repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
bealdav/OpenUpgrade | addons/mail/__init__.py | 382 | 1357 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
morganzhh/sysrepo | swig/python2/examples/pytho2_application_changes_example.py | 1 | 4831 | #!/usr/bin/env python
__author__ = "Mislav Novakovic <mislav.novakovic@sartura.hr>"
__copyright__ = "Copyright 2016, Deutsche Telekom AG"
__license__ = "Apache 2.0"
# 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 c... | apache-2.0 |
ma314smith/home-assistant | homeassistant/components/media_player/soundtouch.py | 6 | 12953 | """Support for interface with a Bose Soundtouch."""
import logging
from os import path
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.media_player import (
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PREVIOUS_TRACK,
SUPPORT_TURN_OFF, SUPPORT_VOLUME_M... | mit |
aoakeson/home-assistant | homeassistant/components/sensor/torque.py | 5 | 3109 | """
Support for the Torque OBD application.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.torque/
"""
import re
from homeassistant.const import HTTP_OK
from homeassistant.helpers.entity import Entity
DOMAIN = 'torque'
DEPENDENCIES = ['http']
S... | mit |
thaim/ansible | lib/ansible/modules/system/java_keystore.py | 18 | 10891 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Guillaume Grossetie <ggrossetie@yuzutech.fr>
# 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_versio... | mit |
j0nathan33/CouchPotatoServer | libs/rtorrent/tracker.py | 173 | 5212 | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.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 use, copy, modify, ... | gpl-3.0 |
miniconfig/home-assistant | tests/components/lock/test_mqtt.py | 8 | 4147 | """The tests for the MQTT lock platform."""
import unittest
from homeassistant.setup import setup_component
from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED,
ATTR_ASSUMED_STATE)
import homeassistant.components.lock as lock
from tests.common import (
mock_mqtt_component... | mit |
nattee/cafe-grader-web | lib/assets/Lib/_sysconfigdata.py | 9 | 18169 | build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1... | mit |
roxyboy/scikit-learn | examples/feature_selection/plot_rfe_with_cross_validation.py | 226 | 1384 | """
===================================================
Recursive feature elimination with cross-validation
===================================================
A recursive feature elimination example with automatic tuning of the
number of features selected with cross-validation.
"""
print(__doc__)
import matplotlib.p... | bsd-3-clause |
enjaz/enjaz | clubs/migrations/0016_separate_presidency.py | 2 | 3601 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def separate_deanship_presidency(apps, schema_editor):
"""No longer will we have lasting clubs. All clubs, including the
presidency and the deanship should last only one year. This will help
us separate pres... | agpl-3.0 |
beiko-lab/gengis | bin/Lib/site-packages/matplotlib/colors.py | 3 | 53183 | """
A module for converting numbers or color arguments to *RGB* or *RGBA*
*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
range 0-1.
This module includes functions and classes for color specification
conversions, and for mapping numbers to colors in a 1-D array of colors called
a colormap. Color... | gpl-3.0 |
sdcooke/django | tests/delete/models.py | 208 | 3759 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class R(models.Model):
is_default = models.BooleanField(default=False)
def __str__(self):
return "%s" % self.pk
def get_default_r():
r... | bsd-3-clause |
crowd-course/scholars | config/urls.py | 1 | 2278 | from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from rest_framework.routers import SimpleRouter
from django.views import defaults ... | mit |
hackerspace/rpi-linux | Documentation/target/tcm_mod_builder.py | 337 | 24391 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
JamesRamm/longclaw_demo | search/views.py | 2 | 1143 | from __future__ import absolute_import, unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
try:
from wagtail.core.models import Page
from wagtail.search.models import Query
except ImportError:
from wagtail.wagtailcore.models import... | mit |
thonkify/thonkify | src/lib/telegram/ext/callbackqueryhandler.py | 3 | 4990 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | mit |
shengqh/ngsperl | lib/Alignment/filterMixBam.py | 1 | 3954 | import pysam
import argparse
import sys
import logging
import os
import re
from asyncore import read
def write_reads(fout, refmap, reads, counts):
hostReads = []
feedReads = []
hasSecondary = False
for read in reads:
if read.is_secondary:
hasSecondary = True
continue
if refmap[read.referenc... | apache-2.0 |
laumann/servo | tests/wpt/css-tests/tools/wptserve/wptserve/stash.py | 89 | 5279 | import base64
import json
import os
import uuid
from multiprocessing import Process
from multiprocessing.managers import BaseManager, DictProxy
class ServerDictManager(BaseManager):
shared_data = {}
def _get_shared():
return ServerDictManager.shared_data
ServerDictManager.register("get_dict",
... | mpl-2.0 |
viktorTarasov/PyKMIP | kmip/demos/pie/register_private_key.py | 1 | 7298 | # Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... | apache-2.0 |
ryanjmccall/nupic | tests/unit/nupic/data/fieldmeta_test.py | 17 | 1995 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | gpl-3.0 |
darjus-amzn/boto | boto/elasticache/__init__.py | 145 | 1669 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | mit |
hkchenhongyi/django | django/contrib/admin/filters.py | 188 | 16608 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.contrib.admin.op... | bsd-3-clause |
philjjoon/Big-Data-Benchmark-for-Big-Bench | engines/hive/queries/q04/variants/old/q4_reducer1.py | 3 | 1829 | #"INTEL CONFIDENTIAL"
#Copyright 2015 Intel Corporation All Rights Reserved.
#
#The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers an... | apache-2.0 |
erjohnso/ansible | lib/ansible/modules/network/nxos/nxos_nxapi.py | 15 | 9821 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... | gpl-3.0 |
roopali8/tempest | tempest/api/compute/test_networks.py | 20 | 1317 | # Copyright 2014 IBM Corp.
#
# 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 t... | apache-2.0 |
andreffs18/flask-template-project | project/user/tests/test_login_manager.py | 1 | 2657 | # !/usr/bin/python
# -*- coding: utf-8 -*-
from project.tests.base import UtilsTestCase
import base64
import project.home.login_manager as lm
class LoginManagerUtilsTestCase(UtilsTestCase):
def setUp(self):
super(LoginManagerUtilsTestCase, self).setUp()
self.user = self.create_user(is_admin=True)... | mit |
marcusmueller/gr-drm | gr-drm/docs/doxygen/doxyxml/text.py | 333 | 1832 | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... | gpl-3.0 |
saksham/sample_project | docs/conf.py | 1 | 8481 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 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
# ... | bsd-3-clause |
perimosocordiae/scipy | scipy/sparse/linalg/tests/test_onenormest.py | 12 | 9229 | """Test functions for the sparse.linalg._onenormest module
"""
import numpy as np
from numpy.testing import assert_allclose, assert_equal, assert_
import pytest
import scipy.linalg
import scipy.sparse.linalg
from scipy.sparse.linalg._onenormest import _onenormest_core, _algorithm_2_2
class MatrixProductOperator(scip... | bsd-3-clause |
astropy/astropy | astropy/visualization/wcsaxes/coordinate_range.py | 11 | 4818 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
import numpy as np
from astropy import units as u
# Algorithm inspired by PGSBOX from WCSLIB by M. Calabretta
LONLAT = {'longitude', 'latitude'}
def wrap_180(values):
values_new = values % 360.
with np.errstate(invalid='igno... | bsd-3-clause |
adiultra/pysick | games/surface.py | 1 | 3208 | """
My crazy surface program
ToDo:
[ ] -> check compare fxn (direction = across) !!important!!
[ ] -> code other directions fro compare
[ ] -> code the win fxn
"""
class surface:
"""Class : Surface
This is class for the surface or "board" of a 2D game
"""
def __init__(self, dimension... | gpl-3.0 |
LarsFronius/ansible | lib/ansible/utils/module_docs_fragments/asa.py | 123 | 4186 | #
# (c) 2016, Peter Sprygada <psprygada@ansible.com>
# (c) 2016, Patrick Ogenstad <@ogenstad>
#
# This file is part of Ansible
#
# Ansible 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 th... | gpl-3.0 |
alash3al/rethinkdb | external/v8_3.30.33.16/build/gyp/test/variables/commands/gyptest-commands-ignore-env.py | 330 | 1466 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test that environment variables are ignored when --ignore-environment is
specified.
"""
import os
import TestGyp
test = TestGyp.TestG... | agpl-3.0 |
kmerenkov/dbup | dbup/database/backend.py | 1 | 3819 | # -*- coding: utf-8 -*-
# Copyright (c) 2008 by Konstantin Merenkov <kmerenkov@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 limitatio... | mit |
FluidityProject/fluidity | tests/gls-ocean-param/gls_ocean_param.py | 2 | 9260 | #!/usr/bin/env python3
import string
import re
import os
import vtktools
from numpy import argsort, size
from pylab import cm, figure, colorbar, arange, date2num, mpl, xlabel, ylabel, savefig, close, legend
from datetime import datetime, timedelta
#### taken from http://www.codinghorror.com/blog/archives/001018.html... | lgpl-2.1 |
patrioticcow/MessagesForSkype | packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/bsddb/test/test_cursor_pget_bug.py | 7 | 2129 | import unittest
import sys, os, glob
try:
# For Pythons w/distutils pybsddb
from bsddb3 import db
except ImportError:
# For Python 2.3
from bsddb import db
#----------------------------------------------------------------------
class pget_bugTestCase(unittest.TestCase):
"""Verify that cursor.pge... | mit |
ArcherCraftStore/ArcherVMPeridot | Python/Lib/nturl2path.py | 89 | 2396 | """Convert a NT pathname to a file URL and vice versa."""
def url2pathname(url):
"""OS-specific conversion from a relative URL of the 'file' scheme
to a file system path; not recommended for general use."""
# e.g.
# ///C|/foo/bar/spam.foo
# becomes
# C:\foo\bar\spam.foo
import string, urlli... | apache-2.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/optparse.py | 99 | 60346 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | lgpl-3.0 |
tsmrachel/remo | log_settings.py | 5 | 2098 | import logging
import logging.handlers
import socket
from django.conf import settings
import commonware.log
import dictconfig
class NullHandler(logging.Handler):
def emit(self, record):
pass
base_fmt = ('%(name)s:%(levelname)s %(message)s :%(pathname)s:%(lineno)s')
use_syslog = settings.HAS_SYSLOG an... | bsd-3-clause |
explora26/zephyr | scripts/dts/devicetree.py | 1 | 7952 | #!/usr/bin/env python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: ai:ts=4:sw=4
import sys
import pprint
def read_until(line, fd, end):
out = [line]
while True:
idx = line.find(end)
if idx < 0:
line = clean_line(fd.readline(), fd)
... | apache-2.0 |
niieani/rethinkdb | test/interface/artificial_table.py | 9 | 2193 | #!/usr/bin/env python
# Copyright 2014-2015 RethinkDB, all rights reserved.
'''This runs a bunch of the ReQL tests against the `rethinkdb._debug_scratch` artificial table to check that `artificial_table_t` works properly.'''
import os, subprocess, sys, time
startTime = time.time()
sys.path.append(os.path.abspath(os... | agpl-3.0 |
xhb/profitpy | profit/lib/widgets/callableselectwidget.py | 18 | 10034 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase <troy@gci.net>
# Distributed under the terms of the GNU General Public License v2
## TODO: match warning to location label
## TODO: fix enable/disable on change
## TODO: streamline
## TODO: provide valid marker on source edit emit
import... | gpl-2.0 |
Alwnikrotikz/libkml | third_party/googletest-r108/test/gtest_env_var_test.py | 15 | 4073 | #!/usr/bin/env python
#
# Copyright 2008, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
fmarco/djangocms-terminal | djangocms_terminal/management/commands/autofixture.py | 1 | 1750 | import django
from django.core.management.base import BaseCommand, CommandError
from djangocms_terminal.utils import get_autofixture
from optparse import make_option
ARGS = (
('--app_label', {'dest': 'app_label', 'help': 'App label'}),
('--model_name', {'dest': 'model_name', 'help': 'Model name'}),
('--f_k... | mit |
dylanlesko/youtube-dl | youtube_dl/extractor/restudy.py | 146 | 1155 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class RestudyIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?restudy\.dk/video/play/id/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://www.restudy.dk/video/play/id/1637',
'info_dict': {
'id': ... | unlicense |
mdakin/engine | build/android/pylib/utils/reraiser_thread.py | 51 | 4650 | # Copyright 2013 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.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
# pylint: disable=W0212
import logging
import sys
import threading
import traceback... | bsd-3-clause |
djangorussia/django-1.3-branch | tests/regressiontests/generic_relations_regress/tests.py | 102 | 2909 | from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from models import *
class GenericRelationTests(TestCase):
def test_inherited_models_content_type(self):
"""
Test that GenericRelations on inherited classes use the correct co... | bsd-3-clause |
finaldie/DNSTurbo | src/modules/request/module.py | 1 | 2469 | import pprint
import time
from dnslib import DNSRecord
from dnslib import DNSHeader
from dnslib import QTYPE
from skull import logger
from common import metrics
##
# Module Init Entry, be called when start phase
#
# @param config A parsed yamlObj
#
def module_init(config):
logger.debug("py module init")
lo... | mit |
cpalmit/drupaltest | sites/all/themes/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | gpl-2.0 |
ryfeus/lambda-packs | Skimage_numpy/source/scipy/interpolate/_cubic.py | 10 | 29293 | """Interpolation algorithms using piecewise cubic polynomials."""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import string_types
from . import BPoly, PPoly
from .polyint import _isscalar
from scipy._lib._util import _asarray_validated
from scipy.linalg im... | mit |
godLoveLucifer/viewfinder | backend/www/test/query_followed_test.py | 13 | 6067 | # -*- coding: utf-8 -*-
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Tests query of viewpoints followed by a user, with limits and
start keys.
"""
__author__ = 'andy@emailscrubbed.com (Andy Kimball)'
from viewfinder.backend.base import constants, util
from viewfinder.backend.base.testing import async_tes... | apache-2.0 |
acenario/Payable | lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/findstatic.py | 463 | 1745 | from __future__ import unicode_literals
import os
from django.contrib.staticfiles import finders
from django.core.management.base import LabelCommand
from django.utils.encoding import force_text
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
label = 'static file... | mit |
ajayuranakar/django-blog | lib/python2.7/site-packages/django/views/decorators/http.py | 208 | 4412 | """
Decorators for views based on HTTP headers.
"""
import logging
from calendar import timegm
from functools import wraps
from django.http import HttpResponseNotAllowed
from django.middleware.http import ConditionalGetMiddleware
from django.utils.cache import get_conditional_response
from django.utils.decorators imp... | gpl-3.0 |
jolyonb/edx-platform | openedx/core/djangoapps/waffle_utils/__init__.py | 2 | 16390 | """
Utilities for waffle.
Includes namespacing, caching, and course overrides for waffle flags.
Usage:
For Waffle Flags, first set up the namespace, and then create flags using the
namespace. For example:
WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='course_experience')
# Use CourseWaffleFlag when you a... | agpl-3.0 |
nlloyd/SubliminalCollaborator | libs/twisted/test/test_policies.py | 7 | 23136 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test code for policies.
"""
from zope.interface import Interface, implements, implementedBy
from StringIO import StringIO
from twisted.trial import unittest
from twisted.test.proto_helpers import StringTransport
from twisted.test.proto_help... | apache-2.0 |
leppa/home-assistant | tests/components/microsoft_face_identify/test_image_processing.py | 1 | 6004 | """The tests for the microsoft face identify platform."""
from unittest.mock import PropertyMock, patch
import homeassistant.components.image_processing as ip
import homeassistant.components.microsoft_face as mf
from homeassistant.const import ATTR_ENTITY_PICTURE, STATE_UNKNOWN
from homeassistant.core import callback
... | apache-2.0 |
diegocortassa/TACTIC | src/client/tactic_client_lib/interpreter/callback.py | 6 | 3958 | ###########################################################
#
# Copyright (c) 2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without writte... | epl-1.0 |
natemurthy/marathon | tests/system/test_marathon_universe.py | 1 | 3488 | """Marathon acceptance tests for DC/OS."""
import pytest
import shakedown
import time
from datetime import timedelta
from dcos import (packagemanager, subcommand)
from dcos.cosmos import get_cosmos_url
from shakedown import required_private_agents
from common import cluster_info
PACKAGE_NAME = 'marathon'
SERVICE_NA... | apache-2.0 |
mathjazz/pontoon | pontoon/insights/tasks.py | 2 | 15213 | import logging
from celery import shared_task
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from django.db.models import F
from django.contrib.auth.models import User
from django.utils import timezone
from pontoon.actionlog.models import ActionLog
from pontoon.base.models import Ent... | bsd-3-clause |
seibert/numba | numba/tests/test_typeinfer.py | 2 | 24395 | import os, sys, subprocess
import itertools
import numpy as np
from numba.core.compiler import compile_isolated
from numba import jit
from numba.core import types, typing, errors, typeinfer, utils
from numba.core.typeconv import Conversion
from numba.tests.support import TestCase, tag
from numba.tests.test_typeconv ... | bsd-2-clause |
RydrDojo/Ridr | pylotVenv/lib/python2.7/site-packages/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
phdeniel/ltpfs | testcases/kernel/power_management/sched_domain.py | 8 | 1671 | #!/usr/bin/python
''' This Python script validates sched domain information in dmesg
with information in sysfs topology
'''
import os
import sys
LIB_DIR = "%s/lib" % os.path.dirname(__file__)
sys.path.append(LIB_DIR)
from sched_mc import *
from optparse import OptionParser
__author__ = "Poornima Nayak <mpnayak@li... | gpl-2.0 |
iulian787/spack | var/spack/repos/builtin/packages/py-keras-applications/package.py | 5 | 1207 | # 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 PyKerasApplications(PythonPackage):
"""Sample Deep Learning application in Keras.
Kera... | lgpl-2.1 |
40223202/2015cdb_g2 | static/Brython3.1.1-20150328-091302/Lib/linecache.py | 785 | 3864 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
import tokenize
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globa... | gpl-3.0 |
jepegit/cellpy | tests/test_prms.py | 1 | 3841 | import pytest
import tempfile
import os
import io
import logging
from cellpy import log
from cellpy import prms
from cellpy import prmreader
from . import fdv
log.setup_logging(default_level="DEBUG")
config_file_txt = """---
Batch:
color_style_label: seaborn-deep
dpi: 300
fig_extension: png
figure_type: unlim... | mit |
CloudServer/nova | nova/tests/unit/virt/test_configdrive.py | 46 | 1156 | # Copyright 2014 IBM Corp.
#
# 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 agree... | apache-2.0 |
bobjects/BobStack | open-test-data/rfc4475-sip-torture-test/multi01.dat.py | 1 | 1149 | messageString = (
'INVITE sip:user@company.com SIP/2.0\r\n'
'Contact: <sip:caller@host25.example.net>\r\n'
'Via: SIP/2.0/UDP 192.0.2.25;branch=z9hG4bKkdjuw\r\n'
'Max-Forwards: 70\r\n'
'CSeq: 5 INVITE\r\n'
'Call-ID: multi01.98asdh@192.... | apache-2.0 |
40223225/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_setups.py | 791 | 16440 | import io
import sys
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases... | gpl-3.0 |
KodiColdkeys/coldkeys-addons | repository/plugin.video.white.devil/resources/lib/modules/keepalive.py | 333 | 19919 | # 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, or (at your option) any later version.
#
# This library is distributed in the hope that it w... | gpl-2.0 |
sodafree/backend | build/selenium/build/lib.linux-i686-2.7/selenium/webdriver/support/event_firing_webdriver.py | 23 | 12550 | #!/usr/bin/python
#
# Copyright 2011 Software Freedom Conservancy.
#
# 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 ap... | bsd-3-clause |
alexzoo/python | selenium_tests/env/lib/python3.6/site-packages/pip/_vendor/packaging/version.py | 1151 | 11556 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... | apache-2.0 |
Bloodyaugust/pongsugarlabcpp | lib/boost/libs/python/test/shared_ptr.py | 12 | 2147 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from shared_ptr_ext import *
Test that shared_ptr<Derived> can be converted to shared_ptr<Base>
>>> Y.store(YYY(42... | gpl-2.0 |
eayunstack/neutron | neutron/tests/unit/agent/test_securitygroups_rpc.py | 1 | 132193 | # Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | apache-2.0 |
aptrishu/coala-bears | bears/rest/RSTcheckBear.py | 4 | 2426 | from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.settings.Setting import typed_list
@linter(executable='rstcheck',
use_stdout=False,
use_stderr=True,... | agpl-3.0 |
evamwangi/bc-7-Todo_List | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
fluxcapacitor/source.ml | jupyterhub.ml/notebooks/train_deploy/zz_under_construction/zz_old/TensorFlow/GoogleTraining/workshop_sections/mnist_series/mnist_cnn/mnist_cnn_estim_layers.py | 3 | 4255 | #!/usr/bin/env python
# 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 ... | apache-2.0 |
junhuac/MQUIC | src/build/config/ios/ios_sdk.py | 3 | 1904 | # 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 os
import subprocess
import sys
# This script prints information about the build system, the operating
# system and the iOS SDK (depending on the pla... | mit |
jindongh/boto | boto/cognito/identity/layer1.py | 135 | 24701 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
jorilallo/coinbase-python | coinbase/auth.py | 1 | 1210 | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import hashlib
import hmac
import time
from requests.auth import AuthBase
class HMACAuth(AuthBase):
def __init__(self, api_key, api_secret):
self.... | mit |
petricm/DIRAC | Interfaces/scripts/dirac-wms-job-submit.py | 3 | 2275 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-wms-job-submit
# Author : Stuart Paterson
########################################################################
"""
Submit jobs to DIRAC WMS
"""
from __future__ import print_function
__RCSI... | gpl-3.0 |
fafaman/django | tests/many_to_one_null/tests.py | 142 | 6484 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Car, Driver, Reporter
class ManyToOneNullTests(TestCase):
def setUp(self):
# Create a Reporter.
self.r = Reporter(name='John Smith')
self.r.save()
# Create an Article.
se... | bsd-3-clause |
nugget/home-assistant | tests/components/google_assistant/test_google_assistant.py | 2 | 12783 | """The tests for the Google Assistant component."""
# pylint: disable=protected-access
import asyncio
import json
from aiohttp.hdrs import CONTENT_TYPE, AUTHORIZATION
import pytest
from homeassistant import core, const, setup
from homeassistant.components import (
fan, cover, light, switch, lock, async_setup, med... | apache-2.0 |
drawks/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_tags.py | 17 | 9237 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# (c) 2017, Yaacov Zamir <yzamir@redhat.com>
# 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
ANS... | gpl-3.0 |
chubbymaggie/reverse | plasma/lib/fileformat/pe.py | 4 | 7471 | #!/usr/bin/env python3
#
# PLASMA : Generate an indented asm code (pseudo-C) with colored syntax.
# Copyright (C) 2015 Joel
#
# 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 ... | gpl-3.0 |
rowemoore/odoo | addons/product_margin/wizard/__init__.py | 444 | 1078 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
drxaero/calibre | src/calibre/gui2/dialogs/opml.py | 14 | 5424 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
from collections import defaultdict, namedtuple
from operator import itemget... | gpl-3.0 |
timorieber/wagtail | wagtail/contrib/postgres_search/tests/test_backend.py | 14 | 7353 | from django.test import TestCase
from wagtail.search.tests.test_backends import BackendTests
from wagtail.tests.search import models
from ..utils import BOOSTS_WEIGHTS, WEIGHTS_VALUES, determine_boosts_weights, get_weight
class TestPostgresSearchBackend(BackendTests, TestCase):
backend_path = 'wagtail.contrib.p... | bsd-3-clause |
jacobmetrick/Flexget | flexget/tests/test_pluginapi.py | 9 | 2893 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import os
import glob
import pytest
from flexget import plugin, plugins
from flexget.event import event, fire_event
@pytest.mark.chdir
class TestPluginApi(object):
... | mit |
mattias-ohlsson/anaconda | pyanaconda/iw/filter_gui.py | 2 | 33205 | #
# Storage filtering UI
#
# Copyright (C) 2009 Red Hat, Inc.
# All rights reserved.
#
# 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 2 of the License, or
# (at your option) any... | gpl-2.0 |
sk-yoh/qiaoy-byte | lib/werkzeug/wrappers.py | 298 | 76131 | # -*- coding: utf-8 -*-
"""
werkzeug.wrappers
~~~~~~~~~~~~~~~~~
The wrappers are simple request and response objects which you can
subclass to do whatever you want them to do. The request object contains
the information transmitted by the client (webbrowser) and the response
object contains al... | apache-2.0 |
bricky/xbmc-addon-tvtumbler | resources/lib/unidecode/x0d1.py | 253 | 4767 | data = (
'tyal', # 0x00
'tyalg', # 0x01
'tyalm', # 0x02
'tyalb', # 0x03
'tyals', # 0x04
'tyalt', # 0x05
'tyalp', # 0x06
'tyalh', # 0x07
'tyam', # 0x08
'tyab', # 0x09
'tyabs', # 0x0a
'tyas', # 0x0b
'tyass', # 0x0c
'tyang', # 0x0d
'tyaj', # 0x0e
'tyac', # 0x0f
'tyak', # ... | gpl-3.0 |
rolandovillca/python_basis | function_python/defaultdict_example.py | 4 | 3025 | from collections import defaultdict
# EXAMPLE 1: using int as parameter:
# ==============================================================================
mississippi = 'mississippi'
d = defaultdict(int)
for key in mississippi:
d[key] += 1
print 'Example 1:'
print d.items()
print
# EXAMPLE 2: Using list as parame... | mit |
mogoweb/webkit_for_android5.1 | webkit/Tools/Scripts/webkitpy/style/checkers/changelog.py | 15 | 3171 | #!/usr/bin/env python
#
# Copyright (C) 2011 Patrick Gansterer <paroga@paroga.com>
#
# 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, thi... | apache-2.0 |
mbr0wn/gnuradio | gr-blocks/python/blocks/msg_meta_to_pair.py | 9 | 2209 | #!/usr/bin/env python
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr
import pmt
class meta_to_pair(gr.sync_block):
"""
This block converts a metadata dictionary item to a pmt pair that is
compat... | gpl-3.0 |
okwow123/djangol2 | allauth/socialaccount/templatetags/socialaccount.py | 6 | 3209 | from django import VERSION as DJANGO_VERSION, template
from django.template.defaulttags import token_kwargs
from allauth.compat import template_context_value
from allauth.socialaccount import providers
from allauth.utils import get_request_param
register = template.Library()
if DJANGO_VERSION < (1, 9):
simple_... | mit |
d40223223/2015cdbg6team0622 | static/Brython3.1.1-20150328-091302/Lib/queue.py | 818 | 8835 | '''A multi-producer, multi-consumer queue.'''
try:
import threading
except ImportError:
import dummy_threading as threading
from collections import deque
from heapq import heappush, heappop
try:
from time import monotonic as time
except ImportError:
from time import time
__all__ = ['Empty', 'Full', 'Q... | gpl-3.0 |
0x0all/scikit-learn | examples/model_selection/plot_validation_curve.py | 21 | 1822 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
jonparrott/gcloud-python | automl/google/cloud/automl_v1beta1/gapic/auto_ml_client_config.py | 3 | 3605 | config = {
"interfaces": {
"google.cloud.automl.v1beta1.AutoMl": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retr... | apache-2.0 |
JIC-Image-Analysis/semi-automated-leaf-segmentation | scripts/sketch_cell_walls.py | 1 | 2169 | """Script to produce a sketch of the cell walls.
The intent is that this sketch is manually curated.
The curated cell outline can then be fed into
another script for calculating cell areas.
"""
import os
import logging
import argparse
from jicbioimage.core.image import Image
from jicbioimage.core.io import AutoName,... | mit |
gvanhorn38/multibox | detect.py | 1 | 19516 | """
Compute object proposals on images.
"""
import argparse
import cPickle as pickle
import json
import logging
import numpy as np
import os
import pprint
import sys
import tensorflow as tf
import tensorflow.contrib.slim as slim
import time
from config import parse_config_file
import model
def extract_patches(ima... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.