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 |
|---|---|---|---|---|---|
fkie/rosrepo | src/rosrepo/ui.py | 1 | 12256 | # coding=utf-8
#
# ROSREPO
# Manage ROS workspaces with multiple Gitlab repositories
#
# Author: Timo Röhling
#
# Copyright 2016 Fraunhofer FKIE
#
# 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 a... | apache-2.0 |
ifduyue/sentry | tests/sentry/api/endpoints/test_project_processingissues.py | 2 | 4420 | from __future__ import absolute_import
from datetime import datetime
from django.utils import timezone
from django.core.urlresolvers import reverse
from sentry.models import (ProcessingIssue, EventError, RawEvent, EventProcessingIssue)
from sentry.testutils import APITestCase
class ProjectProjectProcessingIssuesTes... | bsd-3-clause |
meghana1995/sympy | sympy/physics/quantum/__init__.py | 122 | 1501 | __all__ = []
# The following pattern is used below for importing sub-modules:
#
# 1. "from foo import *". This imports all the names from foo.__all__ into
# this module. But, this does not put those names into the __all__ of
# this module. This enables "from sympy.physics.quantum import State" to
# work.
# 2... | bsd-3-clause |
kajgan/e2 | lib/python/Components/Sensors.py | 104 | 1928 | from Components.FanControl import fancontrol
class Sensors:
# (type, name, unit, directory)
TYPE_TEMPERATURE = 0
# (type, name, unit, fanid)
TYPE_FAN_RPM = 1
def __init__(self):
# (type, name, unit, sensor_specific_dict/list)
self.sensors_list = []
self.addSensors()
def getSensorsCount(self, type = None)... | gpl-2.0 |
zaina/nova | nova/tests/functional/test_legacy_v3_compatible_wrapper.py | 7 | 1429 | # Copyright 2015 Intel Corporation.
# 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 requir... | apache-2.0 |
fmartingr/iosfu | iosfu/gui/components/base.py | 1 | 3711 | from os.path import join as join_path, dirname
from inspect import getfile
from iosfu.utils import slugify
class Component(object):
"""
Base GUI Component object
"""
# Component type, do NOT modify
_type = None
def __unicode__(self):
return self.name
# class Category(Component):
#... | mit |
simod/geonode | geonode/geoserver/context_processors.py | 5 | 2362 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 |
romulojales/estudos-golang | data science from scratch/chap1.py | 2 | 1266 | users = [
{"id": 0, "name": "Hero"},
{"id": 1, "name": "Dunn"},
{"id": 2, "name": "Sue"},
{"id": 3, "name": "Chi"},
{"id": 4, "name": "Thor"},
{"id": 5, "name": "Clive"},
{"id": 6, "name": "Hicks"},
{"id": 7, "name": "Devin"},
{"id": 8, "name": "Kate"},
{"id": 9, "name": "Klein"}... | mit |
napkindrawing/ansible | test/units/modules/network/nxos/test_nxos_system.py | 15 | 6187 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | gpl-3.0 |
dcuolfg/dcuolfg | dcuolfg/characters/views.py | 2 | 2683 | # Copyright 2012-2013 Deryck Hodge. This software is licensed under the
# GNU Lesser General Public License version 3 (see the file LICENSE).
"""
Site-wide views.
"""
from django.http import (
Http404,
HttpResponseRedirect,
)
from django.shortcuts import (
get_object_or_404,
render,
)
from django.con... | lgpl-3.0 |
wimberosa/samba | buildtools/wafadmin/Tools/cs.py | 19 | 1803 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"C# support"
import TaskGen, Utils, Task, Options
from Logs import error
from TaskGen import before, after, taskgen, feature
flag_vars= ['FLAGS', 'ASSEMBLIES']
@feature('cs')
def init_cs(self):
Utils.def_attrs(self,
flags = '',
assemblies = '',
... | gpl-3.0 |
miguelfervi/SSBW-Restaurantes | restaurantes/lib/python2.7/site-packages/django/conf/locale/zh_Hans/formats.py | 1008 | 1810 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5... | gpl-3.0 |
rezoo/chainer | chainer/functions/math/bias.py | 5 | 1529 | import chainer
from chainer.functions.array import broadcast
from chainer.functions.array import reshape
def bias(x, y, axis=1):
"""Elementwise summation with broadcasting.
Computes a elementwise summation of two input variables, with the shape of
the latter variable broadcasted to match the shape of the... | mit |
cernops/python-keystoneclient-kerberos | keystoneclient_kerberos/v3.py | 1 | 1161 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
facilecoin/facilecoin-core | qa/rpc-tests/rest.py | 1 | 3267 | #!/usr/bin/env python2
# Copyright (c) 2014 The FacileCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test REST interface
#
from test_framework import FacileCoinTestFramework
from util import *
import jso... | mit |
alvaroaleman/ansible | lib/ansible/modules/cloud/centurylink/clc_loadbalancer.py | 23 | 35423 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
snak3ater/kernel_msm | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/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 |
quru/wagtail | wagtail/wagtailsearch/migrations/0003_remove_editors_pick.py | 31 | 1292 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailsearch', '0002_add_verbose_names'),
]
operations = [
# EditorsPicks have been moved to the "wagtailsearchpromotions" module.
... | bsd-3-clause |
woodpecker1/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelog.py | 124 | 5952 | # Copyright (C) 2010 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 of conditions and th... | bsd-3-clause |
CodingCat/mxnet | tests/nightly/mxnet_keras_integration_tests/model_util.py | 43 | 2441 | # 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 |
jeffrey4l/nova | nova/api/openstack/compute/plugins/v3/server_diagnostics.py | 24 | 2604 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
TheTypoMaster/chromium-crosswalk | third_party/jinja2/loaders.py | 255 | 17027 | # -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | bsd-3-clause |
cchurch/ansible | lib/ansible/plugins/callback/counter_enabled.py | 23 | 10824 | # (c) 2018, Ivan Aragones Muniesa <ivan.aragones.muniesa@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
Counter enabled Ansible callback plugin (See DOCUMENTATION for more information)
'''
from __future__ import (absolute_import, division, print_function... | gpl-3.0 |
jefftc/changlab | Betsy/Betsy/modules/plot_prediction.py | 1 | 2613 | from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, antecedents, out_attributes, user_options, num_cores,
outfile):
from genomicode import mplgraph
from genomicode import filelib
... | mit |
CUCWD/edx-platform | common/lib/sandbox-packages/verifiers/tests_draganddrop.py | 24 | 32789 | import json
import unittest
import draganddrop
from .draganddrop import PositionsCompare
class Test_PositionsCompare(unittest.TestCase):
""" describe"""
def test_nested_list_and_list1(self):
self.assertEqual(PositionsCompare([[1, 2], 40]), PositionsCompare([1, 3]))
def test_nested_list_and_lis... | agpl-3.0 |
caelan/stripstream | stripstream/utils.py | 1 | 3736 | import os
import random
import shutil
import pickle
from random import shuffle
INF = float('inf')
SEPARATOR = '\n' + 85 * '-' + '\n'
def separator(n=85):
return '\n' + n * '-' + '\n'
def header(s, n=10):
return '\n' + n * '-' + s + n * '-' + '\n'
def set_deterministic(seed=0):
random.seed(seed)
i... | mit |
ethanrowe/python-mandrel | mandrel/test/util/file_finder_test.py | 1 | 2891 | import contextlib
import mock
import os
import unittest
from mandrel.test import utils
from mandrel import util
@contextlib.contextmanager
def scenario(**files_to_levels):
levels = []
with utils.tempdir() as a:
levels.append(a)
with utils.tempdir() as b:
levels.append(b)
... | mit |
sunsettrack4/android_kernel_oneplus_msm8996 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
Russell-IO/ansible | lib/ansible/module_utils/network/ios/ios.py | 16 | 5663 | # 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 belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
saumishr/django | tests/regressiontests/urlpatterns_reverse/tests.py | 22 | 28501 | """
Unit tests for reverse URL lookups.
"""
from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, ViewDoesNotExist
from django.core.urlresolvers import (reverse, resolve, NoReverseMatch,
Resolver404, ResolverMatch, RegexURLResolver, RegexUR... | bsd-3-clause |
jaloren/robotframework | src/robot/variables/isvar.py | 6 | 1651 | # 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
... | apache-2.0 |
SeldonIO/seldon-server | python/seldon/cli/zk_utils.py | 2 | 3835 | import json
from os import walk
import os
import sys
import errno
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else: raise
def is_json_data(data):
if (data != None) and (len(d... | apache-2.0 |
dougwig/x-neutron-lbaas | neutron_lbaas/openstack/common/cache/backends.py | 76 | 7793 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
mats116/gae-boilerplate | bp_includes/external/requests/packages/urllib3/poolmanager.py | 93 | 8976 | # urllib3/poolmanager.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
... | lgpl-3.0 |
qtproject/pyside-pyside | tests/QtCore/bug_332.py | 1 | 1615 | #!/usr/bin/python
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holdin... | lgpl-2.1 |
blueyed/pip | pip/_vendor/distlib/resources.py | 191 | 9432 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import types... | mit |
ArcherCraftStore/ArcherVMPeridot | Python/Lib/test/test_file_eintr.py | 122 | 10331 | # Written to test interrupted system calls interfering with our many buffered
# IO implementations. http://bugs.python.org/issue12268
#
# It was suggested that this code could be merged into test_io and the tests
# made to work using the same method as the existing signal tests in test_io.
# I was unable to get single... | apache-2.0 |
alistairlow/tensorflow | tensorflow/contrib/keras/api/keras/optimizers/__init__.py | 73 | 1696 | # 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 |
andmos/ansible | lib/ansible/modules/notification/rabbitmq_publish.py | 49 | 5482 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, John Imison <john+github@imison.net>
# 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 |
googleapis/googleapis-gen | google/logging/v2/logging-v2-py/google/cloud/logging_v2/services/metrics_service_v2/transports/grpc_asyncio.py | 2 | 16399 | # -*- coding: utf-8 -*-
# Copyright 2020 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... | apache-2.0 |
petosegan/scikit-learn | examples/model_selection/grid_search_digits.py | 227 | 2665 | """
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.grid_search.GridSearc... | bsd-3-clause |
jankeromnes/depot_tools | recipes/recipe_util.py | 36 | 1597 | # Copyright (c) 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.
"""This module holds utilities which make writing recipes easier."""
import json
class Recipe(object):
"""Base class for all recipes.
Provides me... | bsd-3-clause |
jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/cgi.py | 52 | 34826 | #! /usr/local/bin/python
# NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
# intentionally NOT "/usr/bin/env python". On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env w... | mit |
koparasy/faultinjection-gem5 | src/arch/x86/isa/insts/x87/arithmetic/addition.py | 29 | 2165 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# 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 implemen... | bsd-3-clause |
AlexCaranha/Wox | PythonHome/Lib/site-packages/requests/adapters.py | 293 | 14608 | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .models import Response
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
from .packages.urllib3.response impo... | mit |
okuoku/ninja | bootstrap.py | 1 | 4690 | #!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
3rdcycle/pyqtgraph | pyqtgraph/python2_3.py | 14 | 1726 | """
Helper functions that smooth out the differences between python 2 and 3.
"""
import sys
def asUnicode(x):
if sys.version_info[0] == 2:
if isinstance(x, unicode):
return x
elif isinstance(x, str):
return x.decode('UTF-8')
else:
return unicode(x)
el... | mit |
salomon1184/bite-project | deps/gdata-python-client/samples/analytics/data_feed_demo.py | 23 | 6246 | #!/usr/bin/python
#
# Copyright 2009 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... | apache-2.0 |
miciux/telegram-bot-admin | torrenthandler.py | 1 | 5064 | import logging
import abstracthandler
import transmissionrpc
import os
class TorrentHandler(abstracthandler.AbstractHandler):
def __init__(self, conf, bot):
abstracthandler.AbstractHandler.__init__(self, 'torrent', conf, bot)
self.log = logging.getLogger(__name__)
self.tc = None
se... | mit |
mcardillo55/django | django/contrib/auth/urls.py | 568 | 1036 | # The views used below are normally mapped in django.contrib.admin.urls.py
# This URLs file is used to provide a reliable view deployment for test purposes.
# It is also provided as a convenience to those who want to deploy these URLs
# elsewhere.
from django.conf.urls import url
from django.contrib.auth import views
... | bsd-3-clause |
yunxliu/crosswalk-test-suite | webapi/tct-mediacapture-w3c-tests/inst.apk.py | 1996 | 3186 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
sgenoud/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting.py | 1 | 14689 | """
Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting).
"""
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.metrics import mean_squar... | bsd-3-clause |
brokenjacobs/ansible | lib/ansible/modules/remote_management/hpilo/hpilo_facts.py | 33 | 7797 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 Lice... | gpl-3.0 |
40023154/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/socket.py | 730 | 14913 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | gpl-2.0 |
mchdks/python-social-auth | social/backends/professionali.py | 73 | 1907 | # -*- coding: utf-8 -*-
"""
Professionaly OAuth 2.0 support.
This contribution adds support for professionaly.ru OAuth 2.0.
Username is retrieved from the identity returned by server.
"""
from time import time
from social.utils import parse_qs
from social.backends.oauth import BaseOAuth2
class ProfessionaliOAuth2(B... | bsd-3-clause |
marcelovilaca/DIRAC | DataManagementSystem/Utilities/lfc_dfc_copy.py | 14 | 8617 | #########################################################################################
#
# Script to populate the DIRAC FileCatalog with the information from the LFC
# FileCatalog using multiple LFC sources
#
# Author: A.Tsaregorodtsev
# Last Modified: 9.01.2012
#
###################################################... | gpl-3.0 |
PGower/PyCanvas | pycanvas/apis/course_audit_log.py | 1 | 11942 | """CourseAuditLog API Version 1.0.
This API client was generated using a template. Make sure this code is valid before using it.
"""
import logging
from datetime import date, datetime
from base import BaseCanvasAPI
from base import BaseModel
class CourseAuditLogAPI(BaseCanvasAPI):
"""CourseAuditLog AP... | mit |
cpennington/edx-platform | common/lib/xmodule/xmodule/tests/test_services.py | 3 | 6030 | """
Tests for SettingsService
"""
import unittest
from django.test import TestCase
import ddt
import mock
from config_models.models import ConfigurationModel
from django.conf import settings
from django.test.utils import override_settings
from xblock.runtime import Mixologist
from opaque_keys.edx.locator import Co... | agpl-3.0 |
Senseg/Py4A | python3-alpha/extra_modules/gdata/Crypto/Protocol/Chaffing.py | 44 | 9496 | """This file implements the chaffing algorithm.
Winnowing and chaffing is a technique for enhancing privacy without requiring
strong encryption. In short, the technique takes a set of authenticated
message blocks (the wheat) and adds a number of chaff blocks which have
randomly chosen data and MAC fields. This means... | apache-2.0 |
dtudares/hello-world | yardstick/tests/unit/benchmark/scenarios/networking/test_networkcapacity.py | 1 | 2042 | #!/usr/bin/env python
##############################################################################
# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which a... | apache-2.0 |
chand3040/sree_odoo | openerp/addons/hw_posbox_homepage/__init__.py | 1894 | 1075 | # -*- 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 |
tux-00/ansible | lib/ansible/modules/network/f5/bigip_gtm_wide_ip.py | 49 | 5381 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Michael Perzel
#
# 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 you... | gpl-3.0 |
catapult-project/catapult | third_party/gsutil/gslib/tests/mock_logging_handler.py | 5 | 1308 | # -*- coding: utf-8 -*-
# Copyright 2014 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 require... | bsd-3-clause |
dgaiero/cpe101-proj4 | funcsTests.py | 1 | 7252 | # Project 4 – Word Puzzle
#
# Name: Dominic Gaiero and Russell Caletena
# Instructor: S. Einakian
# Section: 05
# https://github.com/dgaiero/cpe101-proj4
# # ######
# # # #### ##### ##### # # # # ###### ###### # ######
# # # # # # # # # # # # # ... | mit |
ericaschwa/randomOldSideProjects | election_predictor/build/lib/xlrd/formatting.py | 42 | 45335 | # -*- coding: cp1252 -*-
##
# Module for formatting information.
#
# <p>Copyright © 2005-2012 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under
# a BSD-style licence.</p>
##
# No part of the content of this file was derived from the works of David Giffin.
f... | artistic-2.0 |
hyxer/mqttsn_secure | broker/MQTTSClient/Python/MQTTSNinternal.py | 2 | 5717 | """
/*******************************************************************************
* Copyright (c) 2011, 2013 IBM Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accomp... | mit |
dragonfly-science/django-pigeonpost | pigeonpost/south_migrations/0001_initial.py | 1 | 7960 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Pigeon'
db.create_table('pigeonpost_pigeon', (
... | mit |
JFCM121CAKE/android_kernel_samsung_jf | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
karthik-sethuraman/Snowmass-ONFOpenTransport | RI/flask_server/tapi_server/controllers/tapi_path_computation_controller.py | 4 | 74967 | import connexion
import six
from tapi_server.models.inline_object import InlineObject # noqa: E501
from tapi_server.models.inline_object11 import InlineObject11 # noqa: E501
from tapi_server.models.inline_object26 import InlineObject26 # noqa: E501
from tapi_server.models.tapi_common_bandwidth_profile import TapiCo... | apache-2.0 |
ewdurbin/sentry | src/sentry/models/tagkey.py | 11 | 3121 | """
sentry.models.tagkey
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.... | bsd-3-clause |
azlanismail/prismgames | examples/games/car/networkx/algorithms/traversal/tests/test_dfs.py | 1 | 2144 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestDFS:
def setUp(self):
# simple graph
G=nx.Graph()
G.add_edges_from([(0,1),(1,2),(1,3),(2,4),(3,4)])
self.G=G
# simple graph, disconnected
D=nx.Graph()
D.add_edges_fro... | gpl-2.0 |
elkingtonmcb/PredictionIO | examples/scala-parallel-similarproduct/no-set-user/data/import_eventserver.py | 47 | 1671 | """
Import sample data for similar product engine
"""
import predictionio
import argparse
import random
SEED = 3
def import_events(client):
random.seed(SEED)
count = 0
print client.get_status()
print "Importing data..."
# generate 10 users, with user ids u1,u2,....,u10
user_ids = ["u%s" % i for i in ran... | apache-2.0 |
trishnaguha/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_host_facts.py | 13 | 7406 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) me@mimiko.me
# 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',
'statu... | gpl-3.0 |
znoland3/zachdemo | venvdir/lib/python3.4/site-packages/dominate/document.py | 37 | 2217 | __license__ = '''
This file is part of Dominate.
Dominate 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 version.
Dominate is distributed in... | mit |
40223249-1/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/token.py | 743 | 3034 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... | gpl-3.0 |
juanalfonsopr/odoo | addons/report_webkit/convert.py | 322 | 2581 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | agpl-3.0 |
syphar/django | tests/template_tests/filter_tests/test_stringformat.py | 73 | 1191 | from django.template.defaultfilters import stringformat
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class StringformatTests(SimpleTestCase):
"""
Notice that escaping is applied *after* any filters, so the string
formatting here only needs... | bsd-3-clause |
MarsSnail/gyp_tools | test/configurations/basics/gyptest-configurations.py | 72 | 1068 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies build of an executable in three different configurations.
"""
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'and... | bsd-3-clause |
AnderEnder/ansible-modules-extras | messaging/rabbitmq_user.py | 65 | 10113 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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 |
Nowheresly/odoo | addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 36 | 36165 | # -*- 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 |
zero-ui/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/common/net/networktransaction.py | 190 | 2926 | # Copyright (C) 2010 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 of conditions and the ... | gpl-3.0 |
talishte/ctigre | env/lib/python2.7/site-packages/fabfile/tag.py | 24 | 4227 | from __future__ import with_statement
from contextlib import nested
from fabric.api import abort, hide, local, settings, task
# Need to import this as fabric.version for reload() purposes
import fabric.version
# But nothing is stopping us from making a convenient binding!
_version = fabric.version.get_version
from ... | bsd-2-clause |
7fever/script.pseudotv.live | service.py | 1 | 4196 | # Copyright (C) 2015 Kevin S. Graer
#
#
# This file is part of PseudoTV Live.
#
# PseudoTV Live 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 lat... | gpl-3.0 |
lowitty/server | libsLinux/pyasn1/type/tagmap.py | 172 | 2392 | from pyasn1 import error
class TagMap:
def __init__(self, posMap={}, negMap={}, defType=None):
self.__posMap = posMap.copy()
self.__negMap = negMap.copy()
self.__defType = defType
def __contains__(self, tagSet):
return tagSet in self.__posMap or \
self.__... | mit |
lakshmi-kannan/st2contrib | packs/twitter/sensors/twitter_search_sensor.py | 6 | 3371 | from TwitterSearch import TwitterSearch
from TwitterSearch import TwitterSearchOrder
from st2reactor.sensor.base import PollingSensor
__all__ = [
'TwitterSearchSensor'
]
BASE_URL = 'https://twitter.com'
class TwitterSearchSensor(PollingSensor):
def __init__(self, sensor_service, config=None, poll_interval=... | apache-2.0 |
bartoldeman/easybuild-framework | easybuild/toolchains/compiler/clang.py | 1 | 5280 | ##
# Copyright 2013-2018 Ghent University
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the... | gpl-2.0 |
syjzwjj/z3 | src/api/python/z3util.py | 15 | 10120 | """
Usage:
import common_z3 as CM_Z3
"""
import common as CM
from z3 import *
def get_z3_version(as_str=False):
major = ctypes.c_uint(0)
minor = ctypes.c_uint(0)
build = ctypes.c_uint(0)
rev = ctypes.c_uint(0)
Z3_get_version(major,minor,build,rev)
rs = map(int,(major.value,minor.value,buil... | mit |
cypridina/gloTK | multiproc.py | 1 | 1198 | #!/usr/bin/env python3
# gloTK - Genomes of Luminous Organisms Toolkit
# Copyright (c) 2015-2016 Darrin Schultz. All rights reserved.
#
# This file is part of gloTK.
#
# GloTK 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 Softwa... | gpl-3.0 |
akionakamura/scikit-learn | sklearn/tests/test_lda.py | 71 | 5883 | import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert... | bsd-3-clause |
mrbox/django | tests/gis_tests/rasterapp/test_rasterfield.py | 38 | 3359 | import json
from django.contrib.gis.shortcuts import numpy
from django.core.exceptions import ImproperlyConfigured
from django.test import (
TestCase, TransactionTestCase, mock, skipUnlessDBFeature,
)
from ..data.rasters.textrasters import JSON_RASTER
from ..models import models
from .models import RasterModel
... | bsd-3-clause |
andrewosh/bolt | bolt/spark/stack.py | 3 | 4932 | from numpy import asarray, ndarray, concatenate
from bolt.spark.utils import zip_with_index
class StackedArray(object):
"""
Wraps a BoltArraySpark and provides an interface for performing
stacked operations (operations on aggregated subarrays). Many methods
will be restricted or forbidden until the Sta... | apache-2.0 |
SurveyMan/SMPy | surveyman/examples/example_survey.py | 1 | 6639 | # -*- coding: cp1252 -*-
#example survey based on https://github.com/etosch/SurveyMan/blob/master/data/Ipierotis.csv
#outputs JSON representation
import surveyman.survey.questions as questions
import surveyman.survey.blocks as blocks
import surveyman.survey.constraints as constraints
import surveyman.survey.options as ... | apache-2.0 |
vivyly/fancast | fancast/casting/serializers.py | 1 | 2476 | #/usr/bin/env python
from rest_framework import serializers
from .models import (Project,
Character,
Prospect,
ProspectVote,
Actor)
class ProjectSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Proje... | bsd-3-clause |
egoid/baytree | lib/python2.7/site-packages/django/contrib/gis/utils/ogrinspect.py | 391 | 9090 | """
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.field import (
OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, O... | mit |
anandpdoshi/erpnext | erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py | 2 | 3767 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
class ChequePrintTemplate(Document):
pass
@frappe.white... | agpl-3.0 |
madtypist/madtypist.github.io | .bundle/gems/pygments.rb-0.6.0/vendor/simplejson/simplejson/scanner.py | 674 | 2560 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from simplejson._speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))... | mit |
nteplov/example-plugin | shadowsocks/crypto/openssl.py | 1038 | 5414 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
rbarrois/djadmin_export | tests/runner.py | 1 | 1126 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2013 Raphaël Barrois
# This code is distributed under the two-clause BSD license.
from __future__ import unicode_literals
import sys
import django
from django.conf import settings
from django.test.runner import DiscoverRunner as DjangoTestSuiteRunner... | lgpl-3.0 |
mitocw/edx-platform | openedx/core/djangoapps/content_libraries/api.py | 3 | 33134 | """
Python API for content libraries.
Via 'views.py', most of these API methods are also exposed as a REST API.
The API methods in this file are focused on authoring and specific to content
libraries; they wouldn't necessarily apply or work in other learning contexts
such as courses, blogs, "pathways," etc.
** As th... | agpl-3.0 |
foospidy/DbDat | plugins/mssql/check_configuration_server_audit_specifications.py | 1 | 1746 | class check_configuration_server_audit_specifications():
"""
check_configuration_server_audit_specifications:
Auditing of defined server level events. Review to ensure proper auditing
is enabled.
"""
# References:
# https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=sql20... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.