code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from auto_nag.bzcleaner import BzCleaner
class DupeMe(BzCleaner):
def description(self):
return "Closed bu... | mozilla/relman-auto-nag | auto_nag/scripts/closed_dupeme.py | Python | bsd-3-clause | 883 |
import matplotlib
from matplotlib.testing.conftest import * # noqa
def pytest_configure(config):
for key, value in [
("markers", "flaky: (Provided by pytest-rerunfailures.)"),
("markers", "timeout: (Provided by pytest-timeout.)"),
("markers", "backend: Set alternate Matplotlib backend tem... | dfm/daft | test/conftest.py | Python | mit | 716 |
"""Support for Niko Home Control."""
from __future__ import annotations
from datetime import timedelta
import logging
import nikohomecontrol
import voluptuous as vol
# Import the device class from the component that you want to support
from homeassistant.components.light import ATTR_BRIGHTNESS, PLATFORM_SCHEMA, Ligh... | rohitranjan1991/home-assistant | homeassistant/components/niko_home_control/light.py | Python | mit | 4,127 |
# Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | ekcs/congress | contrib/tempest/tempest/scenario/congress_datasources/test_glancev2.py | Python | apache-2.0 | 5,461 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | lnielsen/invenio | invenio/ext/fixtures/registry.py | Python | gpl-2.0 | 1,433 |
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
)
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/signin/'
LOGIN_ERROR_URL = '/signin/failed/'
AUTH_USER_MODEL = 'users.User'
| pinkevich/django-project-template | settings/auth.py | Python | mit | 276 |
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.
"""The TaskView allows you to modify what the loader is doing."""
from __future__ import (absolute_import, division, print_function)
from ranger.ext.accumulator import Accumulator
from . import... | ranger/ranger | ranger/gui/widgets/taskview.py | Python | gpl-3.0 | 2,876 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from cpt.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
builder.add_common_builds(shared_option_name="libsolace:shared", pure_c=False)
builder.run()
| abbyssoul/libsolace | build-conan-package.py | Python | apache-2.0 | 256 |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function, division, unicode_literals, absolute_import
import os
import sys
import pytest
from nipype import config
from mock import MagicMock
from builti... | mick-d/nipype | nipype/utils/tests/test_config.py | Python | bsd-3-clause | 7,682 |
read = input
n,k = map(int, read().split())
a = read()
a = '1' + a + '1'
# -1 if use 0, -1 if use len(a) -1
pstart = 0
pcnt = 0
ptype = '1'
b = []
# (start, end, cnt)
for tp in enumerate(a):
i, c = tp
if ptype == c:
pcnt = pcnt + 1
else :
b.append((pstart, i-1, pcnt))
pstart = i
... | xsthunder/acm | at/abc124/d.py | Python | mit | 951 |
from crum import get_current_user
from django.db.models import Exists, OuterRef
from django.conf import settings
from dojo.models import Dojo_Group, Dojo_Group_Member, Product_Group, Product_Type_Group
from dojo.authorization.authorization import get_roles_for_permission, role_has_permission, get_groups
from dojo.autho... | rackerlabs/django-DefectDojo | dojo/group/queries.py | Python | bsd-3-clause | 2,802 |
from django.views.generic import RedirectView
class IndexView(RedirectView):
url = 'derpeddit.github.com'
| superduper/derpeddit | core/views.py | Python | mit | 112 |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def h2o_H2OFrame_all():
"""
Python API test: h2o.frame.H2OFrame.all(), h2o.frame.H2OFrame.any()
"""
python_lists=[[True, False], [False, True], [True, True], [True, 'NA']]
h2ofr... | michalkurka/h2o-3 | h2o-py/tests/testdir_jira/pyunit_pubdev_4987_any_all.py | Python | apache-2.0 | 1,556 |
import pilas
def test_todos_los_objetos_de_interfaz_se_pueden_crear():
pilas.iniciar()
deslizador = pilas.interfaz.Deslizador()
assert deslizador
assert deslizador.progreso == 0
boton = pilas.interfaz.Boton()
assert boton
ingreso = pilas.interfaz.IngresoDeTexto()
assert ingreso
... | irvingprog/pilas | pilas/test/test_interface.py | Python | lgpl-3.0 | 736 |
"""
Django settings for eoncloud_web project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build... | zhanghui9700/eonboard | eoncloud_web/eoncloud_web/settings.py | Python | apache-2.0 | 5,632 |
def hello():
print("hogehoge") | kenny-nelson/GomiBako | Libraries/Python/kiso/__init__.py | Python | mit | 31 |
#Convenience and complex routines that touch multiple MIB modules
from initialization import get_controller
from reflash import reflash_module, reflash_controller | amcgee/pymomo | pymomo/commander/meta/__init__.py | Python | lgpl-3.0 | 163 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you ... | cloudbau/glance | glance/db/__init__.py | Python | apache-2.0 | 12,246 |
#!/urs/bin/env python
#
# Copyright (C) 2015--2016, the ximpol team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU GengReral Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.... | lucabaldini/ximpol | ximpol/test/test_sensitivity_calculator.py | Python | gpl-3.0 | 5,090 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | lulf/qpid-dispatch | tests/router_policy_test.py | Python | apache-2.0 | 13,755 |
import bh_plugin
import sublime
class SwapQuotes(bh_plugin.BracketPluginCommand):
def escaped(self, idx):
"""
Check if character is an escape char
"""
view = self.view
escaped = False
while idx >= 0 and view.substr(idx) == '\\':
escaped = ~... | herove/dotfiles | sublime/Packages/BracketHighlighter/bh_modules/swapquotes.py | Python | mit | 1,753 |
__author__ = 'jpi'
import hashlib
from rest_framework.fields import Field, BooleanField
from django.conf import settings
class UniqueIDField(Field):
"""
Field that provides a unique ID that can be used to identify this object.
"""
read_only = True
def field_to_native(self, obj, field_name):
... | codeforeurope/stadtgedaechtnis_backend | services/serializer/fields.py | Python | mit | 830 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-23 10:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_squashed_0007_auto_20160701_0926'),
]
operations = [
migrations... | VoIPGRID/vialer-middleware | app/migrations/0002_auto_20171123_1039.py | Python | mit | 665 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# $Id: __init__.py 1525 2012-08-16 16:32:03Z g.rodola $
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""psutil is a module providing conven... | ktan2020/legacy-automation | win/Lib/site-packages/psutil/__init__.py | Python | mit | 43,170 |
#alexnet with lasagne
import lasagne
import os
import numpy as np
import yaml
import theano.tensor as T
import theano
class alexNet():
def __init__(self, config, inputVar):
#This class is designed only for the conv layers of alexnet (ie to extract alexnt features)
#the 4d blob is: batch, channels, ... | myt00seven/svrg | cifar/my_alexNet.py | Python | mit | 5,335 |
import requests
import json
import csv
def getcode(fname):
f_oe = open(fname,'r')
mylist = []
num_line = 0
for line in f_oe:
code=line.split('\t')[0]
if num_line>0:
mylist.append(code)
num_line = num_line +1
return mylist
def main():
... | DistrictDataLabs/02-labormatch | labormatch/BLS_ingest2.py | Python | apache-2.0 | 2,774 |
#!/usr/bin/env python
# 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
... | javasoze/sensei | clients/python/sensei/sensei_components.py | Python | apache-2.0 | 36,120 |
#
# Copyright 2008 Spencer Davis <SpencerDavis91@gmail.com>
#
# This file is part of Tuxedo.
#
# Tuxedo is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) an... | Alwnikrotikz/tuxedo | src/task.py | Python | gpl-2.0 | 1,327 |
from conans.client.build.compiler_flags import format_frameworks
from conans.model import Generator
from conans.paths import BUILD_INFO_XCODE
class XCodeGenerator(Generator):
template = '''
HEADER_SEARCH_PATHS = $(inherited) {include_dirs}
LIBRARY_SEARCH_PATHS = $(inherited) {lib_dirs}
OTHER_LDFLAGS = $(inherite... | conan-io/conan | conans/client/generators/xcode.py | Python | mit | 1,935 |
# coding: utf-8
"""Configuration générale de musite.
Vous pouvez modifier ici le titre du site, l'adresse et le port d'écoute, les
emplacements des dossiers.
Vous pouvez aussi définir si vous êtes ou non en mode développement.
"""
import os
from pathlib import Path
TITRE = 'Musite'
HOTE = '0.0.0.0'
PORT = 8080
PWD... | jperon/musite | etc.sample/config.py | Python | mit | 848 |
#Class to Generate Requests for Peers
import math
import Queue
class Requester(object):
'Handles, Generates all the Requests for the Client'
def __init__(self, torrent, metainfo):
'Initializes all variables required'
self.request_queue = Queue.Queue()
self.current_piece_index = to... | ssksameer56/Torrent-O | RequestManager.py | Python | gpl-3.0 | 1,682 |
"""
===========================================
FeatureHasher and DictVectorizer Comparison
===========================================
Compares FeatureHasher and DictVectorizer by using both to vectorize
text documents.
The example demonstrates syntax and speed only; it doesn't actually do
anything useful with the e... | RPGOne/Skynet | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/text/hashing_vs_dict_vectorizer.py | Python | bsd-3-clause | 3,265 |
# 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
# d... | alexpilotti/python-keystoneclient | keystoneclient/v3/role_assignments.py | Python | apache-2.0 | 4,121 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2016 CERN.
#
# Zenodo is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later v... | jainaman224/zenodo | tests/unit/deposit/test_api_buckets.py | Python | gpl-2.0 | 9,093 |
"""
MAX31855_test.py
Alexander Hiam - 12/2012
Updated Oct. 2015
Example program for PyBBIO's MAX31855 library.
Reads the temperature from a MAX31855 thermocouple amplifier connected
over SPI.
This example program is in the public domain.
"""
from bbio import *
from bbio.libraries.MAX31855 import MAX31855
... | graycatlabs/PyBBIO | examples/MAX31855_test.py | Python | mit | 1,015 |
from share.provider import ProviderAppConfig
from .harvester import SocarxivHarvester
# from providers.io.osf.preprints.normalizer import PreprintNormalizer
class AppConfig(ProviderAppConfig):
name = 'providers.org.socarxiv'
version = '0.0.1'
title = 'osf_preprints_socarxiv'
long_title = 'SocArXiv'
... | zamattiac/SHARE | providers/org/socarxiv/apps.py | Python | apache-2.0 | 553 |
# coding: utf-8
"""
Tests for mogli.Molecule.calculate_bonds()
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import mogli
import pytest
def test_calculate_bonds_with_default_method():
"""
Calculate bon... | sciapp/mogli | tests/test_bonds.py | Python | mit | 4,010 |
#!/usr/bin/env python
# -*- coding: utf-8
# ----------------------------------------------------------------------
# Flask web service for Golfred
# ----------------------------------------------------------------------
# Ivan Vladimir Meza-Ruiz/ ivanvladimir at turing.iimas.unam.mx
# 2015/IIMAS/UNAM
# ----------------... | rcln/Golfred | golem/server/golfred/__init__.py | Python | gpl-2.0 | 881 |
import unittest
import pycap.protocol, pycap.constants
class ARPTest(unittest.TestCase):
def testCreate(self):
shw = '00:03:93:44:a9:92'
sp = '192.168.0.2'
thw = '00:50:ba:8f:c4:5f'
tp = '192.168.0.1'
arp = pycap.protocol.arp(shw, thw, sp, tp, pycap.constants.arp.AR... | Aliced3645/DataCenterMarketing | pycap-0.1.6/test/test_arp.py | Python | apache-2.0 | 655 |
#!/usr/bin/python
#coding: utf-8
#Author: asher
#Date: 2017/10/20
#Purpose: get dell server info from api.dell.com
import ConfigParser
import time
import datetime
import requests
import fileinput
import sys
import os
import re
import Queue
from multiprocessing import Pool
import threading
import codecs
reload(sys)
#... | lichengshuang/createvhost | python/asher/getcmdbinfo/bin/getWarranty.py | Python | apache-2.0 | 7,752 |
try:
import ujson as json
except:
import json
def main(j, args, params, tags, tasklet):
#macro puts obj info as params on doc, when show used as label, shows the content of the obj in nicely structured code block
nid = args.getTag('id')
gid = args.getTag('gid')
if not nid or not gid:
p... | Jumpscale/jumpscale6_core | apps/gridportal/base/Grid/.macros/wiki/node_getdata/1_node.py | Python | bsd-2-clause | 1,344 |
from sa_tools.base.magic import MagicMixin
from sa_tools.inbox import Inbox
from sa_tools.session import SASession
from sa_tools.index import Index
import os
import pickle
import sys
def py_ver() -> str:
return str(sys.version_info.major)
class APSession(object):
def __init__(self, username: str, passwd: s... | thismachinechills/awful.py | awful.py | Python | gpl-3.0 | 1,950 |
from Screens.Screen import Screen
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Screens.Console import Console
from Components.FileList import FileList
from Components.ActionMap import ActionMap
from Components.Label import Label... | kingvuplus/nn-gui | lib/python/Nemesis/nemesisUtility.py | Python | gpl-2.0 | 26,671 |
#!/usr/bin/env python3
"""
Copyright (C) 2016 Markus Doering
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is ... | burgerdev/sbf-tools | crawler/crawl.py | Python | gpl-3.0 | 6,728 |
import datetime
from django.conf import settings
from django.core.cache import cache
from django.utils.translation import ugettext_lazy as _
from rest_framework import exceptions
from rest_framework.authentication import TokenAuthentication
EXPIRE_DAYS = getattr(settings, 'REST_FRAMEWORK_TOKEN_EXPIRE_DAYS', 1)
class ... | ZhangDubhe/Tropical-Cyclone-Information-System | TyphoonApi/TyphoonApi/authentication.py | Python | mit | 1,284 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright © 2016-2018 Cyril Desjouy <ipselium@free.fr>
#
# This file is part of cpyvke
#
# cpyvke is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... | ipselium/cpyvke | cpyvke/cpyvke.py | Python | gpl-3.0 | 5,093 |
from nose.tools import * # noqa
from modularodm import Q
from website.prereg import prereg_landing_page as landing_page
from website.prereg.utils import drafts_for_user, get_prereg_schema
from website.project.model import ensure_schemas, MetaSchema
from tests.base import OsfTestCase
from tests import factories
cl... | wearpants/osf.io | tests/test_prereg.py | Python | apache-2.0 | 3,366 |
"""__init__.py."""
| ciarams87/PyU4V | PyU4V/tools/__init__.py | Python | mit | 20 |
# -*- config:utf-8 -*-
"""
Copyright 2015 Airbridge
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applic... | lucasb/airbridge | api/security/controllers.py | Python | apache-2.0 | 893 |
import frappe
def execute():
frappe.reload_doc('website', 'doctype', 'web_page_view', force=True)
frappe.db.sql("""UPDATE `tabWeb Page View` set path='/' where path=''""")
| frappe/frappe | frappe/patches/v13_0/set_path_for_homepage_in_web_page_view.py | Python | mit | 175 |
from segmentation import SimilarityIndex, BRAINSTalairach, BRAINSTalairachMask
from utilities import HistogramMatchingFilter
from classify import BRAINSPosteriorToContinuousClass
| grlee77/nipype | nipype/interfaces/semtools/brains/__init__.py | Python | bsd-3-clause | 179 |
from twilio.rest import TwilioRestClient
# Twilio phone number goes here. Grab one at https://twilio.com/try-twilio
# and use the E.164 format, for example: "+12025551234"
TWILIO_PHONE_NUMBER = ""
# list of one or more phone numbers to dial, in "+19732644210" format
DIAL_NUMBERS = ["",]
# URL location of TwiML inst... | mattmakai/python-twilio-example-apps | no-framework/phone-calls/phone_calls.py | Python | mit | 1,159 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
GridDataMetrics.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********... | dgoedkoop/QGIS | python/plugins/processing/algs/gdal/GridDataMetrics.py | Python | gpl-2.0 | 9,473 |
"""Store :func:`.message`."""
from typing import Optional, Union
from praw import const
from praw.models import Message, Redditor, Subreddit
def message(
self,
to: Union[Redditor, Subreddit, str],
title: str,
body: str,
from_sr: Optional[Union[Subreddit, str]] = None,
) -> Message:
"""Abstract... | praw-dev/prawdditions | prawdditions/patch/message.py | Python | bsd-2-clause | 1,472 |
# Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | alexpilotti/python-glanceclient | tests/v1/test_shell.py | Python | apache-2.0 | 16,564 |
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.template.loader import render_to_string
from django.template import Tem... | gregplaysguitar/glamkit | glamkit/incubated/favourites/views.py | Python | bsd-3-clause | 7,793 |
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import models
def post_init_hook(cr, registry):
from odoo import api, SUPERUSER_ID
env = api.Environment(cr, SUPERUSER_ID, {})
# emulate updating existing field to website-dependent one
env.cr.execute("ALTER TABLE test_webs... | yelizariev/addons-yelizariev | web_website/__init__.py | Python | lgpl-3.0 | 443 |
import matplotlib
matplotlib.use('agg')
import pygrib
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap, shiftgrid,cm
import numpy as np
from pylab import rcParams
import pylab as pyl
from matplotlib.colors import LinearSegmentedColormap
from objects import coltbls
from objects.gribMap import Gr... | cacraig/wxDataGetters | wxdatagetters/generators/grib2Plot.py | Python | mit | 50,115 |
#!/usr/bin/env python2
# ./builder.py -I/usr/local/include/siconos
# mechanics
# ./builder.py -I/usr/local/include/siconos --target=mechanics
# control
# ./builder.py -I/usr/local/include/siconos --target=control
# we use pygccxml from Roman Yakovenko.
# http://sourceforge.net/projects/pygccxml/
import sys
import ... | siconos/siconos-deb | io/tools/builder_refactored.py | Python | apache-2.0 | 5,529 |
from django.conf import settings
import os
SITES_DIR = os.path.join(os.path.dirname(__file__), 'sites')
DEFAULT_HOST = 'www.corp-umbrella-site.com'
HOSTNAME_REDIRECTS = {
'aboutfood.com': 'www.about-food.com',
'about-food.net': 'www.about-food.com',
'meats.about-food.com': '... | ajrbyers/django-dynamicsites | dynamicsites/test/settings.py | Python | gpl-3.0 | 2,994 |
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage
class ForceAuthS3BotoStorage(S3BotoStorage):
def __init__(self, *args, **kwargs):
kwargs['querystring_auth'] = True
super(ForceAuthS3BotoStorage, self).__init__(*args, **kwargs)
class Cach... | LilithWittmann/froide | froide/helper/storage_utils.py | Python | mit | 812 |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import pytest
from . import config
from .. import test_sim_verilator_opentitan as ot
@pytest.fixture(params=config.TEST_APPS_SELFCHECKING,
ids=lambda par... | lowRISC/opentitan | test/systemtest/englishbreakfast/test_sim_verilator.py | Python | apache-2.0 | 2,189 |
#!/usr/bin/env python
# Requirements
# - pyvmomi >= 6.0.0.2016.4
# TODO:
# * more jq examples
# * optional folder heriarchy
"""
$ jq '._meta.hostvars[].config' data.json | head
{
"alternateguestname": "",
"instanceuuid": "5035a5cd-b8e8-d717-e133-2d383eb0d675",
"memoryhotaddenabled": false,
"guestfullna... | kaarolch/ansible | contrib/inventory/vmware_inventory.py | Python | gpl-3.0 | 23,625 |
"""myproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | greven/vagrant-django | project_name/urls.py | Python | bsd-3-clause | 993 |
from util import fibonacci
def solve():
result = 0
for i in fibonacci(1, 2):
if i > 4000000:
return result
elif i % 2 == 0:
result += i
if __name__ == '__main__':
print solve()
| elemel/project-euler | src/2.py | Python | mit | 243 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name' : 'Account Tax Cash Basis',
'version' : '1.1',
'author' : 'OpenERP SA',
'summary': 'Allow to have cash basis on tax',
'sequence': 4,
'description': """
Add an option on tax to allow th... | minhphung171093/GreenERP_V9 | openerp/addons/account_tax_cash_basis/__openerp__.py | Python | gpl-3.0 | 740 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
tab_to_fastq
Description: Convert a tab file to a fastq file
tab_to_fastq.py -i input.tab -o output.fq
-----------------------------------------------------------------------
Author: This software is written and maintained by Pierre Pericard
(pierre.pericard@ed.... | bonsai-team/matam | scripts/tab_to_fastq.py | Python | agpl-3.0 | 1,806 |
from CellCycle.ChainModule.ListThread import *
from start import loadSettings
from start import loadLogger
from CellCycle.MemoryModule.calculateSon import calculateSonId
def add_check():
currentProfile = {"profile_name": "alessandro_fazio", "key_pair": "AWSCellCycle", "branch": "ListUtilities"}
settings_to_l... | AQuadroTeam/CellsCycle | doc/tests/list-communication/KeyTest.py | Python | mit | 6,180 |
import numpy as np
import restrictedBoltzmannMachine as rbm
from batchtrainer import *
from activationfunctions import *
from common import *
from debug import *
from trainingoptions import *
import theano
from theano import tensor as T
from theano.tensor.shared_randomstreams import RandomStreams
theanoFloat = thea... | Warvito/pydeeplearn | code/lib/deepbelief.py | Python | bsd-3-clause | 38,804 |
import datetime
from django.conf import settings
from django.core.management.base import BaseCommand
from django.template.loader import render_to_string
from ...models import CorporateMember
from home.tasks import mail_task
class Command(BaseCommand):
def handle(self, *args, **options):
thirty_days_fro... | cts-admin/cts | cts/members/management/commands/send_renewal_emails.py | Python | gpl-3.0 | 1,296 |
#coding=utf-8
import sys,platform
sys.path.append("../")
if 'twisted.internet.reactor' not in sys.modules:
if platform.system() == "Linux":
from twisted.internet import epollreactor
epollreactor.install()
else:
from twisted.internet import iocpreactor
iocpreactor.install()
impo... | xiexiangwei/xGame | servermanager/main.py | Python | apache-2.0 | 1,801 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
CNB Matrix Module - Approuve
'''
import random
from cnb.cnbMatrixModule import CNBMatrixModule
class CNBMMApprouve(CNBMatrixModule):
"""
"""
name = 'approuve'
usage = ''
desc = 'Approuve an affirmation when the bot detect 4x "k" messages'
enProc... | hackfestca/cnb | cnb/modAvailable/CNBMMApprouve.py | Python | gpl-3.0 | 1,571 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache... | fajoy/nova | nova/tests/test_migrations.py | Python | apache-2.0 | 16,891 |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import subprocess,sys,re
from numpy import array
def find_and_replace(pattern, dest_str, repl_str):
re_comp = re.compile(r'%s(?=\W|$)'%(pattern)) # not followed by alphanumeric [a-zA-Z0-9_] or (|) is at end of string ($)
return re_comp.sub(repl_str, dest_str) # w... | thomasspiesser/MYpop | model_builder.py | Python | mit | 17,412 |
import os
import re
from smtplib import SMTPException
from django import forms
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.contrib.auth import forms as auth_forms
from django.contrib.auth.tokens import default_token_generator
from django.forms.util impo... | Prashant-Surya/addons-server | src/olympia/users/forms.py | Python | bsd-3-clause | 24,188 |
# Copyright (C) 2012,2013,2016
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms... | govarguz/espressopp | src/tools/lattice.py | Python | gpl-3.0 | 3,791 |
from __future__ import unicode_literals
try:
from unittest import mock
except ImportError:
import mock
import threading
from channels import Channel, route, DEFAULT_CHANNEL_LAYER
from channels.asgi import channel_layers
from channels.tests import ChannelTestCase
from channels.worker import Worker, WorkerGroup... | linuxlewis/channels | channels/tests/test_worker.py | Python | bsd-3-clause | 4,367 |
import boto.ec2
from upscale import config
config=config.config
access=config['ec2']['access-key']
key= config['ec2']['secret-key']
region = config['ec2']['region']
vpcid = config['ec2']['vpc-id']
ec2_conn = boto.ec2.connect_to_region(region, aws_access_key_id=key, aws_secret_access_key=access)
import pprint
from c... | nl5887/upscale | upscale/api/hosts.py | Python | apache-2.0 | 730 |
# flake8: noqa: F403, F405
from tests.core import mock
from trakt import Trakt
from datetime import datetime
from dateutil.tz import tzutc
from hamcrest import *
from httmock import HTTMock
def test_movies():
with HTTMock(mock.fixtures, mock.unknown):
with Trakt.configuration.auth('mock', 'mock'):
... | fuzeman/trakt.py | tests/users/lists/test_get.py | Python | mit | 1,290 |
import os
from spinspy import local_data
def isdim(dim):
if os.path.isfile('{0:s}{1:s}grid'.format(local_data.path,dim)):
return True
else:
return False
| bastorer/SPINSpy | spinspy/isdim.py | Python | mit | 178 |
from distutils.core import setup
setup(
name = 'markdown-attr-plus',
version = '0.3.0',
description = 'Markdown Extension to extend attr_list extension to add extra syntax.',
author = 'Claire Charron',
author_email = 'claire@undeterminant.net',
packages = ['markdown_attr_plus'],
url = 'https://github.com/Undete... | Undeterminant/markdown-attr-plus | setup.py | Python | cc0-1.0 | 368 |
print("hello world".index("ll"))
print("hello world".index("ll", None))
print("hello world".index("ll", 1))
print("hello world".index("ll", 1, None))
print("hello world".index("ll", None, None))
print("hello world".index("ll", 1, -1))
try:
print("hello world".index("ll", 1, 1))
except ValueError:
print("Raised... | pfalcon/micropython | tests/basics/string_index.py | Python | mit | 1,712 |
"""Test OpenZWave Websocket API."""
from unittest.mock import patch
from openzwavemqtt.const import (
ATTR_CODE_SLOT,
ATTR_LABEL,
ATTR_OPTIONS,
ATTR_POSITION,
ATTR_VALUE,
ValueType,
)
from homeassistant.components.ozw.const import ATTR_CONFIG_PARAMETER
from homeassistant.components.ozw.lock im... | mezz64/home-assistant | tests/components/ozw/test_websocket_api.py | Python | apache-2.0 | 11,571 |
#!/usr/bin/env python3
# Copyright 2020 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | ros-infrastructure/ros_buildfarm | scripts/release/rpm/upload_package.py | Python | apache-2.0 | 2,542 |
"""mrr log merger tool
usage: $ python3 logmerger.py ${filename}
author: Hwan hee, Lee
email: hwanhee.lee@navercorp.com
"""
import sys
try:
filename = sys.argv[1]
f = open(filename, 'r')
result = {}
gaplist = list(range(0, 820, 20))
for gap in gaplist:
result[gap] = 0
lines ... | naver/arcus-misc | mrr/logmerger.py | Python | apache-2.0 | 855 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Byteman(MavenPackage):
"""Byteman is a tool which makes it easy to trace, monitor and test... | LLNL/spack | var/spack/repos/builtin/packages/byteman/package.py | Python | lgpl-2.1 | 1,096 |
"""
AWGs
"""
from atom.api import Atom, List, Int, Float, Range, Enum, Bool, Constant, Str
from Instrument import Instrument
import enaml
from enaml.qt.qt_application import QtApplication
from instruments.AWGBase import AWGChannel, AWG, AWGDriver
from plugins import find_plugins
AWGList = []
# local plugin regi... | rmcgurrin/PyQLab | instruments/AWGs.py | Python | apache-2.0 | 872 |
from ..cmd import Cli
class VcsUpgrader(Cli):
"""
Base class for updating packages that are a version control repository on local disk
:param vcs_binary_paths:
The full filesystem path to the executable for the version control
system. May be set to None to allow the code to try and find ... | herove/dotfiles | sublime/Packages/Package Control/package_control/upgraders/vcs_upgrader.py | Python | mit | 929 |
#!/usr/bin/env python
# -*- coding: ascii -*- pylint: skip-file
r"""
:Copyright:
Copyright 2006 - 2016
Andr\xe9 Malo or his licensors, as applicable
:License:
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 o... | ndparker/wolfe | make.py | Python | apache-2.0 | 24,565 |
#!/usr/bin/env python3
'''
kicad-footprint-generator is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
kicad-footprint-generator is distribut... | SchrodingersGat/kicad-footprint-generator | scripts/Connector/Connector_Molex/conn_molex_micro-fit-3.0_tht_side_single_row.py | Python | gpl-3.0 | 12,160 |
#!/usr/bin/env python3
from distutils.core import setup
setup(
name='conflib',
version='1.0.0',
description='Manage configuration hierarchies',
author='Les Aker',
author_email='me@lesaker.org',
url='https://github.com/akerl/conflib',
license='MIT License',
packages=['conflib'],
cla... | akerl/conflib | setup.py | Python | mit | 750 |
# Copyright 2017 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleapis/python-storage | samples/snippets/iam_test.py | Python | apache-2.0 | 5,106 |
import sys
import socket
import signal
import weakref
import errno
import logging
import pyuv
logging.basicConfig(level=logging.DEBUG)
STOPSIGNALS = (signal.SIGINT, signal.SIGTERM)
NONBLOCKING = (errno.EAGAIN, errno.EWOULDBLOCK)
if sys.platform == "win32":
NONBLOCKING = NONBLOCKING + (errno.WSAEWOULDBLOCK,)
cl... | saghul/pyuv | examples/echo-server-poll.py | Python | mit | 4,446 |
# Copyright (C) 2015 Custodia Project Contributors - see LICENSE file
from custodia.httpd.consumer import HTTPConsumer
from custodia.httpd.server import HTTPError
from custodia.httpd.authorizers import HTTPAuthorizer
from custodia.message.formats import Validator
from custodia.message.common import UnknownMessageType... | cgwalters/custodia | custodia/secrets.py | Python | gpl-3.0 | 19,749 |
#! /usr/bin/env python
# ==========================================================================
#
# Copyright NumFOCUS
#
# 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
#
# ... | richardbeare/SimpleITK | Testing/Unit/Python/sitkExternalViewerTest.py | Python | apache-2.0 | 3,560 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Implements rotations, including spherical rotations as defined in WCS Paper II
[1]_
`RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in
WCS Paper II to rotate to/from a native sphere and the celestial sphere.
The implement... | stargaser/astropy | astropy/modeling/rotations.py | Python | bsd-3-clause | 16,503 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... | dayatz/taiga-back | tests/integration/resources_permissions/test_auth_resources.py | Python | agpl-3.0 | 2,107 |
#!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['pre... | roadmapper/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_vpn.py | Python | gpl-3.0 | 30,979 |
from __future__ import absolute_import, print_function
import six
from rest_framework import serializers
from sentry.models import User
from sentry.utils.auth import find_users
class UserField(serializers.Field):
def to_representation(self, value):
return value.username
def to_internal_value(self,... | mvaled/sentry | src/sentry/api/fields/user.py | Python | bsd-3-clause | 714 |
try:
import keyring
except ImportError:
raise NotImplemented()
from plyer.facades import Keystore
class LinuxKeystore(Keystore):
def _set_key(self, servicename, key, value, **kwargs):
keyring.set_password(servicename, key, value)
def _get_key(self, servicename, key, **kwargs):
... | KeyWeeUsr/plyer | plyer/platforms/linux/keystore.py | Python | mit | 423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.