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 |
|---|---|---|---|---|---|
cliffe/SecGen | modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/data/jython-2.7.1/Lib/distutils/tests/support.py | 81 | 6954 | """Support code for distutils test cases."""
import os
import sys
import shutil
import tempfile
import unittest
import sysconfig
from copy import deepcopy
import warnings
from distutils import log
from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL
from distutils.core import Distribution
def capture_warnings(f... | gpl-3.0 |
gwulfs/zipline | zipline/finance/performance/position.py | 28 | 8015 | #
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 |
h2oai/h2o-dev | h2o-py/tests/testdir_demos/pyunit_assembly_demo.py | 8 | 1553 | import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
from h2o.assembly import H2OAssembly
from h2o.transforms.preprocessing import *
from h2o import H2OFrame
def assembly_demo():
fr = h2o.import_file(pyunit_utils.locate("smalldata/iris/iris_wheader.csv"), col_types=["numeric","numeric"... | apache-2.0 |
bxlab/HiFive_Paper | Scripts/HiCLib/bx-python-0.7.1/build/lib.linux-x86_64-2.7/bx/motif/pwm.py | 7 | 5511 | """
Classes for working with position specific matrices.
"""
from numpy import *
from copy import copy
import _pwm
class BaseMatrix( object ):
"""
Base class for position specific matrices.
"""
def __init__( self, alphabet=None, sorted_alphabet=None,
char_to_index=None, values=Non... | bsd-3-clause |
rlisagor/freshen | freshen/checks.py | 3 | 1024 | #-*- coding: utf8 -*-
from nose.tools import *
import re as _re
import difflib as _difflib
__unittest = 1
def assert_looks_like(first, second, msg=None):
""" Compare two strings if all contiguous whitespace is coalesced. """
first = _re.sub("\s+", " ", first.strip())
second = _re.sub("\s+", " ", second.s... | gpl-3.0 |
muntasirsyed/intellij-community | python/lib/Lib/site-packages/django/contrib/localflavor/uk/forms.py | 313 | 1943 | """
UK-specific Form helpers
"""
import re
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expressi... | apache-2.0 |
8u1a/plaso | tests/parsers/plist_plugins/spotlight_volume.py | 3 | 1837 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Spotlight Volume configuration plist plugin."""
import unittest
# pylint: disable=unused-import
from plaso.formatters import plist as plist_formatter
from plaso.parsers import plist
from plaso.parsers.plist_plugins import spotlight_volume
from tests.parsers.... | apache-2.0 |
donnydevito/py-academicstoday | academicstoday_project/student/tests/test_exam.py | 3 | 8464 | from django.core.urlresolvers import resolve
from django.http import HttpRequest
from django.http import QueryDict
from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators i... | apache-2.0 |
DailyActie/Surrogate-Model | 01-codes/tensorflow-master/tensorflow/python/framework/importer_test.py | 1 | 27395 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mit |
ryuunosukeyoshi/PartnerPoi-Bot | lib/youtube_dl/extractor/howstuffworks.py | 34 | 4741 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
int_or_none,
js_to_json,
unescapeHTML,
determine_ext,
)
class HowStuffWorksIE(InfoExtractor):
_VALID_URL = r'https?://[\da-z-]+\.howstuffworks\.com/(?:[^/]+/)*(?:\d+-)?(?P<id>.+?)-... | gpl-3.0 |
xneby/tcs-web | tcsweb/settings.py | 1 | 2781 | import os
from django.conf import global_settings
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Karol Farbiś', 'kpchwk@gmail.com'),
)
MANAGERS = ADMINS
INSTALL_DIR = os.path.split(os.path.realpath(__file__ + '/../'))[0]
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME... | gpl-2.0 |
ltiao/scikit-learn | sklearn/linear_model/tests/test_sgd.py | 30 | 44274 | import pickle
import unittest
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing ... | bsd-3-clause |
asadziach/tensorflow | tensorflow/contrib/keras/api/keras/losses/__init__.py | 46 | 2097 | # 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 |
zstackio/zstack-woodpecker | integrationtest/vm/mini/poweroff/test_poweroff_host.py | 1 | 3324 | '''
Integration test for testing power off mini hosts.
#1.operations & power off random hosts
#2.start hosts
#3.duplicated operation
@author: zhaohao.chen
'''
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker... | apache-2.0 |
Russell-IO/ansible | lib/ansible/modules/network/illumos/flowadm.py | 43 | 14799 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
aleksandra-tarkowska/django | django/contrib/auth/forms.py | 1 | 15080 | from __future__ import unicode_literals
from collections import OrderedDict
from django import forms
from django.core.mail import EmailMultiAlternatives
from django.forms.utils import flatatt
from django.template import loader
from django.utils.encoding import force_bytes
from django.utils.html import format_html, fo... | bsd-3-clause |
chidea/GoPythonDLLWrapper | bin/lib/test/test_modulefinder.py | 79 | 8949 | import os
import errno
import importlib.machinery
import py_compile
import shutil
import unittest
import tempfile
from test import support
import modulefinder
TEST_DIR = tempfile.mkdtemp()
TEST_PATH = [TEST_DIR, os.path.dirname(tempfile.__file__)]
# Each test description is a list of 5 items:
#
# 1. a module name t... | mit |
nelson-liu/scikit-learn | examples/plot_multilabel.py | 236 | 4157 | # Authors: Vlad Niculae, Mathieu Blondel
# License: BSD 3 clause
"""
=========================
Multilabel classification
=========================
This example simulates a multi-label document classification problem. The
dataset is generated randomly based on the following process:
- pick the number of labels: n ... | bsd-3-clause |
ClearCorp-dev/odoo-clearcorp | TODO-7.0/account_multicompany_relation/account_multicompany_relation.py | 4 | 15994 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Author: Mag Guevara. Copyright ClearCorp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by th... | agpl-3.0 |
takeshineshiro/cinder | cinder/tests/unit/volume/drivers/netapp/dataontap/client/fakes.py | 6 | 3978 | # Copyright (c) - 2015, Tom Barron. 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... | apache-2.0 |
siripuramrk/namebench | tools/add_linkcount_and_version_to_csv.py | 174 | 1351 | #!/usr/bin/env 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... | apache-2.0 |
googleapis/python-tpu | google/cloud/tpu_v1/types/cloud_tpu.py | 1 | 18294 | # -*- 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 |
lnielsen/invenio-metrics | invenio_metrics/admin.py | 1 | 1755 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
hmrs-cr/PyArcPics | main_flickruploader.py | 1 | 2463 | #!/usr/bin/python
# coding=UTF8
import argparse
import os
import sys
import utils
import flickruploader
def main():
def scan(fup):
print "Scanning folder", options.folder, "..."
pc, npc, pcs, npcs = fup.scan_directory(options.folder)
print pc, "total pictures found. (" + utils.sizeof_fmt... | apache-2.0 |
zedr/django | django/contrib/staticfiles/utils.py | 114 | 1976 | import os
import fnmatch
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
def matches_patterns(path, patterns=None):
"""
Return True or False depending on whether the ``path`` should be
ignored (if it matches any pattern in ``ignore_patterns``).
"""
if patte... | bsd-3-clause |
EvanK/ansible | lib/ansible/modules/cloud/vmware/vmware_about_facts.py | 31 | 3659 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@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
ANSIBLE_METADATA = {
'metad... | gpl-3.0 |
henryfjordan/django | django/contrib/contenttypes/admin.py | 191 | 5385 | from __future__ import unicode_literals
from functools import partial
from django.contrib.admin.checks import InlineModelAdminChecks
from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.forms impo... | bsd-3-clause |
charmoniumQ/Hallways | python_client/hallways/gui/main.py | 2 | 1792 | from __future__ import print_function
import sys
import numpy as np
from PyQt5.QtWidgets import QApplication
from .skeleton import Skeleton
from ..wifi import WiFiScanner
from ..location import Location
from ..storage import FileStorageServer
# TODO: GUI for these settings
interface = 'wlp3s0'
delay = 5
mock_network =... | gpl-2.0 |
gameduell/duell | bin/mac/python2.7.9/lib/python2.7/trace.py | 153 | 29890 | #!/usr/bin/env python
# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err... reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserv... | bsd-2-clause |
prune998/ansible | lib/ansible/plugins/lookup/env.py | 251 | 1071 | # (c) 2012, Jan-Piet Mens <jpmens(at)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 of the License, or
# (at your option) any later ver... | gpl-3.0 |
hongyan0118/uiautotestmacaca | THhealth/ForTest/run.py | 1 | 2307 | #-*- coding: utf-8 -*-
import os
import sys
from macaca import WebDriver
sys.path.append(os.path.split(os.path.split(os.path.abspath(''))[0])[0])
from Public.Log import Log
from Public.ReportPath import ReportPath
from Public.BasePage import BasePage
from THhealth.PageObject.THhealthHomePage import THhealthHomePage... | gpl-3.0 |
slarosa/QGIS | python/plugins/sextante/script/WrongScriptException.py | 5 | 1230 | # -*- coding: utf-8 -*-
"""
***************************************************************************
WrongScriptException.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************... | gpl-2.0 |
rodsol/opencog | opencog/python/conceptnet/writer.py | 16 | 4006 | __author__ = 'DongMin Kim'
class ConceptNetWriter:
def __init__(self, a, out_type, out_name):
self.a = a
self.output_file_type = out_type
self.output_file_name = out_name
# Open an output file
self.output_file = open(self.output_file_name, 'w')
# Prepare the outpu... | agpl-3.0 |
xrg/django-static-gitified | tests/modeltests/proxy_models/tests.py | 33 | 12189 | from __future__ import absolute_import
from django.contrib.contenttypes.models import ContentType
from django.core import management
from django.core.exceptions import FieldError
from django.db import models, DEFAULT_DB_ALIAS
from django.db.models import signals
from django.test import TestCase
from .models import (... | bsd-3-clause |
qtumproject/qtum | test/functional/test_framework/segwit_addr.py | 88 | 3478 | #!/usr/bin/env python3
# Copyright (c) 2017 Pieter Wuille
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Reference implementation for Bech32 and segwit addresses."""
CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
def bech32_p... | mit |
ahmedRguei/job | typo3conf/ext/extension_builder/Resources/Public/jsDomainModeling/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # Copyright (c) 2013 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | gpl-2.0 |
elite-lang/eobject | conanfile.py | 1 | 1107 | from conans import ConanFile, CMake, tools
class eobjectConan(ConanFile):
name = "eobject"
version = "0.1.2"
license = "MIT"
url = "https://github.com/elite-lang/eobject"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = "shared=False", ... | mit |
thnee/ansible | lib/ansible/modules/packaging/os/yum.py | 7 | 66737 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# Copyright: (c) 2014, Epic Games, 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, p... | gpl-3.0 |
rdipietro/tensorflow | tensorflow/python/framework/graph_util_test.py | 9 | 12229 | # 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 |
Docker-J/Sail_GEE_L | scripts/build-all.py | 1182 | 9486 | #! /usr/bin/env python
# Copyright (c) 2009-2011, The Linux Foundation. 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
# ... | gpl-2.0 |
Barrog/C4-Datapack | data/jscript/quests/37_PleaseMakeMeFormalWear/__init__.py | 1 | 3555 | # Made by disKret
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
MYSTERIOUS_CLOTH = 7076
JEWEL_BOX = 7077
SEWING_KIT = 7078
DRESS_SHOES_BOX = 7113
FORMAL_WEAR = 6408
SIGNE... | gpl-2.0 |
Laurawly/tvm-1 | python/tvm/relay/expr.py | 2 | 15511 | # 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 |
JasonCormie/ansible-modules-extras | storage/netapp/netapp_e_amg_role.py | 27 | 8160 | #!/usr/bin/python
# (c) 2016, NetApp, 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.... | gpl-3.0 |
crankyadmin/shadowsocks | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-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 r... | apache-2.0 |
ESG-Leipzig/Homepage-2015 | manage.py | 2 | 2413 | import os
import re
import sys
from django.utils.crypto import get_random_string
DEPLOYMENT_DIRECTORY_NAME = 'esg_leipzig_homepage_2015_deployment'
def create_deployment_dir():
# Creates the deployment directory with settings and wsgi file if
# inexistent.
base_dir = os.path.dirname(os.path.abspath(__fi... | mit |
tahmid-tanzim/youtube-dl | setup.py | 107 | 3233 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os.path
import warnings
import sys
try:
from setuptools import setup
setuptools_available = True
except ImportError:
from distutils.core import setup
setuptools_available = False
try:
# This will create an... | unlicense |
lebrice/SimpleParsing | simple_parsing/helpers/flatten.py | 1 | 6257 | import dataclasses
import warnings
from typing import *
from ..logging_utils import get_logger
logger = get_logger(__file__)
class FlattenedAccess:
""" Allows flattened access to the attributes of all children dataclasses.
This is meant to simplify the adoption of dataclasses for argument
hierarchies, r... | mit |
caseman/grease | test/field_test.py | 1 | 9571 | import unittest
class TestData(object):
def __init__(self, entity=None, **kw):
self.entity = entity
self.__dict__.update(kw)
class TestComponent(dict):
def __init__(self, entities=()):
self.entities = set(entities)
def __getitem__(self, entity):
return self.setdefault(entity, TestData(entity))
clas... | mit |
Telegea/Smarthub-software | src/mqttclient/mqttc-device.py | 2 | 21033 | #!/usr/bin/env python
###############################################################################
#
# MQTT client for the Telegea Smarthub device (CMD Receiver)
#
# Author: Ondrej Wisniewski
#
# Features:
# - handles commands sent from the Telegea server to the Smarthub
#
# Changelog:
# 02-10-2015: Initial versio... | gpl-3.0 |
MarkTseng/django-farmersale | farmersale-env/lib/python2.7/site-packages/django/contrib/gis/maps/google/overlays.py | 102 | 11931 | from __future__ import unicode_literals
from django.contrib.gis.geos import fromstr, Point, LineString, LinearRing, Polygon
from django.utils.functional import total_ordering
from django.utils.safestring import mark_safe
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@pyth... | mit |
Nitaco/ansible | lib/ansible/module_utils/aws/cloudfront_facts.py | 40 | 11396 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Willem van Ketwich
#
# This module 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.
#
# T... | gpl-3.0 |
nkgilley/home-assistant | homeassistant/components/wink/alarm_control_panel.py | 7 | 2331 | """Support Wink alarm control panels."""
import logging
import pywink
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
)
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
... | apache-2.0 |
mozilla/firefox-flicks | vendor-local/lib/python/celery/tests/events/test_state.py | 1 | 11017 | from __future__ import absolute_import
from time import time
from itertools import count
from celery import states
from celery.events import Event
from celery.events.state import State, Worker, Task, HEARTBEAT_EXPIRE_WINDOW
from celery.utils import uuid
from celery.tests.utils import Case
class replay(object):
... | bsd-3-clause |
FCP-INDI/nipype | nipype/interfaces/ants/tests/test_auto_MultiplyImages.py | 12 | 1335 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..utils import MultiplyImages
def test_MultiplyImages_inputs():
input_map = dict(args=dict(argstr='%s',
),
dimension=dict(argstr='%d',
mandatory=True,
position=0,
usedefault=False,
),
enviro... | bsd-3-clause |
johnkeepmoving/oss-ftp | python27/win32/Lib/distutils/tests/test_build_py.py | 46 | 5064 | """Tests for distutils.command.build_py."""
import os
import sys
import StringIO
import unittest
from distutils.command.build_py import build_py
from distutils.core import Distribution
from distutils.errors import DistutilsFileError
from distutils.tests import support
from test.test_support import run_unittest
cla... | mit |
nanolearningllc/edx-platform-cypress | common/lib/xmodule/xmodule/editing_module.py | 120 | 4149 | """Descriptors for XBlocks/Xmodules, that provide editing of atrributes"""
from pkg_resources import resource_string
from xmodule.mako_module import MakoModuleDescriptor
from xblock.fields import Scope, String
import logging
log = logging.getLogger(__name__)
class EditingFields(object):
"""Contains specific tem... | agpl-3.0 |
DVSBA/ajenti | plugins/network/ncs_bsd_ipv4.py | 17 | 1104 | from ajenti.ui import *
from api import *
class BSDIPv4NetworkConfigSet(NetworkConfigBit):
cls = 'bsd-ipv4'
title = 'IPv4'
autovars = ['address', 'netmask', 'broadcast', 'metric', 'mtu']
def get_ui(self):
p = UI.Container(
UI.Formline(
UI.TextInput(nam... | lgpl-3.0 |
sss/calibre-at-bzr | manual/plugin_examples/interface_demo/__init__.py | 10 | 3187 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
# The class th... | gpl-3.0 |
huertasdanny/inertialsense | src/scripts/IS_raw2msg.py | 1 | 1078 | #!/usr/bin/env python
import rospy
import serial
import checksum
from serial import SerialException
from std_msgs.msg import String
from create_dummy_msg import msg_creator
from sensor_msgs.msg import Imu
from sensor_msgs.msg import MagneticField as Mag
from inertialsense.msg import Rawgps
from inertialsense.msg impor... | mit |
tahir24434/hydra | src/integrationtest/python/mesos_marathon_tests.py | 1 | 10264 | __author__ = 'sushil'
from sys import path
path.append("src/main/python")
# from mockito import mock, verify
import unittest
import numbers
import requests
import time
import zmq
from pprint import pprint
from hydra.lib.hydrabase import HydraBase
'''
tests :
-Check connectivity to mesos
-check connectivity to mara... | apache-2.0 |
jakirkham/bokeh | bokeh/core/property/instance.py | 3 | 5059 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
alien4cloud/alien4cloud-cloudify3-provider | alien4cloud-cloudify3-provider/src/test/resources/outputs/blueprints/openstack/artifact_test/wrapper/Tomcat/tosca.interfaces.node.lifecycle.Standard/create/_a4c_create.py | 6 | 15469 |
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.state import ctx_parameters as inputs
import subprocess
import os
import re
import sys
import time
import threading
import platform
from StringIO import StringIO
from cloudify_rest_client import CloudifyClient
from cloudify im... | apache-2.0 |
Dhivyap/ansible | lib/ansible/modules/cloud/azure/azure_rm_applicationsecuritygroup.py | 27 | 8584 | #!/usr/bin/python
#
# Copyright (c) 2018 Yunge Zhu, <yungez@microsoft.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
OpenDrift/opendrift | tests/models/test_readers.py | 1 | 29038 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of OpenDrift.
#
# OpenDrift 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, version 2
#
# OpenDrift is distributed in the hope that it will b... | gpl-2.0 |
frank-tancf/scikit-learn | examples/feature_selection/plot_f_test_vs_mi.py | 75 | 1647 | """
===========================================
Comparison of F-test and mutual information
===========================================
This example illustrates the differences between univariate F-test statistics
and mutual information.
We consider 3 features x_1, x_2, x_3 distributed uniformly over [0, 1], the
targ... | bsd-3-clause |
monikagrabowska/osf.io | tests/framework_tests/test_analytics.py | 3 | 7534 | # -*- coding: utf-8 -*-
"""
Unit tests for analytics logic in framework/analytics/__init__.py
"""
import unittest
import pytest
from django.utils import timezone
from nose.tools import * # flake8: noqa (PEP8 asserts)
from flask import Flask
from datetime import datetime
from framework import analytics, sessions
f... | apache-2.0 |
sbuss/voteswap | lib/networkx/algorithms/link_analysis/hits_alg.py | 10 | 9437 | """Hubs and authorities analysis of graph structure.
"""
# Copyright (C) 2008-2012 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
# NetworkX:http://networkx.github.io/
import networkx as nx
from networkx.... | mit |
tchellomello/home-assistant | homeassistant/components/counter/reproduce_state.py | 16 | 2573 | """Reproduce an Counter state."""
import asyncio
import logging
from typing import Any, Dict, Iterable, Optional
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType
from . import (
ATTR_INITIAL,
ATTR_MAXIMUM,
... | apache-2.0 |
leiferikb/bitpop | src/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/server_process_unittest.py | 2 | 6117 | # Copyright (C) 2011 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 f... | gpl-3.0 |
minlexx/pyevemon | esi_client/models/post_characters_character_id_fittings_internal_server_error.py | 1 | 3184 | # coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PostCharactersCharacterIdFittingsInternalServerError(objec... | gpl-3.0 |
trondeau/gnuradio | gr-wxgui/python/wxgui/pubsub.py | 92 | 4862 | #!/usr/bin/env python
#
# Copyright 2008 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)
# ... | gpl-3.0 |
shanemcd/ansible | lib/ansible/playbook/handler.py | 133 | 1974 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 of the License, or
# (at your option) an... | gpl-3.0 |
kaplun/inspire-next | tests/integration/crossref/test_crossref_views.py | 3 | 3342 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | gpl-3.0 |
auready/django | tests/custom_pk/tests.py | 31 | 7291 | from django.db import IntegrityError, transaction
from django.test import TestCase, skipIfDBFeature
from .models import Bar, Business, Employee, Foo
class BasicCustomPKTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.dan = Employee.objects.create(
employee_code=123, first_name="D... | bsd-3-clause |
ouyangshiliang/hg255 | scripts/dl_cleanup.py | 131 | 5871 | #!/usr/bin/env python
"""
# OpenWRT download directory cleanup utility.
# Delete all but the very last version of the program tarballs.
#
# Copyright (c) 2010 Michael Buesch <mb@bu3sch.de>
"""
import sys
import os
import re
import getopt
# Commandline options
opt_dryrun = False
def parseVer_1234(match, filepath):
... | gpl-2.0 |
xingyepei/edx-platform | cms/djangoapps/contentstore/views/tests/test_course_updates.py | 117 | 14061 | """
unit tests for course_info views and models.
"""
import json
from mock import patch
from django.test.utils import override_settings
from contentstore.models import PushNotificationConfig
from contentstore.tests.test_course_settings import CourseTestCase
from contentstore.utils import reverse_course_url, reverse_us... | agpl-3.0 |
dombrno/PG | Source/jugfile.py | 1 | 2178 | import numpy as np
import sys
from jug import TaskGenerator
from os.path import expanduser
HOME = expanduser("~")
if "storage" in HOME:
HOME = "/storage/home/geffroy"
sys.path.append(HOME + "/Code/PG/Source")
from phase_fluctuations import DWaveModel
from MCMC import MCMCDriver
# pylint: disable=E1101
N_RUNS = 32... | bsd-2-clause |
rahul67/hue | apps/sqoop/src/sqoop/api/job.py | 25 | 7728 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
JiscPER/magnificent-octopus | octopus/modules/store/store.py | 2 | 7571 | from octopus.core import app
from octopus.lib import plugin
import os, shutil, codecs, requests
class StoreException(Exception):
pass
class StoreFactory(object):
@classmethod
def get(cls):
"""
Returns an implementation of the base Store class
"""
si = app.config.get("STOR... | apache-2.0 |
awkspace/ansible | lib/ansible/plugins/callback/osx_say.py | 10 | 2870 | # (c) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
... | gpl-3.0 |
CS-SI/QGIS | tests/src/python/test_provider_oracle.py | 11 | 7039 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the Oracle provider.
.. 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, or
(at your option) any later version.
"... | gpl-2.0 |
martyngigg/pyqt-msvc | examples/webkit/googlechat/ui_form.py | 6 | 5672 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'form.ui'
#
# Created: Mon Nov 29 16:57:47 2010
# by: PyQt4 UI code generator snapshot-4.8.2-241fbaf4620d
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.from... | gpl-3.0 |
doublebits/osf.io | scripts/clone_wiki_pages.py | 17 | 2766 | """
Create copies of wiki pages for existing forks and registrations instead of
using the same NodeWikiPage objects as the original node.
"""
import logging
import sys
from modularodm import Q
from framework.mongo import database as db
from framework.transactions.context import TokuTransaction
from website.addons.wi... | apache-2.0 |
nikolas/edx-platform | openedx/core/djangoapps/course_groups/management/commands/tests/test_remove_users_from_multiple_cohorts.py | 91 | 3951 | """
Tests for cleanup of users which are added in multiple cohorts of a course
"""
from django.core.exceptions import MultipleObjectsReturned
from django.core.management import call_command
from django.test.client import RequestFactory
from openedx.core.djangoapps.course_groups.views import cohort_handler
from openedx... | agpl-3.0 |
chenjun0210/tensorflow | tensorflow/contrib/keras/api/keras/layers/__init__.py | 29 | 8012 | # 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 |
amenonsen/ansible | lib/ansible/modules/network/vyos/vyos_facts.py | 1 | 5074 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The module file for vyos_facts
"""
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': [u'preview'],
'suppo... | gpl-3.0 |
abirger/compliance-checker | compliance_checker/cf/appendix_f.py | 2 | 2157 | #!/usr/bin/env python
'''
Appendix F. Grid Mappings
---
Each recognized grid mapping is described in one of the sections below. Each
section contains: the valid name that is used with the grid_mapping_name
attribute; a list of the specific attributes that may be used to assign values
to the mapping's parameters; the st... | apache-2.0 |
nchammas/asyncssh | asyncssh/crypto/__init__.py | 1 | 1106 | # Copyright (c) 2014-2015 by Ron Frederick <ronf@timeheart.net>.
# All rights reserved.
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License v1.0 which accompanies this
# distribution and is available at:
#
# http://www.eclipse.org/legal/epl-v10.html
#
#... | epl-1.0 |
JHUISI/charm | charm/test/schemes/abenc/abenc_waters09_test.py | 2 | 1130 | import unittest
from charm.schemes.abenc.abenc_waters09 import CPabe09
from charm.toolbox.pairinggroup import PairingGroup, GT
debug = False
class CPabe09Test(unittest.TestCase):
def testCPabe(self):
# Get the eliptic curve with the bilinear mapping feature needed.
groupObj = PairingGroup('SS512... | lgpl-3.0 |
MattNolanLab/Ramsden_MEC | ABAFunctions/ABA_errors.py | 1 | 4010 | '''
Code for error analysis
Copyright (c) 2014, Helen Ramsden
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of cond... | bsd-3-clause |
a-bioinformatician/BreaKmer | breakmer.py | 1 | 6445 | #! /usr/bin/local/python
# -*- coding: utf-8 -*-
import argparse
import breakmer.params as params
import breakmer.processor.analysis as breakmer_analysis
__author__ = "Ryan Abo"
__copyright__ = "Copyright 2015, Ryan Abo"
__email__ = "ryanabo@gmail.com"
__license__ = "MIT"
'''
Main script that initiates the BreaKmer... | mit |
jiajiechen/mxnet | example/python-howto/multiple_outputs.py | 41 | 1505 | # 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 |
hfp/tensorflow-xsmm | tensorflow/contrib/layers/python/layers/embedding_ops.py | 16 | 42456 | # 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 |
Kazade/NeHe-Website | google_appengine/lib/django-1.5/django/core/management/templates.py | 102 | 12715 | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
try:
from urllib.request import urlretrieve
except ImportError: # Python 2
from urllib import urlretrieve
from optparse import make_option
from os import path
import django
fr... | bsd-3-clause |
mitocw/edx-platform | lms/djangoapps/commerce/tests/__init__.py | 4 | 3085 | # -*- coding: utf-8 -*-
""" Commerce app tests package. """
import httpretty
import mock
from django.conf import settings
from django.test import TestCase
from freezegun import freeze_time
from openedx.core.djangoapps.commerce.utils import ecommerce_api_client
from openedx.core.djangoapps.oauth_dispatch.jwt import c... | agpl-3.0 |
dbrgn/fahrplan | fahrplan/parser.py | 1 | 8199 | # -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import re
import logging
keywords = {
'de': {
'now': ['jetzt', 'sofort', 'nun'],
'noon': ['mittag'],
'midnight': ['mitternacht'],
'today': ["heute"],
'tomorrow': ["morgen"],
'at': ['um', 'am'],
... | gpl-3.0 |
toucheJterm2015/touche | testing/tests/admin/SetupHeadersForbiddenTest.py | 1 | 8114 | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | gpl-2.0 |
nick-huang-cc/GraffitiSpaceTT | UnderstandStudyPython/virtualenv_stu.py | 1 | 1524 | #!/usr/bin/env python3
# -*- coding:UTF-8 -*-
#Copyright (c) 1986 Nick Wong.
#Copyright (c) 2016-2026 TP-NEW Corp.
# License: TP-NEW (www.tp-new.com)
__author__ = "Nick Wong"
'''
virtualenv 为应用创建“隔离”环境
virtualenv为应用提供了隔离的Python运行环境,解决了不同应用间多版本的冲突问题。
python3.3以后自带venv模块支持轻量级虚拟环境,virtualenv模块仍然支持,可安装。
1.创建虚拟环境
vir... | agpl-3.0 |
cyanna/edx-platform | common/test/acceptance/tests/studio/test_studio_general.py | 105 | 5669 | """
Acceptance tests for Studio.
"""
from unittest import skip
from bok_choy.web_app_test import WebAppTest
from ...pages.studio.asset_index import AssetIndexPage
from ...pages.studio.auto_auth import AutoAuthPage
from ...pages.studio.checklists import ChecklistsPage
from ...pages.studio.course_info import CourseUpda... | agpl-3.0 |
jalexvig/keras | keras/preprocessing/text.py | 61 | 5906 | # -*- coding: utf-8 -*-
'''
These preprocessing utils would greatly benefit
from a fast Cython rewrite.
'''
from __future__ import absolute_import
import string, sys
import numpy as np
from six.moves import range
from six.moves import zip
if sys.version_info < (3,):
maketrans = string.maketrans
else:
... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.