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 |
|---|---|---|---|---|---|
dlintott/gns3 | src/GNS3/Defaults/IOSRouter3700Defaults.py | 3 | 1505 | # vim: expandtab ts=4 sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (C) 2007-2010 GNS3 Development Team (http://www.gns3.net/team).
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
#... | gpl-2.0 |
arunchandramouli/fanofpython | code/features/classes/serialize.py | 1 | 2846 | '''
Use Case: Exploring the Concept of Serializing and De-Serializing in Python
Shortly called as pickling, the needs is to store the object and later resurrect it
----> Use dump for serializing the records into a file
----> Use dumps for serializing the records into a string
---->... | gpl-3.0 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/training/localhost_cluster_performance_test.py | 92 | 4604 | # 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 |
massot/odoo | addons/product_expiry/__openerp__.py | 52 | 1870 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
billy-inn/scikit-learn | sklearn/gaussian_process/gaussian_process.py | 83 | 34544 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | bsd-3-clause |
aidan-/ansible-modules-extras | storage/netapp/netapp_e_amg_sync.py | 27 | 10565 | #!/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 |
elingg/tensorflow | tensorflow/examples/saved_model/saved_model_half_plus_two.py | 7 | 6654 | ## 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 applic... | apache-2.0 |
modulexcite/catapult | dashboard/dashboard/start_try_job_test.py | 2 | 33603 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import json
import unittest
import httplib2
import mock
import webapp2
import webtest
from google.appengine.ext import ndb
from dashboard im... | bsd-3-clause |
SaranyaKarthikeyan/boto | boto/directconnect/layer1.py | 148 | 23592 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
TI-OpenLink/kernel-omap | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
ibmjstart/bluemix-python-sample-twitter-influence-app | app/klout-master/klout/api.py | 1 | 7997 | # -*- coding: utf-8 -*-
"""
A minimalist klout API interface. Use of this API
requires klout *developer key*. You can get registered and
get a key at
<http://klout.com/s/developers/v2>
Supports Python >= 2.5 and Python 3
====================
Quickstart
====================
Install the PyPi package::
... | apache-2.0 |
wchan/tensorflow | tensorflow/python/framework/test_util.py | 1 | 20357 | # 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... | apache-2.0 |
babyliynfg/cross | tools/project-creator/Python2.6.6/Lib/encodings/iso2022_kr.py | 61 | 1092 | #
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class I... | mit |
e0ne/cinder | cinder/tests/test_solidfire.py | 2 | 27521 |
# 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 |
jandom/rdkit | rdkit/sping/PDF/pdfmetrics.py | 1 | 20669 | #fontmetrics.py - part of PDFgen - copyright Andy Robinson 1999
"""This contains pre-canned text metrics for the PDFgen package, and may also
be used for any other PIDDLE back ends or packages which use the standard
Type 1 postscript fonts.
Its main function is to let you work out the width of strings; it exposes a
s... | bsd-3-clause |
ogenstad/ansible | lib/ansible/modules/cloud/openstack/os_port_facts.py | 15 | 7181 | #!/usr/bin/python
# Copyright (c) 2016 IBM
# 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 |
wilsonianb/nacl_contracts | src/trusted/validator_ragel/spec_val.py | 13 | 4965 | # Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import spec
class Validator(object):
BITNESS = None
MAX_SUPERINSTRUCTION_LENGTH = None
def ValidateSuperinstruction(self, superinstruction... | bsd-3-clause |
adybbroe/mesan_compositer | tests/test_compositer.py | 1 | 11472 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 - 2019 Adam.Dybbroe
# Author(s):
# Adam.Dybbroe <a000680@c14526.ad.smhi.se>
# 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 Foundatio... | gpl-3.0 |
alextreme/Django-Bingo | contrib/xlwt/tests/RKbug.py | 3 | 4662 | from xlwt import *
import sys
from struct import pack, unpack
def cellname(rowx, colx):
# quick kludge, works up to 26 cols :-)
return chr(ord('A') + colx) + str(rowx + 1)
def RK_pack_check(num, anint, case=None):
if not(-0x7fffffff - 1 <= anint <= 0x7fffffff):
print "RK_pack_check: not ... | bsd-3-clause |
KNMI/VERCE | verce-hpc-pe/src/pyflex/window.py | 4 | 8376 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple class defining the windows.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
from __future__ import (absolute_import, division, print_funct... | mit |
benoitsteiner/tensorflow-xsmm | tensorflow/examples/speech_commands/train.py | 9 | 16646 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ichuang/sympy | sympy/physics/quantum/dagger.py | 1 | 4556 | """Hermitian conjugation."""
from sympy import Expr, sympify, Add, Mul, Matrix, Pow
from sympy.physics.quantum.qexpr import QExpr
from sympy.physics.quantum.matrixutils import (
numpy_ndarray, scipy_sparse_matrix, matrix_dagger
)
__all__ = [
'Dagger'
]
class Dagger(Expr):
"""General Hermitian conjugate... | bsd-3-clause |
sovnarkom/instwitter-py | instwitter/rest/partial/status.py | 1 | 3165 | '''
Created on Jul 31, 2009
@author: aleksandrcicenin
'''
from .. import RESTAPI, authneeded
class StatusAPI(RESTAPI):
def status_show(self, id):
path = self._get_method_path('statuses/show/' + id)
return self._get_request_data(path)
@authneeded
def status_update(self, status, ... | mit |
sirMackk/ZeroNet | src/User/UserManager.py | 21 | 2426 | # Included modules
import json
import logging
# ZeroNet Modules
from User import User
from Plugin import PluginManager
from Config import config
@PluginManager.acceptPlugins
class UserManager(object):
def __init__(self):
self.users = {}
# Load all user from data/users.json
def load(self):
... | gpl-2.0 |
kobejean/tensorflow | tensorflow/python/keras/layers/__init__.py | 18 | 8524 | # 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 |
goshan/PokemonGo-Bot | tests/update_live_stats_test.py | 4 | 8844 | import unittest
from sys import platform as _platform
from datetime import datetime, timedelta
from mock import call, patch, MagicMock
from pokemongo_bot.cell_workers.update_live_stats import UpdateLiveStats
from tests import FakeBot
class UpdateLiveStatsTestCase(unittest.TestCase):
config = {
'min_interv... | mit |
jamespcole/home-assistant | homeassistant/components/nmap_tracker/device_tracker.py | 1 | 4634 | """Support for scanning a network with nmap."""
import logging
import re
import subprocess
from collections import namedtuple
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.components.device_tracke... | apache-2.0 |
mmcardle/django_app_cookie | hooks/pre_gen_project.py | 1 | 1367 | #!/usr/bin/python
__author__ = 'mm'
import json
import os
print "Start Generate Templates Hook"
cookie_dir = '{{cookiecutter.app_name}}'
project_base = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
json_file = os.path.join(project_base, 'cookiecutter.json')
base_templates = os.path.join(project_base... | mit |
xiandiancloud/edx-platform | lms/djangoapps/instructor/management/tests/test_openended_commands.py | 33 | 8217 | """Test the openended_post management command."""
from datetime import datetime
import json
from mock import patch
from pytz import UTC
from django.test.utils import override_settings
import capa.xqueue_interface as xqueue_interface
from opaque_keys.edx.locations import Location
from xmodule.modulestore.tests.django... | agpl-3.0 |
cortedeltimo/SickRage | lib/github/tests/__init__.py | 9 | 1888 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
toshywoshy/ansible | test/units/modules/net_tools/nios/test_nios_host_record.py | 21 | 5386 | # 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 in the hope that ... | gpl-3.0 |
nrhine1/scikit-learn | examples/linear_model/plot_sgd_separating_hyperplane.py | 260 | 1219 | """
=========================================
SGD: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a linear Support Vector Machines classifier
trained using SGD.
"""
print(__doc__)
import numpy as n... | bsd-3-clause |
saurabhbajaj207/CarpeDiem | venv/Lib/site-packages/Crypto/Cipher/XOR.py | 126 | 2737 | # -*- coding: utf-8 -*-
#
# Cipher/XOR.py : XOR
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# n... | mit |
hectord/lettuce | tests/integration/lib/Django-1.3/django/db/models/sql/subqueries.py | 230 | 8070 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db import connections
from django.db.models.fields import DateField, FieldDoesNotExist
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures... | gpl-3.0 |
api0cradle/Veil-Evasion | tools/backdoor/intel/LinuxIntelELF64.py | 37 | 5588 | '''
Copyright (c) 2013-2014, Joshua Pitts
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 conditions and t... | gpl-3.0 |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/_base.py | 915 | 13711 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from ..constants import scopingElements, tableInsertModeElements, namespaces
# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent for... | gpl-3.0 |
cgstudiomap/cgstudiomap | main/parts/odoo/openerp/tools/convert.py | 205 | 41282 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
kou/zulip | zerver/migrations/0081_make_emoji_lowercase.py | 7 | 1303 | # Generated by Django 1.10.5 on 2017-05-02 21:44
import django.core.validators
from django.db import migrations, models
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
class Migration(migrations.Migration):
dependencies = [
('zerver',... | apache-2.0 |
watonyweng/horizon | openstack_dashboard/dashboards/project/access_and_security/floating_ips/tables.py | 56 | 8033 | # Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay 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... | apache-2.0 |
GiulianoFranchetto/linux-at91 | tools/perf/scripts/python/syscall-counts-by-pid.py | 1996 | 2105 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
xuegang/gpdb | src/test/tinc/tincmmgr/config.py | 9 | 1126 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | apache-2.0 |
rhgong/itk-with-dom | Wrapping/Generators/Doc/itk_doxy2swig.py | 13 | 4555 | #!/usr/bin/env python
"""Doxygen XML to SWIG docstring converter for ITK classes.
Usage:
itk_doxy2swig.py [input directory name] [output swing interface file name]
"""
# silently import psyco
try:
import psyco
psyco.full()
except ImportError:
pass
import sys
import os
import glob
from doxy2swig import *
fr... | apache-2.0 |
lucciano/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/MSCommon/netframework.py | 61 | 2807 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# 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 li... | apache-2.0 |
chandranaik/Aligning-of-PIE-with-rfc8033-in-ns3 | src/applications/bindings/modulegen__gcc_LP64.py | 33 | 727477 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/oauth2client/scripts/run_system_tests.py | 20 | 3557 | import json
import os
import httplib2
from oauth2client import client
from oauth2client import service_account
JSON_KEY_PATH = os.getenv('OAUTH2CLIENT_TEST_JSON_KEY_PATH')
P12_KEY_PATH = os.getenv('OAUTH2CLIENT_TEST_P12_KEY_PATH')
P12_KEY_EMAIL = os.getenv('OAUTH2CLIENT_TEST_P12_KEY_EMAIL')
USER_KEY_PATH = os.getenv... | mit |
Multipixelone/BlindRemote | start.py | 2 | 1579 | ## Import Files
print('eyeRemote by Multipixelone on Github.')
from TakePicture import TakePicture
from LocalVariables import takepicture
print('Imported Picture Taking')
from Cloudsight import UploadPicture
from cloudsight import errors
import cloudsight
import requests
print('Imported Image Uploading')
import RPi.GPI... | gpl-3.0 |
Innovahn/odoo.old | addons/hr_payroll_account/hr_payroll_account.py | 240 | 10840 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
kwss/keystone | tests/test_versions.py | 4 | 8488 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requir... | apache-2.0 |
mapcentia/vidi | docs/da/conf.py | 1 | 8332 | # -*- coding: utf-8 -*-
#
# Read the Docs Template documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 26 14:19:49 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenera... | agpl-3.0 |
vbannai/neutron | neutron/plugins/cisco/db/network_models_v2.py | 20 | 1922 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, 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-... | apache-2.0 |
FlaPer87/django-nonrel | django/contrib/localflavor/fi/forms.py | 309 | 1803 | """
FI-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class FIZipCodeField(RegexField):
default_error_messages = {
... | bsd-3-clause |
ezc/protobuf | python/google/protobuf/message_factory.py | 228 | 4178 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
fafaman/django | tests/prefetch_related/models.py | 255 | 7972 | import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Basic tests
@python_2_unicode_compatible
class Author(models.... | bsd-3-clause |
faegi/mapproxy | mapproxy/test/system/test_wmts_restful.py | 5 | 4430 | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... | apache-2.0 |
javilonas/NCam | cross/android-toolchain/lib/python2.7/distutils/config.py | 69 | 4130 | """distutils.pypirc
Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
"""
import os
from ConfigParser import ConfigParser
from distutils.cmd import Command
DEFAULT_PYPIRC = """\
[distutils]
index-servers =
pypi
[pypi]
username:%s
passwor... | gpl-3.0 |
TheBraveWarrior/pyload | module/plugins/hoster/BigfileTo.py | 8 | 3306 | # -*- coding: utf-8 -*-
import re
from ..captcha.ReCaptcha import ReCaptcha
from ..internal.misc import json
from ..internal.SimpleHoster import SimpleHoster
class BigfileTo(SimpleHoster):
__name__ = "BigfileTo"
__type__ = "hoster"
__version__ = "0.19"
__status__ = "testing"
__pattern__ = r'htt... | gpl-3.0 |
nimrodyo/TekDefense-Automater | inputs.py | 23 | 3355 | """
The inputs.py module represents some form of all inputs
to the Automater program to include target files, and
the standard config file - sites.xml. Any addition to
Automater that brings any other input requirement should
be programmed in this module.
Class(es):
TargetFile -- Provides a representation of a file con... | mit |
practicalswift/bitcoin | test/functional/wallet_importdescriptors.py | 14 | 27547 | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importdescriptors RPC.
Test importdescriptors by generating keys on node0, importing the corr... | mit |
Tesora-Release/tesora-trove | trove/common/instance.py | 6 | 3820 | # 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 |
Jetsly/pjsip-csharp | tests/pjsua/scripts-sendto/001_torture_4475_3_1_1_1.py | 59 | 1345 | # $Id: 001_torture_4475_3_1_1_1.py 2505 2009-03-12 11:25:11Z bennylp $
import inc_sip as sip
import inc_sdp as sdp
# Torture message from RFC 4475
# 3.1.1. Valid Messages
# 3.1.1.1. A Short Tortuous INVITE
complete_msg = \
"""INVITE sip:vivekg@chair-dnrc.example.com;unknownparam SIP/2.0
TO :
sip:vivekg@chair-dnrc.e... | gpl-2.0 |
z0by/pattern | test/test_en.py | 20 | 48666 | # -*- coding: utf-8 -*-
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import unittest
import random
import subprocess
from pattern import text
from pattern import en
try:
PATH = os.path.dirname(os.path.realpath(__file__))
except:
PATH = ""
#--------------------------------... | bsd-3-clause |
stefrobb/namebench | nb_third_party/dns/ttl.py | 248 | 2180 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
marianotepper/dask | dask/array/tests/test_wrap.py | 9 | 1029 | import pytest
pytest.importorskip('numpy')
from dask.array.wrap import ones
import dask.array as da
import numpy as np
import dask
def test_ones():
a = ones((10, 10), dtype='i4', chunks=(4, 4))
x = np.array(a)
assert (x == np.ones((10, 10), 'i4')).all()
def test_size_as_list():
a = ones([10, 10], dty... | bsd-3-clause |
harmy/kbengine | kbe/src/lib/python/Lib/test/test_zipfile.py | 47 | 57265 | # We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import io
import os
import sys
import imp
import time
import shutil
import struct
import zipfile
import unittest
from tempfile import TemporaryFile
from random import randint, random
from unittest import skipUnles... | lgpl-3.0 |
brendangregg/bcc | examples/networking/tc_perf_event.py | 3 | 2583 | #!/usr/bin/python
#
# tc_perf_event.py Output skb and meta data through perf event
#
# Copyright (c) 2016-present, Facebook, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
import ctypes as ct
import pyroute2
import socket
bpf_txt = """
#include <uapi/linux/if_ether.h>
#incl... | apache-2.0 |
wkritzinger/asuswrt-merlin | release/src/router/asusnatnl/pjproject-1.12/pjsip-apps/src/python/samples/call.py | 60 | 5048 | # $Id: call.py 2171 2008-07-24 09:01:33Z bennylp $
#
# SIP call sample.
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# 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 ver... | gpl-2.0 |
afrolov1/nova | nova/tests/virt/xenapi/test_vmops.py | 1 | 43955 | # Copyright 2013 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 |
HydrelioxGitHub/home-assistant | homeassistant/components/sensor/glances.py | 3 | 8776 | """
Support gathering system information of hosts which are running glances.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.glances/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor ... | apache-2.0 |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/lib/ntsecuritycon.py | 21 | 24453 | # Hacked from winnt.h
DELETE = (65536)
READ_CONTROL = (131072)
WRITE_DAC = (262144)
WRITE_OWNER = (524288)
SYNCHRONIZE = (1048576)
STANDARD_RIGHTS_REQUIRED = (983040)
STANDARD_RIGHTS_READ = (READ_CONTROL)
STANDARD_RIGHTS_WRITE = (READ_CONTROL)
STANDARD_RIGHTS_EXECUTE = (READ_CONTROL)
STANDARD_RIGHTS_ALL = (2031616)
SP... | apache-2.0 |
shakamunyi/neutron | neutron/agent/l3/ha.py | 7 | 6166 | # Copyright (c) 2014 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... | apache-2.0 |
RAtechntukan/Sick-Beard | lib/subliminal/cache.py | 59 | 4623 | # -*- coding: utf-8 -*-
# Copyright 2012 Nicolas Wack <wackou@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 Licen... | gpl-3.0 |
hantek/BinaryConnect | mnist.py | 1 | 6258 | # Copyright 2015 Matthieu Courbariaux, Zhouhan Lin
"""
This file is adapted from BinaryConnect:
https://github.com/MatthieuCourbariaux/BinaryConnect
Running this script should reproduce the results of a feed forward net trained
on MNIST.
To train a vanilla feed forward net with ordinary backprop:
... | gpl-2.0 |
sgallagher/anaconda | tests/nosetests/pyanaconda_tests/module_network_test.py | 1 | 68731 | #
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | gpl-2.0 |
remyoudompheng/forum-gtk | lib/main_window.py | 1 | 40023 | #! /usr/bin/env python2.4
# -*- coding: utf-8 -*-
# Flrn-gtk: fenêtre principale
# Rémy Oudompheng, Noël 2005
import os
import sys
import time, re
import socket
# Modules GTK
import pygtk
pygtk.require('2.0')
import gtk
import gtk.gdk
import gobject
import pango
from tempfile import mkstemp
# Modules
from grp_buffe... | gpl-3.0 |
spaceof7/QGIS | python/plugins/processing/algs/exampleprovider/ProcessingExampleProviderPlugin.py | 16 | 1742 | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : July 2013
Copyright : (C) 2013 by Victor Olaya
Email : volayaf at gmail dot com
********************************... | gpl-2.0 |
SunghanKim/numpy | numpy/_build_utils/waf.py | 71 | 15164 | from __future__ import division, absolute_import, print_function
import os
import re
import waflib.Configure
import waflib.Tools.c_config
from waflib import Logs, Utils
from .common \
import \
LONG_DOUBLE_REPRESENTATION_SRC, pyod, \
long_double_representation
DEFKEYS = waflib.Tools.c_config.DEFK... | bsd-3-clause |
datalogics/scons | test/scons-time/func/prefix.py | 2 | 2038 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... | mit |
TheNaterz/koadic | core/commands/jobs.py | 1 | 1058 | DESCRIPTION = "shows info about jobs"
def autocomplete(shell, line, text, state):
pass
def help(shell):
pass
def print_job(shell, id):
for stager in shell.stagers:
for session in stager.sessions:
for job in session.jobs:
if job.id == int(id):
job.di... | apache-2.0 |
AaronTao1990/scrapy | scrapy/xlib/lsprofcalltree.py | 149 | 3652 | # lsprofcalltree.py: lsprof output which is readable by kcachegrind
# David Allouche
# Jp Calderone & Itamar Shtull-Trauring
# Johan Dahlin
from __future__ import print_function
import optparse
import os
import sys
try:
import cProfile
except ImportError:
raise SystemExit("This script requires cProfile from P... | bsd-3-clause |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/django/contrib/postgres/validators.py | 115 | 2772 | import copy
from django.core.exceptions import ValidationError
from django.core.validators import (
MaxLengthValidator, MaxValueValidator, MinLengthValidator,
MinValueValidator,
)
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _, ungettext_lazy
clas... | gpl-3.0 |
ovnicraft/edx-platform | common/djangoapps/student/tests/test_microsite.py | 79 | 3869 | """
Test for User Creation from Micro-Sites
"""
from django.test import TestCase
from student.models import UserSignupSource
import mock
import json
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
FAKE_MICROSITE = {
"SITE_NAME": "openedx.localhost",
"university": "fakeu... | agpl-3.0 |
mcclurmc/juju | juju/unit/tests/test_lifecycle.py | 1 | 37560 | import logging
import os
import sys
import StringIO
import stat
import yaml
import zookeeper
from twisted.internet.defer import inlineCallbacks, Deferred, fail, returnValue
from juju.unit.lifecycle import (
UnitLifecycle, UnitRelationLifecycle, RelationInvoker)
from juju.unit.workflow import RelationWorkflowSta... | agpl-3.0 |
mensler/ansible | lib/ansible/plugins/terminal/dellos10.py | 14 | 2616 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Copyright (c) 2017 Dell Inc.
#
# 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 |
dpo/opal | opal/Platforms/linux.py | 2 | 1949 | import socket
import os
from ..core.platform import Platform
from ..core.platform import Task
class LINUXTask(Task):
def __init__(self,
name=None,
command=None,
sessionTag=None,
output='/dev/null',
logHandlers=[]):
Task._... | lgpl-3.0 |
krono/pycket | pycket/prims/continuation_marks.py | 1 | 2868 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from pycket import impersonators as imp
from pycket import values
from pycket.cont import call_cont
from pycket.error import SchemeException
from pycket.prims.expose import default, expose, make_callable_label, procedure
# Can use this to promote a get_cmk operation to a ... | mit |
lionel-metongnon/scanning-under-ns3 | src/visualizer/visualizer/hud.py | 189 | 5462 | import goocanvas
import core
import math
import pango
import gtk
class Axes(object):
def __init__(self, viz):
self.viz = viz
self.color = 0x8080C0FF
self.hlines = goocanvas.Path(parent=viz.canvas.get_root_item(), stroke_color_rgba=self.color)
self.hlines.lower(None)
self.vl... | gpl-2.0 |
denisff/python-for-android | python-build/python-libs/gdata/src/gdata/test_data.py | 134 | 256666 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
qgis/QGIS | python/plugins/grassprovider/ext/r_blend_rgb.py | 9 | 2176 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_blend_rgb.py
--------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
******************************... | gpl-2.0 |
idmillington/sparkle | sparkle/decorators.py | 1 | 1539 | from tokens import *
import functools
def rule(rule_definition, state=None, add_to_docstring=True):
"""A general purpose decorator-generator for methods that
represent rules. This decorator adds two attributes to the
method: the 'rule' attribute with the given rule strng in it
and the 'state' attribute... | mit |
slai11/youtube-8m | mean_average_precision_calculator.py | 17 | 4065 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/host/lib/python2.7/email/iterators.py | 415 | 2202 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debugging API.
... | gpl-2.0 |
jag1g13/lammps | tools/moltemplate/src/nbody_by_type_lib.py | 21 | 18421 | #!/usr/bin/env python
# Author: Andrew Jewett (jewett.aij at g mail)
# http://www.chem.ucsb.edu/~sheagroup
# License: 3-clause BSD License (See LICENSE.TXT)
# Copyright (c) 2012, Regents of the University of California
# All rights reserved.
import sys
from nbody_graph_search import *
#from collections impo... | gpl-2.0 |
doy/python-termcast-server | termcast_server/termcast.py | 1 | 9519 | import json
import re
import ssl
import time
import traceback
import vt100
auth_re = re.compile(b'^hello ([^ ]+) ([^ ]+)$')
extra_data_re = re.compile(b'\033\]499;([^\007]*)\007')
clear_patterns = [
b"\033[H\033[J",
b"\033[H\033[2J",
b"\033[2J\033[H",
# this one is from tmux - can't possibly imagine ... | mit |
PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/test_assign_op_npu.py | 1 | 1547 | # Copyright (c) 2021 PaddlePaddle 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 appli... | apache-2.0 |
fuselock/odoo | addons/account/project/report/analytic_balance.py | 358 | 7060 | # -*- 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 |
eirki/script.module.pywin32 | lib/x32/win32comext/propsys/pscon.py | 17 | 48201 | # hand generated from propsys.h
## PROPENUMTYPE, used with IPropertyEnumType
PET_DISCRETEVALUE = 0
PET_RANGEDVALUE = 1
PET_DEFAULTVALUE = 2
PET_ENDRANGE = 3
PDTF_DEFAULT = 0
PDTF_MULTIPLEVALUES = 0x1
PDTF_ISINNATE = 0x2
PDTF_ISGROUP = 0x4
PDTF_CANGROUPBY = 0x8
PDTF_CANSTACKBY = 0x10
PDTF_ISTREEPROPERTY = 0x20
PDTF_IN... | bsd-3-clause |
gylian/Sick-Beard | lib/unidecode/x0b6.py | 253 | 4996 | data = (
'ddyels', # 0x00
'ddyelt', # 0x01
'ddyelp', # 0x02
'ddyelh', # 0x03
'ddyem', # 0x04
'ddyeb', # 0x05
'ddyebs', # 0x06
'ddyes', # 0x07
'ddyess', # 0x08
'ddyeng', # 0x09
'ddyej', # 0x0a
'ddyec', # 0x0b
'ddyek', # 0x0c
'ddyet', # 0x0d
'ddyep', # 0x0e
'ddyeh', # 0x0f
... | gpl-3.0 |
cbenhagen/python-for-android | pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/bccache.py | 284 | 9994 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... | lgpl-2.1 |
jnayak1/osf.io | scripts/consistency/ensure_piwik_nodes.py | 46 | 1542 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Ensure all projects modified today are consistent between the OSF and Piwik
"""
import datetime
import logging
import sys
import time
from modularodm import Q
from framework.analytics import piwik
from scripts import utils as scripts_utils
from website.app import init... | apache-2.0 |
superfluidity/RDCL3D | code/translator/hot/tosca/tosca_network_port.py | 2 | 4748 | #
# 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 the ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.