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 |
|---|---|---|---|---|---|
pfnet/chainer | chainer/functions/math/sqrt.py | 8 | 2385 | import numpy
from chainer import backend
from chainer.backends import cuda
from chainer import function_node
from chainer import utils
from chainer.utils import type_check
import chainerx
class Sqrt(function_node.FunctionNode):
@property
def label(self):
return 'sqrt'
def check_type_forward(sel... | mit |
markhice/ghost-casper | node_modules_bak/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/hdl.py | 363 | 16209 | # -*- coding: utf-8 -*-
"""
pygments.lexers.hdl
~~~~~~~~~~~~~~~~~~~
Lexers for hardware descriptor languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, include, using, t... | mit |
iansf/sky_engine | third_party/jinja2/parser.py | 637 | 35186 | # -*- coding: utf-8 -*-
"""
jinja2.parser
~~~~~~~~~~~~~
Implements the template parser.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from jinja2 import nodes
from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError
from jinja2.lexer impo... | bsd-3-clause |
disigma/depot_tools | third_party/coverage/data.py | 209 | 9188 | """Coverage data for Coverage."""
import os
from coverage.backward import iitems, pickle, sorted # pylint: disable=W0622
from coverage.files import PathAliases
from coverage.misc import file_be_gone
class CoverageData(object):
"""Manages collected coverage data, including file storage.
The data file for... | bsd-3-clause |
sudovijay/youtube-dl | youtube_dl/extractor/vimeo.py | 19 | 27619 | # encoding: utf-8
from __future__ import unicode_literals
import json
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_HTTPError,
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
InAdvancePagedList,
... | unlicense |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/pypy/lib-python/2.7/plat-irix6/WAIT.py | 66 | 5559 | # Generated by h2py from /usr/include/sys/wait.h
from warnings import warnpy3k
warnpy3k("the WAIT module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
# Included from standards.h
def _W_INT(i): return (i)
WUNTRACED = 0004
WNOHANG = 0100
_WSTOPPED = 0177
def WIFEXITED(stat): return ((_W_INT(stat)&0377)==... | agpl-3.0 |
NetApp/cinder | cinder/volume/drivers/hitachi/hbsd_iscsi.py | 5 | 16561 | # Copyright (C) 2014, Hitachi, 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... | apache-2.0 |
r1cc4rdo/alfred-workflows | timezones/local_pytz/reference.py | 839 | 3649 | '''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... | gpl-3.0 |
rohitwaghchaure/erpnext_smart | erpnext/stock/doctype/delivery_note/test_delivery_note.py | 37 | 7463 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import frappe.defaults
from frappe.utils import cint
from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt... | agpl-3.0 |
lukaszb/django-guardian | guardian/testapp/tests/test_other.py | 1 | 13332 | from unittest import mock
import unittest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.contenttyp... | bsd-2-clause |
empiredan/googletest | scripts/release_docs.py | 1167 | 6132 | #!/usr/bin/env python
#
# Copyright 2013 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... | bsd-3-clause |
darmaa/odoo | addons/account_anglo_saxon/__openerp__.py | 67 | 2462 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
tomviner/pytest | doc/en/example/assertion/test_setup_flow_example.py | 18 | 1252 | def setup_module(module):
module.TestStateFullThing.classcount = 0
class TestStateFullThing:
def setup_class(cls):
cls.classcount += 1
def teardown_class(cls):
cls.classcount -= 1
def setup_method(self, method):
self.id = eval(method.__name__[5:])
def test_42(self):
... | mit |
tzaffi/git-in-practice-repo | book/lib/python2.7/site-packages/django/contrib/gis/tests/geo3d/tests.py | 109 | 12136 | from __future__ import absolute_import, unicode_literals
import os
import re
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import postgis
from django.test import TestCase
from django.utils._os import upath
from django.utils.unittest impor... | mit |
shaunstanislaus/ibis | ibis/tasks.py | 7 | 7836 | # Copyright 2014 Cloudera 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 agreed to in writing, so... | apache-2.0 |
CandidCypher/code-for-blog | 2012/plugins_python/htmlize/core.py | 13 | 2324 | #-------------------------------------------------------------------------------
# htmlize: htmlize/core.py
#
# The core functionality of htmlize.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from collections im... | unlicense |
ALabate/linux-asus-T200TA | tools/perf/tests/attr.py | 1266 | 9424 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
hpparvi/PyTransit | pytransit/param/prior.py | 1 | 3826 | # PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... | gpl-2.0 |
varunagrawal/azure-services | varunagrawal/site-packages/django/core/management/commands/test.py | 111 | 2965 | import sys
import os
from optparse import make_option, OptionParser
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--noinput',
actio... | gpl-2.0 |
ahmadghizzawi/aub-ml | assignment2/linear-regression.py | 1 | 5573 | import numpy as np
from numpy import sign as sign
import matplotlib.pyplot as plt
class Utils:
@staticmethod
def generate_set(N):
"""Generates an n by 3 uniformly distributed dataset"""
# Generate random uniformally distributes points
training_set = np.random.uniform(-1, 1, size=(N, 2... | unlicense |
HiroIshikawa/21playground | payblog/blog/lib/python3.5/site-packages/markdown/extensions/abbr.py | 123 | 2738 | '''
Abbreviation Extension for Python-Markdown
==========================================
This extension adds abbreviation handling to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/abbreviations.html>
for documentation.
Oringinal code Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/) ... | mit |
TheMOOCAgency/edx-platform | common/test/acceptance/pages/xblock/crowdsourcehinter_problem.py | 11 | 1738 | """
PageObject for Crowdsourcehinter
"""
from bok_choy.page_object import PageObject
class CrowdsourcehinterProblemPage(PageObject):
"""
A PageObject representing the Crowdsourcehinter xblock.
"""
url = None
def __init__(self, browser):
"""
Args:
browser (selenium.web... | agpl-3.0 |
guncoin/guncoin | test/functional/wallet_abandonconflict.py | 12 | 8752 | #!/usr/bin/env python3
# Copyright (c) 2014-2018 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 the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet... | mit |
yoshinorim/mysql-5.6 | xtrabackup/test/kewpie/lib/modes/dtr/dtr_test_execution.py | 26 | 5597 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2010 Patrick Crews
#
#
# 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 Softwar... | gpl-2.0 |
ravibhure/ansible | lib/ansible/modules/cloud/docker/docker_volume.py | 45 | 7796 | #!/usr/bin/python
# coding: utf-8
#
# Copyright 2017 Red Hat | Ansible, Alex Grönholm <alex.gronholm@nextday.fi>
# 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 = {'meta... | gpl-3.0 |
ntt-sic/python-cinderclient | cinderclient/tests/v1/test_quota_classes.py | 6 | 1448 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
Cloudino/Arduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/euckrprober.py | 2931 | 1675 | ######################## 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... | lgpl-2.1 |
Elneo-group/account-invoicing | account_invoice_line_sort/models/account_invoice.py | 26 | 4940 | # -*- coding: utf-8 -*-
##############################################################################
# This file is part of account_invoice_line_sort, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_line_sort is free software: you can redistribute it
# and... | agpl-3.0 |
GeraldLoeffler/nupic | tests/unit/nupic/encoders/coordinate_test.py | 7 | 11676 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
F-AOSP/platform_external_skia | platform_tools/android/bin/download_utils.py | 149 | 8464 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client 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 library to assist automatically downloading files.
This library is used by scripts that download tarballs, zipfiles, etc. as... | bsd-3-clause |
timduru/platform_external_chromium | net/tools/testserver/device_management.py | 66 | 23833 | #!/usr/bin/python2.5
# Copyright (c) 2011 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 bare-bones test server for testing cloud policy support.
This implements a simple cloud policy test server that can be used to... | bsd-3-clause |
nrwahl2/ansible | lib/ansible/modules/cloud/cloudstack/cs_resourcelimit.py | 33 | 6063 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
Fiedzia/Django-facebook | docs/docs_env/Lib/encodings/raw_unicode_escape.py | 852 | 1208 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... | bsd-3-clause |
chaen/DIRAC | DataManagementSystem/Client/CmdDirCompletion/AbstractFileSystem.py | 4 | 2491 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: lintao
from __future__ import print_function
class HelperReadOnly(object):
def __init__(self, val):
self.val = val
def __get__(self, obj, objtype):
return self.val
def __set__(self, obj, val):
raise AttributeError("can't modify attribute")
cla... | gpl-3.0 |
bloomberg/phabricator-tools | py/phl/phlsys_compressedlogging__t.py | 4 | 4675 | """Test suite for phlsys_compressedlogging."""
# =============================================================================
# TEST PLAN
# -----------------------------------------------------------------------------
# Here we detail the things we are concerned to test and specify wh... | apache-2.0 |
mancoast/CPythonPyc_test | fail/310_test_uuid.py | 3 | 21025 | from unittest import TestCase
from test import support
import uuid
def importable(name):
try:
__import__(name)
return True
except:
return False
class TestUUID(TestCase):
last_node = None
source2node = {}
def test_UUID(self):
equal = self.assertEqual
ascendi... | gpl-3.0 |
DanielSantoyo/SmallBarrel | source/lib_grows/genesi.py | 1 | 13689 | ####################################################
#Software License: #
#--------------------------------------------------#
#genesi.py, a pygame library to create the images of the game.
#Copyright (C) 2016 Daniel Santoyo Gomez
#This library is free software; you can redistri... | artistic-2.0 |
cypsun/FreeCAD | src/Mod/Path/PathScripts/PathProject.py | 6 | 6281 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 |
MaxiTalenti/IA | Trabajos practicos 2016/probar_entrega_1_local.py | 1 | 5608 | # coding: utf-8
from datetime import datetime
import inspect
import os
import sys
problemas = []
recomendaciones = []
advertencias = []
def validar_tiempo(inicio, fin, tope, listado, mensaje):
diferencia = (fin - inicio).total_seconds()
if diferencia > tope:
listado.append(mensaje)
def probar_cod... | apache-2.0 |
borysiasty/QGIS | tests/src/python/test_qgsratiolockbutton.py | 30 | 4394 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRatioLockButton
.. 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 |
harmy/kbengine | kbe/res/scripts/common/Lib/test/test_urlparse.py | 2 | 40955 | #! /usr/bin/env python3
from test import support
import unittest
import urllib.parse
RFC1808_BASE = "http://a/b/c/d;p?q#f"
RFC2396_BASE = "http://a/b/c/d;p?q"
RFC3986_BASE = 'http://a/b/c/d;p?q'
SIMPLE_BASE = 'http://a/b/c/d'
# A list of test cases. Each test case is a a two-tuple that contains
# a str... | lgpl-3.0 |
krull/docker-zenoss4 | init_fs/usr/local/zenoss/ZenPacks/ZenPacks.zenoss.Microsoft.Windows-2.6.9.egg/ZenPacks/zenoss/Microsoft/Windows/tests/testSoftware.py | 1 | 3354 | #!/usr/bin/env python
# coding=utf-8
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2014, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#... | gpl-3.0 |
w1kke/pylearn2 | pylearn2/packaged_dependencies/theano_linear/imaging.py | 44 | 7922 | """
.. todo::
WRITEME
"""
import logging
import sys
import numpy
from theano.compat.six.moves import xrange
from pylearn2.utils.image import Image, ensure_Image
logger = logging.getLogger(__name__)
def scale_to_unit_interval(ndar,eps=1e-8):
"""
.. todo::
WRITEME
"""
ndar = ndar.copy()
... | bsd-3-clause |
paxapy/zulip | zerver/management/commands/remove_users_from_stream.py | 2 | 2713 | from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from optparse import make_option
from django.core.management.base import BaseCommand, CommandParser
from zerver.lib.actions import bulk_remove_subscriptions
from zerver.models impo... | apache-2.0 |
tri2sing/LinearAlgebraPython | test_hw2.py | 1 | 1728 | from GF2 import one
from vec import Vec
from vec import scalar_mul
import itertools
## Problem 1
D = {'a','b','c'}
v0 = Vec(D, {})
v1 = Vec(D, {'a': 1})
v2 = Vec(D, {'a': 0, 'b': 1})
v3 = Vec(D, { 'b': 2})
v4 = Vec(D, {'a': 10, 'b': 10})
def vec_select(veclist, k):
return [Vec(v.D, v... | apache-2.0 |
lakshayg/tensorflow | tensorflow/python/eager/tape_test.py | 19 | 6001 | # 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 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdecore/KService.py | 1 | 4297 | # encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python3/dist-packages/PyKDE4/kdecore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
from .KSycocaEntry import KSycocaEntry
class KService(KSycocaEntry)... | gpl-2.0 |
sahildua2305/eden | static/scripts/tools/run_scheduler_tasks.py | 28 | 4978 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Call Web2py scheduler in app models context and run a specified task using
# its scheduled arguments. Two options for running this script:
#
# cd web2py
# python applications/<app>/static/scripts/tools/run_scheduler_tasks.py --app=<app> --task=<task>
# -- or --
# export... | mit |
mozilla/feedthefox | feedthefox/users/providers/github/views.py | 2 | 1164 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2LoginView,
OAuth2CallbackView)
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
class FeedTheFoxGitHubOAuth2Adapter(GitHubOAuth2Adapter):
"""
A... | mpl-2.0 |
munnerz/CouchPotatoServer | libs/unrar2/rar_exceptions.py | 153 | 1391 | # Copyright (c) 2003-2005 Jimmy Retzlaff, 2008 Konstantin Yegupov
#
# 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... | gpl-3.0 |
huang4fstudio/django | tests/template_tests/filter_tests/test_dictsortreversed.py | 342 | 1066 | from django.template.defaultfilters import dictsortreversed
from django.test import SimpleTestCase
class FunctionTests(SimpleTestCase):
def test_sort(self):
sorted_dicts = dictsortreversed(
[{'age': 23, 'name': 'Barbara-Ann'},
{'age': 63, 'name': 'Ra Ra Rasputin'},
{... | bsd-3-clause |
jsteemann/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_bigmem.py | 56 | 38218 | from test import test_support
from test.test_support import bigmemtest, _1G, _2G, _4G, precisionbigmemtest
import unittest
import operator
import string
import sys
# Bigmem testing houserules:
#
# - Try not to allocate too many large objects. It's okay to rely on
# refcounting semantics, but don't forget that 's ... | apache-2.0 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_0_0/ipam_sync_broker.py | 12 | 2713 | from ..broker import Broker
class IpamSyncBroker(Broker):
controller = "ipam_sync"
def status(self, **kwargs):
"""Gets the highest SeqNo available currently of a given IPAM object.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
|... | apache-2.0 |
bixbydev/Bixby | google/gdata-2.0.18/build/lib.linux-x86_64-2.7/gdata/tlslite/__init__.py | 409 | 1129 | """
TLS Lite is a free python library that implements SSL v3, TLS v1, and
TLS v1.1. TLS Lite supports non-traditional authentication methods
such as SRP, shared keys, and cryptoIDs, in addition to X.509
certificates. TLS Lite is pure python, however it can access OpenSSL,
cryptlib, pycrypto, and GMPY for faster crypt... | gpl-3.0 |
int19h/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/zipfile.py | 6 | 80379 | """
Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
import io
import os
import importlib.util
import sys
import time
import stat
import shutil
import struct
import binascii
import threading
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except Import... | apache-2.0 |
dblia/nosql-ganeti | test/py/ganeti.rapi.rlib2_unittest.py | 2 | 58976 | #!/usr/bin/python
#
# Copyright (C) 2010, 2012 Google 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 2 of the License, or
# (at your option) any later version.
#
# This p... | gpl-2.0 |
axtra/ansible | lib/ansible/runner/lookup_plugins/together.py | 174 | 2135 | # (c) 2013, Bradley Young <young.bradley@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 later... | gpl-3.0 |
rohitw1991/smarttailorfrappe | frappe/tests/test_db_query.py | 35 | 1520 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import frappe, unittest
from frappe.model.db_query import DatabaseQuery
class TestReportview(unittest.TestCase):
def test_basic(self):
self.assertTrue({"name":"DocType"} in DatabaseQuery("DocType").execute(limit... | mit |
gkoelln/youtube-dl | youtube_dl/extractor/cjsw.py | 45 | 2412 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
unescapeHTML,
)
class CJSWIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cjsw\.com/program/(?P<program>[^/]+)/episode/(?P<id>\d+)'
_TESTS = [{
'url':... | unlicense |
jcasner/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/dviread.py | 69 | 29920 | """
An experimental module for reading dvi files output by TeX. Several
limitations make this not (currently) useful as a general-purpose dvi
preprocessor.
Interface::
dvi = Dvi(filename, 72)
for page in dvi: # iterate over pages
w, h, d = page.width, page.height, page.descent
for x,y,font,gl... | agpl-3.0 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_2/django/http/__init__.py | 50 | 17449 | import os
import re
from Cookie import BaseCookie, SimpleCookie, CookieError
from pprint import pformat
from urllib import urlencode
from urlparse import urljoin
try:
# The mod_python version is more efficient, so try importing it first.
from mod_python.util import parse_qsl
except ImportError:
from cgi imp... | mit |
avannaldas/QuickView | QuickView/DataFrameVisualizer.py | 1 | 5101 | '''
Title: QuickView
Purpose: Provides a Glance at the dataset with one line of code!
GitHub: http://github.com/avannaldas/QuickView
Author: Abhijit Annaldas (Twitter @avannaldas)
'''
import pandas as _pd
import matplotlib.pyplot as _plt
from matplotlib.pyplot import cm
'''Number of rows in the dataframe'''
row_count... | mit |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/boto/gs/acl.py | 184 | 11457 | # Copyright 2010 Google Inc.
#
# 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, dis-
# trib... | mit |
yodalee/servo | tests/wpt/web-platform-tests/tools/pytest/testing/code/test_source.py | 171 | 17821 | # flake8: noqa
# disable flake check on this file because some constructs are strange
# or redundant on purpose and can't be disable on a line-by-line basis
import sys
import _pytest._code
import py
import pytest
from _pytest._code import Source
from _pytest._code.source import _ast
if _ast is not None:
astonly =... | mpl-2.0 |
bgris/ODL_bgris | lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 514 | 5931 | from __future__ import absolute_import
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
... | gpl-3.0 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.127/roles/openshift_certificate_expiry/test/test_load_and_handle_cert.py | 78 | 2030 | '''
Unit tests for the load_and_handle_cert method
'''
import datetime
import os
import sys
import pytest
MODULE_PATH = os.path.realpath(os.path.join(__file__, os.pardir, os.pardir, 'library'))
sys.path.insert(1, MODULE_PATH)
# pylint: disable=import-error,wrong-import-position,missing-docstring
# pylint: disable=i... | apache-2.0 |
BigBrother1984/android_external_chromium_org | third_party/protobuf/python/google/protobuf/internal/text_format_test.py | 162 | 23727 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | bsd-3-clause |
peterfpeterson/mantid | Framework/PythonInterface/test/python/plugins/functions/RFresonanceTest.py | 3 | 1312 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
Azulinho/ansible | lib/ansible/plugins/action/vyos.py | 6 | 3640 | #
# (c) 2016 Red Hat 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 version.
#
# Ansible is d... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/redhatopenshift/azure-mgmt-redhatopenshift/azure/mgmt/redhatopenshift/_azure_red_hat_open_shift4_client.py | 1 | 5741 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
muntasirsyed/intellij-community | python/helpers/docutils/transforms/components.py | 196 | 1993 | # $Id: components.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Docutils component-related transforms.
"""
__docformat__ = 'reStructuredText'
import sys
import os
import re
import time
from docutils import nodes,... | apache-2.0 |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/django/contrib/gis/geos/linestring.py | 224 | 5607 | from django.contrib.gis.geos.base import numpy
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.point import Point
from django.contrib.gis.geos import prototypes as cap... | mit |
RedlineResearch/ardupilot | Tools/autotest/param_metadata/wikiemit.py | 23 | 2920 | #!/usr/bin/env python
import re
from emit import Emit
from param import known_param_fields, known_units
# Emit docs in a form acceptable to the APM wiki site
class WikiEmit(Emit):
def __init__(self):
Emit.__init__(self)
wiki_fname = 'Parameters.wiki'
self.f = open(wiki_fname, mode='w')
... | gpl-3.0 |
jmahler/linux-next | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
openstack/octavia | octavia/db/migration/alembic_migrations/versions/8c0851bdf6c3_change_tls_container_id_length_in_sni_.py | 1 | 1043 | # Copyright 2016 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
apexdatasolutions/VistA | Scripts/Testing/PyUnit/TestPatchOrderGenerator.py | 7 | 3660 | #---------------------------------------------------------------------------
# Copyright 2013 The Open Source Electronic Health Record Agent
#
# 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
#
... | apache-2.0 |
CyanogenMod/android_external_chromium_org | tools/python/google/process_utils.py | 186 | 7475 | # Copyright (c) 2006-2008 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.
"""Shared process-related utility functions."""
import errno
import os
import subprocess
import sys
class CommandNotFound(Exception): pass
TASKKI... | bsd-3-clause |
billyhunt/osf.io | website/addons/dataverse/views/config.py | 7 | 4919 | # -*- coding: utf-8 -*-
import httplib as http
from flask import request
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_logged_in
from website.project import decorators
from website.util.sanitize... | apache-2.0 |
chanceraine/nupic | nupic/regions/ImageSensorFilters/BoxFixer.py | 17 | 27788 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
yaroslavprogrammer/django | django/template/smartif.py | 239 | 6269 | """
Parser and utilities for the smart 'if' tag
"""
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
class TokenBase(object):
"""
Base class for ope... | bsd-3-clause |
papouso/odoo | openerp/tools/config.py | 178 | 36937 | #openerp.loggers.handlers. -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program... | agpl-3.0 |
ericfc/django | tests/admin_changelist/admin.py | 247 | 3931 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.core.paginator import Paginator
from .models import Child, Event, Parent, Swallow
site = admin.AdminSite(name="admin")
site.register(User, UserAdmin)
class CustomPaginator(Pagina... | bsd-3-clause |
home-assistant/home-assistant | tests/components/logi_circle/test_config_flow.py | 2 | 7027 | """Tests for Logi Circle config flow."""
import asyncio
from unittest.mock import AsyncMock, Mock, patch
import pytest
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.logi_circle import config_flow
from homeassistant.components.logi_circle.config_flow import (
DOMAIN,
A... | apache-2.0 |
tinkhaven-organization/odoo | addons/portal_claim/__openerp__.py | 432 | 1643 | # -*- 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 |
overcastcloud/trollius | trollius/base_events.py | 1 | 44639 | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... | apache-2.0 |
jeremiahmarks/sl4a | python/src/Lib/lib2to3/fixes/fix_print.py | 53 | 2957 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for print.
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are appl... | apache-2.0 |
aliyun/oss-ftp | python27/win32/Lib/site-packages/cryptography/hazmat/primitives/hmac.py | 61 | 2353 | # 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
from cryptography import utils
from cryptography.exceptions import (
... | mit |
phillxnet/rockstor-core | src/rockstor/storageadmin/south_migrations/0022_auto__add_dvolume__add_unique_dvolume_container_dest_dir__add_containe.py | 9 | 35685 | # -*- 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 'DVolume'
db.create_table(u'storageadmin_dvolume', (
... | gpl-3.0 |
ville-k/tensorflow | tensorflow/python/tools/selective_registration_header_lib.py | 56 | 6103 | # 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 |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/weave/tests/test_build_tools.py | 96 | 2480 | from __future__ import absolute_import, print_function
# still needed
# tests for MingW32Compiler
# don't know how to test gcc_exists() and msvc_exists()...
import os
import sys
import tempfile
import warnings
from numpy.testing import TestCase, assert_, run_module_suite
from scipy.weave import build_tools
# filte... | mit |
jotes/moto | tests/test_route53/test_route53.py | 5 | 8783 | from __future__ import unicode_literals
import boto
from boto.route53.healthcheck import HealthCheck
from boto.route53.record import ResourceRecordSets
import sure # noqa
from moto import mock_route53
@mock_route53
def test_hosted_zone():
conn = boto.connect_route53('the_key', 'the_secret')
firstzone = co... | apache-2.0 |
nitzmahone/ansible | lib/ansible/modules/cloud/ovirt/ovirt_disk.py | 5 | 28981 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUME... | gpl-3.0 |
mdesaive/admindb | admindb/admindb/settings.py | 1 | 4878 | """
Django settings for admindb project.
Generated by 'django-admin startproject' using Django 1.9.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
Author: Melanie ... | gpl-3.0 |
tiagocardosos/stoq | stoqlib/l10n/l10n.py | 3 | 1931 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2012 Async Open Source
##
## This program 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 2
## of the License, or... | gpl-2.0 |
gauribhoite/personfinder | env/google_appengine/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... | apache-2.0 |
dmulholland/ivy | ivy/utils.py | 1 | 3670 | # ------------------------------------------------------------------------------
# This module contains utility functions used throughout the application.
# ------------------------------------------------------------------------------
import os
import shutil
import unicodedata
import re
import sys
from . import hook... | unlicense |
emxys1/imx6rex-bombardier-base-linux-3.10.17 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
SaikWolf/gnuradio | gr-qtgui/apps/qt_digital.py | 58 | 9849 | #!/usr/bin/env python
#
# 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)
... | gpl-3.0 |
vveerava/Openstack | neutron/tests/unit/vmware/test_nsx_opts.py | 9 | 11831 | # Copyright 2013 VMware, 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 agree... | apache-2.0 |
demarle/VTK | Filters/AMR/Testing/Python/TestAMRSliceFilter.py | 21 | 1088 | #!/usr/bin/env python
# This tests vtkAMRResampleFilter
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
def NumCells(out):
n =0;
for i in range(out.GetNumberOfLevels()):
for j in range(out.GetNumberOfDataSets(i)):
m = out.GetDataSet(i,j... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.