repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
lancezlin/ml_template_py | lib/python2.7/site-packages/numpy/lib/scimath.py | 221 | 14085 | """
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::... | mit |
okfn/opd-brand-manager | manager/apps/brand/notifications.py | 2 | 1306 | from django.core.mail import send_mail
from django.core.urlresolvers import reverse
class EmailNotification:
msg_from = 'OKFN team <noreply@okfn.org>'
def __init__(self, msg_to, msg_from=None):
self.msg_to = msg_to
if msg_from:
self.msg_from = msg_from
def send_mail(self, su... | mit |
0jpq0/kbengine | kbe/src/lib/python/Lib/lib2to3/tests/test_fixers.py | 89 | 123507 | """ Test suite for the fixer modules """
# Python imports
import os
import unittest
from itertools import chain
from operator import itemgetter
# Local imports
from lib2to3 import pygram, pytree, refactor, fixer_util
from lib2to3.tests import support
class FixerTestCase(support.TestCase):
# Other test cases ca... | lgpl-3.0 |
energicryptocurrency/energi | qa/rpc-tests/mempool_packages.py | 1 | 11060 | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Energi Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the... | mit |
hgl888/chromium-crosswalk-efl | remoting/tools/build/remoting_localize.py | 56 | 26845 | #!/usr/bin/env python
# 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.
"""
localize.py -- Generates an output file from the given template replacing
variables and localizing strings.
The script uses Jinja2... | bsd-3-clause |
diegocortassa/TACTIC | src/tactic/ui/panel/custom_layout_wdg.py | 1 | 51769 | ###########################################################
#
# Copyright (c) 2005, 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 without written permi... | epl-1.0 |
scikit-learn-contrib/categorical-encoding | category_encoders/__init__.py | 1 | 1448 | """
.. module:: category_encoders
:synopsis:
:platform:
"""
from category_encoders.backward_difference import BackwardDifferenceEncoder
from category_encoders.binary import BinaryEncoder
from category_encoders.count import CountEncoder
from category_encoders.hashing import HashingEncoder
from category_encoders.h... | bsd-3-clause |
ibm-research-ireland/sparkoscope | examples/src/main/python/mllib/fpgrowth_example.py | 158 | 1280 | #
# 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 |
parkera/swift | utils/gyb_syntax_support/__init__.py | 7 | 6049 | import textwrap
from AttributeNodes import ATTRIBUTE_NODES # noqa: I201
from AvailabilityNodes import AVAILABILITY_NODES # noqa: I201
import Classification # noqa: I201
from CommonNodes import COMMON_NODES # noqa: I201
from DeclNodes import DECL_NODES # noqa: I201
from ExprNodes import EXPR_NODES # noqa: I201
fro... | apache-2.0 |
mouton5000/DiscreteEventApplicationEditor | game/Registeries/SpriteRegistery.py | 1 | 2662 | from pygame.rect import Rect
__author__ = 'mouton'
from pygame.sprite import Sprite
import pygame
from collections import defaultdict
from copy import copy
_rootDir = None
_spritesList = defaultdict(pygame.sprite.OrderedUpdates)
_rectsToUpdate = []
def init(rootDir):
global _rootDir
_rootDir = rootDir
... | mit |
kwilliams-mo/iris | lib/iris/tests/test_peak.py | 3 | 11420 | # (C) British Crown Copyright 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
CVSoft/UTQuery | Demo_GSQuery.py | 1 | 3672 | from time import sleep
import GSQuery
# Let's pick a server. We'll use TeamRectifier as they're usually populated.
gs = GSQuery.GSServer('31.186.250.42')
# Let's get the basic server details with the GameSpy query protocol.
# The query methods return dictionary types, so we can store them for later use
# in... | gpl-3.0 |
atuljain/odoo | addons/mass_mailing/models/mail_thread.py | 65 | 4900 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-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 |
Microvellum/Fluid-Designer | win64-vc/2.78/Python/lib/site-packages/packaging/requirements.py | 140 | 4271 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import string
import re
from pyparsing import stringStart, stringEnd, ori... | gpl-3.0 |
ray-project/ray | python/ray/util/collective/tests/single_node_cpu_tests/test_reducescatter.py | 1 | 5148 | """Test the collective reducescatter API."""
import pytest
import ray
import numpy as np
import torch
from ray.util.collective.types import Backend
from ray.util.collective.tests.cpu_util import create_collective_workers, \
init_tensors_for_gather_scatter
@pytest.mark.parametrize("backend", [Backend.GLOO])
@pyt... | apache-2.0 |
vhanla/CudaText | app/cudatext.app/Contents/Resources/py/cuda_addonman/__init__.py | 2 | 20035 | import os
import re
import shutil
import json
import collections
import webbrowser
import subprocess
from cudatext import *
from urllib.parse import unquote
from .work_local import *
from .work_remote import *
from .work_dlg_config import *
from .work_github import *
from .work_cudatext_updates__fosshub import check_cu... | mpl-2.0 |
40223209/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/textwrap.py | 745 | 16488 | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent']
# Hardcode the recognized whitespace characters to the US-ASCII
# whit... | gpl-3.0 |
brennie/reviewboard | reviewboard/webapi/tests/test_review_reply_general_comment.py | 5 | 9334 | from __future__ import unicode_literals
from django.utils import six
from reviewboard.reviews.models import GeneralComment
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import BaseWebAPITestCase
from reviewboard.webapi.tests.mimetypes import (
review_reply_general_comment_i... | mit |
tschneidereit/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_cookies.py | 299 | 1996 | import os
import unittest
import urllib2
import json
import wptserve
from base import TestUsingServer, doc_root
class TestResponseSetCookie(TestUsingServer):
def test_name_value(self):
@wptserve.handlers.handler
def handler(request, response):
response.set_cookie("name", "value")
... | mpl-2.0 |
ic-hep/DIRAC | Core/scripts/dirac-platform.py | 5 | 4471 | #!/usr/bin/env python
########################################################################
# File : dirac-platform
# Author : Adria Casajus
########################################################################
__RCSID__ = "$Id$"
try:
from DIRAC.Core.Utilities.Platform import getPlatformString
except:
imp... | gpl-3.0 |
kinooo/Sick-Beard | sickbeard/notifiers/pushbullet.py | 1 | 4935 | # Author: Pedro Correia (http://github.com/pedrocorreia/)
# Based on pushalot.py by Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-3.0 |
BruceDLong/CodeDog | Scons/scons-local-4.1.0.post1/SCons/Scanner/Fortran.py | 4 | 14787 | # MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... | gpl-2.0 |
yan12125/youtube-dl | youtube_dl/extractor/newstube.py | 16 | 3123 | # coding: utf-8
from __future__ import unicode_literals
import base64
import hashlib
from .common import InfoExtractor
from ..aes import aes_cbc_decrypt
from ..utils import (
bytes_to_intlist,
int_or_none,
intlist_to_bytes,
parse_codecs,
parse_duration,
)
class NewstubeIE(InfoExtractor):
_VA... | unlicense |
jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_chart_scatter14.py | 8 | 1803 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
otsaloma/gaupol | aeidon/pattern.py | 1 | 1548 | # -*- coding: utf-8 -*-
# Copyright (C) 2007 Osmo Salomaa
#
# 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 |
surgebiswas/poker | PokerBots_2017/Johnny/theano/d3viz/tests/test_formatting.py | 3 | 2165 | import numpy as np
import unittest
import theano as th
from theano.d3viz.formatting import PyDotFormatter
from theano.d3viz.tests import models
from nose.plugins.skip import SkipTest
from theano.d3viz.formatting import pydot_imported
if not pydot_imported:
raise SkipTest('Missing requirements')
class TestPyDotF... | mit |
glenn-edgar/local_controller_2 | flask_web/werkzeug/testsuite/serving.py | 74 | 2218 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.serving
~~~~~~~~~~~~~~~~~~~~~~~~~~
Added serving tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import time
import urllib
import unittest
from functools import update_wrapper
from StringIO im... | mit |
doheekim/chuizonetest | lib/wtforms/ext/appengine/fields.py | 177 | 7574 | from __future__ import unicode_literals
import decimal
import operator
from wtforms import fields, widgets
from wtforms.compat import text_type, string_types
class ReferencePropertyField(fields.SelectFieldBase):
"""
A field for ``db.ReferenceProperty``. The list items are rendered in a
select.
:par... | apache-2.0 |
fernandog/Medusa | ext/sqlalchemy/engine/__init__.py | 1 | 20438 | # engine/__init__.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL connections, SQL execution and high-level DB-API interface.
The engine pa... | gpl-3.0 |
qrkourier/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 |
BizzCloud/PosBox | addons/l10n_in_hr_payroll/wizard/hr_yearly_salary_detail.py | 374 | 2376 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_optparse.py | 29 | 61846 | #
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
# test suite to this PyUnit-based version.
#
# $Id$
#
import sys
import os
import re
import copy
import types
import unittest
from StringIO import StringIO
from test import test_support
from optp... | gpl-2.0 |
quxiaolong1504/django | tests/string_lookup/tests.py | 290 | 2573 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Bar, Base, Child, Foo, Whiz
class StringLookupTests(TestCase):
def test_string_form_referencing(self):
"""
Regression test for #1661 and #1662
Check that string... | bsd-3-clause |
zhongdai/gensim | gensim/corpora/sharded_corpus.py | 63 | 35097 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Original author: Jan Hajic jr.
# Copyright (C) 2015 Radim Rehurek and gensim team.
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
This module implements a corpus class that stores its data in separate files called
"shards". This is a com... | gpl-3.0 |
Workday/OpenFrame | tools/telemetry/catapult_base/dependency_manager/cloud_storage_info.py | 1 | 3811 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import stat
from catapult_base import cloud_storage
from catapult_base.dependency_manager import exceptions
class CloudStorageInf... | bsd-3-clause |
tedelhourani/ansible | lib/ansible/modules/cloud/amazon/efs.py | 10 | 21018 | #!/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 |
smallyear/linuxLearn | salt/salt/states/reg.py | 1 | 13518 | # -*- coding: utf-8 -*-
r'''
===========================
Manage the Windows registry
===========================
Many python developers think of registry keys as if they were python keys in a
dictionary which is not the case. The windows registry is broken down into the
following components:
-----
Hives
-----
This is... | apache-2.0 |
Naakh/naakh-py | naakh/api_client.py | 1 | 20321 | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | mit |
Dangetsu/vnr | Frameworks/Sakura/py/apps/browser/curtheme.py | 2 | 1237 | # coding: utf8
# curtheme.py
# 10/6/2012 jichi
#_PYTHON_PATH = os.path.dirname(sys.executable)
#_CURSOR_PATH = os.path.abspath(_PYTHON_PATH + "/../Sakura/res/cursors")
#def beep():
# print '\a'
# #from Qt5.QtWidgets import QApplication
# #QApplication.beep()
# Mouse theme
from sakurakit import skos
if skos.WIN:
... | gpl-3.0 |
zimmerle/gnuradio | gr-uhd/examples/python/usrp_wfm_rcv2_nogui.py | 9 | 6103 | #!/usr/bin/env python
#
# Copyright 2005-2007,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 ... | gpl-3.0 |
wuhengzhi/chromium-crosswalk | tools/usb_gadget/hid_gadget_test.py | 41 | 9446 | #!/usr/bin/python
# 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.
import unittest
import mock
import hid_constants
import hid_descriptors
import hid_gadget
import usb_constants
report_desc = hid_descri... | bsd-3-clause |
pinheadmz/bitcoin | test/functional/p2p-segwit.py | 9 | 92913 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_fram... | mit |
wenhulove333/ScutServer | Sample/Koudai/Server/release/Script/PyScript/Action/action1484.py | 2 | 5026 | import clr, sys
clr.AddReference('ZyGames.Framework.Common');
clr.AddReference('ZyGames.Framework');
clr.AddReference('ZyGames.Framework.Game');
clr.AddReference('ZyGames.Tianjiexing.Model');
clr.AddReference('ZyGames.Tianjiexing.BLL');
clr.AddReference('ZyGames.Tianjiexing.Lang');
from action import *
from ... | mit |
nysan/yocto-autobuilder | lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/lore/lmath.py | 60 | 3037 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
LaTeX-defined image support for Lore documents.
"""
import os, tempfile
from xml.dom import minidom as dom
from twisted.web import domhelpers
import latex, tree, lint, default
class MathLatexSpitter(latex.LatexSpitter):
start_html = '... | gpl-2.0 |
rfaulkner/databayes | http/databayes_api/views.py | 1 | 13088 | """
Defines the routing endpoints of the RESTful API for databayes.
Each method corresponds to an API action and returns the status of the action and the output. This
layer handles communication to the databayes daemon.
IMPORTANT NOTE! - Only one of these server instances should be running to avoid r... | apache-2.0 |
adharaengine/AdharaDB | test.py | 1 | 9327 | import unittest
import tempfile
from tempfile import NamedTemporaryFile
from ZODB import DB, config
from ZODB.FileStorage import FileStorage
from db import Graph, Element, Edge, Node
from backends import DictionaryBackend, ZODBBTreeBackend
class TestGraph(unittest.TestCase):
def setUp(self):
self.g = G... | apache-2.0 |
brianjimenez/lightdock | lightdock/test/gso/test_coordinates.py | 1 | 6927 | """Tests for Coordinates class"""
from nose.tools import assert_almost_equals
from nose.tools import raises
import os
from lightdock.gso.coordinates import Coordinates
from lightdock.gso.coordinates import CoordinatesFileReader
from lightdock.error.lightdock_errors import GSOCoordinatesError
class TestCoordinates:
... | gpl-3.0 |
LohithBlaze/scikit-learn | sklearn/tests/test_metaestimators.py | 226 | 4954 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
jkyeung/XlsxWriter | xlsxwriter/test/table/test_table01.py | 1 | 1893 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...table import Table
from ...worksheet impor... | bsd-2-clause |
flexiant/xen | tools/xm-test/tests/create/08_create_mem128_pos.py | 42 | 1164 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Li Ge <lge@us.ibm.com>
# Test Description:
# Positive Test
# Test for creating domain with mem=.
import sys
import re
import time
from XmTestLib import *
rdpath = os.environ.get("RD_PATH")
if not rdpath:
rdpath = "../ramdis... | gpl-2.0 |
IndraVikas/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
Nitaco/ansible | lib/ansible/modules/storage/zfs/zpool_facts.py | 52 | 6554 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
flwh/KK_mt6589_iq451 | prebuilts/python/linux-x86/2.7.5/lib/python2.7/lib2to3/fixes/fix_itertools_imports.py | 325 | 2094 | """ Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import BlankLine, syms, token
class FixItertoolsImports(fixer_base.BaseFix):
BM_compatible = True
PATTERN = """
import_from< 'from' 'itertools' 'import'... | gpl-2.0 |
purisc-group/purisc | compiler/class_def/conversions/arithmetic.py | 1 | 29184 | from helpers import next_subleq
from helpers import subleq
from helpers import clear
import re
def add(instr, assem):
a = instr.args[0];
b = instr.args[1];
c = instr.result;
t0 = assem.getNextTemp();
#check for literals
if re.match("\d+",a):
if a not in assem.dataMem:
asse... | gpl-2.0 |
julian-klode/python-apt | doc/source/examples/dpkg-contents.py | 2 | 1894 | #!/usr/bin/python
"""Emulate dpkg --contents"""
from __future__ import print_function
import grp
import pwd
import stat
import sys
import time
import apt_inst
def format_mode(member):
"""Return the symbolic mode"""
mode = member.mode
if member.isdir():
s_mode = "d"
elif member.islnk():
... | gpl-2.0 |
ttiurani/gsutil | gslib/tests/test_trace.py | 20 | 1679 | # -*- coding: utf-8 -*-
# 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 require... | apache-2.0 |
sontek/rethinkdb | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-framework-headers.py | 344 | 1103 | #!/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.
"""
Verifies that mac_framework_headers works properly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
# TODO(thakis): Make... | agpl-3.0 |
markmuetz/stormtracks | stormtracks/results.py | 1 | 3180 | import os
from glob import glob
import pandas as pd
from load_settings import settings
from utils.utils import compress_file, decompress_file
RESULTS_TPL = '{0}.hdf'
class ResultNotFound(Exception):
'''Simple exception thrown if result cannot be found in results manager or on disk'''
pass
class Stormtrac... | mit |
KohlsTechnology/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway.py | 25 | 32418 | #!/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 |
ebar0n/SD-NumerosSemiprimos | program/server.py | 2 | 7490 | import socketserver
import threading
import time
import sys
from util import read_json, send_json, return_rangos_primos, \
ping, return_rangos_semiprimos
global coun_connections
coun_connections = 0
global json_primos
json_primos = {}
global json_semiprimos
json_semiprimos = {
'primos': []
}
glob... | gpl-2.0 |
CoolCloud/ansible | examples/scripts/yaml_to_ini.py | 133 | 7634 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
mlperf/inference_results_v0.7 | closed/DellEMC/code/dlrm/tensorrt/accuracy-dlrm.py | 18 | 3009 | #! /usr/bin/env python3
# Copyright (c) 2020, NVIDIA CORPORATION. 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
#
# ... | apache-2.0 |
bmannix/selenium | py/selenium/webdriver/opera/options.py | 100 | 3385 | # 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 |
dmonner/tweater | py/yaml/emitter.py | 110 | 43159 |
# Emitter expects events obeying the following grammar:
# stream ::= STREAM-START document* STREAM-END
# document ::= DOCUMENT-START node DOCUMENT-END
# node ::= SCALAR | sequence | mapping
# sequence ::= SEQUENCE-START node* SEQUENCE-END
# mapping ::= MAPPING-START (node node)* MAPPING-END
__all__ = ['Emitter', 'Emi... | gpl-3.0 |
JohnnyKing94/pootle | tests/forms/contact.py | 5 | 9854 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from __future__ import absolute_import
impo... | gpl-3.0 |
FNST-OpenStack/horizon | openstack_dashboard/api/vpn.py | 27 | 14820 | # Copyright 2013, Mirantis Inc
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
kmad1729/website | django/contrib/admin/widgets.py | 156 | 12061 | """
Form Widget classes specific to the Django admin site.
"""
import django.utils.copycompat as copy
from django import forms
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.t... | bsd-3-clause |
lulandco/SickRage | sickbeard/tv.py | 3 | 117676 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 ... | gpl-3.0 |
makinacorpus/odoo | addons/mrp/product.py | 180 | 4590 | # -*- 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 |
pabloborrego93/edx-platform | pavelib/paver_tests/test_servers.py | 15 | 11645 | """Unit tests for the Paver server tasks."""
import ddt
from paver.easy import call_task
from .utils import PaverTestCase
EXPECTED_COFFEE_COMMAND = (
u"node_modules/.bin/coffee --compile `find {platform_root}/lms "
u"{platform_root}/cms {platform_root}/common -type f -name \"*.coffee\"`"
)
EXPECTED_SASS_COMM... | agpl-3.0 |
giver/m101p | week3/hw3-2and3-3/validate.py | 20 | 13708 | import base64
code="CmltcG9ydCBweW1vbmdvCmltcG9ydCB1cmxsaWIyCmltcG9ydCB1cmxsaWIKaW1wb3J0IGNvb2tpZWxpYgppbXBvcnQgcmFuZG9tCmltcG9ydCByZQppbXBvcnQgc3RyaW5nCmltcG9ydCBzeXMKaW1wb3J0IGdldG9wdAoKIyB0aGlzIGlzIGEgdmFsaWRhdGlvbiBwcm9ncmFtIHRvIG1ha2Ugc3VyZSB0aGF0IHRoZSBibG9nIHdvcmtzIGNvcnJlY3RseS4KIyBJZiB5b3UgYXJlIHJlYWRpbmcgdGhp... | unlicense |
RPG-18/qtawss3 | 3rdparty/gtest-1.7.0/test/gtest_shuffle_test.py | 3023 | 12549 | #!/usr/bin/env python
#
# Copyright 2009 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... | apache-2.0 |
guolivar/totus-niwa | service/thirdparty/featureserver/FeatureServer/DataSource/Flickr.py | 1 | 4910 | from FeatureServer.DataSource import DataSource
from vectorformats.Feature import Feature
from FeatureServer.Exceptions.NoGeometryException import NoGeometryException
import md5
import urllib
from lxml import etree
from StringIO import StringIO
class Flickr (DataSource):
def __init__(self, name, api_key, api_se... | gpl-3.0 |
cloudbase/nova | nova/policies/agents.py | 5 | 1061 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
DNSS4503/android_kernel_msm | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
ulope/django | tests/utils_tests/test_datastructures.py | 16 | 10835 | """
Tests for stuff in django.utils.datastructures.
"""
import copy
import pickle
from django.test import SimpleTestCase
from django.test.utils import IgnoreDeprecationWarningsMixin
from django.utils.datastructures import (DictWrapper, ImmutableList,
MultiValueDict, MultiValueDictKeyError, MergeDict, OrderedSet, ... | bsd-3-clause |
flyser/AutobahnPython | examples/websocket/streaming/message_based_server.py | 27 | 1622 | ###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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
##
## ht... | apache-2.0 |
bwbeach/ansible | test/integration/cleanup_gce.py | 163 | 2589 | '''
Find and delete GCE resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete your *ENTIRE* GCE infrastructure.
'''
import os
import re
import sys
import optparse
import yaml
try:
from libclo... | gpl-3.0 |
zzicewind/nova | nova/virt/xenapi/fake.py | 47 | 38557 | # Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
Simdiva/DSL-Task | evaluate.py | 3 | 3037 | # -*- coding: utf-8 -*-
import io
import sys
from collections import Counter
red = '\033[01;31m'
native = '\033[m'
def err_msg(txt):
return red + txt + native
def language_groups(version=2.0):
varieties = {'Portugese': ['pt-BR', 'pt-PT'],
'Spanish': ['es-ES', 'es-AR'],
'Eng... | cc0-1.0 |
rmsk2/Das-grosse-Quiz | client/playingfield.py | 1 | 19375 | ################################################################################
# Copyright 2016 Martin Grap
#
# 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 |
samfpetersen/gnuradio | gr-qtgui/python/qtgui/__init__.py | 15 | 1183 | #
# Copyright 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 version.
#
#... | gpl-3.0 |
GabrielNicolasAvellaneda/dd-agent | checks.d/pgbouncer.py | 14 | 6682 | """Pgbouncer check
Collects metrics from the pgbouncer database.
"""
# 3p
import psycopg2 as pg
# project
from checks import AgentCheck, CheckException
class ShouldRestartException(Exception):
pass
class PgBouncer(AgentCheck):
"""Collects metrics from pgbouncer
"""
RATE = AgentCheck.rate
GAUGE... | bsd-3-clause |
trabacus-softapps/openerp-8.0-cc | openerp/addons/hw_escpos/escpos/printer.py | 71 | 3770 | #!/usr/bin/python
'''
@author: Manuel F Martinez <manpaz@bashlinux.com>
@organization: Bashlinux
@copyright: Copyright (c) 2012 Bashlinux
@license: GPL
'''
import usb.core
import usb.util
import serial
import socket
from escpos import *
from constants import *
from exceptions import *
class Usb(Escpos):
""" Defi... | agpl-3.0 |
mozilla/verbatim | vendor/lib/python/django/forms/util.py | 83 | 3358 | from django.conf import settings
from django.utils.html import conditional_escape
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
# Import ValidationError so that it ca... | gpl-2.0 |
tcstewar/embodied_benchmarks | control.py | 1 | 3938 | import numpy as np
class Signal(object):
def __init__(self, D, L, dt, max_freq, seed=None):
rng = np.random.RandomState(seed=seed)
steps = int(max_freq * L)
self.w = 2 * np.pi * np.arange(steps) / L
self.A = rng.randn(D, steps) + 1.0j * rng.randn(D, steps)
power = np.sqrt(... | gpl-2.0 |
wemanuel/smry | smry/Crypto/Hash/CMAC.py | 5 | 11991 | # -*- coding: utf-8 -*-
#
# Hash/CMAC.py - Implements the CMAC algorithm
#
# ===================================================================
# 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, perp... | apache-2.0 |
gbrmachado/treeherder | treeherder/model/error_summary.py | 9 | 8253 | import json
import logging
import re
from django.conf import settings
from django.core.urlresolvers import reverse
logger = logging.getLogger(__name__)
LEAK_RE = re.compile(r'\d+ bytes leaked \((.+)\)$')
CRASH_RE = re.compile(r'.+ application crashed \[@ (.+)\]$')
MOZHARNESS_RE = re.compile(
r'^\d+:\d+:\d+[ ]+(... | mpl-2.0 |
odoousers2014/LibrERP | product_catalog_extend/report/__init__.py | 5 | 1119 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 DeneroTeam. (<http://www.deneroteam.com>)
# Copyright (C) 2011 Didotech Inc. (<http://www.didotech.com>)
# All Rights Reserved
#
# This program is free software: you can redistribute... | agpl-3.0 |
cloudstax/openmanage | vendor/lambda-python-requests/chardet/eucjpprober.py | 289 | 3749 | ######################## 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... | apache-2.0 |
mariodebian/jclic-browser | python-examples/demo.py | 1 | 3681 | # This is an example for demonstrating use of the GtkTreeView widget.
# The code in this example is not particularly good: it is written to
# concentrate on widget usage demonstration, not for maintainability.
import pygtk
pygtk.require("2.0")
import gtk
import gobject
view = None
choose_parent_view = None
dialog = N... | gpl-2.0 |
mixturemodel-flow/tensorflow | tensorflow/python/saved_model/saved_model.py | 102 | 1626 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
riteshshrv/django | tests/utils_tests/test_jslex.py | 169 | 9708 | # -*- coding: utf-8 -*-
"""Tests for jslex."""
# originally from https://bitbucket.org/ned/jslex
from __future__ import unicode_literals
from django.test import SimpleTestCase
from django.utils.jslex import JsLexer, prepare_js_for_gettext
class JsTokensTest(SimpleTestCase):
LEX_CASES = [
# ids
("... | bsd-3-clause |
wallyqs/asyncio-nats-streaming | stan/pb/protocol_pb2.py | 1 | 27111 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protocol.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _... | apache-2.0 |
40223112/w16test | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/version.py | 607 | 1334 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... | agpl-3.0 |
kyoungrok0517/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | ExamplesFromChapters/Chapter3/ClusteringWithGaussians.py | 90 | 1034 | import numpy as np
import pymc as pm
data = np.loadtxt("../../Chapter3_MCMC/data/mixture_data.csv", delimiter=",")
p = pm.Uniform("p", 0, 1)
assignment = pm.Categorical("assignment", [p, 1 - p], size=data.shape[0])
taus = 1.0 / pm.Uniform("stds", 0, 100, size=2) ** 2 # notice the size!
centers = pm.Normal("cent... | mit |
liyitest/rr | openstack_dashboard/dashboards/identity/roles/urls.py | 64 | 1070 | # Copyright 2013 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 requir... | apache-2.0 |
saadbinakhlaq/django-oscar | sites/demo/apps/shipping/migrations/0002_auto__add_field_weightbased_default_weight.py | 15 | 2912 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'WeightBased.default_weight'
db.add_column('shipping_weightbased', 'default_weight', self.gf('djang... | bsd-3-clause |
djnugent/Precland | Precland/Simulator.py | 2 | 7761 | #!/usr/bin/python
#SYSTEM IMPORTS
import sys
from os.path import expanduser
import math
import time
import cv2
import numpy as np
from cv_utils.position_vector import PositionVector
from cv_utils.helpers import *
from cv_utils.transforms import *
from droneapi.lib import VehicleMode, Location, Attitude
'''
TODO
fix w... | gpl-3.0 |
CartoDB/cartodb-python | examples/sql_batch_api_jobs.py | 2 | 3070 | import argparse
import logging
import os
import warnings
from carto.auth import APIKeyAuthClient
from carto.sql import BatchSQLClient
warnings.filterwarnings('ignore')
# Logger (better than print)
logging.basicConfig(
level=logging.INFO,
format=' %(asctime)s - %(levelname)s - %(message)s',
datefmt='%I:%M... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.