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 |
|---|---|---|---|---|---|---|---|---|
06fa3a4625576a0d7d4897dabcc2979c36d62ce1 | Remove unused code | dtroyer/dwarf,dtroyer/dwarf,juergh/dwarf,juergh/dwarf | dwarf/image/api_response.py | dwarf/image/api_response.py | #!/usr/bin/env python
#
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 OpenStack 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://... | #!/usr/bin/env python
#
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013 OpenStack 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://... | apache-2.0 | Python |
1334c8fa989981e3c917cdc16869b04ad1c2f6e0 | add --g-fatal-warnings gtk option | baverman/snaked,baverman/snaked | snaked/core/run.py | snaked/core/run.py | from optparse import OptionParser
import os
def get_manager():
parser = OptionParser()
parser.add_option('-s', '--session', dest='session',
help="Open snaked with specified session", default='default')
parser.add_option('', '--select-session', action="store_true", dest='select_session',
hel... | from optparse import OptionParser
import os
def get_manager():
parser = OptionParser()
parser.add_option('-s', '--session', dest='session',
help="Open snaked with specified session", default='default')
parser.add_option('', '--select-session', action="store_true", dest='select_session',
hel... | mit | Python |
6670fe1d081e27417a3d340e2c12c061078582af | Bump version (pre-release) | chrisglass/django-xhtml2pdf,chrisglass/django-xhtml2pdf | django_xhtml2pdf/__init__.py | django_xhtml2pdf/__init__.py | # -*- coding: utf-8 -*-
"""
See PEP 386 (http://www.python.org/dev/peps/pep-0386/)
Release logic:
1. Remove "dev" from current.
2. git commit
3. git tag <version>
4. push to pypi + push to github
5. bump the version, append '.dev0'
6. git commit
7. push to github (to avoid confusion)
"""
__version__ = '0.0.3'
| # -*- coding: utf-8 -*-
"""
See PEP 386 (http://www.python.org/dev/peps/pep-0386/)
Release logic:
1. Remove "dev" from current.
2. git commit
3. git tag <version>
4. push to pypi + push to github
5. bump the version, append '.dev0'
6. git commit
7. push to github (to avoid confusion)
"""
__version__ = '0.0.3.dev0'
| bsd-3-clause | Python |
94d18ba6ede9dc58a558c68fd3af9bbcadc7f189 | Update urls.py For Django 1.6 | rashoodkhan/DjangoBB,hsoft/slimbb,hsoft/DjangoBB,rashoodkhan/DjangoBB,slav0nic/DjangoBB,hsoft/DjangoBB,hsoft/DjangoBB,agepoly/DjangoBB,saifrahmed/DjangoBB,slav0nic/DjangoBB,saifrahmed/DjangoBB,hsoft/slimbb,agepoly/DjangoBB,slav0nic/DjangoBB,saifrahmed/DjangoBB,agepoly/DjangoBB,hsoft/slimbb | djangobb_forum/tests/urls.py | djangobb_forum/tests/urls.py | from django.conf.urls import patterns, include
urlpatterns = patterns('',
(r'^forum/', include('djangobb_forum.urls', namespace='djangobb')),
)
| from django.conf.urls.defaults import patterns, include
urlpatterns = patterns('',
(r'^forum/', include('djangobb_forum.urls', namespace='djangobb')),
)
| bsd-3-clause | Python |
bdceb4c7bc0b71755d9f63974a5597e29fd94e75 | comment test code | nomemo/ProxyPool | tester.py | tester.py | import urllib2
from socket import p
import settings
import random
import threading
import Queue
import json
import requests
from settings import USER_AGENTS
def makeRequest(proxy, target):
i_headers = {'User-Agent': random.choice(USER_AGENTS)}
print("\n")
try:
r = requests.get(target, proxies=proxy, headers=i_he... | import urllib2
from socket import p
import settings
import random
import threading
import Queue
import json
import requests
from settings import USER_AGENTS
def makeRequest(proxy, target):
i_headers = {'User-Agent': random.choice(USER_AGENTS)}
print("\n")
try:
r = requests.get(target, proxies=proxy, headers=i_he... | apache-2.0 | Python |
c6cde6a72204a9e688ea0d6dfe9550f2cb39a0fc | resolve incorrect merge conflict resolution | hkawasaki/kawasaki-aio8-0,mjirayu/sit_academy,kursitet/edx-platform,fly19890211/edx-platform,longmen21/edx-platform,halvertoluke/edx-platform,bitifirefly/edx-platform,ahmadio/edx-platform,zofuthan/edx-platform,longmen21/edx-platform,bitifirefly/edx-platform,pelikanchik/edx-platform,appsembler/edx-platform,morenopc/edx-... | common/lib/xmodule/xmodule/modulestore/tests/test_xml.py | common/lib/xmodule/xmodule/modulestore/tests/test_xml.py | import os.path
from nose.tools import assert_raises, assert_equals
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.modulestore import XML_MODULESTORE_TYPE
from .test_modulestore import check_path_to_location
from xmodule.tests import DATA_DIR
class... | import os.path
from nose.tools import assert_raises, assert_equals
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.xml import XMLModuleStore
from xmodule.modulestore import XML_MODULESTORE_TYPE
from .test_modulestore import check_path_to_location
from . import DATA_DIR
class TestXMLModu... | agpl-3.0 | Python |
2b3667dfc4fbd6571da288146d4e8f8f8f2d51a1 | Fix broken sorted set unit test. | 4degrees/clique | test/unit/test_sorted_set.py | test/unit/test_sorted_set.py | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import pytest
from clique.sorted_set import SortedSet
@pytest.fixture
def standard_set(request):
'''Return sorted set.'''
return SortedSet([4, 5, 6, 7, 2, 1, 1])
@pytest.mark.parametrize(('item', 'expec... | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import pytest
from clique.sorted_set import SortedSet
@pytest.fixture
def standard_set(request):
'''Return sorted set.'''
return SortedSet([4, 5, 6, 7, 2, 1, 1])
@pytest.mark.parametrize(('item', 'expec... | apache-2.0 | Python |
db0e6265892231ecf10244eb7ddcddc62a12b82b | Fix bug where cached items in subfolders would be re-read. | ollien/PyConfigManager | configmanager.py | configmanager.py | import json
import os
import os.path
class ConfigManager():
_cache = {}
def __init__(self, configPath = "configs/"):
if os.path.isdir(configPath):
self.configPath = configPath
else:
raise IOError("Config Path does not eixst")
self._configs = {}
self._syncCache()
self.getConfigs()
def __getitem__(se... | import json
import os
import os.path
class ConfigManager():
_cache = {}
def __init__(self, configPath = "configs/"):
if os.path.isdir(configPath):
self.configPath = configPath
else:
raise IOError("Config Path does not eixst")
self._configs = {}
self._syncCache()
self.getConfigs()
def __getitem__(se... | mit | Python |
17af071faa70d3dc4a884f62fb50f34e8621ac6d | Update watchman/constants.py | JBKahn/django-watchman,mwarkentin/django-watchman,mwarkentin/django-watchman,JBKahn/django-watchman | watchman/constants.py | watchman/constants.py | DEFAULT_CHECKS = (
'watchman.checks.caches',
'watchman.checks.databases',
'watchman.checks.storage',
)
PAID_CHECKS = (
'watchman.checks.email',
)
| DEFAULT_CHECKS = (
'watchman.checks.caches',
'watchman.checks.databases',
'watchman.checks.storage',
)
PAID_CHECKS = (
'watchman.checks.email',
)
| bsd-3-clause | Python |
e1a7e4535e64c005fb508ba6d3fed021bbd40a62 | Update only tables in visible schemas | openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform | oedb_datamodels/versions/1a73867b1e79_add_meta_search.py | oedb_datamodels/versions/1a73867b1e79_add_meta_search.py | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
from dataedit.views... | """Add meta_search table
Revision ID: 1a73867b1e79
Revises: 1c6e2fb3d3b6
Create Date: 2019-04-29 11:47:04.783168
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
from sqlalchemy.orm.session import sessionmaker
from api.actions import update_meta_search
# revision identif... | agpl-3.0 | Python |
f1fec3790fee11ff3d83c272e3a2aa7bb548ddfa | Remove print | deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel | open_spiel/python/algorithms/expected_game_score_test.py | open_spiel/python/algorithms/expected_game_score_test.py | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | apache-2.0 | Python |
fa52bbde01f62bb0816e71970ac50761947afa72 | Improve comment | lee101/retaining-wall | retaining_wall.py | retaining_wall.py | class RetainingWallSolver(object):
def retaining_wall(self, wood_lengths, required_lengths):
self.required_lengths = required_lengths
return self.retaining_wall_recursive(wood_lengths, len(required_lengths) - 1)
def retaining_wall_recursive(self, wood_lengths, required_length_idx):
if r... | class RetainingWallSolver(object):
def retaining_wall(self, wood_lengths, required_lengths):
self.required_lengths = required_lengths
return self.retaining_wall_recursive(wood_lengths, len(required_lengths) - 1)
def retaining_wall_recursive(self, wood_lengths, required_length_idx):
if r... | mit | Python |
b4a9380c73dd367c2cf6249cdf4cdbbdfdbc7907 | fix example | estin/pomp | examples/pythonnews.py | examples/pythonnews.py | """
Extract python news from python.org
"""
import re
import logging
from pomp.core.base import BaseCrawler, BasePipeline
from pomp.core.item import Item, Field
from pomp.contrib import SimpleDownloader
logging.basicConfig(level=logging.DEBUG)
news_re = re.compile(r'<h2 class="news">(.*?)</h2>([\s\S]*?)<div class="pu... | """
Extract python news from python.org
"""
import re
import logging
from pomp.core.base import BaseCrawler, BasePipeline
from pomp.core.item import Item, Field
from pomp.contrib import SimpleDownloader
logging.basicConfig(level=logging.DEBUG)
news_re = re.compile(r'<h2 class="news">(.*?)</h2>([\s\S]*?)<div class="pu... | bsd-3-clause | Python |
e3c42442f090b8b6982f7ff8c93632c43cfa80b3 | use insights landing for offseason | verycumbersome/the-blue-alliance,synth3tk/the-blue-alliance,bvisness/the-blue-alliance,phil-lopreiato/the-blue-alliance,phil-lopreiato/the-blue-alliance,josephbisch/the-blue-alliance,nwalters512/the-blue-alliance,bvisness/the-blue-alliance,the-blue-alliance/the-blue-alliance,phil-lopreiato/the-blue-alliance,nwalters512... | tba_config.py | tba_config.py | import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
MAX_YEAR = 2015
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
INSIGHTS = 5
CHAMPS = 6
# The CONFIG variables should have exactly the same structure between environments
# Ev... | import os
DEBUG = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')
MAX_YEAR = 2015
# For choosing what the main landing page displays
KICKOFF = 1
BUILDSEASON = 2
COMPETITIONSEASON = 3
OFFSEASON = 4
INSIGHTS = 5
CHAMPS = 6
# The CONFIG variables should have exactly the same structure between environments
# Ev... | mit | Python |
b860d7cb81488f5ebbe7e9e356a6d4f140c33df5 | update to follow python 2to3 changes | sassy/FikaNote,gmkou/FikaNote,sassy/FikaNote,gmkou/FikaNote,gmkou/FikaNote,sassy/FikaNote | tests/__init__.py | tests/__init__.py | from .test_home import *
from .test_feed import *
from .test_shownote import *
from .test_agenda import *
from .test_episode import *
| from test_home import *
from test_feed import *
from test_shownote import *
from test_agenda import *
from test_episode import *
| mit | Python |
d77256d1964354eb7dd178f383dd3254c3b4d975 | Fix source docs page | sncosmo/sncosmo,sncosmo/sncosmo,sncosmo/sncosmo | docs/_helpers/source_page.py | docs/_helpers/source_page.py | """Generate a restructured text document that describes built-in sources
and save it to this module's docstring for the purpose of including in
sphinx documentation via the automodule directive."""
import string
from sncosmo.models import _SOURCES
lines = [
'',
' '.join([30*'=', 7*'=', 10*'=', 27*'=', 30*'... | """Generate a restructured text document that describes built-in sources
and save it to this module's docstring for the purpose of including in
sphinx documentation via the automodule directive."""
import string
from sncosmo.models import _SOURCES
lines = [
'',
' '.join([20*'=', 7*'=', 10*'=', 27*'=', 30*'... | bsd-3-clause | Python |
5f5a7ec9460d60a964663ace670529813a41a9d9 | Update bluetooth_ping_test.py | daveol/Fedora-Test-Laptop,daveol/Fedora-Test-Laptop | tests/bluetooth_ping_test.py | tests/bluetooth_ping_test.py | #!/usr/bin/env python
import os
import subprocess as subp
from subprocess import *
from avocado import Test
#I have used my Samsung Galaxy S7 Edge as target device
class WifiScanAP(Test):
def test():
targetDeviceMac = '8C:1A:BF:0D:31:A9'
bluetoothChannel = '2'
port = 1
print("Bluetooth pi... | #!/usr/bin/env python
import os
import subprocess as subp
from subprocess import *
from avocado import Test
class WifiScanAP(Test):
def test():
targetDeviceMac = '8C:1A:BF:0D:31:A9'
bluetoothChannel = '2'
port = 1
print("Bluetooth ping test: testing " + targetDeviceMac)
p = subp.Pope... | mit | Python |
9cc45f750c0860715e66c085895611984531c48c | update standalone disclosure url | mistergone/college-costs,mistergone/college-costs,mistergone/college-costs,mistergone/college-costs | paying_for_college/config/urls.py | paying_for_college/config/urls.py | from django.conf.urls import url, include
from django.conf import settings
from paying_for_college.views import LandingView, StandAloneView
from django.contrib import admin
from django.conf import settings
try:
STANDALONE = settings.STANDALONE
except AttributeError: # pragma: no cover
STANDALONE = False
urlp... | from django.conf.urls import url, include
from django.conf import settings
from paying_for_college.views import LandingView, StandAloneView
from django.contrib import admin
from django.conf import settings
try:
STANDALONE = settings.STANDALONE
except AttributeError: # pragma: no cover
STANDALONE = False
urlp... | cc0-1.0 | Python |
43b4910e004e7096addb3d50e8a0a6c307a669c6 | Remove dead get_body_parameter_name_override | akx/lepo,akx/lepo | lepo/apidef/operation/openapi.py | lepo/apidef/operation/openapi.py | from lepo.apidef.operation.base import Operation
from lepo.apidef.parameter.openapi import OpenAPI3BodyParameter, OpenAPI3Parameter
from lepo.utils import maybe_resolve
class OpenAPI3Operation(Operation):
parameter_class = OpenAPI3Parameter
body_parameter_class = OpenAPI3BodyParameter
def _get_body_param... | from lepo.apidef.operation.base import Operation
from lepo.apidef.parameter.openapi import OpenAPI3BodyParameter, OpenAPI3Parameter
from lepo.utils import maybe_resolve
class OpenAPI3Operation(Operation):
parameter_class = OpenAPI3Parameter
body_parameter_class = OpenAPI3BodyParameter
def _get_body_param... | mit | Python |
b5a6d540f5fdef37b1d58fc45921737e3c77ae96 | fix user autocomplete | oleg-chubin/let_me_play,oleg-chubin/let_me_play,oleg-chubin/let_me_play,oleg-chubin/let_me_play | let_me_app/views/autocomplete.py | let_me_app/views/autocomplete.py | from dal import autocomplete
from slugify import slugify
from let_me_auth.models import User
from let_me_app.models import Equipment, StaffRole
from let_me_auth.social.pipeline import ABSENT_MAIL_HOST
import re
class UserAutocomplete(autocomplete.Select2QuerySetView):
create_field = 'username'
def create_ob... | from dal import autocomplete
from slugify import slugify
from let_me_auth.models import User
from let_me_app.models import Equipment, StaffRole
class UserAutocomplete(autocomplete.Select2QuerySetView):
def get_queryset(self):
# Don't forget to filter out results depending on the visitor !
if not ... | apache-2.0 | Python |
060576768e02c0499282770dd22e35048d62b12e | Improve clarity of session finish function | jakirkham/bokeh,jakirkham/bokeh,rs2/bokeh,stonebig/bokeh,dennisobrien/bokeh,percyfal/bokeh,Karel-van-de-Plassche/bokeh,percyfal/bokeh,DuCorey/bokeh,timsnyder/bokeh,aavanian/bokeh,ptitjano/bokeh,schoolie/bokeh,ericmjl/bokeh,clairetang6/bokeh,ptitjano/bokeh,justacec/bokeh,aiguofer/bokeh,dennisobrien/bokeh,KasperPRasmusse... | tests/conftest.py | tests/conftest.py | from __future__ import print_function
import os
import boto
import pytest
from boto.s3.key import Key as S3Key
from boto.exception import NoAuthHandlerFound
from os.path import join
s3_bucket = "bokeh-travis"
s3 = "https://s3.amazonaws.com/%s" % s3_bucket
build_id = os.environ.get("TRAVIS_BUILD_ID")
# Can we make thi... | from __future__ import print_function
import os
import boto
import pytest
from boto.s3.key import Key as S3Key
from boto.exception import NoAuthHandlerFound
from os.path import join, isfile
s3_bucket = "bokeh-travis"
s3 = "https://s3.amazonaws.com/%s" % s3_bucket
build_id = os.environ.get("TRAVIS_BUILD_ID")
# Can we ... | bsd-3-clause | Python |
36a00bd6ece27b89843a856cd2b99d25a1d0e4d3 | Modify conftest.py to support Python 3.5 only | wikimedia/pywikibot-core,wikimedia/pywikibot-core | tests/conftest.py | tests/conftest.py | # -*- coding: utf-8 -*-
"""Used by pytest to do some preparation work before running tests."""
#
# (C) Pywikibot team, 2016-2020
#
# Distributed under the terms of the MIT license.
#
import sys
def pytest_configure(config):
"""Set the sys._test_runner_pytest flag to True, if pytest is used."""
sys._test_runne... | # -*- coding: utf-8 -*-
"""Used by pytest to do some preparation work before running tests."""
#
# (C) Pywikibot team, 2016-2018
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import sys
def pytest_configure(config):
"""Set the sys._test_r... | mit | Python |
d3fbe9934329df1b1c5f752e4a43981b4fc8beae | Use pathlib.Path | tony/vcspull,tony/vcspull | tests/conftest.py | tests/conftest.py | import pathlib
import pytest
from _pytest.compat import LEGACY_PATH
from libvcs.shortcuts import create_repo_from_pip_url
from libvcs.util import run
@pytest.fixture(scope="function")
def tmpdir_repoparent(tmp_path: pathlib.Path):
"""Return temporary directory for repository checkout guaranteed unique."""
... | import pytest
from _pytest.compat import LEGACY_PATH
from libvcs.shortcuts import create_repo_from_pip_url
from libvcs.util import run
@pytest.fixture(scope="function")
def tmpdir_repoparent(tmpdir_factory):
"""Return temporary directory for repository checkout guaranteed unique."""
fn = tmpdir_factory.mkte... | mit | Python |
8913f5d6a06e0f25d1c8c1a45e0f5b4da8cbf421 | bump version | prateeknepaliya09/rodeo,prateeknepaliya09/rodeo,Cophy08/rodeo,gef756/rodeo,gef756/rodeo,chengjunjian/rodeo,prateeknepaliya09/rodeo,nvoron23/rodeo,nagasuga/rodeo,varunjois111/rodeo,varunjois111/rodeo,prateeknepaliya09/rodeo,Cophy08/rodeo,atsuyim/rodeo,atsuyim/rodeo,chengjunjian/rodeo,gef756/rodeo,nagasuga/rodeo,varunjoi... | rodeo/__init__.py | rodeo/__init__.py | __version__ = "0.1.0"
|
__version__ = "0.0.2"
| bsd-2-clause | Python |
7eb10376b585e56faad4672959f6654f2500a38d | Add `one` as shortcut to `dimensionless_unscaled` | kelle/astropy,aleksandr-bakanov/astropy,bsipocz/astropy,kelle/astropy,mhvk/astropy,funbaker/astropy,larrybradley/astropy,MSeifert04/astropy,aleksandr-bakanov/astropy,saimn/astropy,DougBurke/astropy,AustereCuriosity/astropy,AustereCuriosity/astropy,StuartLittlefair/astropy,astropy/astropy,lpsinger/astropy,AustereCuriosi... | astropy/units/__init__.py | astropy/units/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<http://code.google.com/p/pynbody/>`_ units module written by Andrew
Pontzen, who has granted the Astr... | bsd-3-clause | Python |
865940bd126c7c45b7c615f751244a46176aca4d | Update version to 2.3b2-dev | emanuelschuetze/OpenSlides,normanjaeckel/OpenSlides,jwinzer/OpenSlides,OpenSlides/OpenSlides,jwinzer/OpenSlides,tsiegleauq/OpenSlides,jwinzer/OpenSlides,boehlke/OpenSlides,OpenSlides/OpenSlides,ostcar/OpenSlides,boehlke/OpenSlides,emanuelschuetze/OpenSlides,emanuelschuetze/OpenSlides,boehlke/OpenSlides,boehlke/OpenSlid... | openslides/__init__.py | openslides/__init__.py | __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.3b2-dev'
__license__ = 'MIT'
__url__ = 'https://openslides.org'
args = None
| __author__ = 'OpenSlides Team <support@openslides.org>'
__description__ = 'Presentation and assembly system'
__version__ = '2.3b1'
__license__ = 'MIT'
__url__ = 'https://openslides.org'
args = None
| mit | Python |
8a9fa06c36a89e3fde93059cfbe827506d5b8b62 | Disable exception logging of status code 500 during testing. | BMeu/Orchard,BMeu/Orchard | orchard/errors/e500.py | orchard/errors/e500.py | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | # -*- coding: utf-8 -*-
"""
This module sets up the view for handling ``500 Internal Server Error`` errors.
"""
import datetime
import flask
import flask_classful
from orchard.errors import blueprint
class Error500View(flask_classful.FlaskView):
"""
View for ``500 Internal Server Error`` errors.
... | mit | Python |
b8d693a8fd2e0fb9fa8592b9672bc71e874547d3 | Bump version to 0.1.1 | tangentlabs/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,tangentlabs/django-fancypages,socradev/django-fancypages,socradev/django-fancypages | fancypages/__init__.py | fancypages/__init__.py | import os
__version__ = (0, 1, 1, 'alpha', 1)
def get_fancypages_paths(path):
""" Get absolute paths for *path* relative to the project root """
return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)]
def get_apps():
return (
'django_extensions',
# used for image thumbna... | import os
__version__ = (0, 1, 0, 'alpha', 1)
def get_fancypages_paths(path):
""" Get absolute paths for *path* relative to the project root """
return [os.path.join(os.path.dirname(os.path.abspath(__file__)), path)]
def get_apps():
return (
'django_extensions',
# used for image thumbna... | bsd-3-clause | Python |
b699f950eebbe10c400e9867ce8bead02d2f651c | Remove another thing. | mithrandi/txacme | src/txacme/interfaces.py | src/txacme/interfaces.py | # -*- coding: utf-8 -*-
"""
Interface definitions for txacme.
"""
from zope.interface import Interface
class ITLSSNI01Responder(Interface):
"""
Configuration for a tls-sni-01 challenge responder.
The actual responder may exist somewhere else, this interface is merely for
an object that knows how to c... | # -*- coding: utf-8 -*-
"""
Interface definitions for txacme.
"""
from zope.interface import Interface
class ITLSSNI01Responder(Interface):
"""
Configuration for a tls-sni-01 challenge responder.
The actual responder may exist somewhere else, this interface is merely for
an object that knows how to c... | mit | Python |
8112440223e2e8e4f5d8cb93b28fd846dd59418b | Add logout view. | repocracy/repocracy,codysoyland/snowman,repocracy/repocracy,repocracy/repocracy,codysoyland/snowman,codysoyland/snowman | repocracy/repo/urls.py | repocracy/repo/urls.py | from django.conf.urls.defaults import *
from django.conf import settings
import os
urlpatterns = patterns('repocracy.repo.views',
url(r'^$', 'home', name='home'),
url(r'^claim/(?P<pk>\d+)/(?P<claim_hash>[a-fA-F\d]{40})/$', 'repo_claim', name='repo_claim'),
url(r'^users/(?P<name>[\-_\d\w\\\.]+)/$', 'repo_ow... | from django.conf.urls.defaults import *
from django.conf import settings
import os
urlpatterns = patterns('repocracy.repo.views',
url(r'^$', 'home', name='home'),
url(r'^claim/(?P<pk>\d+)/(?P<claim_hash>[a-fA-F\d]{40})/$', 'repo_claim', name='repo_claim'),
url(r'^users/(?P<name>[\-_\d\w\\\.]+)/$', 'repo_ow... | bsd-3-clause | Python |
8b008968e92cabf1022dff6edb37f38c3aaa5214 | Update merge_filter.py | ctsit/vivo-pump,ctsit/vivo-pump,mconlon17/vivo-pump | uf_examples/courses/merge_filter.py | uf_examples/courses/merge_filter.py | #!/usr/bin/env/python
"""
merge_filter.py -- find the courses in VIVO, and match them to the courses in the source. They
must match on ccn
There are two inputs:
1. Courses in VIVO. Keyed by ccn
2. UF courses in the source. Keyed the same.
There are three cases
1. Course in VIVO and in ... | #!/usr/bin/env/python
"""
merge_filter.py -- find the courses in VIVO, and match them to the courses in the source. They
must match on ccn
There are two inputs:
1. Courses in VIVO. Keyed by ccn
2. UF courses in the source. Keyed the same.
There are three cases
1. Course in VIVO and in ... | bsd-2-clause | Python |
672876c172d9bba9e2f29707f9fdd95e0ff10f9f | put data early in Redis at hourly recache | mctenthij/hortiradar,mctenthij/hortiradar,mctenthij/hortiradar,mctenthij/hortiradar,mctenthij/hortiradar | hortiradar/website/refresh_cache.py | hortiradar/website/refresh_cache.py | import argparse
from datetime import datetime
import flask
import ujson as json
from app import app, get_period
from hortiradar import time_format
from processing import get_cache_key, get_process_top_params, process_details, process_top, redis
def main():
parser = argparse.ArgumentParser(description="Refresh t... | import argparse
from datetime import datetime
import flask
import ujson as json
from app import app, get_period
from hortiradar import time_format
from processing import get_cache_key, get_process_top_params, process_details, process_top, redis
def main():
parser = argparse.ArgumentParser(description="Refresh t... | apache-2.0 | Python |
b6098d5b4578547fea192fe96998dbc43ef9dcb0 | upgrade values check | nitely/http-lazy-headers | http_lazy_headers/fields/upgrade.py | http_lazy_headers/fields/upgrade.py | # -*- coding: utf-8 -*-
from ..shared.utils import constraints
from ..shared.utils import assertions
from ..shared import bases
def upgrade(name, version=None):
return name, version
class ProtocolName:
# http://www.iana.org/assignments/http-upgrade-tokens/http-upgrade-tokens.xml
http = 'HTTP'
tls... | # -*- coding: utf-8 -*-
from ..shared.utils import constraints
from ..shared import bases
def upgrade(name, version=None):
return name, version
class ProtocolName:
# http://www.iana.org/assignments/http-upgrade-tokens/http-upgrade-tokens.xml
http = 'HTTP'
tls = 'TLS'
web_socket = 'WebSocket'
... | mit | Python |
471e0f4e91eb4513315193ce2b2b0f13e2c9724c | remove stray " | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/util/datadog/gauges.py | corehq/util/datadog/gauges.py | from functools import wraps
from celery.task import periodic_task
from corehq.util.datadog import statsd
from corehq.util.soft_assert import soft_assert
def datadog_gauge_task(name, fn, run_every, enforce_prefix='commcare'):
"""
helper for easily registering datadog gauges to run periodically
To update a... | from functools import wraps
from celery.task import periodic_task
from corehq.util.datadog import statsd
from corehq.util.soft_assert import soft_assert
def datadog_gauge_task(name, fn, run_every, enforce_prefix='commcare'):
""""
helper for easily registering datadog gauges to run periodically
To update ... | bsd-3-clause | Python |
213ddc9ffbb171c17c051c6394baa0499abfc820 | fix UnboundLocalError | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | corehq/util/tests/test_log.py | corehq/util/tests/test_log.py | from __future__ import absolute_import
from __future__ import unicode_literals
import six
from django.test import SimpleTestCase
from ..log import clean_exception
class TestLogging(SimpleTestCase):
def test_bad_traceback(self):
result = "JJackson's SSN: 555-55-5555"
exception = None
try:... | from __future__ import absolute_import
from __future__ import unicode_literals
import six
from django.test import SimpleTestCase
from ..log import clean_exception
class TestLogging(SimpleTestCase):
def test_bad_traceback(self):
result = "JJackson's SSN: 555-55-5555"
try:
# copied fro... | bsd-3-clause | Python |
24b85059dcc5c17d21011bc7d1975f519e09837d | Improve formatting | hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem,hhucn/netsec-uebungssystem | netsecus/__init__.py | netsecus/__init__.py | #!/usr/bin/env python
from __future__ import unicode_literals
import imaplib
import logging
import time
import helper
import rules
# useful for debugging: $ openssl s_client -crlf -connect imap.gmail.com:993
#
# core functions
#
def main():
# patching imaplib
imaplib.Commands["MOVE"] = ("SELECTED",)
... | #!/usr/bin/env python
from __future__ import unicode_literals
import imaplib
import logging
import time
import helper
import rules
# useful for debugging: $ openssl s_client -crlf -connect imap.gmail.com:993
#
# core functions
#
def main():
# patching imaplib
imaplib.Commands["MOVE"] = ("SELECTED",)
... | mit | Python |
c492c42639f7a487dc27a95a5a785dd9c62ecdb7 | Change project status formatting | JrGoodle/clowder,JrGoodle/clowder,JrGoodle/clowder | clowder/utility/print_utilities.py | clowder/utility/print_utilities.py | """Print utilities"""
import os
from termcolor import colored
from clowder.utility.git_utilities import (
git_current_sha,
git_current_branch,
git_is_detached,
git_is_dirty
)
def print_project_status(root_directory, path, name):
"""Print repo status"""
repo_path = os.path.join(root_directory, p... | """Print utilities"""
import os
from termcolor import colored
from clowder.utility.git_utilities import (
git_current_sha,
git_current_branch,
git_is_detached,
git_is_dirty
)
def print_project_status(root_directory, path, name):
"""Print repo status"""
repo_path = os.path.join(root_directory, p... | mit | Python |
70021d5df6beb0e8eb5b78a6484cbb650a7a1fb6 | fix docs | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | cupyx/distributed/__init__.py | cupyx/distributed/__init__.py | from cupyx.distributed._init import init_process_group # NOQA
from cupyx.distributed._comm import Backend # NOQA
from cupyx.distributed._nccl_comm import NCCLBackend # NOQA
| from cupyx.distributed._init import init_process_group # NOQA
from cupyx.distributed._nccl_comm import NCCLBackend # NOQA
| mit | Python |
3061affd313aff39f722e6e5846a3191d6592a7d | fix FaqQuestionSitemap URLs | edoburu/django-fluent-faq,edoburu/django-fluent-faq | fluent_faq/sitemaps.py | fluent_faq/sitemaps.py | from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import NoReverseMatch
from fluent_faq.models import FaqCategory, FaqQuestion
from fluent_faq.urlresolvers import faq_reverse
def _url_patterns_installed():
# This module can use normal Django urls.py URLs, or mount the "FaqPage" in the page... | from django.contrib.sitemaps import Sitemap
from django.core.urlresolvers import NoReverseMatch
from fluent_faq.models import FaqCategory, FaqQuestion
from fluent_faq.urlresolvers import faq_reverse
def _url_patterns_installed():
# This module can use normal Django urls.py URLs, or mount the "FaqPage" in the page... | apache-2.0 | Python |
79e7ef509e4757c29d6fa0bd9161410aadbd305a | fix os.path.expand [sic] typo, and refactor | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/utils/xdg.py | salt/utils/xdg.py | # -*- coding: utf-8 -*-
'''
Create an XDG function to get the config dir
'''
import os
def xdg_config_dir(config_dir=None):
'''
Check xdg locations for config files
'''
xdg_config = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
xdg_config_dir = os.path.join(xdg_config, 'salt')
... | # -*- coding: utf-8 -*-
'''
Create an XDG function to get the config dir
'''
import os
def xdg_config_dir(config_dir=None):
'''
Check xdg locations for config files
'''
xdg_config = os.getenv('XDG_CONFIG_HOME', os.path.expanduser('~/.config'))
xdg_config_dir = os.path.join(xdg_config, 'salt')
... | apache-2.0 | Python |
e6db95cce0239d9e8ce33aec5cf21aa1bd19df03 | Add __str__ method | jesseklein406/django-imager,jesseklein406/django-imager,jesseklein406/django-imager | imagersite/imager_profile/models.py | imagersite/imager_profile/models.py | import six
from django.db import models
from django.contrib.auth.models import User
@six.python_2_unicode_compatible
class ImagerProfile(models.Model):
user = models.OneToOneField(User)
fav_camera = models.CharField(max_length=30)
address = models.CharField(max_length=100)
web_url = models.URLField()... |
from django.db import models
from django.contrib.auth.models import User
import six
@six.python_2_unicode_compatible
class ImagerProfile(models.Model):
user = models.OneToOneField(User)
fav_camera = models.CharField(max_length=30)
address = models.CharField(max_length=100)
web_url = models.URLField()
... | mit | Python |
9a21c446f1236e1b89663c991ea354d8e473b3b9 | Fix a copyright and pep8 issues in lanzano_luzi_2019_test.py | gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine | openquake/hazardlib/tests/gsim/lanzano_luzi_2019_test.py | openquake/hazardlib/tests/gsim/lanzano_luzi_2019_test.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2019 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, o... | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2015-2019 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | agpl-3.0 | Python |
03ed43d7d8867ba066d9eea3b3fc7cfe557a31d9 | Use C++ | encukou/py3c,encukou/py3c,encukou/py3c | test/setup.py | test/setup.py | from distutils.core import setup, Extension
test_py3c_module = Extension(
'test_py3c',
sources=['test_py3c.c'],
include_dirs=['../include'],
extra_compile_args = ['--std=c++0x', '-l mylib'],
)
setup_args = dict(
name='test_py3c',
version='0.0',
description = '',
ext_modules = [test_py3... | from distutils.core import setup, Extension
test_py3c_module = Extension(
'test_py3c',
sources=['test_py3c.c'],
include_dirs=['../include'],
)
setup_args = dict(
name='test_py3c',
version='0.0',
description = '',
ext_modules = [test_py3c_module]
)
if __name__ == '__main__':
setup(**se... | mit | Python |
2543709c204f1dd6aca5d012e7c28193631bb74c | Use postgres standard env vars | eirki/gargbot_3000,eirki/gargbot_3000,eirki/gargbot_3000,eirki/gargbot_3000 | gargbot_3000/config.py | gargbot_3000/config.py | #! /usr/bin/env python3.6
# coding: utf-8
import os
import datetime as dt
from pathlib import Path
import pytz
from dotenv import load_dotenv
env_path = Path(".") / ".env"
load_dotenv(dotenv_path=env_path)
slack_verification_token = os.environ["slack_verification_token"]
slack_bot_user_token = os.environ["slack_bot... | #! /usr/bin/env python3.6
# coding: utf-8
import os
import datetime as dt
from pathlib import Path
import pytz
from dotenv import load_dotenv
env_path = Path(".") / ".env"
load_dotenv(dotenv_path=env_path)
slack_verification_token = os.environ["slack_verification_token"]
slack_bot_user_token = os.environ["slack_bot... | mit | Python |
281fd926786186e8f0b1ebc7d8aeb1c362310fc1 | Remove unused variable | godlygeek/LightRender,MaddAddaM/LightRender | viewer.py | viewer.py | import sys
import pygame
import pygame.locals
pygame.init()
size = width, height = 575, 575
screen = pygame.display.set_mode(size)
label_lights = False
def up_row(x_offset):
for i in range(20):
x = x_offset + (i % 2) * 0.5
y = i * 0.5
yield x, y
def down_row(x_offset):
for i in rang... | import sys
import pygame
import pygame.locals
pygame.init()
size = width, height = 575, 575
screen = pygame.display.set_mode(size)
label_lights = False
def up_row(x_offset):
for i in range(20):
x = x_offset + (i % 2) * 0.5
y = i * 0.5
yield x, y
def down_row(x_offset):
for i in rang... | mit | Python |
2321dd5b0afedb9bb4a6e894149dd636174adf2c | Bump version to 4.0.1 | oasis-open/cti-stix-elevator | stix2elevator/version.py | stix2elevator/version.py | __version__ = "4.0.1"
| __version__ = "4.0.0"
| bsd-3-clause | Python |
282ac04e49c6adef237ea30fa4dcae64e6f959d8 | Support for non-blank server roots | mgrouchy/django-stronghold,SunilMohanAdapa/django-stronghold,SunilMohanAdapa/django-stronghold | stronghold/middleware.py | stronghold/middleware.py | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | from django.contrib.auth.decorators import login_required
from stronghold import conf
class LoginRequiredMiddleware(object):
"""
Force all views to use login required
View is deemed to be public if the @public decorator is applied to the view
View is also deemed to be Public if listed in in django s... | mit | Python |
35de4045bc30a1ee0e9aaa17f0b3f370ad95d6c8 | Bump (#16) | Netflix-Skunkworks/swag-client | swag_client/__about__.py | swag_client/__about__.py | from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "swag-client"
__summary__ = ("Cloud multi-account metadata management tool.")
__uri__ = "https://github.co... | from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "swag-client"
__summary__ = ("Cloud multi-account metadata management tool.")
__uri__ = "https://github.co... | apache-2.0 | Python |
67614fb784dca6166b112ddc60254ef5e493541d | Change 9/5 to 1.8 | enzo-code/RPI.GPIO-W-D | wfinal.py | wfinal.py | import RPi.GPIO as GPIO
import pywapi
import string
import time
channels = [4, 7, 8, 9, 10, 14, 15, 17, 18, 22, 23, 24, 25]
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BCM)
GPIO.setup(channels, GPIO.OUT)
GPIO.output(channels, 0)
weather = pywapi.get_weather_from_weather_com('33020')
temperature = int(weather['current_... | import RPi.GPIO as GPIO
import pywapi
import string
import time
channels = [4, 7, 8, 9, 10, 14, 15, 17, 18, 22, 23, 24, 25]
GPIO.setwarnings(True)
GPIO.setmode(GPIO.BCM)
GPIO.setup(channels, GPIO.OUT)
GPIO.output(channels, 0)
weather = pywapi.get_weather_from_weather_com('33020')
temperature = int(weather['current_... | mit | Python |
07f8f44fc5f69c71922bb3b85d621867d0df49fa | Support core logger as a property on the main scraper. | pombredanne/scrapekit,pudo/scrapekit,pombredanne/scrapekit,pudo/scrapekit | scrapekit/core.py | scrapekit/core.py | from uuid import uuid4
from time import time
from datetime import datetime
from threading import local
from scrapekit.config import Config
from scrapekit.tasks import TaskManager, Task
from scrapekit.http import make_session
from scrapekit.logs import make_logger
class Scraper(object):
""" Scraper application ob... | from scrapekit.config import Config
from scrapekit.tasks import TaskManager, Task
from scrapekit.http import make_session
class Scraper(object):
""" Scraper application object which handles resource management
for a variety of related functions. """
def __init__(self, name, config=None):
self.nam... | mit | Python |
6edd4114c4e715a3a0c440af455fff089a099620 | Clarify comment about Pyhton versions | pablohoffman/scrapy,pawelmhm/scrapy,finfish/scrapy,Ryezhang/scrapy,ssteo/scrapy,pawelmhm/scrapy,ssteo/scrapy,scrapy/scrapy,pawelmhm/scrapy,starrify/scrapy,ArturGaspar/scrapy,ssteo/scrapy,wujuguang/scrapy,dangra/scrapy,pablohoffman/scrapy,dangra/scrapy,elacuesta/scrapy,starrify/scrapy,scrapy/scrapy,kmike/scrapy,pablohof... | scrapy/squeues.py | scrapy/squeues.py | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | """
Scheduler queues
"""
import marshal
from six.moves import cPickle as pickle
from queuelib import queue
def _serializable_queue(queue_class, serialize, deserialize):
class SerializableQueue(queue_class):
def push(self, obj):
s = serialize(obj)
super(SerializableQueue, self).p... | bsd-3-clause | Python |
d6cdf99d87b23cd6bfd8fd7079919d89d6496501 | Complete incomplete sentence | diagramsoftware/partner-contact,open-synergy/partner-contact,acsone/partner-contact | partner_identification/models/res_partner_id_category.py | partner_identification/models/res_partner_id_category.py | # -*- coding: utf-8 -*-
#
# © 2004-2010 Tiny SPRL http://tiny.be
# © 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH
# http://www.camptocamp.at
# © 2015 Antiun Ingenieria, SL (Madrid, Spain)
# http://www.antiun.com
# Antonio Espinosa <antonioea@antiun.com>
# © 2016 ACSONE SA/NV (<http://a... | # -*- coding: utf-8 -*-
#
# © 2004-2010 Tiny SPRL http://tiny.be
# © 2010-2012 ChriCar Beteiligungs- und Beratungs- GmbH
# http://www.camptocamp.at
# © 2015 Antiun Ingenieria, SL (Madrid, Spain)
# http://www.antiun.com
# Antonio Espinosa <antonioea@antiun.com>
# © 2016 ACSONE SA/NV (<http://a... | agpl-3.0 | Python |
573d3a7411a1653f64b901077264ecb98c1f9673 | Use subprocess.check_call replace os.system | abersheeran/a2wsgi | script/version.py | script/version.py | import importlib
import os
import sys
import subprocess
here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_version() -> str:
"""
Return version.
"""
sys.path.insert(0, here)
return importlib.import_module("a2wsgi").__version__
os.chdir(here)
subprocess.check_call(f"poetr... | import importlib
import os
import sys
here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_version() -> str:
"""
Return version.
"""
sys.path.insert(0, here)
return importlib.import_module("a2wsgi").__version__
os.chdir(here)
os.system(f"poetry version {get_version()}")
os... | apache-2.0 | Python |
487f7a2235e8541670fc0e9949dd3c0fb80eb932 | fix formatting | subutai/nupic.research,mrcslws/nupic.research,numenta/nupic.research,mrcslws/nupic.research,subutai/nupic.research,numenta/nupic.research | projects/dendrites/permutedMNIST/experiments/__init__.py | projects/dendrites/permutedMNIST/experiments/__init__.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 | Python |
6fbfa11a6f13f8271687a83fc4de68f62d4a4501 | Fix encrpytion with custom salt | dgengtek/scripts,dgengtek/scripts | crypto/encrypt.py | crypto/encrypt.py | #!/bin/env python3
"""
Encrypt password with salt for unix
Usage:
encrypt.py [options] [--rounds <count>] [--sha512 | --sha256 | --md5 | --crypt] [<salt>]
Options:
--sha512
--sha256
--md5
--crypt
-r, --rounds <count> rounds[default: 1000]
"""
import sys
import crypt
from getpass import getpas... | #!/bin/env python3
"""
Encrypt password with salt for unix
Usage:
encrypt.py [options] [--sha512 | --sha256 | --md5 | --crypt] [<salt>]
Options:
--sha512
--sha256
--md5
--crypt
"""
import sys
import crypt
from getpass import getpass
from docopt import docopt
# docopt(doc, argv=None, help=True, ve... | mit | Python |
4c2f6372bb5c1db18998626049aa8e53e9889452 | Fix an invalid build dependency. | google/syzygy,Eloston/syzygy,google/syzygy,google/syzygy,google/syzygy,Eloston/syzygy | syzygy/trace/rpc/rpc.gyp | syzygy/trace/rpc/rpc.gyp | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | # Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | Python |
9843dab8e7e5c3cf7087cadf095339fb1f590ee3 | Sort files by uploading date | pavelulyashev/django-mes-fichiers,pavelulyashev/django-mes-fichiers | src/apps/file_uploader/models.py | src/apps/file_uploader/models.py | from django.contrib.auth.models import User
from django.db import models
from easy_thumbnails.fields import ThumbnailerField
from easy_thumbnails.alias import aliases
class MonFileManager(models.Manager):
def get_query_set(self):
queryset = super(MonFileManager, self).get_query_set()
return query... | from django.contrib.auth.models import User
from django.db import models
from easy_thumbnails.fields import ThumbnailerField
from easy_thumbnails.alias import aliases
class MonFile(models.Model):
name = models.CharField(max_length=100, blank=True)
file = ThumbnailerField(max_length=100, upload_to='monfile/%Y... | bsd-3-clause | Python |
bf87d7a60f20d9811fe2ff2c579f52b3e77a1ed3 | Remove unneeded print statement. | ucb-sejits/ctree,ucb-sejits/ctree,mbdriscoll/ctree | ctree/c/dotgen.py | ctree/c/dotgen.py | """
DOT generator for C constructs.
"""
from ctree.dotgen import DotGenLabeller
from ctree.types import codegen_type
class CDotGenLabeller(DotGenLabeller):
"""
Manages generation of DOT.
"""
def visit_SymbolRef(self, node):
s = r""
if node._global:
s += r"__global "
... | """
DOT generator for C constructs.
"""
from ctree.dotgen import DotGenLabeller
from ctree.types import codegen_type
class CDotGenLabeller(DotGenLabeller):
"""
Manages generation of DOT.
"""
def visit_SymbolRef(self, node):
s = r""
if node._global:
s += r"__global "
... | bsd-2-clause | Python |
50861c6d256438afd880aebbb3a19ea360367fac | upgrade IdentityDetailSerializer to DRF3 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | api/serializers/identity_detail_serializer.py | api/serializers/identity_detail_serializer.py | from core.models.identity import Identity
from rest_framework import serializers
class IdentityDetailSerializer(serializers.ModelSerializer):
# created_by = serializers.CharField(source='creator_name')
quota = serializers.ReadOnlyField(source='get_quota_dict')
provider_id = serializers.ReadOnlyField(sourc... | from core.models.identity import Identity
from rest_framework import serializers
class IdentityDetailSerializer(serializers.ModelSerializer):
created_by = serializers.CharField(source='creator_name')
quota = serializers.Field(source='get_quota_dict')
provider_id = serializers.Field(source='provider.uuid')... | apache-2.0 | Python |
1e4d80c50aaf253fd2bad9a2139737d8bf8dc927 | fix escape sequence DeprecationWarning (#1595) | Farama-Foundation/Gymnasium,Farama-Foundation/Gymnasium | gym/spaces/discrete.py | gym/spaces/discrete.py | import numpy as np
from .space import Space
class Discrete(Space):
r"""A discrete space in :math:`\{ 0, 1, \\dots, n-1 \}`.
Example::
>>> Discrete(2)
"""
def __init__(self, n):
assert n >= 0
self.n = n
super(Discrete, self).__init__((), np.int64)
def sample(sel... | import numpy as np
from .space import Space
class Discrete(Space):
"""A discrete space in :math:`\{ 0, 1, \dots, n-1 \}`.
Example::
>>> Discrete(2)
"""
def __init__(self, n):
assert n >= 0
self.n = n
super(Discrete, self).__init__((), np.int64)
... | mit | Python |
50248c3989624f935a4ff2a80229b997ca77f5c2 | fix generator issue | sobhe/hazm,sobhe/hazm,hesamd/hazm,sobhe/hazm | hazm/SequenceTagger.py | hazm/SequenceTagger.py | # coding: utf8
from __future__ import unicode_literals
from nltk.tag.api import TaggerI
from wapiti import Model
class SequenceTagger(TaggerI):
""" wrapper for [Wapiti](http://wapiti.limsi.fr) sequence tagger
>>> tagger = SequenceTagger(patterns=['*', 'U:word-%x[0,0]'])
>>> tagger.train([[('من', 'PRO'), ('به', '... | # coding: utf8
from __future__ import unicode_literals
from nltk.tag.api import TaggerI
from wapiti import Model
class SequenceTagger(TaggerI):
""" wrapper for [Wapiti](http://wapiti.limsi.fr) sequence tagger
>>> tagger = SequenceTagger(patterns=['*', 'U:word-%x[0,0]'])
>>> tagger.train([[('من', 'PRO'), ('به', '... | mit | Python |
649a70d825d2182e3d5a4f42a83f377b66043e09 | bump version | yandex/yandex-tank,yandex/yandex-tank | yandextank/version.py | yandextank/version.py | VERSION = '1.17.2'
| VERSION = '1.17.1'
| lgpl-2.1 | Python |
60d93c3ade6f465e627c6c47c17d9c86e2b52f2a | Handle None challenge | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | app/grandchallenge/core/context_processors.py | app/grandchallenge/core/context_processors.py | import logging
from django.conf import settings
from guardian.shortcuts import get_perms
from guardian.utils import get_anonymous_user
logger = logging.getLogger(__name__)
def challenge(request):
try:
challenge = request.challenge
if challenge is None:
return {}
except Attribut... | import logging
from django.conf import settings
from guardian.shortcuts import get_perms
from guardian.utils import get_anonymous_user
logger = logging.getLogger(__name__)
def challenge(request):
try:
challenge = request.challenge
except AttributeError:
logger.warning(f"Could not get challen... | apache-2.0 | Python |
1518347c2c1ceb482031ca091d54dcae25eed083 | Refactor flip | jkoelker/zl.indicators | zl/indicators/flip.py | zl/indicators/flip.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Jason Koelker
#
# 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 ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Jason Koelker
#
# 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 ... | apache-2.0 | Python |
0be54cb28387c535bea17e6c3a1a277151b9648a | Add the url name for students_info view to gci.views.helper.url_names. | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | app/soc/modules/gci/views/helper/url_names.py | app/soc/modules/gci/views/helper/url_names.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 | Python |
65c6c0b5ac47caac71c6c1284d84c1004d348c01 | Fix imports at top of file. | Therp/partner-contact,acsone/partner-contact,open-synergy/partner-contact,diagramsoftware/partner-contact | partner_relations/model/__init__.py | partner_relations/model/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 | Python |
a056ddc885d7eb333ab323f7552bfffd35635a8a | Add period at end of plug-in description | ynotstartups/Wanhao,senttech/Cura,fieldOfView/Cura,ynotstartups/Wanhao,hmflash/Cura,totalretribution/Cura,fieldOfView/Cura,Curahelper/Cura,senttech/Cura,totalretribution/Cura,Curahelper/Cura,hmflash/Cura | plugins/ChangeLogPlugin/__init__.py | plugins/ChangeLogPlugin/__init__.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import ChangeLog
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "Changelog"),
"author": "Ul... | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import ChangeLog
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "Changelog"),
"author": "Ul... | agpl-3.0 | Python |
9d92862f903b4683f1365e7ae82dd48d60e86d34 | Add new urls, login and register | SuperNovaPOLIUSP/supernova,SuperNovaPOLIUSP/supernova,SuperNovaPOLIUSP/supernova,SuperNovaPOLIUSP/supernova | aeSupernova/urls.py | aeSupernova/urls.py | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.contrib import admin
from login import views
import login
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example... | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'aeSupernova.views.home', name='home'),
# url(... | agpl-3.0 | Python |
1fb2a774765bc46e1bc2474136f135c59006c787 | Return ConversationType in serializer | yunity/yunity-core,yunity/foodsaving-backend,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend | yunity/conversations/serializers.py | yunity/conversations/serializers.py | from rest_framework import serializers
from rest_framework.fields import CharField, DateTimeField, SerializerMethodField
from rest_framework.relations import PrimaryKeyRelatedField
from yunity.api.serializers import UserSerializer
from yunity.conversations.models import ConversationMessage as MessageModel, Conversation... | from rest_framework import serializers
from rest_framework.fields import CharField, DateTimeField
from rest_framework.relations import PrimaryKeyRelatedField
from yunity.api.serializers import UserSerializer
from yunity.conversations.models import ConversationMessage as MessageModel, ConversationType
from yunity.conver... | agpl-3.0 | Python |
255ddb1a6910e590cb454a0d4e03f51b8d7b2092 | Update setup.py console script to use cli instead of main | hackebrot/cookiedozer,hackebrot/cookiedozer | {{cookiecutter.repo_name}}/setup.py | {{cookiecutter.repo_name}}/setup.py | import sys
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
... | import sys
import os
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
... | mit | Python |
2a4e5ad6ac5e5400564d0dc9306c2ab30b9dba98 | bump version | jacobwegner/pinax-theme-bootstrap,druss16/danslist,jacobwegner/pinax-theme-bootstrap,foraliving/foraliving,foraliving/foraliving,grahamu/pinax-theme-bootstrap,jacobwegner/pinax-theme-bootstrap,grahamu/pinax-theme-bootstrap,druss16/danslist,druss16/danslist,grahamu/pinax-theme-bootstrap,foraliving/foraliving | pinax_theme_bootstrap/__init__.py | pinax_theme_bootstrap/__init__.py | __version__ = "0.1.4" | __version__ = "0.1.3" | mit | Python |
7faa33c1eff79223252d6a7c4fe5ad033383df6c | Bump version | BT-ojossen/l10n-switzerland,open-net-sarl/l10n-switzerland,open-net-sarl/l10n-switzerland,BT-ojossen/l10n-switzerland | l10n_ch_payment_slip/__openerp__.py | l10n_ch_payment_slip/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# This program is free software: you... | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# This program is free software: you... | agpl-3.0 | Python |
2e608036c8611026f9fb47a762901700891e284e | use BufferedWriter for gzip files -- 30% faster writing | Chris7/cutadapt,marcelm/cutadapt | cutadapt/xopen.py | cutadapt/xopen.py | """
Open compressed files transparently.
"""
import gzip
import sys
import io
__author__ = 'Marcel Martin'
import sys
if sys.version_info[0] >= 3:
basestring = str
from codecs import getreader, getwriter
if sys.version_info < (2, 7):
buffered_reader = lambda x: x
buffered_writer = lambda x: x
else:
buffered_re... | """
Open compressed files transparently.
"""
import gzip
import sys
import io
__author__ = 'Marcel Martin'
import sys
if sys.version_info[0] >= 3:
basestring = str
from codecs import getreader, getwriter
if sys.version_info < (2, 7):
buffered_reader = lambda x: x
else:
buffered_reader = io.BufferedReader
def ... | mit | Python |
fc683685d7df05ee0acc63a216c5b8fd99462219 | use f strings | SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci | metaci/plan/templatetags/templatehelpers.py | metaci/plan/templatetags/templatehelpers.py | """
https://simpleisbetterthancomplex.com/snippet/2016/08/22/dealing-with-querystring-parameters.html
"""
from django import template
register = template.Library()
@register.simple_tag
def relative_url(value, field_name, urlencode=None):
url = f"?{field_name}={value}"
if urlencode:
querystring = urle... | """
https://simpleisbetterthancomplex.com/snippet/2016/08/22/dealing-with-querystring-parameters.html
"""
from django import template
register = template.Library()
@register.simple_tag
def relative_url(value, field_name, urlencode=None):
url = "?{}={}".format(field_name, value)
if urlencode:
querystr... | bsd-3-clause | Python |
0430957f2b65ee0e14821027a15cfb956e976c62 | make method static | StegSchreck/RatS,StegSchreck/RatS,StegSchreck/RatS | RatS/tmdb/tmdb_ratings_inserter.py | RatS/tmdb/tmdb_ratings_inserter.py | import time
from RatS.base.base_ratings_uploader import RatingsUploader
from RatS.tmdb.tmdb_site import TMDB
class TMDBRatingsInserter(RatingsUploader):
def __init__(self, args):
super(TMDBRatingsInserter, self).__init__(TMDB(args), args)
self.url_for_csv_file_upload = self._get_url_for_csv_uploa... | import time
from RatS.base.base_ratings_uploader import RatingsUploader
from RatS.tmdb.tmdb_site import TMDB
class TMDBRatingsInserter(RatingsUploader):
def __init__(self, args):
super(TMDBRatingsInserter, self).__init__(TMDB(args), args)
self.url_for_csv_file_upload = self._get_url_for_csv_uploa... | agpl-3.0 | Python |
76f5e98aec0024fb6d015004e1f3f26434a01fc2 | Update _version.py | 4dn-dcic/tibanna,4dn-dcic/tibanna,4dn-dcic/tibanna | core/_version.py | core/_version.py | """Version information."""
# The following line *must* be the last in the module, exactly as formatted:
__version__ = "0.5.3"
| """Version information."""
# The following line *must* be the last in the module, exactly as formatted:
__version__ = "0.5.2"
| mit | Python |
92febbffb91943f13cfac8c00e55103b20645b70 | Update [MediaContainer] children with the correct `section` object | fuzeman/plex.py | plex/objects/library/container.py | plex/objects/library/container.py | from plex.objects.core.base import Property
from plex.objects.container import Container
from plex.objects.library.section import Section
class MediaContainer(Container):
section = Property(resolver=lambda: MediaContainer.construct_section)
title1 = Property
title2 = Property
identifier = Property
... | from plex.objects.core.base import Property
from plex.objects.container import Container
from plex.objects.library.section import Section
class MediaContainer(Container):
section = Property(resolver=lambda: MediaContainer.construct_section)
title1 = Property
title2 = Property
identifier = Property
... | mit | Python |
d4aa45b39eab5ce4b06d6343344afb05a0bf8582 | Fix pep8. | tryfer/tryfer | tryfer/tests/test_formatters.py | tryfer/tests/test_formatters.py | # 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
# distributed under th... | # 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
# distributed under th... | apache-2.0 | Python |
35293cecc99a629b3a185e69cf9ed3a339d9d1cf | Remove indentation level for easier review | glyph/automat | automat/_introspection.py | automat/_introspection.py | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
def copycode(template, changes):
if hasattr(code, "replace"):
return template.replace(**{"co_" + k : v for k, v in changes.items()})
names = [
"argcount", "nlocals", "stacksize", "flags", "code"... | """
Python introspection helpers.
"""
from types import CodeType as code, FunctionType as function
def copycode(template, changes):
if hasattr(code, "replace"):
return template.replace(**{"co_" + k : v for k, v in changes.items()})
else:
names = [
"argcount", "nlocals", "stacksize... | mit | Python |
9a1eb2dbe37c13c82477ed5787eeb985994cac8f | add Python2 shebang to helper.py | Lujeni/matterllo,Lujeni/matterllo,Lujeni/matterllo,Lujeni/matterllo | scripts/helper.py | scripts/helper.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
scripts.init_webhook
~~~~~~~~~~~~~~~~~~~~
A simple script to manage the webhook.
:copyright: (c) 2016 by Lujeni.
:license: BSD, see LICENSE for more details.
"""
import argparse
import sys
from trello import TrelloClient
from slugify import slugi... | # -*- coding: utf-8 -*-
"""
scripts.init_webhook
~~~~~~~~~~~~~~~~~~~~
A simple script to manage the webhook.
:copyright: (c) 2016 by Lujeni.
:license: BSD, see LICENSE for more details.
"""
import argparse
import sys
from trello import TrelloClient
from slugify import slugify
from matterllo.util... | mit | Python |
35ee18926743b6ab0356ef278da9cb14a3263246 | Print field in output | justinccdev/jjvm | jjvm.py | jjvm.py | #!/usr/bin/python
import argparse
import os
import struct
import sys
CP_STRUCT_SIZES = { 7:3, 10:5 }
###############
### CLASSES ###
###############
class MyParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
... | #!/usr/bin/python
import argparse
import os
import struct
import sys
CP_STRUCT_SIZES = { 7:3, 10:5 }
###############
### CLASSES ###
###############
class MyParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
... | apache-2.0 | Python |
b7cdab4dea63b91bbc4840ec4f0f147ac9fce7b0 | Make tests for EvapReadFile | mdpiper/topoflow-cmi-testing | tests/test_evap_read_file.py | tests/test_evap_read_file.py | #!/usr/bin/env python
# Nosetests for the TopoFlow EvapReadFile component.
import os
from nose.tools import assert_is_not_none, assert_equals
from cmt.components import EvapReadFile as Component
from . import example_dir
cfg_file = os.path.join(example_dir, 'June_20_67_evap_read_file.cfg')
var_name = 'land_surface_w... | #!/usr/bin/env python
import os
from cmt.components import EvapReadFile as Component
from . import example_dir
cfg_file = os.path.join(example_dir, 'June_20_67_evap_read_file.cfg')
# Fails because June_20_67_2D-ETrate-in.nc is missing
def test_irf():
component = Component()
component.initialize(cfg_file)
... | mit | Python |
2c6ccdacc2c4e54cf0a12618d60c963d9c67ef62 | Fix for DjangoCMS 3.5: get_cms_setting | nephila/djangocms-page-sitemap | djangocms_page_sitemap/settings.py | djangocms_page_sitemap/settings.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.sitemaps import CMSSitemap
from cms.utils.conf import get_cms_setting
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
PAGE_SITEMAP_CHANGEFREQ_DEFAULT_LIST = {
'always'... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from cms.sitemaps import CMSSitemap
from cms.utils import get_cms_setting
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
PAGE_SITEMAP_CHANGEFREQ_DEFAULT_LIST = {
'always': _('... | bsd-3-clause | Python |
f603e8b394ea2b3ed9329b6948119970eb6aaa46 | add test for transition | vicalloy/django-lb-workflow,vicalloy/django-lb-workflow,vicalloy/django-lb-workflow | lbworkflow/tests/test_transition.py | lbworkflow/tests/test_transition.py | from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from lbworkflow.core.transition import TransitionExecutor
from lbworkflow.views.helper import user_wf_info_as_dict
from .test_base import BaseTests
from .leave.models import Leave
User = get_user_model()
class TransitionExe... | from django.contrib.auth import get_user_model
from lbworkflow.core.transition import TransitionExecutor
from lbworkflow.views.helper import user_wf_info_as_dict
from .test_base import BaseTests
User = get_user_model()
class TransitionExecutorTests(BaseTests):
def test_submit(self):
leave = self.leave... | mit | Python |
51d8d354f1a75b83becad880eec7cbac86d52e74 | Convert test to pytest syntax | cichm/cookiecutter,audreyr/cookiecutter,kkujawinski/cookiecutter,drgarcia1986/cookiecutter,christabor/cookiecutter,stevepiercy/cookiecutter,atlassian/cookiecutter,tylerdave/cookiecutter,terryjbates/cookiecutter,lucius-feng/cookiecutter,letolab/cookiecutter,vintasoftware/cookiecutter,michaeljoseph/cookiecutter,agconti/c... | tests/test_generate_files.py | tests/test_generate_files.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_files
-------------------
Test formerly known from a unittest residing in test_generate.py named
TestGenerateFiles.test_generate_files_nontemplated_exception
TestGenerateFiles.test_generate_files
"""
from __future__ import unicode_literals
import os
imp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_generate_files
-------------------
Test formerly known from a unittest residing in test_generate.py named
TestGenerateFiles.test_generate_files_nontemplated_exception
TestGenerateFiles.test_generate_files
"""
from __future__ import unicode_literals
import os
imp... | bsd-3-clause | Python |
c4963df740e82d476500d2d998b288d0213806ee | Allow searching in the authorization code admin. | cc-archive/commoner,cc-archive/commoner | src/commoner/promocodes/admin.py | src/commoner/promocodes/admin.py | from django.contrib import admin
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import HiddenInput
from commoner.promocodes.models import PromoCode
class PromoCodeAdminForm(forms.ModelForm):
code = forms.CharField(initial='', widget=HiddenInput())
s... | from django.contrib import admin
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.forms.widgets import HiddenInput
from commoner.promocodes.models import PromoCode
class PromoCodeAdminForm(forms.ModelForm):
code = forms.CharField(initial='', widget=HiddenInput())
s... | agpl-3.0 | Python |
442f6c9eae5c64c3438f89c2968b0343c1f4ed6e | Revise script docstring | bowen0701/algorithms_data_structures | alg_find_peak_1D.py | alg_find_peak_1D.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
"""Find a peak in 1D array.
Support a is an array of length n.
If a is an array of length 1, a[0] is a peak.
In general, a[k] is a peak iff a[k] >= a[k - 1] and a[k] >= a[k + 1].
If a[0] >=... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
"""Find a peak in 1D array.
Support a is an array of length n.
If a is an array of length 1, a[0] is a peak.
In general k, a[k] is a peak iff a[k] >= a[k - 1] and a[k] >= a[k + 1].
If a[0] ... | bsd-2-clause | Python |
545f04982267a34daaacc3afb94cd50db3821550 | Update ghost.py | MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab,MyRobotLab/pyrobotlab | home/Humanoid/ghost.py | home/Humanoid/ghost.py | ###################################################
# This is a basic script to carry on a conversation
# with ghost
###################################################
# create service
ghost = Runtime.start("ghost", "WebGui")
ear = Runtime.start("ear", "WebkitSpeechRecognition")
ghostchat = Runtime.start("ghostchat"... | ###################################################
# This is a basic script to carry on a conversation
# with ghost
###################################################
# create service
ghost = Runtime.start("ghost", "WebGui")
ear = Runtime.start("ear", "WebkitSpeechRecognition")
ghostchat = Runtime.start("ghostchat"... | apache-2.0 | Python |
64938b5bb185f7f38716c166a2aa59a0713bc989 | fix for sqlite test db | zbyte64/django-hyperadmin | tests/runtests.py | tests/runtests.py | """
Test support harness for doing setup.py test.
See http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/.
"""
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
# Bootstrap Django's settings.
from django.conf import settings
settings.DATABASES = {
'defau... | """
Test support harness for doing setup.py test.
See http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/.
"""
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.test_settings'
# Bootstrap Django's settings.
from django.conf import settings
settings.DATABASES = {
'defau... | bsd-3-clause | Python |
05f28064187c56d70d8f50c920676b81b7eb9f32 | make test run faster | waylonflinn/bvec,tailwind/bdot | bdot/tests/test_carray.py | bdot/tests/test_carray.py | import nose
import bdot
import bcolz
import numpy as np
from numpy.testing import assert_array_equal
def test_dot_int64():
matrix = np.random.random_integers(0, 12000, size=(30000, 100))
bcarray = bdot.carray(matrix, chunklen=2**13, cparams=bcolz.cparams(clevel=2))
v = bcarray[0]
result = bcarray.dot(v)
expe... | import nose
import bdot
import bcolz
import numpy as np
from numpy.testing import assert_array_equal
def test_dot_int64():
matrix = np.random.random_integers(0, 12000, size=(300000, 100))
bcarray = bdot.carray(matrix, chunklen=2**13, cparams=bcolz.cparams(clevel=2))
v = bcarray[0]
result = bcarray.dot(v)
exp... | mit | Python |
5e2f393238d976e576b390b668c7ce2f13a1e0c1 | Update to use Py3 print() (#1142) | flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc,flutter-webrtc/flutter-webrtc | example/scripts/add-line.py | example/scripts/add-line.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from __future__ import print_function
import sys
import getopt
import re
def findLine(pattern, fp):
line = fp.readline()
line_number = 1
while line:
#print("Line {}: {}".format(line_number, line.strip()))
if pattern in line:
return lin... | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
import getopt
import re
def findLine(pattern, fp):
line = fp.readline()
line_number = 1
while line:
#print("Line {}: {}".format(line_number, line.strip()))
if pattern in line:
return line_number
line = fp.readline()
... | mit | Python |
06cb55639d2bc504d0ec1b9fb073c40e00751328 | Disable output example_pic.png if exists | tosh1ki/pyogi,tosh1ki/pyogi | doc/sample_code/demo_plot_state.py | doc/sample_code/demo_plot_state.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from pyogi.board import Board
from pyogi.plot import plot_board
if __name__ == '__main__':
board = Board()
board.set_initial_state()
board.players = ['先手', '後手']
board.move('+7776FU')
board.move('-3334FU')
board.move('+2868HI')
bo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pyogi.board import Board
from pyogi.plot import plot_board
if __name__ == '__main__':
board = Board()
board.set_initial_state()
board.players = ['先手', '後手']
board.move('+7776FU')
board.move('-3334FU')
board.move('+2868HI')
board.move('... | mit | Python |
75f8a41c00e06f52102bf5f87a093d4ffef34f97 | simplify the saving/loading of the lists | StoDevX/course-data-tools,StoDevX/course-data-tools | lib/maintain_lists_of_entries.py | lib/maintain_lists_of_entries.py | from .load_data_from_file import load_data_from_file
from .save_data import save_data
from .paths import mappings_path
import json
import os
def maintain_lists_of_entries(all_courses):
data_sets = {
'departments': set(),
'instructors': set(),
'times': set(),
'locations': set(),
... | from .load_data_from_file import load_data_from_file
from .save_data import save_data
from .paths import mappings_path
import json
import os
def maintain_lists_of_entries(all_courses):
data_sets = {
'departments': set(),
'instructors': set(),
'times': set(),
'locations': set(),
... | mit | Python |
f3c6a888b4462e2fab43faba6dbe2af4bafff1bb | Update add-snmpproxy-collector.py | Orange-OpenSource/opnfv-cloudify-clearwater,Orange-OpenSource/opnfv-cloudify-clearwater | scripts/monitoring/proxy_snmp/add-snmpproxy-collector.py | scripts/monitoring/proxy_snmp/add-snmpproxy-collector.py | from cloudify import ctx
from cloudify import exceptions
import diamond_agent.tasks as diamond
import os
workdir = ctx.plugin.workdir
paths = diamond.get_paths(workdir.replace("script","diamond"))
name = 'SNMPProxyCollector'
collector_dir = os.path.join(paths['collectors'], name)
if not os.path.exists(collector_dir):... | from cloudify import ctx
from cloudify import exceptions
import diamond_agent.tasks as diamond
import os
paths = diamond.get_paths(ctx.plugin.workdir)
name = 'SNMPProxyCollector'
collector_dir = os.path.join(paths['collectors'], name)
if not os.path.exists(collector_dir):
os.mkdir(collector_dir)
collector_fi... | apache-2.0 | Python |
c9027e8aebe853d1c85fcac24b09caeb8ea5f403 | Bump version to 0.3.0 | Z2PackDev/bands_inspect,Z2PackDev/bands_inspect | bands_inspect/__init__.py | bands_inspect/__init__.py | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | # -*- coding: utf-8 -*-
# (c) 2017-2019, ETH Zurich, Institut fuer Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
"""
A tool for modifying, comparing and plotting electronic bandstructures.
"""
from . import kpoints
from . import eigenvals
from . import compare
from . import lattice
from . import plot
... | apache-2.0 | Python |
889a2608d1d4038a8c7ee1c445530fd1750c00e0 | Optimize styling according to pylint | aleju/ner-crf | preprocessing/collect_unigrams.py | preprocessing/collect_unigrams.py | # -*- coding: utf-8 -*-
"""
File to collect all unigrams and all name-unigrams (label PER) from a corpus file.
The corpus file must have one document/article per line. The words must be labeled in the
form word/LABEL.
Example file content:
Yestarday John/PER Doe/PER said something amazing.
... | # -*- coding: utf-8 -*-
"""
File to collect all unigrams and all name-unigrams (label PER) from a corpus file.
The corpus file must have one document/article per line. The words must be labeled in the
form word/LABEL.
Example file content:
Yestarday John/PER Doe/PER said something amazing.
... | mit | Python |
9b5fd8dba4885cd0cc2de10f7ff6c8066aee0277 | Fix possibles issues with pulseaudiowidget | Anthony25/barython | barython/widgets/audio.py | barython/widgets/audio.py | #!/usr/bin/env python3
import logging
from .base import SubprocessWidget
from barython.hooks.audio import PulseAudioHook
logger = logging.getLogger("barython")
class PulseAudioWidget(SubprocessWidget):
def handler(self, event, *args, **kwargs):
"""
Filter events sent by notifications
"... | #!/usr/bin/env python3
import logging
from .base import SubprocessWidget
from barython.hooks.audio import PulseAudioHook
logger = logging.getLogger("barython")
class PulseAudioWidget(SubprocessWidget):
def handler(self, event, *args, **kwargs):
"""
Filter events sent by the notifications
... | bsd-3-clause | Python |
7f113399e4277ecbbfdde41d683c22082f7e19bd | Add DOI parsing to identifiers | CenterForOpenScience/scrapi,alexgarciac/scrapi,jeffreyliu3230/scrapi,felliott/scrapi,fabianvf/scrapi,mehanig/scrapi,mehanig/scrapi,fabianvf/scrapi,erinspace/scrapi,erinspace/scrapi,felliott/scrapi,CenterForOpenScience/scrapi | scrapi/harvesters/smithsonian.py | scrapi/harvesters/smithsonian.py | '''
Harvester for the Smithsonian Digital Repository for the SHARE project
Example API call: http://repository.si.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
import re
from scrapi.base import helpers
from scrapi.base import OAIHarvester
class SiHarvester(OAIHa... | '''
Harvester for the Smithsonian Digital Repository for the SHARE project
Example API call: http://repository.si.edu/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class SiHarvester(OAIHarvester):
short_name = 'smithsonian'
... | apache-2.0 | Python |
b65a2ee41d16efd1a056727e59c229eb8258070f | set deafult DB_host as localhost | carljm/django-model-utils,carljm/django-model-utils | tests/settings.py | tests/settings.py | import os
INSTALLED_APPS = (
'model_utils',
'tests',
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ.get("DB_NAME", "modelutils"),
"USER": os.environ.get("DB_USER", 'postgres'),
"PASSWORD": os.environ.get("DB_PASSWORD", "")... | import os
INSTALLED_APPS = (
'model_utils',
'tests',
)
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": os.environ.get("DB_NAME", "modelutils"),
"USER": os.environ.get("DB_USER", 'postgres'),
"PASSWORD": os.environ.get("DB_PASSWORD", "")... | bsd-3-clause | Python |
dcf7af23fa237cd761f1a589e2e268875d296841 | Test settings updated | slasyz/django-precise-bbcode,slasyz/django-precise-bbcode | tests/settings.py | tests/settings.py | # -*- coding: utf-8 -*-
# Standard library imports
import os
# Third party imports
from django.conf import global_settings as default_settings
from django.conf import settings
# Local application / specific library imports
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
TEST_SETTINGS = {
'DEBUG': Fals... | # -*- coding: utf-8 -*-
# Standard library imports
import os
# Third party imports
from django.conf import global_settings as default_settings
from django.conf import settings
# Local application / specific library imports
TEST_ROOT = os.path.abspath(os.path.dirname(__file__))
TEST_SETTINGS = {
'DEBUG': Fals... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.