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
a01a3f9c07e0e5d93fc664df118c6085668410c1
Fix a test class name
thombashi/sqlitebiter,thombashi/sqlitebiter
test/test_url_subcommand.py
test/test_url_subcommand.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function import responses import simplesqlite from click.testing import CliRunner from sqlitebiter._enum import ExitCode from sqlitebiter.sqlitebiter import cmd from .common import print_traceback ...
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import print_function import responses import simplesqlite from click.testing import CliRunner from sqlitebiter._enum import ExitCode from sqlitebiter.sqlitebiter import cmd from .common import print_traceback ...
mit
Python
b958ef4c01405189cfe7181f4f4aff6f14072c64
use gettext_lazy in settings
rsalmaso/django-fluo-coupons,rsalmaso/django-fluo-coupons
coupons/settings.py
coupons/settings.py
# Copyright (C) 2016-2017, Raffaele Salmaso <raffaele@salmaso.org> # Copyright (C) 2013, byteweaver # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must re...
# Copyright (C) 2016-2017, Raffaele Salmaso <raffaele@salmaso.org> # Copyright (C) 2013, byteweaver # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must re...
bsd-3-clause
Python
28b0e7487158f3de83c786bffb63889311faa62c
Comment out unused html_static_path Sphinx setting
TangledWeb/tangled.mako
docs/conf.py
docs/conf.py
import datetime import pkg_resources import sphinx_rtd_theme # -- General configuration ------------------------------------------------ current_year = datetime.datetime.today().year project = 'tangled.mako' author = 'Wyatt Baldwin' copyright = '2013-{} {}'.format(current_year, author) # The short X.Y |version| ver...
import datetime import pkg_resources import sphinx_rtd_theme # -- General configuration ------------------------------------------------ current_year = datetime.datetime.today().year project = 'tangled.mako' author = 'Wyatt Baldwin' copyright = '2013-{} {}'.format(current_year, author) # The short X.Y |version| ver...
mit
Python
3219c50787b97b5316a66ab3250716461af5d07f
update dev version after 0.44.2 tag [skip ci]
desihub/desispec,desihub/desispec
py/desispec/_version.py
py/desispec/_version.py
__version__ = '0.44.2.dev5508'
__version__ = '0.44.2'
bsd-3-clause
Python
7975c79d6c345043a7467755248402a7e48127f2
Remove debug output
geometalab/drf-utm-zone-info,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend
source/excerptexport/services/data_conversion_service.py
source/excerptexport/services/data_conversion_service.py
import os from django.conf import settings from django.core.files.storage import FileSystemStorage from django.core.files.base import ContentFile from excerptexport import settings as excerptexport_settings from excerptexport.models import OutputFile private_storage = FileSystemStorage(location=settings.PRIVATE_MED...
import os from django.conf import settings from django.core.files.storage import FileSystemStorage from django.core.files.base import ContentFile from excerptexport import settings as excerptexport_settings from excerptexport.models import OutputFile private_storage = FileSystemStorage(location=settings.PRIVATE_MED...
isc
Python
15211b77985f38d60b9891977501c18941917c93
bump version after tag
desihub/desiutil,desihub/desiutil
py/desiutil/_version.py
py/desiutil/_version.py
__version__ = '3.1.0.dev862'
__version__ = '3.1.0'
bsd-3-clause
Python
4ca46ead1e1de522ad512dc2755c80d35f93455f
Fix minor comment indentation
sagersmith8/ai_graph_coloring,sagersmith8/ai_graph_coloring
ai_graph_color/line.py
ai_graph_color/line.py
class Line: def __init__(self, point_a, point_b): """ Make a new line from two points. :param point_a: one of the points on the line :type point_a: tuple(float, float) :param point_b: one of the points on the line :type point_b: tuple(float, float) """ ...
class Line: def __init__(self, point_a, point_b): """ Make a new line from two points. :param point_a: one of the points on the line :type point_a: tuple(float, float) :param point_b: one of the points on the line :type point_b: tuple(float, float) """ ...
mit
Python
0f4b897d4b637abafb8efb5607a8285587429fd9
Bump the version to 4.1.1a1
blueyed/coveragepy,blueyed/coveragepy,blueyed/coveragepy,hugovk/coveragepy,nedbat/coveragepy,hugovk/coveragepy,hugovk/coveragepy,hugovk/coveragepy,nedbat/coveragepy,blueyed/coveragepy,nedbat/coveragepy,nedbat/coveragepy,nedbat/coveragepy,hugovk/coveragepy,blueyed/coveragepy
coverage/version.py
coverage/version.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. version_info = (4, 1, 1,...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """The version and URL for coverage.py""" # This file is exec'ed in setup.py, don't import anything! # Same semantics as sys.version_info. version_info = (4, 1, 0,...
apache-2.0
Python
90f4c75f1506b7c7e4738d12c10e88192a1460da
use unbreakable key
baverman/vial-cramp
vial-plugin/cramp/__init__.py
vial-plugin/cramp/__init__.py
from vial import vim, register_function from vial.utils import get_key_code, get_ws, parse_keys BRACKETS = ( ('(', ')'), ('[', ']'), ('{', '}'), ('\'', '\''), ('"', '"'), ) OPEN2CLOSE = dict(BRACKETS) def init(): register_function('<SID>BS()', backspace) register_function('<SID>CR()', cr)...
from vial import vim, register_function from vial.utils import get_key_code, get_ws, parse_keys BRACKETS = ( ('(', ')'), ('[', ']'), ('{', '}'), ('\'', '\''), ('"', '"'), ) OPEN2CLOSE = dict(BRACKETS) def init(): register_function('<SID>BS()', backspace) register_function('<SID>CR()', cr)...
mit
Python
4c9e18f39908e9b1a36989b3e4097ca458d94af4
Use the current year in the copyright
jaimeMF/youtube-dl-api-server,apllicationCOM/youtube-dl-api-server,apllicationCOM/youtube-dl-api-server,jaimeMF/youtube-dl-api-server,apllicationCOM/youtube-dl-api-server,jaimeMF/youtube-dl-api-server
docs/conf.py
docs/conf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import sys sys.path.insert(0, os.path.dirname(os.path.abspath('.'))) import youtube_dl_server as ydl_server # -- General configuration ----------------------------------------------------- # Add any Sphin...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import os sys.path.insert(0, os.path.dirname(os.path.abspath('.'))) import youtube_dl_server as ydl_server # -- General configuration ----------------------------------------------------- # Add any Sphinx extension modu...
unlicense
Python
cb1af6542fdaf73ec8a7c37ecbd4ae0bcb4c8f5e
Remove unused import
benmurden/django-country-select-js,benmurden/django-country-select-js
country_select_js/widgets.py
country_select_js/widgets.py
import json from django import forms class CountrySelectWidget(forms.TextInput): class Media: css = { 'all': ('country_select_js/css/countrySelect.min.css',), } js = ('country_select_js/js/countrySelect.min.js', 'country_select_js/js/init.js') def __init__(self, attrs=Non...
import json from django import forms from django.utils.html import format_html class CountrySelectWidget(forms.TextInput): class Media: css = { 'all': ('country_select_js/css/countrySelect.min.css',), } js = ('country_select_js/js/countrySelect.min.js', 'country_select_js/js/i...
bsd-3-clause
Python
0582b21efc6215d010d6d828c1b3c59a5fd30173
make default VideoStreamTrack use 30fps
aiortc/aiortc
aiortc/mediastreams.py
aiortc/mediastreams.py
import asyncio import math from pyee import EventEmitter class AudioFrame: """ Audio frame, 16-bit PCM. """ def __init__(self, channels, data, sample_rate): self.channels = channels self.data = data self.sample_rate = sample_rate self.sample_width = 2 class VideoFram...
import asyncio import math from pyee import EventEmitter class AudioFrame: """ Audio frame, 16-bit PCM. """ def __init__(self, channels, data, sample_rate): self.channels = channels self.data = data self.sample_rate = sample_rate self.sample_width = 2 class VideoFram...
bsd-3-clause
Python
85e352e47f84c1f7ea0284e4386057b0e83d5ee5
Fix #2276
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/pillar/cmd_yaml.py
salt/pillar/cmd_yaml.py
''' Execute a command and read the output as YAML. The YAML data is then directly overlaid onto the minion's pillar data ''' # Import python libs import logging # Import third party libs import yaml # Set up logging log = logging.getLogger(__name__) def ext_pillar(pillar, command): ''' Execute a command an...
''' Execute a command and read the output as YAML. The YAML data is then directly overlaid onto the minion's pillar data ''' # Import python libs import logging # Import third party libs import yaml # Set up logging log = logging.getLogger(__name__) def ext_pillar(pillar, command): ''' Execute a command an...
apache-2.0
Python
e4cb642f6b9db568777b119cd3effb4dbd69ffad
Add comment to the PortAlreadyInUse fix
stackforge/akanda-rug,openstack/akanda-rug,markmcclain/astara,openstack/akanda-rug,dreamhost/akanda-rug,stackforge/akanda-rug
akanda/rug/api/nova.py
akanda/rug/api/nova.py
from novaclient.v1_1 import client from novaclient.exceptions import ClientException class Nova(object): def __init__(self, conf): self.conf = conf self.client = client.Client( conf.admin_user, conf.admin_password, conf.admin_tenant_name, auth_url=co...
from novaclient.v1_1 import client from novaclient.exceptions import ClientException class Nova(object): def __init__(self, conf): self.conf = conf self.client = client.Client( conf.admin_user, conf.admin_password, conf.admin_tenant_name, auth_url=co...
apache-2.0
Python
ba6ca1e701f7344131d3122d8db86f23f8a47896
fix docs 2
pauliacomi/pyGAPS
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import sys from unittest.mock import MagicMock extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.nap...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext...
mit
Python
875d94058d890eeef2aac94390370cb13b7c8cd8
Drop Py2 and six on tests/unit/renderers/test_toml.py
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
tests/unit/renderers/test_toml.py
tests/unit/renderers/test_toml.py
import salt.renderers.toml as toml import salt.serializers.toml from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipIf @skipIf(not salt.serializers.toml.available, "The 'toml' library is missing") class TOMLRendererTestCase(TestCase, LoaderModuleMockMixin): def setu...
# -*- coding: utf-8 -*- # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals # Import Salt libs import salt.renderers.toml as toml import salt.serializers.toml # Import Salt Testing libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import Tes...
apache-2.0
Python
ec453193bcb8e8e04905380e56d4232cc56ad5df
update dev version after 1.3.0 tag [ci skip]
desihub/desitarget,desihub/desitarget
py/desitarget/_version.py
py/desitarget/_version.py
__version__ = '1.3.0.dev5218'
__version__ = '1.3.0'
bsd-3-clause
Python
496a2a437dc2a55851eddacb03690d775481c5dc
Change Sphinx theme
xolox/python-vcs-repo-mgr,xolox/python-vcs-repo-mgr
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- """Documentation build configuration file for the `vcs-repo-mgr` package.""" import os import sys # Add the 'vcs-repo-mgr' source distribution's root directory to the module path. sys.path.insert(0, os.path.abspath('..')) # -- General configuration -------------------------------------------...
# -*- coding: utf-8 -*- """Documentation build configuration file for the `vcs-repo-mgr` package.""" import os import sys # Add the 'vcs-repo-mgr' source distribution's root directory to the module path. sys.path.insert(0, os.path.abspath('..')) # -- General configuration -------------------------------------------...
mit
Python
2762983c7d4922751471f1aa415767dffb7c1c2d
replace slashes in post id with hyphens
ruukasuu/SenPy
libsenpy.py
libsenpy.py
import hashlib, base64, flask, sys import senpy_settings as conf render_args = { "style":conf.style, "title":conf.title, } def timestamp(): return int(time.time()) def randbytes(count, b64): r = open("/dev/urandom", "rb") out = r.read(count) if b64: out = base64.b64encode(out)[:count] return out def genera...
import hashlib, base64, flask, sys import senpy_settings as conf render_args = { "style":conf.style, "title":conf.title, } def timestamp(): return int(time.time()) def randbytes(count, b64): r = open("/dev/urandom", "rb") out = r.read(count) if b64: out = base64.b64encode(out)[:count] return out def genera...
agpl-3.0
Python
ead902b0fd101523ef49a6e2e108a42006d2321b
Use `Whitespace` instead of `Text`
pygments/pygments,pygments/pygments,dscorbett/pygments,pygments/pygments,dscorbett/pygments,pygments/pygments,pygments/pygments,dscorbett/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,pygments/pygments,pygments/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,dscorb...
pygments/lexers/rita.py
pygments/lexers/rita.py
# -*- coding: utf-8 -*- """ pygments.lexers.rita ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for RITA language :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, this, \ ...
# -*- coding: utf-8 -*- """ pygments.lexers.rita ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for RITA language :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, this, \ ...
bsd-2-clause
Python
ca826c2c30e17db5dcdaa41fdc5e1016a39e2a38
Revert function calls
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/wheel/__init__.py
salt/wheel/__init__.py
# -*- coding: utf-8 -*- ''' Modules used to control the master itself ''' from __future__ import absolute_import #import python libs import os import collections # Import salt libs from salt import syspaths import salt.config import salt.loader from salt.client import mixins class WheelClient(mixins.SyncClientMixin,...
# -*- coding: utf-8 -*- ''' Modules used to control the master itself ''' from __future__ import absolute_import #import python libs import os # Import salt libs from salt import syspaths import salt.config import salt.loader from salt.client import mixins class WheelClient(mixins.SyncClientMixin, mixins.AsyncClient...
apache-2.0
Python
d93a9f1cd42628c7d8a52abf5282202096b57c53
clean test
bndl/bndl,bndl/bndl
bndl/compute/tests/test_combine_by_key.py
bndl/compute/tests/test_combine_by_key.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
ae6250d727fbd53a307d9a60eed1bcc8f0f1b9fb
Remove trailing whitespace
mpurzynski/MozDef,mozilla/MozDef,jeffbryner/MozDef,Phrozyn/MozDef,jeffbryner/MozDef,mozilla/MozDef,Phrozyn/MozDef,jeffbryner/MozDef,Phrozyn/MozDef,mpurzynski/MozDef,mpurzynski/MozDef,mozilla/MozDef,mozilla/MozDef,Phrozyn/MozDef,jeffbryner/MozDef,mpurzynski/MozDef
alerts/celeryconfig.py
alerts/celeryconfig.py
from celery import Celery from importlib import import_module from lib.config import ALERTS, LOGGING, RABBITMQ from logging.config import dictConfig # Alert files to include alerts_include = [] for alert in ALERTS.keys(): alerts_include.append('.'.join((alert).split('.')[:-1])) alerts_include = list(set(alerts_inc...
from celery import Celery from importlib import import_module from lib.config import ALERTS, LOGGING, RABBITMQ from logging.config import dictConfig # Alert files to include alerts_include = [] for alert in ALERTS.keys(): alerts_include.append('.'.join((alert).split('.')[:-1])) alerts_include = list(set(alerts_inc...
mpl-2.0
Python
50015658563c821d5b76ac4e80ed90349cd0b2e1
add Attendees for Event objects
malea/formaldatefinder,malea/formaldatefinder,malea/formaldatefinder
formaldatefinder/models.py
formaldatefinder/models.py
from django.db import models from django.forms import ModelForm from datetime import date class Event(models.Model): '''This model is the Event model. We store the name of the event, the date of the event, the sponsoring organization name, and the location of the event.''' event_name = models.Char...
from django.db import models from django.forms import ModelForm from datetime import date class Event(models.Model): '''This model is the Event model. We store the name of the event, the date of the event, the sponsoring organization name, and the location of the event.''' event_name = models.Char...
mit
Python
73efff202c281a5e4a2e1d39ad4ecc8beb58748b
Update task: define repr for ActivityTask ans WorkflowTask
botify-labs/simpleflow,botify-labs/simpleflow
simpleflow/task.py
simpleflow/task.py
from __future__ import absolute_import import json import abc import collections class Task(object): """A Task represents a work that can be scheduled for execution. """ __metaclass__ = abc.ABCMeta @abc.abstractproperty def name(self): raise NotImplementedError() @abc.abstractmetho...
from __future__ import absolute_import import json import abc import collections class Task(object): """A Task represents a work that can be scheduled for execution. """ __metaclass__ = abc.ABCMeta @abc.abstractproperty def name(self): raise NotImplementedError() @abc.abstractmetho...
mit
Python
75efe980bc36e507564aad5d4b0cd8450ea21f44
Remove 'language' configuration
click-contrib/sphinx-click
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # # sphinx-click documentation build configuration file import os import sys sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('../examples')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx...
# -*- coding: utf-8 -*- # # sphinx-click documentation build configuration file import os import sys sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('../examples')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx...
mit
Python
f279f09a92086b107203b6f32b61b0257942597c
Fix bad import.
materialsproject/pymatgen-db,materialsproject/pymatgen-db
pymatgen/db/__init__.py
pymatgen/db/__init__.py
""" Pymatgen-db is a database add-on for the Python Materials Genomics (pymatgen) materials analysis library. It enables the creation of Materials Project-style MongoDB databases for management of materials data and provides a clean and intuitive web ui for exploring that data. A query engine is also provided to enable...
""" Pymatgen-db is a database add-on for the Python Materials Genomics (pymatgen) materials analysis library. It enables the creation of Materials Project-style MongoDB databases for management of materials data and provides a clean and intuitive web ui for exploring that data. A query engine is also provided to enable...
mit
Python
fe9b8c53032dbcb2c4ae353bbee4895acfbcc80b
Bump version to 0.2.1-1
larsbutler/geomet,larsbutler/geomet,geomet/geomet,geomet/geomet
geomet/__init__.py
geomet/__init__.py
# Copyright 2013 Lars Butler & individual contributors # # 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 applicab...
# Copyright 2013 Lars Butler & individual contributors # # 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 applicab...
apache-2.0
Python
0c360dd57d57216990cd11a80183119160b1bd5a
fix some bugs
total-impact/total-impact-webapp,Impactstory/total-impact-webapp,total-impact/total-impact-webapp,Impactstory/total-impact-webapp,Impactstory/total-impact-webapp,Impactstory/total-impact-webapp,total-impact/total-impact-webapp,total-impact/total-impact-webapp
totalimpactwebapp/event_monitoring.py
totalimpactwebapp/event_monitoring.py
""" This module is for letting us know when various events happen by using alert systems like Zapier or Pagerduty. """ from totalimpactwebapp.testing import is_test_email import os import requests def new_user(slug, email): webhook_slugs = os.getenv("ZAPIER_ALERT_HOOKS", None) if (webhook_slugs is None) or is...
""" This module is for letting us know when various events happen by using alert systems like Zapier or Pagerduty. """ from totalimpactwebapp.testing import is_test_email import os import requests def new_user(slug, email): webhook_slugs = os.getenv("ZAPIER_ALERT_HOOKS", None) if webhook_slugs is None or is_t...
mit
Python
ac6639312f3c81ca685a9776578cf05e6296215d
Bump version to clean releases
pycroscopy/pycroscopy
pycroscopy/__version__.py
pycroscopy/__version__.py
version = '0.59.7' time = '2018-03-28T00:49:49+02:00'
version = '0.59.6' time = '2018-03-27T12:40:49+02:00'
mit
Python
47552ac007df104f03a73b8f01641c8d14ba4a91
Change Version
androguard/androguard,reox/androguard,androguard/androguard
androguard/__init__.py
androguard/__init__.py
# The current version of Androguard # Please use only this variable in any scripts, # to keep the version number the same everywhere. __version__ = "3.4.0"
# The current version of Androguard # Please use only this variable in any scripts, # to keep the version number the same everywhere. __version__ = "3.3.5"
apache-2.0
Python
aac1e25c13689efdda70f36ca667b199281a2187
fix nga host
icyblade/pynga
pynga/default_config.py
pynga/default_config.py
from .__version__ import __version__ DEBUG_LEVEL = 'WARNING' USER_AGENT = f'pynga/{__version__}' MAX_THREAD = 100 HOST = 'https://bbs.nga.cn' TIMEZONE = 'Asia/Shanghai' FORUM_PAGE_SLOW_QUERY_LIMIT = 500 ADMIN_LOG_TYPE_MAPPER = { '2': '评分', '3': '举报', '4': '改变标题', '6': '修改密码', '7': '签名/头像', '9':...
from .__version__ import __version__ DEBUG_LEVEL = 'WARNING' USER_AGENT = f'pynga/{__version__}' MAX_THREAD = 100 HOST = 'http://bbs.ngacn.cc' TIMEZONE = 'Asia/Shanghai' FORUM_PAGE_SLOW_QUERY_LIMIT = 500 ADMIN_LOG_TYPE_MAPPER = { '2': '评分', '3': '举报', '4': '改变标题', '6': '修改密码', '7': '签名/头像', '9'...
mit
Python
0d55b7cab9fda36deb17f5d31f99a53d170467b3
fix redundant navigation in sidebar
spl0k/supysonic,spl0k/supysonic,spl0k/supysonic
docs/conf.py
docs/conf.py
# -- Project information ----------------------------------------------------- project = "Supysonic" author = "Alban Féron" copyright = "2013-2021, " + author version = "0.6.2" release = "0.6.2" # -- General configuration --------------------------------------------------- extensions = [] templates_path = [] sourc...
# -- Project information ----------------------------------------------------- project = "Supysonic" author = "Alban Féron" copyright = "2013-2021, " + author version = "0.6.2" release = "0.6.2" # -- General configuration --------------------------------------------------- extensions = [] templates_path = [] sourc...
agpl-3.0
Python
c4fb6a2bbc1145b82f58e6bf8214e8ecafdaf342
modify test
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq
custom/_legacy/hsph/tests.py
custom/_legacy/hsph/tests.py
import re from django.test import SimpleTestCase from mock import Mock import tasks def iter_cases_to_modify(): for domain in ('domain1', 'domain2', 'domain3'): for case_id in ('case1', 'case2', 'case3'): yield { 'case_id': case_id, 'update': {}, ...
import re from django.test import SimpleTestCase from mock import Mock import tasks def iter_cases_to_modify(): for domain in ('foo', 'bar', 'baz'): for case_id in ('ham', 'spam', 'eggs'): yield { 'case_id': case_id, 'update': {}, 'close': False,...
bsd-3-clause
Python
eaf74f092e73dcb832d624d9f19e9eaee5fbc244
Add linecache module to skipped modules for pytest plugin
mrbean-bremen/pyfakefs,pytest-dev/pyfakefs,mrbean-bremen/pyfakefs,jmcgeheeiv/pyfakefs
pyfakefs/pytest_plugin.py
pyfakefs/pytest_plugin.py
"""A pytest plugin for using pyfakefs as a fixture When pyfakefs is installed, the "fs" fixture becomes available. :Usage: def my_fakefs_test(fs): fs.create_file('/var/data/xx1.txt') assert os.path.exists('/var/data/xx1.txt') """ import linecache import py import pytest from pyfakefs.fake_filesystem_unittes...
"""A pytest plugin for using pyfakefs as a fixture When pyfakefs is installed, the "fs" fixture becomes available. :Usage: def my_fakefs_test(fs): fs.create_file('/var/data/xx1.txt') assert os.path.exists('/var/data/xx1.txt') """ import py import pytest from pyfakefs.fake_filesystem_unittest import Patcher ...
apache-2.0
Python
4130804ef5662482fffa70c5199b274cca07a2c1
Clean up unused options.
pombredanne/stix-validator,STIXProject/stix-validator
docs/conf.py
docs/conf.py
import os import sdv project = u'stix-validator' copyright = u'2015, The MITRE Corporation' version = sdv.__version__ release = version extensions = [ 'sphinx.ext.autodoc', 'sphinxcontrib.napoleon', ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' rst_prolog = """ **Version**: ...
import os import sdv project = u'stix-validator' copyright = u'2015, The MITRE Corporation' version = sdv.__version__ release = version extensions = [ 'sphinx.ext.autodoc', 'sphinxcontrib.napoleon', ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' rst_prolog = """ **Version**: ...
bsd-3-clause
Python
4640f73d5362adb75c05b6d3a1509aaf75ffb2ef
Fix doc settings
davidfischer/readthedocs.org,rtfd/readthedocs.org,safwanrahman/readthedocs.org,pombredanne/readthedocs.org,tddv/readthedocs.org,safwanrahman/readthedocs.org,rtfd/readthedocs.org,davidfischer/readthedocs.org,safwanrahman/readthedocs.org,rtfd/readthedocs.org,tddv/readthedocs.org,safwanrahman/readthedocs.org,pombredanne/r...
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- # import os import sys from recommonmark.parser import CommonMarkParser sys.path.insert(0, os.path.abspath('..')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readthedocs.settings.dev") from django.conf import settings import django django.setup() sys.path.append(os.path.abspath('_ext'...
# -*- coding: utf-8 -*- # import os import sys from recommonmark.parser import CommonMarkParser sys.path.insert(0, os.path.abspath('..')) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "readthedocs.settings.sqlite") from django.conf import settings import django django.setup() sys.path.append(os.path.abspath('_e...
mit
Python
7d05e3c6017202b380aacf0c0eb7354d9bebefd1
improve gradient table building
carolFrohlich/nipype,mick-d/nipype,FCP-INDI/nipype,carolFrohlich/nipype,mick-d/nipype,mick-d/nipype,sgiavasis/nipype,carolFrohlich/nipype,sgiavasis/nipype,sgiavasis/nipype,FCP-INDI/nipype,sgiavasis/nipype,mick-d/nipype,FCP-INDI/nipype,carolFrohlich/nipype,FCP-INDI/nipype
nipype/interfaces/dipy/base.py
nipype/interfaces/dipy/base.py
# -*- coding: utf-8 -*- from nipype.interfaces.base import (traits, File, isdefined, BaseInterface, BaseInterfaceInputSpec) class DipyBaseInterfaceInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc=('input diffusion data')) in_bval = File(ex...
# -*- coding: utf-8 -*- from nipype.interfaces.base import (traits, File, isdefined, BaseInterface, BaseInterfaceInputSpec) class DipyBaseInterfaceInputSpec(BaseInterfaceInputSpec): in_file = File(exists=True, mandatory=True, desc=('input diffusion data')) in_bval = File(ex...
bsd-3-clause
Python
895bfd0a904e71180e309c479face76b675f6523
update the test
macbre/index-digest,macbre/index-digest
indexdigest/test/linters/test_0070_insert_ignore.py
indexdigest/test/linters/test_0070_insert_ignore.py
from __future__ import print_function from unittest import TestCase from indexdigest.linters.linter_0070_insert_ignore import \ remove_comments, is_insert_ignore_query, check_insert_ignore_queries from indexdigest.test import DatabaseTestMixin, read_queries_from_log class TestInsertIgnore(TestCase, DatabaseTest...
from __future__ import print_function from unittest import TestCase from indexdigest.linters.linter_0070_insert_ignore import \ remove_comments, is_insert_ignore_query, check_insert_ignore_queries from indexdigest.test import DatabaseTestMixin, read_queries_from_log class TestInsertIgnore(TestCase, DatabaseTest...
mit
Python
85b5760debf12186446c93be852e0bf043f9ca9d
Fix crashes on texts without named entities
WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln,WhatWorksWhenForWhom/nlppln
nlppln/commands/replace_ner.py
nlppln/commands/replace_ner.py
#!/usr/bin/env python import click import os import codecs import json import pandas as pd @click.command() @click.argument('ner_csv_file', type=click.Path(exists=True)) @click.argument('input_files', nargs=-1, type=click.Path(exists=True)) @click.argument('output_dir', nargs=1, type=click.Path()) @click.option('--mo...
#!/usr/bin/env python import click import os import codecs import json import pandas as pd @click.command() @click.argument('ner_csv_file', type=click.Path(exists=True)) @click.argument('input_files', nargs=-1, type=click.Path(exists=True)) @click.argument('output_dir', nargs=1, type=click.Path()) @click.option('--mo...
apache-2.0
Python
c83d437f4f73623358f40cd49c4dbeb1d2b3e2f8
Move redis import
socketubs/carotte,socketubs/carotte
carotte/results/backends/redis_backend.py
carotte/results/backends/redis_backend.py
# -*- coding: utf-8 -*- import pickle from datetime import datetime from . import Base class Redis(Base): def __init__(self, host='localhost', port=6379, db=0): import redis self.r = redis.StrictRedis(host=host, port=port, db=db) def add_task(self, task): self.r.set('task_%s' % task....
# -*- coding: utf-8 -*- import redis import pickle from datetime import datetime from . import Base class Redis(Base): def __init__(self, host='localhost', port=6379, db=0): self.r = redis.StrictRedis(host=host, port=port, db=db) def add_task(self, task): self.r.set('task_%s' % task.id, pick...
mit
Python
3314a2f9d717240a74698e0150a5dd5852cd6235
Update scan.py to follow the new model better
sait-berkeley-infosec/pynessus-api
nessusapi/scan.py
nessusapi/scan.py
from nessusapi.session import request, HTTPError class Scan: def __init__(self, target, scan_name, policy): self.target = target self.name = scan_name self.policy = policy self.uuid = None try: self.uuid = request('scan/new', target=self.target, ...
from nessusapi.session import request, HTTPError class Scan: def __init__(self, target, scan_name, policy): self.target = target self.name = scan_name self.policy = policy self.uuid = None def start(self): if self.uuid: raise BadRequestError('Scan already s...
mit
Python
28213ea2a21bb12cf346daca4adbc12902c9f4ea
Update pylsy_test.py
huiyi1990/Pylsy,gnithin/Pylsy,muteness/Pylsy,muteness/Pylsy,bcho/Pylsy,gnithin/Pylsy,bcho/Pylsy,huiyi1990/Pylsy
pylsy/tests/pylsy_test.py
pylsy/tests/pylsy_test.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest import sys sys.path.append('..') from pylsy import pylsytable class PylsyTableTests(unittest.TestCase): def setUp(self): attributes = ["name", "age"] self.table = pylsytable(attributes) def tearDown(self): ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest from pylsy import pylsytable import sys sys.path.append('..') class PylsyTableTests(unittest.TestCase): def setUp(self): attributes = ["name", "age"] self.table = pylsytable(attributes) def tearDown(self): ...
mit
Python
08049b6d95677d3e46dae227a726452b8bbe099b
Remove unnecessary Exception catch
LilithWittmann/froide,stefanw/froide,fin/froide,catcosmo/froide,CodeforHawaii/froide,fin/froide,LilithWittmann/froide,ryankanno/froide,CodeforHawaii/froide,stefanw/froide,CodeforHawaii/froide,okfse/froide,ryankanno/froide,fin/froide,CodeforHawaii/froide,okfse/froide,stefanw/froide,LilithWittmann/froide,okfse/froide,cat...
froide/frontpage/models.py
froide/frontpage/models.py
from django.db import models from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.contrib.sites.managers import CurrentSiteManager from foirequest.models import FoiRequest class FeaturedRequestManager(CurrentSiteManage...
from django.db import models from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.contrib.sites.managers import CurrentSiteManager from foirequest.models import FoiRequest class FeaturedRequestManager(CurrentSiteManage...
mit
Python
0770a8e77463ee70851404a37138da050aead5bb
Add units to Core import.
tallakahath/pymatgen,matk86/pymatgen,aykol/pymatgen,matk86/pymatgen,gpetretto/pymatgen,setten/pymatgen,tschaume/pymatgen,ndardenne/pymatgen,gVallverdu/pymatgen,dongsenfo/pymatgen,johnson1228/pymatgen,montoyjh/pymatgen,johnson1228/pymatgen,nisse3000/pymatgen,ndardenne/pymatgen,tschaume/pymatgen,davidwaroquiers/pymatgen,...
pymatgen/core/__init__.py
pymatgen/core/__init__.py
""" This package contains core modules and classes for representing structures and operations on them. """ __author__ = "Shyue Ping Ong" __date__ = "Dec 15, 2010 7:21:29 PM" from .periodic_table import * from .composition import * from .structure import * from .structure_modifier import * from .bonds import * from .l...
""" This package contains core modules and classes for representing structures and operations on them. """ __author__ = "Shyue Ping Ong" __date__ = "Dec 15, 2010 7:21:29 PM" from .periodic_table import * from .composition import * from .structure import * from .structure_modifier import * from .bonds import * from .l...
mit
Python
30a1a9b0922d063dc1511462ef04ac75a00d186e
Update __init__.py
pyQode/pyqode.python,mmolero/pyqode.python,zwadar/pyqode.python,pyQode/pyqode.python
pyqode/python/__init__.py
pyqode/python/__init__.py
# -*- coding: utf-8 -*- """ pyqode.python is an extension of pyqode.core that brings support for the python programming language. It provides a set of additional modes and panels for the frontend and a series of worker for the backend (code completion, documentation lookups, code linters, and so on...). """ __version...
# -*- coding: utf-8 -*- """ pyqode.python is an extension of pyqode.core that brings support for the python programming language. It provides a set of additional modes and panels for the frontend and a series of worker for the backend (code completion, documentation lookups, code linters, and so on...). """ __version...
mit
Python
6db5dc7c481382e582b3694567080458e8e9323a
remove unused theme
treasure-data/td-client-python
docs/conf.py
docs/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
apache-2.0
Python
4dbb597eb0acb634fb603087e4bbcca04ec47875
Remove dev from version
kiip/statsite
statsite/__init__.py
statsite/__init__.py
""" Statsite package contains all the classes related to statsite. """ __version__ = "0.5.0"
""" Statsite package contains all the classes related to statsite. """ __version__ = "0.5.0.dev"
bsd-3-clause
Python
83766673d477951aa723247085163c77f5819198
revert swarm size
F483/storjspec,F483/storjspec,Storj/storjspec,Storj/storjspec
storjnet/test_dht.py
storjnet/test_dht.py
import os import random import unittest import pyjsonrpc # FIXME add to readme documentation SWARMSIZE = int(os.environ.get("STORJNET_SWARMSIZE", "5")) USER_HOST = os.environ.get("STORJNET_USER_HOST", "127.0.0.1") USER_START_PORT = int(os.environ.get("STORJNET_USER_START_PORT", "5000")) class TestDhtUserApi(unittes...
import os import random import unittest import pyjsonrpc # FIXME add to readme documentation SWARMSIZE = int(os.environ.get("STORJNET_SWARMSIZE", "10")) USER_HOST = os.environ.get("STORJNET_USER_HOST", "127.0.0.1") USER_START_PORT = int(os.environ.get("STORJNET_USER_START_PORT", "5000")) class TestDhtUserApi(unitte...
mit
Python
7255033298cad9a4a7c51bdceafe84c0536e78ba
Change the API and add a test and documentation
scottza/PyTOPKAPI,sahg/PyTOPKAPI
pytopkapi/infiltration.py
pytopkapi/infiltration.py
"""Infiltration module. """ import numpy as np from scipy.optimize import fsolve def _green_ampt_cum_eq(F, psi, dtheta, K, t): """The Green-Ampt cumulative infiltration equation """ tmp = psi*dtheta # np.log(x) computes ln(x) return F - tmp*np.log(1 + F/tmp) - K*t def green_ampt_cum_infiltratio...
"""Infiltration module. """ import numpy as np from scipy.optimize import fsolve def green_ampt_cum_infiltration(F, psi, dtheta, K, t): """The Green-Ampt cumulative infiltration equation. """ tmp = psi*dtheta # np.log(x) computes ln(x) return F - tmp*np.log(1 + F/tmp) - K*t if __name__ == '...
bsd-3-clause
Python
782b6ec66ff41c022d0192b449f9f4a1ca14d2fb
Add attr.gpu decorator
keisuke-umezawa/chainer,niboshi/chainer,hvy/chainer,woodshop/chainer,keisuke-umezawa/chainer,wkentaro/chainer,cupy/cupy,pfnet/chainer,ktnyt/chainer,hidenori-t/chainer,tigerneil/chainer,ktnyt/chainer,chainer/chainer,kikusu/chainer,delta2323/chainer,muupan/chainer,elviswf/chainer,t-abe/chainer,keisuke-umezawa/chainer,aon...
tests/functions_tests/test_dropout.py
tests/functions_tests/test_dropout.py
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import testing from chainer.testing import attr if cuda.available: cuda.init() class TestDropout(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(-1, 1, (2, 3)).astype...
import unittest import numpy import chainer from chainer import cuda from chainer import functions from chainer import testing from chainer.testing import attr if cuda.available: cuda.init() class TestDropout(unittest.TestCase): def setUp(self): self.x = numpy.random.uniform(-1, 1, (2, 3)).astype...
mit
Python
a3684b7221ce6af0b076f9ac45277941410b2e51
Test with 3 senders instead of two
freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut
tests/causalorderingtest.py
tests/causalorderingtest.py
#!/usr/bin/env python from twisted.internet import reactor from mesh import Mesh from mesh import MeshNode import sys nodes = [] # We're optimists success = True class TestMeshNode(MeshNode): def unknownOutput(self, line): if (self.name == "node3"): MeshNode.unknownOutput(self, line) class TestMesh(Mesh...
#!/usr/bin/env python from twisted.internet import reactor from mesh import Mesh import sys nodes = [] # We're optimists success = True class TestMesh(Mesh): done = 0 expected = None def gotOutput(self, node, sender, data): global success value = int(data.rstrip()) if (node in self.nodes[0:2] and ...
lgpl-2.1
Python
a04adfcdc202eded3d50969ec006b18d370a8a26
Add docstrings for snippets.finder
trilan/snippets,trilan/snippets
snippets/finder.py
snippets/finder.py
import os def find(root): """Yield all found filepaths in provided directory recursively.""" for current, dirs, files in os.walk(root): for file in files: yield os.path.join(current, file)
import os def find(root): for current, dirs, files in os.walk(root): for file in files: yield os.path.join(current, file)
isc
Python
1223c77fb3ada03d32e6c9da0a08dd43bfc5ad7b
Make sure checkout is first on sys.path
sqlobject/sqlobject,drnlm/sqlobject,sqlobject/sqlobject,drnlm/sqlobject
docs/test.py
docs/test.py
import sys, os if sys.version_info >= (2, 4): import doctest else: raise ImportError("Python 2.4 doctest required") sys.path.insert( 0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def test(): for doc in ['SQLObject.txt']: doctest.testfile(doc, optionflags=doctest.ELLIPSIS) i...
import sys, os if sys.version_info >= (2, 4): import doctest else: raise ImportError("Python 2.4 doctest required") sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def test(): for doc in ['SQLObject.txt']: doctest.testfile(doc, optionflags=doctest.ELLIPSIS) if __name...
lgpl-2.1
Python
dc7fe92cb6665a688ce09b9273a445981ad7b150
fix utf-8 encoding problem
zhewang/restauranthunter,zhewang/restauranthunter,zhewang/restauranthunter
datascripts/load_business.py
datascripts/load_business.py
import json import pymysql import argparse def InsertToMySQL(conn, record): cursor = conn.cursor() cursor.execute( "INSERT business values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)", [record['business_id'],record['name'].encode('utf-8'),record['full_address'].encode('utf-8'),record['city'].encode('utf-8'),reco...
import json import pymysql import argparse def InsertToMySQL(conn, record): cursor = conn.cursor() query = "INSERT business values ('{0}',\"{1}\",\"{2}\",'{3}','{4}',{5},{6},{7},{8},{9})".format( record['business_id'],record['name'],record['full_address'].replace('\n',', ').encode('utf-8'),record['city...
mit
Python
3e4b9a5f1e091e0f56c3e0808eda9efeefc44f71
Change from old `ed` to new `dj` in cli.py
Grokzen/docker-jinja,Grokzen/docker-jinja
djinja/cli.py
djinja/cli.py
# -*- coding: utf-8 -*- def main(): """ This is the main entrypoint for the application. It is designed to handle: - cli argument parsing via docopt - setup logging across the application. - start the main application logic This should allways be the first file in this package to be i...
# -*- coding: utf-8 -*- def main(): """ This is the main entrypoint for the application. It is designed to handle: - cli argument parsing via docopt - setup logging across the application. - start the main application logic This should allways be the first file in this package to be i...
mit
Python
49897f091c159220a7aa1fac2d5e03f42236053f
Make sure example repo exists
rtfd/sphinx-autoapi,rtfd/sphinx-autoapi,rtfd/sphinx-autoapi,rtfd/sphinx-autoapi
tests/dotnetexample/conf.py
tests/dotnetexample/conf.py
# -*- coding: utf-8 -*- templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'dotnetexample' copyright = u'2015, rtfd' author = u'rtfd' version = '0.1' release = '0.1' language = None exclude_patterns = ['_build'] pygments_style = 'sphinx' todo_include_todos = False html_theme = 'sphi...
# -*- coding: utf-8 -*- templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'dotnetexample' copyright = u'2015, rtfd' author = u'rtfd' version = '0.1' release = '0.1' language = None exclude_patterns = ['_build'] pygments_style = 'sphinx' todo_include_todos = False html_theme = 'sphi...
mit
Python
c381708d6ff23b49f7c73653129e4dc4c20efc9e
Add a test for async with ClientSession()
esaezgil/aiohttp,singulared/aiohttp,pfreixes/aiohttp,arthurdarcet/aiohttp,moden-py/aiohttp,AraHaanOrg/aiohttp,KeepSafe/aiohttp,moden-py/aiohttp,singulared/aiohttp,AraHaanOrg/aiohttp,mind1master/aiohttp,alex-eri/aiohttp-1,esaezgil/aiohttp,mind1master/aiohttp,rutsky/aiohttp,playpauseandstop/aiohttp,moden-py/aiohttp,esaez...
examples/web_ws.py
examples/web_ws.py
#!/usr/bin/env python3 """Example for aiohttp.web websocket server """ import asyncio import os from aiohttp.web import (Application, Response, WebSocketResponse, WSMsgType, run_app) WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html') async def wshandler(request): resp ...
#!/usr/bin/env python3 """Example for aiohttp.web websocket server """ import asyncio import os from aiohttp.web import (Application, WSMsgType, Response, WebSocketResponse, run_app) WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html') async def wshandler(request): resp ...
apache-2.0
Python
c4309285a48e395b84db13a38702685adb3603d2
Prepare 0.3.3
silentsokolov/django-admin-rangefilter,silentsokolov/django-admin-rangefilter,silentsokolov/django-admin-rangefilter
rangefilter/__init__.py
rangefilter/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals __author__ = 'Dmitriy Sokolov' __version__ = '0.3.3' default_app_config = 'rangefilter.apps.RangeFilterConfig' VERSION = __version__
# -*- coding: utf-8 -*- from __future__ import unicode_literals __author__ = 'Dmitriy Sokolov' __version__ = '0.3.2' default_app_config = 'rangefilter.apps.RangeFilterConfig' VERSION = __version__
mit
Python
22b4863bbcf4bd149f4e9b4986514a028811e552
disable some auth routes temporayr
resurtm/recarguide,resurtm/recarguide,resurtm/recarguide
recarguide/auth/urls.py
recarguide/auth/urls.py
# Copied from django.contrib.auth.urls and modified from django.conf.urls import url from django.contrib.auth import views from recarguide.auth.forms import AuthenticationForm from recarguide.auth.views import signup app_name = 'auth' urlpatterns = [ url(r'^login/$', views.LoginView.as_view( authenticat...
# Copied from django.contrib.auth.urls and modified from django.conf.urls import url from django.contrib.auth import views from recarguide.auth.forms import AuthenticationForm from recarguide.auth.views import signup app_name = 'auth' urlpatterns = [ url(r'^login/$', views.LoginView.as_view( authenticat...
mit
Python
225b3dabe0ab9e835525726e977129560afbbc96
fix version for agave
oesteban/mriqc,poldracklab/mriqc,oesteban/mriqc,poldracklab/mriqc,oesteban/mriqc,poldracklab/mriqc,poldracklab/mriqc,oesteban/mriqc
mriqc/utils/agave_appgen.py
mriqc/utils/agave_appgen.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: oesteban # @Date: 2016-03-16 11:28:27 # @Last Modified by: oesteban # @Last Modified time: 2016-03-16 15:12:13 """ Agave app generator """ import json from argparse import ArgumentParser, RawTextHelpFormatter import mriqc version = '.'.join([v for v in mri...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: oesteban # @Date: 2016-03-16 11:28:27 # @Last Modified by: oesteban # @Last Modified time: 2016-03-16 15:12:13 """ Agave app generator """ import json from argparse import ArgumentParser, RawTextHelpFormatter import mriqc agaveapp = { 'name': mriqc.__n...
apache-2.0
Python
aeb5e36b2e4f528ee9657f319f9db3f8fcfcb010
fix map command
naggie/crates,naggie/crates,naggie/crates
index/management/commands/map.py
index/management/commands/map.py
''' Proof-of-concept mapper. Symlinks CAS entries to named files. ''' from django.conf import settings from django.core.management.base import BaseCommand, CommandError from os.path import join,islink from index.models import AudioFile from os import unlink from cas.cas import BasicCAS # TODO clean file path of un...
''' Proof-of-concept mapper. Symlinks CAS entries to named files. ''' from django.conf import settings from django.core.management.base import BaseCommand, CommandError from os.path import join,islink from index.models import AudioFile from os import unlink from cas import BasicCAS # TODO clean file path of unicod...
mit
Python
f62b639b11b40596f33af6c7101a76a34ed27468
Handle requestless requests on fqdn global tags
BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway
src/core/templatetags/fqdn.py
src/core/templatetags/fqdn.py
from django import template from django.urls import reverse, NoReverseMatch register = template.Library() @register.simple_tag(takes_context=True) def journal_url(context, url_name=None, *args): request = context.get('request') if url_name is not None: path = reverse(url_name, args=args) else: ...
from django import template from django.urls import reverse, NoReverseMatch register = template.Library() @register.simple_tag(takes_context=True) def journal_url(context, url_name=None, *args): request = context['request'] if url_name is not None: path = reverse(url_name, args=args) else: ...
agpl-3.0
Python
e648dfda6a5a063232d033fba5d97c760484702d
change name
acysos/odoo-addons,acysos/odoo-addons,acysos/odoo-addons
l10n_es_account_balance_report_coop/__manifest__.py
l10n_es_account_balance_report_coop/__manifest__.py
# -*- coding: utf-8 -*- # Copyright 2017 Ignacio Ibeas <ignacio@acysos.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Informes de cuentas anuales españoles - Cooperativas", "version": "8.0.0.1.0", "author": "Acysos S.L.", "contributors": [ "Ignacio Ibeas <ignaci...
# -*- coding: utf-8 -*- # Copyright 2017 Ignacio Ibeas <ignacio@acysos.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Informes de cuentas anuales españoles - " "Entidades sin fines lucrativos", "version": "8.0.0.1.0", "author": "Acysos S.L.", "contributors": [ ...
agpl-3.0
Python
81b4731b2a668cc62116ab314a1f2a1c82bb9d94
use NOQA to since flake8
stephanpoetschner/django-redis-metrics,bradmontgomery/django-redis-metrics,bradmontgomery/django-redis-metrics,stephanpoetschner/django-redis-metrics,bradmontgomery/django-redis-metrics,stephanpoetschner/django-redis-metrics
redis_metrics/__init__.py
redis_metrics/__init__.py
__version__ = "0.5.1" try: from .utils import gauge, metric # NOQA except ImportError: # pragma: no cover pass # pragma: no cover
__version__ = "0.5.1" try: from .utils import gauge, metric # placate pyflakes assert gauge assert metric except ImportError: # pragma: no cover pass # pragma: no cover
mit
Python
a5480c83bb6ae57202e12854fd60d49afc2f65d8
add nl
mozilla-iam/sso-dashboard,mozilla-iam/sso-dashboard,mozilla-iam/sso-dashboard,mozilla-iam/sso-dashboard
dashboard/person.py
dashboard/person.py
import http.client import json import urllib import config class API(object): """Retrieve data from person api as needed. Will eventually replace Mozillians API""" def __init__(self): """ :param session: the flask session to update with userinfo """ self.config = config.OIDCC...
import http.client import json import urllib import config class API(object): """Retrieve data from person api as needed. Will eventually replace Mozillians API""" def __init__(self): """ :param session: the flask session to update with userinfo """ self.config = config.OIDCC...
mpl-2.0
Python
46d85d2f124825caa82625a4b1594b210f52fbcf
add email notice format
Answeror/torabot,Answeror/torabot,Answeror/torabot
torabot/mods/pixiv/views/email.py
torabot/mods/pixiv/views/email.py
def format_notice_body(notice): return "pixiv: %(title)s 更新了: %(uri)s" % dict( uri=notice.change.art.uri, title=notice.change.art.title, )
mit
Python
8b47dd0d46f59ed57734c3ffe46ce297f29741cd
Add url_error_count to wikipedia_article_matching_filtering
mkrnr/wikiwhere
url_extraction/wikipedia_article_matching_filtering.py
url_extraction/wikipedia_article_matching_filtering.py
''' Created on Mar 9, 2016 @author: Martin Koerner <info@mkoerner.de> ''' import json from urlparse import urlparse import argparse import re # generate help text for arguments parser = argparse.ArgumentParser(description='Extracts domains from a file containing the URLs of Wikipedia articles.') parser.add_argument...
''' Created on Mar 9, 2016 @author: Martin Koerner <info@mkoerner.de> ''' import json from urlparse import urlparse import argparse import re # generate help text for arguments parser = argparse.ArgumentParser(description='Extracts domains from a file containing the URLs of Wikipedia articles.') parser.add_argument...
mit
Python
35fe454e4321a9b621d6d54dc3326f92a9a65a9a
Clean up and document a bit.
gnoack/ukechord,gnoack/ukechord
chordpro.py
chordpro.py
"""Read ChordPro files and output them through a PDFWriter object""" import re def _analyze_chordpro_textline(line): """Analyze the text and chords in a line of text. Args: line: The line of text, with chords in square brackets. Returns: A list of (chord, textchunk) tuples. The chord is None for ...
"""Read ChordPro files and output them through a PDFWriter object""" import re def _analyze_chordpro_textline(line): matches = list(re.finditer(r"\[([^\]]+)\]([^\[]*)", line)) if matches: result = [] if matches[0].start(0): result.append((None, line[:matches[0].start(0)])) for m in matches: ...
apache-2.0
Python
e5bc2e057034f067ffddbe786532e407a5dac866
Put spaces between graphs and var name (#19063)
thaim/ansible,thaim/ansible
lib/ansible/modules/utilities/logic/include_role.py
lib/ansible/modules/utilities/logic/include_role.py
#!/usr/bin/python # -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the...
#!/usr/bin/python # -*- mode: python -*- # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the...
mit
Python
bb3ec131261f0619a86f21f549d6b1cb47f2c9ad
Simplify SimpleAlarmSerializer to improve the performance of the graph_data endpoint
sigurdsa/angelika-api
graph/serializers.py
graph/serializers.py
from rest_framework import serializers from measurement.models import Measurement from threshold_value.models import ThresholdValue from calendar import timegm from alarm.models import Alarm class GraphSeriesSerializer(serializers.ModelSerializer): x = serializers.SerializerMethodField('get_time') y = seriali...
from rest_framework import serializers from measurement.models import Measurement from threshold_value.models import ThresholdValue from calendar import timegm from alarm.models import Alarm class GraphSeriesSerializer(serializers.ModelSerializer): x = serializers.SerializerMethodField('get_time') y = seriali...
mit
Python
317320ef1bbf336c88dcdee4b9240bd129537b86
set from address
OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops,OpenDataPolicingNC/Traffic-Stops
traffic_stops/settings/staging.py
traffic_stops/settings/staging.py
from traffic_stops.settings.base import * os.environ.setdefault('CACHE_HOST', '127.0.0.1:11211') os.environ.setdefault('BROKER_HOST', '127.0.0.1:5672') DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES['default']['NAME'] = 'traffic_stops_staging' DATABASES['default']['USER'] = 'traffic_stops_staging' DATABASES['default...
from traffic_stops.settings.base import * os.environ.setdefault('CACHE_HOST', '127.0.0.1:11211') os.environ.setdefault('BROKER_HOST', '127.0.0.1:5672') DEBUG = False TEMPLATE_DEBUG = DEBUG DATABASES['default']['NAME'] = 'traffic_stops_staging' DATABASES['default']['USER'] = 'traffic_stops_staging' DATABASES['default...
mit
Python
34667b59161f0079715e9bffa11237a1a8c5500f
Add some koji API code for testing getting build results/output.
fedora-infra/fedimg,fedora-infra/fedimg
fedimg/uploader.py
fedimg/uploader.py
#!/bin/env python # -*- coding: utf8 -*- import koji from pprint import pprint def upload(builds): """ Takes a list of one or more Koji build IDs (passed to it from consumer.py) and sends the appropriate image files off to cloud services. """ if isinstance(builds, list): # Create a Koji conn...
#!/bin/env python # -*- coding: utf8 -*- import koji def upload(builds): """ Takes a list of one or more Koji build IDs (passed to it from consumer.py) and sends the appropriate image files off to cloud services. """ if isinstance(builds, list): for build in builds: pass else:...
agpl-3.0
Python
572bbfda6db48d03d1f0fdd3a53c79c3c4a1d2c2
add version 0.9.0 (#9553)
iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack
var/spack/repos/builtin/packages/py-seaborn/package.py
var/spack/repos/builtin/packages/py-seaborn/package.py
# Copyright 2013-2018 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 PySeaborn(PythonPackage): """Seaborn: statistical data visualization. Seaborn is a li...
# Copyright 2013-2018 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 PySeaborn(PythonPackage): """Seaborn: statistical data visualization. Seaborn is a li...
lgpl-2.1
Python
084166a8c537a99414053a4fb59b7daa3078f556
bump a version
turbolabtech/Stream-Framework,turbolabtech/Stream-Framework,nikolay-saskovets/Feedly,Anislav/Stream-Framework,turbolabtech/Stream-Framework,Architizer/Feedly,SergioChan/Stream-Framework,nikolay-saskovets/Feedly,turbolabtech/Stream-Framework,SergioChan/Stream-Framework,SergioChan/Stream-Framework,Architizer/Feedly,smuse...
feedly/__init__.py
feedly/__init__.py
__author__ = 'Thierry Schellenbach' __copyright__ = 'Copyright 2012, Thierry Schellenbach' __credits__ = ['Thierry Schellenbach, mellowmorning.com, @tschellenbach'] __license__ = 'BSD' __version__ = '0.3.6' __maintainer__ = 'Thierry Schellenbach' __email__ = 'thierryschellenbach@gmail.com' __status__ = 'Production' ...
__author__ = 'Thierry Schellenbach' __copyright__ = 'Copyright 2012, Thierry Schellenbach' __credits__ = ['Thierry Schellenbach, mellowmorning.com, @tschellenbach'] __license__ = 'BSD' __version__ = '0.3.5' __maintainer__ = 'Thierry Schellenbach' __email__ = 'thierryschellenbach@gmail.com' __status__ = 'Production' ...
bsd-3-clause
Python
dbd97fab760f268e07f3337c6e40e5d7749f524b
Add filters to neutron conf parser (#2684)
RedHatInsights/insights-core,RedHatInsights/insights-core
insights/parsers/neutron_conf.py
insights/parsers/neutron_conf.py
""" NeutronConf - file ``/etc/neutron/neutron.conf`` ================================================ This class provides parsing for the file ``/etc/neutron/neutron.conf``. Sample input data is in the format:: [DEFAULT] # debug = False debug = False # verbose = True verbose = False core_plug...
""" NeutronConf - file ``/etc/neutron/neutron.conf`` ================================================ This class provides parsing for the file ``/etc/neutron/neutron.conf``. Sample input data is in the format:: [DEFAULT] # debug = False debug = False # verbose = True verbose = False core_plug...
apache-2.0
Python
4c0abaf97873517dacbf9372dc5f85aae852a4cc
fix MT export format
basuke/kanshin-export,basuke/kanshin-export
kanshin/export.py
kanshin/export.py
# -*- coding: utf-8 -*- import re URL_PATTERN = re.compile(r"\[(.+?)\]\((https?://.+?)\)") IMG_TEMPLATE = u'<img src="{url}" class="kanshin-diary-entry-images">' LINK_TEMPLATE = u'<a href="{url}" class="kanshin-link">{title}</a>' COMMENT_TEMPLATE = u'''----- COMMENT: AUTHOR: {user} URL: http://www.kanshin.link/use...
# -*- coding: utf-8 -*- IMG_TEMPLATE = u'<img src="{url}" class="kanshin-diary-entry-images">' COMMENT_TEMPLATE = u'''----- COMMENT: AUTHOR: {user} URL: http://www.kanshin.link/user/{id} DATE: {date} {text} ''' ENTRY_TEMPLATE = u'''TITLE: {title} BASENAME: diary-{id} AUTHOR: {user} DATE: {date} CONVERT BREAKS: markd...
mit
Python
3003c3fc1a1aae98fb24b87f4488d3a42341310f
Revise to endtimes_minheap
bowen0701/algorithms_data_structures
lc0253_meeting_rooms_ii.py
lc0253_meeting_rooms_ii.py
"""Leetcode 253. Meeting Rooms II (Premium) Medium URL: https://leetcode.com/problems/meeting-rooms-ii Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. Example1 Input: intervals = [[0,30],[5,10],[15,20]] ...
"""Leetcode 253. Meeting Rooms II (Premium) Medium URL: https://leetcode.com/problems/meeting-rooms-ii Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. Example1 Input: intervals = [[0,30],[5,10],[15,20]] ...
bsd-2-clause
Python
0f9168caa5085cb225ea04b725a2379eef8c3b8d
Fix some minor formatting issues
gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x,thelonious/g2x,thelonious/g2x
app/Voltage/voltage.py
app/Voltage/voltage.py
import smbus import time ADDRESS = 4 CMD_READ_ANALOG = 1 VOLT12 = 650 VOLT18 = 978 def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min class Voltage: def __init__(self): self.bus =...
import smbus import time ADDRESS = 4 CMD_READ_ANALOG = 1 VOLT12 = 650 VOLT18 = 978 def map_range(x, in_min, in_max, out_min, out_max): out_delta = out_max - out_min in_delta = in_max - in_min return (x - in_min) * out_delta / in_delta + out_min class Voltage: def __init__(self): self.bus = s...
mit
Python
1b2648b72a8492d4c37c2695796f968a540c25b7
correct coordinate problem in get_hg38_bed.py
wrpearson/fasta36,wrpearson/fasta36,wrpearson/fasta36,wrpearson/fasta36,wrpearson/fasta36,wrpearson/fasta36
scripts/get_hg38_bed.py
scripts/get_hg38_bed.py
#!/usr/bin/python ################ ## get_hg38_bed.py parses an HG38 coordinate into a pseudo-bed entry, ## and runs bedtools getfasta to return the fasta sequence ## import sys import re from subprocess import Popen, PIPE, STDOUT import shlex ## a genome_loc should look like: chr#:start-stop ## if stop < start, coo...
#!/usr/bin/python ################ ## get_hg38_bed.py parses an HG38 coordinate into a pseudo-bed entry, ## and runs bedtools getfasta to return the fasta sequence ## import sys import re from subprocess import Popen, PIPE, STDOUT import shlex ## a genome_loc should look like: chr#:start-stop ## if stop < start, coo...
apache-2.0
Python
2628284e05c1a52f120657f7b336fd326d4dfc7b
add dataset module in init
keunwoochoi/kapre,keunwoochoi/kapre
kapre/__init__.py
kapre/__init__.py
__version__ = '0.0.3.1' VERSION = __version__ from . import time_frequency from . import backend from . import backend_keras from . import augmentation from . import filterbank from . import utils from . import datasets from keras import backend as K if K.backend() == 'theano': try: from theano.tensor i...
__version__ = '0.0.3.1' VERSION = __version__ from . import time_frequency from . import backend from . import backend_keras from . import augmentation from . import filterbank from . import utils from keras import backend as K if K.backend() == 'theano': try: from theano.tensor import fft from ...
mit
Python
dc82d59b739934d093ed0d704583e7edf1278fc3
Add delete old sessions command
QLGu/djangopackages,nanuxbe/djangopackages,pydanny/djangopackages,QLGu/djangopackages,pydanny/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,nanuxbe/djangopackages
core/management/commands/delete_old_sessions.py
core/management/commands/delete_old_sessions.py
from datetime import datetime from django.core.management.base import NoArgsCommand from django.contrib.sessions.models import Session class Command(NoArgsCommand): help = "Delete old sessions" def handle_noargs(self, **options): old_sessions = Session.objects.filter(expire_date__lt=datetime.now())...
from datetime import datetime from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session class Command(BaseCommand): args = '<count count ...>' help = "Delete old sessions" def handle(self, *args, **options): old_sessions = Session.objects.filter(expi...
mit
Python
36985aad167674aa4be9f18ce6bee6d492c69e4d
Implement a Node
andela-kerinoso/data_structures_algo
app/data_structures.py
app/data_structures.py
class Stack(object): """Implementation of Stack ADT""" def __init__(self, items=[]): self.items = items def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): if not self.is_empty(): return self.items.p...
class Stack(object): """Implementation of Stack ADT""" def __init__(self, items=[]): self.items = items def is_empty(self): return self.items == [] def push(self, item): self.items.append(item) def pop(self): if not self.is_empty(): return self.items.p...
mit
Python
4d9d0745e8e6f12b09cc5e62a7591a9840c5e810
Update version to 0.8.1
willthames/ansible-review
lib/ansiblereview/version.py
lib/ansiblereview/version.py
__version__ = '0.8.1'
__version__ = '0.8.0'
mit
Python
d42a58128e7768c0cd987d9281cafb36d9868e6b
handle ObjectDoesNotExist in migration
Hitechverma/zamboni,washort/zamboni,kmaglione/olympia,kumar303/addons-server,psiinon/addons-server,aviarypl/mozilla-l10n-addons-server,kumar303/zamboni,shahbaz17/zamboni,mdaif/olympia,elysium001/zamboni,psiinon/addons-server,shahbaz17/zamboni,eviljeff/zamboni,Nolski/olympia,Joergen/olympia,diox/olympia,washort/zamboni,...
migrations/662-modify-existing-region-exclusions.py
migrations/662-modify-existing-region-exclusions.py
#!/usr/bin/env python from django.core.exceptions import ObjectDoesNotExist from django.db import IntegrityError import mkt from mkt.developers.cron import exclude_new_region from mkt.webapps.models import AddonExcludedRegion from mkt.zadmin.models import FeaturedAppRegion def run(): """ Migrate from New Me...
#!/usr/bin/env python from django.db import IntegrityError import mkt from mkt.developers.cron import exclude_new_region from mkt.webapps.models import AddonExcludedRegion from mkt.zadmin.models import FeaturedAppRegion def run(): """ Migrate from New Mexico to Old Mexico. Then add AddonExcludedRegion o...
bsd-3-clause
Python
8a076af6465cfcf7b340742a2f4bb0dc6070b66b
Fix ignore
sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint,sassoftware/mint
mint/django_rest/rbuilder/inventory/manager/base.py
mint/django_rest/rbuilder/inventory/manager/base.py
# # Copyright (c) 2011 rPath, Inc. # # All Rights Reserved # from mint.django_rest.rbuilder.manager.basemanager import exposed # pyflakes=ignore class BaseManager(object): def __init__(self, mgr): # mgr is a weakref to avoid circular references. Access its fields # through properties self...
# # Copyright (c) 2011 rPath, Inc. # # All Rights Reserved # from mint.django_rest.rbuilder.manager.basemanager import exposed # pyflakes=ignore class BaseManager(object): def __init__(self, mgr): # mgr is a weakref to avoid circular references. Access its fields # through properties self....
apache-2.0
Python
00631eb478de47a271b38bd8e9c7f1f0325f38ba
read write shit
abonaca/gary,abonaca/gary,abonaca/gary
gary/potential/__init__.py
gary/potential/__init__.py
from .core import * from .builtin import * from .cpotential import * from .cbuiltin import * from .custom import * from .io import *
from .core import * from .builtin import * from .cpotential import * from .cbuiltin import * from .custom import *
mit
Python
131723ab15be88c97549595b001953d2133ec897
Fix default parameters so they are not assigning actual values
SECOORA/GUTILS,SECOORA/GUTILS
gutils/yo/filters.py
gutils/yo/filters.py
#!/usr/bin/env python import numpy as np from gutils.yo import ( TIME_DIM, DATA_DIM ) def filter_profiles(dataset, conditional): """Filters out profiles that do not meet some criteria Returns the filtered set of profiles """ filtered_dataset = dataset.copy() filtered_dataset[:, 2] = 0...
#!/usr/bin/env python import numpy as np from gutils.yo import ( TIME_DIM, DATA_DIM ) def filter_profiles(dataset, conditional): """Filters out profiles that do not meet some criteria Returns the filtered set of profiles """ filtered_dataset = dataset.copy() filtered_dataset[:, 2] = 0...
mit
Python
25746eadb6475bc8f8a2b17af91583de64441889
Fix a comment to refer to the right type of instruction.
vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,hoangt/tpzsimul.gem5,hoangt/tpzsimul.gem5,pombredanne/http-repo.gem5.org-gem5-,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,hoangt/tpzsimul.gem5,vovojh/gem5,pombredanne/http-repo.gem5.org-gem5-,vovojh/gem5,vovojh/gem5,...
src/arch/x86/isa/insts/control_transfer/call.py
src/arch/x86/isa/insts/control_transfer/call.py
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the # following conditions are met: # # The software must be used only for Non-Commercial Use which mean...
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the # following conditions are met: # # The software must be used only for Non-Commercial Use which mean...
bsd-3-clause
Python
4f603c08ee651bc883c3497b28535df9d7b55d9d
Update hello.py
zatuper/pywebstepic,zatuper/pywebstepic,zatuper/pywebstepic,ztp99/pyweb,ztp99/pyweb,ztp99/pyweb
etc/hello.py
etc/hello.py
CONFIG = { 'mode': 'wsgi', 'working_dir': '/path/to/my/app', 'python': '/usr/bin/python', 'args': ( '--bind=127.0.0.1:8080', '--workers=16', '--timeout=60', 'app.module', ), } def application(env, start_response): # url = [] start_response('200 OK', [('Conten...
CONFIG = { 'mode': 'wsgi', 'working_dir': '/path/to/my/app', 'python': '/usr/bin/python', 'args': ( '--bind=127.0.0.1:8080', '--workers=16', '--timeout=60', 'app.module', ), } def application(env, start_response): # url = [] start_response('200 OK', [('Conten...
apache-2.0
Python
0498f636f7e977690e45a936498c91d6e83b75c9
Bump version to 0.2.1
soxofaan/asynchronousfilereader
asynchronousfilereader/__init__.py
asynchronousfilereader/__init__.py
__version__ = '0.2.1' import threading try: # Python 2 from Queue import Queue except ImportError: # Python 3 from queue import Queue class AsynchronousFileReader(threading.Thread): """ Helper class to implement asynchronous reading of a file in a separate thread. Pushes read lines on a ...
__version__ = '0.2.0' import threading try: # Python 2 from Queue import Queue except ImportError: # Python 3 from queue import Queue class AsynchronousFileReader(threading.Thread): """ Helper class to implement asynchronous reading of a file in a separate thread. Pushes read lines on a ...
mit
Python
b10c157587ad813d88eb51b7efdd695d1cf66103
Improve requirements/compile.py (#360)
adamchainz/flake8-comprehensions
requirements/compile.py
requirements/compile.py
#!/usr/bin/env python import os import subprocess import sys from pathlib import Path if __name__ == "__main__": os.chdir(Path(__file__).parent) os.environ["CUSTOM_COMPILE_COMMAND"] = "requirements/compile.py" os.environ.pop("PIP_REQUIRE_VIRTUALENV") common_args = [ "-m", "piptools", ...
#!/usr/bin/env python import os import subprocess import sys from pathlib import Path if __name__ == "__main__": os.chdir(Path(__file__).parent) os.environ["CUSTOM_COMPILE_COMMAND"] = "requirements/compile.py" os.environ.pop("PIP_REQUIRE_VIRTUALENV") common_args = ["-m", "piptools", "compile", "--gener...
mit
Python
7f87d859134a98bf81ec602b92e28b5be357d069
Include the LocalSite's public flag in the admin UI listing.
KnowNo/reviewboard,KnowNo/reviewboard,1tush/reviewboard,reviewboard/reviewboard,chipx86/reviewboard,1tush/reviewboard,beol/reviewboard,reviewboard/reviewboard,brennie/reviewboard,KnowNo/reviewboard,1tush/reviewboard,sgallagher/reviewboard,1tush/reviewboard,beol/reviewboard,custode/reviewboard,sgallagher/reviewboard,Kno...
reviewboard/site/admin.py
reviewboard/site/admin.py
# # admin.py -- Admin site definitions for the "reviewboard.site" app # # Copyright (c) 2010 David Trowbridge # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including...
# # admin.py -- Admin site definitions for the "reviewboard.site" app # # Copyright (c) 2010 David Trowbridge # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including...
mit
Python
591a40b6e1f4ac8b1d21050ccfa10779dc9dbf7c
Add string to display the name of the field Dimension during the import
xcgd/analytic_structure
analytic_code.py
analytic_code.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 XCG Consulting (www.xcg-consulting.fr) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2013 XCG Consulting (www.xcg-consulting.fr) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
agpl-3.0
Python
5b19ca28cafde5a490984ca1ec0232a5d415232f
Remove unused method
qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect
src/diamond/collectors/jolokia/kafka_jolokia.py
src/diamond/collectors/jolokia/kafka_jolokia.py
# -*- coding: utf-8 -*- """ Collect Kafka metrics using jolokia agent ### Example Configuration ``` host = localhost port = 8778 ``` """ from jolokia import JolokiaCollector, MBean import re import sys class KafkaJolokiaCollector(JolokiaCollector): TOTAL_TOPICS = re.compile('kafka\.server:name=.*PerSec...
# -*- coding: utf-8 -*- """ Collect Kafka metrics using jolokia agent ### Example Configuration ``` host = localhost port = 8778 ``` """ from jolokia import JolokiaCollector, MBean import re import sys class KafkaJolokiaCollector(JolokiaCollector): TOTAL_TOPICS = re.compile('kafka\.server:name=.*PerSec...
apache-2.0
Python
50146d9e3e43ca4d9c50d044c52714cf4234cee1
Fix window test border _again_ (more fixed).
adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,adamlwgriffiths/Pyglet,adamlwgriffiths/Pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet,seeminglee/pyglet64,niklaskorz/pyglet,niklaskorz/pyglet
tests/window/window_util.py
tests/window/window_util.py
#!/usr/bin/python # $Id:$ from pyglet.gl import * def draw_client_border(window): glClearColor(0, 0, 0, 1) glClear(GL_COLOR_BUFFER_BIT) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0, window.width, 0, window.height, -1, 1) glMatrixMode(GL_MODELVIEW) glLoadIdentity()...
#!/usr/bin/python # $Id:$ from pyglet.gl import * def draw_client_border(window): glClearColor(0, 0, 0, 1) glClear(GL_COLOR_BUFFER_BIT) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0, window.width, 0, window.height, -1, 1) glMatrixMode(GL_MODELVIEW) glLoadIdentity()...
bsd-3-clause
Python
825f7986c763648fbecdc7b3617dad9640b3905d
Use unicode in `vagrant_up` rule
nvbn/thefuck,Clpsplug/thefuck,scorphus/thefuck,SimenB/thefuck,nvbn/thefuck,mlk/thefuck,Clpsplug/thefuck,SimenB/thefuck,scorphus/thefuck,mlk/thefuck
thefuck/rules/vagrant_up.py
thefuck/rules/vagrant_up.py
from thefuck.shells import shell from thefuck.utils import for_app @for_app('vagrant') def match(command): return 'run `vagrant up`' in command.stderr.lower() def get_new_command(command): cmds = command.script_parts machine = None if len(cmds) >= 3: machine = cmds[2] start_all_instance...
from thefuck.shells import shell from thefuck.utils import for_app @for_app('vagrant') def match(command): return 'run `vagrant up`' in command.stderr.lower() def get_new_command(command): cmds = command.script_parts machine = None if len(cmds) >= 3: machine = cmds[2] startAllInstances ...
mit
Python
406b6795a415b77640d24f85f50e3f21d842fe33
Fix shape omission in ragged2list
spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc
thinc/layers/ragged2list.py
thinc/layers/ragged2list.py
from typing import Tuple, Callable from ..model import Model from ..config import registry from ..types import Ragged, List2d InT = Ragged OutT = List2d @registry.layers("ragged2list.v1") def ragged2list() -> Model[InT, OutT]: """Transform sequences from a ragged format into lists.""" return Model("ragged2...
from typing import Tuple, Callable from ..model import Model from ..config import registry from ..types import Ragged, List2d InT = Ragged OutT = List2d @registry.layers("ragged2list.v1") def ragged2list() -> Model[InT, OutT]: """Transform sequences from a ragged format into lists.""" return Model("ragged2...
mit
Python
d48a462e7da68fd28ee573bd588bdb91f38e709b
Add docstrings and author
wmaraujo/importance-sampling,wmaraujo/importance-sampling
sysc4005_final_2h.py
sysc4005_final_2h.py
#! /usr/bin/env python3 """ Importance sampling simulation to find the probability of a standard normal random variable exceeding 8 P(X > 8), where X is distributed according to the standard normal distribution. True value is about 6.22096057410^-16 Obtained with WolframAlpha: http://www.wolframalpha.com/input/?i=1+-...
#! /usr/bin/env python3 from random import normalvariate from math import exp, sqrt n = 155000000 total = 0 sumVar = 0 print("Simulation begins now") for i in range(n): X = normalvariate(8, 1) if (X > 8): total += exp(32-8*X) sumVar += exp(64-16*X) mean = total / n variance = (sumVar - (total*...
cc0-1.0
Python
0c5eead595198cdb09e1855e9217f99ec5774146
remove delete
ging/horizon,ging/horizon,ging/horizon,ging/horizon
openstack_dashboard/fiware_api/access_control_ge.py
openstack_dashboard/fiware_api/access_control_ge.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 t...
# 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 t...
apache-2.0
Python