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 |
|---|---|---|---|---|---|
40223226/2015cdbg8_6-22 | static/Brython3.1.1-20150328-091302/Lib/_sre.py | 622 | 51369 | # NOT_RPYTHON
"""
A pure Python reimplementation of the _sre module from CPython 2.4
Copyright 2005 Nik Haldimann, licensed under the MIT license
This code is based on material licensed under CNRI's Python 1.6 license and
copyrighted by: Copyright (c) 1997-2001 by Secret Labs AB
"""
MAXREPEAT = 2147483648
#import ar... | gpl-3.0 |
marcoitur/Freecad_test | src/Mod/Arch/ArchServer.py | 16 | 8359 | #***************************************************************************
#* *
#* Copyright (c) 2015 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
sa2812/udacity | ud120/final_project/poi_email_addresses.py | 23 | 3483 | def poiEmails():
email_list = ["kenneth_lay@enron.net",
"kenneth_lay@enron.com",
"klay.enron@enron.com",
"kenneth.lay@enron.com",
"klay@enron.com",
"layk@enron.com",
"chairman.ken@enron.com",
"jeffreyskilling@yahoo.com",
... | mit |
Kongsea/tensorflow | tensorflow/python/kernel_tests/distributions/bijector_test.py | 75 | 5536 | # 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 |
chatcannon/numpy | numpy/f2py/setup.py | 158 | 3925 | #!/usr/bin/env python
"""
setup.py for installing F2PY
Usage:
python setup.py install
Copyright 2001-2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIE... | bsd-3-clause |
dpinney/omf | omf/scratch/disaggDataGeneration/regression/code/batchData.py | 1 | 9220 | # break out of code on keyboard interrupt -------------------------------------
import os, signal
def signalHandler(signal, frame):
os._exit(1)
signal.signal(signal.SIGINT, signalHandler)
# imports ---------------------------------------------------------------------
import pathlib, time, csv
import numpy as np... | gpl-2.0 |
vandaele/light-automation | loop_write.py | 1 | 1125 | #! /usr/bin/env python
# -*- coding:utf-8 -*-
import random
import time
from automaton_client import AutomatonClient
SERVER_HOST = "localhost"
SERVER_PORT = 1502
SLEEP_INTERVAL = 5
# sets on only 6 randomly chosen panels
def random6():
regs_values = [0] * 23
indices = []
while len(indices) < 6:
... | mit |
kylerbrown/bark | bark/io/rhd/read_one_data_block.py | 2 | 2839 | #! /bin/env python
#
# Michael Gibson 23 April 2015
import sys, struct
import numpy as np
def read_one_data_block(data, header, indices, fid):
"""Reads one 60-sample data block from fid into data, at the location indicated by indices."""
# In version 1.2, we moved from saving timestamps as unsigned... | gpl-2.0 |
mxia/engine | testing/legion/examples/subprocess/subprocess_test.py | 15 | 4531 | #!/usr/bin/env python
# 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.
"""A host test module demonstrating interacting with remote subprocesses."""
import argparse
import logging
import os
import sys
impor... | bsd-3-clause |
dbrnz/PythonQtCopy | examples/NicePyConsole/pygments/lexers/r.py | 5 | 23786 | # -*- coding: utf-8 -*-
"""
pygments.lexers.r
~~~~~~~~~~~~~~~~~
Lexers for the R/S languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, words, do_insertions
from ... | lgpl-2.1 |
twalpole/selenium | py/test/selenium/webdriver/common/interactions_tests.py | 6 | 8691 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
oeeagle/quantum | neutron/services/loadbalancer/plugin.py | 5 | 13631 | #
# Copyright 2013 Radware LTD.
#
# 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 agr... | apache-2.0 |
sarthakmeh03/django | django/contrib/syndication/views.py | 59 | 8751 | from __future__ import unicode_literals
from calendar import timegm
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404, HttpResponse
from django.template import Templat... | bsd-3-clause |
snikch/dotfiles | vim/plugin/editorconfig-core-py/editorconfig/fnmatch.py | 16 | 3872 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | mit |
kntem/webdeposit | modules/bibformat/lib/elements/bfe_notes.py | 36 | 2310 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
## ... | gpl-2.0 |
pluckljn/paimei | pydbg_server.py | 6 | 5899 | #!c:\python\python.exe
#
# PyDBG
# Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com>
#
# $Id: pydbg_server.py 194 2007-04-05 15:31:53Z cameron $
#
'''
@author: Pedram Amini
@contact: pedram.amini@gmail.com
@organization: www.openrce.org
'''
import socket
import sys
import threading... | gpl-2.0 |
Thanathan-k/EyeWitness | EyeWitness.py | 1 | 26019 | #!/usr/bin/env python
import argparse
import glob
import os
import re
import shutil
import signal
import sys
import time
import webbrowser
from modules import db_manager
from modules import objects
from modules import phantomjs_module
from modules import rdp_module
from modules import selenium_module
from modules imp... | gpl-3.0 |
ovilab/lammps | tools/eff/bohr2ang.py | 57 | 2023 | Info="""
Module name: bohr2ang.py
Author: (c) Andres Jaramillo-Botero
California Institute of Technology
ajaramil@caltech.edu
Project: pEFF
Version: August 2009
Usage: python bohr2ang.py
>>Name of data file (bohr): [datafile]
Results:
creates a datafile with extension .ang in real units
"""
import os
currdir=os.g... | gpl-2.0 |
nya282828/nyagarage | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | mit |
markflyhigh/incubator-beam | sdks/python/apache_beam/io/gcp/pubsub_it_pipeline.py | 1 | 3590 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
hyperized/ansible | lib/ansible/modules/cloud/rackspace/rax_keypair.py | 52 | 4747 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
tacketar/lstore | doc/conf.py | 3 | 9619 | # -*- coding: utf-8 -*-
#
# LStore documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 26 17:15:51 2016.
#
# 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
# autogenerated file.
#
# Al... | apache-2.0 |
xyzz/vcmi-build | project/jni/python/src/Lib/plat-irix6/readcd.py | 132 | 8576 | # Class interface to the CD module.
from warnings import warnpy3k
warnpy3k("the readcd module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
import cd, CD
class Error(Exception):
pass
class _Stop(Exception):
pass
def _doatime(self, cb_type, data):
if ((data[0] * 60) + data[1]) * 75 + data[2]... | lgpl-2.1 |
jiyeqian/labelImg | libs/canvas.py | 1 | 24545 |
try:
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
except ImportError:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
#from PyQt4.QtOpenGL import *
from libs.shape import Shape
from libs.lib import distance
CURSOR_DEFAULT = Qt.ArrowCursor
CURSOR_POINT =... | mit |
bionikspoon/python_hangman | tests/test_hangman.py | 2 | 3277 | #!/usr/bin/env python
# coding=utf-8
"""
test_hangman
----------------------------------
Tests for `Hangman` model.
"""
from pytest import fixture, raises
from hangman.model import Hangman, GameWon, GameLost
@fixture
def game():
return Hangman(answer='hangman')
def test_new_game_returns_game_instance_with_an... | mit |
amarian12/p2pool-adaptive-smc | wstools/Namespaces.py | 292 | 9396 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... | gpl-3.0 |
leightonshank/google-python-exercises | copyspecial/copyspecial.py | 1 | 1949 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
import os
import shutil
import commands
"""Copy Special exercise
"""
d... | apache-2.0 |
mrichart/ns-3-dev-git | src/wimax/bindings/modulegen__gcc_LP64.py | 19 | 796055 | 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 |
kerr-huang/SL4A | python/src/Lib/ctypes/test/__init__.py | 90 | 7110 | import os, sys, unittest, getopt, time
use_resources = []
class ResourceDenied(Exception):
"""Test skipped because it requested a disallowed resource.
This is raised when a test calls requires() for a resource that
has not be enabled. Resources are defined by test modules.
"""
def is_resource_enabl... | apache-2.0 |
tdhopper/scikit-learn | sklearn/metrics/cluster/__init__.py | 312 | 1322 | """
The :mod:`sklearn.metrics.cluster` submodule contains evaluation metrics for
cluster analysis results. There are two forms of evaluation:
- supervised, which uses a ground truth class values for each sample.
- unsupervised, which does not and measures the 'quality' of the model itself.
"""
from .supervised import ... | bsd-3-clause |
netsamir/dotfiles | files/vim/bundle/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/completion/imports.py | 13 | 4703 | # -----------------
# own structure
# -----------------
# do separate scopes
def scope_basic():
from import_tree import mod1
#? int()
mod1.a
#? []
import_tree.a
#? []
import_tree.mod1
import import_tree
#? str()
import_tree.a
def scope_pkg():
import import_tree.mod1
... | unlicense |
SrNetoChan/QGIS | tests/src/python/test_qgsserver_wmts.py | 19 | 11988 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer WMTS.
From build dir, run: ctest -R PyQgsServerWMTS -V
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the Lic... | gpl-2.0 |
dashea/anaconda | tests/regex_tests/hostname_test.py | 9 | 6530 | #!/usr/bin/python3
# vim:set fileencoding=utf-8
#
# Copyright (C) 2014 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 pr... | gpl-2.0 |
factorlibre/openerp-server-6.1 | openerp/report/render/rml2html/rml2html.py | 14 | 16210 | # -*- 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 |
alrusdi/lettuce | tests/integration/lib/Django-1.3/django/contrib/contenttypes/generic.py | 155 | 17218 | """
Classes allowing "generic" relations through ContentType and object-id fields.
"""
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import signals
from django.db import models, router, DEFAULT_DB_ALIAS
from django.db.models.fields.related import RelatedFi... | gpl-3.0 |
silverapp/silver | silver/models/transactions/transaction.py | 1 | 11691 | # Copyright (c) 2017 Presslabs SRL
#
# 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 writ... | apache-2.0 |
krzykwas/rhqagent | pyagent/data/sender/implementation/RHQDataSender.py | 1 | 6157 | #-*- coding: utf-8 -*-
#
# Krzysztof „krzykwas” Kwaśniewski
# Gdańsk, 21-06-2012
#
# 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 late... | gpl-3.0 |
probprog/pyprob | tests/test_state.py | 1 | 4307 | import unittest
import pyprob
from pyprob import util, state, Model
from pyprob.distributions import Categorical, Normal
class StateTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
self._root_function_name = self.test_state_address.__code__.co_name
super().__init__(*args, **kwarg... | bsd-2-clause |
lesina/Hack70 | env/lib/python3.5/site-packages/PIL/JpegImagePlugin.py | 7 | 26462 | #
# The Python Imaging Library.
# $Id$
#
# JPEG (JFIF) file handling
#
# See "Digital Compression and Coding of Continuous-Tone Still Images,
# Part 1, Requirements and Guidelines" (CCITT T.81 / ISO 10918-1)
#
# History:
# 1995-09-09 fl Created
# 1995-09-13 fl Added full parser
# 1996-03-25 fl Added hack to use t... | gpl-3.0 |
CasparLi/calibre | setup/install.py | 6 | 13659 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys, os, textwrap, subprocess, shutil, tempfile, atexit, glob
from setup imp... | gpl-3.0 |
metajack/skia | third_party/harfbuzz/contrib/tables/mirroring-parse.py | 53 | 1658 | import sys
# http://www.unicode.org/Public/UNIDATA/auxiliary/BidiMirroring.txt
# This parses a file in the format of the above file and outputs a table
# suitable for bsearch(3). This table maps Unicode code points to their
# 'mirror'. (Mirroring is used when rendering RTL characters, see the Unicode
# standard). By ... | bsd-3-clause |
julienbaladier/fuddly | libs/external_modules.py | 1 | 3956 | ################################################################################
#
# Copyright 2014-2016 Eric Lacombe <eric.lacombe@security-labs.org>
#
################################################################################
#
# This file is part of fuddly.
#
# fuddly is free software: you can redistribute ... | gpl-3.0 |
wanghongjuan/crosswalk-test-suite | webapi/tct-jsenhance-html5-tests/inst.apk.py | 1996 | 3186 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
mlperf/training_results_v0.6 | Google/benchmarks/mask/implementations/tpu-v3-256-mask/mask_rcnn/eval_multiprocess.py | 3 | 3368 | # Copyright 2018 Google. 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 agree... | apache-2.0 |
pgroudas/pants | src/python/pants/option/ranked_value.py | 9 | 3134 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
class ... | apache-2.0 |
yongshengwang/builthue | desktop/core/ext-py/Django-1.4.5/tests/regressiontests/db_typecasts/tests.py | 42 | 2397 | # Unit tests for typecast functions in django.db.backends.util
import datetime
from django.db.backends import util as typecasts
from django.utils import unittest
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8, 11)),
('1990-01-01',... | apache-2.0 |
damdam-s/OpenUpgrade | addons/website_certification/__openerp__.py | 320 | 1562 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
gaddman/ansible | lib/ansible/module_utils/azure_rm_common.py | 7 | 55022 | # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import os
import re
import types
import copy
import inspect
import traceback
import json
from os.path import e... | gpl-3.0 |
sadleader/odoo | addons/account/wizard/account_fiscalyear_close_state.py | 297 | 3130 | # -*- 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 |
criccomini/airflow | tests/contrib/executors/test_kubernetes_executor.py | 7 | 5660 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/__init__.py | 838 | 1384 | '''
Debian and other distributions "unbundle" requests' vendored dependencies, and
rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
The problem with this is that not only requests itself imports those
dependencies, but third-party code outside of the distros' control too.
In reaction to t... | mit |
sadig/DC2 | components/dc2-distrotools/dc2/distrotools/__init__.py | 2 | 1054 | # -*- coding: utf-8 -*-
#################################################################################
#
# (DC)² - DataCenter Deployment Control
# Copyright (C) 2010, 2011, 2012, 2013, 2014 Stephan Adig <sh@sourcecode.de>
# This program is free software; you can redistribute it and/or modify
# it under ... | gpl-2.0 |
NeovaHealth/odoo | addons/l10n_be/wizard/l10n_be_vat_intra.py | 332 | 14728 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Adapted by Noviat to
# - make the 'mand_id' field optional
# - support Noviat tax code scheme
#... | agpl-3.0 |
gheinrich/DIGITS-GAN | digits/dataset/images/forms.py | 1 | 1583 | # Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import wtforms
from wtforms import validators
from ..forms import DatasetForm
from .job import ImageDatasetJob
from digits import utils
class ImageDatasetForm(DatasetForm):
"""
Defines the form used t... | bsd-3-clause |
mja054/swift_plugin | test/probe/test_object_failures.py | 5 | 7314 | #!/usr/bin/python -u
# Copyright (c) 2010-2011 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 required by applica... | apache-2.0 |
benklaasen/namebench | nb_third_party/dns/namedict.py | 248 | 2107 | # 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 |
JoePelz/SAM | spec/python/models/test_user.py | 2 | 2858 | # importing db_connection has the side effect of setting the test database.
from spec.python import db_connection
from sam.models.user import User
sub_id = db_connection.default_sub
session = {}
def logout():
session.clear()
def login():
user = User(session)
user.logged_in = True
user.name = 'Test ... | gpl-3.0 |
LCAV/linvpy | setup.py | 1 | 3335 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='linvpy',
version=... | bsd-2-clause |
Immortalin/python-for-android | python-build/python-libs/gdata/samples/base/baseItemTypesQueryExample.py | 89 | 1279 | #!/usr/bin/python
#
# Copyright (C) 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 ... | apache-2.0 |
maelnor/nova | nova/scheduler/filters/exact_core_filter.py | 20 | 1827 | # 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
#
# Unles... | apache-2.0 |
mezz64/home-assistant | homeassistant/components/meteo_france/weather.py | 7 | 5807 | """Support for Meteo-France weather service."""
import logging
import time
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_PRECIPITATION,
ATTR_FORECAST_TEMP,
ATTR_FORECAST_TEMP_LOW,
ATTR_FORECAST_TIME,
ATTR_FORECAST_WIND_BEARING,
ATTR_FORECAST_WIND_SPEE... | apache-2.0 |
EverythingMe/recat | logcatcolor/reader.py | 1 | 3959 | """
logcat-color
Copyright 2012, Marshall Culpepper
Licensed under the Apache License, Version 2.0
Logcat I/O stream readers and helpers
"""
import asyncore
import asynchat
from cStringIO import StringIO
import fcntl
import inspect
import pyretrace
from logcatcolor.format import Format, detect_format
from logcatcolor... | apache-2.0 |
RandolphVI/CNN-Text-Classification | HAN/text_han.py | 1 | 9368 | # -*- coding:utf-8 -*-
__author__ = 'Randolph'
import tensorflow as tf
from tensorflow.contrib.layers import batch_norm
class TextHAN(object):
"""A HAN for text classification."""
def __init__(
self, sequence_length, vocab_size, embedding_type, embedding_size, lstm_hidden_size,
fc_hi... | apache-2.0 |
richardcs/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_custom_attributes.py | 19 | 7309 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright, (c) 2018, Ansible Project
# Copyright, (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ =... | gpl-3.0 |
fuselock/odoo | addons/hr_payroll/report/__init__.py | 427 | 1161 | #-*- 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 |
datalogics/scons | test/option/debug-nomemoizer.py | 2 | 1812 | #!/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 |
Pablo126/SSBW | Tarea3/tarea3/lib/python3.5/site-packages/pip/_vendor/html5lib/treebuilders/dom.py | 435 | 8835 | from __future__ import absolute_import, division, unicode_literals
from collections import MutableMapping
from xml.dom import minidom, Node
import weakref
from . import base
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
... | gpl-3.0 |
yvaucher/hr | __unported__/hr_policy_absence/hr_policy_absence.py | 3 | 3772 | #-*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# 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, eith... | agpl-3.0 |
tapanagupta/mi-instrument | mi/platform/responses.py | 10 | 1549 | #!/usr/bin/env python
"""
@package ion.agents.platform.responses
@file ion/agents/platform/responses.py
@author Carlos Rueda
@brief Some constants for responses from platform agents/drivers.
"""
from mi.core.common import BaseEnum
__author__ = 'Carlos Rueda'
__license__ = 'Apache 2.0'
class NormalResponse(Ba... | bsd-2-clause |
irwenqiang/pyensemble | ensemble.py | 3 | 23046 | # Author: David C. Lambert [dcl -at- panix -dot- com]
# Copyright(c) 2013
# License: Simple BSD
"""
The :mod:`ensemble` module implements the ensemble selection
technique of Caruana et al [1][2].
Currently supports f1, auc, rmse, accuracy and mean cross entropy scores
for hillclimbing. Based on numpy, scipy, sklearn ... | bsd-3-clause |
yingzha/keras | keras/constraints.py | 78 | 1081 | from __future__ import absolute_import
import theano
import theano.tensor as T
import numpy as np
class Constraint(object):
def __call__(self, p):
return p
def get_config(self):
return {"name": self.__class__.__name__}
class MaxNorm(Constraint):
def __init__(self, m=2):
self.m =... | mit |
Eric-Zhong/odoo | addons/account/project/wizard/account_analytic_cost_ledger_for_journal_report.py | 378 | 2209 | # -*- 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 |
moshthepitt/product.co.ke | product/settings.py | 1 | 5370 | """
Django settings for template project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | mit |
pdellaert/ansible | test/units/modules/network/fortimanager/test_fmgr_secprof_web.py | 38 | 2484 | # Copyright 2018 Fortinet, Inc.
#
# 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 program is distributed in the... | gpl-3.0 |
camptocamp/ngo-addons-backport | openerp/conf/deprecation.py | 76 | 1602 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
vishnu2kmohan/dcos | packages/dcos-integration-test/extra/test_endpoints.py | 4 | 11474 | import ipaddress
import urllib.parse
import bs4
import pytest
from requests.exceptions import ConnectionError
from retrying import retry
from test_helpers import expanded_config
def test_if_dcos_ui_is_up(dcos_api_session):
r = dcos_api_session.get('/')
assert r.status_code == 200
assert len(r.text) > 1... | apache-2.0 |
alexmorozov/django | tests/test_runner/test_discover_runner.py | 20 | 6193 | import os
from contextlib import contextmanager
from unittest import TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@contextmanager
def change_cwd(directory):
current_dir = os.path.abspath(os.path.dirname(__file__))
new_dir = os.pat... | bsd-3-clause |
dongguangming/youtube-dl | youtube_dl/extractor/hark.py | 167 | 1344 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .common import InfoExtractor
class HarkIE(InfoExtractor):
_VALID_URL = r'https?://www\.hark\.com/clips/(?P<id>.+?)-.+'
_TEST = {
'url': 'http://www.hark.com/clips/mmbzyhkgny-obama-beyond-the-afghan-theater-we-only-target-al-qaeda-on... | unlicense |
milrob/essentia | src/examples/tutorial/extractor_predominantmelody.py | 10 | 2747 | # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), either version 3 of the ... | agpl-3.0 |
YanTangZhai/tf | tensorflow/python/kernel_tests/unpack_op_test.py | 1 | 2570 | # 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 |
SaMnCo/charm-dashing | lib/charmhelpers/fetch/__init__.py | 6 | 6419 | import importlib
from yaml import safe_load
from charmhelpers.core.host import (
lsb_release
)
from urlparse import (
urlparse,
urlunparse,
)
import subprocess
from charmhelpers.core.hookenv import (
config,
log,
)
import apt_pkg
CLOUD_ARCHIVE = """# Ubuntu Cloud Archive
deb http://ubuntu-cloud.arc... | agpl-3.0 |
xsteadfastx/subsonic-xbmc-addon | plugin.audio.subsonic/resources/lib/mock/__init__.py | 424 | 75527 | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... | mit |
profgiuseppe/graph-tool-tests | doc/demos/animation_sirs.py | 2 | 5001 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# This simple example on how to do animations using graph-tool. Here we do a
# simple simulation of an S->I->R->S epidemic model, where each vertex can be in
# one of the following states: Susceptible (S), infected (I), recovered (R). A
# vertex in the S state becomes inf... | gpl-3.0 |
retn/MoodleDownloader | moodleDownloader.py | 1 | 6017 | import string
import sys
import shutil
import json
import time
import logging
import os
import requests
import lxml.html
class MoodleDownloader:
loginURL = "login/index.php"
courseURL = "course/view.php"
resourceURL = "mod/resource/view.php"
def __init__(self, user, passwd, url):
self._cred ... | mit |
hehongliang/tensorflow | tensorflow/python/autograph/operators/exceptions_test.py | 6 | 2933 | # 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 |
chengduoZH/Paddle | python/paddle/fluid/reader.py | 2 | 40892 | # Copyright (c) 2019 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 |
ifiddes/pycbio | pycbio/sys/configInPy.py | 1 | 3097 | """
Configuration files written as python programs.
"""
import sys
from types import FunctionType, ModuleType
from pycbio.sys import PycbioException
def _evalConfigFile(configPyFile, extraEnv=None):
"evaluate file and return environment"
configEnv = {"configPyFile": configPyFile}
if extraEnv is not None:
... | bsd-3-clause |
kif/freesas | freesas/app/extract_ascii.py | 1 | 12757 | #!/usr/bin/python3
# coding: utf-8
#
# Project: freesas
# https://github.com/kif/freesas
#
# Copyright (C) 2020 European Synchrotron Radiation Facility, Grenoble, France
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | mit |
0dataloss/ansible-modules-core | cloud/google/gce_lb.py | 64 | 12120 | #!/usr/bin/python
# Copyright 2013 Google 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 vers... | gpl-3.0 |
Thraxis/pymedusa | lib/unidecode/x00d.py | 252 | 4121 | data = (
'[?]', # 0x00
'[?]', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'e', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'o', # 0x12
'oo', # ... | gpl-3.0 |
knone1/Shamu | 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 |
whoflungpoop/badbot | core/reload.py | 24 | 5129 | import collections
import glob
import os
import re
import sys
import traceback
if 'mtimes' not in globals():
mtimes = {}
if 'lastfiles' not in globals():
lastfiles = set()
def make_signature(f):
return f.func_code.co_filename, f.func_name, f.func_code.co_firstlineno
def format_plug(plug, kind='', lpa... | unlicense |
darktears/chromium-crosswalk | tools/grit/grit/format/policy_templates/writers/plist_strings_writer_unittest.py | 44 | 12697 | #!/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.
'''Unit tests for grit.format.policy_templates.writers.plist_strings_writer'''
import os
import sys
if __name__ == '__main__':
... | bsd-3-clause |
philrosenfield/ResolvedStellarPops | utils/mpfit/mpfitexpr.py | 1 | 2971 | """
Copyright (C) 2009 Sergey Koposov
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 program is ... | bsd-3-clause |
kevinlondon/youtube-dl | youtube_dl/extractor/udn.py | 88 | 2232 | # coding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
js_to_json,
ExtractorError,
)
from ..compat import compat_urlparse
class UDNEmbedIE(InfoExtractor):
IE_DESC = '聯合影音'
_VALID_URL = r'https?://video\.udn\.com/(?:embed|play)/news/... | unlicense |
Gamebasis/3DGamebasisServer | GameData/blender-2.71-windows64/2.71/python/lib/unittest/suite.py | 75 | 10541 | """TestSuite"""
import sys
from . import case
from . import util
__unittest = True
def _call_if_exists(parent, attr):
func = getattr(parent, attr, lambda: None)
func()
class BaseTestSuite(object):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
_cleanup = True... | gpl-3.0 |
alistairlow/tensorflow | tensorflow/python/keras/applications/xception/__init__.py | 74 | 1142 | # 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 |
awong1900/platformio | platformio/platforms/teensy.py | 2 | 1531 | # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
from platformio.util import get_boards
class TeensyPlatform(BasePlatform):
"""
Teensy is a complete USB-based microcontroller development system, in
a very small footprint, capabl... | mit |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/HardContact_ElPPlShear/Area/A_1/compare_essi_version.py | 409 | 1085 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
# automatically find the script directory.
# script_dir=sys.argv[1]
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own command line color function
# ... | cc0-1.0 |
nhomar/odoo | addons/auth_crypt/auth_crypt.py | 108 | 3919 | import logging
from passlib.context import CryptContext
import openerp
from openerp.osv import fields, osv
_logger = logging.getLogger(__name__)
default_crypt_context = CryptContext(
# kdf which can be verified by the context. The default encryption kdf is
# the first of the list
['pbkdf2_sha512', 'md5_... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.