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 |
|---|---|---|---|---|---|
mhaessig/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_parser2.py | 451 | 2119 | from __future__ import absolute_import, division, unicode_literals
import io
from . import support # flake8: noqa
from html5lib import html5parser
from html5lib.constants import namespaces
from html5lib import treebuilders
import unittest
# tests that aren't autogenerated from text files
class MoreParserTests(un... | mpl-2.0 |
enod/pyswip | examples/create_term.py | 10 | 1824 | # -*- coding:utf-8 -*-
# pyswip -- Python SWI-Prolog bridge
# Copyright (c) 2007-2012 Yüce Tekol
#
# 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 l... | mit |
b0ttl3z/SickRage | lib/sqlalchemy/engine/util.py | 79 | 2331 | # engine/util.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import util
def connection_memoize(key):
"""Decorator, memoize a function ... | gpl-3.0 |
les69/calvin-base | calvin/actorstore/systemactors/web/FacebookPicture.py | 1 | 1502 | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Ericsson AB
#
# 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 |
richardwolny/sms-tools | lectures/05-Sinusoidal-model/plots-code/synthesis-window.py | 22 | 1725 | import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hamming, triang, blackmanharris
import sys, os, functools, time
from scipy.fftpack import fft, ifft, fftshift
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/'))
import dftModel as DFT
import ... | agpl-3.0 |
mwmuni/LIGGGHTS_GUI | OpenGL/raw/GL/NV/transform_feedback2.py | 9 | 1388 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-3.0 |
cyscodes/dtxt | bin/dtxt_settings.py | 1 | 1665 | # coding=utf-8
# Copyright (C) 2017 Daryl Caster, Tyler Murphy
#
# 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.
#
# Th... | gpl-3.0 |
ykaneko/neutron | neutron/plugins/nec/ofc_manager.py | 4 | 6286 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.or... | apache-2.0 |
cloudify-cosmo/cloudify-host-pool-service | scripts/create.py | 1 | 2218 | # #######
# Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | apache-2.0 |
wimnat/ansible | test/support/integration/plugins/modules/selogin.py | 85 | 7779 | #!/usr/bin/python
# (c) 2017, Petr Lautrbach <plautrba@redhat.com>
# Based on seport.py module (c) 2014, Dan Keder <dan.keder@gmail.com>
# 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 ... | gpl-3.0 |
vijaylbais/boto | tests/unit/manage/test_ssh.py | 114 | 2004 | #!/usr/bin/env python
# Copyright (c) 2013 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 restriction, including
# without ... | mit |
jnewland/home-assistant | homeassistant/components/plex/media_player.py | 3 | 33432 | """Support to interface with the Plex API."""
from datetime import timedelta
import json
import logging
import requests
import voluptuous as vol
from homeassistant import util
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const i... | apache-2.0 |
webmaster128/botan | src/scripts/oids.py | 1 | 7815 | #!/usr/bin/python
"""
(C) 2016 Jack Lloyd
(C) 2017 Fabian Weissberg, Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
"""
import sys
import datetime
import re
from collections import defaultdict
def format_oid(oid):
#return '"' + oid + '"'
return "{" + oid.r... | bsd-2-clause |
nathanlnw/705_tw_ceritfy | tools/utils.py | 55 | 2507 | import sys
import os
def splitall(loc):
"""
Return a list of the path components in loc. (Used by relpath_).
The first item in the list will be either ``os.curdir``, ``os.pardir``, empty,
or the root directory of loc (for example, ``/`` or ``C:\\).
The other items in the list will be strings.
... | gpl-2.0 |
BackupTheBerlios/pixies-svn | pixies/reportlab/platypus/flowables.py | 1 | 24838 | #Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/platypus/flowables.py
__version__=''' $Id$ '''
__doc__="""
A flowable is a "floating element" in a document whose exact position is determined by the
o... | gpl-2.0 |
bchareyre/trial | py/tests/engines.py | 5 | 3952 | 'test functionality of individual engines'
import unittest
import random
from yade.wrapper import *
from yade._customConverters import *
from yade import utils
from yade import *
from math import *
try:
from minieigen import *
except ImportError:
from miniEigen import *
class TestKinematicEngines(unittest.TestCase... | gpl-2.0 |
synasius/django | django/contrib/gis/feeds.py | 336 | 5978 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C ... | bsd-3-clause |
xbmc/atv2 | xbmc/lib/libPython/Python/Lib/test/test_uu.py | 17 | 4914 | """
Tests for uu module.
Nick Mathewson
"""
import unittest
from test import test_support
import sys, os, uu, cStringIO
import uu
from StringIO import StringIO
plaintext = "The smooth-scaled python crept over the sleeping dog\n"
encodedtext = """\
M5&AE('-M;V]T:\"US8V%L960@<'ET:&]N(&-R97!T(&]V97(@=&AE('-L965P
(:6YG... | gpl-2.0 |
xdevelsistemas/taiga-back-community | taiga/base/utils/dicts.py | 2 | 1249 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... | agpl-3.0 |
dwcarder/sdn-ix-demo | exabgp-3.4.3/lib/exabgp/bgp/message/update/attribute/clusterlist.py | 3 | 1286 | # encoding: utf-8
"""
clusterlist.py
Created by Thomas Mangin on 2012-07-07.
Copyright (c) 2009-2013 Exa Networks. All rights reserved.
"""
from exabgp.protocol.ip import IPv4
from exabgp.bgp.message.update.attribute.attribute import Attribute
# ===================================================================
c... | bsd-2-clause |
cedk/odoo | openerp/addons/base/module/wizard/base_update_translations.py | 447 | 2931 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
brokenjacobs/ansible | lib/ansible/plugins/lookup/password.py | 36 | 9261 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2013, Javier Candeira <javier@candeira.com>
# (c) 2013, Maykel Moya <mmoya@speedyrails.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... | gpl-3.0 |
wangyou/XX-Net | code/default/gae_proxy/local/proxy.py | 2 | 6968 | #!/usr/bin/env python2
# coding:utf-8
# Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com>
# Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com>
# Contributor:
# Phus Lu <phus.lu@gmail.com>
# Hewig Xu <hewigovens@gmail.com>
# Ayanamist Yang <ayanamist@gmail.com>... | bsd-2-clause |
Technaesthetic/ua-tools | node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | mit |
google/adcase | src/lib/adcase/formats/format_105-videobanner/build_105-videobanner.py | 1 | 1268 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 |
hcarvalhoalves/django-rest-thumbnails | restthumbnails/views.py | 1 | 1671 | from django import http
from django.core.cache import cache
from django.conf import settings
from django.views.decorators.cache import add_never_cache_headers
from django.views.generic import View
from restthumbnails import defaults
from restthumbnails.exceptions import ThumbnailError
from restthumbnails.helpers impor... | bsd-3-clause |
marnnie/Cable-buenaventura | plugin.video.genesis/modules/resolvers/zettahost.py | 2 | 1212 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 |
dfang/odoo | addons/im_livechat/__manifest__.py | 22 | 1300 | # -*- coding: utf-8 -*-
{
'name' : 'Website Live Chat',
'version': '1.0',
'sequence': 170,
'summary': 'Website Live Chat with Visitors/Customers',
'category': 'Website',
'complexity': 'easy',
'website': 'https://www.odoo.com/page/live-chat',
'description':
"""
Website Live Chat S... | agpl-3.0 |
chepeftw/EC2TestAutomator | legacyCollectors/statscollectorBC0.py | 1 | 2857 | #!/usr/bin/python
import argparse, yaml
from datetime import datetime
from pymongo import MongoClient
__author__ = 'chepe'
def main():
parser = argparse.ArgumentParser()
parser.add_argument("name", type=str, help="The number of nodes of the simulation")
parser.add_argument("nodes", type=int, help="The n... | gpl-3.0 |
jagg81/translate-toolkit | translate/convert/oo2xliff.py | 3 | 7347 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2003-2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | gpl-2.0 |
opennode/nodeconductor | waldur_core/__init__.py | 1 | 1508 | # The dancing with the function and its deletion is done
# to keep the namespace clean: only __version__ is going to be exposed.
from six import add_move, MovedModule
add_move(MovedModule('mock', 'mock', 'unittest.mock'))
def _get_version(package_name='waldur_core'):
import pkg_resources
# Based on http://... | mit |
dietrichc/streamline-ppc-reports | examples/adwords/v201406/basic_operations/remove_ad_group.py | 1 | 1868 | #!/usr/bin/python
#
# Copyright 2014 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 b... | apache-2.0 |
alogg/dolfin | test/unit/la/python/Vector.py | 3 | 10932 | """Unit tests for the Vector interface"""
# Copyright (C) 2011 Garth N. Wells
#
# This file is part of DOLFIN.
#
# DOLFIN is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License... | gpl-3.0 |
hajgato/easybuild-easyblocks | easybuild/easyblocks/c/cp2k.py | 1 | 30189 | ##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
pranavtendolkr/horizon | openstack_dashboard/dashboards/project/instances/workflows/update_instance.py | 39 | 5731 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | apache-2.0 |
RuiNascimento/krepo | program.plexus/resources/plexus/history.py | 27 | 1789 | # -*- coding: utf-8 -*-
""" Plexus (c) 2015 enen92
This file manages the history of recent played p2p addon items
Functions:
list_history() -> Function list addon history. It grabs the info from history.txt in the userdata
add_to_history(name,url,mode,iconimage) -> Add to addon history. It appe... | gpl-2.0 |
MCMic/Sick-Beard | lib/hachoir_parser/container/riff.py | 90 | 16966 | # -*- coding: UTF-8 -*-
"""
RIFF parser, able to parse:
* AVI video container
* WAV audio container
* CDA file
Documents:
- libavformat source code from ffmpeg library
http://ffmpeg.mplayerhq.hu/
- Video for Windows Programmer's Guide
http://www.opennet.ru/docs/formats/avi.txt
- What is an animated curso... | gpl-3.0 |
gtrensch/nest-simulator | pynest/examples/pulsepacket.py | 8 | 11262 | # -*- coding: utf-8 -*-
#
# pulsepacket.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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... | gpl-2.0 |
mrwangxc/zstack-utility | kvmagent/kvmagent/test/test_vr_create_iso.py | 5 | 1509 | '''
@author: Frank
'''
import unittest
import time
from kvmagent import kvmagent
from kvmagent.plugins import virtualrouter_plugin
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zstacklib.utils import log
from zstacklib.utils import uuidhelper
class Test(unittest.TestCase):
CALLBACK_... | apache-2.0 |
sysalexis/kbengine | kbe/res/scripts/common/Lib/turtledemo/tree.py | 85 | 1425 | #!/usr/bin/env python3
""" turtle-example-suite:
tdemo_tree.py
Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.
Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields No... | lgpl-3.0 |
karan1276/servo | tests/wpt/harness/wptrunner/tests/test_chunker.py | 59 | 2807 | # 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/.
import unittest
import sys
from os.path import join, dirname
from mozlog import structured
import pytest
sys.path.inse... | mpl-2.0 |
signed/intellij-community | python/helpers/py3only/docutils/languages/__init__.py | 170 | 1626 | # $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# Internationalization details are documented in
# <http://docutils.sf.net/docs/howto/i18n.html>.
"""
This package contains modules for language-dependent fe... | apache-2.0 |
bob-the-hamster/commandergenius | project/jni/python/src/Lib/htmllib.py | 312 | 12869 | """HTML 2.0 parser.
See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
from warnings import warnpy3k
warnpy3k("the htmllib module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
import sgmllib
from formatter import AS_IS
__all__ = ["HTMLPars... | lgpl-2.1 |
kampanita/pelisalacarta | python/main-classic/channels/tvvip.py | 1 | 41485 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para tvvip
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import os
import re
import sys
import unicodedata
import urllib
... | gpl-3.0 |
simzacks/jjb | tests/builder/test_builder.py | 6 | 1623 | # vim: set fileencoding=utf-8 :
#
# - Copyright 2014 Guido Günther <agx@sigxcpu.org>
#
# 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 |
tanjunyen/django-registration | registration/tests/models.py | 10 | 11905 | import datetime
import hashlib
import re
from django.utils import six
from django.conf import settings
from django.core import mail
from django.core import management
from django.test import TestCase
from registration.models import RegistrationProfile
from registration.users import UserModel
from registration.compat ... | bsd-3-clause |
WillianPaiva/1flow | oneflow/core/models/reldb/sync/node.py | 2 | 8068 | # -*- coding: utf-8 -*-
"""
Copyright 2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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 (... | agpl-3.0 |
shizhai/wprobe | build_dir/host/scons-2.1.0/engine/SCons/Platform/hpux.py | 21 | 1777 | """engine.SCons.Platform.hpux
Platform-specific initialization for HP-UX systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 200... | gpl-2.0 |
plotly/plotly.py | packages/python/plotly/_plotly_utils/importers.py | 2 | 1632 | import importlib
def relative_import(parent_name, rel_modules=(), rel_classes=()):
"""
Helper function to import submodules lazily in Python 3.7+
Parameters
----------
rel_modules: list of str
list of submodules to import, of the form .submodule
rel_classes: list of str
list o... | mit |
dash-dash/AutobahnPython | autobahn/websocket/__init__.py | 68 | 1276 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
hajuuk/R7000 | ap/gpl/timemachine/libxml2-2.7.2/python/tests/xpathext.py | 87 | 1118 | #!/usr/bin/python -u
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
def foo(ctx, x):
return x + 1
def bar(ctx, x):
return "%d" % (x + 2)
doc = libxml2.parseFile("tst.xml")
ctxt = doc.xpathNewContext()
res = ctxt.xpathEval("//*")
if len(res) != 2:
print "xpath query: wrong node ... | gpl-2.0 |
DataDog/integrations-core | php_fpm/setup.py | 1 | 1961 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... | bsd-3-clause |
kaji-project/shinken-mod-graphite | test/test_mod_graphite.py | 1 | 5187 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2010:
# Sébastien Coavoux, sebastien.coavoux@savoirfairelinux.com
# Philippe Pepos Petitclerc, philippe.pepos-petitclerc@savoirfairelinux.com
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it und... | agpl-3.0 |
imarqs/ardupilot | Tools/scripts/magfit_flashlog.py | 278 | 4744 | #!/usr/bin/env python
''' fit best estimate of magnetometer offsets from ArduCopter flashlog
using the algorithm from Bill Premerlani
'''
import sys, time, os, math
# command line option handling
from optparse import OptionParser
parser = OptionParser("magfit_flashlog.py [options]")
parser.add_option("--verbose", ac... | gpl-3.0 |
ianyh/heroku-buildpack-python-opencv | vendor/.heroku/lib/python2.7/ctypes/test/test_returnfuncptrs.py | 80 | 2773 | import unittest
from ctypes import *
import os
import _ctypes_test
class ReturnFuncPtrTestCase(unittest.TestCase):
def test_with_prototype(self):
# The _ctypes_test shared lib/dll exports quite some functions for testing.
# The get_strchr function returns a *pointer* to the C strchr function.
... | mit |
yannickcr/CouchPotatoServer | libs/suds/mx/literal.py | 178 | 9517 | # 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 ... | gpl-3.0 |
toshywoshy/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ipsec_phase2_interface.py | 7 | 29041 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
wrohdewald/Gpxity | setup.py | 1 | 2034 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""see https://setuptools.readthedocs.io/en/latest/setuptools.html."""
from setuptools import setup, find_packages
COPYRIGHT = """
Copyright (c) 2019 Wolfgang Rohdewald <wolfgang@rohdewald.de>
See LICENSE for details.
"""
def readall(path):
"""explicitly close the... | gpl-2.0 |
blaggacao/OpenUpgrade | addons/mrp/mrp.py | 22 | 72573 | # -*- 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 |
afrolov1/nova | nova/api/openstack/compute/server_metadata.py | 5 | 7171 | # Copyright 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 requ... | apache-2.0 |
Gravecorp/Gap | packages/IronPython.StdLib.2.7.3/content/Lib/distutils/command/install_data.py | 251 | 2845 | """distutils.command.install_data
Implements the Distutils 'install_data' command, for installing
platform-independent data files."""
# contributed by Bastian Kleineidam
__revision__ = "$Id$"
import os
from distutils.core import Command
from distutils.util import change_root, convert_path
class install_data(Comman... | mpl-2.0 |
mpetyx/palmdrop | venv/lib/python2.7/site-packages/cms/models/metaclasses.py | 7 | 1045 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.db.models.base import ModelBase
from cms.publisher.manager import PublisherManager
from mptt.models import MPTTModelBase
from cms.publisher.options import PublisherOptions
class PageMetaClass(MPTTModelBase):
def __new__(cls, name, bases, attrs):... | apache-2.0 |
CountZer0/PipelineConstructionSet | python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/_OpenMayaFX.py | 3 | 26833 | def MnRigid_getNumVertices(*args, **kwargs):
pass
def delete_MFnFluid(*args, **kwargs):
pass
def MnRigid_swigregister(*args, **kwargs):
pass
def MnParticle_getThickness(*args, **kwargs):
pass
def MFnFluid_getCoordinates(*args, **kwargs):
pass
def MDynSweptTriangle_area(*args, **kwargs):
... | bsd-3-clause |
kntem/webdeposit | modules/webstyle/lib/goto_plugins/goto_plugin_simple.py | 26 | 1159 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
HighwindONE/android_kernel_motorola_msm8226 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
rlugojr/rekall | rekall-core/rekall/plugins/linux/psxview.py | 3 | 2446 | # Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
# Copyright 2014 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | gpl-2.0 |
kastnerkyle/kaggle-wise2014 | basic_clf.py | 1 | 1692 | """Competition script for Wise2014."""
import numpy as np
from sklearn.datasets import load_svmlight_file
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import LinearSVC
from sklearn.cross_validation import cross_val_score, KFold
print("Loading... | bsd-3-clause |
plotly/plotly.py | packages/python/plotly/plotly/validators/scattergeo/marker/colorbar/_title.py | 2 | 1256 | import _plotly_utils.basevalidators
class TitleValidator(_plotly_utils.basevalidators.TitleValidator):
def __init__(
self, plotly_name="title", parent_name="scattergeo.marker.colorbar", **kwargs
):
super(TitleValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | mit |
awacha/saxsfittool | src/saxsfittool/fitfunction/coreshell/coreshell.py | 1 | 3207 | import numpy as np
from matplotlib.axes import Axes
from matplotlib.patches import Ellipse
from .c_coreshell import F2GaussianCoreShellSphereDistribution
from ..core import FitFunction
class CoreShellSphereGaussianDistribution(FitFunction):
name = "Spherical core-shell particles, Gaussian size distribution"
... | bsd-3-clause |
markfinger/recipe-crawler-for-beaney | requests/packages/urllib3/response.py | 197 | 18103 | from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
from socket import timeout as SocketTimeout
from socket import error as SocketError
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
... | mit |
rbalda/neural_ocr | env/lib/python2.7/site-packages/numpy/testing/tests/test_utils.py | 18 | 27128 | from __future__ import division, absolute_import, print_function
import warnings
import sys
import numpy as np
from numpy.testing import (
assert_equal, assert_array_equal, assert_almost_equal,
assert_array_almost_equal, build_err_msg, raises, assert_raises,
assert_warns, assert_no_warnings, assert_allclo... | mit |
llhe/tensorflow | tensorflow/python/kernel_tests/cwise_ops_test.py | 5 | 78869 | # 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 |
baroquebobcat/pants | tests/python/pants_test/backend/jvm/tasks/jvm_compile/scala/test_scalac_plugin_integration.py | 6 | 3001 | # coding=utf-8
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.back... | apache-2.0 |
SomethingExplosive/android_external_chromium_org | tools/json_schema_compiler/cpp_util_test.py | 72 | 1278 | #!/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.
import cpp_util
import unittest
class CppUtilTest(unittest.TestCase):
def testClassname(self):
self.assertEquals('Permission... | bsd-3-clause |
resba/gnuradio | gnuradio-core/src/python/gnuradio/gr/qa_copy.py | 11 | 1864 | #!/usr/bin/env python
#
# Copyright 2009,2010 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 opt... | gpl-3.0 |
puavo-org/puavo-os | debs/linux/debian/lib/python/debian_linux/gencontrol.py | 1 | 13361 | import codecs
from collections import OrderedDict
from .debian import *
class PackagesList(OrderedDict):
def append(self, package):
self[package['Package']] = package
def extend(self, packages):
for package in packages:
self[package['Package']] = package
class Makefile(object):... | gpl-2.0 |
thtrieu/essence | src/modules/shaping.py | 1 | 3826 | from .module import Module
from src.utils import nxshape
import numpy as np
class concat(Module):
def __init__(self, server, *args):
args = list(args)
axis = args[-1]
shapes = args[:-1]
new_size = sum(x[axis] for x in shapes)
shapes = [list(shp) for shp in shapes]
fo... | gpl-3.0 |
akash1808/nova_test_latest | nova/api/openstack/compute/servers.py | 8 | 48987 | # Copyright 2010 OpenStack Foundation
# Copyright 2011 Piston Cloud Computing, 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.apach... | apache-2.0 |
bhermansyah/DRR-datacenter | geonode/upload/forms.py | 24 | 7124 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
AngryBork/apex-sigma-plugins | minigames/professions/forage.py | 3 | 2959 | import discord
from sigma.core.utilities.data_processing import user_avatar
from .nodes.item_core import ItemCore
item_core = None
async def forage(cmd, message, args):
global item_core
if not item_core:
item_core = ItemCore(cmd.resource('data'))
if not cmd.bot.cool_down.on_cooldown(cmd.name, m... | gpl-3.0 |
themiken/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/cxxflags/gyptest-cxxflags.py | 142 | 1551 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the g... | gpl-3.0 |
dstandish/luigi | luigi/contrib/pyspark_runner.py | 4 | 1722 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
quidsup/notrack | src/blockparser.py | 1 | 28401 | #!/usr/bin/env python3
#Title : NoTrack
#Description : This script will download latest block lists from various sources, then parse them into Dnsmasq
#Author : QuidsUp
#Date : 2015-01-14
#Version : 20.12
#Usage : sudo python notrack.py
#Standard imports
import os
import shutil
import sys
i... | gpl-3.0 |
SeattleTestbed/repy_v2 | encoding_header.py | 1 | 1183 | """
<Program Name>
encoding_header.py
<Purpose>
This mini module provides the ENCODING_DECLARATION constant, a string that is
prepended to code loaded into VirtualNamespace objects. This is prepended to
such code in order to specify UTF-8 encoding and prevent certain bugs.
Because prepending it to code resu... | mit |
lxe/npm | node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | artistic-2.0 |
girving/meld | vc/darcs.py | 2 | 4499 | # -*- coding: utf-8 -*-
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
#Copyright (c) 2005 Ali Afshar <aafshar@gmail.com>
#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 res... | gpl-2.0 |
HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/ThirdParty/mpi4py/vtkmpi4py/src/rc.py | 20 | 2931 | # Author: Lisandro Dalcin
# Contact: dalcinl@gmail.com
"""
Runtime configuration parameters
"""
initialize = True
"""
Automatic MPI initialization at import time
* Any of ``{True | 1 | "yes" }``: initialize MPI at import time
* Any of ``{False | 0 | "no" }``: do not initialize MPI at import time
"""
threaded = T... | gpl-3.0 |
mujiansu/arangodb | 3rdParty/V8-4.3.61/tools/ninja/ninja_output.py | 58 | 1391 | # Copyright 2015 the V8 project 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 os
import os.path
def GetNinjaOutputDirectory(v8_root, configuration=None):
"""Returns <v8_root>/<output_dir>/(Release|Debug).
The configura... | apache-2.0 |
Belxjander/Kirito | Python-3.5.0-Amiga/Lib/asyncio/base_events.py | 3 | 47231 | """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... | gpl-3.0 |
bdoner/SickRage | sickbeard/clients/deluged_client.py | 14 | 7134 | # Author: Paul Wollaston
# Contributions: Luke Mullan
#
# This client script allows connection to Deluge Daemon directly, completely
# circumventing the requirement to use the WebUI.
from base64 import b64encode
import sickbeard
from sickbeard import logger
from .generic import GenericClient
from synchronousdeluge im... | gpl-3.0 |
infinit/grpc | tools/run_tests/run_tests.py | 1 | 54315 | #!/usr/bin/env python
# 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 o... | bsd-3-clause |
fgesora/odoo | openerp/conf/__init__.py | 442 | 1974 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
euro2/euro2 | contrib/bitrpc/bitrpc.py | 2348 | 7835 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:8332")
else:
access = Ser... | mit |
zchq88/DLminiProject | sentiment_network/Sentiment Classification.py | 1 | 10594 | # 定义如何显示评论
def pretty_print_review_and_label(i):
print(labels[i] + "\t:\t" + reviews[i][:80] + "...")
# What we know!获取评论数据
g = open('reviews.txt', 'r')
reviews = list(map(lambda x: x[:-1], g.readlines()))
g.close()
# What we WANT to know!获取评价数据
g = open('labels.txt', 'r')
labels = list(map(lambda x: x[:-1].upper... | mit |
jellysheep/pyload | module/gui/PackageDock.py | 41 | 3198 | # -*- coding: utf-8 -*-
"""
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 ... | gpl-3.0 |
zahodi/ansible | lib/ansible/modules/network/nxos/nxos_nxapi.py | 20 | 11050 | #!/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 |
serensoner/CouchPotatoServer | libs/suds/transport/https.py | 202 | 3634 | # 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 ... | gpl-3.0 |
anryko/ansible | lib/ansible/modules/network/avi/avi_pool.py | 19 | 23242 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
2013Commons/HUE-SHARK | desktop/core/ext-py/Django-1.2.3/django/contrib/comments/feeds.py | 310 | 1439 | from django.conf import settings
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(sel... | apache-2.0 |
SnakeJenny/TensorFlow | tensorflow/contrib/opt/python/training/variable_clipping_optimizer.py | 133 | 5903 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.