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 |
|---|---|---|---|---|---|---|---|---|
983ba079bb99da836f64fc2667100c66a2441f0c | use python logging module. | geekan/task-manager,geekan/task-manager,geekan/task-manager,geekan/task-manager | task_manager/task_processor/views.py | task_manager/task_processor/views.py | from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.db.models import Q
from models import ImageNeuralTask
from time import strftime, localtime
import logging
l = logging.getLogger(__name__)
# Create your views here.
def merge_dict... | from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from django.db.models import Q
from models import ImageNeuralTask
from time import strftime, localtime
# Create your views here.
def merge_dicts(*dict_args):
'''
Given any number of di... | mit | Python |
673f811b8325a6926ac52ffa404a74f2ec9e5e8a | Change parcellation to DKT | MadsJensen/RP_scripts,MadsJensen/RP_scripts,MadsJensen/RP_scripts | extract_ts_epochs.py | extract_ts_epochs.py | import sys
import numpy as np
import mne
from mne.minimum_norm import read_inverse_operator, apply_inverse_epochs
from my_settings import (mne_folder, epochs_folder, source_folder, conditions)
subject = sys.argv[1]
method = "dSPM"
snr = 1.
lambda2 = 1. / snr**2
# labels = mne.read_labels_from_annot(
# subject=s... | import sys
import numpy as np
import mne
from mne.minimum_norm import read_inverse_operator, apply_inverse_epochs
from my_settings import (mne_folder, epochs_folder, source_folder, conditions)
subject = sys.argv[1]
method = "dSPM"
snr = 1.
lambda2 = 1. / snr**2
labels = mne.read_labels_from_annot(
subject=subje... | bsd-3-clause | Python |
0a9fc9e4d8e43954b10db5668dacb96e68a4ef4f | fix add media with unknown fields | PnEcrins/GeoNature,PnEcrins/GeoNature,PnEcrins/GeoNature,PnEcrins/GeoNature | backend/geonature/core/gn_commons/schemas.py | backend/geonature/core/gn_commons/schemas.py | from marshmallow import pre_load, fields, EXCLUDE
from pypnnomenclature.schemas import NomenclatureSchema
from pypnusershub.schemas import UserSchema
from geonature.utils.env import MA
from geonature.core.gn_commons.models import TModules, TMedias, TValidations
class ModuleSchema(MA.SQLAlchemyAutoSchema):
class ... | from marshmallow import pre_load, fields
from pypnnomenclature.schemas import NomenclatureSchema
from pypnusershub.schemas import UserSchema
from geonature.utils.env import MA
from geonature.core.gn_commons.models import TModules, TMedias, TValidations
class ModuleSchema(MA.SQLAlchemyAutoSchema):
class Meta:
... | bsd-2-clause | Python |
2835e9bf17d435c3d60e3a9c05ab65e3801c0e77 | Add py-setuptools-scm 3.3.3 (#13183) | iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack | var/spack/repos/builtin/packages/py-setuptools-scm/package.py | var/spack/repos/builtin/packages/py-setuptools-scm/package.py | # Copyright 2013-2019 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 PySetuptoolsScm(PythonPackage):
"""The blessed package to manage your versions by scm tags... | # Copyright 2013-2019 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 PySetuptoolsScm(PythonPackage):
"""The blessed package to manage your versions by scm tags... | lgpl-2.1 | Python |
5f6ca3bb95e371afd2bbf97c690cde393e7c4b24 | fix cooccur process script | patverga/torch-relation-extraction,patverga/torch-relation-extraction,patverga/torch-relation-extraction | bin/process/co-occuring-mentions-from-mtx.py | bin/process/co-occuring-mentions-from-mtx.py | import sys
import getopt
import itertools
import random
def file_to_ep_dict(fname):
entity_pairs = {}
with open(fname) as f:
for line in f:
fields = line.strip().split("\t")
ep = (fields[0], fields[1])
if ep not in entity_pairs:
entity_pairs[ep] = []... | import sys
import getopt
import itertools
def file_to_ep_dict(fname):
entity_pairs = {}
with open(fname) as f:
for line in f:
fields = line.strip().split("\t")
ep = (fields[0], fields[1])
if ep not in entity_pairs:
entity_pairs[ep] = []
e... | mit | Python |
e01175427f8615067730024b93aad834880456cd | update version | cjbrasher/LipidFinder | LipidFinder/__init__.py | LipidFinder/__init__.py | # Copyright (c) 2019 J. Alvarez-Jarreta and C.J. Brasher
#
# This file is part of the LipidFinder software tool and governed by the
# 'MIT License'. Please see the LICENSE file that should have been
# included as part of this software.
"""LipidFinder's software information."""
name = "LipidFinder"
__version__ = "2.0.... | # Copyright (c) 2019 J. Alvarez-Jarreta and C.J. Brasher
#
# This file is part of the LipidFinder software tool and governed by the
# 'MIT License'. Please see the LICENSE file that should have been
# included as part of this software.
"""LipidFinder's software information."""
name = "LipidFinder"
__version__ = "2.0"... | mit | Python |
17ddd95d19b1a737bb2b7aa89a4eb0aa17c35137 | Add contacted column. | inteligencia-coletiva-lsd/pybossa,OpenNewsLabs/pybossa,Scifabric/pybossa,inteligencia-coletiva-lsd/pybossa,PyBossa/pybossa,jean/pybossa,Scifabric/pybossa,geotagx/pybossa,geotagx/pybossa,OpenNewsLabs/pybossa,PyBossa/pybossa,stefanhahmann/pybossa,stefanhahmann/pybossa,jean/pybossa | alembic/versions/66594a9866c_add_updated_and_state_to_app.py | alembic/versions/66594a9866c_add_updated_and_state_to_app.py | """add updated and state to app
Revision ID: 66594a9866c
Revises: 29353a1877ba
Create Date: 2014-10-23 10:53:15.357562
"""
# revision identifiers, used by Alembic.
revision = '66594a9866c'
down_revision = '29353a1877ba'
from alembic import op
import sqlalchemy as sa
import datetime
def make_timestamp():
now = ... | """add updated and state to app
Revision ID: 66594a9866c
Revises: 29353a1877ba
Create Date: 2014-10-23 10:53:15.357562
"""
# revision identifiers, used by Alembic.
revision = '66594a9866c'
down_revision = '29353a1877ba'
from alembic import op
import sqlalchemy as sa
import datetime
def make_timestamp():
now = ... | agpl-3.0 | Python |
591ed4b39167daea0eaceca7cf7d79802fd47bd1 | Delete call_aiohttp() (#8) | brettcannon/gidgethub,brettcannon/gidgethub | gidgethub/test/test_aiohttp.py | gidgethub/test/test_aiohttp.py | import datetime
import aiohttp
import pytest
from .. import aiohttp as gh_aiohttp
from .. import sansio
@pytest.mark.asyncio
async def test_sleep():
delay = 1
start = datetime.datetime.now()
async with aiohttp.ClientSession() as session:
gh = gh_aiohttp.GitHubAPI(session, "gidgethub")
aw... | import datetime
import aiohttp
import pytest
from .. import aiohttp as gh_aiohttp
from .. import sansio
async def call_aiohttp(what, *args, **kwargs):
async with aiohttp.ClientSession() as session:
gh = gh_aiohttp.GitHubAPI(session, "gidgethub")
return await getattr(gh, what)(*args, **kwargs)
... | apache-2.0 | Python |
48fab607b1152b8b93cdb0cc0dc5c300dafecf4c | Update default settings to match Slurm 17.X / CentOS installation | mghpcc-projects/user_level_slurm_reservations,mghpcc-projects/user_level_slurm_reservations | common/hil_slurm_settings.py | common/hil_slurm_settings.py | """
MassOpenCloud / Hardware Isolation Layer (HIL)
Slurm / HIL Control Settings
May 2017, Tim Donahue tpd001@gmail.com
"""
DEBUG = True
SLURM_INSTALL_DIR = '/usr/bin/'
HIL_SLURMCTLD_PROLOG_LOGFILE = '/var/log/moc_hil_ulsr/hil_prolog.log'
HIL_MONITOR_LOGFILE = '/var/log/moc_hil_ulsr/hil_monitor.log'
HIL_ENDPOINT =... | """
MassOpenCloud / Hardware Isolation Layer (HIL)
Slurm / HIL Control Settings
May 2017, Tim Donahue tpd001@gmail.com
"""
DEBUG = True
SLURM_INSTALL_DIR = '/usr/local/bin/'
HIL_SLURMCTLD_PROLOG_LOGFILE = '/var/log/moc_hil_ulsr/hil_prolog.log'
HIL_MONITOR_LOGFILE = '/var/log/moc_hil_ulsr/hil_monitor.log'
HIL_ENDP... | mit | Python |
0ba9fa847a8b605363b298ecad40cb2fc5870cbb | Update build script to work correctly on macOS and linux. | treamology/panda3d-voxels,treamology/panda3d-voxels,treamology/panda3d-voxels | build_modules.py | build_modules.py | import os, sys, subprocess, shutil
def check_for_module_builder():
if os.path.exists("voxel_native/scripts/"):
return
print("Downloading P3DModuleBuilder...")
cmd = [sys.executable, "-B", "voxel_native/download_P3DModuleBuilder.py"]
try:
output = subprocess.check_output(cmd, stderr=sy... | import os, sys, subprocess, shutil
def check_for_module_builder():
if os.path.exists("voxel_native/scripts/"):
return
print("Downloading P3DModuleBuilder...")
cmd = [sys.executable, "-B", "voxel_native/download_P3DModuleBuilder.py"]
try:
output = subprocess.check_output(cmd, stderr=sy... | mit | Python |
182215c61de046b626f754aeec22b2845a52f103 | Call the bootstrap job. | pnomolos/greatbigcrane,pnomolos/greatbigcrane | greatbigcrane/project/views.py | greatbigcrane/project/views.py | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | """
Copyright 2010 Jason Chu, Dusty Phillips, and Phil Schalm
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 agre... | apache-2.0 | Python |
115a71995f2ceae667c05114da8e8ba21c25c402 | Move to 1.6.6 dev for further development | alby128/syncplay,alby128/syncplay,Syncplay/syncplay,Syncplay/syncplay | syncplay/__init__.py | syncplay/__init__.py | version = '1.6.6'
revision = ' development'
milestone = 'Yoitsu'
release_number = '87'
projectURL = 'https://syncplay.pl/'
| version = '1.6.5'
revision = ' release'
milestone = 'Yoitsu'
release_number = '86'
projectURL = 'https://syncplay.pl/'
| apache-2.0 | Python |
9ceddfc1a371c02d983a5b62b7d154f35a4b9006 | Bump version to 0.4.0.dev (#707) | quantumlib/Cirq,quantumlib/Cirq,balopat/Cirq,balopat/Cirq,balopat/Cirq,quantumlib/Cirq,quantumlib/Cirq,quantumlib/Cirq | cirq/_version.py | cirq/_version.py | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 | Python |
2c162b131a936c0607ec2aacbf79108aa9a78555 | Bump to version 0.8.0 | reubano/meza,reubano/tabutils,reubano/tabutils,reubano/tabutils,reubano/meza,reubano/meza | tabutils/__init__.py | tabutils/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
tabutils
~~~~~~~~
Provides methods for reading and processing data from tabular formatted files
Examples:
literal blocks::
python example_google.py
Attributes:
ENCODING (str): Default file encoding.
"""
__title__ = 'tabut... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
tabutils
~~~~~~~~
Provides methods for reading and processing data from tabular formatted files
Examples:
literal blocks::
python example_google.py
Attributes:
ENCODING (str): Default file encoding.
"""
__title__ = 'tabut... | mit | Python |
a805379908e8e94f44339a877c094e239ab97a09 | Add command to list all user commands. | Javex/qllbot,sqall01/qllbot,qll/qllbot | modules/usercmds.py | modules/usercmds.py | import contextlib
import lib.cmd
import lib.event
import lib.irc
USERCMD_CHAR = '!'
_user_cmds = {} # storage for all user commands during runtime
@lib.event.subscribe('new_db')
def create_usercmds_schema(db=None):
"""Creates the usercmds SQLite schema."""
db.execute('CREATE TABLE usercmds (cmd TEXT PRIM... | import contextlib
import lib.cmd
import lib.event
import lib.irc
USERCMD_CHAR = '!'
_user_cmds = {} # storage for all user commands during runtime
@lib.event.subscribe('new_db')
def create_usercmds_schema(db=None):
"""Creates the usercmds SQLite schema."""
db.execute('CREATE TABLE usercmds (cmd TEXT PRIM... | bsd-2-clause | Python |
0bb8641efa2e0e54c782b55eb62601735b60a1ce | change error message to indicate Polygons are allowed, too | geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/drf-utm-zone-info,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info | conversion_service/clipping_geometry/to_polyfile.py | conversion_service/clipping_geometry/to_polyfile.py | from django.contrib.gis.geos import MultiPolygon, Polygon
from django.template.loader import render_to_string
def create_poly_file_string(geometry):
"""
Converts a Polygon or Multipolygon to a polyfile compatible string
Args:
geometry: django.contrib.gis.geos.MultiPolygon or django.contrib.gis.ge... | from django.contrib.gis.geos import MultiPolygon, Polygon
from django.template.loader import render_to_string
def create_poly_file_string(geometry):
"""
Converts a Polygon or Multipolygon to a polyfile compatible string
Args:
geometry: django.contrib.gis.geos.MultiPolygon or django.contrib.gis.ge... | mit | Python |
41263cfc401f7eb6f13da4ea1e288e2b6b674f52 | Fix preselection of paid orders filter | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/blueprints/admin/shop/order/models.py | byceps/blueprints/admin/shop/order/models.py | """
byceps.blueprints.admin.shop.order.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from enum import Enum
from typing import Optional
from .....services.shop.order.transfer.mod... | """
byceps.blueprints.admin.shop.order.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from enum import Enum
from typing import Optional
from .....services.shop.order.transfer.mod... | bsd-3-clause | Python |
2633be5b9da5101ea9b5dd4449c6a5eb7405e932 | Set and clear colour for whole filelist output | mcgid/morenines,mcgid/morenines | morenines/output.py | morenines/output.py | import click
import sys
def info(message):
click.echo(message)
def good(message):
click.secho("Warning: " + message, fg='green')
def warning(message):
click.secho("WARNING: " + message, fg='yellow')
def error(message):
click.secho("ERROR: " + message, fg='red')
sys.exit(1)
def set_output_colou... | import click
import sys
def info(message):
click.echo(message)
def good(message):
click.secho("Warning: " + message, fg='green')
def warning(message):
click.secho("WARNING: " + message, fg='yellow')
def error(message):
click.secho("ERROR: " + message, fg='red')
sys.exit(1)
def print_filelist(h... | mit | Python |
65b8484810305ea19a363e14860f2f516733c244 | use django.utils.safestring.mark_safe with html templatetag html output | rsalmaso/django-babeljs,rsalmaso/django-babeljs | babeljs/templatetags/babeljs.py | babeljs/templatetags/babeljs.py | # -*- coding: utf-8 -*-
# Copyright (C) 2007-2015, Raffaele Salmaso <raffaele@salmaso.org>
#
# 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 without limitation... | # -*- coding: utf-8 -*-
# Copyright (C) 2007-2015, Raffaele Salmaso <raffaele@salmaso.org>
#
# 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 without limitation... | mit | Python |
bf1d97366802602952734a1e8874eab3b063179d | Update StructuredGrid example per https://github.com/pyvista/pyvista-support/issues/16 | akaszynski/vtkInterface | examples/00-load/create-structured-surface.py | examples/00-load/create-structured-surface.py | """
.. _ref_create_structured:
Creating a Structured Surface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a StructuredGrid surface from NumPy arrays
"""
# sphinx_gallery_thumbnail_number = 2
import pyvista as pv
import numpy as np
################################################################################
# From NumP... | """
.. _ref_create_structured:
Creating a Structured Surface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a StructuredGrid surface from NumPy arrays
"""
# sphinx_gallery_thumbnail_number = 2
import pyvista as pv
import numpy as np
################################################################################
# Create a ... | mit | Python |
c20202a23d689e75d640c684f8c3f4f9dc599316 | Refactor passlib password hasing example | ets-labs/python-dependency-injector,ets-labs/dependency_injector,rmk135/dependency_injector,rmk135/objects | examples/miniapps/password_hashing/example.py | examples/miniapps/password_hashing/example.py | """Example of dependency injection and password hashing in Python."""
import passlib.hash
import dependency_injector.containers as containers
import dependency_injector.providers as providers
class UsersService:
"""Users service."""
def __init__(self, password_hasher):
"""Initialize instance."""
... | """Example of dependency injection and password hashing in Python."""
import passlib.hash
import dependency_injector.containers as containers
import dependency_injector.providers as providers
class UsersService:
"""Users service."""
def __init__(self, password_hasher):
"""Initialize instance."""
... | bsd-3-clause | Python |
8fff2f030502e011c051c26e8376ed735478d2ef | Fix example for evt readout | tamasgal/km3pipe,tamasgal/km3pipe | examples/offline_analysis/plot_evt_readout.py | examples/offline_analysis/plot_evt_readout.py | # -*- coding: utf-8 -*-
"""
=============================
Reading and Parsing EVT files
=============================
This example shows how to read and parse EVT files, which are used in our
Monte Carlo productions.
"""
# Author: Tamas Gal <tgal@km3net.de>, Moritz Lotze >mlotze@km3net.de>
# License: BSD-3
import mat... | # -*- coding: utf-8 -*-
"""
=============================
Reading and Parsing EVT files
=============================
This example shows how to read and parse EVT files, which are used in our
Monte Carlo productions.
"""
# Author: Tamas Gal <tgal@km3net.de>, Moritz Lotze >mlotze@km3net.de>
# License: BSD-3
import mat... | mit | Python |
4ddbbcbe25b7e24fcf4f342642d204a7b3442828 | Update module description to fix outdated info | treveradams/connector-telephony,brain-tec/connector-telephony,treveradams/connector-telephony,treveradams/connector-telephony,brain-tec/connector-telephony,brain-tec/connector-telephony | base_phone_popup/__openerp__.py | base_phone_popup/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Base Phone Pop-up module for Odoo/OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | # -*- encoding: utf-8 -*-
##############################################################################
#
# Base Phone Pop-up module for Odoo/OpenERP
# Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 | Python |
df7b9879a194c2909467340b72ac7c0c87f6fd77 | Remove camera configuration. | microy/PyStereoVisionToolkit,microy/StereoVision,microy/StereoVision,microy/PyStereoVisionToolkit,microy/VisionToolkit,microy/VisionToolkit | VisionToolkit/Camera.py | VisionToolkit/Camera.py | # -*- coding:utf-8 -*-
#
# Module to capture images from USB cameras
#
#
# External dependencies
#
import threading
import cv2
#
# Thread to read the images from a USB camera
#
class UsbCamera( threading.Thread ) :
#
# Initialisation
#
def __init__( self, image_callback ) :
# Initialize the thread
super... | # -*- coding:utf-8 -*-
#
# Module to capture images from USB cameras
#
#
# External dependencies
#
import threading
import cv2
#
# Thread to read the images from a USB camera
#
class UsbCamera( threading.Thread ) :
#
# Initialisation
#
def __init__( self, image_callback ) :
# Initialize the thread
super... | mit | Python |
cadfdadc14f0bf41456ef32a3e339e76b887eea4 | Fix missing self.shape | toslunar/chainerrl,toslunar/chainerrl | chainerrl/explorers/additive_ou.py | chainerrl/explorers/additive_ou.py | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from logging import getLogger
from chainer import cuda
import numpy as np
from chainerrl import e... | from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from logging import getLogger
from chainer import cuda
import numpy as np
from chainerrl import e... | mit | Python |
7b581c76eab5ae50ec830b2b306d61a4775fa393 | improve comment | coreruleset/coreruleset,SpiderLabs/owasp-modsecurity-crs,SpiderLabs/owasp-modsecurity-crs,umarfarook882/owasp-modsecurity-crs,umarfarook882/owasp-modsecurity-crs,SpiderLabs/owasp-modsecurity-crs,SpiderLabs/owasp-modsecurity-crs,SpiderLabs/owasp-modsecurity-crs,coreruleset/coreruleset,coreruleset/coreruleset,coreruleset... | util/regexp-assemble/regexp-cmdline.py | util/regexp-assemble/regexp-cmdline.py | #!/usr/bin/env python
#
# Convert a word list to a list of regexps usable by Regexp::Assemble.
#
# Examples:
# cat regexp-932100.txt | ./regexp-cmdline.py unix | ./regexp-assemble.pl
# cat regexp-932110.txt | ./regexp-cmdline.py windows | ./regexp-assemble.pl
# cat regexp-932150.txt | ./regexp-cmdline.py unix | ./reg... | #!/usr/bin/env python
#
# Convert a word list to a list of regexps usable by Regexp::Assemble.
#
# Examples:
# cat regexp-932100.txt | ./regexp-cmdline.py unix | ./regexp-assemble.pl
# cat regexp-932110.txt | ./regexp-cmdline.py windows | ./regexp-assemble.pl
# cat regexp-932150.txt | ./regexp-cmdline.py unix | ./reg... | apache-2.0 | Python |
cf399d6daa7df64516e7fe34dceda70c8d634d57 | add formatter to error log file handler. | iDigBio/idigbio-media-appliance,iDigBio/idigbio-media-appliance,iDigBio/idigbio-media-appliance,iDigBio/idigbio-media-appliance | idigbio_media_appliance/app.py | idigbio_media_appliance/app.py | from __future__ import absolute_import, print_function, division, unicode_literals
import os
from flask.ext.sqlalchemy import SQLAlchemy
from flask import Flask
from . import config
import logging
# from gevent import monkey
# monkey.patch_all()
logging.root.setLevel(logging.DEBUG)
FORMAT = '%(asctime)s - %(name)s -... | from __future__ import absolute_import, print_function, division, unicode_literals
import os
from flask.ext.sqlalchemy import SQLAlchemy
from flask import Flask
from . import config
import logging
# from gevent import monkey
# monkey.patch_all()
logging.root.setLevel(logging.DEBUG)
FORMAT = '%(asctime)s - %(name)s -... | mit | Python |
0e3006bee1e23deb2b4b1ea9410d6b61991534dc | fix import | ndawe/rootpy,kreczko/rootpy,ndawe/rootpy,rootpy/rootpy,kreczko/rootpy,rootpy/rootpy,ndawe/rootpy,kreczko/rootpy,rootpy/rootpy | benchmarks/tree/io/tree_read.py | benchmarks/tree/io/tree_read.py | #!/usr/bin/env python
# this import is required to register the Tree class
import rootpy.tree
from rootpy.io import open
from time import time
from ROOT import TTreeCache
import sys
for cached in (False, True):
try:
f = open("test.root")
except IOError:
sys.exit("test.root does not exist. Ple... | #!/usr/bin/env python
from rootpy.io import open
from time import time
from ROOT import TTreeCache
import sys
for cached in (False, True):
try:
f = open("test.root")
except IOError:
sys.exit("test.root does not exist. Please run tree_write.py first.")
tree = f.test
if cached:
... | bsd-3-clause | Python |
b7a082752c4012ff66ed6baf76cb467960c456be | add herokuapp domain to allowed hosts in production | akurihara/impulse,akurihara/impulse | impulse/settings/production.py | impulse/settings/production.py | from .base import *
import dj_database_url
DEBUG = False
ALLOWED_HOSTS = ['.herokuapp.com']
db_from_envronment = dj_database_url.config()
DATABASES = {
'default': db_from_envronment
}
| from .base import *
import dj_database_url
DEBUG = False
db_from_envronment = dj_database_url.config()
DATABASES = {
'default': db_from_envronment
}
| mit | Python |
2f9e92c884984bb816c7996db12d84023810b073 | Disable syntax for large log files | drivnal/drivnal,drivnal/drivnal,drivnal/drivnal | drivnal/handlers/log.py | drivnal/handlers/log.py | from drivnal.constants import *
from drivnal.client import Client
import drivnal.utils as utils
from drivnal import server
@server.app.route('/log/<type>/<volume_id>/<type_id>', methods=['GET'])
def log_get(type, volume_id, type_id):
client = Client()
volume = client.get_volume(volume_id)
data = None
... | from drivnal.constants import *
from drivnal.client import Client
import drivnal.utils as utils
from drivnal import server
@server.app.route('/log/<type>/<volume_id>/<type_id>', methods=['GET'])
def log_get(type, volume_id, type_id):
client = Client()
volume = client.get_volume(volume_id)
data = None
... | agpl-3.0 | Python |
f30c36fbc644b42af8280885d04bb71c0829bc66 | Bump version. | vmlaker/coils | coils/version.py | coils/version.py | __version__ = '2.0.1'
| __version__ = '2.0.0'
| mit | Python |
f49cc86901f4670f28abfbd6c6c0a7ac88f218f1 | support list in runlist | Fewbytes/cloudify-plugin-chef,Fewbytes/cloudify-plugin-chef | cloudify_plugin_chef/operations.py | cloudify_plugin_chef/operations.py | from cloudify.decorators import operation as _operation
from cloudify_plugin_chef.chef_client import run_chef
EXPECTED_OP_PREFIX = 'cloudify.interfaces.lifecycle'
def _extract_op(ctx):
prefix, _, op = ctx.operation.rpartition('.')
if prefix != EXPECTED_OP_PREFIX:
ctx.warn("Node operation is expected ... | from cloudify.decorators import operation as _operation
from cloudify_plugin_chef.chef_client import run_chef
EXPECTED_OP_PREFIX = 'cloudify.interfaces.lifecycle'
def _extract_op(ctx):
prefix, _, op = ctx.operation.rpartition('.')
if prefix != EXPECTED_OP_PREFIX:
ctx.warn("Node operation is expected ... | apache-2.0 | Python |
b8ca9de33bbb9aab87f4f620143e858154264460 | Define a default file for the input data file | ric2b/Mutual_Debt_Simplification | mutual_debt/main.py | mutual_debt/main.py | """Mutual Debt Simplification
Usage:
simplify-debts [ <data_file> ]
simplify-debts (-h | --help)
Options:
-h --help Show this screen.
"""
import json
import sys
from mutual_debt.simplification import debt_list_to_graph, \
simplify_debt_graph, draw_graph
def print_error(*args, sep=' ', end='\n'):
... | """Mutual Debt Simplification
Usage:
simplify-debts <data_file>
simplify-debts (-h | --help)
Options:
-h --help Show this screen.
"""
import json
import sys
from mutual_debt.simplification import debt_list_to_graph, \
simplify_debt_graph, draw_graph
def print_error(*args, sep=' ', end='\n'):
""" ... | mit | Python |
499e4cd6ef85269881622e27417e7ff5caa62464 | change test data | soazig/project-epsilon-1,timothy1191xa/project-epsilon-1,ye-zhi/project-epsilon,berkeley-stat159/project-epsilon | code/utils/tests/test_smoothing.py | code/utils/tests/test_smoothing.py | """ Tests for smoothvoxels in smooth module
Run at the tests directory with:
nosetests test_smoothing.py
"""
import os
import sys
import numpy as np
import itertools
import scipy.ndimage
from scipy.ndimage.filters import gaussian_filter
import matplotlib.pyplot as plt
import nibabel as nib
from numpy.testing impor... | """ Tests for smoothvoxels in smooth module
Run at the tests directory with:
nosetests test_smoothing.py
"""
import os
import sys
import numpy as np
import itertools
import scipy.ndimage
from scipy.ndimage.filters import gaussian_filter
import matplotlib.pyplot as plt
import nibabel as nib
from numpy.testing impor... | bsd-3-clause | Python |
d6b1f7c03ec2b32823fe2c4214e6521e8074cd9f | Make sure the 'channel' argument is not Unicode when we send it, because Twisted doesn't like that | Didero/DideRobot | commands/join.py | commands/join.py | from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
class Command(CommandTemplate):
triggers = ['join']
helptext = "Makes me join another channel, if I'm allowed to at least"
def execute(self, message):
"""
:type message: IrcMessage
"""
replytext = u""
if message.messageParts... | from CommandTemplate import CommandTemplate
from IrcMessage import IrcMessage
class Command(CommandTemplate):
triggers = ['join']
helptext = "Makes me join another channel, if I'm allowed to at least"
def execute(self, message):
"""
:type message: IrcMessage
"""
replytext = u""
if message.messageParts... | mit | Python |
6b04b44a2d54aa557ae60caff443f1cb0e248cdf | Update __init__.py | isponline/netmiko,nvoron23/netmiko,fooelisa/netmiko,jinesh-patel/netmiko,ktbyers/netmiko,rumo/netmiko,mzbenami/netmiko,enzzzy/netmiko,isponline/netmiko,ivandgreat/netmiko,isidroamv/netmiko,shamanu4/netmiko,brutus333/netmiko,ivandgreat/netmiko,isidroamv/netmiko,mileswdavis/netmiko,MikeOfNoTrades/netmiko,jumpojoy/netmiko... | netmiko/__init__.py | netmiko/__init__.py | from ssh_dispatcher import ssh_dispatcher
from cisco import CiscoIosSSH
from cisco import CiscoAsaSSH
from arista import AristaSSH
from f5 import F5LtmSSH
__version__ = '0.1.2'
| from ssh_dispatcher import ssh_dispatcher
from cisco import CiscoIosSSH
from cisco import CiscoAsaSSH
from arista import AristaSSH
__version__ = '0.1.2'
| mit | Python |
263180cdc550d0114bd2b981d0950f807d314f17 | add import | mqingyn/peewee-manager | peeweemgr/__init__.py | peeweemgr/__init__.py | __author__ = 'mqingyn'
__version__ = '1.0.3'
version = tuple(map(int, __version__.split('.')))
| __author__ = 'mqingyn'
__version__ = '1.0.2'
version = tuple(map(int, __version__.split('.')))
| mit | Python |
8060fec64a8e73c6745a904f4f43f953f94e4f0d | Update Ch. 17 PracticeQuestions: imported specific function | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/CrackingCodesWithPython/Chapter17/PracticeQuestions.py | books/CrackingCodesWithPython/Chapter17/PracticeQuestions.py | # Chapter 17 Practice Questions
# 1. What is the word pattern for the word hello?
from books.CrackingCodesWithPython.Chapter17.makeWordPatterns import getWordPattern
wordPat = getWordPattern('hello')
print(wordPat)
# 2. Do mammoth and goggles have the same word pattern?
wordPat1 = getWordPattern('mammoth')
wordPat2 ... | # Chapter 17 Practice Questions
# 1. What is the word pattern for the word hello?
import books.CrackingCodesWithPython.Chapter17.makeWordPatterns
wordPat = books.CrackingCodesWithPython.Chapter17.makeWordPatterns.getWordPattern('hello')
print(wordPat)
# 2. Do mammoth and goggles have the same word pattern?
wordPat1 ... | mit | Python |
eaea688fb9e291c83d45b08c1a34591cdca21312 | Update Ch. 18 PracticeQuestions: changed Question 2 solution | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/CrackingCodesWithPython/Chapter18/PracticeQuestions.py | books/CrackingCodesWithPython/Chapter18/PracticeQuestions.py | # Chapter 18 Practice Questions
# 1. Which cipher is the Vigenere cipher similar to, except that the Vigenere
# cipher uses multiple keys instead of just one key?
# Hint: Check page 248
from books.CrackingCodesWithPython.Chapter18.vigenereCipher import decryptMessage
message = "Tuw Rmxeawni Ticzav zs faimcae lk xy... | # Chapter 18 Practice Questions
# 1. Which cipher is the Vigenere cipher similar to, except that the Vigenere
# cipher uses multiple keys instead of just one key?
# Hint: Check page 248
from books.CrackingCodesWithPython.Chapter18.vigenereCipher import decryptMessage
message = "Tuw Rmxeawni Ticzav zs faimcae lk xy... | mit | Python |
fb44db3b03274efff025cb19c312d2230085033d | Update representation of exception | infoxchange/ixprofile-client,infoxchange/ixprofile-client | ixprofile_client/exceptions.py | ixprofile_client/exceptions.py | """
Exceptions raised when interacting with the profile server
"""
class ProfileServerException(Exception):
"""
Base exception for all profile server errors
"""
def __init__(self, response=None):
super(ProfileServerFailure, self).__init__()
self.response = response
try:
... | """
Exceptions raised when interacting with the profile server
"""
class ProfileServerException(Exception):
"""
Base exception for all profile server errors
"""
def __init__(self, response=None):
super(ProfileServerFailure, self).__init__()
self.response = response
try:
... | mit | Python |
0144b24a2482c3c23691a474e647d8be79641e12 | Update test case to new return format. | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/integration/client/standard.py | tests/integration/client/standard.py | # -*- coding: utf-8 -*-
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class StdTest(integration.ModuleCase):
'''
Test standard client calls
'''
def test_cli(self):
'''
Test cli function
... | # -*- coding: utf-8 -*-
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class StdTest(integration.ModuleCase):
'''
Test standard client calls
'''
def test_cli(self):
'''
Test cli function
... | apache-2.0 | Python |
fb7117f2acdb54560048d319235b5f3d35ae989b | Use salt.utils.versions.LooseVersion instead of distutils | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | tests/integration/states/test_npm.py | tests/integration/states/test_npm.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Erik Johnson (erik@saltstack.com)`
tests.integration.states.npm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import s... | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Erik Johnson (erik@saltstack.com)`
tests.integration.states.npm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
from distutils.version import LooseVersion
# Import Salt Testing libs
from tests.support.case import ... | apache-2.0 | Python |
d69aaff42cd707c9930cac37a329c898523b9cbf | fix a bug where the first line is ignored | MirkoDziadzka/ofxstatement-1822direkt | src/ofxstatement/plugins/germany_1822direkt.py | src/ofxstatement/plugins/germany_1822direkt.py | from ofxstatement.plugin import Plugin
from ofxstatement.parser import CsvStatementParser
from ofxstatement.statement import StatementLine
class FrankfurterSparkasse1822Plugin(Plugin):
def get_parser(self, filename):
encoding = self.settings.get('charset', 'iso-8859-1')
f = open(filename, 'r', enco... | from ofxstatement.plugin import Plugin
from ofxstatement.parser import CsvStatementParser
from ofxstatement.statement import StatementLine
class FrankfurterSparkasse1822Plugin(Plugin):
def get_parser(self, filename):
encoding = self.settings.get('charset', 'iso-8859-1')
f = open(filename, 'r', enco... | bsd-2-clause | Python |
703cc73fca458898151632739128d65edd85da2e | Change Regular expression to match Game Bots | Onapsis/sandboxed-game-engine | turnboxed/basebot.py | turnboxed/basebot.py | import os
import json
import re
import traceback
class BaseBot(object):
def __init__(self):
self._turn_cookie = None
def log_exception(self, excpt):
os.write(123456789, json.dumps({"TURN_COOKIE": self._turn_cookie,
"EXCEPTION": excpt.__class__.__name__... | import os
import json
import re
import traceback
class BaseBot(object):
def __init__(self):
self._turn_cookie = None
def log_exception(self, excpt):
os.write(123456789, json.dumps({"TURN_COOKIE": self._turn_cookie,
"EXCEPTION": excpt.__class__.__name__... | mit | Python |
c5331de78f9f8496f6400b3816f31bee073abf32 | Fix alignment and close an #ifdef | skeuomorf/cryptography,skeuomorf/cryptography,Hasimir/cryptography,sholsapp/cryptography,dstufft/cryptography,dstufft/cryptography,sholsapp/cryptography,Ayrx/cryptography,kimvais/cryptography,skeuomorf/cryptography,bwhmather/cryptography,kimvais/cryptography,Hasimir/cryptography,Hasimir/cryptography,kimvais/cryptograph... | cryptography/hazmat/bindings/openssl/ecdh.py | cryptography/hazmat/bindings/openssl/ecdh.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 the... | # 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 the... | bsd-3-clause | Python |
3ab661fbd7fdb7f977afca5d38eb8f0ab65deaeb | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/d1ce4aeadb85fda49399d922630164ea24ce92a2. | paolodedios/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tenso... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "d1ce4aeadb85fda49399d922630164ea24ce92a2"
TFRT_SHA256 = "9ec2555b5ae76773634a29cef3e3... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "4b7d8e901b5598f3739512f022e9dfe218e605cd"
TFRT_SHA256 = "e8de656c387fa8b73e461e5534e5... | apache-2.0 | Python |
7dc88b6620682d3338d6a08ff4a255f32c65aae8 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/9b140cb259147e01ecfba6df57c745b6a71fd950. | tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,yongtang/tenso... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "9b140cb259147e01ecfba6df57c745b6a71fd950"
TFRT_SHA256 = "3a6ec4127fb2d6011a298c6bb806... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "372edb969ec4aee247c451daf0902078cf8a3fce"
TFRT_SHA256 = "5010fb9576a1ef1c73d867a20dba... | apache-2.0 | Python |
8508b747acb287898651274d8ee3e800f0a13824 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/a1b0f3671864f65c4f6270ccbbf320a8454a74e1. | tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libra... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "a1b0f3671864f65c4f6270ccbbf320a8454a74e1"
TFRT_SHA256 = "a10660324c96be592a5bf7ed4bfb... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "226dc422f0cf7636b8357e56b4fe701d969c29b7"
TFRT_SHA256 = "0c4f12c4c4fd9232f2392ebceafc... | apache-2.0 | Python |
5d637e92bfb00f21cefe628e933df2618b1f14ed | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/ecd68c32546434bf80f90d2ad8f32095c4cc066e. | frreiss/tensorflow-fred,frreiss/tensorflow-fred,yongtang/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorfl... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ecd68c32546434bf80f90d2ad8f32095c4cc066e"
TFRT_SHA256 = "222283f436df9ca6c2d50ed3d2f1045c593457cecb130b... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "232bc420a3d766bb0d257319f03f2ab15bf3b443"
TFRT_SHA256 = "28e14a29c90871fcdd61f0d5fc7c890f49943528ea66ec... | apache-2.0 | Python |
cfd1581a8b8913df350e5ee09f1e7ae9cdb39850 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/0a2cdcfc4f9409e586290aff06d27d848fd46fe7. | karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,tensorflow/... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "0a2cdcfc4f9409e586290aff06d27d848fd46fe7"
TFRT_SHA256 = "dadace8820329b088a2bc302fdde... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "e48f4cd1e8c2de3dacfac21835e1b6b070c0e00c"
TFRT_SHA256 = "e4d8cda2f6e10c85dee5ec3d133b... | apache-2.0 | Python |
d26ec5ec25920362f59769cb0435846c28af4fba | Remove uneeded button index map | furbrain/tingbot-python | tingbot/platform_specific/tingbot.py | tingbot/platform_specific/tingbot.py | import os
def fixup_env():
import evdev
os.environ["SDL_FBDEV"] = "/dev/fb1"
mouse_path = None
for device_path in evdev.list_devices():
device = evdev.InputDevice(device_path)
if device.name == "ADS7846 Touchscreen":
mouse_path = device_path
if mouse_path:
os... | import os
def fixup_env():
import evdev
os.environ["SDL_FBDEV"] = "/dev/fb1"
mouse_path = None
for device_path in evdev.list_devices():
device = evdev.InputDevice(device_path)
if device.name == "ADS7846 Touchscreen":
mouse_path = device_path
if mouse_path:
os... | bsd-2-clause | Python |
521e24fa115e69bca39d7cca89ce42e8efa3b077 | Use full pathname to perf_expectations in test. | meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u... | tools/perf_expectations/PRESUBMIT.py | tools/perf_expectations/PRESUBMIT.py | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on ... | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on ... | bsd-3-clause | Python |
9dd71fe94b57d56a422e784c10c463c22add90c3 | Fix absolute reference to logfile location | interactomix/iis,interactomix/iis | configuration/development.py | configuration/development.py | import pathlib
_basedir = pathlib.Path(__file__).parents[1]
SQLALCHEMY_DATABASE_URI = (
'sqlite:///' + str(_basedir.joinpath(pathlib.PurePath('app.db')).resolve())
)
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = 'INSECURE'
MAIL_SERVER = 'localhost'
MAIL_PORT = '25'
MAIL_DEFAULT_SENDER = 'no-reply@localhos... | import pathlib
_basedir = pathlib.Path(__file__).parents[1]
SQLALCHEMY_DATABASE_URI = (
'sqlite:///' + str(_basedir.joinpath(pathlib.PurePath('app.db')).resolve())
)
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = 'INSECURE'
MAIL_SERVER = 'localhost'
MAIL_PORT = '25'
MAIL_DEFAULT_SENDER = 'no-reply@localhos... | agpl-3.0 | Python |
013d6896e883845aebf03ea5830b518c918f8b1a | fix typo | ihsanudin/odoo,camptocamp/ngo-addons-backport,osvalr/odoo,Bachaco-ve/odoo,cloud9UG/odoo,ecosoft-odoo/odoo,SAM-IT-SA/odoo,BT-rmartin/odoo,bealdav/OpenUpgrade,blaggacao/OpenUpgrade,srsman/odoo,klunwebale/odoo,oihane/odoo,ehirt/odoo,collex100/odoo,nitinitprof/odoo,alhashash/odoo,cysnake4713/odoo,VitalPet/odoo,omprakasha/o... | addons/portal/portal.py | addons/portal/portal.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | Python |
b0b74348c54eb94c1dd1f5f1c146f2a9fa7c0534 | remove unused import | opendatazurich/ckanext-stadtzh-dwhdropzone | ckanext/stadtzhdwhdropzone/harvesters/stadtzhdwhdropzoneharvester.py | ckanext/stadtzhdwhdropzone/harvesters/stadtzhdwhdropzoneharvester.py | # coding: utf-8
from ckanext.stadtzhharvest.harvester import StadtzhHarvester
import logging
log = logging.getLogger(__name__)
class StadtzhdwhdropzoneHarvester(StadtzhHarvester):
'''
The harvester for the Stadt ZH DWH Dropzone
'''
DATA_PATH = '/usr/lib/ckan/DWH'
METADATA_DIR = 'dwh-metadata'
... | # coding: utf-8
from ckanext.stadtzhharvest.harvester import StadtzhHarvester
import os
import logging
log = logging.getLogger(__name__)
class StadtzhdwhdropzoneHarvester(StadtzhHarvester):
'''
The harvester for the Stadt ZH DWH Dropzone
'''
DATA_PATH = '/usr/lib/ckan/DWH'
METADATA_DIR = 'dwh-... | agpl-3.0 | Python |
0124161cfa0064ff5517c5dff108e74d2066974e | Use cupyx.scipy._scipy_available to import scipy.linalg conditionally in test_decomp_lu.py | cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy | tests/cupyx_tests/scipy_tests/linalg_tests/test_decomp_lu.py | tests/cupyx_tests/scipy_tests/linalg_tests/test_decomp_lu.py | import unittest
import numpy
import cupy
from cupy import cuda
from cupy import testing
import cupyx.scipy.linalg
if cupyx.scipy._scipy_available:
import scipy.linalg
@testing.gpu
@testing.parameterize(*testing.product({
'shape': [(1, 1), (2, 2), (3, 3), (5, 5)],
}))
@testing.fix_random()
@unittest.skipUnles... | import unittest
import numpy
try:
import scipy.linalg
scipy_available = True
except ImportError:
scipy_available = False
import cupy
from cupy import cuda
from cupy import testing
import cupyx.scipy.linalg
@testing.gpu
@testing.parameterize(*testing.product({
'shape': [(1, 1), (2, 2), (3, 3), (5, 5... | mit | Python |
a0840998821b78dfeae8df8e5d031089393581ed | Fix module dependencies | eicher31/compassion-modules,CompassionCH/compassion-modules,Secheron/compassion-modules,CompassionCH/compassion-modules,eicher31/compassion-modules,ecino/compassion-modules,emgirardin/compassion-modules,philippe89/compassion-modules,emgirardin/compassion-modules,maxime-beck/compassion-modules,emgirardin/compassion-modu... | contract_compassion/__openerp__.py | contract_compassion/__openerp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / /... | # -*- encoding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / /... | agpl-3.0 | Python |
3c2216db8c9caa09cbdacf094739b7bcf869c068 | Use Plotter.datastore = Propagate | tkf/compapp | compapp/utils.py | compapp/utils.py | from .core import Executable
from .plugins import PluginWrapper, AutoDump, Figure, \
SubDataStore, HashDataStore
from .properties import Propagate
class Plotter(Executable):
"""
Base plotter class.
Example
-------
::
class DensityPlotter(Plotter):
pass
class Cumulativ... | from .core import Executable
from .plugins import PluginWrapper, AutoDump, Figure, \
SubDataStore, HashDataStore
class Plotter(Executable):
"""
Base plotter class.
Example
-------
::
class DensityPlotter(Plotter):
pass
class CumulativeDistributionPlotter(Plotter):
... | bsd-2-clause | Python |
189f7d81f31abf20bbd56e098bf8dacd8a933d05 | Remove unused function casp_model_names. | deepmind/alphafold,deepmind/alphafold | alphafold/model/data.py | alphafold/model/data.py | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | apache-2.0 | Python |
82aa492f43b7b7c2a9aa935d4fe101743c64e144 | Add function to get stdin/stdout/stderr on MSVC | seibert/numba,stonebig/numba,IntelLabs/numba,cpcloud/numba,ssarangi/numba,stuartarchibald/numba,gmarkall/numba,jriehl/numba,ssarangi/numba,shiquanwang/numba,stuartarchibald/numba,numba/numba,pombredanne/numba,sklam/numba,sklam/numba,gmarkall/numba,stonebig/numba,stonebig/numba,sklam/numba,gmarkall/numba,gmarkall/numba,... | numba/stdio_util.py | numba/stdio_util.py | #! /usr/bin/env python
# ______________________________________________________________________
import ctypes
import ctypes.util
from numba import *
# ______________________________________________________________________
c_void_pp = ctypes.POINTER(ctypes.c_void_p)
def get_libc ():
return ctypes.CDLL(ctypes.ut... | #! /usr/bin/env python
# ______________________________________________________________________
import ctypes
import ctypes.util
from numba import *
# ______________________________________________________________________
c_void_pp = ctypes.POINTER(ctypes.c_void_p)
def get_libc ():
return ctypes.CDLL(ctypes.ut... | bsd-2-clause | Python |
7d46b70f0201417a8abd2debed7780834d710897 | Add masked_as_lists function | cfobel/numpy_helpers | numpy_helpers/ma.py | numpy_helpers/ma.py | import numpy as np
def masked_as_lists(masked_array):
rank = len(masked_array.shape)
slices = tuple([slice(0, masked_array.shape[i]) for i in xrange(rank - 1)])
digits = int(np.ceil(np.log10(masked_array.max())))
f = '%%%dd' % digits
masked_lists = [', '.join([f % block_id if not m else digits... | import numpy as np
def pformat(masked_array):
rank = len(masked_array.shape)
slices = tuple([slice(0, masked_array.shape[i]) for i in xrange(rank - 1)])
digits = int(np.ceil(np.log10(masked_array.max())))
f = '%%%dd' % digits
line = ']\n' + ((rank - 1) * ' ') + '['
formatted_masked = line.... | mit | Python |
f07204ba55442e13e71c28535714fb0c024aba52 | Add unique_id to ohmconnect (#78479) | w1ll1am23/home-assistant,nkgilley/home-assistant,nkgilley/home-assistant,w1ll1am23/home-assistant,mezz64/home-assistant,mezz64/home-assistant | homeassistant/components/ohmconnect/sensor.py | homeassistant/components/ohmconnect/sensor.py | """Support for OhmConnect."""
from __future__ import annotations
from datetime import timedelta
import logging
import defusedxml.ElementTree as ET
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_ID, CONF_NAME
from... | """Support for OhmConnect."""
from __future__ import annotations
from datetime import timedelta
import logging
import defusedxml.ElementTree as ET
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_ID, CONF_NAME
from... | apache-2.0 | Python |
9cc290f6b5f1fd73840d02e2dc390e151ecff2db | Fix typo. | opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind | src/waldur_mastermind/analytics/serializers.py | src/waldur_mastermind/analytics/serializers.py | from datetime import timedelta
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from waldur_core.core.serializers import GenericRelatedField
from waldur_core.structure.models import Customer, Project
class DailyHistoryQuotaSerializer(se... | from datetime import timedelta
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from waldur_core.core.serializers import GenericRelatedField
from waldur_core.structure.models import Customer, Project
class DailyHistoryQuotaSerializer(se... | mit | Python |
c88cefb1a12f35a8554fc783074883cbc558100a | Use request.access_route for determining origin of request to get through the Openshift servers. | bilderbuchi/ofCodeStyleGuard,bilderbuchi/ofCodeStyleGuard | ofCodeStyleGuard.py | ofCodeStyleGuard.py | #!/usr/bin/python
"""Make sure openFrameworks Pull Requests conform to the code style"""
import styleguard
import logging
import json
import os
from flask import Flask, request
LOGGER = logging.getLogger('webserver')
logging.basicConfig(level=styleguard.cfg['logging_level'])
APP = Flask(__name__)
APP.logger.setLevel(s... | #!/usr/bin/python
"""Make sure openFrameworks Pull Requests conform to the code style"""
import styleguard
import logging
import json
import os
from flask import Flask, request
LOGGER = logging.getLogger('webserver')
logging.basicConfig(level=styleguard.cfg['logging_level'])
APP = Flask(__name__)
APP.logger.setLevel(s... | mit | Python |
b326d43a94058390a559c4c9f55e9cd88dcac747 | Set propper mimetype for image attachment | liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4,liqd/adhocracy4 | adhocracy4/emails/mixins.py | adhocracy4/emails/mixins.py | from email.mime.image import MIMEImage
from django.contrib.staticfiles import finders
from .base import EmailBase
class PlatformEmailMixin:
"""
Attaches the static file images/logo.png so it can be used in an html
email.
"""
def get_attachments(self):
attachments = super().get_attachments... | from email.mime.image import MIMEImage
from django.contrib.staticfiles import finders
from .base import EmailBase
class PlatformEmailMixin:
"""
Attaches the static file images/logo.png so it can be used in an html
email.
"""
def get_attachments(self):
attachments = super().get_attachments... | agpl-3.0 | Python |
3afd4e86eb665ddd33538875ba69cf2e7a558b79 | put the pid in the formatter | plockaby/dart,plockaby/dart,plockaby/dart,plockaby/dart | agent/lib/dart/agent/cli.py | agent/lib/dart/agent/cli.py | #!/usr/bin/env python3
"""
This is a supervisord event listener. It does things such as:
* Forward state changes to the distributed data store.
* Forward active and pending configurations to the distributed data store.
* Forward host configuration information to the distributed data store.
* Listen for commands to exe... | #!/usr/bin/env python3
"""
This is a supervisord event listener. It does things such as:
* Forward state changes to the distributed data store.
* Forward active and pending configurations to the distributed data store.
* Forward host configuration information to the distributed data store.
* Listen for commands to exe... | artistic-2.0 | Python |
ee95736e1218e3fe7139777775019e38ec6c0edb | Change tests to new syntax. | frac/django-test-utils,ericholscher/django-test-utils,acdha/django-test-utils,acdha/django-test-utils,frac/django-test-utils,ericholscher/django-test-utils | test_project/test_app/tests/testmaker_tests.py | test_project/test_app/tests/testmaker_tests.py | """
This file is to test testmaker. It will run over the polls app and with the crawler and with test maker outputting things. Hopefully this will provide a sane way to test testmaker.
"""
from django.test.testcases import TestCase
from django.template import Context, Template
from django.contrib.auth.models import Use... | """
This file is to test testmaker. It will run over the polls app and with the crawler and with test maker outputting things. Hopefully this will provide a sane way to test testmaker.
"""
from django.test.testcases import TestCase
from django.template import Context, Template
from django.contrib.auth.models import Use... | mit | Python |
876af95676eeb75ce2077e3fc94078131153df10 | Fix dynprefs import | c0d3z3r0/ctf-backend,c0d3z3r0/ctf-backend,c0d3z3r0/ctf-backend,c0d3z3r0/ctf-backend | ctfbackend/backend/templatetags/backend_extras.py | ctfbackend/backend/templatetags/backend_extras.py | from django import template
from dynamic_preferences.registries import global_preferences_registry
register = template.Library()
@register.simple_tag
def navactive(request, urls):
if request.resolver_match.url_name in urls.split():
return "active"
return ""
@register.simple_tag
def dynprefs(prefnam... | from django import template
from dynamic_preferences.registries import \
global_preferences_registry as dynprefs
register = template.Library()
@register.simple_tag
def navactive(request, urls):
if request.resolver_match.url_name in urls.split():
return "active"
return ""
@register.simple_tag
de... | agpl-3.0 | Python |
4cecd527b62b0258c44398edf2e666adaae2db7e | Upgrade to v2.7.13 | biolink/ontobio,biolink/ontobio | ontobio/__init__.py | ontobio/__init__.py | from __future__ import absolute_import
__version__ = '2.7.13'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition
from .assoc_factory import AssociationSetFactory
from .io.ontol_renderers import GraphRenderer
import logging
import logging.handlers
from logging.config impo... | from __future__ import absolute_import
__version__ = '2.7.12'
from .ontol_factory import OntologyFactory
from .ontol import Ontology, Synonym, TextDefinition
from .assoc_factory import AssociationSetFactory
from .io.ontol_renderers import GraphRenderer
import logging
import logging.handlers
from logging.config impo... | bsd-3-clause | Python |
bb7c9e117a17e31afc103192c7cd13b68c7232c3 | Fix dependency_manager path hacking. | catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult | dependency_manager/dependency_manager/__init__.py | dependency_manager/dependency_manager/__init__.py | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
CATAPULT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
CATAPULT_THIRD_PARTY_PATH = os.path.... | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
CATAPULT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
CATAPULT_THIRD_PARTY_PATH = os.path.... | bsd-3-clause | Python |
4163401029515ba49159356fd293b8472e2d1bff | add admin for message | elnappo/Baulicht,elnappo/Baulicht,elnappo/Baulicht,elnappo/Baulicht | Webinterface/main/admin.py | Webinterface/main/admin.py | from django.contrib import admin
from main.models import Message
def to_dbus(modeladmin, request, queryset):
for message in queryset:
message.send_to_dbus()
to_dbus.short_description = "Mark selected messages as published"
def remove_from_dbus(modeladmin, request, queryset):
for message in queryse... | from django.contrib import admin
from main.models import Message
# Register your models here.
admin.site.register(Message)
| mit | Python |
f4c83a4dd5e8f774e976ea72fc9c4369d4e96d39 | Add exception handling for when Pi disassociates | jasonsbrooks/ysniff-software,jasonsbrooks/ysniff-software | ysniff.py | ysniff.py | #!/usr/bin/env python
import boto.rds
import fileinput
import sys
import os
from subprocess import call
mac_index = 12
time_index = 1
start_t_us = 0
start_u_us = 0
MAC_LEN = 17
SAMPLE_PERIOD = 30 # Seconds.
PUSH_TO_AWS_PERIOD = 300 # Seconds.
maclist = set()
buffer = {}
try:
domain=conn.get_domain('tmp_ysniff')
... | #!/usr/bin/env python
import boto.rds
import fileinput
import sys
import os
mac_index = 12
time_index = 1
start_t_us = 0
start_u_us = 0
MAC_LEN = 17
SAMPLE_PERIOD = 30 # Seconds.
PUSH_TO_AWS_PERIOD = 300 # Seconds.
maclist = set()
buffer = {}
conn=boto.connect_sdb()
domain=conn.get_domain('tmp_ysniff')
# TODO: Uplo... | mit | Python |
3c81d6708730f237d8b2e1462e80eba6bd5411f3 | Add logout function. | supasate/PythonZabbixApi | zabbix.py | zabbix.py | import requests
class ZabbixError(Exception):
pass
class Api(object):
def __init__(self, server='http://localhost/zabbix'):
self.session = requests.Session()
self.session.headers.update({
'Content-Type': 'application/json'
})
self.url = server + '/api_jsonrpc.php'
... | import requests
class ZabbixError(Exception):
pass
class Api(object):
def __init__(self, server='http://localhost/zabbix'):
self.session = requests.Session()
self.session.headers.update({
'Content-Type': 'application/json'
})
self.url = server + '/api_jsonrpc.php'
... | apache-2.0 | Python |
331be7f72afe69403208f9e936bb8ff2483eefa8 | Revert accidental revision to local.py | texastribune/emissions-database,texastribune/emissions-database,texastribune/emissions-database,texastribune/emissions-database | emission_events/emission_events/settings/local.py | emission_events/emission_events/settings/local.py | ##################
# LOCAL SETTINGS #
##################
import os
from .base import *
#######################
# DEBUG CONFIGURATION #
#######################
# https://docs.djangoproject.com/en/1.7/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/1.7/ref/settings/#template-debug
TEMPLATE_DEBU... | ##################
# LOCAL SETTINGS #
##################
import os
from .base import *
#######################
# DEBUG CONFIGURATION #
#######################
# https://docs.djangoproject.com/en/1.7/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/1.7/ref/settings/#template-debug
TEMPLATE_DEBU... | mit | Python |
279215dae02b455bee0244cd7dcd26e3ce12f39c | fix type and add functool.wraps | johnbywater/eventsourcing,johnbywater/eventsourcing | eventsourcing/domain/services/event_subscriber.py | eventsourcing/domain/services/event_subscriber.py | from functools import wraps
from eventsourcing.domain.model.events import subscribe
def subscribe_to(event_class):
""" Decorator for making a custom event handler function subscribe to a certain event type
Args:
event_class: DomainEvent class or its child classes that the handler function should subsc... | from eventsourcing.domain.model.events import subscribe
def subscribe_to(event_class):
""" Annotation for wrapping up a custom event handler function and subscribe to a certain event type
Args:
event_class: DomainEvent class or its child classes that the handler function should subscribe to
Examp... | bsd-3-clause | Python |
d62ec44e98aab1f58084b21d4c9b4c61ffd6fe36 | Add tests to cover using the JWTAuth class using ES256 in addition to RS256. | atlassian/asap-authentication-python | atlassian_jwt_auth/contrib/tests/test_requests.py | atlassian_jwt_auth/contrib/tests/test_requests.py | import unittest
import jwt
from requests import Request
import atlassian_jwt_auth
from atlassian_jwt_auth.tests import utils
from atlassian_jwt_auth.contrib.requests import JWTAuth, create_jwt_auth
class BaseRequestsTest(object):
""" tests for the contrib.requests.JWTAuth class """
def setUp(self):
... | import unittest
import jwt
from requests import Request
from atlassian_jwt_auth.tests import utils
from atlassian_jwt_auth.contrib.requests import create_jwt_auth
class RequestsTest(unittest.TestCase, utils.RS256KeyTestMixin):
""" tests for the contrib.requests.JWTAuth class """
def setUp(self):
se... | mit | Python |
d587fbbd962e0682c08c5b9ee49891efafc675a1 | add basic parameter filtering (requires url and label) | noxan/django-bootstrap-navtags | bootstrapnavtags/templatetags/bootstrapnavtags.py | bootstrapnavtags/templatetags/bootstrapnavtags.py | from django import template
from django.template.base import TemplateSyntaxError
register = template.Library()
@register.tag
def navitem(parser, token):
bits = token.split_contents()
template_tag = bits[0]
if len(bits) < 3:
raise template.TemplateSyntaxError, "%r tag requires at least two argum... | from django import template
register = template.Library()
@register.tag
def navitem(parser, token):
pass
| bsd-3-clause | Python |
4df0318354119b0e7531352b5dbce2a5bb12da01 | add some quotations and ready for sql | yangshaoshun/OMOOC2py,yangshaoshun/OMOOC2py | _src/om2py4w/4wex0/main.py | _src/om2py4w/4wex0/main.py | # -*- coding: utf-8 -*-
from bottle import *
import sys
from jinja2 import Template
reload(sys)
sys.setdefaultencoding( "utf-8" )
# 打开历史文件
def print_log():
open_file = open("mydaily.log")
log = open_file.read()
return log
# 向历史文件写入数据
def new(txt_add):
target = open("mydaily.log", 'a')
target.wr... | # -*- coding: utf-8 -*-
from bottle import *
import sys
from jinja2 import Template
reload(sys)
sys.setdefaultencoding( "utf-8" )
def print_log():
open_file = open("mydaily.log")
log = open_file.read()
return log
def new(txt_add):
target = open("mydaily.log", 'a')
target.write(txt_add + '\n')
... | mit | Python |
07a04f63da897ae687fd90039d379482a13372e2 | Standardize module names on leading capital letters | ElementalAlchemist/txircd,Heufneutje/txircd | txircd/modules/rfc/response_error.py | txircd/modules/rfc/response_error.py | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ErrorResponse(ModuleData):
implements(IPlugin, IModuleData)
name = "ErrorResponse"
core = True
def actions(self):
return [ ("quit", 10, self.sendE... | from twisted.plugin import IPlugin
from txircd.module_interface import IModuleData, ModuleData
from zope.interface import implements
class ErrorResponse(ModuleData):
implements(IPlugin, IModuleData)
name = "errorResponse"
core = True
def actions(self):
return [ ("quit", 10, self.sendE... | bsd-3-clause | Python |
011a546db976f444e76dddc172b213b0a3d5c974 | Clean up the SampleFramework class | rmccue/depthmapper | depthmapper/SampleFramework.py | depthmapper/SampleFramework.py | """
SampleFramework.py - Application framework from the PyOgre demos
Requires PyOgre from http://python-ogre.org/
See README.md for installation requirements
This code is in the Public Domain
"""
import ogre.renderer.OGRE as ogre
# We don't use the verisons but it's nice to set them up...
ogre.OgreVersion = ogre.Ge... | """
SampleFramework.py - Application framework from the PyOgre demos
Requires PyOgre from http://python-ogre.org/
See README.md for installation requirements
This code is in the Public Domain
"""
import ogre.renderer.OGRE as ogre
# We don't use the verisons but it's nice to set them up...
ogre.OgreVersion = ogre.Ge... | isc | Python |
3041fb18421f7521d0c11405ff33ea375f45d5dc | Make modules uninstallable | OCA/l10n-switzerland,OCA/l10n-switzerland | l10n_ch_states/__manifest__.py | l10n_ch_states/__manifest__.py | # Copyright 2015 Mathias Neef copadoMEDIA UG
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Switzerland Country States',
'category': 'Localisation',
'summary': '',
'version': '11.0.1.0.0',
'author': 'copado MEDIA UG, Odoo Community Association (OCA)',
'website': 'http... | # Copyright 2015 Mathias Neef copadoMEDIA UG
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Switzerland Country States',
'category': 'Localisation',
'summary': '',
'version': '11.0.1.0.0',
'author': 'copado MEDIA UG, Odoo Community Association (OCA)',
'website': 'http... | agpl-3.0 | Python |
29358a1d0ccb4707b0b8f19e562ea7e199a68605 | Add OCA as author of OCA addons | factorlibre/l10n-spain,factorlibre/l10n-spain,factorlibre/l10n-spain | l10n_es_partner/__openerp__.py | l10n_es_partner/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Spanish Localization Team
# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com)
# Jordi Esteve <jesteve@zikzakm... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Spanish Localization Team
# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com)
# Jordi Esteve <jesteve@zikzakm... | agpl-3.0 | Python |
cb7aeb60fcff7f8fa6ac9e12282bf7dcd71617d8 | Fix ceilometerclient mocks for 2.8.0 release | openstack/heat,noironetworks/heat,noironetworks/heat,openstack/heat | heat/tests/clients/test_ceilometer_client.py | heat/tests/clients/test_ceilometer_client.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
# ... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 | Python |
3d92c98ad5f75d7d19972af96939b28e198499ea | remove whitespaces | rtavenar/tslearn | tslearn/docs/examples/plot_serialize_models.py | tslearn/docs/examples/plot_serialize_models.py | # -*- coding: utf-8 -*-
"""
Model Persistence
=================
Many tslearn models can be saved to disk and used for predictions
at a later time. This can be particularly useful when a model takes
a long time to train.
**Available formats:** hdf5, json, pickle
Save a model to disk::
model.to_<format>
Load a m... | # -*- coding: utf-8 -*-
"""
Model Persistence
=================
Many tslearn models can be saved to disk and used for predictions
at a later time. This can be particularly useful when a model takes
a long time to train.
**Available formats:** hdf5, json, pickle
Save a model to disk::
model.to_<format>
Load a... | bsd-2-clause | Python |
365e51729e8d2caddc3116bc4c4d1c9f5f5d45c1 | Debug code | agendaodonto/server,agendaodonto/server | app/schedule/service/sms.py | app/schedule/service/sms.py | from datetime import datetime
from time import sleep
from django.conf import settings
from pyfcm import FCMNotification
class SMS:
def __init__(self):
self.client = FCMNotification(settings.FIREBASE_TOKEN)
def wait_for_status_change(self, schedule) -> bool:
start_time = datetime.now()
... | from datetime import datetime
from time import sleep
from django.conf import settings
from pyfcm import FCMNotification
class SMS:
def __init__(self):
self.client = FCMNotification(settings.FIREBASE_TOKEN)
def wait_for_status_change(self, schedule) -> bool:
start_time = datetime.now()
... | agpl-3.0 | Python |
cc6c00656f8a7bd969c400904647fc9fc6125486 | add space | 0sw4l/villas-de-san-pablo,0sw4l/villas-de-san-pablo,0sw4l/villas-de-san-pablo,0sw4l/villas-de-san-pablo | apps/empleabilidad/forms.py | apps/empleabilidad/forms.py | from django import forms
from . import models
from apps.utils import forms as utils, constants
from django.forms import models as models_form
from apps.personas import models as persona_models
class VacanteForm(utils.BaseFormAllFields):
title = 'Vacante'
fecha = forms.DateField(input_formats=constants.INPUT_F... | from django import forms
from . import models
from apps.utils import forms as utils, constants
from django.forms import models as models_form
from apps.personas import models as persona_models
class VacanteForm(utils.BaseFormAllFields):
title = 'Vacante'
fecha = forms.DateField(input_formats=constants.INPUT_F... | mit | Python |
4e379e5813f8686578397043554819fbb5dbb410 | add ALMA beta server | ceb8/astroquery,imbasimba/astroquery,imbasimba/astroquery,ceb8/astroquery | astroquery/alma/__init__.py | astroquery/alma/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
ALMA Archive service.
"""
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.alma`.
"""
timeout = _config.ConfigItem(60, "Timeout in seconds")
archive_url = _c... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
ALMA Archive service.
"""
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.alma`.
"""
timeout = _config.ConfigItem(60, "Timeout in seconds")
archive_url = _c... | bsd-3-clause | Python |
937d0d731d03348696046a9783524ad5959dcb31 | Fix exception in doorbird logbook during startup (#74649) | mezz64/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant,mezz64/home-assistant | homeassistant/components/doorbird/logbook.py | homeassistant/components/doorbird/logbook.py | """Describe logbook events."""
from __future__ import annotations
from typing import Any
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_ENTITY_ID,
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import callback
from .... | """Describe logbook events."""
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_ENTITY_ID,
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import callback
from .const import DOMAIN, DOOR_STATION, DOOR_STATION_EVENT_ENTIT... | apache-2.0 | Python |
e011e3b9b6a846f7e32fe978e5205554c64fc631 | Add baz() | moreati/coveralls-trial | coveralls_trial/coveralls_trial.py | coveralls_trial/coveralls_trial.py | # -*- coding: utf-8 -*-
def foo():
return True
def bar():
return False
def baz(x)
if x:
return x**2
elif x == 0:
return x + 17
else:
return x
| # -*- coding: utf-8 -*-
def foo():
return True
def bar():
return False
| bsd-3-clause | Python |
481142127970960cda4ae29f3a24713c2a46991e | Update __init__.py | rshipp/python-appassure | appassure/core/__init__.py | appassure/core/__init__.py | """This package contains the AppAssureAPI class and its subclasses,
which provide direct access to the AppAssure Core API's interfaces
and services, as described at http://docs.appassure.com/display/AA50D/.
"""
| """This package contains the AppAssureAPI class and its subclasses,
which provide direct access to the AppAssure Core API's interfaces
and services, as described at http://docs.appassure.com/display/AA50D/.
"""
| bsd-3-clause | Python |
60193bd891a819d519d181a6f31b263b01cf50a7 | revert to the correct imports | hackday-profilers/flocker-docker-plugin,hackday-profilers/flocker-docker-plugin,moypray/flocker-docker-plugin,wallnerryan/flocker-docker-plugin,mbrukman/flocker-docker-plugin,moypray/flocker-docker-plugin,mbrukman/flocker-docker-plugin,hackday-profilers/flocker-docker-plugin,mbrukman/flocker-docker-plugin,moypray/flock... | powerstripflocker.tac | powerstripflocker.tac | # Copyright ClusterHQ Inc. See LICENSE file for details.
from twisted.web import server, resource
from twisted.application import service, internet
from powerstripflocker.adapter import HandshakeResource, AdapterResource
def getAdapter():
root = resource.Resource()
v1 = resource.Resource()
root.putChild... | # Copyright ClusterHQ Inc. See LICENSE file for details.
from twisted.web import server, resource
from twisted.application import service, internet
from powerstripflocker.adapter import (HandshakeResource, CreateResource,
DestroyResource, MountResource, UnmountResource)
def getAdapter():
root = resource.Reso... | apache-2.0 | Python |
fd4c7640cbc9add7ca141e1df9e9aa02dc97c1b5 | Make password write only | LandRegistry/service-frontend-alpha,LandRegistry/service-frontend-alpha,LandRegistry/service-frontend-alpha,LandRegistry/service-frontend-alpha,LandRegistry/service-frontend-alpha | application/auth/models.py | application/auth/models.py | from werkzeug.security import generate_password_hash
from werkzeug.security import check_password_hash
from application import db
class User(db.Model):
__tablename__ = 'users'
email = db.Column(db.String(255), primary_key=True)
_password = db.Column(db.String(255))
authenticated = db.Column(db.Boole... | from werkzeug.security import generate_password_hash
from werkzeug.security import check_password_hash
from application import db
class User(db.Model):
__tablename__ = 'users'
email = db.Column(db.String(255), primary_key=True)
_password = db.Column(db.String(255))
authenticated = db.Column(db.Boole... | mit | Python |
e6e1429b9e1c8b654f688b5ac2dd0681717d39ab | change SSH to HTTPS URIs and remove private repo from test | bethgelab/foolbox,bethgelab/foolbox | foolbox/tests/test_model_zoo.py | foolbox/tests/test_model_zoo.py | from foolbox import zoo
import numpy as np
import foolbox
import sys
import pytest
from foolbox.zoo.model_loader import ModelLoader
@pytest.fixture(autouse=True)
def unload_foolbox_model_module():
# reload foolbox_model from scratch for every run
# to ensure atomic tests without side effects
module_names ... | from foolbox import zoo
import numpy as np
import foolbox
import sys
import pytest
from foolbox.zoo.model_loader import ModelLoader
@pytest.fixture(autouse=True)
def unload_foolbox_model_module():
# reload foolbox_model from scratch for every run
# to ensure atomic tests without side effects
module_names ... | mit | Python |
ebc3990091c4d2290a01033761e484d788381309 | add filtering of datasets | almey/policycompass-services,policycompass/policycompass-services,policycompass/policycompass-services,almey/policycompass-services,mmilaprat/policycompass-services,mmilaprat/policycompass-services,almey/policycompass-services,mmilaprat/policycompass-services,policycompass/policycompass-services | apps/datasetmanager/api.py | apps/datasetmanager/api.py | __author__ = 'fki'
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.request import Request
from rest_framework import status
from rest_framework import generics
from .models import *
from .serializers import *
from .file_encoder import FileEncoder
class Base(A... | __author__ = 'fki'
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.request import Request
from rest_framework import status
from rest_framework import generics
from .models import *
from .serializers import *
from .file_encoder import FileEncoder
class Base(A... | agpl-3.0 | Python |
60c29aab1b0bd0ae237e023fe4587326f21daa47 | Improve code of 'import_test' | reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/ActiveDr... | website/tests/test_import_results.py | website/tests/test_import_results.py | """"Tests in this module should be pass after data import and fail before"""
from database import bdb
from database import make_snv_key
from database import decode_csv
import app # this will take some time (stats initialization)
from models import Protein
def test_mappings():
"""This is a simple inclusion test f... | """"Tests in this module should be pass after data import and fail before"""
from database import bdb
from database import make_snv_key
from database import decode_csv
from models import Protein
def test_mappings():
"""This is a simple inclusion test for genome -> proteme mutation mappigns.
Knowing the data,... | lgpl-2.1 | Python |
82ac173a782637ba89bda7b20a7132d54947cd10 | add birthday to json | rohitdatta/pepper,rohitdatta/pepper,rohitdatta/pepper | pepper/api/views.py | pepper/api/views.py | from pepper.app import DB
from pepper.users import User
from flask import url_for, jsonify, request, Response
import json, os, urllib
from pepper import settings
from pepper.utils import calculate_age
def schedule():
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
json_url = os.path.join(SITE_ROOT, "../stati... | from pepper.app import DB
from pepper.users import User
from flask import url_for, jsonify, request, Response
import json, os, urllib
from pepper import settings
from pepper.utils import calculate_age
def schedule():
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
json_url = os.path.join(SITE_ROOT, "../stati... | agpl-3.0 | Python |
2fe0353d0ad7f2afc87cd85c7dd1e1174112807d | Update cmd2 fix to still work with 0.6.7 | openstack/cliff,dtroyer/cliff,dtroyer/cliff,openstack/cliff | cliff/tests/test_interactive.py | cliff/tests/test_interactive.py | # -*- encoding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | # -*- encoding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | apache-2.0 | Python |
7e4d32fdbdadb8a331d13f28da1a003b2fe8acf6 | Fix keepass importer csv errors | scorphus/passpie,marcwebbie/passpie,eiginn/passpie,eiginn/passpie,marcwebbie/passpie,scorphus/passpie | tests/test_importers/test_keepass_importer.py | tests/test_importers/test_keepass_importer.py | import pytest
from passpie.importers.keepass_importer import KeepassImporter
def test_keepass_importer_returns_false_when_csv_files_hasnt_expected_headers(mocker, mock_open):
headers = reversed(['Group', 'Title', 'Username', 'Password', 'URL', 'Notes'])
mocker.patch('passpie.importers.keepass_importer.unicod... | import pytest
from passpie.importers.keepass_importer import KeepassImporter
def test_keepass_importer_returns_false_when_csv_files_hasnt_expected_headers(mocker, mock_open):
headers = reversed(['Group', 'Title', 'Username', 'Password', 'URL', 'Notes'])
mocker.patch('passpie.importers.keepass_importer.csv.re... | mit | Python |
37a74b2b4b19282d892820983885003d42095130 | disable algolia indexing | dbinetti/barberscore-django,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,barberscore/barberscore-api,dbinetti/barberscore | project/api/config.py | project/api/config.py |
# Standard Library
import os
# Django
from django.apps import AppConfig
class ApiConfig(AppConfig):
"""Sets the configuration for the api app."""
name = 'api'
def ready(self):
import algoliasearch_django as algoliasearch
import api.signals
from .indexes import AwardIndex
... |
# Standard Library
import os
# Django
from django.apps import AppConfig
class ApiConfig(AppConfig):
"""Sets the configuration for the api app."""
name = 'api'
def ready(self):
import algoliasearch_django as algoliasearch
import api.signals
from .indexes import AwardIndex
... | bsd-2-clause | Python |
e5051e1d21a7dfecb5194d34ed0df8c3d56647e7 | change fallback canvas url to canvas.dev | penzance/ab-testing-tool,penzance/ab-testing-tool,penzance/ab-testing-tool,penzance/ab-testing-tool | ab_testing_tool/settings/local.py | ab_testing_tool/settings/local.py | from .base import *
from logging.config import dictConfig
ALLOWED_HOSTS = ['*']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# For local development, allow setting a token in ENV_SETTINGS
COURSE_OAUTH_TOKEN = SECURE_SETTINGS.get("course_oauth_token")
INSTALLED_APPS += ('debug_toolbar', 'sslserve... | from .base import *
from logging.config import dictConfig
ALLOWED_HOSTS = ['*']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# For local development, allow setting a token in ENV_SETTINGS
COURSE_OAUTH_TOKEN = SECURE_SETTINGS.get("course_oauth_token")
INSTALLED_APPS += ('debug_toolbar', 'sslserve... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.