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 |
|---|---|---|---|---|---|---|---|---|
c1b3949edb943cc21a63c34d6a01ed59e9b6536d | Disable logs from chardet | Ritiek/Spotify-Downloader | spotdl/command_line/__main__.py | spotdl/command_line/__main__.py | import logging
import coloredlogs
import sys
from spotdl.command_line.core import Spotdl
from spotdl.command_line.arguments import get_arguments
from spotdl.command_line.exceptions import ArgumentError
# hardcode loglevel for dependencies so that they do not spew generic
# log messages along with spotdl.
for module ... | import logging
import coloredlogs
import sys
from spotdl.command_line.core import Spotdl
from spotdl.command_line.arguments import get_arguments
from spotdl.command_line.exceptions import ArgumentError
# hardcode loglevel for dependencies so that they do not spew generic
# log messages along with spotdl.
for module ... | mit | Python |
ad5ea7d37876daf3c5c54c85cc623041453d9125 | Add missing return 0 in callback | tmetsch/python-dtrace,tmetsch/python-dtrace | tests/dtrace_ctypes_test.py | tests/dtrace_ctypes_test.py | """
Unittest for ctypes based consumer.
"""
__author__ = 'tmetsch'
from dtrace_ctypes import consumer
from ctypes import c_char_p
import unittest
SCRIPT = 'dtrace:::BEGIN {trace("Hello World");}'
class TestDTraceConsumer(unittest.TestCase):
"""
Tests ctypes based DTrace consumer.
"""
def setUp(s... | """
Unittest for ctypes based consumer.
"""
__author__ = 'tmetsch'
from dtrace_ctypes import consumer
from ctypes import c_char_p
import unittest
SCRIPT = 'dtrace:::BEGIN {trace("Hello World");}'
class TestDTraceConsumer(unittest.TestCase):
"""
Tests ctypes based DTrace consumer.
"""
def setUp(s... | mit | Python |
071d4c0abbc98591cf72f20ff78b0afa84aeb223 | Use store_size fixture in test_roundtrip_2 | python-lz4/python-lz4,python-lz4/python-lz4 | tests/frame/test_frame_1.py | tests/frame/test_frame_1.py | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
def test_roundtrip_1(data, block_s... | import lz4.frame as lz4frame
import pytest
def test_create_compression_context():
context = lz4frame.create_compression_context()
assert context != None
def test_create_decompression_context():
context = lz4frame.create_decompression_context()
assert context != None
def test_roundtrip_1(data, block_s... | bsd-3-clause | Python |
6a1f7d551edf3760ae32e9a8ebdf3ebb9e122df1 | Bump the version to a major change | gmr/pamqp | pamqp/__init__.py | pamqp/__init__.py | """AMQP Specifications and Classes"""
__author__ = 'Gavin M. Roy'
__email__ = 'gavinmroy@gmail.com'
__since__ = '2011-09-23'
__version__ = '1.6.0'
import sys
# Keep a constant that indicates if Python 3 support is needed
PYTHON3 = True if sys.version_info > (3, 0, 0) else False
from pamqp.header import ProtocolHeade... | """AMQP Specifications and Classes"""
__author__ = 'Gavin M. Roy'
__email__ = 'gavinmroy@gmail.com'
__since__ = '2011-09-23'
__version__ = '1.5.1'
import sys
# Keep a constant that indicates if Python 3 support is needed
PYTHON3 = True if sys.version_info > (3, 0, 0) else False
from pamqp.header import ProtocolHeade... | bsd-3-clause | Python |
7b56a4c714e4f1ec62b0f6536e70b077ba463052 | Update clock.py | pingo-io/demo-py,pingo-io/demo-py | lcdserial/clock.py | lcdserial/clock.py | import time
from pingo.parts import serial
# '/dev/ttyAMA0' is the mini-UART port on the Raspberry Pi
lcd = serial.LCD16x2('/dev/ttyAMA0')
time.sleep(.5) # wait for display to boot up
while True:
lcd.set_cursor(0, 0)
lcd.write(time.strftime('%H:%M:%S'))
time.sleep(1)
| import time
from pingo.parts import serial
# '/dev/ttyAMA0' is the mini-UART port on the Raspberry Pi
lcd = serial.LCD16x2('/dev/ttyAMA0', 9600)
time.sleep(.5) # wait for display to boot up
while True:
lcd.set_cursor(0, 0)
lcd.write(time.strftime('%H:%M:%S'))
time.sleep(1)
| mit | Python |
e2c35f70f8a41e5e449260d95eec609c66b0b56f | Fix lint error. | jlaine/django-ldapdb,django-ldapdb/django-ldapdb | ldapdb/__init__.py | ldapdb/__init__.py | # -*- coding: utf-8 -*-
# This software is distributed under the two-clause BSD license.
# Copyright (c) The django-ldapdb project
import sys
import ldap.filter
from django.conf import settings
def escape_ldap_filter(value):
if sys.version_info[0] < 3:
text_value = unicode(value) # noqa: F821
else... | # -*- coding: utf-8 -*-
# This software is distributed under the two-clause BSD license.
# Copyright (c) The django-ldapdb project
import sys
import ldap.filter
from django.conf import settings
def escape_ldap_filter(value):
if sys.version_info[0] < 3:
text_value = unicode(value) # noqa: F821
els... | bsd-2-clause | Python |
a4f19853b8f46520de2c83f5d7bfe3f26bbe5d93 | add v3.3.2 (#22787) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/hmmer/package.py | var/spack/repos/builtin/packages/hmmer/package.py | # Copyright 2013-2021 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 Hmmer(Package):
"""HMMER is used for searching sequence databases for sequence homologs,
... | # Copyright 2013-2021 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 Hmmer(Package):
"""HMMER is used for searching sequence databases for sequence homologs,
... | lgpl-2.1 | Python |
e28519887ff85f016a6fd70b24f1dc17455f5647 | Fix name error in setup | Uname-a/knife_scraper,Uname-a/knife_scraper,Uname-a/knife_scraper | willie/modules/bugzilla.py | willie/modules/bugzilla.py | # coding=utf-8
"""
admin.py - Willie Bugzilla Module
Copyright © 2013, Edward Powell, embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net/
"""
from lxml import etree
import re
from willie import web
import urllib
import urllib2
def configure(config):
"""
| [bugzilla] | example |... | # coding=utf-8
"""
admin.py - Willie Bugzilla Module
Copyright © 2013, Edward Powell, embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net/
"""
from lxml import etree
import re
from willie import web
import urllib
import urllib2
def configure(config):
"""
| [bugzilla] | example |... | mit | Python |
9e16902397245cf2dd448710362ac003f2a2711d | Fix name of bpp-suite (missing -...) | tmerrick1/spack,skosukhin/spack,mfherbst/spack,skosukhin/spack,krafczyk/spack,mfherbst/spack,TheTimmy/spack,krafczyk/spack,iulian787/spack,LLNL/spack,mfherbst/spack,TheTimmy/spack,EmreAtes/spack,lgarren/spack,tmerrick1/spack,LLNL/spack,lgarren/spack,EmreAtes/spack,matthiasdiener/spack,skosukhin/spack,tmerrick1/spack,kr... | var/spack/repos/builtin/packages/prank/package.py | var/spack/repos/builtin/packages/prank/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
f0fb182a98ce031f48ccff33cca8d8c4452e95c1 | Fix for windmill being started with strange urls. | windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill,windmill/windmill | windmill/tools/__init__.py | windmill/tools/__init__.py | # Copyright (c) 2006-2007 Open Source Applications Foundation
#
# 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 require... | # Copyright (c) 2006-2007 Open Source Applications Foundation
#
# 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 require... | apache-2.0 | Python |
1f60a17aba92b503f476284346c0b022f0c951ee | adjust elevator example to use exogenous events | fferri/pygolog | tests/indigolog-elevator.py | tests/indigolog-elevator.py | #!/usr/bin/env python3.3
from strips import *
from golog_program import *
from domains.elevator import *
up = lambda: Exec(ElevatorState.up())
down = lambda: Exec(ElevatorState.down())
turn_off = lambda: Exec(ElevatorState.turn_off())
def next_floor_to_serve(fl):
return Test(lambda s: s.light[fl])
def go_floor(... | #!/usr/bin/env python3.3
from strips import *
from golog_program import *
from domains.elevator import *
up = lambda: Exec(ElevatorState.up())
down = lambda: Exec(ElevatorState.down())
turn_off = lambda: Exec(ElevatorState.turn_off())
def next_floor_to_serve(fl):
return Test(lambda s: s.light[fl])
def go_floor(... | bsd-3-clause | Python |
3a18d14dedbf46f98c33b74b3a75ceceb8d464f5 | Create model cash register | mazulo/SGT,mazulo/SGT | sgt/cash_register/models.py | sgt/cash_register/models.py | from django.db import models
class CashRegister(models.Model):
pass
| from django.db import models
# Create your models here.
| mit | Python |
e09ece0a50cacca4710d4e82a67b44151f561b40 | add some low hanging code coverage | stopthatcow/zazu,stopthatcow/zazu | tests/test_code_reviewer.py | tests/test_code_reviewer.py | # -*- coding: utf-8 -*-
import pytest
import zazu.code_reviewer
__author__ = "Nicholas Wiles"
__copyright__ = "Copyright 2017"
def test_code_reviewer():
uut = zazu.code_reviewer.CodeReviewer()
with pytest.raises(NotImplementedError):
uut.connect()
with pytest.raises(NotImplementedError):
... | # -*- coding: utf-8 -*-
import pytest
import zazu.code_reviewer
__author__ = "Nicholas Wiles"
__copyright__ = "Copyright 2017"
def test_code_reviewer():
uut = zazu.code_reviewer.CodeReviewer()
with pytest.raises(NotImplementedError):
uut.connect()
with pytest.raises(NotImplementedError):
... | mit | Python |
662cc280801b57740bc86b34bfb3212813e2ed18 | Fix copypasta | ckane/zooq,ckane/zooq | ztasks/base_zooqdb_task.py | ztasks/base_zooqdb_task.py | #!/usr/bin/env python3
#
# Author: Coleman Kane <ckane@colemankane.org>
# Base class for any modules utilizing the 'samples.sqlite' DB
#
import sqlite3
import os
from subprocess import Popen, DEVNULL, PIPE
from ztasks.ztask_base import ztask_base
class base_zooqdb_task(ztask_base):
def __init__(self, objid, dir):... | #!/usr/bin/env python3
#
# Author: Coleman Kane <ckane@colemankane.org>
# Base class for any modules utilizing the 'samples.sqlite' DB
#
import sqlite3
import os
from subprocess import Popen, DEVNULL, PIPE
from ztasks.ztask_base import ztask_base
class base_zooqdb_task(ztask_base):
def __init__(self, objid, dir):... | mit | Python |
b0c38bc8b848afa69de99ee5e4c15d7a95ed6f50 | Add test for `print_attrs()`. | seblin/shcol | testsuite/test_highlevel.py | testsuite/test_highlevel.py | import unittest
import shcol
from _helpers import CapturedStream
class PrintColumnizedTest(unittest.TestCase):
def _get_result(self, items):
with CapturedStream('stdout') as outstream:
shcol.print_columnized(items)
return outstream.getvalue()
def test_items(self):
... | import unittest
import shcol
from _helpers import CapturedStream
class PrintColumnizedTest(unittest.TestCase):
def _get_result(self, items):
with CapturedStream('stdout') as outstream:
shcol.print_columnized(items)
outstream.seek(0)
return outstream.read()
... | bsd-2-clause | Python |
9b8259821836318fb9b381d5e3c7357e893d9e08 | Make method public | compas-dev/compas | src/compas_ghpython/__init__.py | src/compas_ghpython/__init__.py | """
********************************************************************************
compas_ghpython
********************************************************************************
.. currentmodule:: compas_ghpython
.. toctree::
:maxdepth: 1
compas_ghpython.artists
compas_ghpython.utilities
"""
import ... | """
********************************************************************************
compas_ghpython
********************************************************************************
.. currentmodule:: compas_ghpython
.. toctree::
:maxdepth: 1
compas_ghpython.artists
compas_ghpython.utilities
"""
import ... | mit | Python |
a40991df8ec48324d2e8258e5224a2561d78462a | Complete recur sol (TLE) | bowen0701/algorithms_data_structures | lc0516_longest_palindromic_subsequence.py | lc0516_longest_palindromic_subsequence.py | """Leetcode 516. Longest Palindromic Subsequence
Medium
URL: https://leetcode.com/problems/longest-palindromic-subsequence/
Given a string s, find the longest palindromic subsequence's length in s.
You may assume that the maximum length of s is 1000.
Example 1:
Input:
"bbbab"
Output:
4
One possible longest palindrom... | """Leetcode 516. Longest Palindromic Subsequence
Medium
URL: https://leetcode.com/problems/longest-palindromic-subsequence/
Given a string s, find the longest palindromic subsequence's length in s.
You may assume that the maximum length of s is 1000.
Example 1:
Input:
"bbbab"
Output:
4
One possible longest palindrom... | bsd-2-clause | Python |
218242e6922ce2e2b208822a326f53478f9f8629 | Increase tests for AdditiveGaussian | toslunar/chainerrl,toslunar/chainerrl | tests/explorers_tests/test_additive_gaussian.py | tests/explorers_tests/test_additive_gaussian.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # NOQA
import unittest
from chainer import testing
from chainer.testing import condition
import nu... | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases() # NOQA
import unittest
import numpy as np
from chainerrl.explorers.additive_gaussian import Addit... | mit | Python |
50e4ba751de9b47b5cd12560481eabbf58ae513e | Add filters for dates in works | fernandolobato/balarco,fernandolobato/balarco,fernandolobato/balarco | works/filters.py | works/filters.py | """Filter classes corresponding to each one of the works app's models that has the
same fields as the model for an equalTo filter.
There can be added extra fields inside each class as gt, lt, gte, lte and so on for
convinience.
"""
import django_filters
from . import models as works_models
class WorkTypeFilter(djang... | """Filter classes corresponding to each one of the works app's models that has the
same fields as the model for an equalTo filter.
There can be added extra fields inside each class as gt, lt, gte, lte and so on for
convinience.
"""
import django_filters
from . import models as works_models
class WorkTypeFilter(djang... | mit | Python |
c5cadb94f167e9bd322f97838f957378ca5bfcd3 | Bump version | thombashi/SimpleSQLite,thombashi/SimpleSQLite | simplesqlite/__version__.py | simplesqlite/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.40.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.39.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
8906bc01e3bfd658383168e3d6d394f13120f5df | Bump version | thombashi/SimpleSQLite,thombashi/SimpleSQLite | simplesqlite/__version__.py | simplesqlite/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.42.0"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.41.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
981d9bca9ea19af056f074bede5b45f66adcda6c | bump version, update copyright | wharton/wrds | wrds/__init__.py | wrds/__init__.py | # -*- coding: utf-8 -*-
"""
WRDS Python Data Access Library
==============================
WRDS-Py is a library for extracting data from WRDS data sources and getting it into Pandas.
>>> import wrds
>>> db = wrds.Connection()
>>> db.list_libraries()
['aha', 'aha_sample', 'ahasamp', 'audit', 'audit_au... | # -*- coding: utf-8 -*-
"""
WRDS Python Data Access Library
==============================
WRDS-Py is a library for extracting data from WRDS data sources and getting it into Pandas.
>>> import wrds
>>> db = wrds.Connection()
>>> db.list_libraries()
['aha', 'aha_sample', 'ahasamp', 'audit', 'audit_au... | mit | Python |
f1e92d7762d6c7932ae5a99840c714e90434e724 | test updated | havrlant/fca-search | src/tests/search_test.py | src/tests/search_test.py | import unittest
from retrieval.search_engine import SearchEngine
from other.constants import TEST_FOLDER
from other.data import getStopWords
from common.io import readfile, savefile
from retrieval.index import Index
from subprocess import Popen, PIPE
from json import loads
class SearchTest(unittest.TestCase):
def te... | import unittest
from retrieval.search_engine import SearchEngine
from other.constants import TEST_FOLDER
from other.data import getStopWords
from common.io import readfile, savefile
from retrieval.index import Index
from subprocess import Popen, PIPE
class SearchTest(unittest.TestCase):
def testSearchCommand(self):
... | bsd-2-clause | Python |
8e8e6c5253aaa7b5b131c8a11d3e982e30a1a8de | bump version to 0.15.0 | ivelum/cub-python | cub/version.py | cub/version.py | version = '0.15.0'
| version = '0.14.1'
| mit | Python |
b3ad6a6d77c19d9156a5fd3bc8d8364dcf96868a | Add compliance with rule E261 to hash_reqs.py. | rishig/zulip,brainwane/zulip,andersk/zulip,vabs22/zulip,jrowan/zulip,brockwhittaker/zulip,synicalsyntax/zulip,eeshangarg/zulip,punchagan/zulip,dhcrzf/zulip,dhcrzf/zulip,jrowan/zulip,jackrzhang/zulip,andersk/zulip,timabbott/zulip,Galexrt/zulip,showell/zulip,jackrzhang/zulip,rht/zulip,synicalsyntax/zulip,Galexrt/zulip,ko... | scripts/lib/hash_reqs.py | scripts/lib/hash_reqs.py | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import argparse
import hashlib
if False:
from typing import Iterable, List, MutableSet
def expand_reqs_helper(fpath, visited):
# type: (str, MutableSet[str]) -> List[str]
if fpath in visited:
return []
else:
... | #!/usr/bin/env python
from __future__ import print_function
import os
import sys
import argparse
import hashlib
if False:
from typing import Iterable, List, MutableSet
def expand_reqs_helper(fpath, visited):
# type: (str, MutableSet[str]) -> List[str]
if fpath in visited:
return []
else:
... | apache-2.0 | Python |
ec0099f67d5a0373f5efbd34e546ae04a39ed725 | Add test for null inputs in scalar functions | cpcloud/slumba,cpcloud/slumba | slumba/tests/test_scalar.py | slumba/tests/test_scalar.py | import sqlite3
import random
import pytest
from slumba import create_function, sqlite_udf
from numba import int64, float64, optional
@sqlite_udf(float64(float64))
def add_one(x):
return x + 1.0
@sqlite_udf(optional(float64)(float64))
def add_one_optional(x):
return x + 1.0 if x is not None else None
@sq... | import sqlite3
import pytest
from slumba import create_function, sqlite_udf
from numba import int64, float64, optional
@sqlite_udf(float64(float64))
def add_one(x):
return x + 1.0
@sqlite_udf(optional(float64)(float64))
def add_one_optional(x):
return x + 1.0 if x is not None else None
@sqlite_udf(int64... | apache-2.0 | Python |
23c2efc78479b84d5782e391fae06cd632661dad | fix rc number | tmilliman/python-vegindex | src/vegindex/__init__.py | src/vegindex/__init__.py | # -*- coding: utf-8 -*-
__author__ = """Thomas Milliman"""
__email__ = 'thomas.milliman@unh.edu'
__version__ = '0.3.0rc1'
import os
from . import config
# from roimask import ROIMask
# from roilist import ROIList
# from roitimeseries import ROITimeSeries
# from gcctimeseries import GCCTimeSeries
# from quantile imp... | # -*- coding: utf-8 -*-
__author__ = """Thomas Milliman"""
__email__ = 'thomas.milliman@unh.edu'
__version__ = '0.3.0rc0'
import os
from . import config
# from roimask import ROIMask
# from roilist import ROIList
# from roitimeseries import ROITimeSeries
# from gcctimeseries import GCCTimeSeries
# from quantile imp... | mit | Python |
bc5404bd3720fcf819aa7ea2ce613f504269153c | Fix django-debug-toolbar | studentenportal/web,studentenportal/web,studentenportal/web,studentenportal/web,studentenportal/web | config/urls.py | config/urls.py | from django.conf.urls import include, url
from django.conf import settings
from django.views.generic import TemplateView
from django.views.static import serve
from django.contrib import admin
from apps.front import views
from apps.api import urls as api_urls
from apps.events import urls as event_urls
from apps.documen... | from django.conf.urls import include, url
from django.conf import settings
from django.views.generic import TemplateView
from django.views.static import serve
from django.contrib import admin
from apps.front import views
from apps.api import urls as api_urls
from apps.events import urls as event_urls
from apps.documen... | agpl-3.0 | Python |
2bd0abc3b2ae6a5e207e1cc139d43931239936f4 | Fix start-zcsi script | NetSys/NetBricks,NetSys/e2d2,NetSys/NetBricks,NetSys/NetBricks,apanda/NetBricks,NetSys/e2d2,NetSys/e2d2,NetSys/e2d2,apanda/NetBricks,NetSys/e2d2,NetSys/NetBricks,NetSys/e2d2,apanda/NetBricks,NetSys/e2d2,apanda/NetBricks,apanda/NetBricks,NetSys/NetBricks | scripts/start-zcsi-vm.py | scripts/start-zcsi-vm.py | import subprocess
import sys
import os
import re
# Return a command string to start ZCSI with all DPDK cores and passed in delay
if len(sys.argv) > 1:
delay = sys.argv[1]
else:
delay = "0"
dpdk_home=os.environ["DPDK_HOME"]
zcsi_home=os.environ["ZCSI_HOME"]
status_out = subprocess.check_output([dpdk_home + "/too... | import subprocess
import sys
import os
import re
# Return a command string to start ZCSI with all DPDK cores and passed in delay
if len(sys.argv) > 1:
delay = sys.argv[1]
else:
delay = 0
dpdk_home=os.environ["DPDK_HOME"]
zcsi_home=os.environ["ZCSI_HOME"]
status_out = subprocess.check_output([dpdk_home + "/tools... | isc | Python |
27bd4a5cdd478dd5d05706cbb634d18c4e96cd54 | Add py-h5glance versions 0.5 & 0.6 (#15461) | iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack | var/spack/repos/builtin/packages/py-h5glance/package.py | var/spack/repos/builtin/packages/py-h5glance/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 PyH5glance(PythonPackage):
"""H5Glance lets you explore HDF5 files in the terminal or
... | # 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 PyH5glance(PythonPackage):
"""H5Glance lets you explore HDF5 files in the terminal or
... | lgpl-2.1 | Python |
bbed5e942ee6467d77eb5caafc91564c1ddb354f | add LOCALE_PATHS to test settings (for easier loca generation) | rsalmaso/django-fluo-coupons,rsalmaso/django-fluo-coupons | coupons/tests/settings.py | coupons/tests/settings.py | """Django settings for tests."""
import os
import django
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
INTERNAL_IPS = ['127.0.0.1']
LANGUAGE_CODE = 'en'
LANGUAGES = (
('en', 'English'),... | """Django settings for tests."""
import os
import django
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
INTERNAL_IPS = ['127.0.0.1']
LANGUAGE_CODE = 'en'
LANGUAGES = (
('en', 'English'),... | bsd-3-clause | Python |
53c568a58ea252ca802e4e2cb0e16672d1963ad6 | adjust parsers for stderr output | xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache,xiaoyaozi5566/DynamicCache | parsers/miss_trace.py | parsers/miss_trace.py | #!/ufs/cluster/yao/bin/python
import re, os
import string
import sys
import array
import random
import shutil
from os import walk
def genTrace(input_filename):
print "Parsing " + input_filename
# output filename
output_filename = input_filename.split('.')[0] + ".trc"
# open input file
inputfile = ... | #!/ufs/cluster/yao/bin/python
import re, os
import string
import sys
import array
import random
import shutil
from os import walk
def genTrace(input_filename):
print "Parsing " + input_filename
# output filename
output_filename = input_filename[:-4] + ".trc"
# open input file
inputfile = open(inpu... | bsd-3-clause | Python |
067358321dfa675e297bd9cfe691c7818e0c2d45 | Use full_path util | remind101/stacker,remind101/stacker,mhahn/stacker,mhahn/stacker | stacker/hooks/keypair.py | stacker/hooks/keypair.py | import logging
import os
from boto.ec2 import connect_to_region
from . import utils
logger = logging.getLogger(__name__)
def ensure_keypair_exists(region, namespace, mappings, parameters, **kwargs):
connection = connect_to_region(region)
keypair_name = kwargs.get('keypair', parameters.get('SshKeyName'))
... | import logging
import os
from boto.ec2 import connect_to_region
from . import utils
logger = logging.getLogger(__name__)
def ensure_keypair_exists(region, namespace, mappings, parameters, **kwargs):
connection = connect_to_region(region)
keypair_name = kwargs.get('keypair', parameters.get('SshKeyName'))
... | bsd-2-clause | Python |
8b19dbdecabeaec128c1a94a60c0f626933963b9 | Check that the text of the bug's resolution is present | Uname-a/knife_scraper,Uname-a/knife_scraper,Uname-a/knife_scraper | willie/modules/bugzilla.py | willie/modules/bugzilla.py | # coding=utf-8
"""
admin.py - Willie Bugzilla Module
Copyright © 2013, Edward Powell, embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net/
"""
from lxml import etree
import re
from willie import web
import urllib
import urllib2
def configure(config):
"""
| [bugzilla] | example |... | # coding=utf-8
"""
admin.py - Willie Bugzilla Module
Copyright © 2013, Edward Powell, embolalia.net
Licensed under the Eiffel Forum License 2.
http://willie.dftba.net/
"""
from lxml import etree
import re
from willie import web
import urllib
import urllib2
def configure(config):
"""
| [bugzilla] | example |... | mit | Python |
9538987248d59bf10cef01bd4dd788c1268f0b2e | Send mail in batches of 1000(limit of mailgun) | gkbrk/WatchPeopleCode,paked/WPC-fix,WatchPeopleCode/WatchPeopleCode,eleweek/WatchPeopleCode,WatchPeopleCode/WatchPeopleCode,jniebuhr/WatchPeopleCode,jniebuhr/WatchPeopleCode,WatchPeopleCode/WatchPeopleCode,WatchPeopleCode/WatchPeopleCode,gkbrk/WatchPeopleCode,eleweek/WatchPeopleCode,eleweek/WatchPeopleCode,jniebuhr/Wat... | wpc/email_notifications.py | wpc/email_notifications.py | from wpc import app
from wpc.models import Stream, Subscriber
from flask import render_template
import requests
import json
def send_message(recipient_vars, subject, text, html):
return requests.post(
app.config['MAILGUN_API_URL'],
auth=("api", app.config['MAILGUN_API_KEY']),
data={"from... | from wpc import app
from wpc.models import Stream, Subscriber
from flask import render_template
import requests
import json
def send_message(recipient_vars, subject, text, html):
return requests.post(
app.config['MAILGUN_API_URL'],
auth=("api", app.config['MAILGUN_API_KEY']),
data={"from... | mit | Python |
923ff0a77094feca57400bd30722d476b46873e4 | Fix library variable | chukysoria/spotify-connect-web,chukysoria/spotify-connect-web,chukysoria/spotify-connect-web,chukysoria/spotify-connect-web | connect_ffi.py | connect_ffi.py | import os
from cffi import FFI
ffi = FFI()
library_name = "spotify.processed.h"
library_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), library_name)
#Header generated with cpp spotify.h > spotify.processed.h && sed -i 's/__extension__//g' spotify.processed.h
with open(library_path) as file:
head... | import os
from cffi import FFI
ffi = FFI()
library_name = "spotify.processed.h"
library_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), libraryName)
#Header generated with cpp spotify.h > spotify.processed.h && sed -i 's/__extension__//g' spotify.processed.h
with open(library_path) as file:
heade... | apache-2.0 | Python |
fb7f0f800876c6f511073f064ae9ab32c4f96c15 | make it use nouvelle's nifty ResortableTable stuff to show a list of current players | kongr45gpen/bzflag-import-1,kongr45gpen/bzflag-import-1,kongr45gpen/bzflag-import-1,kongr45gpen/bzflag-import-1,kongr45gpen/bzflag-import-1,kongr45gpen/bzflag-import-1 | plugins/python/test-twisted.py | plugins/python/test-twisted.py | #!/usr/bin/env python
#
# Copyright (C) 2005 David Trowbridge
#
# 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 2
# of the License, or (at your option) any later version.
#
# This... | #!/usr/bin/env python
#
# Copyright (C) 2005 David Trowbridge
#
# 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 2
# of the License, or (at your option) any later version.
#
# This... | lgpl-2.1 | Python |
4741a0575cbe75dcf618e88ef8c3e0e3b2225e66 | Bump version number to 2.0.1 | audreyr/cookiecutter,audreyr/cookiecutter | cookiecutter/__init__.py | cookiecutter/__init__.py | """Main package for Cookiecutter."""
__version__ = "2.0.1"
| """Main package for Cookiecutter."""
__version__ = "2.0.0"
| bsd-3-clause | Python |
839d1824d79404ddb52967e5a0faa9e85d8eef02 | Remove extra blank line | polygraph-python/polygraph | polygraph/utils/strict_dict.py | polygraph/utils/strict_dict.py | class StrictDict(dict):
"""
A dictionary that raises an exception if attempting to associate a known
key with a different value
"""
def __setitem__(self, key, item):
if key in self and self[key] != item:
raise ValueError(
"Attempting to set {} to a different value... | class StrictDict(dict):
"""
A dictionary that raises an exception if attempting to associate a known
key with a different value
"""
def __setitem__(self, key, item):
if key in self and self[key] != item:
raise ValueError(
"Attempting to set {} to a different value... | mit | Python |
b053eb4e51dc79ccc95d96ede7c8a4a6c723a146 | fix issues with hg segment | banga/powerline-shell,b-ryan/powerline-shell,banga/powerline-shell,b-ryan/powerline-shell,milkbikis/powerline-shell | powerline_shell/segments/hg.py | powerline_shell/segments/hg.py | import os
import subprocess
from ..utils import ThreadedSegment
def get_hg_status():
has_modified_files = False
has_untracked_files = False
has_missing_files = False
p = subprocess.Popen(['hg', 'status'], stdout=subprocess.PIPE)
output = p.communicate()[0].decode("utf-8")
for line in output.... | import os
import subprocess
from ..utils import ThreadedSegment
def get_hg_status():
has_modified_files = False
has_untracked_files = False
has_missing_files = False
p = subprocess.Popen(['hg', 'status'], stdout=subprocess.PIPE)
output = p.communicate()[0].decode("utf-8")
for line in output.... | mit | Python |
d9e7fb81121151d22ef8d0d33de65e05396850fd | Fix lyrics newline parser | anlar/prismriver-lyrics,anlar/prismriver,anlar/prismriver,anlar/prismriver-lyrics | prismriver/plugin/sonichits.py | prismriver/plugin/sonichits.py | """ Random comments:
- api access requires some parts of UA to be set, otherwise return 404
"""
from prismriver.plugin.common import Plugin
from prismriver.struct import Song
class SonicHitsPlugin(Plugin):
ID = 'sonichits'
RANK = 7
def __init__(self, config):
super(SonicHitsPlugin, self).__init_... | """ Random comments:
- api access requires some parts of UA to be set, otherwise return 404
"""
from prismriver.plugin.common import Plugin
from prismriver.struct import Song
class SonicHitsPlugin(Plugin):
ID = 'sonichits'
RANK = 7
def __init__(self, config):
super(SonicHitsPlugin, self).__init_... | mit | Python |
a1b38d4a21b1bb01716bddb3bfcbf45ca968150b | update docker name | hxsf/OnlineJudge,wangmingjob/OnlineJudge,wwj718/OnlineJudge,wangmingjob/OnlineJudge,hxsf/OnlineJudge,wangmingjob/OnlineJudge,Timeship/OnlineJudge-1,hxsf/OnlineJudge,uestcxl/OnlineJudge,uestcxl/OnlineJudge,Timeship/OnlineJudge-QDU,Timeship/OnlineJudge-QDU,Timeship/OnlineJudge-QDU,uestcxl/OnlineJudge,wangmingjob/OnlineJu... | judge/judger_controller/settings.py | judge/judger_controller/settings.py | # coding=utf-8
# 这个redis 是 celery 使用的,包括存储队列信息还有部分统计信息
redis_config = {
"host": "121.42.32.129",
"port": 6379,
"db": 0
}
# 判题的 docker 容器的配置参数
docker_config = {
"image_name": "a7673b55d263",
"docker_path": "docker",
"shell": True
}
# 测试用例的路径,是主机上的实际路径
test_case_dir = "/var/mnt/source//test_ca... | # coding=utf-8
# 这个redis 是 celery 使用的,包括存储队列信息还有部分统计信息
redis_config = {
"host": "121.42.32.129",
"port": 6379,
"db": 0
}
# 判题的 docker 容器的配置参数
docker_config = {
"image_name": " judger",
"docker_path": "docker",
"shell": True
}
# 测试用例的路径,是主机上的实际路径
test_case_dir = "/var/mnt/source//test_case/"
... | mit | Python |
4ee4586cc4f38a5aed1a8c6cd639419b44f1abca | Add test_update_jwt_expired test. | pasinskim/integration,pasinskim/integration,pasinskim/integration | tests/tests/test_basic_integration.py | tests/tests/test_basic_integration.py | #!/usr/bin/python
# Copyright 2017 Northern.tech AS
#
# 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 a... | #!/usr/bin/python
# Copyright 2017 Northern.tech AS
#
# 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 a... | apache-2.0 | Python |
358d9ee96ec2078af6d63370568a745b1b225a7b | add dogpile.cache to install_requires again ... | michaellaier/pymor,michaellaier/pymor,michaellaier/pymor,michaellaier/pymor | dependencies.py | dependencies.py | tests_require = ['tox', 'pytest', 'pytest-cache', 'pytest-capturelog', 'pytest-instafail',
'pytest-xdist', 'pytest-cov', 'pytest-flakes', 'pytest-pep8']
install_requires = ['Cython', 'numpy', 'scipy', 'PyContracts', 'Sphinx',
'docopt', 'numpydoc', 'dogpile.cache']
pre_setup_requires... | tests_require = ['tox', 'pytest', 'pytest-cache', 'pytest-capturelog', 'pytest-instafail',
'pytest-xdist', 'pytest-cov', 'pytest-flakes', 'pytest-pep8']
install_requires = ['Cython', 'numpy', 'scipy', 'PyContracts', 'Sphinx',
'docopt', 'numpydoc']
pre_setup_requires = ['cython', 'nu... | bsd-2-clause | Python |
0f3f78430bc3c2a823b964ac76ce96fc9fde64f3 | Add title via settings | ollien/Timpani,ollien/Timpani,ollien/Timpani | timpani/webserver/controllers/user.py | timpani/webserver/controllers/user.py | import flask
import os.path
import datetime
from ... import auth
from ... import blog
from ... import configmanager
from ... import settings
from .. import webhelpers
FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../../configs/"))
TEMPLATE_PATH... | import flask
import os.path
import datetime
from ... import auth
from ... import blog
from ... import configmanager
from .. import webhelpers
FILE_LOCATION = os.path.abspath(os.path.dirname(__file__))
CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../../../configs/"))
TEMPLATE_PATH = os.path.abspath(os.pat... | mit | Python |
6b148853094a364fb303447db79bef5ac586e5ed | bump version | plotly/python-api,plotly/plotly.py,plotly/plotly.py,plotly/python-api,plotly/python-api,plotly/plotly.py | plotly/version.py | plotly/version.py | __version__ = '2.0.4'
| __version__ = '2.0.3'
| mit | Python |
f1c465b4f58237fc5e0f4e5168b67497ee1dd5f4 | REFACTOR : Run strictyaml faster when dealing with OrValidators that consistently fail on the first validator. | crdoconnor/strictyaml,crdoconnor/strictyaml | strictyaml/exceptions.py | strictyaml/exceptions.py | from ruamel.yaml import MarkedYAMLError
from ruamel.yaml.dumper import RoundTripDumper
from ruamel.yaml import dump
try:
from ruamel.yaml.error import Mark as StringMark
except ImportError:
from ruamel.yaml.error import StringMark
class StrictYAMLError(MarkedYAMLError):
pass
class YAMLValidationError(St... | from ruamel.yaml import MarkedYAMLError
from ruamel.yaml.dumper import RoundTripDumper
from ruamel.yaml import dump
try:
from ruamel.yaml.error import Mark as StringMark
except ImportError:
from ruamel.yaml.error import StringMark
class StrictYAMLError(MarkedYAMLError):
pass
class YAMLValidationError(St... | mit | Python |
bc1a1e7fe6793baeea9fce1cc2db59e129f19c09 | fix Signal.register to accommodate strange urwid behaviour | CanonicalLtd/subiquity,CanonicalLtd/subiquity | subiquitycore/signals.py | subiquitycore/signals.py | # Copyright 2015 Canonical, Ltd.
#
# 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 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright 2015 Canonical, Ltd.
#
# 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 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 | Python |
3a9a70efc31885e50ed23de328c29f38df64edff | Work in progress | ctismer/pyfilesystem,ctismer/pyfilesystem | fs/zipfs.py | fs/zipfs.py | #!/usr/bin/env python
from fs import *
from zipfile import ZipFile
class ZipFS(FS):
def __init__(self, zip_file, mode="r", compression="deflated", allowZip64=False):
if compression == "deflated":
compression_type = zipfile.ZIP_DEFLATED
elif compression == "stored":
compr... | #!/usr/bin/env python
from fs import *
from zipfile import ZipFile
class ZipFS(FS):
def __init__(self, zip_file, mode="r", compression="deflated", allowZip64=False):
if compression == "deflated":
compression_type = zipfile.ZIP_DEFLATED
elif compression == "stored":
compr... | bsd-3-clause | Python |
6ea405458ab8c90ee97eece34bfe973fd222f8e9 | Update fsclient | Mirantis/f2s,Mirantis/f2s | fsclient.py | fsclient.py | #!/usr/bin/env python
import os
import click
from solar.core.resource import composer as cr
from solar.dblayer.model import ModelMeta
@click.group()
def main():
pass
class NailgunSource(object):
def nodes(self, uids):
from fuelclient.objects.node import Node
nodes_obj = map(Node, uids)
... | #!/usr/bin/env python
import os
import click
from solar.core.resource import composer as cr
from solar.dblayer.model import ModelMeta
@click.group()
def main():
pass
class NailgunSource(object):
def nodes(self, uids):
from fuelclient.objects.node import Node
nodes_obj = map(Node, uids)
... | apache-2.0 | Python |
7bef391ef605716a02cdc9bb572234ff26082ba4 | Use simple_tag decorators as those tags can now also be used for assignments | GISAElkartea/amv2,GISAElkartea/amv2,GISAElkartea/amv2 | antxetamedia/archive/templatetags/absolute_urls.py | antxetamedia/archive/templatetags/absolute_urls.py | from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def build_absolute_uri(context, url):
if url:
return context['request'].build_absolute_uri(url)
| from django import template
register = template.Library()
@register.assignment_tag(takes_context=True)
def build_absolute_uri(context, url):
if url:
return context['request'].build_absolute_uri(url)
| agpl-3.0 | Python |
08897315360198bb63b929c6f39672653f5cb529 | fix filter for python 3 | chfw/moban,chfw/moban | docs/level-7-use-custom-jinja2-filter-test-n-global/custom-jj2-plugin/filter.py | docs/level-7-use-custom-jinja2-filter-test-n-global/custom-jj2-plugin/filter.py | import sys
import base64
from moban.extensions import JinjaFilter
@JinjaFilter('base64encode')
def base64_encode(string):
if sys.version_info[0] > 2:
content = base64.b64encode(string.encode('utf-8'))
content = content.decode('utf-8')
else:
content = base64.b64encode(string)
return... | import base64
from moban.extensions import JinjaFilter
@JinjaFilter('base64encode')
def base64_encode(string):
return base64.b64encode(string)
| mit | Python |
3b8d4a00ee3afb7d44ca6a6fb73d08c51ce62d3a | Add sunburst lib | oscar6echo/ezhc,oscar6echo/ezhc,oscar6echo/ezhc | ezhc/_config.py | ezhc/_config.py |
import json
from IPython.display import display, HTML, Javascript
JS_SAVE = [
'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.js',
'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js',
]
JS_LIBS_ONE = json.dumps([
'jquery',
'https://code.highcharts.com/stock/highstoc... |
import json
from IPython.display import display, HTML, Javascript
JS_SAVE = [
'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.js',
'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js',
]
JS_LIBS_ONE = json.dumps([
'jquery',
'https://code.highcharts.com/stock/highstoc... | mit | Python |
b7da3e266871673415756fde623fbc989e97bfa1 | add get state history for panda client | craft-ai/craft-ai-client-python,craft-ai/craft-ai-client-python | craftai/pandas/client.py | craftai/pandas/client.py | from six.moves import range
import pandas as pd
from .. import Client as VanillaClient
from ..errors import CraftAiBadRequestError
from .interpreter import Interpreter
def chunker(to_be_chunked_df, chunk_size):
return (to_be_chunked_df[pos:pos + chunk_size]
for pos in range(0, len(to_be_chunked_df), chun... | from six.moves import range
import pandas as pd
from .. import Client as VanillaClient
from ..errors import CraftAiBadRequestError
from .interpreter import Interpreter
def chunker(to_be_chunked_df, chunk_size):
return (to_be_chunked_df[pos:pos + chunk_size]
for pos in range(0, len(to_be_chunked_df), chun... | bsd-3-clause | Python |
47ea05b54217b033781ae9c4d9eac7ce437fae7d | Update activate-devices.py | JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub,JeffreyPowell/pi-heating-hub | cron/activate-devices.py | cron/activate-devices.py | #!/usr/bin/env python
import MySQLdb
#import datetime
#import urllib2
#import os
import datetime
import RPi.GPIO as GPIO
try:
import RPi.GPIO as GPIO
except RuntimeError:
print("Error importing RPi.GPIO!")
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
cnx = MySQLdb.... | #!/usr/bin/env python
import MySQLdb
#import datetime
#import urllib2
#import os
import datetime
import RPi.GPIO as GPIO
try:
import RPi.GPIO as GPIO
except RuntimeError:
print("Error importing RPi.GPIO!")
servername = "localhost"
username = "pi"
password = "password"
dbname = "pi_heating_db"
cnx = MySQLdb.... | apache-2.0 | Python |
39555c70181776f397c728537b7d8bd7a4a6b85c | Fix code to support django4 and up, edge case for code older than 3.2 | shanx/django-maintenancemode,shanx/django-maintenancemode | maintenancemode/middleware.py | maintenancemode/middleware.py | import re
from django import VERSION as django_version
from django.conf import urls
from django.urls import get_resolver
from django.urls import resolvers
from django.utils.deprecation import MiddlewareMixin
from . import utils as maintenance
from .conf import settings
urls.handler503 = "maintenancemode.views.tempora... | import re
from django import VERSION as django_version
from django.conf import urls
from django.urls import get_resolver
from django.urls import resolvers
from django.utils.deprecation import MiddlewareMixin
from . import utils as maintenance
from .conf import settings
urls.handler503 = "maintenancemode.views.tempora... | bsd-3-clause | Python |
314d45476bd079fe3b9bb97af181b2b6f306fe73 | Test for XDG basedir creation | Artanicus/python-cozify,Artanicus/python-cozify | cozify/test/test_config.py | cozify/test/test_config.py | #!/usr/bin/env python3
import os, tempfile
from cozify import config
from cozify.test import debug
from cozify.test.fixtures import tmp_hub
def test_config_XDG(tmp_hub):
assert config._initXDG()
def test_config_XDG_env(tmp_hub):
with tempfile.TemporaryDirectory() as td:
os.environ["XDG_CONFIG_HOME... | #!/usr/bin/env python3
import os, tempfile
from cozify import config
from cozify.test import debug
from cozify.test.fixtures import tmp_hub
def test_config_XDG(tmp_hub):
assert config._initXDG()
def test_config_XDG_env(tmp_hub):
with tempfile.TemporaryDirectory() as td:
os.environ["XDG_CONFIG_HOME... | mit | Python |
56878ec5962fefbc555abf692c8ab345614e90c3 | Refactor utf-8 parser | romuloceccon/logviewer,romuloceccon/logviewer | lib/utf8_parser.py | lib/utf8_parser.py | import struct
class Utf8Parser(object):
def __init__(self, receive):
self._receive = receive
self._buffer = []
self._seq_size = 0
def _reset_buffer(self, size):
self._buffer.clear()
self._seq_size = size
def put_key(self, key):
if key & 0x80 == 0:
... | import struct
class Utf8Parser(object):
def __init__(self, receive):
self._receive = receive
self._buffer = []
self._seq_size = 0
def put_key(self, key):
if key & 0x80 == 0:
self._buffer.clear()
self._receive(chr(key))
self._seq_size = 0
... | mit | Python |
8f8d1b2ba59310e7510f295476f5c8884bdba51d | add AbstractProductWashingInstruction | byteweaver/django-eca-catalogue | eca_catalogue/text/abstract_models.py | eca_catalogue/text/abstract_models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
class AbstractSellingPoint(models.Model):
text = models.CharField(_("Text"), max_length=255)
product = models.ForeignKey('Product', related_name='selling_points')
class Meta:
abstract = True
verbose_name ... | from django.db import models
from django.utils.translation import ugettext_lazy as _
class AbstractSellingPoint(models.Model):
text = models.CharField(_("Text"), max_length=255)
product = models.ForeignKey('Product', related_name='selling_points')
class Meta:
abstract = True
verbose_name ... | bsd-3-clause | Python |
200c141737440d55039780f5bd205e1e81bf20fe | Add distinct() in filter_powered decorator | freevoid/django-datafilters,zorainc/django-datafilters,zorainc/django-datafilters | datafilters/decorators.py | datafilters/decorators.py | from functools import wraps
__all__ = ('filter_powered',)
def filter_powered(filterform_cls, queryset_name='object_list', pass_params=False,
add_count=False, aggregate_args={}, values_spec=None, deferred=None):
def decorator(view):
@wraps(view)
def filter_powered_view(request, *args, **... | from functools import wraps
__all__ = ('filter_powered',)
def filter_powered(filterform_cls, queryset_name='object_list', pass_params=False,
add_count=False, aggregate_args={}, values_spec=None, deferred=None):
def decorator(view):
@wraps(view)
def filter_powered_view(request, *args, **... | mit | Python |
e127c1343e586e6a7c1dc50f25973cc05c180b1d | Remove null bytes | renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar | tests/validation/test_cohort_patient_validation.py | tests/validation/test_cohort_patient_validation.py | # TODO
|