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 |
|---|---|---|---|---|---|
YangChihWei/2015cdb_g1_0623 | static/Brython3.1.1-20150328-091302/Lib/tokenize.py | 728 | 24424 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... | gpl-3.0 |
dharmabumstead/ansible | lib/ansible/modules/cloud/amazon/aws_direct_connect_gateway.py | 59 | 13580 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
PeterWangIntel/chromium-crosswalk | testing/scripts/telemetry_unittests.py | 25 | 1385 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import sys
import common
def main_run(args):
filter_tests = []
if args.filter_file:
filter_tests = js... | bsd-3-clause |
robhudson/warehouse | tests/legacy/test_xmlrpc.py | 1 | 2891 | # Copyright 2013 Donald Stufft
#
# 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 |
alex-dorokhov/libgdx | extensions/gdx-freetype/jni/freetype-2.9.1/src/tools/docmaker/docbeauty.py | 31 | 2643 | #!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import sys, os, string, getopt
content_processor = ... | apache-2.0 |
Tivix/wagtail | wagtail/wagtailcore/blocks/stream_block.py | 4 | 12662 | from __future__ import absolute_import, unicode_literals
import collections
from django import forms
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from django.template.loader import render_to_string
from django.utils.encoding import python_2_unicode_compatible, force_text... | bsd-3-clause |
JacobBarthelmeh/wolfssl | wrapper/python/wolfcrypt/wolfcrypt/build_ffi.py | 3 | 3533 | # build_ffi.py
#
# Copyright (C) 2006-2021 wolfSSL Inc.
#
# This file is part of wolfSSL.
#
# wolfSSL 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 ... | gpl-2.0 |
sysadmind/ansible-modules-extras | cloud/cloudstack/cs_volume.py | 4 | 15099 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Jefferson Girão <jefferson@girao.net>
# (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... | gpl-3.0 |
cachedout/AutobahnPython | examples/websocket/echo/client.py | 8 | 1683 | ###############################################################################
##
## Copyright 2011,2012 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## ... | apache-2.0 |
SyntaxVoid/PyFusionGUI | pyfusion/acquisition/DIIID/fetch.py | 1 | 6044 | """Subclass of MDSplus data fetcher to grab additional H1-specific metadata."""
import pyfusion, os
from pyfusion.acquisition.MDSPlus.fetch import MDSPlusDataFetcher, get_tree_path
import pyfusion.acquisition.MDSPlus.h1ds as mdsweb
from pyfusion.acquisition.base import MultiChannelFetcher
from pyfusion.data.timeseries ... | gpl-3.0 |
yangw1234/BigDL | pyspark/bigdl/models/utils/model_broadcast.py | 5 | 2407 | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | apache-2.0 |
clickbaron/userinfuser | serverside/logs.py | 12 | 2949 | # Copyright (C) 2011, CloudCaptive
#
# 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 i... | gpl-3.0 |
haad/ansible | test/units/module_utils/basic/test_heuristic_log_sanitize.py | 53 | 3735 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | gpl-3.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_opcodes.py | 133 | 3109 | # Python test set -- part 2, opcodes
from test.test_support import run_unittest, check_py3k_warnings
import unittest
class OpcodeTest(unittest.TestCase):
def test_try_inside_for_loop(self):
n = 0
for i in range(10):
n = n+i
try: 1 // 0
except NameError: pass
... | gpl-2.0 |
brev/nupic | tests/swarming/nupic/swarming/experiments/spatial_classification/description.py | 32 | 15435 | # ----------------------------------------------------------------------
# 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 |
automl/HPOlib | tests/testsuite.py | 2 | 2164 | import unittest
import unittests.test_benchmark_util as test_benchmark_util
import unittests.test_configuration_space as test_configuration_space
import unittests.test_optimization_interceptor as test_optimization_interceptor
import unittests.test_data_utils as test_data_utils
import unittests.test_dispatcher as test_... | gpl-3.0 |
emetsger/osf.io | scripts/tests/test_googledrive_connect_external_accounts.py | 30 | 2194 | from nose.tools import *
from scripts.googledrive.connect_external_accounts import do_migration
from framework.auth import Auth
from tests.base import OsfTestCase
from tests.factories import ProjectFactory, UserFactory
from website.addons.googledrive.model import GoogleDriveUserSettings
from website.addons.googledr... | apache-2.0 |
abarnert/pyinterval | test/test_basic.py | 1 | 13302 | # Copyright (c) 2008, Stefano Taschini <taschini@ieee.org>
# All rights reserved.
# See LICENSE for details.
import unittest
from interval import interval, fpu
class FpuTestCase(unittest.TestCase):
def test_third(self):
"Nearest rounding of 1/3 is downwards."
self.assertEqual(1/3.0, fpu.down(lam... | bsd-3-clause |
jkonecny12/anaconda | pyanaconda/modules/storage/partitioning/base.py | 3 | 7727 | #
# The module for partitioning.
#
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distrib... | gpl-2.0 |
agry/NGECore2 | scripts/mobiles/naboo/ikopi_stag.py | 2 | 1618 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | lgpl-3.0 |
Fantu/Cinnamon | files/usr/share/cinnamon/cinnamon-slideshow/cinnamon-slideshow.py | 3 | 13599 | #!/usr/bin/python3
from gi.repository import Gio, GLib
import dbus, dbus.service, dbus.glib
from dbus.mainloop.glib import DBusGMainLoop
import random
import os, locale
from xml.etree import ElementTree
from setproctitle import setproctitle
SLIDESHOW_DBUS_NAME = "org.Cinnamon.Slideshow"
SLIDESHOW_DBUS_PATH = "/org/Ci... | gpl-2.0 |
ioana-delaney/spark | python/pyspark/ml/param/shared.py | 4 | 25151 | #
# 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 |
badloop/SickRage | lib/sqlalchemy/testing/util.py | 79 | 5319 | # testing/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 ..util import jython, pypy, defaultdict, decorator, py2k
import decimal
import gc... | gpl-3.0 |
switowski/invenio | invenio/utils/xmlhelpers.py | 18 | 1097 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014 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) any later... | gpl-2.0 |
Alzon/SUR | magnum/common/pythonk8sclient/client/models/V1beta3_FinalizerName.py | 15 | 1172 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, 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 require... | apache-2.0 |
Glignos/inspire-next | tests/integration/test_theme_views.py | 6 | 3872 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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-3.0 |
daoluan/decode-Django | Django-1.5.1/tests/regressiontests/generic_relations_regress/tests.py | 89 | 2975 | from django.db.models import Q
from django.test import TestCase
from .models import (Address, Place, Restaurant, Link, CharLink, TextLink,
Person, Contact, Note, Organization, OddRelation1, OddRelation2)
class GenericRelationTests(TestCase):
def test_inherited_models_content_type(self):
"""
... | gpl-2.0 |
tillahoffmann/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/invert_test.py | 141 | 3581 | # 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 |
vsajip/babel3 | scripts/dump_data.py | 55 | 1500 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# ... | bsd-3-clause |
michaelkirk/QGIS | python/ext-libs/jinja2/optimizer.py | 1401 | 2302 | # -*- coding: utf-8 -*-
"""
jinja2.optimizer
~~~~~~~~~~~~~~~~
The jinja optimizer is currently trying to constant fold a few expressions
and modify the AST in place so that it should be easier to evaluate it.
Because the AST does not contain all the scoping information and the
compiler has to ... | gpl-2.0 |
mtekel/digitalmarketplace-buyer-frontend | tests/app/views/test_errors.py | 1 | 1478 | # coding=utf-8
import mock
from nose.tools import assert_equal, assert_true
from requests import ConnectionError
from ...helpers import BaseApplicationTest
@mock.patch('app.main.views.search_api_client')
class TestErrors(BaseApplicationTest):
def test_404(self, search_api_mock):
res = self.client.get('/g... | mit |
leongold/lago | lago/dirlock.py | 4 | 3377 | # Copyright 2014 Red Hat, 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 program is distributed in the ... | gpl-2.0 |
mateon1/servo | tests/wpt/web-platform-tests/tools/pytest/testing/python/raises.py | 171 | 2572 | import pytest
class TestRaises:
def test_raises(self):
source = "int('qwe')"
excinfo = pytest.raises(ValueError, source)
code = excinfo.traceback[-1].frame.code
s = str(code.fullsource)
assert s == source
def test_raises_exec(self):
pytest.raises(ValueError, "a,... | mpl-2.0 |
losnikitos/googleads-python-lib | examples/dfp/v201505/placement_service/update_placements.py | 4 | 2221 | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
nikolas/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/utils/datastructures.py | 46 | 9725 | """
Tests for stuff in django.utils.datastructures.
"""
import pickle
import unittest
from django.utils.copycompat import copy
from django.utils.datastructures import *
class DatastructuresTestCase(unittest.TestCase):
def assertRaisesErrorWithMessage(self, error, message, callable,
*args, **kwargs):
... | gpl-3.0 |
City-busz/Cinnamon | files/usr/share/cinnamon/cinnamon-settings/modules/cs_notifications.py | 3 | 3412 | #!/usr/bin/env python2
import gi
gi.require_version('Notify', '0.7')
from gi.repository import GObject, Notify
from GSettingsWidgets import *
content = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit. \
Suspendisse eleifend, lacus ut tempor vehicula, lorem tortor \
suscipit libero, sit amet congue odio l... | gpl-2.0 |
sudosurootdev/external_chromium_org | tools/telemetry/telemetry/core/browser_info.py | 55 | 1147 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
_check_webgl_supported_script = """
(function () {
var c = document.createElement('canvas');
var gl = c.getContext('webgl');
if (gl == null) {
gl =... | bsd-3-clause |
gioman/QGIS | python/plugins/processing/algs/qgis/DensifyGeometries.py | 1 | 3583 | # -*- coding: utf-8 -*-
"""
***************************************************************************
DensifyGeometries.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | gpl-2.0 |
PiwwowPants/Blocked-Out | build/c4che/basalt_cache.py | 1 | 1942 | AR = 'arm-none-eabi-ar'
ARFLAGS = 'rcs'
AS = 'arm-none-eabi-gcc'
BINDIR = '/usr/local/bin'
BUILD_DIR = 'basalt'
CC = ['arm-none-eabi-gcc']
CCLNK_SRC_F = []
CCLNK_TGT_F = ['-o']
CC_NAME = 'gcc'
CC_SRC_F = []
CC_TGT_F = ['-c', '-o']
CC_VERSION = ('4', '7', '2')
CFLAGS = ['-std=c99', '-mcpu=cortex-m3', '-mthumb', '-ffunct... | gpl-2.0 |
Partoo/scrapy | tests/test_closespider.py | 15 | 2474 | from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.utils.test import get_crawler
from tests.spiders import FollowAllSpider, ItemSpider, ErrorSpider
from tests.mockserver import MockServer
class TestCloseSpider(TestCase):
def setUp(self):
self.mockserver = MockServe... | bsd-3-clause |
FNST-OpenStack/horizon | openstack_dashboard/dashboards/settings/password/forms.py | 63 | 3043 | # Copyright 2013 Centrin Data Systems 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... | apache-2.0 |
kernelci/kernelci-backend | app/utils/batch/tests/test_batch_common.py | 1 | 5474 | # Copyright (C) Collabora Limited 2018
# Author: Guillaume Tucker <guillaume.tucker@collabora.com>
# Author: Ana Guerrero Lopez <ana.guerrero@collabora.com>
#
# Copyright (C) Linaro Limited 2014,2015
# Author: Milo Casagrande <milo.casagrande@linaro.org>
#
# This program is free software; you can redistribute it and/or... | lgpl-2.1 |
vidartf/hyperspy | hyperspy/model.py | 1 | 70365 | # -*- coding: utf-8 -*-
# Copyright 2007-2016 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
thaumos/ansible | lib/ansible/plugins/doc_fragments/utm.py | 43 | 1586 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
headers:
description:
- A dictiona... | gpl-3.0 |
amjad-twalo/icsisumm | tac09/preprocess/prob_util.py | 17 | 10294 | from __future__ import division
import math, random
LOGPROBMIN = -9999.9
class Counter(dict):
def __getitem__(self, entry):
try:
return dict.__getitem__(self, entry)
except KeyError:
return 0.0
def copy(self):
return Counter(dict.copy(self))
def makeProbDist(self... | gpl-3.0 |
mblayman/httpie | httpie/output/processing.py | 54 | 1454 | import re
from httpie.plugins import plugin_manager
from httpie.context import Environment
MIME_RE = re.compile(r'^[^/]+/[^/]+$')
def is_valid_mime(mime):
return mime and MIME_RE.match(mime)
class Conversion(object):
def get_converter(self, mime):
if is_valid_mime(mime):
for converte... | bsd-3-clause |
pravsalam/clamav-antivirus | libclamav/c++/llvm/utils/lit/lit/TestingConfig.py | 17 | 4224 | import os
class TestingConfig:
""""
TestingConfig - Information on the tests inside a suite.
"""
@staticmethod
def frompath(path, parent, litConfig, mustExist, config = None):
if config is None:
# Set the environment based on the command line arguments.
environment ... | gpl-2.0 |
fulfilio/etsy-python | etsy/oauth.py | 1 | 2302 | import oauth2 as oauth
import urllib.request
import urllib.parse
import urllib.error
from cgi import parse_qsl
from .etsy_env import EtsyEnvProduction
EtsyOAuthToken = oauth.Token
class EtsyOAuthClient(oauth.Client):
def __init__(self, oauth_consumer_key,
oauth_consumer_secret, etsy_env=EtsyEnv... | gpl-3.0 |
firmlyjin/brython | www/tests/unittests/test/test_pdb.py | 29 | 22308 | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import imp
import pdb
import sys
import unittest
import subprocess
import textwrap
from test import support
# This little helper class is essential for testing pdb under doctest.
from test.test_doctest import _FakeInput
class PdbTestInput(... | bsd-3-clause |
mikebenfield/scikit-learn | sklearn/tests/test_metaestimators.py | 52 | 4990 | """Common tests for metaestimators"""
import functools
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.externals.six import iterkeys
from sklearn.datasets import make_classification
from sklearn.utils.testing import assert_true, assert_false, assert_raises
from sklearn.pipeline import Pipeline... | bsd-3-clause |
mmclenna/engine | tools/android/download_android_tools.py | 16 | 3232 | #!/usr/bin/python
# 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.
"""
Downloads trimmed-down Android Tools from Google Cloud Storage and extracts
them to INSTALL_DIR, updating INSTALL_DIR/VERSION_* stamp f... | bsd-3-clause |
chushao/Gradesource-Uploader | requests/packages/charade/euctwprober.py | 231 | 1717 | ######################## 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.
... | mit |
mountain213/neo4jworkshop | REST_clients/Python_client/neo4jrestclient/query.py | 1 | 35708 | # -*- coding: utf-8 -*-
# Inspired by: https://github.com/CulturePlex/Sylva
# /tree/master/sylva/engines/gdb/lookups
import json
import uuid
from collections import Sequence
import warnings
from neo4jrestclient.constants import RAW
from neo4jrestclient.request import Request
from neo4jrestclient.ex... | mit |
uclouvain/OSIS-Louvain | base/models/exam_enrollment.py | 1 | 19884 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
yushu9/kosmosfs | src/python/rmr/rmr.py | 11 | 1287 | #
# $Id$
#
# Copyright 2006 Kosmix Corp.
#
# Author: Blake Lewis (Kosmix Corp.)
#
# This file is part of Kosmos File System (KFS).
#
# 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://w... | apache-2.0 |
itsjeyd/edx-platform | cms/djangoapps/contentstore/management/commands/create_course.py | 163 | 2188 | """
Django management command to create a course in a specific modulestore
"""
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from xmodule.modulestore import ModuleStoreEnum
from contentstore.views.course import create_new_course_in_store
from contentstore.... | agpl-3.0 |
mali/kdevelop | languages/qmljs/nodejsmodules/net.py | 2 | 3248 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# This file is part of qmljs, the QML/JS language support plugin for KDevelop
# Copyright (c) 2014 Denis Steckelmacher <steckdenis@yahoo.fr>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# pub... | gpl-2.0 |
tonyli71/os-testr | setup.py | 2 | 1050 | #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
ant9000/yowsup | yowsup/layers/protocol_receipts/protocolentities/receipt_incoming.py | 43 | 4570 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .receipt import ReceiptProtocolEntity
from yowsup.layers.protocol_acks.protocolentities import OutgoingAckProtocolEntity
class IncomingReceiptProtocolEntity(ReceiptProtocolEntity):
'''
delivered:
<receipt to="xxxxxxxxxxx@s.whatsapp.net" id=... | gpl-3.0 |
technologiescollege/Blockly-rduino-communication | scripts_XP/Lib/site-packages/prompt_toolkit/key_binding/bindings/vi.py | 7 | 67809 | # pylint: disable=function-redefined
from __future__ import unicode_literals
from prompt_toolkit.buffer import ClipboardData, indent, unindent, reshape_text
from prompt_toolkit.document import Document
from prompt_toolkit.enums import IncrementalSearchDirection, SEARCH_BUFFER, SYSTEM_BUFFER
from prompt_toolkit.filters ... | gpl-3.0 |
binoculars/osf.io | addons/gitlab/serializer.py | 7 | 1757 | from addons.base.serializer import StorageAddonSerializer
from addons.gitlab.api import GitLabClient
from addons.gitlab.exceptions import GitLabError
from website.util import api_url_for
class GitLabSerializer(StorageAddonSerializer):
addon_short_name = 'gitlab'
# Include host information with more informati... | apache-2.0 |
mnahm5/django-estore | Lib/site-packages/click/termui.py | 202 | 21008 | import os
import sys
import struct
from ._compat import raw_input, text_type, string_types, \
isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN
from .utils import echo
from .exceptions import Abort, UsageError
from .types import convert_type
from .globals import resolve_color_default
# The prompt funct... | mit |
ii0/pybrain | pybrain/supervised/trainers/evolino.py | 25 | 6392 | from __future__ import print_function
__author__ = 'Michael Isik'
from numpy import Infinity
from pybrain.supervised.trainers.trainer import Trainer
from pybrain.supervised.evolino.population import EvolinoPopulation
from pybrain.supervised.evolino.individual import EvolinoSubIndividual
from pybrain.supervised.evoli... | bsd-3-clause |
AuyaJackie/odoo | addons/l10n_pt/__openerp__.py | 380 | 1834 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Thinkopen Solutions, Lda. All Rights Reserved
# http://www.thinkopensolutions.com.
# $Id$
#
# This program is free software: you can red... | agpl-3.0 |
kutenai/django | tests/forms_tests/widget_tests/test_clearablefileinput.py | 8 | 5038 | from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import ClearableFileInput
from django.utils.encoding import python_2_unicode_compatible
from .base import WidgetTest
@python_2_unicode_compatible
class FakeFieldFile(object):
"""
Quacks like a FieldFile (has a .url and unicode re... | bsd-3-clause |
Kenneth-Posey/kens-old-projects | smokin-goldshop/handler/customerhandler.py | 1 | 9909 |
import os, urllib, logging, datetime
from google.appengine.api import memcache, users
from google.appengine.ext import db, webapp
from google.appengine.ext.webapp.template import render
from google.appengine.ext.webapp.util import run_wsgi_app
from models.ipinfo import IpInfo
from models.order import Order
from m... | gpl-2.0 |
airypi/airypi-rpi | airypi_rpi/auth.py | 1 | 7695 | import requests, pickle, os, getpass, json, sys
from requests.adapters import HTTPAdapter
from cookielib import domain_match, user_domain_match
import client
from socketio_client import SocketIO
import time
from urlparse import urlparse
domain_name = 'www.airypi.com'
#domain_name = '192.168.2.105'
server_url = 'htt... | gpl-3.0 |
bayandin/selenium | py/test/selenium/webdriver/common/results_page.py | 36 | 1408 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
simonwydooghe/ansible | test/units/modules/network/fortios/test_fortios_firewall_vip.py | 21 | 34781 | # 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 |
PongPi/isl-odoo | addons/account/res_currency.py | 340 | 2267 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010 OpenERP s.a. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# p... | agpl-3.0 |
bgxavier/nova | nova/scheduler/chance.py | 27 | 2709 | # Copyright (c) 2010 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | apache-2.0 |
dandan94/OpenGLTest | finalOpenGL/HelloGLFW/lib/boost_1_59_0/libs/python/test/pickle4.py | 46 | 1150 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
r'''>>> import pickle4_ext
>>> import pickle
>>> def world_getinitargs(self):
... return (self.get_country(),)
>>> pic... | gpl-3.0 |
Dm47021/android_kernel_afyonlte | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
timeyyy/python-client | test/test_client_rpc.py | 2 | 2265 | # -*- coding: utf-8 -*-
from nose.tools import with_setup, eq_ as eq
from test_common import vim, cleanup
cid = vim.channel_id
@with_setup(setup=cleanup)
def test_call_and_reply():
def setup_cb():
cmd = 'let g:result = rpcrequest(%d, "client-call", 1, 2, 3)' % cid
vim.command(cmd)
eq(vim.... | apache-2.0 |
tfroehlich82/EventGhost | lib27/site-packages/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | gpl-2.0 |
DarioGT/OMS-PluginXML | org.modelsphere.sms/lib/jython-2.2.1/Lib/xml/Uri.py | 1 | 16782 | # pylint: disable-msg=C0103
#
# backported code from 4Suite with slight modifications, started from r1.89 of
# Ft/Lib/Uri.py, by syt@logilab.fr on 2005-02-09
#
# part if not all of this code should probably move to urlparse (or be used
# to fix some existant functions in this module)
#
#
# Copyright 2004 Fourt... | gpl-3.0 |
strets123/pyms | Peak/List/DPA/Class.py | 7 | 25343 | """
Classes for peak alignment by dynamic programming
"""
#############################################################################
# #
# PyMS software for processing of metabolomic mass-spectrometry data #
# Copyright (C) 2005... | gpl-2.0 |
jimkmc/micropython | tests/bytecode/pylib-tests/sunau.py | 22 | 16832 | """Stuff to parse Sun and NeXT audio files.
An audio file consists of a header followed by the data. The structure
of the header is as follows.
+---------------+
| magic word |
+---------------+
| header size |
+---------------+
| data size |
+--------... | mit |
martinbarnard/beebRecipeParser | models/db.py | 1 | 4234 | # -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... | gpl-3.0 |
WarrenWeckesser/scipy | scipy/sparse/_matrix_io.py | 17 | 5333 | import numpy as np
import scipy.sparse
__all__ = ['save_npz', 'load_npz']
# Make loading safe vs. malicious input
PICKLE_KWARGS = dict(allow_pickle=False)
def save_npz(file, matrix, compressed=True):
""" Save a sparse matrix to a file using ``.npz`` format.
Parameters
----------
file : str or file... | bsd-3-clause |
Jandersoft/jander777-ghost | node_modules/testem/node_modules/tap/node_modules/yamlish/yamlish-py/setup.py | 160 | 1406 | # coding: utf-8
from setuptools import setup
requires_list = [
"PyYAML>=3.09"
]
import os.path
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as inf:
return "\n" + inf.read().replace("\r\n", "\n")
setup(
name='yamlish',
version="0.17.0",
description='Python imp... | mit |
junhuac/MQUIC | src/tools/gyp/pylib/gyp/mac_tool.py | 1 | 26826 | #!/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.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
c86j224s/snippet | Python_Pygments/lib/python3.6/site-packages/pygments/styles/native.py | 31 | 1938 | # -*- coding: utf-8 -*-
"""
pygments.styles.native
~~~~~~~~~~~~~~~~~~~~~~
pygments version of my "native" vim theme.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | apache-2.0 |
scieloorg/processing | tests/test_analytics.py | 1 | 4011 | # coding: utf-8
import unittest
from clients.analytics import Analytics
class AnalyticsClientTest(unittest.TestCase):
def setUp(self):
self.analytics = Analytics()
def test_compute_impact_factor(self):
data = {
"options": {
"title": {
"text":... | bsd-2-clause |
mmauroy/SickRage | lib/github/tests/Issue131.py | 39 | 2739 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
baloo/shinken | shinken/brok.py | 1 | 1333 | #!/usr/bin/env python
# Copyright (C) 2009-2011 :
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/o... | agpl-3.0 |
Ex-Mente/auxi.0 | auxi/tools/chemistry/stoichiometry_test.py | 1 | 9854 | #!/usr/bin/env python3
"""
This module contains all the code used to test the testee module.
"""
import unittest
from auxi.tools.chemistry import stoichiometry as testee
__version__ = '0.3.6'
__license__ = 'LGPL v3'
__copyright__ = 'Copyright 2016, Ex Mente Technologies (Pty) Ltd'
__author__ = 'Johan Zietsman'
__c... | lgpl-3.0 |
peak6/st2 | st2api/st2api/controllers/v1/webhooks.py | 5 | 10276 | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | apache-2.0 |
cfg2015/EPT-2015-2 | addons/google_spreadsheet/__openerp__.py | 312 | 1710 | # -*- 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 |
cccs-web/mezzanine | mezzanine/bin/mezzanine_project.py | 10 | 2964 | #!/usr/bin/env python
from __future__ import unicode_literals
from future.builtins import open
from distutils.dir_util import copy_tree
from optparse import OptionParser
import os
from shutil import move
from uuid import uuid4
from mezzanine.utils.importing import path_for_import
def create_project():
"""
C... | bsd-2-clause |
axi0mX/ipwndfu | image3_24Kpwn.py | 1 | 2668 | # Credit: This file is based on 24Kpwn exploit (segment overflow) by chronic, CPICH, ius, MuscleNerd, Planetbeing, pod2g, posixninja, et al.
import struct
import image3
def exploit(img3, securerom):
with open('bin/24Kpwn-shellcode.bin', 'rb') as f:
shellcode = f.read()
MAX_SHELLCODE_LENGTH = 1024
... | gpl-3.0 |
xiezhq-hermann/LeetCode-in-Python | src/linked_list_random_382.py | 1 | 1067 | # Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def __init__(self, head):
"""
@param head The linked list's head.
Note that the head is guaranteed to be not null, so it con... | mit |
jsteemann/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test___all__.py | 52 | 6085 | import unittest
from test.test_support import run_unittest
import sys
import warnings
class AllTest(unittest.TestCase):
def check_all(self, modname):
names = {}
with warnings.catch_warnings():
warnings.filterwarnings("ignore", ".* (module|package)",
... | apache-2.0 |
prefetchnta/questlab | bin/x64bin/python/37/Lib/shutil.py | 1 | 43138 | """Utility functions for copying and archiving files and directory trees.
XXX The functions here don't copy the resource fork or other metadata on Mac.
"""
import os
import sys
import stat
import fnmatch
import collections
import errno
try:
import zlib
del zlib
_ZLIB_SUPPORTED = True
ex... | lgpl-2.1 |
umitproject/packet-manipulator | umit/pm/gui/tabs/console.py | 2 | 26765 | #!/usr/bin/env python
#------------------------------------------------------------------------------
#
# Copyright (c) 1998 James Henstridge, 2006 Nicolas Rougier
#
# 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
# ... | gpl-2.0 |
puttarajubr/commcare-hq | corehq/apps/analytics/tasks.py | 1 | 4971 | from celery.task import task
import json
import requests
import urllib
import KISSmetrics
from settings import ANALYTICS_IDS
def _track_on_hubspot(webuser, properties):
"""
Update or create a new "contact" on hubspot. Record that the user has
created an account on HQ.
properties is a dictionary mapp... | bsd-3-clause |
dash-dash/pyzmq | zmq/tests/test_version.py | 43 | 1334 | # Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from unittest import TestCase
import zmq
from zmq.sugar import version
class TestVersion(TestCase):
def test_pyzmq_version(self):
vs = zmq.pyzmq_version()
vs2 = zmq.__version__
self.assertTrue(is... | bsd-3-clause |
MartinThoma/LaTeX-examples | tikz/histogram-symbols/process.py | 1 | 4444 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import shutil
import fileinput
import math
def main(filename, bins, maximum, yticks_number):
with open(filename) as f:
content = f.read().split("\n")
numbers = []
for line in content:
line = line.strip()
... | mit |
LarsFronius/ansible | lib/ansible/modules/network/panos/panos_pg.py | 78 | 6521 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
xhochy/arrow | dev/archery/archery/integration/tester_js.py | 6 | 2443 | # 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 u... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.