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 |
|---|---|---|---|---|---|
from a10sdk.common.A10BaseClass import A10BaseClass
class Stats(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param dslite_data_session_freed: {"description": "DS-Lite Data Sessions Freed", "format": "counter", "type": "number", "oid": "13", "optional": true, "size": ... | amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_fixed_nat_global_stats.py | Python | apache-2.0 | 13,296 |
# -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | OpenMOOC/moocng | moocng/courses/management/commands/export_course.py | Python | apache-2.0 | 4,436 |
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from geotrek.common.management.commands.migrate import check_srid_has_meter_unit
class StartupCheckTest(TestCase):
def test_error_is_raised_if_srid_is_not_meters(self):
if hasattr(check_srid_has_meter_unit, '_checked... | GeotrekCE/Geotrek-admin | geotrek/common/tests/test_conf.py | Python | bsd-2-clause | 755 |
# -*- coding: utf-8 -*-
"""Processor for remote INDRA JSON files."""
import requests
from typing import List
from ..statements import Statement, print_stmt_summary, stmts_from_json
__all__ = [
'RemoteProcessor',
]
class RemoteProcessor:
"""A processor for INDRA JSON file to be retrieved by URL.
Param... | johnbachman/indra | indra/sources/utils.py | Python | bsd-2-clause | 1,144 |
from dnollkse.viewHelper import render
from faq.models import Faq
def faq(request):
faq = Faq.objects.all()
return render(request, "faq/index.dtl", {'faq': faq})
| dtekcth/DNollK.se | faq/views.py | Python | bsd-2-clause | 172 |
"""
implementations of internal DB commands for YubiHSM
"""
# Copyright (c) 2011 Yubico AB
# See the file COPYING for licence statement.
import struct
__all__ = [
# constants
# functions
# classes
'YHSM_Cmd_DB_YubiKey_Store',
'YHSM_Cmd_DB_Validate_OTP',
]
import pyhsm.defines
import pyhsm.except... | Yubico/python-pyhsm | pyhsm/db_cmd.py | Python | bsd-2-clause | 5,954 |
#!/usr/bin/env python
import os
import unittest
from nose.plugins.attrib import attr
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.adcpt_acfgm.dcl.pd0.adcpt_acfgm_dcl_pd0_telemetered_driver import parse
from mi.dataset.driver.adcpt_acfgm.dcl.pd0.re... | petercable/mi-dataset | mi/dataset/driver/adcpt_acfgm/dcl/pd0/test/test_adcpt_acfgm_dcl_pd0_telemetered_driver.py | Python | bsd-2-clause | 980 |
import fractions
import operator
import os
import random
import sys
import struct
import time
import unittest
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
INVALID_UNDERSCORE_LITERALS)
from math import isinf, isnan, copysign, ldexp
INF = float("inf")... | yotchang4s/cafebabepy | src/main/python/test/test_float.py | Python | bsd-3-clause | 62,623 |
from sklearn.ensemble import RandomForestClassifier
def get_estimator():
clf = RandomForestClassifier(n_estimators=10, max_leaf_nodes=10,
random_state=61)
return clf
| paris-saclay-cds/ramp-workflow | rampwf/tests/kits/iris_data_label/submissions/random_forest_10_10/estimator.py | Python | bsd-3-clause | 209 |
from django.template import Template, Context, TemplateSyntaxError
try:
from PIL import Image
except ImportError:
import Image
from django.core.files import storage
from easy_thumbnails import test, alias
from easy_thumbnails.conf import settings
from easy_thumbnails.files import get_thumbnailer
class Base(... | jrief/easy-thumbnails | easy_thumbnails/tests/templatetags.py | Python | bsd-3-clause | 12,831 |
from django.contrib.auth.models import User
from socialgraph.models import UserLink
def get_people_user_follows(user):
"""
Returns a ``QuerySet`` representing the users that the given user follows.
"""
ul = UserLink.objects.filter(from_user=user).values_list('to_user',
flat=True)
return Us... | mvayngrib/startthedark | socialgraph/util.py | Python | bsd-3-clause | 1,058 |
import importlib
import inspect
import os
import re
import sys
import tempfile
from io import StringIO
from django.conf.urls import url
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from django.template import TemplateDoesNotE... | mattseymour/django | tests/view_tests/tests/test_debug.py | Python | bsd-3-clause | 46,158 |
# Copyright (c) 2012, 2017 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the function... | rallylee/gem5 | configs/common/CpuConfig.py | Python | bsd-3-clause | 5,477 |
from __future__ import absolute_import
from django.conf import settings
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.bases.user import UserEndpoint
from sentry.api.serializers import serialize
from sentry.models import User
class BaseUserSerializer(seri... | daevaorn/sentry | src/sentry/api/endpoints/user_details.py | Python | bsd-3-clause | 2,738 |
# this data should be from nws.
import pyeto
latitude_deg = 38.01
latitude = pyeto.deg2rad(latitude_deg)
day_of_year = 206
tmin = 37
tmax = 53
coastal = True
altitude = 147
rh_min = 13
rh_max = 88
ws = 1.3
tmean = pyeto.daily_mean_t(tmin, tmax)
atmos_pres = pyeto.atm_pressure(altitude)
psy = pyeto.psy_const(atmos_pre... | SB-Technology-Holdings-International/WateringWebClient | server/old-water.py | Python | bsd-3-clause | 1,158 |
# Copyright (c) 2015, Activision Publishing, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condi... | wuan/assertpy | tests/test_description.py | Python | bsd-3-clause | 2,938 |
"""
Module for special-purpose plots.
"""
from __future__ import absolute_import
from .hinton import hinton
from .errorfill import errorfill
__all__ = ['hinton', 'errorfill']
| tonysyu/mpltools | mpltools/special/__init__.py | Python | bsd-3-clause | 179 |
from custom.opm.constants import InvalidRow
from custom.opm.tests import OPMCaseReportTestBase, OPMCase, MockCaseRow
class TestInvalidDates(OPMCaseReportTestBase):
def testBadEdd(self):
case = OPMCase(
forms=[],
edd='this is not a date',
)
self.assertRaises(Invalid... | puttarajubr/commcare-hq | custom/opm/tests/test_regressions.py | Python | bsd-3-clause | 548 |
import os
import typing as t
from warnings import warn
from .app import Flask
from .blueprints import Blueprint
from .globals import _request_ctx_stack
class UnexpectedUnicodeError(AssertionError, UnicodeError):
"""Raised in places where we want some better error reporting for
unexpected unicode or binary da... | mitsuhiko/flask | src/flask/debughelpers.py | Python | bsd-3-clause | 6,171 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
from sentry import eventstore
from sentry.event_manager import EventManager
@pytest.fixture
def make_sdk_snapshot(insta_snapshot):
def inner(data):
mgr = EventManager(data={"sdk": data})
mgr.normalize()
evt = e... | beeftornado/sentry | tests/sentry/event_manager/interfaces/test_sdk.py | Python | bsd-3-clause | 978 |
import socket
import threading
from django.core.handlers.wsgi import WSGIHandler
from django.core.management import call_command
from django.core.servers import basehttp
from django.db import connections
from django.test.testcases import TransactionTestCase, TestCase
import socket
class StoppableWSGIServer(basehttp.W... | strets123/django-tastypie-tweaks | tests/testcases.py | Python | bsd-3-clause | 3,622 |
from unittest import main
from qiita_pet.test.tornado_test_base import TestHandlerBase
class TestAuthCreateHandler(TestHandlerBase):
database = True
def test_get(self):
response = self.get('/auth/create/')
self.assertEqual(response.code, 200)
def test_post(self):
post_args = {
... | RNAer/qiita | qiita_pet/test/test_auth_handlers.py | Python | bsd-3-clause | 2,102 |
from .observation import Observation
from . import galaxymakers
from . import blendmakers
from . import medsmakers
from . import psfmakers
from . import utils
| kstory8/egret | egret/__init__.py | Python | bsd-3-clause | 159 |
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library 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 2.1 of the License, ... | youtube/cobalt | third_party/websocket-client/websocket/_core.py | Python | bsd-3-clause | 17,905 |
from gpiozero import Servo
from time import sleep
servo = Servo(17)
while True:
servo.min()
sleep(2)
servo.mid()
sleep(2)
servo.max()
sleep(2)
| RPi-Distro/python-gpiozero | docs/examples/servo_1.py | Python | bsd-3-clause | 169 |
# -*- coding: utf-8 -*-
"""
.. _ex-ssp-proj:
==================================
Sensitivity map of SSP projections
==================================
This example shows the sources that have a forward field
similar to the first SSP vector correcting for ECG.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.... | mne-tools/mne-python | examples/visualization/ssp_projs_sensitivity_map.py | Python | bsd-3-clause | 1,240 |
# -*- coding: utf-8 -*-
#
# gandalf documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 14 20:44:50 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | marcelometal/gandalf | docs/source/conf.py | Python | bsd-3-clause | 7,702 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | KhronosGroup/COLLADA-CTS | StandardDataSets/1_5/collada/library_visual_scenes/visual_scene/id/id_underscore/id_underscore.py | Python | mit | 3,780 |
from .xcode import XcodePlatform
import platform
class iOSPlatform(XcodePlatform):
def __init__(self, parameters={}):
XcodePlatform.__init__(self, parameters)
@staticmethod
def identifier():
return 'ios'
@staticmethod
def sdk():
return 'iphoneos'
@staticmethod
d... | vmrob/needy | needy/platforms/ios.py | Python | mit | 1,607 |
'''
Created on 2013-4-21
@author: Xsank
'''
import os
import re
import tokenize
from exception import TemplateError
from util import tou,abort,html_escape
from config import TEMPLATES,TEMPLATE_PATH,DEBUG
class BaseTemplate(object):
extentions = ['tpl','html']
settings = {}
defaults = {}
def __ini... | jude90/bottle | brick/template.py | Python | mit | 8,543 |
#!/usr/bin/env python
import os
os.system('clear')
banner()
runlocally()
print colorblue.format('Open multiple tabs in Firefox with:')
print
print "1. List containing IPs and/or URLs."
print "2. Directories from a domain\'s robot.txt."
print "3. Previous menu"
print
choice = raw_input('Choice: ')
if choice == "1":... | leebaird/discover | notes/python/discover/web/multitabs.py | Python | mit | 2,600 |
import frappe
from frappe import _
import frappe.www.list
no_cache = 1
def get_context(context):
if frappe.session.user == 'Guest':
frappe.throw(_("You need to be logged in to access this page"), frappe.PermissionError)
active_tokens = frappe.get_all("OAuth Bearer Token",
filters=[["user", "=", frappe.se... | frappe/frappe | frappe/www/third_party_apps.py | Python | mit | 1,546 |
# Copyright 2016 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 ag... | Sorsly/subtle | google-cloud-sdk/lib/surface/ml/jobs/stream_logs.py | Python | mit | 1,916 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.t... | holiman/pyrlp | setup.py | Python | mit | 1,588 |
if __name__ == '__main__':
import basic_client
raise SystemExit(basic_client.main())
from sys import stdout
from twisted.python.log import startLogging, err
from twisted.protocols.amp import AMP
from twisted.internet import reactor
from twisted.internet.protocol import Factory
from twisted.internet.endpoints... | EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/docs/core/howto/listings/amp/basic_client.py | Python | mit | 669 |
#!/usr/bin/python
# Copyright (c) 2011 Jason Hancock <jsnbyh@gmail.com>
#
# 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 the rights to us... | jasonhancock/cloudstack-python-client | setup.py | Python | mit | 1,693 |
# coding: utf-8
from __future__ import unicode_literals
from datetime import date
from boundaries.models import BoundarySet
from boundaries.tests import ViewTestCase, ViewsTests, PrettyTests
class BoundarySetDetailTestCase(ViewTestCase, ViewsTests, PrettyTests):
maxDiff = None
url = '/boundary-sets/inc/'
... | datamade/represent-boundaries | boundaries/tests/test_boundary_set_detail.py | Python | mit | 962 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""Wrapper for netCDF readers."""
from __future__ import unicode_literals, division, print_function
import os.path
import warnings
import numpy as np
from collections import OrderedDict
from monty.dev import r... | gpetretto/pymatgen | pymatgen/io/abinit/netcdf.py | Python | mit | 17,297 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os, multiprocessing, subprocess
root_path = os.path.abspath(os.path.join(os.path.dirname(__file__)))
resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'res'))
gen_resources = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src/sakia'))
... | ucoin-io/cutecoin | gen_resources.py | Python | mit | 1,836 |
# encoding: UTF-8
from __future__ import print_function
from __future__ import absolute_import
from time import sleep
from .vnfxcm import FxcmApi
url = 'https://api-demo.fxcm.com:443'
port = 443
token = '48055b5d9afac0a300143ac067ce04cd2430a434'
proxy = 'https://localhost:1080'
api = FxcmApi()
print('api create... | harveywwu/vnpy | vnpy/api/fxcm/test.py | Python | mit | 757 |
from celery import task
from django.core.mail import send_mail
from django.template import loader
from django.contrib.auth.forms import PasswordResetForm
from django.core.mail import EmailMultiAlternatives, send_mail
@task()
def add():
return 2 + 2
@task()
def send_mail_old_user(email):
send_mail('invitation ... | druuu/pietrack | project/tasks.py | Python | mit | 1,095 |
####################################
# Driftwood 2D Game Dev. Suite #
# lightmanager.py #
# Copyright 2014-2017 #
# Michael D. Reiley & Paul Merrill #
####################################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of ... | Driftwood2D/Driftwood | src/lightmanager.py | Python | mit | 14,606 |
import abc
import copy
import json
import string
class JSONObject(metaclass=abc.ABCMeta):
@abc.abstractmethod
def __to_json__(self):
pass
@staticmethod
@abc.abstractclassmethod
def from_json(action, selector):
pass
def to_instance(self, target):
return copy.copy(self... | jomyhuang/sdwle | hearthbreaker/tags/base.py | Python | mit | 20,904 |
"""Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import StringIO
import errno
import os
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase
from test import t... | MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.7/Lib/test/test_ftplib.py | Python | mit | 25,025 |
from mongoengine.common import _import_class
from mongoengine.connection import DEFAULT_CONNECTION_NAME, get_db
__all__ = ('switch_db', 'switch_collection', 'no_dereference',
'no_sub_classes', 'query_counter')
class switch_db(object):
"""switch_db alias context manager.
Example ::
# Reg... | MakerReduxCorp/mongoengine | mongoengine/context_managers.py | Python | mit | 6,830 |
#!/usr/bin/env python
#
# Copyright 2007 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 o... | pigeonflight/strider-plone | docker/appengine/dev_appserver.py | Python | mit | 6,126 |
import logging
import networkx
from django.db import transaction
from django.utils import timezone
from regparser.web.index.models import Entry as DBEntry
from regparser.web.index.models import Dependency, DependencyNode
logger = logging.getLogger(__name__)
class Missing(Exception):
def __init__(self, key, dep... | tadhg-ohiggins/regulations-parser | regparser/index/dependency.py | Python | cc0-1.0 | 4,316 |
import unittest
from PyFoam.Applications.PlotWatcher import PlotWatcher
theSuite=unittest.TestSuite()
| Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam | unittests/Applications/test_PlotWatcher.py | Python | gpl-2.0 | 104 |
import os
cluster_path = '/scratch/users/ctsai89/CHE444/2016/cluster_fixed_benchmark'
systems = open('systems.txt').readlines()
os.system('ssh-keygen -R sherlock.stanford.edu')
for system in systems:
try:
elements = system.strip()
os.system('scp ctsai89@sherlock.stanford.edu:'+cluster_path+'/Fixed_... | brohr/brohr.github.io | Fixed_Lattice_Clusters/download_structures.py | Python | gpl-2.0 | 405 |
"""Manual test for figure.show() in the inline matplotlib backend.
This script should be loaded for interactive use (via %load) into a qtconsole
or notebook initialized with the inline backend.
Expected behavior: only *one* copy of the figure is shown.
For further details:
https://github.com/ipython/ipython/issues/... | pacoqueen/ginn | extra/install/ipython2/ipython-5.10.0/tools/tests/inline_figshow.py | Python | gpl-2.0 | 583 |
# Embedded file name: /usr/lib/enigma2/python/Components/Converter/ODRefString.py
from Components.Converter.Converter import Converter
from Components.Element import cached
from Screens.InfoBar import InfoBar
class ODRefString(Converter, object):
CURRENT = 0
EVENT = 1
def __init__(self, type):
... | trunca/enigma2 | lib/python/Components/Converter/ODRefString.py | Python | gpl-2.0 | 1,792 |
# This file is part of Rubber and thus covered by the GPL
# (c) Emmanuel Beffara, 2003--2006
"""
Dependency analysis and environment parsing for package 'listings' in Rubber.
"""
def setup (document, context):
global doc
doc = document
doc.hook_macro('lstinputlisting', 'oa', hook_input)
doc.hook_macro('lstnewenvir... | sre/rubber | src/latex_modules/listings.py | Python | gpl-2.0 | 660 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015 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 optio... | SamiHiltunen/invenio-utils | tests/test_utils_datastructures.py | Python | gpl-2.0 | 12,697 |
from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage("ar")
assert language.punctranslate("") == ""
assert language.punctranslate("abc efg") == "abc efg"
assert language.punctranslate("abc efg.") == "abc efg."
... | translate/translate | translate/lang/test_ar.py | Python | gpl-2.0 | 1,388 |
# Very, very naive RE-based way for collecting declarations inside
# 'cdef extern from *' Cython blocks in in source files, and next
# generate compatibility headers for MPI-2 partially implemented or
# built, or MPI-1 implementations, perhaps providing a subset of MPI-2
from textwrap import dedent
try:
import mp... | capoe/espressopp.soap | contrib/mpi4py/mpi4py-1.3/conf/mpiscanner.py | Python | gpl-3.0 | 10,154 |
"""
Binds a cmake executable as a rez package.
"""
from __future__ import absolute_import
from rez.package_maker__ import make_package
from rez.bind._utils import check_version, find_exe, extract_version, make_dirs
from rez.utils.platform_ import platform_
from rez.system import system
from rez.utils.lint_helper import... | saddingtonbaynes/rez | src/rez/bind/cmake.py | Python | gpl-3.0 | 1,170 |
import time
class Stopwatch(object):
def __init__(self):
self.start_time = time.time()
def time(self):
return time.time() - self.start_time | tanglu-org/tgl-misago | misago/stopwatch.py | Python | gpl-3.0 | 165 |
# TNC Python interface
# @(#) $Jeannot: tnc.py,v 1.11 2005/01/28 18:27:31 js Exp $
# Copyright (c) 2004-2005, Jean-Sebastien Roy (js@jeannot.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 Soft... | ygenc/onlineLDA | onlineldavb_new/build/scipy/scipy/optimize/tnc.py | Python | gpl-3.0 | 11,437 |
#!/usr/bin/env python
#
# Copyright 2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from gnuradio import gr, digital
from gnur... | jdemel/gnuradio | gr-filter/examples/reconstruction.py | Python | gpl-3.0 | 4,364 |
HOST = "172.31.28.140:27017"
PORT = ""
USER = ""
PASSWORD = ""
DATABASE = "google"
READ_PREFERENCE = "primary"
COLLECTION_INPUT = "average_ratioevent"
COLLECTION_OUTPUT = "analysis_ratio"
PREFIX_COLUMN = "g_"
ATTRIBUTES = ["event type", "total cpu task","total memory task", "total balanced task"]
SORT = ["_id.filepath... | elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1A/instances/6_workflow_full_10files_primary_1sh_1rs_with_annot_with_proj_3s/analysisevent_0/ConfigDB_Analysis_AverageEvent_0.py | Python | gpl-3.0 | 451 |
#!/usr/bin/env python
#
# Copyright 2012,2013,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr
from gnuradio import blocks
from gnuradio import blocks
import sys
try:
from gnuradio import qtgui
from PyQt5 import Qt... | dl1ksv/gnuradio | gr-qtgui/examples/pyqt_time_raster_b.py | Python | gpl-3.0 | 2,170 |
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
def execute():
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
return
custom_fields = {
'Sales Invoice Item': [
dict(fieldname='taxable_value', label='Taxable Value',
field... | mhbu50/erpnext | erpnext/patches/v12_0/create_taxable_value_field.py | Python | gpl-3.0 | 499 |
import sys
PY_VERSION = sys.version_info[0] | words-in-passing/words-in-passing.github.io | marklog/compat.py | Python | agpl-3.0 | 45 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-06-02 15:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0130_learningcontaineryear_campus'),
]
operations = [
migrations.Alter... | uclouvain/osis_louvain | base/migrations/0131_auto_20170602_1745.py | Python | agpl-3.0 | 1,485 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('logframe', '0005_auto_20151215_1204'),
('contacts', '0001_initial'),
]
operations = [
migrations.AddField(
... | daniell/kashana | django/website/contacts/migrations/0002_user_last_viewed_logframe.py | Python | agpl-3.0 | 472 |
import requests
from sqlalchemy import desc
from inbox.basicauth import OAuthError
from inbox.search.base import SearchBackendException
from inbox.auth.oauth import OAuthRequestsWrapper
from inbox.models import Message, Thread, Account
from inbox.models.backends.gmail import g_token_manager
from nylas.logging import ge... | closeio/nylas | inbox/search/backends/gmail.py | Python | agpl-3.0 | 5,314 |
# coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import requests
import loggi... | nickverschoor/OctoPrint | src/octoprint/plugins/softwareupdate/version_checks/github_release.py | Python | agpl-3.0 | 10,218 |
# -*- coding: utf-8 -*-
#***************************************************************************
#* Copyright (c) 2010 Juergen Riegel <juergen.riegel@web.de> *
#* *
#* This file is part of the FreeCAD CAx development system.... | sanguinariojoe/FreeCAD | src/Mod/Test/UnitTests.py | Python | lgpl-2.1 | 6,978 |
# 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 PyDlcpar(PythonPackage):
"""DLCpar is a reconciliation method for inferring gene duplicati... | iulian787/spack | var/spack/repos/builtin/packages/py-dlcpar/package.py | Python | lgpl-2.1 | 696 |
# 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)
import ast
import hashlib
import spack.repo
import spack.package
import spack.directives
import spack.error
import spack.... | iulian787/spack | lib/spack/spack/util/package_hash.py | Python | lgpl-2.1 | 5,042 |
"""Partial dependence plots for tree ensembles. """
# Authors: Peter Prettenhofer
# License: BSD 3 clause
from itertools import count
import numbers
import numpy as np
from scipy.stats.mstats import mquantiles
from ..utils.extmath import cartesian
from ..externals.joblib import Parallel, delayed
from ..externals im... | chaluemwut/fbserver | venv/lib/python2.7/site-packages/sklearn/ensemble/partial_dependence.py | Python | apache-2.0 | 14,897 |
# 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... | eaplatanios/tensorflow | tensorflow/python/framework/ops.py | Python | apache-2.0 | 221,991 |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | alexandrul-ci/robotframework | src/robot/running/runner.py | Python | apache-2.0 | 9,678 |
# Copyright 2015, Doug Wiegley (dougwig), A10 Networks
#
# 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 b... | gandelman-a/neutron-lbaas | neutron_lbaas/tests/unit/drivers/a10networks/test_driver_v2.py | Python | apache-2.0 | 3,412 |
# Copyright 2019 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... | ppwwyyxx/tensorflow | tensorflow/python/framework/convert_to_constants.py | Python | apache-2.0 | 27,106 |
# Copyright 2016 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... | shakamunyi/tensorflow | tensorflow/contrib/ctc/__init__.py | Python | apache-2.0 | 1,014 |
#!/usr/bin/python
#
# Copyright 2015 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 b... | coxmediagroup/googleads-python-lib | examples/adwords/v201506/basic_operations/add_campaigns.py | Python | apache-2.0 | 4,119 |
# 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/dashboards/project/cg_snapshots/tabs.py | Python | apache-2.0 | 1,188 |
#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | lextoumbourou/cyclone | demos/websocket/chat/chatdemo.py | Python | apache-2.0 | 4,474 |
#
# Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "li... | zeliard/aws-sdk-cpp | scripts/run_integration_tests.py | Python | apache-2.0 | 3,508 |
# -*- coding: utf-8 -*-
#
# 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
#... | CloverHealth/airflow | tests/www/test_views.py | Python | apache-2.0 | 28,088 |
# Copyright 2018 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 applicab... | jiaphuan/models | research/deeplab/core/preprocess_utils_test.py | Python | apache-2.0 | 17,975 |
# Copyright 2017 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... | nburn42/tensorflow | tensorflow/python/estimator/run_config.py | Python | apache-2.0 | 30,509 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... | StackStorm/st2 | contrib/runners/noop_runner/noop_runner/noop_runner.py | Python | apache-2.0 | 1,964 |
from urllib.parse import urljoin
from django.db import models
from django.urls import resolve, reverse
from django.utils.translation import gettext
from django.utils.translation import gettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.models import (
ContentTyped,
Displayable,
Orde... | stephenmcd/mezzanine | mezzanine/pages/models.py | Python | bsd-2-clause | 10,686 |
# -*- coding: utf-8 -*-
#
# Django Classy Settings documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 24 13:53:10 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | pombredanne/django-classy-settings | docs/conf.py | Python | bsd-2-clause | 8,289 |
from __future__ import absolute_import
from django.utils import timezone
from mock import Mock, patch
from sentry.testutils import AcceptanceTestCase
class OrganizationRateLimitsTest(AcceptanceTestCase):
def setUp(self):
super(OrganizationRateLimitsTest, self).setUp()
self.user = self.create_use... | alexm92/sentry | tests/acceptance/test_organization_rate_limits.py | Python | bsd-3-clause | 1,897 |
""" """
__docformat__ = "restructuredtext"
# Se agrega tabla tagcounts para sumarizar los tags de un usuario
migration = [
("""\
CREATE TABLE tagcounts (
user_id INTEGER NOT NULL,
tag_id INTEGER NOT NULL,
count INTEGER NOT NULL,
PRIMARY KEY (user_id, tag_id),
... | santisiri/popego | popego/popserver/popserver/db/migration_027.py | Python | bsd-3-clause | 593 |
# Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from nose.tools import assert_true
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equ... | jniediek/mne-python | mne/tests/test_cov.py | Python | bsd-3-clause | 23,537 |
#!/usr/bin/env python
# Copyright 2014 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 base64
import json
import unittest
from extensions_paths import SERVER2
from file_system import StatInfo
from future import Fut... | 7kbird/chrome | chrome/common/extensions/docs/server2/gitiles_file_system_test.py | Python | bsd-3-clause | 5,240 |
#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | erja-gp/openthread | tests/toranj/test-019-inform-previous-parent.py | Python | bsd-3-clause | 6,478 |
from django.conf import settings
from django.db import connections
from django.dispatch import receiver, Signal
from django.template import context
template_rendered = Signal(providing_args=["template", "context"])
setting_changed = Signal(providing_args=["setting", "value"])
@receiver(setting_changed)
def update_co... | svn2github/django | django/test/signals.py | Python | bsd-3-clause | 1,072 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module provides the tools used to internally run the astropy test suite
from the installed astropy. It makes use of the `pytest`_ testing framework.
"""
import os
import sys
import pickle
import warnings
import functools
import pytest
from astr... | pllim/astropy | astropy/tests/helper.py | Python | bsd-3-clause | 16,362 |
from __future__ import division
import numpy as np
from bokeh.plotting import *
N = 20
img = np.empty((N,N), dtype=np.uint32)
view = img.view(dtype=np.uint8).reshape((N, N, 4))
for i in range(N):
for j in range(N):
view[i, j, 0] = int(i/N*255)
view[i, j, 1] = 158
view[i, j, 2] = int(j/N... | the13fools/Bokeh_Examples | plotting/file/image_rgba.py | Python | bsd-3-clause | 618 |
#!/usr/bin/env python
#
#===- rename_check.py - clang-tidy check renamer -------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------... | youtube/cobalt | third_party/llvm-project/clang-tools-extra/clang-tidy/rename_check.py | Python | bsd-3-clause | 9,659 |
"""
============
Rank filters
============
Rank filters are non-linear filters using the local gray-level ordering to
compute the filtered value. This ensemble of filters share a common base: the
local gray-level histogram is computed on the neighborhood of a pixel (defined
by a 2-D structuring element). If the filter... | pratapvardhan/scikit-image | doc/examples/xx_applications/plot_rank_filters.py | Python | bsd-3-clause | 19,382 |
# -*- coding]= utf-8 -*-
from __future__ import absolute_import, unicode_literals
def execute(next_process, handler, dependencies, **kwargs):
dependencies["_req"] = handler.request
dependencies["_resp"] = handler.response
dependencies["_handler"] = handler
dependencies["_dependencies"] = dependencies
... | silviolima/EstudoAppengine | tekton/tekton-master/src/tekton/gae/middleware/webapp2_dependencies.py | Python | mit | 361 |
import json
import logging
from google.appengine.api import mail
import tba_config
class OutgoingNotificationHelper(object):
@classmethod
def send_admin_alert_email(cls, subject, email_body):
# Send an email to contact@ telling them to review this
# Only do this on prod
if tba_confi... | jaredhasenklein/the-blue-alliance | helpers/outgoing_notification_helper.py | Python | mit | 1,786 |
import unittest
import shutil
import tempfile
import os
import random
import string
import bcbio.utils as utils
import tests.generate_test_data as td
from scilifelab.illumina.hiseq import HiSeqRun
class TestHiSeqRun(unittest.TestCase):
def setUp(self):
self.rootdir = tempfile.mkdtemp(prefix="test_il... | SciLifeLab/scilifelab | tests/illumina/test_hiseq.py | Python | mit | 5,072 |
import time
from config.config import config
from lib.irc import Irc
from lib.game import Game
from lib.misc import pbutton
class Bot:
def __init__(self):
self.config = config
self.irc = Irc(config)
self.game = Game()
self.message_buffer = [{'username': '', 'button': ''}] * self.c... | aidanrt/twitch-plays | lib/bot.py | Python | mit | 1,447 |