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 |
|---|---|---|---|---|---|---|---|---|
8de7697b3b8a73e79a73ec34f17ef0fa842cfbb2 | Update setup.py for release. | google/osv.dev,google/osv.dev,google/osv.dev,google/osv.dev,google/osv.dev | lib/setup.py | lib/setup.py | # Copyright 2021 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, ... | # Copyright 2021 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, ... | apache-2.0 | Python |
786cc9b8f793f608098c1da97cb564e7d24b15cd | add IPython.start_ipython | ipython/ipython,ipython/ipython | IPython/__init__.py | IPython/__init__.py | # encoding: utf-8
"""
IPython: tools for interactive and parallel computing in Python.
http://ipython.org
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2011, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# ... | # encoding: utf-8
"""
IPython: tools for interactive and parallel computing in Python.
http://ipython.org
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2011, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# ... | bsd-3-clause | Python |
14276843ce67d53a4f9600914872368bc29b145b | Fix bug where log_quantities in _CustomAction was a list | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | hoomd/custom_action.py | hoomd/custom_action.py | from abc import ABC, abstractmethod
from hoomd.parameterdicts import ParameterDict
class _CustomAction(ABC):
flags = []
log_quantities = {}
def __init__(self):
pass
def attach(self, simulation):
self._state = simulation.state
def detach(self):
if hasattr(self, '_state'):... | from abc import ABC, abstractmethod
from hoomd.parameterdicts import ParameterDict
class _CustomAction(ABC):
flags = []
log_quantities = []
def __init__(self):
pass
def attach(self, simulation):
self._state = simulation.state
def detach(self):
if hasattr(self, '_state'):... | bsd-3-clause | Python |
8622a5e0734c3f5ef1538362971824218fb8aa19 | add target module | vitareinforce/flask-bluemix,vitareinforce/flask-bluemix | welcome.py | welcome.py | # Copyright 2015 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | # Copyright 2015 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | apache-2.0 | Python |
8ff90c8f55ff8cfd772b664a6271453e47c1fd78 | bump version | corbinfanning/mustaine,bgilmore/mustaine,cyrusmg/python-hessian,cyrusmg/python-hessian,heqingpan/mustaine,cyrusmg/python-hessian | mustaine/__init__.py | mustaine/__init__.py | # Copyright (c) 2010, Brandon Gilmore
# Copyright (c) 2010, Phill Tornroth
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
#... | # Copyright (c) 2010, Brandon Gilmore
# Copyright (c) 2010, Phill Tornroth
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
#... | bsd-3-clause | Python |
621224db245a705b12f4345e70c8e242e3336969 | Add timestamp in spam index | webkom/holonet,webkom/holonet,webkom/holonet | holonet/core/message.py | holonet/core/message.py | # -*- coding: utf8 -*-
from io import BytesIO
import time
from django.utils import timezone
class HolonetEmailMessage(object):
encoding = None
def __init__(self, msg, list_recipients, connection=None):
self.msg = msg
self.list_recipients = list_recipients
self.connection = connecti... | # -*- coding: utf8 -*-
from io import BytesIO
class HolonetEmailMessage(object):
encoding = None
def __init__(self, msg, list_recipients, connection=None):
self.msg = msg
self.list_recipients = list_recipients
self.connection = connection
super(HolonetEmailMessage, self).__i... | mit | Python |
783784f31eca55c223929acb0a9c8106c8ac9d46 | duplicate code - change the sample function to a somewhat more whimsical example. more serious stuff can be seen in 'real' functions. | hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub,hsr-ba-fs15-dat/opendatahub | src/main/python/plugins/odhql_function.tmpl.py | src/main/python/plugins/odhql_function.tmpl.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Example function for ODHQL. Copy this file and use a valid Python module name (e.g. my_function.py).
Your function will then be automatically loaded and made available within the ODH Query Language Interpreter.
See hub.odhql.function package for more ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Example CONCAT function used in ODHQL. Copy this file and use a valid Python module name (e.g. my_function.py).
Your function will then be automatically loaded and made available within the ODH Query Language Interpreter.
See hub.odhql.function packag... | mit | Python |
9187979699a0f49ec5fc1659e9e2f87c97699a74 | Remove unused import | tsurumeso/waifu2x-chainer,tsurumeso/waifu2x-chainer | lib/utils.py | lib/utils.py | from __future__ import print_function
import os
import random
import numpy as np
class Namespace(object):
def __init__(self, kwargs):
self.kwargs = kwargs
for key in kwargs.keys():
setattr(self, key, kwargs[key])
def __repr__(self):
str = []
for key in self.kwarg... | from __future__ import print_function
import os
import random
import chainer
import numpy as np
class Namespace(object):
def __init__(self, kwargs):
self.kwargs = kwargs
for key in kwargs.keys():
setattr(self, key, kwargs[key])
def __repr__(self):
str = []
for ke... | mit | Python |
ad8eaacd2e022cb904834bb6ae1faa38618c5cbf | Add events to csv output | aguinane/nem-reader | nemreader/outputs.py | nemreader/outputs.py | """
nemreader.outputs
~~~~~
Output results in different formats
"""
import csv
from nemreader import read_nem_file
def output_as_csv(file_name, nmi=None, output_file=None):
"""
Transpose all channels and output a csv that is easier
to read and do charting on
:param file_name: The NEM fil... | """
nemreader.outputs
~~~~~
Output results in different formats
"""
import csv
from nemreader import read_nem_file
def output_as_csv(file_name, nmi=None, output_file=None):
"""
Transpose all channels and output a csv that is easier
to read and do charting on
:param file_name: The NEM fil... | mit | Python |
a789e8bf574973259c0461b99fb9a486abed6e23 | Fix a bug that would add updated control ip address instead of replace | jcshen007/cloudstack,resmo/cloudstack,resmo/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,jcshen007/cloudstack,jcshen007/cloudstack,jcshen007/cloudstack,GabrielBrascher/cloudstack,resmo/cloudstack,GabrielBrascher/cloudstack,GabrielBrascher/cloudstack,wido/cloudstack,resmo/cloudstack,DaanHoogland/cloudstack,Gab... | systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py | systemvm/patches/debian/config/opt/cloud/bin/cs_ip.py | from pprint import pprint
from netaddr import *
def merge(dbag, ip):
added = False
for dev in dbag:
if dev == "id":
continue
for address in dbag[dev]:
if address['public_ip'] == ip['public_ip']:
dbag[dev].remove(address)
if ip['add']:
ipo = IPNet... | from pprint import pprint
from netaddr import *
def merge(dbag, ip):
added = False
for dev in dbag:
if dev == "id":
continue
for address in dbag[dev]:
if address['public_ip'] == ip['public_ip']:
dbag[dev].remove(address)
if ip['add']:
ipo = IPNet... | apache-2.0 | Python |
67ebe8da58384529c49673e2314d4fc228aebe9e | Fix test data for PyPackageRequirementsInspectionTest.testImportsNotInRequirementsTxt. | apixandru/intellij-community,da1z/intellij-community,mglukhikh/intellij-community,allotria/intellij-community,ibinti/intellij-community,suncycheng/intellij-community,apixandru/intellij-community,da1z/intellij-community,ibinti/intellij-community,vvv1559/intellij-community,ibinti/intellij-community,ThiagoGarciaAlves/inte... | python/testData/inspections/PyPackageRequirementsInspection/ImportsNotInRequirementsTxt/test1.py | python/testData/inspections/PyPackageRequirementsInspection/ImportsNotInRequirementsTxt/test1.py | import pip
import <weak_warning descr="Package containing module 'opster' is not listed in project requirements">opster</weak_warning>
from <weak_warning descr="Package containing module 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert
import <weak_warning descr="Package contai... | import pip
import <weak_warning descr="Package 'opster' is not listed in project requirements">opster</weak_warning>
from <weak_warning descr="Package 'clevercss' is not listed in project requirements">clevercss</weak_warning> import convert
import <weak_warning descr="Package 'django' is not listed in project requirem... | apache-2.0 | Python |
ed91a6832d459dffa18d1b2d7b827b6aa6da2627 | Add team project list to docs | BuildingLink/sentry,JamesMura/sentry,mvaled/sentry,beeftornado/sentry,JamesMura/sentry,ngonzalvez/sentry,Kryz/sentry,fuziontech/sentry,nicholasserra/sentry,TedaLIEz/sentry,JackDanger/sentry,songyi199111/sentry,BayanGroup/sentry,songyi199111/sentry,1tush/sentry,kevinlondon/sentry,gg7/sentry,jokey2k/sentry,Natim/sentry,v... | src/sentry/api/endpoints/team_project_index.py | src/sentry/api/endpoints/team_project_index.py | from __future__ import absolute_import
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.team import TeamEndpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializers import serialize
from sent... | from __future__ import absolute_import
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.bases.team import TeamEndpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializers import serialize
from sentry.constants import MEMBER_ADMIN
from s... | bsd-3-clause | Python |
f5668fec4423179eac8bd996b0ae906af66c5563 | Remove arg. | Julian/Great,Julian/Great,Julian/Great | great/cli.py | great/cli.py | import argparse
from great import extract
from great.models.core import db
from great.app import create_app
def main(arguments):
app = create_app()
if arguments.command == "itunes":
tracks = extract.itunes_tracks(arguments.library_file)
for track in tracks:
db.session.add(extract... | import argparse
from great import extract
from great.models.core import db
from great.app import create_app
def main(arguments):
app = create_app(arguments.db_uri)
if arguments.command == "itunes":
tracks = extract.itunes_tracks(arguments.library_file)
for track in tracks:
db.ses... | mit | Python |
eac175e8650078ee17d7520725f2fe9604b30dac | Adjust frame rate if needed | voc/voctomix,voc/voctomix | voctocore/lib/sources/loopsource.py | voctocore/lib/sources/loopsource.py | #!/usr/bin/env python3
import logging
import re
from gi.repository import Gst
from lib.config import Config
from lib.sources.avsource import AVSource
class LoopSource(AVSource):
timer_resolution = 0.5
def __init__(self, name, has_audio=True, has_video=True,
force_num_streams=None):
... | #!/usr/bin/env python3
import logging
import re
from gi.repository import Gst
from lib.config import Config
from lib.sources.avsource import AVSource
class LoopSource(AVSource):
timer_resolution = 0.5
def __init__(self, name, has_audio=True, has_video=True,
force_num_streams=None):
... | mit | Python |
c194d9b2244f3c9779442d71605a5c9f17ad763b | FIX make brat.utils compatible with python 3 (and 2.6+) | HazyResearch/snorkel,HazyResearch/snorkel,HazyResearch/snorkel | snorkel/contrib/brat/utils.py | snorkel/contrib/brat/utils.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from six.moves.urllib.request import urlopen
from six.moves.urllib.error import URLError, HTTPError
def download(url, outfname):
"""
Downl... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from urllib2 import urlopen, URLError, HTTPError
def download(url, outfname):
"""
Download target URL
:param url:
:param outfname... | apache-2.0 | Python |
9aee6d2fa65859811e44fc1410053f27243f5610 | Edit to test_logit | datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts | Tests/test_tools.py | Tests/test_tools.py | """This is the test suite for Tools."""
import unittest
import os
from Datasnakes.Tools import LogIt, Multiprocess
class TestTools(unittest.TestCase):
"""Test the Tools module."""
def setUp(self, logfile='test.log'):
self.logfile = logfile
def test_logit(self):
logit = LogIt()
... | """This is the test suite for Tools."""
import unittest
import os
from Datasnakes.Tools import LogIt, Multiprocess
class TestTools(unittest.TestCase):
"""Test the Tools module."""
def setUp(self, logfile='test.log'):
self.logfile = logfile
def test_logit(self):
logit = LogIt()
... | mit | Python |
5baae6dded891bc12c5676078fedd4ee222ae016 | fix tests and add some more | ministryofjustice/courtfinder-govuk-publisher-test,ministryofjustice/courtfinder-govuk-publisher-test | scripts/test.py | scripts/test.py | #!/usr/bin/env python
import requests
import json
import sys
base_url='http://127.0.0.1:8000/court/'
oauth_token='foobar'
#with open('../data/sample_court.json') as f:
# sample_court_json = f.read()
sample_court_json_1 = '{"name":"blah","slug":"blah","updated_at": "2014-03-18T12:33:12.176Z","closed":false,"alert... | #!/usr/bin/env python
import requests
import json
base_url='http://127.0.0.1:8000/court/'
court_file='../data/sample_court.json'
oauth_token='foobar'
with open('../data/sample_court.json') as f:
sample_court_json = f.read()
headers = {'Authorization': 'Bearer '+oauth_token}
def is_in(small, big):
s = json.... | mit | Python |
c39b0aa2314d354d85735e9ef024443e58088133 | add docstrings | sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana,sequana/sequana | sequana/kmer.py | sequana/kmer.py | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
# Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>,
# <d.desvillechabrol@gmail.com>
#
# Distributed u... | # -*- coding: utf-8 -*-
#
# This file is part of Sequana software
#
# Copyright (c) 2016 - Sequana Development Team
#
# File author(s):
# Thomas Cokelaer <thomas.cokelaer@pasteur.fr>
# Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>,
# <d.desvillechabrol@gmail.com>
#
# Distributed u... | bsd-3-clause | Python |
9b330d37243036f95d5a07c40fd8e49c009c7554 | change target function for TIM algorithm | simp1eton/CS224W_Final_Project,simp1eton/CS224W_Final_Project,simp1eton/CS224W_Final_Project | PYTHON/tim.py | PYTHON/tim.py | from util import read_file
import random
def generate_set(adj_list, threshold, start):
queue = [(start, 0)]
visited = set()
visited.add(start)
while len(queue) > 0:
front = queue.pop(0)
if front[1] > threshold:
return visited
for adj in adj_list[front[0]]:
... | from util import read_file
import random
def generate_set(adj_list, threshold, start):
queue = [(start, 0)]
visited = set()
visited.add(start)
while len(queue) > 0:
front = queue.pop(0)
if front[1] > threshold:
return visited
for adj in adj_list[front[0]]:
... | mit | Python |
a8aa8ca27e5690ed6a58a15490e605af57b5f32b | Undo change to SO name | jdmcbr/Shapely,mindw/shapely,jdmcbr/Shapely,mouadino/Shapely,abali96/Shapely,mindw/shapely,abali96/Shapely,mouadino/Shapely | shapely/geos.py | shapely/geos.py | """
Exports the libgeos_c shared lib, GEOS-specific exceptions, and utilities.
"""
import atexit
from ctypes import cdll, CDLL, CFUNCTYPE, c_char_p
from ctypes.util import find_library
import os
import sys
import shapely
if sys.platform == 'win32':
try:
local_dlls = os.path.abspath(os.__file__ + "../../.... | """
Exports the libgeos_c shared lib, GEOS-specific exceptions, and utilities.
"""
import atexit
from ctypes import cdll, CDLL, CFUNCTYPE, c_char_p
from ctypes.util import find_library
import os
import sys
import shapely
if sys.platform == 'win32':
try:
local_dlls = os.path.abspath(os.__file__ + "../../.... | bsd-3-clause | Python |
38917c4a3cb3c120cbe26b35bd5483d99c5392ba | support matrix conversion syntax for r_ and c_ | simupy/simupy | simupy/array.py | simupy/array.py | from sympy.tensor.array import Array
from sympy import ImmutableDenseMatrix as Matrix
from numpy.lib.index_tricks import RClass, CClass, AxisConcatenator
class SymAxisConcatenatorMixin:
"""
A mix-in to convert numpy AxisConcatenator classes to use with sympy N-D
arrays.
"""
# support numpy >= 1.1... | from sympy.tensor.array import Array
from numpy.lib.index_tricks import RClass, CClass
class SymAxisConcatenatorMixin:
"""
A mix-in to convert numpy AxisConcatenator classes to use with sympy N-D
arrays.
"""
def __getitem__(self, key):
return Array(super().__getitem__(tuple(
k ... | bsd-2-clause | Python |
2db6df175c82be21a243e80893f04bab6b754d87 | Create the logging directory | stevenburgess/zfs-tests,datto/zfs-tests | TestConfig.py | TestConfig.py | import os
import sys
import subprocess
import Configs
import ZfsApi
# This class will quickly test if your machine is properly configured for
# these perf tests.
# TODO check that zfs is installed, perhaps get version
def check_all():
permissions_check()
check_filesystems()
def permissions_check():
# Che... | import os
import sys
import subprocess
import Configs
import ZfsApi
# This class will quickly test if your machine is properly configured for
# these perf tests.
# TODO check that zfs is installed, perhaps get version
def check_all():
permissions_check()
check_filesystems()
def permissions_check():
# Che... | mit | Python |
33894846ce841497eb17aca2973d0f58de94d748 | Bump version to Development 0.3 | fulfilio/nereid-cms,priyankarani/nereid-cms,tarunbhardwaj/nereid-cms | __tryton__.py | __tryton__.py | #This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
{
'name': 'Nereid CMS',
'version': '2.0.0.3',
'author': '''Open Labs Business Solutions,
Openlabs Technologies & Consulting (P) Ltd.''',
'email': 'info@o... | #This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
{
'name': 'Nereid CMS',
'version': '2.0.0.2',
'author': '''Open Labs Business Solutions,
Openlabs Technologies & Consulting (P) Ltd.''',
'email': 'info@o... | bsd-3-clause | Python |
56b8e94f651ee6204d62323716d3272ab747d087 | remove package-mimicking syntax | TheChymera/LabbookDB,TheChymera/LabbookDB | labbookdb/report/selection.py | labbookdb/report/selection.py | from .db import query
def data_selection(db_path, data_type, treatment_start_dates=[]):
"""Select dataframe from a LabbookDB style database.
Parameters
----------
db_path : string
Path to a LabbookDB formatted database.
data_type : string
What type of data should be selected values can be:
"sucrose prefere... | if not __package__:
import os, sys
print(os.path.realpath(__file__))
pkg_root = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)),"../.."))
sys.path.insert(0,pkg_root)
from labbookdb.db import query
def data_selection(db_path, data_type, treatment_start_dates=[]):
"""Select dataframe from a... | bsd-3-clause | Python |
a9533109d48214ad4dcf3048e175aa16e89731f5 | Increase version to 0.3.2 | ccampbell/storm | storm/__init__.py | storm/__init__.py | version = '0.3.2'
| version = '0.3.1'
| mit | Python |
9d0d6a9c895876f28ec719ea54feb614b408bf5c | Test project: fix import of djmercadopago urls | data-tsunami/django-mercadopago,data-tsunami/django-mercadopago | test_project/test_project/urls.py | test_project/test_project/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
url(r'^$', 'test_app.views.home', name='home'),
url(r'^mp/', include('djmercadopago.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| from django.conf.urls import patterns, include, url
from django.contrib import admin
import djmercadopago
urlpatterns = patterns('',
url(r'^$', 'test_app.views.home', name='home'),
url(r'^mp/', include(djmercadopago.urls)),
url(r'^admin/', include(admin.site.urls)),
)
| bsd-3-clause | Python |
d3998e64c837f87ad574964b4325335172ca8c5d | add a create and delete view for newsletter subscription models | byteweaver/django-newsletters | newsletters/views.py | newsletters/views.py | from django.views.generic import CreateView, DeleteView
from newsletters.models import Subscription
from newsletters.forms import SubscriptionForm
class SubscriptionCreateView(CreateView):
form_class = SubscriptionForm
class SubscriptionDeleteView(DeleteView):
model = Subscription
| from django.shortcuts import render
# Create your views here.
| bsd-3-clause | Python |
c70678cafb9f6d2bb1db2c64513de5e9853d58e0 | check uuid_generate | hwaf/hwaf,hwaf/hwaf | find_uuid.py | find_uuid.py | # -*- python -*-
# stdlib imports ---
import os
import os.path as osp
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
from waflib.Configure import conf
#
_heptooldir = osp.dirname(osp.abspath(__file__))
def options(ctx):
ctx.load('hep-waftools-base', tooldir=_heptooldir)
ctx.add_option(
... | # -*- python -*-
# stdlib imports ---
import os
import os.path as osp
# waf imports ---
import waflib.Utils
import waflib.Logs as msg
from waflib.Configure import conf
#
_heptooldir = osp.dirname(osp.abspath(__file__))
def options(ctx):
ctx.load('hep-waftools-base', tooldir=_heptooldir)
return
def configur... | bsd-3-clause | Python |
fbe72e14b9d53570614538b59e5d9128d0a3832d | Add a catchall dialplan entry when matching users. | Eyepea/aiosip,sangoma/aiosip | aiosip/dialplan.py | aiosip/dialplan.py | import logging
from . import utils
from collections import MutableMapping
LOG = logging.getLogger(__name__)
class Dialplan:
def __init__(self, default=None):
self._users = {}
self.default = default
async def resolve(self, username, protocol, local_addr, remote_addr):
LOG.debug('Res... | import logging
from . import utils
from collections import MutableMapping
LOG = logging.getLogger(__name__)
class Dialplan:
def __init__(self, default=None):
self._users = {}
self.default = default
async def resolve(self, username, protocol, local_addr, remote_addr):
LOG.debug('Res... | apache-2.0 | Python |
11e23916b47cf8b9c35f32ad379e66336cf53f8b | Change from double to single quotes | imuchnik/cfgov-refresh,imuchnik/cfgov-refresh,imuchnik/cfgov-refresh,imuchnik/cfgov-refresh | _lib/wordpress_view_processor.py | _lib/wordpress_view_processor.py | import sys
import json
import os.path
from string import Template
from wordpress_post_processor import process_post
import requests
import dateutil.parser
def posts_at_url(url):
url = os.path.expandvars(url)
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requ... | import sys
import json
import os.path
from string import Template
from wordpress_post_processor import process_post
import requests
import dateutil.parser
def posts_at_url(url):
url = os.path.expandvars(url)
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requ... | cc0-1.0 | Python |
8f9a466dee5cd9bcd794e95f3d6cc22103dc4fb7 | Add incubating specifier to version | sdiazb/airflow,edgarRd/incubator-airflow,jfantom/incubator-airflow,mrkm4ntr/incubator-airflow,alexvanboxel/airflow,jfantom/incubator-airflow,AllisonWang/incubator-airflow,zoyahav/incubator-airflow,artwr/airflow,edgarRd/incubator-airflow,NielsZeilemaker/incubator-airflow,andrewmchen/incubator-airflow,rishibarve/incubato... | airflow/version.py | airflow/version.py | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 | Python |
cabc82eb1b371bb9c732907e19cd64ef7eaf9956 | remove unused and invalid import | eEcoLiDAR/eEcoLiDAR | laserchicken/test_read_las.py | laserchicken/test_read_las.py | import os
import shutil
import unittest
import numpy as np
import pytest
from laserchicken.read_las import read
class TestReadWriteLas(unittest.TestCase):
_test_dir = 'TestLoad_dir'
_test_file_name = '5points.las'
_test_data_source = 'testdata'
test_file_path = os.path.join(_test_dir, _test_file_nam... | import os
import shutil
import unittest
import pytest
import numpy as np
from laserchicken.read_las import read
from laserchicken.write_las import write
from laserchicken.test_utils import generate_test_point_cloud
class TestReadWriteLas(unittest.TestCase):
_test_dir = 'TestLoad_dir'
_test_file_name = '5poi... | apache-2.0 | Python |
b04f3bd19b508140b0b4feee46d590b61da46bed | Switch Swift trunk to 1.4.1, now that the 1.4.0 release branch is branched out. | mja054/swift_plugin,iostackproject/IO-Bandwidth-Differentiation,williamthegrey/swift,openstack/swift,notmyname/swift,matthewoliver/swift,orion/swift-config,thiagodasilva/swift,zackmdavis/swift,smerritt/swift,bkolli/swift,Em-Pan/swift,Khushbu27/Tutorial,openstack/swift,larsbutler/swift,aerwin3/swift,redhat-openstack/swi... | swift/__init__.py | swift/__init__.py | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | import gettext
class Version(object):
def __init__(self, canonical_version, final):
self.canonical_version = canonical_version
self.final = final
@property
def pretty_version(self):
if self.final:
return self.canonical_version
else:
return '%s-dev' ... | apache-2.0 | Python |
aa9a7e1d794967e9fec91711772d03cb6042b277 | Improve documentation of the 'constants' module | IATI/iati.core,IATI/iati.core | iati/core/constants.py | iati/core/constants.py | """A module containing constants required throughout IATI library code.
The contents of this file are not designed to be user-editable. Only edit if you know what you are doing!
Warning:
This contents of this module should currently be deemed private.
Todo:
Allow logging constants to be user-definable.
"""
... | """A module containing constants required throughout IATI library code.
The contents of this file are not designed to be user-editable. Only edit if you know what you are doing!
Warning:
This contents of this module should currently be deemed private.
Todo:
Allow logging constants to be user-definable.
"""
... | mit | Python |
6ef01afcc9e27a16d20dea5b516462a0a1261265 | bump version number | bashu/wagtail-metadata-mixin,bashu/wagtail-metadata-mixin | wagtailmetadata/__init__.py | wagtailmetadata/__init__.py | __version__ = "0.0.2"
| __version__ = "0.0.1"
| mit | Python |
e9b422c74382d88787114796e7e4b6dfd2b25225 | Correct path to frontend views | disqus/codebox,disqus/codebox | codesharer/app.py | codesharer/app.py | from flask import Flask
from flaskext.redis import Redis
def create_app():
from codesharer.apps.snippets.views import frontend
app = Flask(__name__)
app.config.from_object('codesharer.conf.Config')
app.register_module(frontend)
db = Redis(app)
db.init_app(app)
app.db = db
retur... | from flask import Flask
from flaskext.redis import Redis
def create_app():
from codesharer.apps.classifier.views import frontend
app = Flask(__name__)
app.config.from_object('codesharer.conf.Config')
app.register_module(frontend)
db = Redis(app)
db.init_app(app)
app.db = db
ret... | apache-2.0 | Python |
90ec1e2c521e82b1c6fc6ba9e14983a0294261b5 | bump version to 3.0.0dev | altair-viz/altair,jakevdp/altair | altair/__init__.py | altair/__init__.py | # flake8: noqa
__version__ = '3.0.0dev0'
from .vegalite import *
from . import examples
def load_ipython_extension(ipython):
from ._magics import vega, vegalite
ipython.register_magic_function(vega, 'cell')
ipython.register_magic_function(vegalite, 'cell')
| # flake8: noqa
__version__ = '2.5.0dev0'
from .vegalite import *
from . import examples
def load_ipython_extension(ipython):
from ._magics import vega, vegalite
ipython.register_magic_function(vega, 'cell')
ipython.register_magic_function(vegalite, 'cell')
| bsd-3-clause | Python |
b9f43757b4d6bd63d15b75f5a40f26fb56904ba7 | Fix fields import | N-litened/amocrm_api,Krukov/amocrm_api | amocrm/__init__.py | amocrm/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import sys
import logging
from .settings import settings as amo_settings
from .api import *
from .apimodels import *
from . import fields
__all__ = [
'BaseCompany', 'BaseContact', 'BaseLead', 'amo_settings', 'AmoApi', 'ContactNote',... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import sys
import logging
from .settings import settings as amo_settings
from .api import *
from .apimodels import *
__all__ = [
'BaseCompany', 'BaseContact', 'BaseLead', 'amo_settings', 'AmoApi', 'ContactNote', 'ContactTask',
'... | mit | Python |
df02879c51c4f87514e376e3a2a0f7db7a75a285 | Improve configuration schema for Geniushub integration (#23155) | fbradyirl/home-assistant,GenericStudent/home-assistant,rohitranjan1991/home-assistant,adrienbrault/home-assistant,tboyce021/home-assistant,aronsky/home-assistant,kennedyshead/home-assistant,nkgilley/home-assistant,turbokongen/home-assistant,qedi-r/home-assistant,aequitas/home-assistant,Danielhiversen/home-assistant,mKe... | homeassistant/components/geniushub/__init__.py | homeassistant/components/geniushub/__init__.py | """This module connects to a Genius hub and shares the data."""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_client... | """This module connects to the Genius hub and shares the data."""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
fr... | apache-2.0 | Python |
c382b43b5e5c442d9d3c6bc6af398b829e07f1b5 | Fix chunk | muddyfish/PYKE,muddyfish/PYKE | node/floor_divide.py | node/floor_divide.py | #!/usr/bin/env python
from nodes import Node
import math
class FloorDiv(Node):
char = "f"
args = 2
results = 1
@Node.test_func([3,2], [1])
@Node.test_func([6,-3], [-2])
def func(self, a:Node.number,b:Node.number):
"""a/b. Rounds down, returns an int."""
return a//b
... | #!/usr/bin/env python
from nodes import Node
class FloorDiv(Node):
char = "f"
args = 2
results = 1
@Node.test_func([3,2], [1])
@Node.test_func([6,-3], [-2])
def func(self, a:Node.number,b:Node.number):
"""a/b. Rounds down, returns an int."""
return a//b
@Node.test... | mit | Python |
f0962f53e517cb24fdab5253ae60ee7fd7be0cfe | Remove unnecessry print in tests | AtteqCom/zsl,AtteqCom/zsl | tests/interface/cli/exec_task_from_cli_test.py | tests/interface/cli/exec_task_from_cli_test.py | from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
from unittest.case import TestCase
from click.testing import CliRunner
from zsl import inject
from zsl.application.containers.core_container import CoreContainer
from zsl.application.modules.cli_module import Zs... | from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import *
from unittest.case import TestCase
from click.testing import CliRunner
from zsl import inject
from zsl.application.containers.core_container import CoreContainer
from zsl.application.modules.cli_module import Zs... | mit | Python |
a8a0dd55a5289825aae34aa45765ea328811523e | Exclude Fast test for Python 2 | bees4ever/spotpy,bees4ever/spotpy,thouska/spotpy,thouska/spotpy,bees4ever/spotpy,thouska/spotpy | spotpy/unittests/test_fast.py | spotpy/unittests/test_fast.py | import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy.examples.spot_setup_hymod_python import spot_setup
# Test only untder Python 3 as Python >2.7.10 results in a strange fft error
if sys.version_info >= (3, 5):
class TestFast(unittest... | import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
from spotpy.examples.spot_setup_hymod_python import spot_setup
class TestFast(unittest.TestCase):
def setUp(self):
self.spot_setup = spot_setup()
self.rep = 200 # REP must be a... | mit | Python |
f3e6a8099c7eb8104371a936fba05804e0e76572 | Fix hostnames with a dash getting rejected | maphy-psd/python-webuntis,untitaker/python-webuntis | webuntis/utils/userinput.py | webuntis/utils/userinput.py | '''
This file is part of python-webuntis
:copyright: (c) 2013 by Markus Unterwaditzer.
:license: BSD, see LICENSE for more details.
'''
import re
from .logger import log
from .third_party import urlparse
def server(url):
if not re.match(r'^http(s?)\:\/\/', url): # if we just have the hostname
... | '''
This file is part of python-webuntis
:copyright: (c) 2013 by Markus Unterwaditzer.
:license: BSD, see LICENSE for more details.
'''
import re
from .logger import log
from .third_party import urlparse
def server(url):
if not re.match(r'^http(s?)\:\/\/', url): # if we just have the hostname
... | bsd-3-clause | Python |
e1855bb410275c6ba5b0f04934ea21c615de38dc | fix for last commit | MeirKriheli/Open-Knesset,OriHoch/Open-Knesset,daonb/Open-Knesset,Shrulik/Open-Knesset,habeanf/Open-Knesset,Shrulik/Open-Knesset,OriHoch/Open-Knesset,daonb/Open-Knesset,navotsil/Open-Knesset,otadmor/Open-Knesset,habeanf/Open-Knesset,DanaOshri/Open-Knesset,OriHoch/Open-Knesset,ofri/Open-Knesset,noamelf/Open-Knesset,MeirK... | committees/api.py | committees/api.py | '''
Api for the committees app
'''
from tastypie.api import Api
from tastypie.constants import ALL
from tastypie.bundle import Bundle
import tastypie.fields as fields
from apis.resources.base import BaseResource
from models import Committee, CommitteeMeeting, ProtocolPart
from mks.api import MemberResource
class Com... | '''
Api for the committees app
'''
from tastypie.api import Api
from tastypie.constants import ALL
from tastypie.bundle import Bundle
import tastypie.fields as fields
from apis.resources.base import BaseResource
from models import Committee, CommitteeMeeting, ProtocolPart
from mks.api import MemberResource
class Com... | bsd-3-clause | Python |
e736482bec7be7871bd4edd270f8c064961c20fc | Update minimum support boto version. | gjtempleton/moto,botify-labs/moto,dbfr3qs/moto,botify-labs/moto,heddle317/moto,braintreeps/moto,spulec/moto,rocky4570/moto,ZuluPro/moto,kennethd/moto,okomestudio/moto,Affirm/moto,alexdebrie/moto,Brett55/moto,riccardomc/moto,2mf/moto,heddle317/moto,rocky4570/moto,dbfr3qs/moto,botify-labs/moto,dbfr3qs/moto,2rs2ts/moto,js... | setup.py | setup.py | #!/usr/bin/env python
from __future__ import unicode_literals
from setuptools import setup, find_packages
install_requires = [
"Jinja2",
"boto>=2.20.0",
"flask",
"httpretty>=0.6.1",
"requests",
"xmltodict",
"six",
"werkzeug",
]
import sys
if sys.version_info < (2, 7):
# No buildin... | #!/usr/bin/env python
from __future__ import unicode_literals
from setuptools import setup, find_packages
install_requires = [
"Jinja2",
"boto",
"flask",
"httpretty>=0.6.1",
"requests",
"xmltodict",
"six",
"werkzeug",
]
import sys
if sys.version_info < (2, 7):
# No buildint Ordere... | apache-2.0 | Python |
6d0240fbb329e649210578e7c194a79e1f495267 | copy unprocessed files to key folders | DreadfulDeveloper/src-helpers,DreadfulDeveloper/src-helpers,DreadfulDeveloper/src-helpers | koda/main.py | koda/main.py | import os
import sys
from glob import glob
from mutagen.easyid3 import EasyID3
import shutil
CAMELOT_FOLDERS = ["1A - 1B", "2A - 2B", "3A - 3B", "4A - 4B", "5A - 5B", "6A - 6B", "7A - 7B", "8A - 8B", "9A - 9B", "10A - 10B", "11A - 11B", "12A - 12B"]
def createOutputDirs():
outputdir = "processed"
workdir = os... | import os
import sys
from mutagen.easyid3 import EasyID3
def listDirectory(directory):
"get list of file info objects for files of particular extensions"
workdir = os.path.join(os.path.dirname(os.path.realpath(__file__)), directory)
fileList = [os.path.normcase(f) for f in os.listdir(workdir)]
return ... | mit | Python |
ba83df5099879576db2f074cb2b046bbad3a482c | fix identation issue after auto format | GabiGrin/SublimeInsertTsReference,GabiGrin/SublimeInsertTsReference | insert_ts_reference.py | insert_ts_reference.py | import sublime, sublime_plugin, os.path
class InsertTsReferenceCommand(sublime_plugin.TextCommand):
def run(self, edit):
comment_template = '/// <reference path="$PATH$" />'
view = self.view
references_file_name = sublime.load_settings('InsertTsReference').get('references_file_name', 'references.ts... | import sublime, sublime_plugin, os.path
class InsertTsReferenceCommand(sublime_plugin.TextCommand):
def run(self, edit):
comment_template = '/// <reference path="$PATH$" />'
view = self.view
references_file_name = sublime.load_settings('InsertTsReference').get('references_file_name', 'references.ts');
... | mit | Python |
a6a74ceadf855bdb47fd4962f955af73017c7e26 | Add docstring for writers API | boltzj/movies-in-sf | app/api/writers.py | app/api/writers.py | # Core
from app.api import api
from flask import json, abort
from flask.ext.cors import cross_origin
from urllib import parse
# Models
from app.models.writer import Writer
@cross_origin()
@api.route('/writers', methods=['GET'])
def get_writer_names():
"""
Return all writer names existing in the database
:... | # Core
from app.api import api
from flask import json, abort
from flask.ext.cors import cross_origin
from urllib import parse
# Models
from app.models.writer import Writer
@cross_origin()
@api.route('/writers', methods=['GET'])
def get_writers_names():
"""
:return: Return a list of all writers names
"""
... | mit | Python |
522b197500bffb748dc2daf3bf0ea448b3094af7 | Add another missing heroku config variable | paulocheque/guides-cms,pluralsight/guides-cms,paulocheque/guides-cms,pluralsight/guides-cms,pluralsight/guides-cms,paulocheque/guides-cms | example_config.py | example_config.py | """
File to easily switch between configurations between production and
development, etc.
"""
import os
# You must set each of these in your heroku environment with the heroku
# config:set command. See README.md for more information.
HEROKU_ENV_REQUIREMENTS = ('HEROKU', 'SECRET_KEY', 'GITHUB_CLIENT_ID',
... | """
File to easily switch between configurations between production and
development, etc.
"""
import os
# You must set each of these in your heroku environment with the heroku
# config:set command. See README.md for more information.
HEROKU_ENV_REQUIREMENTS = ('HEROKU', 'SECRET_KEY', 'GITHUB_CLIENT_ID',
... | agpl-3.0 | Python |
52841517a575ba7df354b809cb23bc2851c9fcd4 | Remove carriage returns from the output | jdgwartney/boundary-plugin-shell,boundary/boundary-plugin-shell,boundary/boundary-plugin-shell,jdgwartney/boundary-plugin-shell | exec_proc.py | exec_proc.py | #!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... | #!/usr/bin/env python
# Copyright 2014 Boundary, 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 o... | apache-2.0 | Python |
cb31b795a816acd3b52952649a3fd628bd70ae10 | Update runner | kiyomaro927/stdbt | source/build.py | source/build.py | #!/usr/bin/env python
from utils import stream
from utils import preprocessor
from utils import vader
from utils import select
from utils import sort
class DBBuilder:
def __init__(self, config_path):
self.stream_api = stream.StreamAPI(config_path)
self.tweet_stream = self.stream_api.stream()
... | #!/usr/bin/env python
| mit | Python |
21fad559f02c3eee41de736636cefc97027184dc | Fix type hint for display_name in common | andrewlin16/duckbot,andrewlin16/duckbot | app/common.py | app/common.py | import random
from discord.ext.commands import Context
rand = random.SystemRandom()
def display_name(ctx: Context) -> str:
return ctx.message.author.nick or ctx.message.author.name
| import random
import string
from discord.ext.commands import Context
rand = random.SystemRandom()
def display_name(ctx: Context) -> string:
return ctx.message.author.nick or ctx.message.author.name
| mit | Python |
f6f6ff80a1ac052eb327d8d6dd237c288ad30b1d | Tag v0.2.0 | macbre/index-digest,macbre/index-digest | indexdigest/__init__.py | indexdigest/__init__.py | """
index_digest Python module
"""
VERSION = '0.2.0'
| """
index_digest Python module
"""
VERSION = '0.1.0'
| mit | Python |
a0cfa7b79b97f02d90f23dd612e57491765ab1cf | Fix #386 (too many file handlers) | matthiask/south,matthiask/south | south/logger.py | south/logger.py | import sys
import logging
from django.conf import settings
# Create a dummy handler to use for now.
class NullHandler(logging.Handler):
def emit(self, record):
pass
_logger = logging.getLogger("south")
_logger.addHandler(NullHandler())
_logger.setLevel(logging.DEBUG)
def get_logger():
"Attach a file ... | import sys
import logging
from django.conf import settings
class NullHandler(logging.Handler):
def emit(self, record):
pass
h = NullHandler()
_logger = logging.getLogger("south")
_logger.addHandler(h)
_logger.setLevel(logging.DEBUG)
# TODO: Add a log formatter?
def get_logger():
debug_on = getattr(s... | apache-2.0 | Python |
69fc5b4608ea6da566dac7aba87312fe9c27c717 | Update saliency_interpreter.py (#4286) | allenai/allennlp,allenai/allennlp,allenai/allennlp,allenai/allennlp | allennlp/interpret/saliency_interpreters/saliency_interpreter.py | allennlp/interpret/saliency_interpreters/saliency_interpreter.py | from allennlp.common import Registrable
from allennlp.common.util import JsonDict
from allennlp.predictors import Predictor
class SaliencyInterpreter(Registrable):
"""
A `SaliencyInterpreter` interprets an AllenNLP Predictor's outputs by assigning a saliency
score to each input token.
"""
def __i... | from allennlp.common import Registrable
from allennlp.common.util import JsonDict
from allennlp.predictors import Predictor
class SaliencyInterpreter(Registrable):
"""
A `SaliencyInterpreter` interprets an AllenNLP Predictor's outputs by assigning a saliency
score to each input token.
"""
def __i... | apache-2.0 | Python |
5ab0c1c1323b2b12a19ef58de4c03236db84644d | Remove old views and replace with new PasswordResetConfirmView | haematologic/cellcounter,haematologic/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,cellcounter/cellcounter,haematologic/cellcounter,cellcounter/cellcounter | cellcounter/accounts/urls.py | cellcounter/accounts/urls.py | from django.conf.urls import patterns, url
from cellcounter.accounts import views
urlpatterns = patterns('',
url('^new/$', views.RegistrationView.as_view(), name='register'),
url('^(?P<pk>[0-9]+)/$', views.UserDetailView.as_view(), name='user-detail'),
url('^(?P<pk>[0-9]+)/delete/$', views.UserDeleteView.... | from django.conf.urls import patterns, url
from cellcounter.accounts import views
urlpatterns = patterns('',
url('^new/$', views.RegistrationView.as_view(), name='register'),
url('^(?P<pk>[0-9]+)/$', views.UserDetailView.as_view(), name='user-detail'),
url('^(?P<pk>[0-9]+)/delete/$', views.UserDeleteView.... | mit | Python |
d913afd26ca817efe6b0630f9d5fdb49a0cc4284 | Update utils.py | praekelt/molo-gem,praekelt/molo-gem,praekelt/molo-gem | gem/utils.py | gem/utils.py | from django.utils.http import urlencode
from django.conf import settings
def provider_logout_url(request):
"""
This function is used to construct a logout URL that can be used to
log the user out of
the Identity Provider (Authentication Service).
:param request:
:return:
"""
site = re... | from django.utils.http import urlencode
from django.conf import settings
def provider_logout_url(request):
"""
This function is used to construct a logout URL that can be used to
log the user out of
the Identity Provider (Authentication Service).
:param request:
:return:
"""
site = re... | bsd-2-clause | Python |
f0acf5023db56e8011a6872f230514a69ec9f311 | Use new MainApplication Tk class. | adambiser/snes-wolf3d-extractor | extractor.py | extractor.py | import extractor.ui.mainapplication as ui
import Tkinter as tk
def main():
## root = tk.Tk()
## root.title('SNES Wolfenstein 3D Extractor')
## root.minsize(400, 100)
## ui.MainApplication(root).pack(side="top", fill="both", expand=True)
## root.mainloop()
ui.MainApplication().mainloop()
main()
| import extractor.ui.mainapplication as ui
import Tkinter as tk
def main():
root = tk.Tk()
root.title('SNES Wolfenstein 3D Extractor')
root.minsize(400, 100)
ui.MainApplication(root).pack(side="top", fill="both", expand=True)
root.mainloop()
main()
| mit | Python |
cc7cd9accce7aa53f1bff9416c341a01f615dd35 | Remove CSV from supported formats | jqnatividad/ckanext-officedocs,jqnatividad/ckanext-officedocs,jqnatividad/ckanext-officedocs | ckanext/officedocs/plugin.py | ckanext/officedocs/plugin.py | import ckan.lib.helpers as h
import ckan.plugins as p
import ckan.plugins.toolkit as tk
from six.moves.urllib.parse import quote_plus
class OfficeDocsPlugin(p.SingletonPlugin):
p.implements(p.IConfigurer)
p.implements(p.IResourceView)
def update_config(self, config_):
tk.add_template_directory(c... | import ckan.lib.helpers as h
import ckan.plugins as p
import ckan.plugins.toolkit as tk
from six.moves.urllib.parse import quote_plus
class OfficeDocsPlugin(p.SingletonPlugin):
p.implements(p.IConfigurer)
p.implements(p.IResourceView)
def update_config(self, config_):
tk.add_template_directory(c... | agpl-3.0 | Python |
aed4c22faff1f4b2db13c6717ca8fe97db9448ac | Fix spec_version generation | ensonic/ev3dev-lang-python-1,rhempel/ev3dev-lang-python,ensonic/ev3dev-lang-python,dwalton76/ev3dev-lang-python,ddemidov/ev3dev-lang-python-1,dwalton76/ev3dev-lang-python | spec_version.py | spec_version.py | #~autogen spec_version
spec_version = "spec: 0.9.3-pre-r2, kernel: v3.16.7-ckt16-7-ev3dev-ev3"
#~autogen
| #~autogen ../python/templates/python_spec_version
spec_version = "spec: 0.9.3-pre-r1, kernel: v3.16.7-ckt10-4-ev3dev-ev3"
#~autogen
| mit | Python |
fde18f54087dcf79b8a1ff0c36cc6214ce366386 | Update P04_updateProduce fixed AttributeError by changing depreciated method | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/AutomateTheBoringStuffWithPython/Chapter12/P04_updateProduce.py | books/AutomateTheBoringStuffWithPython/Chapter12/P04_updateProduce.py | #! python3
# P04_updateProduce.py - Corrects costs in produce sales spreadsheet.
#
# Note:
# - The produceSales.xlsx workbook can be downloaded from
# https://nostarch.com/automatestuff/
import openpyxl
wb = openpyxl.load_workbook("produceSales.xlsx")
sheet = wb.get_sheet_by_name("Sheet")
# The produce types and t... | #! python3
# P04_updateProduce.py - Corrects costs in produce sales spreadsheet.
#
# Note:
# - The produceSales.xlsx workbook can be downloaded from
# https://nostarch.com/automatestuff/
import openpyxl
wb = openpyxl.load_workbook("produceSales.xlsx")
sheet = wb.get_sheet_by_name("Sheet")
# The produce types and t... | mit | Python |
4f6640ad2c33f0db3f2c6d40aa9a07d28710bda6 | fix channel name | openhumanoids/oh-distro,openhumanoids/oh-distro,openhumanoids/oh-distro,openhumanoids/oh-distro,openhumanoids/oh-distro,openhumanoids/oh-distro,openhumanoids/oh-distro,openhumanoids/oh-distro | software/control/fall_detect_demo/fall_detector.py | software/control/fall_detect_demo/fall_detector.py | from __future__ import division
import lcm
import os
import sys
sys.path.append(os.path.expanduser('~/drc/software/build/lib/python2.7/dist-packages'))
import drc
m = lcm.LCM()
class FallDetector:
def __init__(self):
self.decay_rate = 0.2
self.zmp_error = 0
self.last_t = None
def hand... | from __future__ import division
import lcm
import os
import sys
sys.path.append(os.path.expanduser('~/drc/software/build/lib/python2.7/dist-packages'))
import drc
m = lcm.LCM()
class FallDetector:
def __init__(self):
self.decay_rate = 0.2
self.zmp_error = 0
self.last_t = None
def hand... | bsd-3-clause | Python |
31071fb6ca4e894dc42aefe7218c722f4f0c0e26 | Update file. | satnet-project/propagators,satnet-project/propagators,satnet-project/propagators,satnet-project/propagators,satnet-project/propagators | get_names.py | get_names.py |
class Get_names:
def __init__(self):
import os
import sys
directorio_actual = os.getcwd()
print directorio_actual
from time import sleep
sleep(5)
os.chdir(directorio_actual + '/TLEs')
print os.getcwd()
sleep(5)
print sys.argv[1]
sleep(5)
abrir_tle = open(sys.argv[1], 'r')
lista... |
class Get_names:
def __init__(self):
import os
import sys
directorio_actual = os.getcwd()
print directorio_actual
from time import sleep
sleep(5)
os.chdir(directorio_actual + '/TLEs')
print os.getcwd()
sleep(5)
print sys.argv[1]
sleep(5)
abrir_tle = open(sys.argv[1], 'r')
lista... | apache-2.0 | Python |
98ee4e6a25bf82ac32c2f89f17278993a14bcfba | create / drop LDAP in tests | UGentPortaal/django-ldapdb-archived,UGentPortaal/django-ldapdb,crito/django-ldapdb,chronossc/django-ldapdb,crito/django-ldapdb | examples/tests.py | examples/tests.py | # -*- coding: utf-8 -*-
#
# django-ldapdb
# Copyright (C) 2009-2010 Bolloré telecom
# See AUTHORS file for a full list of contributors.
#
# This program 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... | # -*- coding: utf-8 -*-
#
# django-ldapdb
# Copyright (C) 2009-2010 Bolloré telecom
# See AUTHORS file for a full list of contributors.
#
# This program 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... | bsd-3-clause | Python |
5e53f1e86fc7c4f1c7b42479684ac393c997ce52 | Fix exit code of unittest. | qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv | client/test/test-unrealcv.py | client/test/test-unrealcv.py | # TODO: Test robustness, test speed
import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realist... | # TODO: Test robustness, test speed
import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realist... | mit | Python |
8aca952c1c1e2668df58a0844896267f7e69b8f6 | remove assert | rmariano/compr,rmariano/compr | compressor/cli.py | compressor/cli.py | """
Compressor CLI (command-line interface) module.
Exposes the entry point to the program for executing as command line.
"""
import argparse
import sys
from compressor.constants import VERSION
from compressor.lib import compress_file, extract_file
def argument_parser() -> argparse.ArgumentParser:
"""Create the ... | """
Compressor CLI (command-line interface) module.
Exposes the entry point to the program for executing as command line.
"""
import argparse
import sys
from compressor.constants import VERSION
from compressor.lib import compress_file, extract_file
def argument_parser() -> argparse.ArgumentParser:
"""Create the ... | mit | Python |
75b8f0ec2a1f3c6468153180c70eabc4ecff642a | fix flake8 | juju4/ansible-bro-ids,juju4/ansible-bro-ids,juju4/ansible-bro-ids | files/api.py | files/api.py | #!/usr/bin/python
# from http://nullsecure.org/building-your-own-passivedns-feed/
import requests
import json
import sys
indicator = sys.argv[1]
url = "http://localhost:8081/dns/"
r = requests.get(url+indicator)
j = json.loads(r.text)
print("+------------------------+------------------------+--------+-------+-----... | #!/usr/bin/python
## from http://nullsecure.org/building-your-own-passivedns-feed/
import requests
import json
import sys
indicator = sys.argv[1]
url = "http://localhost:8081/dns/"
r = requests.get(url+indicator)
j = json.loads(r.text)
print "+------------------------+------------------------+--------+------... | bsd-2-clause | Python |
e4caa80cc6b6ee2b9c031a7d743d61b4830f2a7e | put typing_extensions.get_types() behind python version guard | gitpython-developers/gitpython,gitpython-developers/GitPython,gitpython-developers/GitPython,gitpython-developers/gitpython | git/types.py | git/types.py | # -*- coding: utf-8 -*-
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
import sys
from typing import (Callable, Dict, NoReturn, Tuple, Union, Any, Iterator, # noqa: F401
NamedTuple, TYPE_CHECKING, TypeVa... | # -*- coding: utf-8 -*-
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os
import sys
from typing import (Callable, Dict, NoReturn, Tuple, Union, Any, Iterator, # noqa: F401
NamedTuple, TYPE_CHECKING, get_ar... | bsd-3-clause | Python |
cb28aa3a0272bdcd2db94d2d25468458420a544a | Revise to bool is_carry | bowen0701/algorithms_data_structures | lc0066_plus_one.py | lc0066_plus_one.py | """Leetcode 66. Plus One
Easy
URL: https://leetcode.com/problems/plus-one/
Given a non-empty array of digits representing a non-negative integer,
plus one to the integer.
The digits are stored such that the most significant digit is at the
head of the list, and each element in the array contain a single digit.
Yo... | """Leetcode 66. Plus One
Easy
URL: https://leetcode.com/problems/plus-one/
Given a non-empty array of digits representing a non-negative integer,
plus one to the integer.
The digits are stored such that the most significant digit is at the
head of the list, and each element in the array contain a single digit.
Yo... | bsd-2-clause | Python |
4b1c356a27adc68e62d801986e67ef60336685db | add and configure infernal dependency (#14502) | LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/trnascan-se/package.py | var/spack/repos/builtin/packages/trnascan-se/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class TrnascanSe(AutotoolsPackage):
"""Seaching for tRNA genes in genomic sequence"""
homep... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class TrnascanSe(AutotoolsPackage):
"""Seaching for tRNA genes in genomic sequence"""
homep... | lgpl-2.1 | Python |
3a26c641d1c3988123babbeb56b978b449fa6c98 | Update pipeline.py | pkug/intelmq,robcza/intelmq,certtools/intelmq,certtools/intelmq,sch3m4/intelmq,robcza/intelmq,robcza/intelmq,aaronkaplan/intelmq,aaronkaplan/intelmq,sch3m4/intelmq,robcza/intelmq,sch3m4/intelmq,pkug/intelmq,certtools/intelmq,pkug/intelmq,aaronkaplan/intelmq,pkug/intelmq,sch3m4/intelmq | intelmq/lib/pipeline.py | intelmq/lib/pipeline.py | import redis
import time
class Pipeline():
def __init__(self, host="127.0.0.1", port="6379", db=2):
self.host = host
self.port = port
self.db = db
self.redis = redis.Redis(
host = self.host,
port = int(self.port),
... | import redis
import time
class Pipeline():
def __init__(self, host="127.0.0.1", port="6379", db=2):
self.host = host
self.port = port
self.db = db
self.redis = redis.Redis(
host = self.host,
port = int(self.port),
... | agpl-3.0 | Python |
227be653c21a703d8ed0864d23573c25dd3859ce | bump repo version | omry/omegaconf | omegaconf/version.py | omegaconf/version.py | import sys # pragma: no cover
__version__ = "2.0.0rc19"
msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer.
You have the following options:
1. Upgrade to Python 3.6 or newer.
This is highly recommended. new features will not be added to OmegaConf 1.4.
2. Continue using OmegaConf 1.4:
You... | import sys # pragma: no cover
__version__ = "2.0.0rc18"
msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer.
You have the following options:
1. Upgrade to Python 3.6 or newer.
This is highly recommended. new features will not be added to OmegaConf 1.4.
2. Continue using OmegaConf 1.4:
You... | bsd-3-clause | Python |
ce9da309294f2520f297980d80773160f050e8bf | Add __all__ in exceptions module. | Kami/python-yubico-client | yubico/yubico_exceptions.py | yubico/yubico_exceptions.py | __all___ = [
'YubicoError',
'StatusCodeError',
'InvalidClientIdError',
'SignatureVerificationError'
]
class YubicoError(Exception):
""" Base class for Yubico related exceptions. """
pass
class StatusCodeError(YubicoError):
def __init__(self, status_code):
self.status_code = statu... | class YubicoError(Exception):
""" Base class for Yubico related exceptions. """
pass
class StatusCodeError(YubicoError):
def __init__(self, status_code):
self.status_code = status_code
def __str__(self):
return ('Yubico server returned the following status code: %s' %
... | bsd-3-clause | Python |
b20320301eb311bb1345061a8b74ac63495051b1 | Add trailing slash to /docs/api/ url pattern. This provides more flexibility for end users in that they can choose to navigate to /docs/api or /docs/api/ successfully. Without the trailing slash in the url pattern, /docs/api/ returns a 404. | juanique/django-tastydocs,juanique/django-tastydocs,juanique/django-tastydocs,juanique/django-tastydocs | tastydocs/urls.py | tastydocs/urls.py | from django.conf.urls.defaults import patterns
from views import doc
urlpatterns = patterns(
'',
(r'^api/$', doc),
(r'^example/(?P<resource_name>\w+)/', 'tastydocs.views.example_data'),
)
| from django.conf.urls.defaults import patterns
from views import doc
urlpatterns = patterns(
'',
(r'^api$', doc),
(r'^example/(?P<resource_name>\w+)/', 'tastydocs.views.example_data'),
)
| bsd-3-clause | Python |
6f5df9830482e8b9ffcf810dcc14131d349c219e | update api config | apipanda/openssl,apipanda/openssl,apipanda/openssl,apipanda/openssl | apps/api/config.py | apps/api/config.py | from __future__ import unicode_literals
from django.apps import AppConfig
class AppConfig(AppConfig):
name = 'api'
verbose_name = 'Api Application'
def ready(self):
from .signals import create_api_key
| from __future__ import unicode_literals
from django.apps import AppConfig
class AppConfig(AppConfig):
name = 'app'
verbose_name = 'Api Application'
def ready(self):
from .signals import create_api_key
| mit | Python |
4c94da43060f0c5a3dd59102c1499bc9c947a9d9 | Update mail_mail.py | eicher31/compassion-modules,maxime-beck/compassion-modules,ecino/compassion-modules,eicher31/compassion-modules,emgirardin/compassion-modules,emgirardin/compassion-modules,emgirardin/compassion-modules,eicher31/compassion-modules,ecino/compassion-modules,maxime-beck/compassion-modules,ecino/compassion-modules,maxime-be... | mail_sendgrid_mass_mailing/models/mail_mail.py | mail_sendgrid_mass_mailing/models/mail_mail.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __openerp__.p... | agpl-3.0 | Python |
682f45ffd222dc582ee770a0326c962540657c68 | Fix an error in __unicode__ | rdegges/django-twilio,aditweb/django-twilio | django_twilio/models.py | django_twilio/models.py | # -*- coding: utf-8 -*-
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
class Caller(models.Model):
"""A caller is defined uniquely by their phone number.
:param bool blacklisted: Designates whether the caller can use our
services.
:param char phone_number... | # -*- coding: utf-8 -*-
from django.db import models
from phonenumber_field.modelfields import PhoneNumberField
class Caller(models.Model):
"""A caller is defined uniquely by their phone number.
:param bool blacklisted: Designates whether the caller can use our
services.
:param char phone_number... | unlicense | Python |
0534a96d7872ec13b14d084c62454c4cdfa711ed | fix breakage ("TypeError: cannot use a string pattern on a bytes-like object") | mmetak/streamlink,gravyboat/streamlink,bastimeyer/streamlink,melmorabity/streamlink,bastimeyer/streamlink,melmorabity/streamlink,beardypig/streamlink,gravyboat/streamlink,sbstp/streamlink,mmetak/streamlink,beardypig/streamlink,fishscene/streamlink,javiercantero/streamlink,streamlink/streamlink,fishscene/streamlink,back... | src/livestreamer/plugins/livecodingtv.py | src/livestreamer/plugins/livecodingtv.py | import re
from livestreamer.plugin import Plugin
from livestreamer.stream import RTMPStream, HTTPStream
from livestreamer.plugin.api import http
_vod_re = re.compile('\"(http(s)?://.*\.mp4\?t=.*)\"')
_rtmp_re = re.compile('rtmp://[^"]+/(?P<channel>\w+)+[^/"]+')
_url_re = re.compile('http(s)?://(?:\w+.)?\livecoding\.t... | import re
from livestreamer.plugin import Plugin
from livestreamer.stream import RTMPStream, HTTPStream
from livestreamer.plugin.api import http
_vod_re = re.compile('\"(http(s)?://.*\.mp4\?t=.*)\"')
_rtmp_re = re.compile('rtmp://[^"]+/(?P<channel>\w+)+[^/"]+')
_url_re = re.compile('http(s)?://(?:\w+.)?\livecoding\.t... | bsd-2-clause | Python |
aadf177df60fa9cf1470732edf8ea9cab6eef79e | Remove commented fixture code | praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control | subscription/tests.py | subscription/tests.py | """
Tests for Subscription Application
"""
from tastypie.test import ResourceTestCase
from django.contrib.auth.models import User
class SubscriptionResourceTest(ResourceTestCase):
def setUp(self):
super(SubscriptionResourceTest, self).setUp()
# Create a user.
self.username = 'testuser'
... | """
Tests for Subscription Application
"""
from tastypie.test import ResourceTestCase
from django.contrib.auth.models import User
class SubscriptionResourceTest(ResourceTestCase):
# fixtures = ['test_subscription.json']
def setUp(self):
super(SubscriptionResourceTest, self).setUp()
# Create... | bsd-3-clause | Python |
07556d5cb011c16bc0d73f2e2dca753481b390a4 | add supplement product and ingredient comp | jeffshek/betterself,jeffshek/betterself,jeffshek/betterself,jeffshek/betterself | supplements/models.py | supplements/models.py | from django.db import models
from betterself.mixins import BaseTimeModel
class Ingredient(BaseTimeModel):
# if some ingredient is longer than 300 characters, prob shouldn't take it.
name = models.CharField(max_length=300)
user_generated = models.BooleanField(default=False)
half_life_minutes = models.... | from django.db import models
from betterself.mixins import BaseTimeModel
class Ingredient(BaseTimeModel):
# if some ingredient is longer than 300 characters, prob shouldn't take it.
name = models.CharField(max_length=300)
user_generated = models.BooleanField(default=False)
half_life_minutes = models.... | mit | Python |
046ffb6edcf660879681926dd9a0b0c5774ef4e8 | Use a new classification instead of input and output | benjello/openfisca-france-indirect-taxation,openfisca/openfisca-france-indirect-taxation,antoinearnoud/openfisca-france-indirect-taxation,thomasdouenne/openfisca-france-indirect-taxation | openfisca_france_indirect_taxation/__init__.py | openfisca_france_indirect_taxation/__init__.py | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | # -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it ... | agpl-3.0 | Python |
082464c30dc34a7b36cd4763c324af55a8ed31e5 | Fix a typo in comment | hashbangstudio/Python-Minecraft-Examples | 03-sendTextFromFileToChat.py | 03-sendTextFromFileToChat.py | # We have to import the minecraft api module to do anything in the minecraft world
from mcpi.minecraft import *
# We have to import sys module to get the command line arguments
import sys
if __name__ == "__main__":
"""
First thing you do is create a connection to minecraft
This is like dialling a phone... | # We have to import the minecraft api module to do anything in the minecraft world
from mcpi.minecraft import *
# We have to import sys module to get the command line arguments
import sys
if __name__ == "__main__":
"""
First thing you do is create a connection to minecraft
This is like dialling a phone... | bsd-3-clause | Python |
e9bf339261636647a2af096d8cf45c2ee6cf202f | use emacs report style | SublimeLinter/SublimeLinter-phpcs | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#
"""This module exports the Phpcs plugin class."""
from SublimeLinter.lint import Linter
class Phpcs(Linter):
"""Provides an interface to phpcs.""... | mit | Python |
50a860a9286e03a3deb6b93161cf351d80d3f2ce | Fix pep257 | sirreal/SublimeLinter-contrib-govet | linter.py | linter.py | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Govet plugin class."""
from SublimeLinter.lint import Linter, util
class Govet(Linter):
"""Provides an interface to go... | #
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jon Surrell
# Copyright (c) 2014 Jon Surrell
#
# License: MIT
#
"""This module exports the Govet plugin class."""
from SublimeLinter.lint import Linter, util
class Govet(Linter):
"""Provides an interface to go... | mit | Python |
0ea00d932ef16aad3cb2fdbacedd30181c786778 | increase timeout of autotest | cladmi/RIOT,miri64/RIOT,ant9000/RIOT,authmillenon/RIOT,OTAkeys/RIOT,josephnoir/RIOT,mtausig/RIOT,kaspar030/RIOT,yogo1212/RIOT,x3ro/RIOT,OTAkeys/RIOT,OlegHahm/RIOT,kYc0o/RIOT,authmillenon/RIOT,ant9000/RIOT,mfrey/RIOT,yogo1212/RIOT,OlegHahm/RIOT,OlegHahm/RIOT,A-Paul/RIOT,mfrey/RIOT,smlng/RIOT,kYc0o/RIOT,authmillenon/RIOT... | tests/pkg_libcose/tests/01-run.py | tests/pkg_libcose/tests/01-run.py | #!/usr/bin/env python3
# Copyright (C) 2017 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
from testrunner import run
# on real hardware, this test... | #!/usr/bin/env python3
# Copyright (C) 2017 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
from testrunner import run
def testfunc(child):
boar... | lgpl-2.1 | Python |
444ce71f2ca92a535270ac34d7201e81de002af5 | fix tests | throwable-one/teamcity-messages | tests/unit-tests/messages_test.py | tests/unit-tests/messages_test.py | from teamcity.messages import TeamcityServiceMessages
from datetime import datetime
class StreamStub(object):
def __init__(self):
self.observed_output = ''
def write(self, msg):
self.observed_output += msg
def flush(self):
pass
fixed_date = datetime(2000, 11, 2, 10, 23, 1, 55678... | from teamcity.messages import TeamcityServiceMessages
from datetime import datetime
class StreamStub(object):
def __init__(self):
self.observed_output = ''
def write(self, msg):
self.observed_output += msg
fixed_date = datetime(2000, 11, 2, 10, 23, 1, 556789)
def test_no_properties():
... | apache-2.0 | Python |
b4e6cdbf7eb8cab80352d6058fe370b386e38928 | remove uuid from test | sk2/autonetkit | tests/webserver/test_webserver.py | tests/webserver/test_webserver.py | import autonetkit
import os
import autonetkit.load.graphml as graphml
import shutil
automated = True # whether to open ksdiff, log to file...
if __name__ == "__main__":
automated = False
dirname, filename = os.path.split(os.path.abspath(__file__))
parent_dir = os.path.abspath(os.path.join(dirname, os.pardir))
an... | import autonetkit
import os
import autonetkit.load.graphml as graphml
import shutil
automated = True # whether to open ksdiff, log to file...
if __name__ == "__main__":
automated = False
dirname, filename = os.path.split(os.path.abspath(__file__))
parent_dir = os.path.abspath(os.path.join(dirname, os.pardir))
an... | bsd-3-clause | Python |
a8e445f24e662d34cf9b76e6e52212bf0dda1d2a | Connect and disconnect every time we need to send aprs data. | elielsardanons/dstar_sniffer,elielsardanons/dstar_sniffer | dstar_sniffer/aprs_lib/aprsis.py | dstar_sniffer/aprs_lib/aprsis.py | import aprslib
import logging
import nmea
from passcode import passcode_generator
def to_aprs_callsign(dstar_callsign):
module = dstar_callsign[-1:]
return dstar_callsign[:-1].strip() + "-" + module
def aprsis_dstar_callback(dstar_stream):
if 'D74' in dstar_stream['sfx'] and '$GPGGA' in dstar_stream['gps']:
# d... | import aprslib
import logging
import nmea
from passcode import passcode_generator
def to_aprs_callsign(dstar_callsign):
module = dstar_callsign[-1:]
return dstar_callsign[:-1].strip() + "-" + module
def aprsis_dstar_callback(dstar_stream):
rpt_callsign = to_aprs_callsign(dstar_stream['rpt1'])
if 'D74' in dstar_s... | mit | Python |
946f8ff1c475ebf6f339c4df5eb5f7069c5633e9 | Fix did not return HttpResponse when comment | vuonghv/brs,vuonghv/brs,vuonghv/brs,vuonghv/brs | apps/core/views.py | apps/core/views.py | from django.views.generic.detail import ContextMixin
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from apps.categories.models import Category
from apps.books.models import Book
class BaseView(ContextMixin):
"""docstring for BaseView"""
model = ... | from django.views.generic.detail import ContextMixin
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from apps.categories.models import Category
from apps.books.models import Book
class BaseView(ContextMixin):
"""docstring for BaseView"""
model = ... | mit | Python |
0d4fda58516d8b52f6ecb67e9dc29d38990e778a | Fix regular expression escaping | ministryofjustice/bai2 | bai2/utils.py | bai2/utils.py | import datetime
import re
from .constants import TypeCodes
def parse_date(value):
"""
YYMMDD Format.
"""
return datetime.datetime.strptime(value, '%y%m%d').date()
def write_date(date):
return date.strftime('%y%m%d')
def parse_time(value):
clock_pattern = re.compile(r'\d\d:\d\d:\d\d')
... | import datetime
import re
from .constants import TypeCodes
def parse_date(value):
"""
YYMMDD Format.
"""
return datetime.datetime.strptime(value, '%y%m%d').date()
def write_date(date):
return date.strftime('%y%m%d')
def parse_time(value):
clock_pattern = re.compile('\d\d:\d\d:\d\d')
... | mit | Python |
214f0e17e0bf6701f5a78c92e1a6583d729da709 | Cut 0.16 | pyinvoke/invocations | invocations/_version.py | invocations/_version.py | __version_info__ = (0, 16, 0)
__version__ = '.'.join(map(str, __version_info__))
| __version_info__ = (0, 15, 0)
__version__ = '.'.join(map(str, __version_info__))
| bsd-2-clause | Python |
646a25054b670d1e71199ad8c32b81b9db186404 | Fix snapshot search | globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service | dbaas/backup/admin/snapshot.py | dbaas/backup/admin/snapshot.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.conf.urls import url
from django.contrib import admin
from django.http import HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
from backup.tasks import make_databases_backup
from system.... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import logging
from django.conf.urls import url
from django.contrib import admin
from django.http import HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
from backup.tasks import make_databases_backup
from system.... | bsd-3-clause | Python |
0848439552f40ca55bf06e3c01f77d557cb90c9b | make M5_PATH a real search path | andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin,andrewfu0325/gem5-aladdin | configs/common/SysPaths.py | configs/common/SysPaths.py | # Copyright (c) 2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | # Copyright (c) 2006 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause | Python |
004cfe5528749209ff0763d2e5859a83ae4e05fe | fix encoding autodetection | alihalabyah/grab,giserh/grab,SpaceAppsXploration/grab,kevinlondon/grab,alihalabyah/grab,istinspring/grab,subeax/grab,pombredanne/grab-1,shaunstanislaus/grab,raybuhr/grab,subeax/grab,lorien/grab,pombredanne/grab-1,huiyi1990/grab,maurobaraldi/grab,SpaceAppsXploration/grab,shaunstanislaus/grab,huiyi1990/grab,maurobaraldi/... | grab/html.py | grab/html.py | # -*- coding: utf-8 -*-
import re
from htmlentitydefs import name2codepoint
import logging
def decode_entities(text):
"""
Convert HTML entities to their unicode analogs.
"""
re_entity = re.compile(r'(&[a-z]+;)')
re_num_entity = re.compile(r'(&#\d+;)')
def process_entity(match):
entity... | # -*- coding: utf-8 -*-
import re
from htmlentitydefs import name2codepoint
import logging
def decode_entities(text):
"""
Convert HTML entities to their unicode analogs.
"""
re_entity = re.compile(r'(&[a-z]+;)')
re_num_entity = re.compile(r'(&#\d+;)')
def process_entity(match):
entity... | mit | Python |
56567351793a433ed7d3ea8853e523289fa64615 | Use simple function instead of Module for filtering muons | tamasgal/km3pipe,tamasgal/km3pipe | examples/plot_dom_hits.py | examples/plot_dom_hits.py | """
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from km3modules impor... | """
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from km3modules impor... | mit | Python |
07eb518143f72d1b14d8f6c1aef74688e383a229 | Remove invalid escaped newline | nickgzzjr/powerpool,simplecrypto/powerpool,sigwo/powerpool,nickgzzjr/powerpool,cinnamoncoin/powerpool,cinnamoncoin/powerpool,simplecrypto/powerpool,sigwo/powerpool | contrib/deploy.py | contrib/deploy.py | #!/usr/bin/env python
import argparse
import os
import subprocess
parser = argparse.ArgumentParser(prog='simplecoin RPC')
parser.add_argument('-l', '--log-level',
choices=['DEBUG', 'INFO', 'WARN', 'ERROR'])
subparsers = parser.add_subparsers(title='main subcommands', dest='action')
subparsers.add_... | #!/usr/bin/env python
import argparse
import os
import subprocess
parser = argparse.ArgumentParser(prog='simplecoin RPC')
parser.add_argument('-l', '--log-level',
choices=['DEBUG', 'INFO', 'WARN', 'ERROR'])
subparsers = parser.add_subparsers(title='main subcommands', dest='action')
subparsers.add_... | bsd-2-clause | Python |
4779a4aa84012d0326a4bfd896d0ad503407f5f9 | update initial migration with non-deprecated IP field (#3) | GeoNode/geonode-dialogos | dialogos/migrations/0001_initial.py | dialogos/migrations/0001_initial.py | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program 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 ... | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program 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 ... | bsd-3-clause | Python |
4a782f94e8fe5a26e2998408c2cb013f2aebe9ac | Remove reference to old, bad migration that was in my local tree. | jayoshih/content-curation,jayoshih/content-curation,jayoshih/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,fle-internal/content-curation,jayoshih/content-curation,DXCanas/content-curation,DXCanas/content-curat... | contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py | contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0089_auto_20180706_2242'),
]
... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0090_auto_20180724_1625'),
]
... | mit | Python |
1e06d42ed92d6aac0ab3311d5cc5845d5860dca2 | fix showing user in admin | praekelt/jmbo-your-words,praekelt/jmbo-your-words | jmboyourwords/admin.py | jmboyourwords/admin.py | from django.contrib import admin
from jmboyourwords.models import YourStoryCompetition, YourStoryEntry
from ckeditor.widgets import CKEditorWidget
from django.db import models
class YourStoryCompetitionAdmin(admin.ModelAdmin):
list_filter = ('created', 'publish_on', 'retract_on')
list_display = ('title', 'pub... | from django.contrib import admin
from jmboyourwords.models import YourStoryCompetition, YourStoryEntry
from ckeditor.widgets import CKEditorWidget
from django.db import models
class YourStoryCompetitionAdmin(admin.ModelAdmin):
list_filter = ('created', 'publish_on', 'retract_on')
list_display = ('title', 'pub... | bsd-3-clause | Python |
69a8528801ae5c3fdde57b9766917fcf8690c54e | Fix args manipulation in when translating ksdefs | Metaswitch/Telephus,driftx/Telephus,ClearwaterCore/Telephus,driftx/Telephus,Metaswitch/Telephus,ClearwaterCore/Telephus | telephus/translate.py | telephus/translate.py | class APIMismatch(Exception):
pass
def translateArgs(request, api_version):
args = request.args
if request.method == 'system_add_keyspace' \
or request.method == 'system_update_keyspace':
adapted_ksdef = adapt_ksdef_rf(args[0])
args = (adapted_ksdef,) + args[1:]
return args
def pos... | class APIMismatch(Exception):
pass
def translateArgs(request, api_version):
args = request.args
if request.method == 'system_add_keyspace' \
or request.method == 'system_update_keyspace':
args = adapt_ksdef_rf(args[0]) + args[1:]
return args
def postProcess(results, method):
if method ... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.