repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
pchauncey/ansible | lib/ansible/modules/database/misc/riak.py | 29 | 7451 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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_METAD... | gpl-3.0 |
yamila-moreno/django | tests/admin_widgets/models.py | 99 | 4619 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class MyFileField(models.FileField):
pass
@python_2_unicode_compatible
class Member(models.Model):
name = models.CharField(max_lengt... | bsd-3-clause |
yalewoosoft/shadowsocks | speedtest/speedtest.py | 2 | 44531 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2016 Matt Martz
# 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.or... | apache-2.0 |
ASMlover/study | zeroMQ/python/req-rep/rep.py | 1 | 1660 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 ASMlover. 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
# ... | bsd-2-clause |
Psycho666/Simplicity_trlte_kernel | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/amazon/execute_lambda.py | 24 | 10649 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | bsd-3-clause |
WhatDo/FlowFairy | examples/denoise_class/diluted_net.py | 1 | 3075 | import tensorflow as tf
import tensorflow.contrib.slim as slim
from flowfairy.conf import settings
from util import lrelu, conv2d, maxpool2d
batch_size = settings.BATCH_SIZE
samplerate = sr = settings.SAMPLERATE
dropout = settings.DROPOUT
learning_rate = settings.LEARNING_RATE
discrete_class = settings.DISCRETE_CLASS
... | mit |
ThirdProject/android_external_chromium_org | chrome/common/extensions/docs/examples/apps/hello-python/main.py | 148 | 5230 | #!/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.
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import users
from go... | bsd-3-clause |
TieWei/nova | nova/scheduler/utils.py | 6 | 5282 | # 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 agreed to in... | apache-2.0 |
demarle/VTK | ThirdParty/Twisted/twisted/internet/test/test_epollreactor.py | 39 | 7386 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet.epollreactor}.
"""
from __future__ import division, absolute_import
from twisted.trial.unittest import TestCase
try:
from twisted.internet.epollreactor import _ContinuousPolling
except ImportError:
_Conti... | bsd-3-clause |
Peddle/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/forms/fields.py | 97 | 4697 | from __future__ import unicode_literals
import warnings
from django import forms
from django.utils import six
from django.utils.translation import ugettext_lazy as _
# While this couples the geographic forms to the GEOS library,
# it decouples from database (by not importing SpatialBackend).
from django.contrib.gis.... | apache-2.0 |
mattkretz/root | interpreter/llvm/src/tools/clang/tools/scan-view/ScanView.py | 48 | 25494 | import BaseHTTPServer
import SimpleHTTPServer
import os
import sys
import urllib, urlparse
import posixpath
import StringIO
import re
import shutil
import threading
import time
import socket
import itertools
import Reporter
import ConfigParser
###
# Various patterns matched or replaced by server.
kReportFileRE = re.... | lgpl-2.1 |
angelapper/edx-platform | openedx/core/djangoapps/programs/tests/test_utils.py | 2 | 45492 | """Tests covering Programs utilities."""
# pylint: disable=no-member
import datetime
import json
import uuid
import ddt
import httpretty
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
import mock
from nose.p... | agpl-3.0 |
aam-at/tensorflow | tensorflow/python/tpu/tpu_embedding_v2_cpu_test.py | 5 | 12980 | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
MariaSolovyeva/inasafe | realtime/exceptions.py | 4 | 3318 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Realtime Exception Classes.**
Custom exception classes for the IS application.
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Gene... | gpl-3.0 |
w1kke/pylearn2 | pylearn2/models/tests/test_lwta.py | 49 | 1393 | """
Tests of the LWTA functionality.
"""
__author__ = "Ian Goodfellow, Minh Ngoc Le"
import os
import numpy as np
import pylearn2
from pylearn2.utils import sharedX
from pylearn2.models.lwta import lwta
from pylearn2.scripts.tests.yaml_testing import limited_epoch_train
def test_lwta_simple():
"""Test simple ca... | bsd-3-clause |
an7oine/WinVHS | Cygwin/lib/python2.7/site-packages/Crypto/__init__.py | 27 | 1990 | # -*- 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... | gpl-3.0 |
stevetranby/cocos2dx-shader-cookbook | cocos2d/plugin/tools/toolsForGame/main.py | 265 | 3576 | import sys, string, os
from Tkinter import *
import steps
Plugins = sys.argv[1]
print Plugins
pluginList = Plugins.split(':')
maxStep = 2
curStep = 1
stepList = []
# functions
# show step on the num index
def showStep(num):
global stepList
stepNum = len(stepList)
if num >= stepNum or num <= 0 :
... | mit |
rodrigc/buildbot | master/buildbot/test/unit/data/test_sourcestamps.py | 5 | 3155 | # This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
asedunov/intellij-community | python/lib/Lib/encodings/quopri_codec.py | 116 | 2060 | """Codec for quoted-printable encoding.
Like base64 and rot13, this returns Python strings, not Unicode.
"""
import codecs, quopri
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
def quopri_encode(input, errors='strict'):
"""Encode the input, returning a tuple (outpu... | apache-2.0 |
montoyjh/pymatgen | pymatgen/apps/borg/queen.py | 5 | 4940 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module defines the BorgQueen class, which manages drones to assimilate
data using Python's multiprocessing.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
... | mit |
sdeepanshu02/microblog | flask/Lib/site-packages/jinja2/constants.py | 1169 | 1626 | # -*- coding: utf-8 -*-
"""
jinja.constants
~~~~~~~~~~~~~~~
Various constants.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
#: list of lorem ipsum words used by the lipsum() helper function
LOREM_IPSUM_WORDS = u'''\
a ac accumsan ad adipiscing aenean a... | bsd-3-clause |
kawamon/hue | desktop/core/ext-py/boto-2.46.1/boto/mashups/order.py | 153 | 7584 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | apache-2.0 |
munyirik/python | cpython/Lib/ctypes/test/test_arrays.py | 79 | 5628 | import unittest
from ctypes import *
from ctypes.test import need_symbol
formats = "bBhHiIlLqQfd"
formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
c_long, c_ulonglong, c_float, c_double, c_longdouble
class ArrayTestCase(unittest.TestCase):
def test_simple(self):
# create classes ... | bsd-3-clause |
chrsrds/scikit-learn | sklearn/experimental/enable_hist_gradient_boosting.py | 9 | 1215 | """Enables histogram-based gradient boosting estimators.
The API and results of these estimators might change without any deprecation
cycle.
Importing this file dynamically sets the
:class:`sklearn.ensemble.HistGradientBoostingClassifier` and
:class:`sklearn.ensemble.HistGradientBoostingRegressor` as attributes of th... | bsd-3-clause |
irvingpop/digital-beer-menu | src/lib/werkzeug/testsuite/wrappers.py | 66 | 26587 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests for the response and request objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import pickle
from StringIO import StringIO
from datetime import ... | gpl-2.0 |
ujenmr/ansible | lib/ansible/plugins/action/telnet.py | 52 | 3520 | # (c) 2017, Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import telnetlib
from time import sleep
from ansible.module_utils._text import to_native, to_bytes
from a... | gpl-3.0 |
RP7/R7-OCM | src/host/python/GSM/Qfunc.py | 2 | 1059 | import math
import numpy as np
def Qfuncx(t):
a = 0.
T = int(t*10000)
for x in range(T,100*10000):
v = x/10000.
a = a + (1/math.sqrt(2.*math.pi))*math.exp(0-v*v/2.)
return a/10000.
def Qfunc(t):
return 0.5-0.5*math.erf(t/math.sqrt(2.))
def Ffunc(t,B):
a = 2.*math.pi*B/math.sqrt(math.log(2.))
... | apache-2.0 |
TheMOOCAgency/edx-platform | common/lib/xmodule/xmodule/tests/test_lti20_unit.py | 174 | 17021 | # -*- coding: utf-8 -*-
"""Tests for LTI Xmodule LTIv2.0 functional logic."""
import datetime
import textwrap
from django.utils.timezone import UTC
from mock import Mock
from xmodule.lti_module import LTIDescriptor
from xmodule.lti_2_util import LTIError
from . import LogicTest
class LTI20RESTResultServiceTest(Logi... | agpl-3.0 |
mwasilew/AndroidViewClient | tests/com/dtmilano/android/viewclienttests.py | 5 | 44976 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C) 2012 Diego Torres Milano
Created on Feb 5, 2012
@author: diego
'''
import sys
import os
import time
import StringIO
import unittest
import exceptions
import platform
# PyDev sets PYTHONPATH, use it
try:
for p in os.environ['PYTHONPATH'].split(':')... | apache-2.0 |
ryfeus/lambda-packs | Skimage_numpy/source/skimage/measure/profile.py | 11 | 4753 | import numpy as np
from scipy import ndimage as ndi
def profile_line(img, src, dst, linewidth=1,
order=1, mode='constant', cval=0.0):
"""Return the intensity profile of an image measured along a scan line.
Parameters
----------
img : numeric array, shape (M, N[, C])
The image... | mit |
GenericStudent/home-assistant | homeassistant/components/nzbget/config_flow.py | 10 | 4404 | """Config flow for NZBGet."""
import logging
from typing import Any, Dict, Optional
import voluptuous as vol
from homeassistant.config_entries import CONN_CLASS_LOCAL_POLL, ConfigFlow, OptionsFlow
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
CONF_PASSWORD,
CONF_PORT,
CONF_SCAN_INTERVAL,... | apache-2.0 |
dabelenda/amm | src/api/utils.py | 1 | 5007 | """(c) All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, VPSI, 2017"""
import os
import string
import binascii
import ldap3
from django.conf import settings
from config.settings import base
def generate_random_b64(length):
"""
Generate a random string encoded with base 64
"""
... | mit |
kyroskoh/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | bsd-3-clause |
kyokyos/bioinform | royale_simulation.py | 1 | 26471 |
#royale simulation.py 版本4,最新版本
#增加了捕食者的子类,进化类,拥有更强属性,程序模拟观察后,属性值较差的捕食者被自然法则淘汰,捕食者逐步而漫长进化,这个简单模拟器可以辅助证明达尔文适者生存法则。
import random,pylab
class Island():
"""Island,n*n grid where zero value indicates an unoccupied cell."""
#生成一个n排,n列的点矩阵,矩阵是笛卡尔坐标系,x向右递增,y向上递增,(0,0)是左下角,(9,0)是右下角
#(0,9)是左上角,(9,9)是右上角
#程... | unlicense |
nitinitprof/odoo | addons/sale_margin/__openerp__.py | 261 | 1592 | ##############################################################################
#
# 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 |
prasaianooz/pip | pip/utils/outdated.py | 191 | 5555 | from __future__ import absolute_import
import datetime
import json
import logging
import os.path
import sys
from pip._vendor import lockfile
from pip._vendor.packaging import version as packaging_version
from pip.compat import total_seconds, WINDOWS
from pip.index import PyPI
from pip.locations import USER_CACHE_DIR... | mit |
splunk/splunk-webframework | contrib/tlslite/tlslite/utils/python_rsakey.py | 2 | 4436 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RSA implementation."""
from .cryptomath import *
from .asn1parser import ASN1Parser
from .rsakey import *
from .pem import *
class Python_RSAKey(RSAKey):
def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=... | apache-2.0 |
zhangg/trove | trove/tests/api/mgmt/datastore_versions.py | 1 | 6805 | # Copyright [2015] Hewlett-Packard Development Company, L.P.
#
# 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 l... | apache-2.0 |
ericdill/pyqtgraph | pyqtgraph/widgets/SpinBox.py | 25 | 19875 | # -*- coding: utf-8 -*-
from ..Qt import QtGui, QtCore
from ..python2_3 import asUnicode
from ..SignalProxy import SignalProxy
from .. import functions as fn
from math import log
from decimal import Decimal as D ## Use decimal to avoid accumulating floating-point errors
from decimal import *
import weakref
__all__ =... | mit |
gnieboer/tensorflow | tensorflow/contrib/layers/python/layers/embedding_ops.py | 26 | 41512 | # 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 |
compatibleone/accords-platform | tools/codegen/OCCI/test/TestBackendParsing.py | 1 | 3540 | import unittest
from testfixtures import LogCapture
import xml.etree.ElementTree as ET
from hamcrest import assert_that, is_, is_not, has_key, has_entry
from ConfigParser import BackendParser
from Backend import Backend
def _dump_xml_as_file(root, filename):
from xml.dom import minidom
with open(filename, 'w... | apache-2.0 |
CankingApp/cankingapp.github.io | node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | apache-2.0 |
ErickMurillo/ciat_plataforma | ficha_granos_basicos/migrations/0008_auto__del_field_insumos_rubro__del_field_gastos_rubro__del_field_monit.py | 3 | 35324 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Insumos.rubro'
db.delete_column(u'ficha_granos_basicos_... | mit |
ClearCorp-dev/odoo | addons/google_account/google_account.py | 64 | 8766 | # -*- coding: utf-8 -*-
import openerp
from openerp.http import request
from openerp.osv import osv
from openerp import SUPERUSER_ID
from openerp.tools.translate import _
from datetime import datetime
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
import werkzeug.urls
import urllib2
import simplejson
impor... | agpl-3.0 |
Evervolv/android_kernel_samsung_manta | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
N3X15/ft-engine | mysql-test/suite/tokudb/t/change_column_text.py | 54 | 1409 | import sys
def main():
print "# this test is generated by change_text.py"
print "# generate hot text expansion test cases"
print "--disable_warnings"
print "DROP TABLE IF EXISTS t;"
print "--enable_warnings"
print "SET SESSION DEFAULT_STORAGE_ENGINE=\"TokuDB\";"
print "SET SESSION TOKUDB_DIS... | gpl-2.0 |
javier-ruiz-b/docker-rasppi-images | raspberry-google-home/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py | 41 | 16886 | """
This module uses ctypes to bind a whole bunch of functions and constants from
SecureTransport. The goal here is to provide the low-level API to
SecureTransport. These are essentially the C-level functions and constants, and
they're pretty gross to work with.
This code is a bastardised version of the code found in ... | apache-2.0 |
TRox1972/youtube-dl | youtube_dl/extractor/nowtv.py | 34 | 9503 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
parse_iso8601,
parse_duration,
remove_start,
)
class NowTVBaseIE(InfoExtractor):
_VIDEO_FI... | unlicense |
sw897/make-surface | makesurface/scripts/fill_facets.py | 3 | 5868 | import fiona, rasterio, mercantile, tools, json, click
from rasterio import features, Affine, coords
import numpy as np
np.seterr(divide='ignore', invalid='ignore')
def filterBadJSON(feat):
for f in feat:
try:
yield json.loads(f)
except:
pass
def getBounds(features):
x... | mit |
DavidPu/git-repo | git_command.py | 14 | 5787 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | apache-2.0 |
bobisme/odoo | addons/hw_posbox_upgrade/__openerp__.py | 313 | 1696 | # -*- 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 |
Apoc2400/Reftag | gdata/youtube/__init__.py | 297 | 25623 | #!/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 ... | gpl-3.0 |
PX4/Firmware | Tools/upload_log.py | 3 | 4435 | #!/usr/bin/env python3
"""
Upload an ULog file to the logs.px4.io web server.
@author: Beat Kueng (beat-kueng@gmx.net)
"""
from __future__ import print_function
from argparse import ArgumentParser
from six.moves import input
import subprocess
import sys
try:
import requests
except ImportError as e:
print(... | bsd-3-clause |
deepmind/dm_control | dm_control/entities/props/duplo/duplo_test.py | 1 | 6534 | # Copyright 2019 The dm_control Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | apache-2.0 |
DelazJ/QGIS | python/plugins/processing/algs/qgis/SelectByAttribute.py | 15 | 7154 | # -*- coding: utf-8 -*-
"""
***************************************************************************
SelectByAttribute.py
---------------------
Date : May 2010
Copyright : (C) 2010 by Michael Minn
Email : pyqgis at michaelminn dot com
*******************... | gpl-2.0 |
arborh/tensorflow | tensorflow/python/ops/ragged/ragged_merge_dims_op_test.py | 6 | 9657 | # Copyright 2019 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 |
hgiemza/DIRAC | Core/Workflow/Workflow.py | 2 | 14682 | """
Workflow class is the main container of Steps and Modules
"""
import os, re, types
import xml.sax
from DIRAC.Core.Workflow.Parameter import *
from DIRAC.Core.Workflow.Module import *
from DIRAC.Core.Workflow.Step import *
from DIRAC.Core.Workflow.Utility import *
from DIRAC import S_OK, S_ERROR
__RCSID__ = "$... | gpl-3.0 |
Elleo/rockwatch | deps/lightblue/_lightblue.py | 12 | 12543 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | gpl-3.0 |
ishigem/pimouse_run_corridor | scripts/wall_trace.py | 1 | 1590 | #!/usr/bin/env python
import rospy,copy,math
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.msg import LightSensorValues
class WallStop():
def __init__(self):
self.cmd_vel = rospy.Publisher('/cmd_vel', Twist, queue_size=1)
self.sensor_values ... | gpl-3.0 |
jhoos/django | tests/file_uploads/tests.py | 42 | 23411 | #! -*- coding: utf-8 -*-
from __future__ import unicode_literals
import base64
import errno
import hashlib
import json
import os
import shutil
import tempfile as sys_tempfile
import unittest
from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.m... | bsd-3-clause |
flh/odoo | addons/auth_signup/__openerp__.py | 62 | 1573 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
dangemstar/mezzaninesource | build/lib/mezzanine/core/middleware.py | 9 | 12539 | from __future__ import unicode_literals
from future.utils import native_str
from django.contrib import admin
from django.contrib.auth import logout
from django.contrib.messages import error
from django.contrib.redirects.models import Redirect
from django.core.exceptions import MiddlewareNotUsed
from django.core.urlres... | bsd-2-clause |
hfst/hfst | test/tools/fsmbook-tests/python-scripts/FinnishOTProsody.hfst.py | 2 | 9144 | exec(compile(open('CompileOptions.py', 'rb').read(), 'CompileOptions.py', 'exec'))
comp = hfst.XreCompiler(hfst.get_default_fst_type())
def regex(name, expression):
tr = comp.compile(expression)
if name == None:
return tr
else:
comp.define_transducer(name, tr)
# Data
regex('FinnWords', "{... | gpl-3.0 |
suyashphadtare/vestasi-erp-1 | erpnext/setup/doctype/company/fixtures/india/__init__.py | 36 | 4647 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def install(company):
docs = [
{'doctype': 'Deduction Type', 'name': 'Professional Tax', 'description': 'Prof... | agpl-3.0 |
pandaoknight/leetcode | easy/rectangle-area/main.py | 1 | 1342 | class Solution(object):
def computeArea(self, A, B, C, D, E, F, G, H):
"""
:type A: int
:type B: int
:type C: int
:type D: int
:type E: int
:type F: int
:type G: int
:type H: int
:rtype: int
"""
ac = (A, C)
eg = ... | gpl-2.0 |
mozvip/Sick-Beard | lib/requests/packages/chardet2/latin1prober.py | 52 | 5078 | ######################## 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 R... | gpl-3.0 |
davzhang/helix-python-binding | org/apache/helix/store/PropertyStore.py | 1 | 4058 | # package org.apache.helix.store
#from org.apache.helix.store import *
#from java.util import Comparator
#from java.util import List
#from org.I0Itec.zkclient import DataUpdater
# Parameterized type: <T>
class PropertyStore:
def setProperty(self, key, value):
"""
Returns void
Parameters:
... | apache-2.0 |
mrabbah/snmpccgx | flask/lib/python2.7/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 536 | 2616 | from __future__ import absolute_import
import os
import time
from . import (LockBase, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# super(Symlin... | gpl-3.0 |
beafus/Recipe-Calculator-Animations | project/server/lib/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... | mit |
plotly/plotly.py | packages/python/plotly/plotly/graph_objs/choroplethmapbox/_colorbar.py | 1 | 73541 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choroplethmapbox"
_path_str = "choroplethmapbox.colorbar"
_valid_props = {
"bgcolo... | mit |
eadgarchen/tensorflow | tensorflow/contrib/kfac/examples/mlp_mnist_main.py | 15 | 1634 | # 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 |
chitrangpatel/presto | bin/DDplan.py | 2 | 19135 | #!/usr/bin/env python
from numpy import *
from Pgplot import *
class observation:
def __init__(self, dt, f_ctr, BW, numchan, cDM):
# dt in sec, f_ctr and in MHz
self.dt = dt
self.f_ctr = f_ctr
self.BW = BW
self.numchan = numchan
self.chanwidth = BW/numchan
se... | gpl-2.0 |
elaeon/ML | src/dama/data/ds.py | 1 | 18505 | import datetime
import json
import numpy as np
import pandas as pd
import dask.array as da
import dask.bag as db
import dask
from tabulate import tabulate
from dama.abc.data import AbsData
from dama.abc.conn import AbsConn
from dama.data.it import Iterator, BaseIterator, BatchIterator
from dama.utils.core import Hash, ... | apache-2.0 |
sodhacoin/sodhacoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
nortikin/sverchok | nodes/dictionary/dictionary_in.py | 2 | 5468 | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
from itertools import chain, cycl... | gpl-3.0 |
with-git/tensorflow | tensorflow/contrib/learn/python/learn/grid_search_test.py | 137 | 2035 | # 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 |
h2oai/h2o-3 | h2o-py/tests/testdir_algos/rf/pyunit_effective_parameters_rf.py | 2 | 5956 | from __future__ import print_function
import sys
import h2o
import numpy as np
from h2o.backend import H2OCluster
sys.path.insert(1,"../../../")
from tests import pyunit_utils
from h2o.estimators.random_forest import H2ORandomForestEstimator
#testing default setup of following parameters:
#distribution (available in... | apache-2.0 |
JioCloud/neutron | neutron/tests/api/admin/test_lbaas_agent_scheduler.py | 17 | 2846 | # 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 |
GetSomeBlocks/Score_Soccer | resources/lib/twisted/twisted/test/test_randbytes.py | 12 | 5242 | # Copyright (c) 2007 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{twisted.python.randbytes}.
"""
import os, sys
from twisted.trial import unittest
from twisted.python import randbytes
try:
from Crypto.Util import randpool
except ImportError:
randpool = None
class SecureRan... | mit |
applideveloper/threejs | utils/build/build.py | 24 | 2128 | #!/usr/bin/env python
import sys
if sys.version_info < (2, 7):
print("This script requires at least Python 2.7.")
print("Please, update to a newer version: http://www.python.org/download/releases/")
exit()
import argparse
import json
import os
import shutil
import tempfile
def main(argv=None):
parser = argpar... | mit |
lokirius/python-for-android | python-build/python-libs/gdata/build/lib/gdata/Crypto/Protocol/AllOrNothing.py | 226 | 10952 | """This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... | apache-2.0 |
andersroos/rankedftw | tasks/base.py | 1 | 2228 | import sys
from argparse import ArgumentTypeError, ArgumentParser
from contextlib import ExitStack
from logging import getLogger
from rocky.process import stoppable
from common.settings import config
from main.models import Region
from rocky.argparse import log_args
from rocky.process import log_exception, pid_file
... | agpl-3.0 |
pgmillon/ansible | lib/ansible/modules/network/aci/aci_tenant_ep_retention_policy.py | 19 | 10848 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
fritaly/httpie | tests/test_ssl.py | 46 | 2787 | import os
import pytest
import pytest_httpbin.certs
from requests.exceptions import SSLError
from httpie import ExitStatus
from utils import http, HTTP_OK, TESTS_ROOT
CLIENT_CERT = os.path.join(TESTS_ROOT, 'client_certs', 'client.crt')
CLIENT_KEY = os.path.join(TESTS_ROOT, 'client_certs', 'client.key')
CLIENT_PEM =... | bsd-3-clause |
joshlk/scrapy | scrapy/utils/response.py | 28 | 2998 | """
This module provides some useful functions for working with
scrapy.http.Response objects
"""
import os
import re
import weakref
import webbrowser
import tempfile
from twisted.web import http
from twisted.web.http import RESPONSES
from w3lib import html
from scrapy.http import HtmlResponse, TextResponse
from scra... | bsd-3-clause |
yannickcr/CouchPotatoServer | libs/chardet/eucjpprober.py | 215 | 3506 | ######################## 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 |
derekjchow/models | research/maskgan/sample_shuffler.py | 5 | 3156 | # 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 applicab... | apache-2.0 |
pabloborrego93/edx-platform | lms/djangoapps/course_blocks/usage_info.py | 93 | 1246 | """
Declares CourseUsageInfo class to be used by the transform method in
Transformers.
"""
from lms.djangoapps.courseware.access import _has_access_to_course
class CourseUsageInfo(object):
'''
A class object that encapsulates the course and user context to be
used as currency across block structure transf... | agpl-3.0 |
thaumos/ansible | lib/ansible/modules/network/a10/a10_server_axapi3.py | 34 | 8948 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Mischa Peters <mpeters@a10networks.com>
# Copyright: (c) 2016, Eric Chou <ericc@a10networks.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_functio... | gpl-3.0 |
fedorpatlin/ansible | test/units/modules/network/ios/test_ios_banner.py | 36 | 2330 | # 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 |
VladimirVystupkin/AMRParsing1.x | stanfordnlp/unidecode/x0d6.py | 253 | 4765 | data = (
'hyeo', # 0x00
'hyeog', # 0x01
'hyeogg', # 0x02
'hyeogs', # 0x03
'hyeon', # 0x04
'hyeonj', # 0x05
'hyeonh', # 0x06
'hyeod', # 0x07
'hyeol', # 0x08
'hyeolg', # 0x09
'hyeolm', # 0x0a
'hyeolb', # 0x0b
'hyeols', # 0x0c
'hyeolt', # 0x0d
'hyeolp', # 0x0e
'hyeolh', # 0x... | gpl-2.0 |
jmighion/ansible | lib/ansible/modules/windows/win_dsc.py | 24 | 3414 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Trond Hindenes <trond@hindenes.com>, and others
#
# 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 versio... | gpl-3.0 |
Juniper/contrail-dev-neutron | neutron/tests/unit/test_extension_security_group.py | 8 | 67616 | # Copyright (c) 2012 OpenStack Foundation.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
kkoksvik/FreeCAD | src/Mod/Plot/plotLabels/TaskPanel.py | 26 | 12911 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
F5Networks/f5-common-python | f5-sdk-dist/scripts/get-version-release.py | 1 | 2936 | #!/usr/bin/env python
# Copyright 2017 F5 Networks 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 |
AkA84/edx-platform | common/lib/xmodule/xmodule/tests/test_lti_unit.py | 98 | 22100 | # -*- coding: utf-8 -*-
"""Test for LTI Xmodule functional logic."""
import datetime
from django.utils.timezone import UTC
from mock import Mock, patch, PropertyMock
import textwrap
from lxml import etree
from webob.request import Request
from copy import copy
import urllib
from xmodule.fields import Timedelta
from x... | agpl-3.0 |
daizhengy/RDS | trove/tests/api/mgmt/storage.py | 4 | 5014 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 |
vlinhd11/vlinhd11-android-scripting | python/src/Lib/test/test_unicode_file.py | 58 | 8556 | # Test some Unicode file name semantics
# We dont test many operations on files other than
# that their names can be used with Unicode characters.
import os, glob, time, shutil
import unicodedata
import unittest
from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE
from test.test_support import TESTF... | apache-2.0 |
namccart/gnuradio | gr-digital/python/digital/qpsk.py | 49 | 7671 | #
# Copyright 2005,2006,2011 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)
# any later ve... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.