repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
yiliaofan/brotli | setup.py | 67 | 7796 | import distutils
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext
from distutils.cmd import Command
import platform
import os
import re
CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
# when compiling for Windows Python 2.7, force distutils to use ... | apache-2.0 |
mosesfistos1/beetbox | beetsplug/web/__init__.py | 4 | 9737 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | mit |
hernandito/SickRage | lib/markupsafe/_constants.py | 1535 | 4795 | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
'AElig': 198,
'Aacute': 193,
'Acirc': 194,
'Agrave': 1... | gpl-3.0 |
levixie/zulip | api/integrations/asana/zulip_asana_config.py | 124 | 2157 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Zulip, 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
#... | apache-2.0 |
maciekcc/tensorflow | tensorflow/tools/test/run_and_gather_logs.py | 137 | 4918 | # 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 |
fossoult/odoo | addons/l10n_eu_service/__openerp__.py | 254 | 3277 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... | agpl-3.0 |
hefnrh/PyChat | client/rabin.py | 1 | 5671 | from math import *
from random import *
class rabin:
def __init__(self):
pass
def get_big(self, bit): #get a big number x that x % 4 = 3
big = 1
for i in range(bit-3):
temp = randrange(0,2)
big = big * 2 + temp
big = big * 4 + 3
ret... | gpl-2.0 |
gnieboer/tensorflow | tensorflow/compiler/tests/variable_ops_test.py | 30 | 3939 | # 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 |
gimarg/dynamotors | node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py | 1869 | 1247 | # Copyright 2014 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.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... | gpl-2.0 |
irvingpop/digital-beer-menu | src/lib/flask_admin/tests/test_model.py | 9 | 23799 | import wtforms
from nose.tools import eq_, ok_
from flask import Flask
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.test import Client
from wtforms import fields
from flask_admin import Admin, form
from flask_admin._compat import iteritems, itervalues
from flask_admin.model import base, filters
fro... | gpl-2.0 |
jcushman/pywb | pywb/manager/manager.py | 1 | 16268 | import os
import shutil
import sys
import logging
import heapq
import yaml
import re
from distutils.util import strtobool
from pkg_resources import resource_string
from argparse import ArgumentParser, RawTextHelpFormatter
from pywb.utils.loaders import load_yaml_config
from pywb.utils.timeutils import timestamp20_no... | gpl-3.0 |
anpingli/openshift-ansible | roles/openshift_health_checker/openshift_checks/logging/elasticsearch.py | 45 | 9996 | """Check for an aggregated logging Elasticsearch deployment"""
import json
import re
from openshift_checks import OpenShiftCheckException, OpenShiftCheckExceptionList
from openshift_checks.logging.logging import LoggingCheck
class Elasticsearch(LoggingCheck):
"""Check for an aggregated logging Elasticsearch dep... | apache-2.0 |
Refefer/pylearn2 | pylearn2/datasets/norb.py | 44 | 14401 | """
An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads
the original NORB file format, not the LISA lab's `.npy` version.
Currently only supports the Small NORB Dataset.
Download the dataset from
`here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_.
NORB dataset(s) by Fu Jie Huang a... | bsd-3-clause |
appop/bitcoin | qa/rpc-tests/invalidateblock.py | 1 | 3083 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The nealcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the invalidateblock RPC."""
from test_framework.test_framework import nealcoinTestFramework
from... | mit |
xzturn/tensorflow | tensorflow/python/platform/analytics.py | 21 | 1090 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
alikins/ansible | lib/ansible/modules/cloud/cloudscale/cloudscale_floating_ip.py | 49 | 9740 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
# 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_ve... | gpl-3.0 |
idjaw/keystone | keystone/contrib/endpoint_policy/backends/sql.py | 11 | 1154 | # 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
# distributed under t... | apache-2.0 |
kumajaya/android_kernel_samsung_lt02 | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
autopulated/yotta | yotta/test/cli/test_shrinkwrap.py | 3 | 5298 | #!/usr/bin/env python
# Copyright 2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import unittest
import os
import copy
# internal modules:
from yotta.test.cli import cli
from yotta.test.cli import util
Test_Target = "x86-osx-native... | apache-2.0 |
waynew/salmon | salmon/data/prototype/config/testing.py | 2 | 1091 | from config import settings
from salmon import view
from salmon.routing import Router
from salmon.server import Relay
import jinja2
import logging
import logging.config
import os
logging.config.fileConfig("config/test_logging.conf")
# the relay host to actually send the final message to (set debug=1 to see what
# the... | gpl-3.0 |
pwmarcz/django | django/contrib/gis/geos/prototypes/errcheck.py | 48 | 3013 | """
Error checking functions for GEOS ctypes prototype functions.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the `free` routine used to free the memory allocated for
# string pointers ... | bsd-3-clause |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/tests/regressiontests/utils/decorators.py | 43 | 3919 | from django.http import HttpResponse
from django.template import Template, Context
from django.template.response import TemplateResponse
from django.test import TestCase, RequestFactory
from django.utils.decorators import decorator_from_middleware
class ProcessViewMiddleware(object):
def process_view(self, reques... | mit |
gmacchi93/serverInfoParaguay | apps/venv/lib/python2.7/site-packages/pip/exceptions.py | 398 | 1086 | """Exceptions used throughout package"""
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class DistributionNotFound(InstallationError)... | apache-2.0 |
shishaochen/TensorFlow-0.8-Win | third_party/grpc/tools/buildgen/plugins/generate_vsprojects.py | 59 | 3748 | # Copyright 2015, 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 conditions and the f... | apache-2.0 |
mozilla/verbatim | vendor/lib/python/django/contrib/admin/actions.py | 98 | 3205 | """
Built-in, globally-available admin actions.
"""
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.template.response import TemplateResponse
from django.utils... | gpl-2.0 |
breisfeld/avoplot | src/AvoPlot.py | 3 | 1352 | #!/usr/bin/python
#Copyright (C) Nial Peters 2013
#
#This file is part of AvoPlot.
#
#AvoPlot 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 |
tashigaofei/BlogSpider | scrapy/contrib/downloadermiddleware/httpcache.py | 33 | 4327 | from email.utils import formatdate
from scrapy import signals
from scrapy.exceptions import NotConfigured, IgnoreRequest
from scrapy.utils.misc import load_object
class HttpCacheMiddleware(object):
def __init__(self, settings, stats):
if not settings.getbool('HTTPCACHE_ENABLED'):
raise NotCon... | mit |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/tensorboard/plugins/base_plugin.py | 27 | 2305 | # 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... | mit |
kmee/odoo-brazil-hr | l10n_br_hr_arquivos_governo/models/arquivo_grrf.py | 2 | 9714 | # -*- coding: utf-8 -*-
# (c) 2017 KMEE- Hendrix Costa <hendrix.costa@kmee.com.br>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from .abstract_arquivos_governo import AbstractArquivosGoverno
class Grrf(AbstractArquivosGoverno):
# Informações do Responsavel
def _registro_00(self):
... | agpl-3.0 |
nikhilnrng/algorithms-and-data-structures | data_structures/trees/binary_search_tree.py | 1 | 5647 | class BSTNode(object):
"""A node in a binary search tree."""
def __init__(self, data, left=None, right=None):
self.data = data
self.left = left
self.right = right
class BinarySearchTree(object):
"""A class for a binary search tree that stores unique values."""
def __init__(sel... | mit |
chubbymaggie/simuvex | simuvex/vex/statements/storeg.py | 1 | 1135 | from . import SimIRStmt
from ... import s_options as o
from ...s_action_object import SimActionObject
from ...s_action import SimActionData
class SimIRStmt_StoreG(SimIRStmt):
def _execute(self):
addr = self._translate_expr(self.stmt.addr)
data = self._translate_expr(self.stmt.data)
expr = d... | bsd-2-clause |
tsteinholz/cldoc | setup.py | 2 | 4372 | #!/usr/bin/env python
from setuptools import setup, Command
import subprocess, os, shutil, glob, sys
coffee_files = [
'cldoc.coffee',
'page.coffee',
'sidebar.coffee',
'node.coffee',
'type.coffee',
'doc.coffee',
'category.coffee',
'enum.coffee',
'templated.coffee',
'struct.coff... | gpl-2.0 |
fmichea/srddl | srddl/filetypes/pcap.py | 1 | 1307 | import srddl.data as sd
import srddl.fields as sf
import srddl.helpers as sh
import srddl.models as sm
class PcapFileHeader(sm.Struct):
magic = sf.IntField('magic', size=4)
version_major = sf.IntField('', size=2)
version_minor = sf.IntField('', size=2)
thiszone = sf.IntField('gmt to local correction', size=4)
... | bsd-3-clause |
isc-projects/forge | tests/dhcpv6/kea_only/config_backend/test_cb_v6_options.py | 1 | 13970 | """Kea database config backend commands hook testing"""
import pytest
import srv_msg
from cb_model import setup_server_for_config_backend_cmds
pytestmark = [pytest.mark.v6,
pytest.mark.kea_only,
pytest.mark.controlchannel,
pytest.mark.hook,
pytest.mark.config_b... | isc |
joone/chromium-crosswalk | tools/findit/svn_repository_parser.py | 74 | 9178 | # Copyright (c) 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 xml.dom.minidom as minidom
from xml.parsers.expat import ExpatError
import crash_utils
from repository_parser_interface import ParserInterface
... | bsd-3-clause |
flyingrub/scdl | scdl/scdl.py | 1 | 26778 | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""scdl allows you to download music from Soundcloud
Usage:
scdl -l <track_url> [-a | -f | -C | -t | -p][-c | --force-metadata][-n <maxtracks>]\
[-o <offset>][--hidewarnings][--debug | --error][--path <path>][--addtofile][--addtimestamp]
[--onlymp3][--hide-progress... | gpl-2.0 |
CrankWheel/grit-i18n | grit/gather/rc.py | 62 | 11190 | #!/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.
'''Support for gathering resources from RC files.
'''
import re
from grit import exception
from grit import lazy_re
from grit im... | bsd-2-clause |
ravibhure/ansible | lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py | 49 | 9858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, 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 So... | gpl-3.0 |
paweljasinski/ironpython3 | Tests/interop/net/loadorder/t3h.py | 3 | 1606 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... | apache-2.0 |
CiscoUcs/Ironic | build/lib/ironic/openstack/common/periodic_task.py | 5 | 8319 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/twisted/conch/scripts/tkconch.py | 10 | 22833 | # -*- test-case-name: twisted.conch.test.test_scripts -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementation module for the `tkconch` command.
"""
import Tkinter, tkFileDialog, tkMessageBox
from twisted.conch import error
from twisted.conch.ui import tkvt100
from twisted.conch.... | mit |
txemi/ansible | lib/ansible/utils/module_docs_fragments/cnos.py | 77 | 3621 | # Copyright (C) 2017 Lenovo, 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.
#
# Ansi... | gpl-3.0 |
andreymaznyak/ontologydatabase | vendor/sonata-project/admin-bundle/Resources/doc/conf.py | 77 | 7893 | # -*- coding: utf-8 -*-
#
# IoC documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 29 01:43:00 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All con... | mit |
111t8e/h2o-2 | py/testdir_multi_jvm/test_rf_hhp_2a_fvec.py | 9 | 2453 | import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_exec, h2o_rf
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(3)
@classmethod
def tearDownCl... | apache-2.0 |
rahushen/ansible | lib/ansible/modules/packaging/os/svr4pkg.py | 14 | 7700 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Boyd Adamson <boyd () boydadamson.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... | gpl-3.0 |
ofekd/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/performance/concatenation.py | 451 | 1145 | from __future__ import absolute_import, division, unicode_literals
def f1():
x = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
z = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
x += y + z
def f2():
x = "ABCDEFGHIJKLMNOP... | mpl-2.0 |
ExPHAT/binding-of-isaac | Gurdy.py | 1 | 1437 | # Gurdy.py
# Aaron Taylor
# Moose Abumeeiz
#
# This is the first boss, Gurdy. He just sits there and takes your bullets
#
from pygame import *
from const import *
from func import *
from Animation import *
from Enemy import *
class Gurdy(Enemy):
x = 6
y = 3
health = 100
hurtDistance = 2
def __init__(self, tex... | mit |
Vignesh2208/Awlsim | awlsim/core/systemblocks/system_sfc_m1.py | 2 | 1118 | # -*- coding: utf-8 -*-
#
# AWL simulator - SFCs
#
# Copyright 2012-2015 Michael Buesch <m@bues.ch>
#
# 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 yo... | gpl-2.0 |
nicko96/Chrome-Infra | appengine/findit/handlers/failure_log.py | 1 | 1213 | # 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.
from base_handler import BaseHandler
from base_handler import Permission
from waterfall import buildbot
from waterfall import masters
from model.wf_step impo... | bsd-3-clause |
pyrocko/kite | src/deramp.py | 1 | 2008 | import numpy as num
from pyrocko.guts import Bool
from .plugin import PluginConfig, Plugin
class DerampConfig(PluginConfig):
demean = Bool.T(optional=True, default=True)
class Deramp(Plugin):
def __init__(self, scene, config=None):
self.scene = scene
self.config = config or DerampConfig()... | gpl-3.0 |
sarvex/tensorflow | tensorflow/python/training/slot_creator.py | 9 | 10200 | # 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 |
fake-name/ReadableWebProxy | alembic/versions/2019-09-14_5552dfae2cb0_add_hash_function_and_dependent_pgcrpyto.py | 1 | 1402 | """Add has function and dependent pgcrpyto
Revision ID: 5552dfae2cb0
Revises: c225ea8fbf5e
Create Date: 2019-09-14 06:19:36.520447
"""
# revision identifiers, used by Alembic.
revision = '5552dfae2cb0'
down_revision = 'c225ea8fbf5e'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as ... | bsd-3-clause |
AngelkPetkov/titanium_mobile | support/common/markdown/etree_loader.py | 136 | 1287 |
from markdown import message, CRITICAL
import sys
## Import
def importETree():
"""Import the best implementation of ElementTree, return a module object."""
etree_in_c = None
try: # Is it Python 2.5+ with C implemenation of ElementTree installed?
import xml.etree.cElementTree as etree_in_c
exce... | apache-2.0 |
BruceDai/testkit-lite | testkitlite/engines/bdd.py | 4 | 5938 | #!/usr/bin/python
#
# Copyright (C) 2012 Intel Corporation
#
# 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 pr... | gpl-2.0 |
GoSteven/PythonPractice | basic/solution/mimic.py | 208 | 2995 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | apache-2.0 |
sgraham/nope | chrome/common/extensions/docs/server2/object_store_creator_test.py | 94 | 1899 | #!/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.
import unittest
from environment import GetAppVersion
from test_object_store import TestObjectStore
from object_store_creator import O... | bsd-3-clause |
ryfeus/lambda-packs | Tensorflow_Pandas_Numpy/source3.6/numpy/polynomial/__init__.py | 11 | 1150 | """
A sub-package for efficiently dealing with polynomials.
Within the documentation for this sub-package, a "finite power series,"
i.e., a polynomial (also referred to simply as a "series") is represented
by a 1-D numpy array of the polynomial's coefficients, ordered from lowest
order term to highest. For example, a... | mit |
haukurk/qlivestats | qlivestats/core/config.py | 1 | 1253 | import yaml
import os
class BaseConfigError(Exception):
pass
class ConfigParsingError(BaseConfigError):
pass
class ConfigReadError(BaseConfigError):
pass
class BaseHolder(object):
def __init__(self, configfile="/etc/qlivestats.yaml"):
self.name = self.__class__.__name__.lower()
... | mit |
naritta/numpy | numpy/f2py/cb_rules.py | 23 | 20754 | #!/usr/bin/env python
"""
Build call-back mechanism for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 20... | bsd-3-clause |
RaspberryCoin/RaspberryCoinCore | qa/rpc-tests/forknotify.py | 15 | 2204 | #!/usr/bin/env python3
# Copyright (c) 2014-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 -alertnotify
#
from test_framework.test_framework import BitcoinTestFramework
from test_framew... | mit |
dsoft20/romrenamer | rm.py | 1 | 3004 | #Replace game name with the rom name, github: https://github.com/dsoft20
#This script takes the gamelist.xml generated by the Universal XML-Scraper
#and replace the scraped name field (<name>) with the rom name
# <path>./Game name (Europe).zip</path>
# <name>Game name</name>
# TO
# <path>./Game name (Europe).z... | mit |
jcpowermac/ansible | test/runner/lib/powershell_import_analysis.py | 102 | 2276 | """Analyze powershell import statements."""
from __future__ import absolute_import, print_function
import os
import re
from lib.util import (
display,
)
def get_powershell_module_utils_imports(powershell_targets):
"""Return a dictionary of module_utils names mapped to sets of powershell file paths.
:ty... | gpl-3.0 |
resmo/ansible | test/units/modules/network/fortios/test_fortios_user_security_exempt_list.py | 21 | 7891 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
kaniini/aerospike-py | aerospike_py/message.py | 1 | 10055 | import asyncio
from collections import namedtuple
import struct
from aerospike_py.connection import Connection, ASConnectionError
from aerospike_py.result_code import ASMSGProtocolException
class ASIOException(Exception):
pass
class InvalidMessageException(Exception):
pass
# --- all messages ---
Aerospi... | isc |
yzl0083/orange | docs/reference/rst/code/freeviz-pca.py | 6 | 1686 | # Description: FreeViz projector
# Category: projection
# Uses: zoo
# Referenced: Orange.projection.linear
# Classes: Orange.projection.linear.FreeViz, Orange.projection.linear.Projector
import Orange
import numpy as np
tab = Orange.data.Table('titanic')
ind = Orange.data.sample.SubsetIndices2(p0=0.99... | gpl-3.0 |
pombredanne/similarityPy | tests/algorihtm_tests/mean_test.py | 2 | 1357 | from unittest import TestCase
from similarityPy.algorithms.mean import Mean
from tests import test_logger
__author__ = 'cenk'
class MeanTest(TestCase):
def setUp(self):
pass
def test_algorithm_with_list(self):
test_logger.debug("MeanTest - test_algorithm_with_list Starts")
mean = M... | mit |
curiousbadger/pyWitnessSolver | src/lib/Partition.py | 1 | 10104 | '''
Created on Mar 9, 2016
@author: charper
'''
from collections import Counter
import logging
from lib import lib_dbg_filehandler, lib_consolehandler, lib_inf_filehandler
module_logger=logging.getLogger(__name__)
module_logger.addHandler(lib_inf_filehandler)
module_logger.addHandler(lib_dbg_filehandler)
... | gpl-3.0 |
xiaoxiaoyao/MyApp | PythonApplication1/自己的小练习/Sankey桑基图.py | 2 | 4119 | from pyecharts.charts import Sankey
from pyecharts import options as opts
linkes=[
{'source':'03万','target':'续费后03万','value':20},
{'source':'03万','target':'续费后05万','value':70},
{'source':'03万','target':'续费后10万','value':25},
{'source':'03万','target':'续费后15万','value':12},
{'source':'03万','target':'续费后25万','value':10},
{... | unlicense |
KhronosGroup/COLLADA-CTS | StandardDataSets/collada/library_effects/effect/profile_COMMON/technique/lambert/transparent/effect_lambert_transparent_texture_aone/effect_lambert_transparent_texture_aone.py | 2 | 4099 |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publ... | mit |
masia02/chainer | tests/cupy_tests/manipulation_tests/test_split.py | 15 | 1695 | import unittest
from cupy import testing
@testing.gpu
class TestSplit(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.numpy_cupy_array_equal()
def test_array_spliti1(self, xp):
a = testing.shaped_arange((3, 11), xp)
split = xp.array_split(a, 4, 1)
return xp.concaten... | mit |
daevaorn/sentry | src/sentry/quotas/redis.py | 1 | 2795 | """
sentry.quotas.redis
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from time import time
from sentry.exceptions import InvalidConfiguration
from sentry.quotas.base import NotRa... | bsd-3-clause |
Kronuz/pyScss | scss/extension/extra.py | 5 | 16464 | """Functions new to the pyScss library."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os.path
import random
import six
from six.moves import xrange
from scss import config
from scss.errors ... | mit |
HiroIshikawa/21playground | microblog/flask/lib/python3.5/site-packages/pbr/pbr_json.py | 41 | 1228 | # Copyright 2011 OpenStack LLC.
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
# 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
#
# htt... | mit |
iblacksand/SimpleDiveMeets | node_modules/dmg-builder/vendor/ds_store/store.py | 11 | 45209 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import binascii
import struct
import biplist
import mac_alias
try:
next
except NameError:
next = lambda x: x.next()
try:
unicode
except NameError:
unicode = str
from .... | gpl-3.0 |
KWierso/treeherder | treeherder/etl/perf.py | 1 | 9481 | import copy
import logging
from hashlib import sha1
from typing import List
import simplejson as json
from treeherder.log_parser.utils import validate_perf_data
from treeherder.model.models import OptionCollection
from treeherder.perf.models import (PerformanceDatum,
PerformanceFra... | mpl-2.0 |
dendisuhubdy/tensorflow | tensorflow/python/ops/image_grad_test.py | 18 | 15052 | # 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 |
meghana1995/sympy | sympy/ntheory/generate.py | 58 | 17478 | """
Generating and counting primes.
"""
from __future__ import print_function, division
import random
from bisect import bisect
# Using arrays for sieving instead of lists greatly reduces
# memory consumption
from array import array as _array
from .primetest import isprime
from sympy.core.compatibility import as_int... | bsd-3-clause |
skycucumber/xuemc | python/venv/lib/python2.7/site-packages/whoosh/codec/plaintext.py | 30 | 14257 | # Copyright 2012 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | gpl-2.0 |
faulkner/swampdragon | tests/test_base_model_router_delete.py | 13 | 1163 | from swampdragon.route_handler import BaseModelRouter, SUCCESS
from swampdragon.serializers.model_serializer import ModelSerializer
from swampdragon.testing.dragon_testcase import DragonTestCase
from .models import TwoFieldModel
class Serializer(ModelSerializer):
class Meta:
update_fields = ('text', 'numb... | bsd-3-clause |
moutai/scikit-learn | sklearn/covariance/__init__.py | 389 | 1157 | """
The :mod:`sklearn.covariance` module includes methods and algorithms to
robustly estimate the covariance of features given a set of points. The
precision matrix defined as the inverse of the covariance is also estimated.
Covariance estimation is closely related to the theory of Gaussian Graphical
Models.
"""
from ... | bsd-3-clause |
openplans/shareabouts-api | src/sa_api_v2/south_migrations/0033_create_clients_for_existing_api_keys.py | 2 | 9942 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
depends_on = (
("apikey", "0002_auto__add_field_apikey_client"),
)
def forwards(self, orm):
"Write your forwards methods here."
... | gpl-3.0 |
flacjacket/pywayland | example/surface.py | 1 | 5108 | # Copyright 2015 Sean Vig
#
# 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, sof... | apache-2.0 |
ChemiKhazi/Sprytile | rx/backpressure/pausable.py | 2 | 1729 |
from rx.core import Observable, ObservableBase, Disposable
from rx.internal import extensionmethod
from rx.disposables import CompositeDisposable
from rx.subjects import Subject
class PausableObservable(ObservableBase):
def __init__(self, source, pauser=None):
self.source = source
self.controller... | mit |
beck/django | django/apps/config.py | 131 | 8077 | import os
from importlib import import_module
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils._os import upath
from django.utils.module_loading import module_has_submodule
MODELS_MODULE_NAME = 'models'
class AppConfig(object):
"""
Class representing a Django ap... | bsd-3-clause |
mfasDa/raadev | analysis/base/DataSet.py | 1 | 10982 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | gpl-3.0 |
chronicwaffle/PokemonGo-DesktopMap | app/pywin/Lib/lib-tk/test/test_ttk/test_extensions.py | 38 | 10397 | import sys
import unittest
import Tkinter as tkinter
import ttk
from test.test_support import requires, run_unittest, swap_attr
from test_ttk.support import AbstractTkTest, destroy_default_root
requires('gui')
class LabeledScaleTest(AbstractTkTest, unittest.TestCase):
def tearDown(self):
self.root.update... | mit |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/xml/sax/_exceptions.py | 250 | 4785 | """Different kinds of SAX Exceptions"""
import sys
if sys.platform[:4] == "java":
from java.lang import Exception
del sys
# ===== SAXEXCEPTION =====
class SAXException(Exception):
"""Encapsulate an XML error or warning. This class can contain
basic error or warning information from either the XML parser o... | gpl-2.0 |
cloudsigma/cloud-init | cloudinit/sources/helpers/openstack.py | 1 | 15113 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Joshua Harlow <harlowja@yahoo-inc.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
smoitra87/gerbil | deepnet/sparse_coder.py | 13 | 9682 | from neuralnet import *
from sparse_code_layer import *
import scipy.linalg
class SparseCoder(NeuralNet):
def SetLayerAndEdgeClass(self):
self.LayerClass = SparseCodeLayer
self.EdgeClass = Edge
def Show(self):
encoder = self.encoder.params['weight'].asarray()
decoder = self.decoder.params['weight'... | bsd-3-clause |
theshadowx/enigma2 | lib/python/Screens/HelpMenu.py | 13 | 1630 | from Screen import Screen
from Components.Pixmap import Pixmap, MovingPixmap
from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.HelpMenuList import HelpMenuList
from Screens.Rc import Rc
class HelpMenu(Screen, Rc):
def __init__(self, session, list):
Screen.__init__(self, s... | gpl-2.0 |
NERC-CEH/jules-jasmin | job_runner/job_runner/config/environment.py | 1 | 1725 | """Pylons environment configuration"""
import os
from mako.lookup import TemplateLookup
from pylons.configuration import PylonsConfig
from pylons.error import handle_mako_error
import job_runner.lib.app_globals as app_globals
import job_runner.lib.helpers
from job_runner.config.routing import make_map
def load_envir... | gpl-2.0 |
neerajvashistha/pa-dude | lib/python2.7/site-packages/docx/opc/part.py | 13 | 8157 | # encoding: utf-8
"""
Open Packaging Convention (OPC) objects related to package parts.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from .compat import cls_method_fn
from .oxml import serialize_part_xml
from ..oxml import parse_xml
from .packuri import PackURI
from ... | mit |
wnoc-drexel/gem5-stable | src/mem/AddrMapper.py | 69 | 3530 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
joausaga/participa | cparte/test.py | 1 | 9070 | from django.test import TestCase
from cparte.models import Channel
import channel_middleware
import ConfigParser
import json
import re
import tweepy
class TwitterTestCase(TestCase):
fixtures = ['cparte.json']
url = "https://twitter.com/"
config = ConfigParser.ConfigParser()
config.read('cparte/config... | mit |
deltreey/ansible | lib/ansible/utils/unicode.py | 88 | 11283 | # (c) 2012-2014, Toshio Kuraotmi <a.badger@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 |
DevOps4Networks/ansible | lib/ansible/plugins/lookup/shelvefile.py | 132 | 2906 | # (c) 2015, Alejandro Guirao <lekumberri@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 |
PySyncer/shows_sync | shows_sync/providers/output/myanimelist.py | 1 | 2643 | from lxml import etree
import time
import requests
import constants as CONSTANTS
import urllib
import logging
from pymal import Mal
import sys
class MyAnimeList(object):
def __init__(self, username, password):
self.username = username
self.password = password
self.mal = Mal.Mal(username, p... | mit |
soarpenguin/ansible | lib/ansible/plugins/action/fetch.py | 42 | 9898 | # (c) 2012-2014, 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) an... | gpl-3.0 |
eyalfa/spark | python/pyspark/ml/wrapper.py | 24 | 12950 | #
# 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 |
quoclieu/codebrew17-starving | env/lib/python3.5/site-packages/Crypto/Math/Numbers.py | 10 | 5358 | # ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributio... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.