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 |
|---|---|---|---|---|---|
daedric/buck | third-party/py/unittest2/unittest2/test/test_program.py | 121 | 7252 | from cStringIO import StringIO
import sys
import unittest2
hasInstallHandler = hasattr(unittest2, 'installHandler')
class Test_TestProgram(unittest2.TestCase):
# Horrible white box test
def testNoExit(self):
result = object()
test = object()
class FakeRunner(object):
def... | apache-2.0 |
johngian/remo | vendor-local/lib/python/tablib/packages/unicodecsv/__init__.py | 52 | 3434 | # -*- coding: utf-8 -*-
import csv
from csv import *
#http://semver.org/
VERSION = (0, 8, 0)
__version__ = ".".join(map(str,VERSION))
def _stringify(s, encoding):
if type(s)==unicode:
return s.encode(encoding)
elif isinstance(s, (int , float)):
pass #let csv.QUOTE_NONNUMERIC do its thing.
... | bsd-3-clause |
LogicalDash/kivy | kivy/tests/perf_test_textinput.py | 21 | 6625 | from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.resources import resource_find
from kivy.clock import Clock
import timeit
Builder.load_string('''
<PerfApp>:
value: 0
but: but.__self__
slider: slider
text_input: text_input
BoxLayout:
... | mit |
Xykon/pycom-micropython-sigfox | esp32/tools/pypic.py | 2 | 5197 | #!/usr/bin/env python
from __future__ import print_function
import sys
import argparse
import errno
import serial
import struct
import time
__version__ = '0.9.2'
CMD_PEEK = (0x0)
CMD_POKE = (0x01)
CMD_MAGIC = (0x02)
CMD_HW_VER = (0x10)
CMD_FW_VER = (0x11)
CMD_PROD_ID = (0x12)
CMD_SETUP_SLEEP = (0x20)
CMD_GO_SLEEP =... | mit |
ahuarte47/QGIS | tests/src/python/test_qgsvaliditychecks.py | 45 | 5681 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for validity checks
.. 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 License, or
(at your option) any later version.
"""
__... | gpl-2.0 |
rrooij/youtube-dl | youtube_dl/extractor/bleacherreport.py | 39 | 4164 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .amp import AMPIE
from ..utils import (
ExtractorError,
int_or_none,
parse_iso8601,
)
class BleacherReportIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?bleacherreport\.com/articles/(?P<id>\d+)'
_... | unlicense |
su2code/SU2 | SU2_PY/discrete_adjoint.py | 1 | 7832 | #!/usr/bin/env python
## \file discrete_adjoint.py
# \brief Python script for doing the discrete adjoint computation using the SU2 suite.
# \author F. Palacios, T. Economon, T. Lukaczyk
# \version 7.1.1 "Blackbird"
#
# SU2 Project Website: https://su2code.github.io
#
# The SU2 Project is maintained by the SU2 Fou... | lgpl-2.1 |
wuhengzhi/chromium-crosswalk | tools/memory_inspector/memory_inspector/classification/rules.py | 109 | 5039 | # 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.
"""This module defines the core structure of the classification rules.
This module does NOT specify how the rules filter the data: this responsibility
is of... | bsd-3-clause |
lifei/flask-admin | flask_admin/contrib/geoa/fields.py | 1 | 2904 | import warnings
import geoalchemy2
from flask import current_app
from shapely.geometry import shape
from sqlalchemy import func
from flask_admin.form import JSONField
from .widgets import LeafletWidget
class GeoJSONField(JSONField):
widget = LeafletWidget()
def __init__(self, label=None, validators=None, ... | bsd-3-clause |
jbittel/django-mama-cas | mama_cas/utils.py | 1 | 2745 | import logging
from urllib.parse import parse_qsl, urlencode, urlparse, urlunparse
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.urls import reverse, NoReverseMatch
from django.http import HttpResponseRedirect
from django.utils.encoding import force_bytes
from mama_... | bsd-3-clause |
jessekl/flixr | venv/lib/python2.7/site-packages/lxml/html/html5parser.py | 70 | 6498 | """
An interface to html5lib that mimics the lxml.html interface.
"""
import sys
import string
from html5lib import HTMLParser as _HTMLParser
from html5lib.treebuilders.etree_lxml import TreeBuilder
from lxml import etree
from lxml.html import _contains_block_level_tag, XHTML_NAMESPACE, Element
# python3 compatibil... | mit |
vaginessa/pyload | module/PyFile.py | 40 | 8284 | #!/usr/bin/env python
"""
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 th... | gpl-3.0 |
ktrumble/prmai | lib/userdb.py | 1 | 4718 | from mongo import db
import postsdb
# For update_twitter
import tweepy
import settings
import urllib2
"""
{
'user': { 'id_str':'', 'auth_type': '', 'username': '', 'fullname': '', 'screen_name': '', 'profile_image_url_https': '', 'profile_image_url': '', 'is_blacklisted': False }
'access_token': { 'secret': '', '... | gpl-3.0 |
sadleader/odoo | addons/l10n_uy/__init__.py | 438 | 1070 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Openerp.uy <openerp.uy@lists.launchpad.net>
# Proyecto de Localización de OperERP para Uruguay
# $Id$
#
# This program i... | agpl-3.0 |
piyushroshan/xen-4.3.2 | tools/xm-test/tests/vcpu-pin/01_vcpu-pin_basic_pos.py | 42 | 1246 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Dan Smith <danms@us.ibm.com>
# 1) Make sure we have a multi cpu system
# 2) Create a test domain and pin its VCPU0 to CPU 0 and then 1
import sys;
import re;
from XmTestLib import *
# Verify that we can run this test on this ho... | gpl-2.0 |
shssoichiro/servo | tests/wpt/harness/wptrunner/wpttest.py | 58 | 10090 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEFAULT_TIMEOUT = 10 # seconds
LONG_TIMEOUT = 60 # seconds
import os
import mozinfo
from wptmanifest.parser import ... | mpl-2.0 |
vityagi/azure-linux-extensions | OSPatching/patch/__init__.py | 16 | 2381 | #!/usr/bin/python
#
# Copyright 2014 Microsoft Corporation
#
# 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... | apache-2.0 |
fabianp/scikit-learn | benchmarks/bench_multilabel_metrics.py | 86 | 7286 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... | bsd-3-clause |
jvzantvoort/RackTablesDB | RackTablesDB/config.py | 1 | 2308 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""RackTablesDB.config - read the configuration for the RackTablesDB"""
import os
import logging
import ConfigParser
import traceback
class Config(object):
def __init__(self):
self.variables = dict()
self.database = dict()
self.has_been_read =... | mit |
neilhan/tensorflow | tensorflow/python/ops/control_flow_ops.py | 3 | 114338 | # 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 |
shanemcd/ansible | lib/ansible/module_utils/facts/system/env.py | 232 | 1170 | # 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 |
junghans/espressopp | src/interaction/CoulombKSpaceEwald.py | 2 | 5870 | # Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | gpl-3.0 |
Yanjing123/myicons | fontbuilder/renderers.py | 3 | 4943 | import zipfile
import plistlib
import tempfile
import fontforge
from django.template.loader import render_to_string
from rest_framework import renderers
from .utils import minify_css
from .ttf2eot import ttf2eot
class FontCSSRenderer(renderers.BaseRenderer):
media_type = 'text/css'
format = 'css'
chars... | bsd-2-clause |
PCManticore/argus-ci | argus/backends/base.py | 3 | 4663 | # Copyright 2015 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 |
smartbgp/libbgp | libbgp/tests/unit/net/test_family.py | 1 | 1329 | # Copyright 2015-2017 Cisco Systems, 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 req... | apache-2.0 |
mancoast/CPythonPyc_test | fail/300_test_threading_local.py | 5 | 2646 | import unittest
from doctest import DocTestSuite
from test import support
import threading
import weakref
import gc
class Weak(object):
pass
def target(local, weaklist):
weak = Weak()
local.weak = weak
weaklist.append(weakref.ref(weak))
class ThreadingLocalTest(unittest.TestCase):
def test_local... | gpl-3.0 |
zaxliu/deepnap | experiments/kdd-exps/experiment_QNN_legacy_template.py | 1 | 4398 | # System built-in modules
import time
from datetime import datetime
import sys
import os
from multiprocessing import Pool
# Project dependency modules
import pandas as pd
pd.set_option('mode.chained_assignment', None) # block warnings due to DataFrame value assignment
import lasagne
# Project modules
sys.path.append('... | bsd-3-clause |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/distutils/command/install_scripts.py | 241 | 2068 | """distutils.command.install_scripts
Implements the Distutils 'install_scripts' command, for installing
Python scripts."""
# contributed by Bastian Kleineidam
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils import log
from stat import ST_MODE
class install_scripts (Command):
... | gpl-3.0 |
lanen/youtube-dl | youtube_dl/extractor/defense.py | 123 | 1240 | from __future__ import unicode_literals
from .common import InfoExtractor
class DefenseGouvFrIE(InfoExtractor):
IE_NAME = 'defense.gouv.fr'
_VALID_URL = r'http://.*?\.defense\.gouv\.fr/layout/set/ligthboxvideo/base-de-medias/webtv/(?P<id>[^/?#]*)'
_TEST = {
'url': 'http://www.defense.gouv.fr/lay... | unlicense |
campbe13/openhatch | vendor/packages/Django/tests/modeltests/ordering/models.py | 114 | 1139 | """
6. Specifying ordering
Specify default ordering for a model using the ``ordering`` attribute, which
should be a list or tuple of field names. This tells Django how to order
``QuerySet`` results.
If a field name in ``ordering`` starts with a hyphen, that field will be
ordered in descending order. Otherwise, it'll ... | agpl-3.0 |
Stargrazer82301/CAAPR | CAAPR/CAAPR_AstroMagic/PTS/pts/eagle/plotdensitycurves.py | 2 | 4043 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | mit |
savoirfairelinux/odoo | addons/anonymization/__init__.py | 441 | 1080 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
bootphon/abkhazia | abkhazia/commands/abkhazia_acoustic.py | 1 | 10116 | # Copyright 2016 Thomas Schatz, Xuan-Nga Cao, Mathieu Bernard
#
# This file is part of abkhazia: 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.
#
# Abkh... | gpl-3.0 |
pitunti/alfaPitunti | plugin.video.alfa/core/tvdb.py | 1 | 40140 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# tvdb
# ------------------------------------------------------------
# Scraper para el site thetvdb.com usando API v2.1
# Utilizado para obtener datos de series para la videoteca
# del addon y también Kodi.
# -----------------------... | gpl-3.0 |
scroggo/skia | platform_tools/nacl/httpd.py | 116 | 7009 | #!/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.
"""A tiny web server.
This is intended to be used for testing, and only run from within the examples
directory.
"""
import BaseHT... | bsd-3-clause |
moonboots/tensorflow | tensorflow/python/client/notebook.py | 26 | 4596 | # 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 |
Erotemic/ibeis | ibeis/algo/hots/__init__.py | 1 | 3797 | # -*- coding: utf-8 -*-
# Autogenerated on 12:39:11 2016/10/13
# flake8: noqa
from __future__ import absolute_import, division, print_function, unicode_literals
from ibeis.algo.hots import _pipeline_helpers
from ibeis.algo.hots import chip_match
from ibeis.algo.hots import exceptions
from ibeis.algo.hots import hstypes... | apache-2.0 |
pyfisch/servo | tests/wpt/web-platform-tests/tools/third_party/py/testing/code/test_assertion.py | 55 | 7796 | import pytest, py
import re
def exvalue():
import sys
return sys.exc_info()[1]
def f():
return 2
def test_assert():
try:
assert f() == 3
except AssertionError:
e = exvalue()
s = str(e)
assert s.startswith('assert 2 == 3\n')
def test_assert_within_finally():
e... | mpl-2.0 |
joergdietrich/astropy | astropy/table/table.py | 2 | 101482 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..extern import six
from ..extern.six.moves import zip, range
from .index import TableIndices, TableLoc, TableILoc
import re
import sys
from ... | bsd-3-clause |
NeCTAR-RC/python-neutronclient | neutronclient/tests/functional/test_readonly_neutron.py | 4 | 8539 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
ankurankan/pgmpy | pgmpy/inference/bn_inference.py | 2 | 8890 | from pgmpy.inference import Inference
from pgmpy.models import BayesianNetwork
import pandas as pd
import numpy as np
import networkx as nx
import itertools
class BayesianModelInference(Inference):
"""
Inference class specific to Bayesian Models
"""
def __init__(self, model):
"""
Clas... | mit |
willingc/oh-mainline | vendor/packages/python-social-auth/social/backends/oauth.py | 15 | 16515 | import six
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_AUTH_HEADER
from social.p3 import urlencode, unquote
from social.utils import url_add_parameters, parse_qs, handle_http_errors
from social.exceptions import AuthFailed, AuthCanceled, AuthUnknownError, \
... | agpl-3.0 |
vsaw/miniSSL | minissl/keyutils.py | 1 | 4926 | #!/bin/python
from Crypto.Util.asn1 import DerSequence
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Hash import HMAC
from Crypto.Random import _UserFriendlyRNG as Random
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from M2Crypto import X509 as m2x509
from OpenSSL i... | mit |
fintech-circle/edx-platform | openedx/core/djangoapps/theming/tests/test_util.py | 45 | 3001 | """
Test helpers for Comprehensive Theming.
"""
from functools import wraps
import os
import os.path
import contextlib
import re
from mock import patch
from django.conf import settings
from django.contrib.sites.models import Site
import edxmako
from openedx.core.djangoapps.theming.models import SiteTheme
def with... | agpl-3.0 |
ravibhure/ansible | lib/ansible/modules/network/netscaler/netscaler_lb_monitor.py | 114 | 47437 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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 |
tanvioka/rdbms-subsetter | test_subsetter.py | 3 | 5202 | import os
import unittest
import tempfile
import sqlite3
from subsetter import Db
class DummyArgs(object):
logarithmic = False
fraction = 0.25
force_rows = {}
children = 25
config = {}
exclude_tables = []
full_tables = []
buffer = 1000
dummy_args = DummyArgs()
class OverallTest(unitte... | cc0-1.0 |
detiber/ansible | lib/ansible/modules/cloud/rackspace/rax_clb.py | 70 | 9412 | #!/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... | gpl-3.0 |
justacec/bokeh | bokeh/models/tests/test_annotations.py | 2 | 8903 | from __future__ import absolute_import
from itertools import chain
from bokeh.models.annotations import (
Legend, Arrow, BoxAnnotation, Span, LabelSet, Label, Title
)
from bokeh.models import ColumnDataSource, ArrowHead
from bokeh.core.enums import (
NamedColor as Color, LineJoin, LineCap, FontStyle, TextAli... | bsd-3-clause |
jriguera/Diamond | src/diamond/handler/Handler.py | 21 | 4235 | # coding=utf-8
import logging
import threading
import traceback
from configobj import ConfigObj
import time
class Handler(object):
"""
Handlers process metrics that are collected by Collectors.
"""
def __init__(self, config=None, log=None):
"""
Create a new instance of the Handler cla... | mit |
eyohansa/django | tests/migrations/test_multidb.py | 366 | 6909 | import unittest
from django.db import connection, migrations, models
from django.db.migrations.state import ProjectState
from django.test import override_settings
from .test_operations import OperationTestBase
try:
import sqlparse
except ImportError:
sqlparse = None
class AgnosticRouter(object):
"""
... | bsd-3-clause |
zofuthan/edx-platform | cms/djangoapps/contentstore/course_info_model.py | 112 | 6790 | """
Views for viewing, adding, updating and deleting course updates.
Current db representation:
{
"_id" : locationjson,
"definition" : {
"data" : "<ol>[<li><h2>date</h2>content</li>]</ol>"},
"items" : [{"id": ID, "date": DATE, "content": CONTENT}]
"metadata" : ignored
}
}
"""
impor... | agpl-3.0 |
wanggang3333/scikit-learn | sklearn/manifold/tests/test_isomap.py | 226 | 3941 | from itertools import product
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
from sklearn.utils.testing import assert_less
... | bsd-3-clause |
bradleyayers/suds-htj | suds/umx/core.py | 199 | 7575 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 hope that it will ... | lgpl-3.0 |
Slezhuk/ansible | lib/ansible/module_utils/vmware.py | 51 | 16732 | # -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 yo... | gpl-3.0 |
Lyrositor/moul-scripts | Python/system/py_compile.py | 111 | 5930 | """Routine to "compile" a .py file to a .pyc (or .pyo) file.
This module has intimate knowledge of the format of .pyc files.
"""
import __builtin__
import imp
import marshal
import os
import sys
import traceback
MAGIC = imp.get_magic()
__all__ = ["compile", "main", "PyCompileError"]
class PyCompileError(Exception... | gpl-3.0 |
vitaly4uk/django | tests/db_typecasts/tests.py | 206 | 2412 | # Unit tests for typecast functions in django.db.backends.util
import datetime
import unittest
from django.db.backends import utils as typecasts
from django.utils import six
TEST_CASES = {
'typecast_date': (
('', None),
(None, None),
('2005-08-11', datetime.date(2005, 8, 11)),
('1... | bsd-3-clause |
bitifirefly/edx-platform | common/djangoapps/student/migrations/0051_auto__add_courseenrollmentattribute.py | 82 | 17758 | # -*- 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):
# Adding model 'CourseEnrollmentAttribute'
db.create_table('student_cours... | agpl-3.0 |
mikalstill/nova | nova/api/openstack/compute/tenant_networks.py | 3 | 7723 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
cgoldberg/linux-metrics | example.py | 1 | 1658 | #!/usr/bin/env python
#
# Copyright (c) 2011-2013 Corey Goldberg (http://goldb.org)
#
# This file is part of linux-metrics
#
# License :: OSI Approved :: MIT License:
# http://www.opensource.org/licenses/mit-license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of ... | mit |
newerthcom/savagerebirth | libs/python-2.72/Lib/popen2.py | 304 | 8416 | """Spawn a command with pipes to its stdin, stdout, and optionally stderr.
The normal os.popen(cmd, mode) call spawns a shell command and provides a
file interface to just the input or output of the process depending on
whether mode is 'r' or 'w'. This module provides the functions popen2(cmd)
and popen3(cmd) which r... | gpl-2.0 |
ttfseiko/openerp-trunk | openerp/addons/l10n_cl/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
mrry/tensorflow | tensorflow/contrib/learn/python/learn/tests/estimators_test.py | 7 | 5456 | # 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 |
tpo/ansible | test/units/cli/test_console.py | 77 | 1829 | # (c) 2016, Thilo Uttendorfer <tlo@sengaya.de>
#
# 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 |
pmalmgren/consul | vendor/github.com/hashicorp/go-msgpack/codec/msgpack_test.py | 1232 | 3478 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
import msgpack, msgpackrpc, sys, os, threading
def get_test_data_list():
# get list with all primitive typ... | mpl-2.0 |
ytjiang/django | django/contrib/admin/widgets.py | 8 | 14831 | """
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.db.models.deletion import CASCADE
from django.forms.uti... | bsd-3-clause |
GyrosOfWar/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_extensions.py | 413 | 16128 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
darthdeus/dotfiles | c_ycm_conf.py | 1 | 5178 | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | mit |
ptisserand/ansible | lib/ansible/modules/network/nxos/nxos_static_route.py | 16 | 9227 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
ElvishArtisan/drouter | python/examples/show_destinations.py | 1 | 1976 | #!%PYTHON_BANGPATH%
# show_destinations.py
#
# Drouter state script to enumerate all destinations
#
# (C) Copyright 2018-2019 Fred Gleason <fredg@paravelsystems.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# publ... | gpl-2.0 |
Boussadia/weboob | modules/fortuneo/backend.py | 2 | 2415 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Gilles-Alexandre Quenot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 |
MyRookie/SentimentAnalyse | venv/lib/python2.7/site-packages/numpy/linalg/linalg.py | 11 | 75845 | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | mit |
rbrito/pkg-youtube-dl | youtube_dl/extractor/bellmedia.py | 8 | 2971 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class BellMediaIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?P<domain>
(?:
ctv|
tsn|
bnn(?:bloomberg)?|
thecomed... | unlicense |
patrioticcow/MessagesForSkype | packages/win32/bundle/MessagesForSkype/modules/python/1.3.1-beta/Lib/bisect.py | 91 | 2394 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | mit |
mitchrule/Miscellaneous | Django_Project/django/Lib/site-packages/django/db/backends/sqlite3/features.py | 119 | 2631 | from __future__ import unicode_literals
import sys
from django.db import utils
from django.db.backends.base.features import BaseDatabaseFeatures
from django.utils.functional import cached_property
from .base import Database
try:
import pytz
except ImportError:
pytz = None
class DatabaseFeatures(BaseDataba... | mit |
DirtyPiece/dancestudio | Build/Tools/Python27/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py | 319 | 1348 | from socket import error as SocketError
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dr... | mit |
blooparksystems/odoo | addons/account_check_printing/account_payment.py | 37 | 7203 | # -*- coding: utf-8 -*-
import math
from openerp import models, fields, api, _
from openerp.tools import amount_to_text_en, float_round
from openerp.exceptions import UserError, ValidationError
class account_register_payments(models.TransientModel):
_inherit = "account.register.payments"
check_amount_in_wor... | gpl-3.0 |
ThinkOpen-Solutions/odoo | addons/mrp_repair/wizard/make_invoice.py | 172 | 3150 | # -*- 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 |
lavalamp/test-infra | experiment/flakedetector.py | 11 | 3269 | #!/usr/bin/env python3
# Copyright 2017 The Kubernetes 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 appl... | apache-2.0 |
jnerin/ansible | lib/ansible/module_utils/facts/virtual/linux.py | 1 | 10826 | # 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 |
psi4/mongo_qcdb | qcfractal/tests/test_client.py | 2 | 4656 | """
Tests the interface portal adapter to the REST API
"""
import numpy as np
import pytest
import qcfractal.interface as ptl
from qcfractal.testing import test_server
# All tests should import test_server, but not use it
# Make PyTest aware that this module needs the server
valid_encodings = ["json", "json-ext", "... | bsd-3-clause |
aselle/tensorflow | tensorflow/contrib/tpu/python/profiler/__init__.py | 33 | 1246 | # 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 |
ecederstrand/django | tests/forms_tests/tests/tests.py | 89 | 16458 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from django.forms import (
CharField, FileField, Form, ModelChoiceField, ModelForm,
)
from django.forms.models import ModelFormMetaclass
from d... | bsd-3-clause |
hradec/gaffer | python/GafferVDBUI/SphereLevelSetUI.py | 8 | 2544 | ##########################################################################
#
# Copyright (c) 2020, Don Boogert. 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 so... | bsd-3-clause |
isghe/cjdns | node_build/dependencies/libuv/build/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... | gpl-3.0 |
ehudmagal/robotqcapp | boto/ec2/autoscale/activity.py | 57 | 3059 | # Copyright (c) 2009-2011 Reza Lotun http://reza.lotun.name/
#
# 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, mod... | bsd-3-clause |
roadmapper/ansible | test/units/modules/network/cnos/test_cnos_l2_interface.py | 23 | 5128 | #
# (c) 2018 Lenovo.
#
# 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 distri... | gpl-3.0 |
Lh4cKg/sl4a | python/src/Tools/scripts/ifdef.py | 66 | 3717 | #! /usr/bin/env python
# Selectively preprocess #ifdef / #ifndef statements.
# Usage:
# ifdef [-Dname] ... [-Uname] ... [file] ...
#
# This scans the file(s), looking for #ifdef and #ifndef preprocessor
# commands that test for one of the names mentioned in the -D and -U
# options. On standard output it writes a copy... | apache-2.0 |
jamiefolsom/edx-platform | common/test/acceptance/performance/test_studio_performance.py | 139 | 3307 | """
Single page performance tests for Studio.
"""
from bok_choy.web_app_test import WebAppTest, with_cache
from ..pages.studio.auto_auth import AutoAuthPage
from ..pages.studio.overview import CourseOutlinePage
from nose.plugins.attrib import attr
@attr(har_mode='explicit')
class StudioPagePerformanceTest(WebAppTest)... | agpl-3.0 |
zerberros/tercera_mano | tercera_mano.py | 1 | 9083 | #!/usr/bin/python
###############################################################################
# Copyleft (c) 2013 Jairo Estefanía. Some rights reserved. #
# This program or module is free software: you can redistribute it and/or #
# modify it under the terms of the Lesser GNU General Public ... | lgpl-3.0 |
StephenChusang/py-faster-rcnn-tracker | lib/rpn/proposal_layer.py | 6 | 6803 | # --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
import caffe
import numpy as np
import yaml
from fast_r... | mit |
sho-h/ruby_env | devkit/mingw/bin/lib/distutils/errors.py | 59 | 3582 | """distutils.errors
Provides exceptions used by the Distutils modules. Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).
This module is safe to use in "from ... import *" m... | mit |
maoxuxiang/termite_mallet_project | web2py/gluon/contrib/login_methods/dropbox_account.py | 42 | 4563 | #!/usr/bin/env python
# coding: utf8
"""
Dropbox Authentication for web2py
Developed by Massimo Di Pierro (2012)
Same License as Web2py License
"""
# mind here session is dropbox session, not current.session
import os
import re
import urllib
from dropbox import client, rest, session
from gluon import *
from gluon.to... | bsd-3-clause |
s2oBCN/selenium | py/test/selenium/webdriver/common/utils.py | 68 | 2155 | # 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 |
gunrock/gunrock | tools/gr_to_mtx_symmetric.py | 4 | 1322 | #!/usr/local/bin/python
"""
Simple python script to convert .gr format graph to .mtx format
"""
import os
import sys
import string
### check command line args
if (len(sys.argv)) != 2:
print ' Usage: python gr_to_mtx_symmetric.py graph.gr'
sys.exit()
### gr graph input
file_gr = sys.argv[1]
### matrix-marke... | apache-2.0 |
xiejianying/pjsip_trunk | tests/pjsua/mod_sipp.py | 19 | 8562 | # $Id$
## Automatic test module for SIPp.
##
## This module will need a test driver for each SIPp scenario:
## - For simple scenario, i.e: make/receive call (including auth), this
## test module can auto-generate a default test driver, i.e: make call
## or apply auto answer. Just name the SIPp scenario using "uas"... | gpl-2.0 |
bavardage/statsmodels | statsmodels/tsa/varma_process.py | 3 | 19937 | # -*- coding: utf-8 -*-
""" Helper and filter functions for VAR and VARMA, and basic VAR class
Created on Mon Jan 11 11:04:23 2010
Author: josef-pktd
License: BSD
This is a new version, I didn't look at the old version again, but similar
ideas.
not copied/cleaned yet:
* fftn based filtering, creating samples with f... | bsd-3-clause |
sonnerm/games | games/skatai.py | 1 | 1235 | __author__ = 'michael'
from games import player, skat
class MauernderRandomPlayer(player.Player):
'''
just folds in the beginning, afterwards plays randomly. Usually better then a completly randomized player
'''
def move(self, moveview):
if skat.SkatCalls.Fold in moveview.get_options():
... | agpl-3.0 |
Pretio/boto | boto/ec2/autoscale/launchconfig.py | 135 | 10807 | # Copyright (c) 2009 Reza Lotun http://reza.lotun.name/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without... | mit |
headedhorseman101/ACE3 | tools/stringtablemerger.py | 52 | 4379 | #!/usr/bin/env python3
import os
import sys
import re
from xml.dom import minidom
# STRINGTABLE MERGER TOOL
# Author: KoffeinFlummi
# --------------------------
# Automatically merges all stringtable entries
# in the given language from the given dir.
def get_modules(projectpath):
""" Get all the modules of the... | gpl-2.0 |
chouseknecht/ansible | lib/ansible/galaxy/login.py | 12 | 4798 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.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 Fo... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.