repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
googleapis/python-api-core | tests/unit/test_client_info.py | 1 | 2488 | # Copyright 2017 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, s... | apache-2.0 |
axitkhurana/stem | stem/connection.py | 4 | 41301 | # Copyright 2011-2013, Damian Johnson
# See LICENSE for licensing information
"""
Functions for connecting and authenticating to the tor process.
The :func:`~stem.connection.connect_port` and
:func:`~stem.connection.connect_socket_file` functions give an easy, one line
method for getting an authenticated control conn... | lgpl-3.0 |
aam-at/tensorflow | tensorflow/python/profiler/profiler_v2.py | 2 | 7483 | # Copyright 2020 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... | apache-2.0 |
ItsCalebJones/SpaceLaunchNow-Server | api/v330/spacestation/views.py | 1 | 1860 | from rest_framework.viewsets import ModelViewSet
from rest_framework.filters import SearchFilter, OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
from api.models import *
from api.permission import HasGroupPermission
from api.v330.spacestation.serializers import SpaceStationDetailedSeriali... | apache-2.0 |
amenonsen/ansible | lib/ansible/modules/database/postgresql/postgresql_privs.py | 7 | 40322 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
manazhao/tf_recsys | tensorflow/python/kernel_tests/rnn_test.py | 37 | 23985 | # 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... | apache-2.0 |
luan-th-nguyen/seisflows_ndt | seisflows/config.py | 1 | 6784 |
import copy_reg
import imp
import os
import re
import sys
import types
from importlib import import_module
from os.path import abspath, join, exists
from seisflows.tools import msg
from seisflows.tools.err import ParameterError
from seisflows.tools import unix
from seisflows.tools.tools import loadjson, loadobj, loa... | bsd-2-clause |
forge33/CouchPotatoServer | libs/daemon.py | 102 | 3610 | #!/usr/bin/env python
from signal import SIGTERM
import sys
import os
import time
import atexit
class Daemon():
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, stdin = '/dev/null', stdout = '/dev/null', stderr = '/dev/null... | gpl-3.0 |
pritamsamadder048/libforensics | code/lf/win/shell/objects.py | 13 | 4265 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 License, or
# (at your option) any later ver... | lgpl-3.0 |
kemalakyol48/python-for-android | python-modules/twisted/twisted/cred/portal.py | 60 | 5349 | # -*- test-case-name: twisted.test.test_newcred -*-
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The point of integration of application and authentication.
"""
from twisted.internet import defer
from twisted.internet.defer import maybeDeferred
from twisted.python import fai... | apache-2.0 |
jumpstarter-io/horizon | openstack_dashboard/dashboards/project/routers/extensions/routerrules/views.py | 18 | 2302 | # Copyright 2013, Big Switch 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 by applicable law ... | apache-2.0 |
lawzou/shoop | shoop/core/models/product_variation.py | 2 | 8923 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
import hashlib
import itertools
fro... | agpl-3.0 |
AndKe/MAVProxy | MAVProxy/modules/mavproxy_HIL.py | 24 | 5670 | #!/usr/bin/env python
'''
HIL module
Andrew Tridgell
December 2012
This interfaces to Tools/autotest/jsbsim/runsim.py to run the JSBSim flight simulator
'''
import sys, os, time, socket, errno, struct, math
from math import degrees, radians
from MAVProxy.modules.lib import mp_module
from pymavlink import mavutil
cla... | gpl-3.0 |
cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py | 1 | 38185 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | gpl-3.0 |
shaufi/odoo | addons/base_vat/__init__.py | 440 | 1081 | # -*- 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 GNU... | agpl-3.0 |
brendandburns/tensorflow | tensorflow/g3doc/tutorials/mnist/mnist_softmax.py | 2 | 1055 | """A very simple MNIST classifer.
See extensive documentation at
http://tensorflow.org/tutorials/mnist/beginners/index.md
"""
from __future__ import print_function
# Import data
import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
import tensorflow as tf
sess = tf.InteractiveSession()
# C... | apache-2.0 |
seem-sky/kbengine | kbe/res/scripts/common/Lib/xdrlib.py | 98 | 5381 | """Implements (a subset of) Sun XDR -- eXternal Data Representation.
See: RFC 1014
"""
import struct
from io import BytesIO
__all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
# exceptions
class Error(Exception):
"""Exception class for this module. Use:
except xdrlib.Error as var:
# var h... | lgpl-3.0 |
saydulk/django | tests/model_formsets_regress/models.py | 281 | 1226 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class User(models.Model):
username = models.CharField(max_length=12, unique=True)
serial = models.IntegerField()
class UserSite(models.Model):
user = models.ForeignKey(User, models.CASCADE, to_field="username")
... | bsd-3-clause |
sliz1/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/utils.py | 982 | 2545 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
__all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair",
"surrogatePairTo... | mpl-2.0 |
yetsky/extra | packages/my-application/python-all/files/usr/lib/python2.7/symtable.py | 68 | 7437 | """Interface to the compiler's internal symbol tables"""
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, OPT_IMPORT_STAR, OPT_EXEC, OPT_BARE_EXEC,
SCOPE_OFF, SCOPE_MASK, FREE, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL, LOCAL)
import weakref
__all__ = ["sym... | gpl-2.0 |
AloneRoad/Inforlearn | vendor/django/utils/feedgenerator.py | 17 | 14201 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title=u"Poynter E-Media Tidbits",
... link=u"http://www.poynter.org/column.asp?id=31",
... description=u"A group weblog by the shar... | apache-2.0 |
akhileshtechila/AffiliateWebservice | vendor/doctrine/orm/docs/en/_exts/configurationblock.py | 2577 | 3506 | #Copyright (c) 2010 Fabien Potencier
#
#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, merge, publish, distrib... | mit |
ChristophKirst/ClearMap | ClearMap/IO/NRRD.py | 1 | 20940 | #!/usr/bin/env python
# encoding: utf-8
"""
Interface to NRRD volumetric image data files.
The interface is based on nrrd.py, an all-python (and numpy)
implementation for reading and writing nrrd files.
See http://teem.sourceforge.net/nrrd/format.html for the specification.
Example:
>>> import os, numpy
>>> ... | gpl-3.0 |
Sonicbids/django | tests/middleware_exceptions/tests.py | 4 | 43526 | import sys
from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template.response import TemplateResponse
from django.template import engines
from django.test import RequestFactory, T... | bsd-3-clause |
atgeirr/opm-common | python/pybind11/tests/test_modules.py | 31 | 2376 | from pybind11_tests import modules as m
from pybind11_tests.modules import subsubmodule as ms
from pybind11_tests import ConstructorStats
def test_nested_modules():
import pybind11_tests
assert pybind11_tests.__name__ == "pybind11_tests"
assert pybind11_tests.modules.__name__ == "pybind11_tests.modules"
... | gpl-3.0 |
iradul/phantomjs-clone | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/pulseaudio_sanitizer_mock.py | 125 | 1666 | # Copyrigth (C) 2013 Zan Dobersek <zandobersek@gmail.com>
#
# 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 of conditions and ... | bsd-3-clause |
alexlo03/ansible | lib/ansible/modules/remote_management/ucs/ucs_vlans.py | 64 | 6941 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
weidongxu84/info-gatherer | django/contrib/auth/tests/models.py | 1 | 3906 | from django.conf import settings
from django.test import TestCase
from django.contrib.auth.models import (Group, User,
SiteProfileNotAvailable, UserManager)
class ProfileTestCase(TestCase):
fixtures = ['authtestdata.json']
def setUp(self):
"""Backs up the AUTH_PROFILE_MODULE"""
self.old_A... | mit |
powerlim2/project_free_insight | data_api/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | bsd-3-clause |
rplevka/robottelo | tests/foreman/cli/test_katello_agent.py | 1 | 11216 | """CLI tests for ``katello-agent``.
:Requirement: Host
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: Katello-agent
:Assignee: gtalreja
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import time
import pytest
from broker import VMBroker
from robottelo.api.utils import wait_for... | gpl-3.0 |
dgoodwin/origin | cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py | 137 | 5613 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
jbzdak/edx-platform | common/lib/xmodule/xmodule/modulestore/mongo/base.py | 4 | 82145 | """
Modulestore backed by Mongodb.
Stores individual XModules as single documents with the following
structure:
{
'_id': <location.as_dict>,
'metadata': <dict containing all Scope.settings fields>
'definition': <dict containing all Scope.content fields>
'definition.children': <list of all child locati... | agpl-3.0 |
seanfisk/buzzword-bingo-server | django/contrib/localflavor/generic/forms.py | 514 | 2160 | from django import forms
DEFAULT_DATE_INPUT_FORMATS = (
'%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06'
'%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006'
'%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006'
'%B %d %Y', '%B %d, %Y', ... | bsd-3-clause |
mdevaev/slog | src/remote.py | 1 | 1202 | # -*- mode: python; coding: utf-8; -*-
import dbus
import dbus.service, dbus.mainloop.glib
class Remote:
def __init__(self):
bus = dbus.SessionBus()
slog_obj = bus.get_object("org.LightLang.SLog", "/SLog")
self.iface = dbus.Interface(slog_obj, "org.LightLang.SLogInterface")
def __spy_toggle(self):
self.if... | gpl-2.0 |
jmontoyam/mne-python | mne/simulation/tests/test_source.py | 8 | 8770 | import os.path as op
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal
from nose.tools import assert_true, assert_raises, assert_equal
from mne.datasets import testing
from mne import read_label, read_forward_solution, pick_types_forward
from mne.label import Label
from mne.si... | bsd-3-clause |
Russell-IO/ansible | test/runner/lib/cover.py | 22 | 7315 | """Code coverage utilities."""
from __future__ import absolute_import, print_function
import os
import re
from lib.target import (
walk_module_targets,
walk_compile_targets,
)
from lib.util import (
display,
ApplicationError,
run_command,
common_environment,
)
from lib.config import (
C... | gpl-3.0 |
goern/origin | cmd/cluster-capacity/go/src/github.com/kubernetes-incubator/cluster-capacity/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-e2e/reactive/kubernetes_e2e.py | 50 | 6058 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
CuonDeveloper/cuon | cuon_client/cuon_newclient/bin/cuon/PrefsFinance/prefsFinance.py | 2 | 16706 | # -*- coding: utf-8 -*-
##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne]
##This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as
##published by the Free Software Foundation; either version 3 of the License, or (at your option) any later versio... | gpl-3.0 |
bguillot/OpenUpgrade | addons/website_crm/controllers/main.py | 20 | 3787 | # -*- coding: utf-8 -*-
import base64
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp import SUPERUSER_ID
import werkzeug.urls
class contactus(http.Controller):
def generate_google_map_url(self, street, city, city_zip, country_name):
url = "http://maps.googl... | agpl-3.0 |
alfredgamulo/cloud-custodian | tools/c7n_gcp/c7n_gcp/filters/sccfindings.py | 2 | 3341 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
"""
Security Command Center Findings suppport for GCP resources
"""
from c7n.filters.core import ValueFilter
from c7n.utils import local_session, type_schema
from c7n_gcp.provider import resources as gcp_resources
class SecurityComandCente... | apache-2.0 |
andyfaff/scipy | scipy/interpolate/tests/test_interpnd.py | 12 | 13626 | import os
import numpy as np
from numpy.testing import (assert_equal, assert_allclose, assert_almost_equal,
suppress_warnings)
from pytest import raises as assert_raises
import pytest
import scipy.interpolate.interpnd as interpnd
import scipy.spatial.qhull as qhull
import pickle
def data... | bsd-3-clause |
ovnicraft/server-tools | base_locale_uom_default/tests/test_res_lang.py | 1 | 1605 | # -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError
class TestResLang(TransactionCase):
def setUp(self):
super(TestResLang, self).setUp()
se... | agpl-3.0 |
matk86/pymatgen | pymatgen/symmetry/tests/test_groups.py | 8 | 6297 | #!/usr/bin/env python
from __future__ import division
import unittest
import numpy as np
import warnings
from pymatgen.core.lattice import Lattice
from pymatgen.core.operations import SymmOp
from pymatgen.symmetry.groups import PointGroup, SpaceGroup
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The ... | mit |
dhalleine/tensorflow | tensorflow/python/ops/nn_batchnorm_test.py | 3 | 23420 | # 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... | apache-2.0 |
jennyzhang0215/incubator-mxnet | python/mxnet/module/base_module.py | 27 | 42930 | # 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... | apache-2.0 |
w1ll1am23/home-assistant | tests/components/bond/test_cover.py | 5 | 4226 | """Tests for the Bond cover device."""
from datetime import timedelta
from bond_api import Action, DeviceType
from homeassistant import core
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_CLOSE_COVER,
SERVICE_OPEN_COVER,
SERV... | apache-2.0 |
Lab603/PicEncyclopedias | jni-build/jni-build/jni/include/tensorflow/contrib/factorization/python/ops/gmm_test.py | 4 | 6387 | # 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... | mit |
jabumaho/MNIST-neural-network | network.py | 1 | 3424 | import numpy as np
def sgm(x, derivative=False):
if not derivative:
return 1/(1+np.exp(-x))
else:
return sgm(x) * (1 - sgm(x))
def linear(x, derivative=False):
if not derivative:
return x
else:
return 1
class NeuralNetwork:
layerCount = 0
shape = None
weights = []
layerTransfe... | gpl-3.0 |
danclaudiupop/pyhackernews | hn/core.py | 1 | 6927 | import os
import urwid
import subprocess
import ConfigParser
from hnapi import HN
from datetime import datetime
_config = None
class HNStory(object):
def __init__(self, i, story):
self.index = i + 1
self.story = story
@property
def story_number(self):
index = str(self.index)
... | mit |
kostajaitachi/shogun | examples/undocumented/python_modular/kernel_weighted_comm_word_string_modular.py | 26 | 1407 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_dna('../data/fm_train_dna.dat')
testdat = lm.load_dna('../data/fm_test_dna.dat')
parameter_list = [[traindat,testdat],[traindat,testdat]]
def kernel_weighted_comm_word_string_modular (fm_train_dna=traindat,fm_test_dna=testdat,o... | gpl-3.0 |
arulalant/mmDiagnosis | diagnosis1/extra/dirty/MULTIPLE PLOTS/por_landscape_2x3.py | 1 | 2203 | import cdms2
import cdutil
import numpy
import numpy.ma
import vcs
import os
import sys
import por_template_2x3_landscape as por_lanscape_2x3
x = por_lanscape_2x3.x
iso=x.createisofill('new1', 'ASD')
iso.levels = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
#([1, 5, 10, 15, 20, 25, 35, 45, 55, 60, 65, 70, 80])
#is... | gpl-3.0 |
viru/ansible | lib/ansible/plugins/action/assert.py | 163 | 2353 | # Copyright 2012, Dag Wieers <dag@wieers.com>
#
# 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 versi... | gpl-3.0 |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/sympy/solvers/tests/test_recurr.py | 5 | 6985 | from sympy import Eq, factorial, Function, Lambda, rf, S, sqrt, symbols, I, expand_func, binomial, gamma
from sympy.solvers.recurr import rsolve, rsolve_hyper, rsolve_poly, rsolve_ratio
from sympy.utilities.pytest import raises
from sympy.abc import a, b, c
y = Function('y')
n, k = symbols('n,k', integer=True)
C0, C1,... | gpl-3.0 |
mjirayu/sit_academy | lms/djangoapps/courseware/management/commands/clean_xml.py | 62 | 4192 | import lxml.etree
import os
import sys
import traceback
from fs.osfs import OSFS
from path import path
from django.core.management.base import BaseCommand
from xmodule.modulestore.xml import XMLModuleStore
def traverse_tree(course):
"""Load every descriptor in course. Return bool success value."""
queue =... | agpl-3.0 |
boooka/GeoPowerOff | venv/lib/python2.7/site-packages/pip/commands/completion.py | 538 | 1838 | import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
COMP_CWORD=$COMP_CWORD \\
... | apache-2.0 |
codrut3/tensorflow | tensorflow/python/debug/lib/debug_data.py | 14 | 59159 | # 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... | apache-2.0 |
echanna/EdxNotAFork | common/djangoapps/util/tests/test_json_request.py | 56 | 2287 | from django.http import HttpResponse
from util.json_request import JsonResponse
import json
import unittest
import mock
class JsonResponseTestCase(unittest.TestCase):
def test_empty(self):
resp = JsonResponse()
self.assertIsInstance(resp, HttpResponse)
self.assertEqual(resp.content, "")
... | agpl-3.0 |
Mhynlo/SickRage | lib/babelfish/data/get_files.py | 68 | 1554 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 the BabelFish authors. All rights reserved.
# Use of this source code is governed by the 3-clause BSD license
# that can be found in the LICENSE file.
#
from __future__ import unicode_literals
import os.path
import tempfile
import zipfile
import reque... | gpl-3.0 |
cedricpradalier/vrep_ros_ws | src/ar_loc_base/src/ar_loc_base/rover_pf.py | 1 | 4147 | import roslib; roslib.load_manifest('ar_loc_base')
import rospy
from numpy import *
from numpy.linalg import pinv, inv
from math import pi, sin, cos
from geometry_msgs.msg import *
import tf
import bisect
import threading
from rover_kinematics import *
class RoverPF(RoverKinematics):
def __init__(self, initial_po... | bsd-3-clause |
agrc/deq-enviro | api/Deq.Search.Soe/PublishSoe.py | 1 | 1322 | import requests
host = 'localhost'
configuration = 'Debug'
service_name = 'DEQEnviro/MapService'
token_url = 'http://{}:6080/arcgis/admin/generateToken'.format(host)
update_soe_url = 'http://{}:6080/arcgis/admin/services/types/extensions/update'.format(
host)
upload_url = 'http://{}:6080/arcgis/admin/uploads/uplo... | mit |
ivanhorvath/openshift-tools | openshift/installer/vendored/openshift-ansible-3.11.28-1/roles/lib_openshift/src/test/unit/test_oc_label.py | 82 | 9672 | '''
Unit tests for oc label
'''
import os
import six
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b/c our libraries aren't loaded in jenkins
# pylint: disable=import-error
# p... | apache-2.0 |
TheSimoms/Felleshoelet | spotifyconnector/venv/lib/python3.6/site-packages/flask/templating.py | 3 | 4939 | # -*- coding: utf-8 -*-
"""
flask.templating
~~~~~~~~~~~~~~~~
Implements the bridge to Jinja2.
:copyright: 2010 Pallets
:license: BSD-3-Clause
"""
from jinja2 import BaseLoader
from jinja2 import Environment as BaseEnvironment
from jinja2 import TemplateNotFound
from .globals import _app_ctx_stac... | gpl-2.0 |
Qgap/zulip | zerver/test_decorators.py | 115 | 5293 | # -*- coding: utf-8 -*-
from django.test import TestCase
from zerver.decorator import \
REQ, has_request_variables, RequestVariableMissingError, \
RequestVariableConversionError, JsonableError
from zerver.lib.validator import (
check_string, check_dict, check_bool, check_int, check_list
)
import ujson
cl... | apache-2.0 |
nkhuyu/blaze | blaze/partition.py | 17 | 3179 | """ Abstraction around partitionable data
Some data can be partitioned into disjoint pieces.
Examples include lists, tuples, and arrays of various flavors.
This module provides functions to abstract away the handling of such
partitions. It proposes three operations, each of these operations deals with
data (like a n... | bsd-3-clause |
debkbanerji/super-mem | ocrtest/myenv/lib/python2.7/site-packages/setuptools/command/test.py | 130 | 8816 | import os
import operator
import sys
import contextlib
import itertools
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader
import six
from six.moves import map, filter
from pkg_resources import (resource_listdir, resource_exists, normalize_path,... | mit |
Gustry/QGIS | tests/src/python/test_qgsattributeform.py | 30 | 3752 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the attribute form
Run with ctest -V -R PyQgsAttributeForm
.. note:: 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, ... | gpl-2.0 |
ojengwa/django-1 | django/contrib/gis/db/models/query.py | 56 | 36394 | import warnings
from django.contrib.gis.db.models import aggregates
from django.contrib.gis.db.models.fields import (
GeometryField, LineStringField, PointField, get_srid_info,
)
from django.contrib.gis.db.models.lookups import GISLookup
from django.contrib.gis.db.models.sql import (
AreaField, DistanceField, ... | bsd-3-clause |
nblago/utils | src/model/BBFit.py | 1 | 66521 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 22 10:57:34 2018
Class that enables to fit a black body function to a set of magntidues.
@author: nadiablago
@version: 0.22
"""
from __future__ import print_function
import matplotlib
from matplotlib import pylab as plt
import corner
from astropy import units as u
impo... | mit |
serghei/kde3-kdeutils | superkaramba/examples/control_management/mgmt.py | 4 | 1338 | #
# Written by Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#this import statement allows access to the karamba functions
import karamba
do_nothing_txt = None
mgmt_txt = None
#this is called when you widget is initialized
def initWidget(widget):
global do_nothing_txt
global do_something_txt
# display new messa... | gpl-2.0 |
Dino0631/RedRain-Bot | cogs/lib/youtube_dl/extractor/reverbnation.py | 64 | 1627 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
qualities,
str_or_none,
)
class ReverbNationIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?reverbnation\.com/.*?/song/(?P<id>\d+).*?$'
_TESTS = [{
'url': 'http://www.reverbnation.com/alkilad... | gpl-3.0 |
Jericho/deep-learning | image-classification/helper.py | 155 | 5631 | import pickle
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelBinarizer
def _load_label_names():
"""
Load the label names from file
"""
return ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
def load_cfar10_batch(ci... | mit |
sjperkins/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/models/hard_decisions_to_data_then_nn.py | 189 | 2852 | # 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... | apache-2.0 |
ptoraskar/django | tests/urlpatterns_reverse/middleware.py | 386 | 1050 | from django.core.urlresolvers import reverse
from django.http import HttpResponse, StreamingHttpResponse
from . import urlconf_inner
class ChangeURLconfMiddleware(object):
def process_request(self, request):
request.urlconf = urlconf_inner.__name__
class NullChangeURLconfMiddleware(object):
def pro... | bsd-3-clause |
40223137/cdag7test37 | static/Brython3.1.1-20150328-091302/Lib/difflib.py | 737 | 82544 | #! /usr/bin/env python3
"""
Module difflib -- helpers for computing deltas between objects.
Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
Use SequenceMatcher to return list of the best "good enough" matches.
Function context_diff(a, b):
For two lists of strings, return a delta in context ... | gpl-3.0 |
bristy/login_app_flask | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/__init__.py | 745 | 1295 | ######################## BEGIN LICENSE BLOCK ########################
# 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 ve... | mit |
40223144/w16b_test | static/Brython3.1.3-20150514-095342/Lib/contextlib.py | 737 | 8788 | """Utilities for with-statement contexts. See PEP 343."""
import sys
from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"]
class ContextDecorator(object):
"A base class or mixin that enables context managers to work as decorators."
... | agpl-3.0 |
thakkarparth007/fabric | bddtests/msp/identities_pb2.py | 12 | 3006 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: msp/identities.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as... | apache-2.0 |
vnsofthe/odoo | addons/sale_order_dates/__init__.py | 441 | 1071 | # -*- 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 GNU... | agpl-3.0 |
40223143/cda-w15 | static/Brython3.1.3-20150514-095342/Lib/unittest/test/testmock/testwith.py | 739 | 5806 | import unittest
from warnings import catch_warnings
from unittest.test.testmock.support import is_instance
from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call
something = sentinel.Something
something_else = sentinel.SomethingElse
class WithTest(unittest.TestCase):
def test_with_sta... | agpl-3.0 |
stacywsmith/ansible | lib/ansible/module_utils/dellos6.py | 21 | 8111 |
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still ... | gpl-3.0 |
songmonit/CTTMSONLINE | addons/account/wizard/account_report_account_balance.py | 378 | 1741 | # -*- 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 GNU... | agpl-3.0 |
qk4l/Flexget | flexget/tests/test_thetvdb.py | 7 | 18812 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.utils import PY3
import re
from datetime import datetime, timedelta
import mock
import pytest
from flexget.manager import Session
from... | mit |
mattstep/ansible-modules-core | cloud/azure/azure.py | 92 | 24105 | #!/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 distributed... | gpl-3.0 |
shangwuhencc/shogun | examples/undocumented/python_modular/graphical/converter_sobi_bss.py | 26 | 1089 | """
Blind Source Separation using the SOBI Algorithm with Shogun
Based on the example from scikit-learn
http://scikit-learn.org/
Kevin Hughes 2013
"""
import numpy as np
import pylab as pl
from modshogun import RealFeatures
from modshogun import SOBI
# Generate sample data
np.random.seed(0)
n_samples = 2000
time... | gpl-3.0 |
vadimtk/chrome4sdp | tools/gn/bin/help_as_html.py | 105 | 3135 | #!/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.
# Runs 'gn help' and various subhelps, and spits out html.
# TODO:
# - Handle numbered and dashed lists -> <ol> <ul>. (See "os" and "to... | bsd-3-clause |
sestrella/ansible | lib/ansible/modules/cloud/amazon/aws_ses_identity_policy.py | 7 | 7466 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
vmanoria/bluemix-hue-filebrowser | hue-3.8.1-bluemix/desktop/core/ext-py/pyopenssl/doc/tools/toc2bkm.py | 41 | 3965 | #! /usr/bin/env python
"""Convert a LaTeX .toc file to some PDFTeX magic to create that neat outline.
The output file has an extension of '.bkm' instead of '.out', since hyperref
already uses that extension.
"""
import getopt
import os
import re
import string
import sys
# Ench item in an entry is a tuple of:
#
# ... | gpl-2.0 |
zhouyejoe/spark | python/pyspark/join.py | 149 | 3994 | """
Copyright (c) 2011, Douban Inc. <http://www.douban.com/>
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 of con... | apache-2.0 |
disco-framework/disco | priv/general/components/gui/gui.py | 1 | 18070 | #!/usr/bin/python
import sys
from PyQt4 import QtCore, QtGui
from ui_mainview import Ui_MainWindow
import json
from jsonreader import JsonReader
##################################################
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, pare... | apache-2.0 |
jimmida/incubator-hawq | tools/bin/ext/figleaf/__init__.py | 35 | 8016 | """
figleaf is another tool to trace Python code coverage.
figleaf uses the sys.settrace hook to record which statements are
executed by the CPython interpreter; this record can then be saved
into a file, or otherwise communicated back to a reporting script.
figleaf differs from the gold standard of Python coverage t... | apache-2.0 |
pilou-/ansible | lib/ansible/modules/network/f5/bigip_monitor_gateway_icmp.py | 38 | 26253 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
au9ustine/elrond | elrond/aws/s3.py | 1 | 3432 | import os
import json
import threading
import boto3
from boto3.s3.transfer import S3Transfer
from elrond.crypto import get_file_digest
DEFAULT_CHUNK_SIZE = 64 * 1024 * 1024
ELROND_S3_SINGLETON_CLIENT = None
ELROND_S3_SUPPORTED_REGIONS = [
'EU',
'eu-west-1',
'us-west-1',
'us-west-2',
'ap-south-1'... | mit |
cerrno/neurokernel | examples/timing/run_gpu_slow.py | 2 | 1898 | #!/usr/bin/env python
"""
Run timing test (GPU) scaled over number of ports.
"""
import csv
import glob
import multiprocessing as mp
import os
import re
import subprocess
import sys
import numpy as np
from neurokernel.tools.misc import get_pids_open
try:
from subprocess import DEVNULL
except ImportError:
i... | bsd-3-clause |
fenglu-g/incubator-airflow | tests/contrib/executors/test_mesos_executor.py | 21 | 3748 | # -*- 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
#... | apache-2.0 |
ging/horizon | openstack_dashboard/dashboards/admin/networks/ports/tables.py | 9 | 4004 | # Copyright 2012 NEC Corporation
#
# 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... | apache-2.0 |
anjalisood/spark-tk | regression-tests/generatedata/graph_generator.py | 8 | 1635 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
pybrain/pybrain | pybrain/supervised/trainers/mixturedensity.py | 25 | 3420 | # $Id$
__author__ = 'Martin Felder'
import numpy as np
from pybrain.supervised.trainers import RPropMinusTrainer, BackpropTrainer
from pybrain.structure.modules.mixturedensity import MixtureDensityLayer
def gaussian(x, mean, stddev):
""" return value of homogenous Gaussian at given vector point
x: vector, me... | bsd-3-clause |
randynobx/ansible | lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py | 41 | 17614 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@gmail.com>
#
# 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... | gpl-3.0 |
newsapps/django-boundaryservice | boundaryservice/models.py | 3 | 5557 | import re
from django.contrib.gis.db import models
from boundaryservice.fields import ListField, JSONField
from boundaryservice.utils import get_site_url_root
class SluggedModel(models.Model):
"""
Extend this class to get a slug field and slug generated from a model
field. We call the 'get_slug_text', '__... | mit |
antonioUnina/neutron | neutron/api/v2/resource.py | 12 | 7099 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.