code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
../../../../share/pyshared/zeitgeist/datamodel.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/zeitgeist/datamodel.py | Python | gpl-3.0 | 49 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Shuang Wang <ooocamel@icloud.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_versi... | kvar/ansible | lib/ansible/modules/cloud/amazon/aws_codecommit.py | Python | gpl-3.0 | 6,565 |
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import sys
#NOTE: if you want to develop askbot
#you might want to install django-debug-toolbar as well
import askbot
setup(
name = "askbot",
version = askbot.get_version(),#remember to manually set this correctly
descr... | maxwward/SCOPEBak | setup.py | Python | gpl-3.0 | 5,541 |
""" Unit tests for nonlinear solvers
Author: Ondrej Certik
May 2007
"""
from numpy.testing import assert_, dec, TestCase, run_module_suite
from scipy.optimize import nonlin
from numpy import matrix, diag, dot
from numpy.linalg import inv
import numpy as np
SOLVERS = [nonlin.anderson, nonlin.diagbroyden, nonlin.linea... | ygenc/onlineLDA | onlineldavb_new/build/scipy/scipy/optimize/tests/test_nonlin.py | Python | gpl-3.0 | 11,990 |
"""News source to send a notification whenever a twitch streamer goes live."""
import datetime
import logging
import discord
from dateutil import parser
from .AbstractSources import DataBasedSource
DOZER_LOGGER = logging.getLogger('dozer')
class TwitchSource(DataBasedSource):
"""News source to send a notificat... | guineawheek/Dozer | dozer/sources/TwitchSource.py | Python | gpl-3.0 | 7,912 |
#!/usr/bin/python
'''
Created on Sep 18, 2009
@author: sgallagh
'''
import unittest
import os
from stat import *
import sys
srcdir = os.getenv('srcdir')
if srcdir:
sys.path.insert(0, "./src/config")
srcdir = srcdir + "/src/config"
else:
srcdir = "."
import SSSDConfig
class SSSDConfigTestValid(unittest.... | yelley/sssd-gpo | src/config/SSSDConfigTest.py | Python | gpl-3.0 | 71,528 |
import sys
from PyQt4 import QtCore, QtGui, uic
import light
qtCreatorFile = "pythonlight.ui" # Enter file here.
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
class LightApp(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
Ui_MainWindow.__init__... | chrfrantz/op-papers | oosd/week07/light/pythonlight.py | Python | gpl-3.0 | 737 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para flashx
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
from core import logger
from core import jsunpac... | kampanita/pelisalacarta | python/main-classic/servers/flashx.py | Python | gpl-3.0 | 2,876 |
"""
Classes and functions to manage arkOS tracked services.
arkOS Core
(c) 2016 CitizenWeb
Written by Jacob Cook
Licensed under GPLv3, see LICENSE.md
"""
import glob
import miniupnpc
import random
from arkos import config, logger, policies, signals, storage, security
from arkos.messages import Notification
from arko... | pomarec/core | arkos/tracked_services.py | Python | gpl-3.0 | 14,893 |
import sys
from collections import namedtuple
from AnyQt.QtWidgets import QSizePolicy, QLayout
from AnyQt.QtCore import Slot
import Orange.data
from Orange.widgets.utils.datacaching import data_hints
from Orange.widgets import widget, gui, settings
from Orange.widgets.utils import itemmodels
from Orange.widgets.uti... | ales-erjavec/orange-bio | orangecontrib/bio/widgets3/OWGeneNetwork.py | Python | gpl-3.0 | 16,602 |
# -*- coding: utf-8 -*-
from django import forms
class DocumentForm(forms.Form):
xmlfile = forms.FileField(label='Select the input xml file (scenario.xml)')
outputfile = forms.FileField(label='Select the survery output file (output.txt) if available', required=False)
ctsoutputfile = forms.FileField(label='... | tph-thuering/vnetsource | ts_om_viz/forms.py | Python | mpl-2.0 | 571 |
from urllib.parse import urlparse
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialaccount.providers.oauth2.views import (
OAuth2CallbackView,
OAuth2LoginView,
)
from kuma.core.decorators import redirect_in_maintenance_mode
from kuma.core.ga_tracking import ACTIO... | Elchi3/kuma | kuma/users/providers/google/views.py | Python | mpl-2.0 | 1,558 |
# GUI frame for the dftModel_function.py
from Tkinter import *
import tkFileDialog, tkMessageBox
import sys, os
import pygame
from scipy.io.wavfile import read
import dftModel_function
class DftModel_frame:
def __init__(self, parent):
self.parent = parent
self.initUI()
pygame.init()
def ini... | georgid/sms-tools | software/models_interface/dftModel_GUI_frame.py | Python | agpl-3.0 | 4,273 |
# Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from anki.syncserver import serve
serve()
| simgunz/anki | pylib/anki/syncserver/__main__.py | Python | agpl-3.0 | 171 |
import time
import json
import random
from flask import Flask, request, current_app, abort
from functools import wraps
from cloudbrain.utils.metadata_info import (map_metric_name_to_num_channels,
get_supported_devices,
get_metrics_... | andyh616/cloudbrain | cloudbrain/apiservice/rest_api_server.py | Python | agpl-3.0 | 6,641 |
import os
from multiprocessing import cpu_count
_cpu_count = cpu_count()
if hasattr(os, 'getloadavg'):
def load_fair():
return 'load', os.getloadavg()[0] / _cpu_count
else:
from winperfmon import PerformanceCounter
from threading import Thread
from collections import deque
from time impor... | buhe/judge | sysinfo.py | Python | agpl-3.0 | 1,249 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | ingadhoc/openerp-travel | travel_accommodation/wizard/__init__.py | Python | agpl-3.0 | 1,121 |
# -*- coding: UTF-8 -*-
logger.info("Loading 5 objects to table gfks_helptext...")
# fields: id, content_type, field, help_text
loader.save(create_gfks_helptext(1,contacts_Partner,u'language',u'Die Sprache, in der Dokumente ausgestellt werden sollen.'))
loader.save(create_gfks_helptext(2,gfks_HelpText,u'field',u'The na... | lino-framework/welfare | lino_welfare/projects/gerd/tests/dumps/18.8.0/gfks_helptext.py | Python | agpl-3.0 | 794 |
# coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility an... | ballouche/navitia | source/jormungandr/jormungandr/interfaces/v1/Ptobjects.py | Python | agpl-3.0 | 5,265 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | education_group/ddd/service/write/copy_training_service.py | Python | agpl-3.0 | 2,322 |
from .devstack import *
from .edraak_common import *
# WARNING: Don't just add/delete settings from here. Make sure the settings are
# reflected in `cms/envs/edraak_devstack.py`
| Edraak/edx-platform | lms/envs/edraak_devstack.py | Python | agpl-3.0 | 179 |
# Test mocks and helpers
from __future__ import absolute_import
from webob import Request
from xblock.runtime import DictKeyValueStore, KvsFieldData
from xblock.test.tools import TestRuntime
def make_request(body, method='POST'):
"""
Helper method to make request
"""
request = Request.blank('/')
r... | open-craft/xblock-poll | tests/utils.py | Python | agpl-3.0 | 708 |
# -*- coding: utf-8 -*-
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mob... | xlqian/navitia | source/jormungandr/jormungandr/scenarios/ridesharing/tests/instant_system_tests.py | Python | agpl-3.0 | 15,730 |
from PyQt4 import QtCore, QtGui
class Page(QtGui.QWidget):
""" A container and dropevent catcher for widgets """
def __init__(self, parent, pihud):
super(Page, self).__init__(parent)
self.setAcceptDrops(True)
self.pihud = pihud # normally, this would simply be the parent()
se... | brendan-w/piHud | pihud/Page.py | Python | lgpl-2.1 | 846 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Hashcat(MakefilePackage):
"""hashcat is the world's fastest and most advanced password rec... | iulian787/spack | var/spack/repos/builtin/packages/hashcat/package.py | Python | lgpl-2.1 | 1,313 |
#!/usr/bin/python
import os, sys, signal, random
from datetime import datetime, timedelta
VLC_POOL_SIZE = 10 #number of vlc client to keep open
SPAWN_TIMER = 5 #number of seconds between vlc spawn
MAX_VLC_LIFE_TIME = 60 #max life time in seconds of a vlc client
VLC_COMMAND = '/usr/bin/vlc'
class Vlc(object):
def __i... | lscube/feng | contrib/feng_destroyer.py | Python | lgpl-2.1 | 2,136 |
# -*- coding: utf-8 -*-
# Copyright(C) 2016 Edouard Lambert
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the... | laurentb/weboob | modules/binck/__init__.py | Python | lgpl-3.0 | 843 |
################################################################################
# #
# Coauthors: Antoine Eddi (@antoeddi) & Philippe Desmaison (@desmaisn) #
# ... | calinerd/AWS | FULL_LABS/MustacheMe/SourceCode/src/MustacheMe/MustacheMeProcessor/api-static/serv.py | Python | unlicense | 10,036 |
#!/usr/bin/python
import sys
import os
if len(sys.argv) >= 4 :
filename = sys.argv[1]
row_i = int(sys.argv[2])-1
target_ls_filename = sys.argv[3]
output_filename = sys.argv[4]
else:
print("usage: python selectrow.py filename row_i target_ls_filename")
print("or ./selectrow.py filename row_i ta... | jason-weirather/IDP | bin/selectrow.py | Python | apache-2.0 | 1,076 |
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
# 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/... | stackforge/watcher | watcher/decision_engine/solution/solution_comparator.py | Python | apache-2.0 | 832 |
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.map_message_type import *
REQUEST_TYPE = MAP_EXECUTEONALLKEYS
RESPONSE_TYPE = 117
RETRYABLE... | cangencer/hazelcast-python-client | hazelcast/protocol/codec/map_execute_on_all_keys_codec.py | Python | apache-2.0 | 1,451 |
# 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, ... | gsuitedevs/hangouts-chat-samples | python/card-bot/main.py | Python | apache-2.0 | 9,379 |
def testHasMasterPrimary(txnPoolNodeSet):
masterPrimaryCount = 0
for node in txnPoolNodeSet:
masterPrimaryCount += int(node.monitor.hasMasterPrimary)
assert masterPrimaryCount == 1
| evernym/zeno | plenum/test/monitoring/test_monitor_attributes.py | Python | apache-2.0 | 201 |
__author__ = 'Ostico <ostico@gmail.com>'
import sys
import os
import unittest
from pyorient.exceptions import *
from pyorient import OrientSocket
from pyorient.messages.database import *
from pyorient.messages.commands import *
from pyorient.messages.cluster import *
from pyorient.messages.records import *
from pyori... | mogui/pyorient | tests/test_raw_messages_2.py | Python | apache-2.0 | 12,897 |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/lasers/tasks/editors/pyrometer_calibration_editor.py | Python | apache-2.0 | 4,570 |
from JumpScale.portal.macrolib import div_base
def main(j, args, params, *other_args):
return div_base.macro(j, args, params, self_closing=True, tag='input',
additional_tag_params={'type': 'email',
'pattern': r"^[a-zA-Z0-9.!#$%&'*+/=... | Jumpscale/jumpscale_portal8 | apps/portalbase/macros/page/email/1_main.py | Python | apache-2.0 | 436 |
# 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 u... | sxjscience/tvm | python/tvm/contrib/xcode.py | Python | apache-2.0 | 7,815 |
#
# 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... | Acehaidrey/incubator-airflow | airflow/example_dags/tutorial_etl_dag.py | Python | apache-2.0 | 4,302 |
from django.apps import AppConfig
class AccountConfig(AppConfig):
name = 'account'
verbose_name = "EVE W-Space account module"
# Register registries provided by this app
import account.profile_section_registry
import account.group_admin_section_registry
import account.user_admin_section_registry | evewspace/eve-wspace | evewspace/account/apps.py | Python | apache-2.0 | 306 |
# 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... | mahak/neutron | neutron/db/models/provisioning_block.py | Python | apache-2.0 | 1,178 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... | UnrememberMe/pants | tests/python/pants_test/backend/jvm/tasks/test_binary_create_integration.py | Python | apache-2.0 | 6,836 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | essamjoubori/girder | plugins/oauth/server/providers/__init__.py | Python | apache-2.0 | 1,071 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | openstack/python-openstacksdk | openstack/compute/v2/server_group.py | Python | apache-2.0 | 3,440 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | guschmue/tensorflow | tensorflow/python/ops/control_flow_grad.py | Python | apache-2.0 | 9,075 |
"""Abstract base class for kernel clients"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#------... | noslenfa/tdjangorest | uw/lib/python2.7/site-packages/IPython/kernel/clientabc.py | Python | apache-2.0 | 2,081 |
# json error messages for oauth, api parameters, getting, updating, uploading, and deleting images
oauth_error_json = {'status': 'error', 'msg': "could not verify oauth credentials"}
upload_image_blob_error_json = {'status': 'error', 'msg': "failure to upload image to azure storage"}
upload_image_db_error_json = {'sta... | rjhunter8285/nsc-cloudproject-s22016 | prototype/api/FlaskApp/FlaskApp/azure_components/static/app_json.py | Python | apache-2.0 | 1,143 |
# 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... | BiznetGIO/horizon | openstack_dashboard/utils/settings.py | Python | apache-2.0 | 14,525 |
"""Let's Encrypt client crypto utility functions.
.. todo:: Make the transition to use PSS rather than PKCS1_v1_5 when the server
is capable of handling the signatures.
"""
import logging
import os
import OpenSSL
import zope.component
from acme import crypto_util as acme_crypto_util
from acme import jose
from ... | g1franc/lets-encrypt-preview | letsencrypt/crypto_util.py | Python | apache-2.0 | 8,163 |
from __future__ import absolute_import
from __future__ import unicode_literals
import os
from compose.config.config import ConfigDetails
from compose.config.config import ConfigFile
from compose.config.config import load
def build_config(contents, **kwargs):
return load(build_config_details(contents, **kwargs))... | sdurrheimer/compose | tests/helpers.py | Python | apache-2.0 | 1,309 |
# 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 use ... | TiVo/kafka | tests/kafkatest/tests/streams/streams_eos_test.py | Python | apache-2.0 | 9,430 |
import math
import gzip
import paddle.v2 as paddle
import paddle.v2.evaluator as evaluator
import conll03
import itertools
# init dataset
train_data_file = 'data/train'
test_data_file = 'data/test'
vocab_file = 'data/vocab.txt'
target_file = 'data/target.txt'
emb_file = 'data/wordVectors.txt'
train_data_reader = conl... | zhaopu7/models | sequence_tagging_for_ner/ner.py | Python | apache-2.0 | 8,636 |
# Copyright 2021, Google LLC.
#
# 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... | google-research/public-data-in-dpfl | utils/datasets/infinite_emnist_test.py | Python | apache-2.0 | 3,434 |
# sqlalchemy/events.py
# Copyright (C) 2005-2020 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Core event interfaces."""
from . import event
from . import exc
from . impo... | kawamon/hue | desktop/core/ext-py/SQLAlchemy-1.3.17/lib/sqlalchemy/events.py | Python | apache-2.0 | 53,052 |
import unittest
import numpy as np
from ..imutils import nan_to_zero, quantile_threshold, interpolate
class ImutilsTest(unittest.TestCase):
def test_nan_to_zero_with_ge_zero(self):
ids = (
np.zeros(1),
np.ones(range(1, 10)),
np.arange(1024 * 1024)
)
fo... | alexandrovteam/pyImagingMSpec | pyImagingMSpec/test/imutils_test.py | Python | apache-2.0 | 3,746 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
""" Module for all special column handlers for workflow objects """
import dat... | prasannav7/ggrc-core | src/ggrc_workflows/converters/handlers.py | Python | apache-2.0 | 14,283 |
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | sag-enorman/selenium | py/test/selenium/webdriver/firefox/ff_profile_tests.py | Python | apache-2.0 | 8,464 |
# Copyright (c) 2013 Mirantis 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 writ... | citrix-openstack-build/sahara | sahara/utils/general.py | Python | apache-2.0 | 3,962 |
from __future__ import absolute_import
from django.contrib import admin
from django.contrib.admin.models import DELETION
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse
from django.utils.html import escape
from admin.common... | mluo613/osf.io | admin/common_auth/admin.py | Python | apache-2.0 | 2,230 |
#!/usr/bin/env python
import sys # reads command-line args
import ConfigParser
import os
config = ConfigParser.ConfigParser()
config.read(['os.cfg',
os.path.expanduser('~/.os.cfg'),
'/etc/os-maint/os.cfg'])
os_user_name = config.get('OPENSTACK', 'os_user_name')
os_password = config.get('OPENSTACK', ... | drwahl/os-maintenance-tools | bin/neutron_clean_secgroups.py | Python | apache-2.0 | 1,359 |
# Copyright 2011 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# unless required by applicable law or agr... | ryantierney513/capirca | lib/speedway.py | Python | apache-2.0 | 1,410 |
#!/usr/bin/env python
"""This modules contains regression tests for config API handler."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from grr_response_server.gui import api_regression_test_lib
from grr_response_server.gui.api_pl... | dunkhong/grr | grr/server/grr_response_server/gui/api_plugins/config_regression_test.py | Python | apache-2.0 | 1,948 |
# -*- coding: utf-8 -*-
# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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... | opencobra/memote | src/memote/experimental/growth.py | Python | apache-2.0 | 2,835 |
"""Support for RFXtrx devices."""
import asyncio
import binascii
from collections import OrderedDict
import copy
import logging
import RFXtrx as rfxtrxmod
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
fro... | tboyce021/home-assistant | homeassistant/components/rfxtrx/__init__.py | Python | apache-2.0 | 16,421 |
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 OpenMarket Ltd
#
# 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 applica... | TribeMedia/synapse | tests/api/test_filtering.py | Python | apache-2.0 | 15,549 |
#!/usr/bin/env python3
from itertools import combinations, chain
from enum import Enum, auto
LINUX = 'linux'
OSX = 'osx'
WINDOWS = 'windows'
AMD64 = 'amd64'
ARM64 = 'arm64'
PPC64LE = 'ppc64le'
TRAVIS_TEMPLATE = """\
# This config file is generated by ./scripts/gen_travis.py.
# Do not edit by hand.
# We use 'min... | arangodb/arangodb | 3rdParty/jemalloc/v5.2.1/scripts/gen_travis.py | Python | apache-2.0 | 8,683 |
# 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... | eayunstack/python-neutronclient | neutronclient/tests/functional/core/test_readonly_neutron.py | Python | apache-2.0 | 6,814 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | kalahbrown/HueBigSQL | apps/jobbrowser/src/jobbrowser/models.py | Python | apache-2.0 | 22,026 |
from rest_framework.serializers import ValidationError
from six import string_types
def has_id_field(value):
if value is None:
raise ValidationError('Nested object must contain an `id` attribute.')
if isinstance(value, string_types):
raise ValidationError(value)
| pombredanne/drf-nested-serializer | nested_serializers/validators.py | Python | bsd-2-clause | 288 |
#!/usr/bin/env python
from peyotl.utility import get_logger
import re
from peyotl.git_storage import GitActionBase
# extract an amendment id from a git repo path (as returned by git-tree)
_LOG = get_logger(__name__)
class MergeException(Exception):
pass
def get_filepath_for_id(repo_dir, amendment_id):
fro... | mtholder/peyotl | peyotl/amendments/git_actions.py | Python | bsd-2-clause | 5,259 |
"""
$url teamliquid.net
$url tl.net
$type live
"""
import logging
import re
from urllib.parse import urlparse
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugins.afreeca import AfreecaTV
from streamlink.plugins.twitch import Twitch
log = logging.getLogger(__name__)
@pluginmatcher(re.compile... | streamlink/streamlink | src/streamlink/plugins/teamliquid.py | Python | bsd-2-clause | 1,128 |
"""
@package mi.instrument.mclane.driver
@file marine-integrations/mi/instrument/mclane/driver.py
@author Dan Mergens
@brief Driver base class for McLane instruments
Release notes:
initial version
"""
import datetime
__author__ = 'Dan Mergens'
__license__ = 'Apache 2.0'
import re
import time
from mi.core.log import... | ooici/marine-integrations | mi/instrument/mclane/driver.py | Python | bsd-2-clause | 50,088 |
from __future__ import unicode_literals
from django.template.defaultfilters import slugify as django_slugify
from django.utils.importlib import import_module
from unidecode import unidecode
# Timezone support with fallback.
try:
from django.utils.timezone import now
except ImportError:
from datetime import d... | JostCrow/django-forms-builder | forms_builder/forms/utils.py | Python | bsd-2-clause | 1,599 |
# coding: utf-8
from collections import namedtuple
from pandas.io.msgpack.exceptions import * # noqa
from pandas.io.msgpack._version import version # noqa
class ExtType(namedtuple("ExtType", "code data")):
"""ExtType represents ext type in msgpack."""
def __new__(cls, code, data):
if not isinstan... | toobaz/pandas | pandas/io/msgpack/__init__.py | Python | bsd-3-clause | 1,223 |
from django.conf.urls import include, url
from django.shortcuts import redirect
from olympia.stats.urls import stats_patterns
from . import views
ADDON_ID = r"""(?P<addon_id>[^/<>"']+)"""
# These will all start with /addon/<addon_id>/
detail_patterns = [
url('^$', views.addon_detail, name='addons.detail'),
... | lavish205/olympia | src/olympia/addons/urls.py | Python | bsd-3-clause | 3,177 |
#!/usr/bin/env/python
import sys
import argparse
from bokpipe.bokastrom import scamp_solve
parser = argparse.ArgumentParser()
parser.add_argument("image",type=str,
help="input FITS image")
parser.add_argument("catalog",type=str,
help="input FITS catalog")
parser.add_argument("... | legacysurvey/rapala | bokpipe/tools/bokwcs.py | Python | bsd-3-clause | 1,410 |
from os import path
__version__ = '0.0.22'
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
return cur_dir
def setup(app):
app.add_html_theme(
'divio_docs_theme',
path.abspat... | halfflat/nestmc-proto | doc/scripts/divio_docs_theme/__init__.py | Python | bsd-3-clause | 352 |
"""
sentry.db.models
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from copy import copy
import logging
import six
from bitfield.types import BitHandler
from django.db import models... | looker/sentry | src/sentry/db/models/base.py | Python | bsd-3-clause | 4,686 |
import copy
from corehq.pillows.case import CasePillow
from corehq.pillows.mappings.reportcase_mapping import REPORT_CASE_MAPPING, REPORT_CASE_INDEX
from django.conf import settings
from .base import convert_property_dict
class ReportCasePillow(CasePillow):
"""
Simple/Common Case properties Indexer
an ext... | puttarajubr/commcare-hq | corehq/pillows/reportcase.py | Python | bsd-3-clause | 1,031 |
#!/usr/bin/env python3
import socket
def main():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(('127.0.0.1', 5555))
s.listen(1)
while 1:
conn, addr = s.accept()
#data = conn.recv(1024)
conn.send("blabla".encode())
conn.close()
if __name__ == ... | polaris-gslb/polaris-core | tests/tcp_listen.py | Python | bsd-3-clause | 343 |
from django.dispatch import Signal
page_published = Signal(providing_args=['instance', 'revision'])
page_unpublished = Signal(providing_args=['instance'])
pre_page_move = Signal(providing_args=['instance', 'parent_page_before', 'parent_page_after', 'url_path_before', 'url_path_after'])
post_page_move = Signal(providi... | kaedroho/wagtail | wagtail/core/signals.py | Python | bsd-3-clause | 923 |
#!/usr/bin/env python
# coding=utf-8
import os
import datetime
from google.appengine.ext import webapp
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template
from v2ex.babel import Member
from v2ex.ba... | qhm123/the10000 | feed.py | Python | bsd-3-clause | 1,821 |
##########################################################################
#
# Copyright (c) 2011-2013, John Haddon. All rights reserved.
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... | cedriclaunay/gaffer | python/GafferUI/AboutWindow.py | Python | bsd-3-clause | 5,545 |
import datetime
from flask import g
from sqlalchemy import (
Boolean,
Column,
DateTime,
ForeignKey,
Integer,
Sequence,
String,
Table,
UniqueConstraint,
)
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import backref, relationship
from ... import Model
from... | dpgaspar/Flask-AppBuilder | flask_appbuilder/security/sqla/models.py | Python | bsd-3-clause | 5,212 |
from __future__ import absolute_import, unicode_literals
import csv
import datetime
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.encoding import smart_str
from django.utils.translation import... | chrxr/wagtail | wagtail/wagtailforms/views.py | Python | bsd-3-clause | 3,935 |
class ResizeError(Exception):
pass
def codelengths_from_frequencies(freqs):
freqs = sorted(freqs.items(),
key=lambda item: (item[1], -item[0]), reverse=True)
nodes = [Node(char=key, weight=value) for (key, value) in freqs]
while len(nodes) > 1:
right, left = nodes.pop(), nodes.pop()
... | kikocorreoso/brython | www/tests/compression/huffman.py | Python | bsd-3-clause | 8,832 |
""""
This module handles sending grades back to edX
Most of this module is a python 3 port of pylti (github.com/mitodl/sga-lti)
and should be moved back into that library.
"""
import uuid
from xml.etree import ElementTree as etree
import oauth2
from django.conf import settings
class SendGradeFailure(Exception):
... | koljanos/sga-lti | sga/backend/send_grades.py | Python | bsd-3-clause | 4,039 |
from .assign_role import AssignRoleBulkAction
from .delete import DeleteBulkAction
from .set_active_state import SetActiveStateBulkAction
__all__ = ["AssignRoleBulkAction", "DeleteBulkAction", "SetActiveStateBulkAction"]
| wagtail/wagtail | wagtail/users/views/bulk_actions/__init__.py | Python | bsd-3-clause | 222 |
from contextlib import ContextDecorator
from operator import itemgetter
from wagtail.utils.apps import get_app_submodules
_hooks = {}
def register(hook_name, fn=None, order=0):
"""
Register hook for ``hook_name``. Can be used as a decorator::
@register('hook_name')
def my_hook(...):
... | kaedroho/wagtail | wagtail/core/hooks.py | Python | bsd-3-clause | 2,294 |
"""
sentry.management.commands.create_sample_event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.core.management.base import BaseCommand, CommandError, make_option
class Command(BaseC... | rdio/sentry | src/sentry/management/commands/create_sample_event.py | Python | bsd-3-clause | 1,839 |
import os
import numpy as np
import pytest
import pandas as pd
from pandas import (
Categorical,
DatetimeIndex,
Interval,
IntervalIndex,
NaT,
Series,
TimedeltaIndex,
Timestamp,
cut,
date_range,
isna,
qcut,
timedelta_range,
)
import pandas._testing as tm
from pandas.... | rs2/pandas | pandas/tests/reshape/test_qcut.py | Python | bsd-3-clause | 8,222 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) Philipp Wagner. All rights reserved.
# Licensed under the BSD license. See LICENSE file in the project root for full license information.
import sys
# append facerec to module search path
sys.path.append("../..")
# import facerec stuff
from facerec.dataset... | dashmoment/facerecognition | py/apps/scripts/fisherfaces_example.py | Python | bsd-3-clause | 2,253 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.names.tap}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.usage import UsageError
from twisted.names.tap import Options, _buildResolvers
from twisted.names.dns import PORT
from twisted.name... | hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/names/test/test_tap.py | Python | bsd-3-clause | 3,955 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from math import inf
import pytest
import numpy as np
from astropy.cosmology.utils import inf_like, vectorize_if_needed, vectorize_redshift_method
from astropy.utils.exceptions import AstropyDeprecationWarning
def test_vectorize_redshift_method():
... | mhvk/astropy | astropy/cosmology/tests/test_utils.py | Python | bsd-3-clause | 2,328 |
import os
import amo.search
from .models import Reindexing
from django.core.management.base import CommandError
# shortcut functions
is_reindexing_amo = Reindexing.objects.is_reindexing_amo
flag_reindexing_amo = Reindexing.objects.flag_reindexing_amo
unflag_reindexing_amo = Reindexing.objects.unflag_reindexing_amo
g... | anaran/olympia | lib/es/utils.py | Python | bsd-3-clause | 1,403 |
from django.http import Http404
from django.shortcuts import render_to_response
from django.conf import settings
from django.template import RequestContext
from django.core.cache import parse_backend_uri
from django_memcached.util import get_memcached_stats
from django.contrib.auth.decorators import user_passes_test
... | alaindomissy/django-memcached | django_memcached/views.py | Python | bsd-3-clause | 1,535 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | stonebig/bokeh | bokeh/util/tests/test_string.py | Python | bsd-3-clause | 5,444 |
from morepath import compat
def test_text_type():
assert isinstance(u'foo', compat.text_type)
assert not isinstance(b'foo', compat.text_type)
def test_string_types():
assert isinstance('foo', compat.string_types)
assert isinstance(u'foo', compat.string_types)
if compat.PY3:
assert not is... | taschini/morepath | morepath/tests/test_compat.py | Python | bsd-3-clause | 799 |
# pylint: disable=too-many-lines
"""
Component to interface with cameras.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/camera/
"""
import asyncio
import logging
from aiohttp import web
from homeassistant.helpers.entity import Entity
from homeassista... | srcLurker/home-assistant | homeassistant/components/camera/__init__.py | Python | mit | 5,960 |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test gettxoutproof and verifytxoutproof RPCs."""
from test_framework.messages import CMerkleBlock, Fro... | ElementsProject/elements | test/functional/rpc_txoutproof.py | Python | mit | 6,163 |
from unittest import TestCase
import validictory
class TestItems(TestCase):
def test_property(self):
schema = {
"type": "object",
"properties": {
"foo": {
"default": "bar"
},
"baz": {
"type": "... | jalaziz/validictory | validictory/tests/test_defaults.py | Python | mit | 1,074 |