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 |
|---|---|---|---|---|---|
samfoo/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/stream.py | 673 | 2748 | # Copyright 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... | mpl-2.0 |
KousikaGanesh/purchaseandInventory | openerp/addons/stock/wizard/stock_inventory_merge.py | 57 | 3815 | # -*- 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 |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/lib/third_party/httplib2/iri2uri.py | 706 | 3828 | """
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The character... | apache-2.0 |
h3biomed/ansible | lib/ansible/modules/network/fortimanager/fmgr_secprof_dns.py | 39 | 11232 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
kalahbrown/HueBigSQL | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Protocol/__init__.py | 125 | 1573 | # -*- coding: utf-8 -*-
#
# ===================================================================
# 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,
# non-exclusive license to e... | apache-2.0 |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/http/client.py | 45 | 2786 | from __future__ import absolute_import
import sys
assert sys.version_info[0] < 3
from httplib import *
from httplib import HTTPMessage
# These constants aren't included in __all__ in httplib.py:
from httplib import (HTTP_PORT,
HTTPS_PORT,
_CS_IDLE,
_CS... | isc |
mzadel/libmapper-sc | editors/sced/sced/ScLang.py | 46 | 2479 | # -*- coding: utf-8 -*-
# sced (SuperCollider mode for gedit)
# Copyright 2009 Artem Popov and other contributors (see AUTHORS)
#
# sced 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 ve... | gpl-3.0 |
gspilio/nova | nova/api/openstack/compute/contrib/image_size.py | 38 | 3327 | # Copyright 2013 Rackspace Hosting
# 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 |
metasmile/awesome-strings | raw/chromium/grit/grit/format/policy_templates/template_formatter.py | 61 | 2591 | #!/usr/bin/env python
# Copyright (c) 2012 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 sys
from functools import partial
from grit.format.policy_templates import policy_template_generator
from grit.format.poli... | mit |
JianyuWang/neutron | neutron/tests/api/admin/test_l3_agent_scheduler.py | 43 | 4395 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
joshuajan/odoo | openerp/addons/base/res/res_country.py | 33 | 4249 | # -*- 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... | agpl-3.0 |
timoc/autokey | src/lib/gtkapp.py | 48 | 10468 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... | gpl-3.0 |
LAMBDA-HYPERON/fluids-movie | make_movie.py | 1 | 1245 | #!/usr/bin/env python
import sys
import argparse
import numpy as np
import netCDF4 as nc
import matplotlib.pyplot as plt
from matplotlib import animation
"""
This script makes a fluid animation using NetCDF data.
"""
def main ():
# Setup arguments.
parser = argparse.ArgumentParser()
parser.add_argument('input_... | apache-2.0 |
CumulusNetworks/ansible-modules-extras | packaging/os/zypper_repository.py | 73 | 9155 | #!/usr/bin/python
# encoding: utf-8
# (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
# (c) 2014, Justin Lecher <jlec@gentoo.org>
#
# 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
#... | gpl-3.0 |
godLoveLucifer/viewfinder | backend/op/create_prospective_op.py | 13 | 14304 | # -*- coding: utf-8 -*-
# Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Viewfinder CreateProspectiveOperation.
This operation creates a prospective (un-registered) user, along with the new user's identity,
default viewpoint, initial account settings, etc.
"""
__authors__ = ['andy@emailscrubbed.com (Andy Kim... | apache-2.0 |
bosstb/HaberPush | youtube_dl/extractor/rtl2.py | 8 | 3463 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class RTL2IE(InfoExtractor):
_VALID_URL = r'http?://(?:www\.)?rtl2\.de/[^?#]*?/(?P<id>[^?#/]*?)(?:$|/(?:$|[?#]))'
_TESTS = [{
'url': 'http://www.rtl2.de/sendung/grip-da... | mit |
awagnon/maraschino | modules/couchpotato.py | 3 | 14369 | from flask import render_template, request, jsonify, json, send_file
from jinja2.filters import FILTERS
from maraschino.tools import get_setting_value, requires_auth
from maraschino import logger, app, WEBROOT
import urllib2
import StringIO
import base64
import re
def couchpotato_http():
if get_setting_value('cou... | mit |
T3CHNOLOG1C/Plaidohlect | MusicBot/musicbot/exceptions.py | 14 | 2599 | import shutil
import textwrap
# Base class for exceptions
class MusicbotException(Exception):
def __init__(self, message, *, expire_in=0):
self._message = message
self.expire_in = expire_in
@property
def message(self):
return self._message
@property
def message_no_format(s... | apache-2.0 |
dboonz/polymode | Polymode/difflounge/line_sparse.py | 5 | 3516 | #
# Lined Sparse Class
#
from numpy import *
class Line(object):
def __init__(self, value=None, offset=None, offsetr=None):
self.value = asarray(value)
self.shape = self.value.shape
self.ndim = self.value.ndim
if offset is None:
offset = self.shape[0]//2
if offsetr is not None:
offset = self.shape[... | gpl-3.0 |
chinmaygarde/mojo | tools/idl_parser/idl_node.py | 125 | 5444 | #!/usr/bin/env python
# Copyright (c) 2012 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 sys
#
# IDL Node
#
# IDL Node defines the IDLAttribute and IDLNode objects which are constructed
# by the parser as it proc... | bsd-3-clause |
sadaf2605/django | django/core/checks/security/sessions.py | 57 | 2781 | from django.conf import settings
from .. import Tags, Warning, register
from ..utils import patch_middleware_message
def add_session_cookie_message(message):
return message + (
" Using a secure-only session cookie makes it more difficult for "
"network traffic sniffers to hijack user sessions."
... | bsd-3-clause |
adambrenecki/django | tests/test_utils/tests.py | 4 | 23654 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.db import connection
from django.forms import EmailField, IntegerField
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.test import SimpleTestCase, TestCase, skipIfDBFeature,... | bsd-3-clause |
helogargon/TFG | CyberCube/FrontEnd/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... | mit |
jabesq/home-assistant | tests/components/config/test_script.py | 2 | 1047 | """Tests for config/script."""
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
async def test_delete_script(hass, hass_client):
"""Test deleting a script."""
with patch.object(config, 'SECTIONS', ['script']):
await ... | apache-2.0 |
RamonGuiuGou/l10n-spain | l10n_es_payment_order/wizard/converter.py | 13 | 5316 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com)
# Pedro Tarrafeta <pedro@acysos.com>
# Ignacio Ibeas <ignacio@acysos.... | agpl-3.0 |
vjmac15/Lyilis | lib/pycparser/ast_transforms (VJ Washington's conflicted copy 2017-08-29).py | 22 | 3574 | #------------------------------------------------------------------------------
# pycparser: ast_transforms.py
#
# Some utilities used by the parser to create a friendlier AST.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# License: BSD
#------------------------------------------------------------------------------... | gpl-3.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/layout_tests/port/builders_unittest.py | 47 | 1897 | # 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... | bsd-3-clause |
mccheung/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/depends.py | 410 | 6221 | from __future__ import generators
import sys, imp, marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion, LooseVersion
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
]
class Require:
"""A prerequisite to building o... | lgpl-3.0 |
Yahvuh/Eliza | Flask/Lib/site-packages/pip/_vendor/colorama/winterm.py | 442 | 5732 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... | gpl-2.0 |
grueni75/GeoDiscoverer | Source/Platform/Target/Android/core/src/main/jni/libxml2-2.9.2/check-xinclude-test-suite.py | 347 | 5333 | #!/usr/bin/python
import sys
import time
import os
import string
sys.path.insert(0, "python")
import libxml2
#
# the testsuite description
#
DIR="xinclude-test-suite"
CONF="testdescr.xml"
LOG="check-xinclude-test-suite.log"
log = open(LOG, "w")
os.chdir(DIR)
test_nr = 0
test_succeed = 0
test_failed = 0
test_error =... | gpl-3.0 |
zofuthan/edx-platform | lms/djangoapps/discussion_api/render.py | 168 | 3644 | """
Content rendering functionality
Note that this module is designed to imitate the front end behavior as
implemented in Markdown.Sanitizer.js.
"""
import re
import markdown
# These patterns could be more flexible about things like attributes and
# whitespace, but this is imitating Markdown.Sanitizer.js, so it uses... | agpl-3.0 |
nikoonia/gem5v | ext/ply/test/yacc_notfunc.py | 174 | 1476 | # -----------------------------------------------------------------------------
# yacc_notfunc.py
#
# p_rule not defined as a function
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import... | bsd-3-clause |
cosurgi/trunk | examples/concrete/triax.py | 2 | 7273 | from __future__ import print_function
################################################################################
#
# Triaxial test. Axial strain rate is prescribed and transverse prestress.
# Test is possible on prism or cylinder
# An independent c++ engine may be created from this script in the future.
#
#######... | gpl-2.0 |
ahmadiga/min_edx | lms/djangoapps/verify_student/migrations/0012_populate_verification_deadlines.py | 61 | 14155 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""
This migration populates the "verification deadline" model with
t... | agpl-3.0 |
ma314smith/home-assistant | homeassistant/components/splunk.py | 28 | 2421 | """
Support to send data to an Splunk instance.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/splunk/
"""
import json
import logging
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_HOST, CONF_PORT, CONF_SSL, CONF_T... | mit |
Warboss-rus/wargameengine | WargameEngine/bullet/data/xacro_standalone.py | 12 | 23887 | #! /usr/bin/env python
# Copyright (c) 2013, Willow Garage, Inc.
# Copyright (c) 2014, Open Source Robotics Foundation, 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:
#
# * Redistributio... | gpl-3.0 |
theheros/kbengine | kbe/src/lib/python/Lib/plat-freebsd8/IN.py | 344 | 12956 | # Generated by h2py from /usr/include/netinet/in.h
# Included from sys/cdefs.h
__GNUCLIKE_ASM = 3
__GNUCLIKE_ASM = 2
__GNUCLIKE___TYPEOF = 1
__GNUCLIKE___OFFSETOF = 1
__GNUCLIKE___SECTION = 1
__GNUCLIKE_ATTRIBUTE_MODE_DI = 1
__GNUCLIKE_CTOR_SECTION_HANDLING = 1
__GNUCLIKE_BUILTIN_CONSTANT_P = 1
__GNUCLIKE_BUILTIN_VARA... | lgpl-3.0 |
cstan11/Sick-Beard | lib/requests/packages/chardet/mbcssm.py | 215 | 18214 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
yceruto/django | tests/utils_tests/test_module_loading.py | 5 | 8752 | import imp
from importlib import import_module
import os
import sys
import unittest
from zipimport import zipimporter
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
from django.test.utils import override_settings
from django.utils import six
from django.utils.module_load... | bsd-3-clause |
OpenUpgrade/OpenUpgrade | addons/hr_attendance/wizard/hr_attendance_error.py | 377 | 2896 | # -*- 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 |
0xFelix/python-viessmann-tools | viessmanntools/vitoreset.py | 1 | 7193 | from contextlib import contextmanager
from datetime import datetime
from enum import Enum
from json import dumps
from locale import LC_TIME, setlocale
from signal import SIGINT, SIGTERM, signal
from subprocess import TimeoutExpired
from time import sleep
from threading import Event
import paho.mqtt.client as mqtt
impor... | gpl-3.0 |
dharmabumstead/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_scaleset_facts.py | 13 | 7164 | #!/usr/bin/python
#
# Copyright (c) 2017 Sertac Ozercan, <seozerca@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 |
hujiajie/chromium-crosswalk | tools/win/sizeviewer/sizeviewer.py | 46 | 7024 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import codecs
import json
import os
import string
import subprocess
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def Ru... | bsd-3-clause |
kanagasabapathi/python-for-android | python-build/python-libs/gdata/src/atom/http_interface.py | 133 | 5183 | #!/usr/bin/python
#
# Copyright (C) 2008 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 |
oouyang/fxos-certsuite | mcts/web-platform-tests/tests/tools/pywebsocket/src/mod_pywebsocket/util.py | 18 | 13818 | # Copyright 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... | mpl-2.0 |
mkeyran/EmotionRecognizer | training.py | 1 | 1567 | import nn_learn
import pickle
import base_model
dat = pickle.load(open("data/TrainingData/pickled_generated_sets", 'rb'))
pca_dat = pickle.load(open("data/TrainingData/pickled_generated_sets_pca", 'rb'))
model = nn_learn.NeuralNetwork(nn_learn.neural_net9_pca_lr03)
d = pca_dat
model.train(d["train_data"], d["tr... | mit |
lmjohns3/downhill | downhill/__init__.py | 1 | 4167 | from .adaptive import *
from .base import build, Optimizer
from .dataset import Dataset
from .first_order import *
__version__ = '0.5.0pre'
def minimize(loss, train, valid=None, params=None, inputs=None, algo='rmsprop',
updates=(), monitors=(), monitor_gradients=False, batch_size=32,
train_... | mit |
ReachingOut/unisubs | apps/messages/tests.py | 2 | 21327 | # -*- coding: utf-8 -*-
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# 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 the Free Software Foundation, either version 3 of the
#... | agpl-3.0 |
adhoc-dev/oca-account-financial-tools | account_fiscal_position_vat_check/account_invoice.py | 26 | 2832 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Account Fiscal Position VAT Check module for OpenERP
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free so... | agpl-3.0 |
akosyakov/intellij-community | python/lib/Lib/site-packages/django/test/simple.py | 73 | 15048 | import sys
import signal
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases import ... | apache-2.0 |
cchurch/ansible | test/units/modules/storage/netapp/test_netapp_e_asup.py | 56 | 7858 | # (c) 2018, NetApp Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import json
from ansible.modules.storage.netapp.netapp_e_asup import Asup
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
__metaclass__ = type
from uni... | gpl-3.0 |
Kongsea/tensorflow | tensorflow/python/tools/optimize_for_inference.py | 106 | 4714 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
xzYue/odoo | addons/l10n_us/__openerp__.py | 341 | 1763 | # -*- 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 |
jart/tensorflow | tensorflow/contrib/solvers/python/ops/linear_equations.py | 36 | 5609 | # 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 |
gbaty/pyside2 | tests/signals/signal_emission_gui_test.py | 3 | 4080 | #!/usr/bin/env python
"""Tests covering signal emission and receiving to python slots"""
import unittest
from PySide2.QtCore import QObject, SIGNAL, SLOT
try:
from PySide2.QtWidgets import QSpinBox, QPushButton
hasQtGui = True
except ImportError:
hasQtGui = False
from helper import BasicPySlotCase, Use... | lgpl-2.1 |
vmarkovtsev/django | django/contrib/gis/db/backends/mysql/operations.py | 328 | 2746 | from django.contrib.gis.db.backends.base.adapter import WKTAdapter
from django.contrib.gis.db.backends.base.operations import \
BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import aggregates
from django.db.backends.mysql.operations import D... | bsd-3-clause |
mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/tvm/nnvm/python/nnvm/testing/mobilenet_v2.py | 1 | 1220 | """
MobileNetV2, load model from gluon model zoo
Reference:
Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation
https://arxiv.org/abs/1801.04381
"""
from .utils import create_workload
from ..frontend.mxnet import _from_mxnet_impl
def get_workload(batch_size, num_... | apache-2.0 |
Communities-Communications/cc-odoo | addons/print_receipt/reports/account_voucher.py | 1 | 1173 | # -*- coding: utf-8 -*-
import time
from openerp.report import report_sxw
from openerp import pooler
from openerp.tools.amount_to_text_pt import amount_to_text
class account_voucher(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_voucher, self).__init__(cr, uid, name, cont... | agpl-3.0 |
johnkit/vtk-dev | IO/EnSight/Testing/Python/EnSightSelectArrays.py | 20 | 1547 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInte... | bsd-3-clause |
cjhak/b2share | invenio/legacy/websearch/scripts/webcoll.py | 6 | 3085 | # This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 o... | gpl-2.0 |
jdmmiranda307/dataviva-api | tests/api/test_hedu_api.py | 3 | 1241 | from test_base import BaseTestCase
class TestHeduApiTests(BaseTestCase):
def test_should_respond_ok_to_hedu_path(self):
response = self.client.get('/hedu/year/')
self.assert_200(response)
def test_should_check_if_all_years_are_loaded(self):
response = self.client.get('/hedu/year/?orde... | mit |
baliga-lab/pf1010-web | aqxWeb/api.py | 1 | 4401 | from aqxWeb.dao.users import UserDAO
from aqxWeb.dao.systems import SystemDAO
from aqxWeb.dao.metadata import MetadataDAO
from aqxWeb.dao.subscriptions import SubscriptionDAO
from aqxWeb.dao.measurements import MeasurementDAO
from collections import defaultdict
import json
class API:
def __init__(self, app):
... | lgpl-3.0 |
zcbenz/cefode-chromium | ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py | 5 | 23962 | #!/usr/bin/python
# Copyright (c) 2012 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 script packages the PNaCl translator files as:
(1) a Chrome Extension (crx), which can be used as a straight-forward CRX,
... | bsd-3-clause |
willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/gunicorn/app/django_wsgi.py | 87 | 4363 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
""" module used to build the django wsgi application """
from __future__ import print_function
import os
import re
import sys
import time
try:
from StringIO import StringIO
except:
fr... | mit |
yade/trunk | examples/simple-scene/simple-scene-energy-tracking.py | 2 | 4828 | #!/usr/bin/python
# -*- coding: utf-8 -*-
############################################
##### interesting parameters #####
############################################
# Cundall non-viscous damping
# try zero damping and watch total energy...
from __future__ import print_function
damping = 0.2
# initial angula... | gpl-2.0 |
wangcy6/storm_app | frame/c++/webrtc-master/tools_webrtc/sslroots/generate_sslroots.py | 4 | 6554 | # -*- coding:utf-8 -*-
# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All ... | apache-2.0 |
esno/polartray | src/protobuf/act_samples_pb2.py | 1 | 15529 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobuf/act_samples.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflect... | mit |
nviennot/rethinkdb | test/interface/dead_machine_issues.py | 7 | 2742 | #!/usr/bin/env python
# Copyright 2010-2012 RethinkDB, all rights reserved.
import sys, os, time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, http_admin, scenario_common
from vcoptparse import *
op = OptParser()
scenario_common.prepare_option_parser... | agpl-3.0 |
talha81/TACTIC-DEV | src/tactic/command/watch_drop_folder.py | 1 | 17599 | ############################################################
#
# Copyright (c) 2012, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way witho... | epl-1.0 |
florian-dacosta/OCB | 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 |
lexyan/SickBeard | lib/hachoir_metadata/filter.py | 90 | 1668 | from lib.hachoir_metadata.timezone import UTC
from datetime import date, datetime
# Year in 1850..2030
MIN_YEAR = 1850
MAX_YEAR = 2030
class Filter:
def __init__(self, valid_types, min=None, max=None):
self.types = valid_types
self.min = min
self.max = max
def __call__(self, value):
... | gpl-3.0 |
xyb994/housing | ssu_housing/contrib/sites/migrations/0003_set_site_domain_and_name.py | 1 | 1162 | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations... | mit |
diego-d5000/MisValesMd | env/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py | 1 | 25383 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
from __future__ import unicode_literals
# Python, ctypes and types dependencies.
from ctypes import addressof, byref, c_double
from django.contrib.gis.gdal.error import SRSException
from django.con... | mit |
digimarc/django | django/contrib/sites/models.py | 22 | 3243 | from __future__ import unicode_literals
import string
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugett... | bsd-3-clause |
LiuVII/Self-driving-RC-car | capture.py | 1 | 2906 | from __future__ import print_function
import os, sys, re
import time, datetime
import numpy as np
import signal, atexit
from subprocess import Popen, PIPE, STDOUT
import subprocess
def ctrl_c_handler(signum, frame):
print ("\rStopping... Time Elapsed: %s" % time.strftime("%H:%M:%S", time.gmtime(time.tim... | mit |
marshall007/rethinkdb | external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_output_test.py | 496 | 12051 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | agpl-3.0 |
dc3-plaso/dfvfs | dfvfs/file_io/vhdi_file_io.py | 1 | 4312 | # -*- coding: utf-8 -*-
"""The VHD image file-like object."""
import pyvhdi
from dfvfs.file_io import file_object_io
from dfvfs.lib import errors
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import resolver
class VHDIFile(file_object_io.FileObjectIO):
"""Class that implements a file-lik... | apache-2.0 |
mszczodrak/openthread | tools/harness-automation/cases/router_5_1_4.py | 16 | 1875 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# 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
# notic... | bsd-3-clause |
houshengbo/nova_vmware_compute_driver | nova/tests/fake_crypto.py | 29 | 5329 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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/li... | apache-2.0 |
elifesciences/elife-ga | setup.py | 2 | 1126 | from setuptools import setup
MODULE = 'elife_ga_metrics' # name of the subdirectory your code resides in
NAME = 'elife-ga-metrics' # project name
AUTHORS = ["Luke Skibinski <l.skibinski@elifesciences.org>"] # list of all contributing authors
LICENCE = 'GPLv3' # licence short name
COPYRIGHT = 'eLife Sciences' # copyrig... | gpl-3.0 |
thumbimigwe/echorizr | lib/python2.7/site-packages/django/core/cache/__init__.py | 230 | 3806 | """
Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client ... | mit |
foobnix/foobnix | foobnix/util/bean_utils.py | 3 | 2333 | #-*- coding: utf-8 -*-
'''
Created on 20 окт. 2010
@author: ivan
'''
import os
import logging
from foobnix.gui.model import FDModel, FModel
from foobnix.util.text_utils import normalize_text
from foobnix.fc.fc import FC
from foobnix.fc.fc_cache import FCache
def update_parent_for_beans(beans, parent):
for bean i... | gpl-3.0 |
andykimpe/chromium-test-npapi | tools/cygprofile/PRESUBMIT.py | 52 | 1141 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for cygprofile.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API b... | bsd-3-clause |
0xPoly/ooni-probe | ooni/resources/update.py | 5 | 1416 | import os
from twisted.internet import defer
from twisted.web.client import downloadPage
from ooni.resources import inputs, geoip, resources_directory
from ooni.utils import unzip, gunzip
@defer.inlineCallbacks
def download_resource(resources):
for filename, resource in resources.items():
print "Downloa... | bsd-2-clause |
foufou55/Sick-Beard | lib/requests/packages/chardet/charsetprober.py | 216 | 1914 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All ... | gpl-3.0 |
JianyuWang/neutron | neutron/tests/unit/objects/test_base.py | 8 | 13607 | # 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
# d... | apache-2.0 |
alazaro/tennis_tournament | django/contrib/sessions/backends/cache.py | 55 | 1979 | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
KEY_PREFIX = "django.contrib.sessions.cache"
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
su... | gpl-3.0 |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/tests/contenttypes_tests/test_models.py | 5 | 10780 | from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType, ContentTypeManager
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.shortcuts import get_current_site
from django.http import Http404, HttpRequest
from django.test import TestCase, overri... | apache-2.0 |
ceeblet/OST_PythonCertificationTrack | Python2/IntroGUI/src/tkdemo.py | 1 | 1298 | from tkinter import *
class Application(Frame):
def say_hi(self):
print("Hi there, everyone!")
def createWidgets(self):
self.hi_there = Button(self, text="Hello", fg="blue", command=self.say_hi)
#be careful of this. the () at the end of the command will call the comman... | mit |
waltBB/neutron_read | neutron/agent/l2population_rpc.py | 6 | 11961 | # Copyright (c) 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... | apache-2.0 |
masood-anwer/Aspose_Words_Java | Plugins/Aspose_Words_Java_for_Jython/asposewords/programming_documents/ProcessComments.py | 4 | 2560 | from asposewords import Settings
from com.aspose.words import Document
from com.aspose.words import NodeType
from com.aspose.words import SaveFormat
#from java.util import ArrayList
class ProcessComments:
def __init__(self):
dataDir = Settings.dataDir + 'programming_documents/'
# Open th... | mit |
jkDesignDE/ScriptumX | ScriptumX/X/tests.py | 9 | 1045 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
"""
import django
from django.test import TestCase
# TODO: Configure your database in settings.py and sync before running tests.
class ViewTest(TestCase):
"""Tests for the application views."""
... | gpl-3.0 |
dyoung418/tensorflow | tensorflow/contrib/factorization/examples/mnist.py | 136 | 11854 | # 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 |
pedroma/python-linkedin | tests/linkedin_test.py | 8 | 2542 | from tests import *
from linkedin import linkedin
from random import randint
class LinkedInMethodsTestBase:
@classmethod
def set_up_class(cls, gae):
cls._gae = gae
cls.api = linkedin.LinkedIn(API_KEY, SECRET_KEY, RETURN_URL, gae)
cls.api.request_token()
print "------------... | mit |
PeterWangIntel/chromium-crosswalk | tools/perf/measurements/page_cycler.py | 17 | 6434 | # Copyright 2012 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.
"""The page cycler measurement.
This measurement registers a window load handler in which is forces a layout and
then records the value of performance.now()... | bsd-3-clause |
sjshank/spotEmployee | node_modules/npm/node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | epl-1.0 |
abacuspix/NFV_project | Mastering Flask_Code Bundle/chapter_8/webapp/controllers/rest/parsers.py | 11 | 1408 | from flask.ext.restful import reqparse
user_post_parser = reqparse.RequestParser()
user_post_parser.add_argument('username', type=str, required=True)
user_post_parser.add_argument('password', type=str, required=True)
post_get_parser = reqparse.RequestParser()
post_get_parser.add_argument('page', type=int, location=['... | mit |
joeyt83/androguard | androguard/decompiler/dad/basic_blocks.py | 34 | 10681 | # This file is part of Androguard.
#
# Copyright (c) 2012 Geoffroy Gueguen <geoffroy.gueguen@gmail.com>
# 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://... | apache-2.0 |
phillipwei/crazyflie-clients-python | lib/cflib/crazyflie/log.py | 22 | 22076 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | gpl-2.0 |
NeuralEnsemble/neuroConstruct | lib/jython/Lib/test/test_zipfile64.py | 158 | 4421 | # Tests of the full ZIP64 functionality of zipfile
# The test_support.requires call is the only reason for keeping this separate
# from test_zipfile
from test import test_support
# XXX(nnorwitz): disable this test by looking for extra largfile resource
# which doesn't exist. This test takes over 30 minutes to run in ... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.