repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
ncoghlan/dnf | dnf/cli/commands/reinstall.py | 12 | 3858 | # reinstall.py
# Reinstall CLI command.
#
# Copyright (C) 2014 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... | gpl-2.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/numpy/core/function_base.py | 23 | 6891 | from __future__ import division, absolute_import, print_function
__all__ = ['logspace', 'linspace']
from . import numeric as _nx
from .numeric import result_type, NaN, shares_memory, MAY_SHARE_BOUNDS, TooHardError
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
"""
Return evenly... | mit |
DickJC123/mxnet | example/gluon/lipnet/BeamSearch.py | 15 | 6240 | #!/usr/bin/env python3
# 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
# "... | apache-2.0 |
chaincoin/chaincoin | qa/rpc-tests/replace-by-fee.py | 1 | 22023 | #!/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 replace by fee code
#
from test_framework.test_framework import BitcoinTestFramework
from test_... | mit |
morph027/ansible-modules-extras | clustering/znode.py | 55 | 7693 | #!/usr/bin/python
# Copyright 2015 WP Engine, Inc. All rights reserved.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | gpl-3.0 |
mikewied/perfrunner | perfrunner/tests/multitenancy.py | 7 | 6048 | import time
from collections import OrderedDict
import numpy as np
from logger import logger
from perfrunner.helpers.misc import pretty_dict
from perfrunner.settings import TargetSettings
from perfrunner.tests import PerfTest
class EmptyBucketsTest(PerfTest):
"""
Ramp-up test with increasing number of empt... | apache-2.0 |
makinacorpus/odoo | addons/purchase_double_validation/__openerp__.py | 260 | 1920 | # -*- 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 |
haxoza/django | django/core/management/commands/inspectdb.py | 100 | 11994 | from __future__ import unicode_literals
import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = "Introspects the database tables in the given database and... | bsd-3-clause |
sergecodd/FireFox-OS | B2G/gaia/tests/python/gaiatest/tests/clock/clock_object.py | 2 | 2675 | # 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/.
from gaiatest import GaiaTestCase
from marionette import MarionetteTestCase
from marionette import Marionette
_alarm_cre... | apache-2.0 |
SlimRoms/kernel_samsung_t1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
pytorch/fairseq | examples/multilingual/data_scripts/utils/fasttext_multi_filter.py | 1 | 2340 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#!/bin/python
import fasttext
from multiprocessing import Pool
import contextlib
import sys
import argparse
from functools import partial
im... | mit |
jkenn99/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py | 118 | 5888 | # Copyright (C) 2010 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 ... | bsd-3-clause |
bunnyitvn/webptn | django/core/handlers/base.py | 63 | 12478 | from __future__ import unicode_literals
import logging
import sys
import types
from django import http
from django.conf import settings
from django.core import exceptions
from django.core import urlresolvers
from django.core import signals
from django.utils.encoding import force_text
from django.utils.importlib impor... | bsd-3-clause |
dolphx/browsepy | browsepy/plugin/player/playable.py | 1 | 7332 |
import sys
import codecs
import os.path
import warnings
from browsepy.compat import range, PY_LEGACY # noqa
from browsepy.file import Node, File, Directory, \
underscore_replace, check_under_base
if PY_LEGACY:
import ConfigParser as configparser
else:
import configparser
ConfigPa... | mit |
cszawisza/eedb | externals/gmock-1.7.0/gtest/test/gtest_xml_output_unittest.py | 1815 | 14580 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
LordSputnik/beets | test/test_importadded.py | 2 | 7210 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Stig Inge Lea Bjornsen.
#
# 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 limi... | mit |
dbtsai/spark | examples/src/main/python/ml/feature_hasher_example.py | 27 | 1521 | #
# 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 |
heiden-deng/anaconda | pyanaconda/installclasses/rhel.py | 8 | 2153 | #
# rhel.py
#
# Copyright (C) 2010 Red Hat, 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 License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version... | gpl-2.0 |
asm-products/movie-database-service | ani/lib/python2.7/site-packages/django/conf/locale/sr_Latn/formats.py | 235 | 1981 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y.'
TIME_FORMAT = 'H:i'
DATE... | agpl-3.0 |
jrabbit/ubotu-fr | plugins/plugins/Reply/test.py | 18 | 2633 | ###
# Copyright (c) 2005, Daniel DiPaolo
# 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 condition... | bsd-3-clause |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/site-packages/urllib3/request.py | 63 | 5991 | from __future__ import absolute_import
from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.con... | gpl-3.0 |
rgeleta/odoo | addons/hr_timesheet_sheet/__init__.py | 434 | 1127 | # -*- 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... | agpl-3.0 |
ppwwyyxx/tensorflow | tensorflow/python/kernel_tests/random/random_grad_test.py | 30 | 10140 | # Copyright 2018 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 |
Dineshs91/youtube-dl | youtube_dl/extractor/ultimedia.py | 106 | 3657 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
ExtractorError,
qualities,
unified_strdate,
clean_html,
)
class UltimediaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.... | unlicense |
kH0d0r/TeamTalk | win-client/3rdParty/src/json/makerelease.py | 169 | 15483 | """Tag the sandbox for release, make source and doc tarballs.
Requires Python 2.6
Example of invocation (use to test the script):
python makerelease.py --platform=msvc6,msvc71,msvc80,msvc90,mingw -ublep 0.6.0 0.7.0-dev
When testing this script:
python makerelease.py --force --retag --platform=msvc6,msvc71,msvc80,min... | apache-2.0 |
drnextgis/QGIS | python/ext-libs/dateutil/rrule.py | 214 | 41036 | """
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
import itertools
import datetime
import calendar
try:
import _thread
except ImportError:
import thread as _thread
import sys
from six i... | gpl-2.0 |
wreckJ/intellij-community | python/lib/Lib/smtplib.py | 87 | 27148 | #! /usr/bin/env python
'''SMTP/ESMTP client class.
This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).
Notes:
Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RC... | apache-2.0 |
ioam/topographica | doc/conf.py | 3 | 3793 | # -*- coding: utf-8 -*-
import os, sys
sys.path.append(os.path.abspath('.'))
from builder.shared_conf import * # pyflakes:ignore (API import)
paths = ['../external/imagen/', '../external/lancet/', '../external/param/',
'../external/paramtk/', '../external/holoviews/', '../external/featuremapper/',
... | bsd-3-clause |
grilo/ansible-1 | test/units/playbook/test_helpers.py | 119 | 19184 | # (c) 2016, Adrian Likins <alikins@redhat.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 vers... | gpl-3.0 |
JavML/django | django/core/management/commands/showmigrations.py | 440 | 4901 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.loader import MigrationLoader
class Command(BaseCommand):
help = "Shows all available migrations for the ... | bsd-3-clause |
birsoyo/conan | conans/server/rest/server.py | 2 | 1907 | import bottle
from conans.server.rest.api_v1 import ApiV1
from conans.model.version import Version
from conans.server.rest.api_v2 import ApiV2
class ConanServer(object):
"""
Server class. Instances api_v1 application and run it.
Receives the store.
"""
store = None
root_app = None
... | mit |
ptisserand/ansible | lib/ansible/utils/module_docs_fragments/dimensiondata.py | 192 | 2098 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Dimension Data
#
# This module 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 ... | gpl-3.0 |
Southpaw-TACTIC/TACTIC | src/pyasm/web/webware_adapter.py | 1 | 4985 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
harry159821/Tickeys-linux | tickeys/kivy/cache.py | 40 | 7975 | '''
Cache manager
=============
The cache manager can be used to store python objects attached to a unique
key. The cache can be controlled in two ways: with a object limit or a
timeout.
For example, we can create a new cache with a limit of 10 objects and a
timeout of 5 seconds::
# register a new Cache
Cach... | mit |
fangxingli/hue | desktop/core/ext-py/pyopenssl/doc/conf.py | 10 | 7131 | # -*- coding: utf-8 -*-
#
# pyOpenSSL documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 16 07:12:22 2011.
#
# 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.
#
# A... | apache-2.0 |
rooi/CouchPotatoServer | libs/xmpp/commands.py | 200 | 16116 | ## $Id: commands.py,v 1.17 2007/08/28 09:54:15 normanr Exp $
## Ad-Hoc Command manager
## Mike Albon (c) 5th January 2005
## 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 versio... | gpl-3.0 |
magic0704/neutron | neutron/db/migration/alembic_migrations/versions/31d7f831a591_add_constraint_for_routerid.py | 9 | 2691 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
phenoxim/nova | nova/tests/unit/api/openstack/placement/test_handler.py | 1 | 7223 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
flavioamieiro/pypln.backend | pypln/backend/workers/bigrams.py | 3 | 1748 | # coding: utf-8
#
# Copyright 2012 NAMD-EMAP-FGV
#
# This file is part of PyPLN. You can get more information at: http://pypln.org/.
#
# PyPLN 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 o... | gpl-3.0 |
brijeshkesariya/odoo | openerp/addons/test_workflow/tests/test_workflow.py | 392 | 6232 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.tests import common
class test_workflows(common.TransactionCase):
def check_activities(self, model_name, i, names):
""" Check that the record i has workitems in the given activity names.
"""
instance = se... | agpl-3.0 |
stianstr/autodeploy | autodeploy/Api.py | 1 | 3374 | from DependencyContainer import DependencyContainer
from Deployer import AlreadyDeployed
import traceback
dc = DependencyContainer()
# Step 1 - Check if branch can be deployed
def check(branch, server, user, internalCheck=False):
checker = dc.getDeploymentChecker(server)
result = checker.check(branch)
if ... | mit |
derickr/mongo-c-driver | build/evergreen_config_lib/tasks.py | 1 | 29912 | # Copyright 2018-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
shaded-enmity/ansible-modules-extras | monitoring/datadog_event.py | 12 | 4710 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Author: Artūras 'arturaz' Šlajus <x11@arturaz.net>
#
# This module is proudly sponsored by iGeolise (www.igeolise.com) and
# Tiny Lab Productions (www.tinylabproductions.com).
DOCUMENTATION = '''
---
module: datadog_event
short_description: Posts events to DataDog service... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/201_re_tests.py | 6 | 29675 | #!/usr/bin/env python
# -*- mode: python -*-
# Re test suite and benchmark suite v1.5
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex ... | gpl-3.0 |
mozilla/moztrap | tests/view/manage/runs/test_views.py | 5 | 6823 | # coding: utf-8
"""
Tests for run management views.
"""
from datetime import date
from django.core.urlresolvers import reverse
from tests import case
from ...lists.runs import RunsListTests
class RunsTest(case.view.manage.ListViewTestCase,
RunsListTests,
case.view.ListFinderTests,
... | bsd-2-clause |
citrix-openstack/build-ryu | ryu/ofproto/ofproto_v1_3.py | 3 | 42950 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... | apache-2.0 |
defance/edx-platform | lms/djangoapps/shoppingcart/tests/test_context_processor.py | 134 | 3312 | """
Unit tests for shoppingcart context_processor
"""
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from mock import patch, Mock
from course_modes.tests.factories import CourseModeFactory
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils... | agpl-3.0 |
RomainBrault/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 43 | 10272 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
uhjish/bx-python | lib/bx/align/score.py | 7 | 11617 | """
Support for scoring alignments using arbitrary scoring matrices, arbitrary
alphabets, and affine gap penalties.
"""
from numpy import *
class ScoringScheme( object ):
# note that gap_open and gap_extend are penalties, which means you should make them positive
def __init__( self, gap_open, gap_extend, default... | mit |
pixelrebel/st2 | st2client/tests/unit/test_util_date.py | 6 | 2406 | # 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 |
gearslam/JB_LS970ZVC | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
goibibo/django-rest-swagger | tests/cigar_example/cigar_example/restapi/views.py | 17 | 8199 | # coding=utf-8
"""API Views for example application."""
from rest_framework.views import Response, APIView
from rest_framework import viewsets, status
import rest_framework
from rest_framework.generics import ListCreateAPIView, \
RetrieveUpdateDestroyAPIView
from cigar_example.app.models import Cigar, Manufacture... | bsd-2-clause |
xodus7/tensorflow | tensorflow/contrib/gan/python/estimator/python/head_impl.py | 18 | 10693 | # 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 |
joelpinheiro/safebox-smartcard-auth | Server/veserver/lib/python2.7/site-packages/cherrypy/_cpnative_server.py | 58 | 6000 | """Native adapter for serving CherryPy via its builtin server."""
import logging
import sys
import cherrypy
from cherrypy._cpcompat import BytesIO
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import httputil
from cherrypy import wsgiserver
class NativeGateway(wsgiserver.Gateway):
recu... | gpl-2.0 |
stephanpoetschner/django-redis-metrics | docs/conf.py | 2 | 9316 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# django-redis-metrics documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 19 09:37:56 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present... | mit |
szezso/T.E.S.C.O-kernel_vivo | tools/perf/python/twatch.py | 3213 | 1338 | #! /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 |
windskyer/k_nova | nova_extension/compute/ibm/etree_wrapper.py | 1 | 4367 | # =================================================================
# =================================================================
"""Wrapper around ElementTree, using either the native implementation or lxml.
This module creates a wrapper around the ElementTree library, picking an
appropriate implementation for... | apache-2.0 |
dhalleine/tensorflow | tensorflow/python/kernel_tests/control_flow_ops_py_test.py | 1 | 59408 | # 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 |
pulinagrawal/nupic | src/nupic/support/unittesthelpers/test_framework_helpers.py | 15 | 2021 | # ----------------------------------------------------------------------
# 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 |
pleaseproject/python-for-android | python3-alpha/python3-src/Tools/pybench/Lookups.py | 92 | 15254 | from pybench import Test
class SpecialClassAttribute(Test):
version = 2.0
operations = 5*(12 + 12)
rounds = 100000
def test(self):
class c:
pass
for i in range(self.rounds):
c.__a = 2
c.__b = 3
c.__c = 4
c.__a = 2
... | apache-2.0 |
gamesun/MyCdecl | main.py | 1 | 5018 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2013, gamesun
# 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 a... | bsd-3-clause |
vmindru/ansible | test/units/modules/network/f5/test_bigip_provision.py | 21 | 4395 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
rhinstaller/blivet | translation-canary/translation_canary/translated/test_percentage.py | 15 | 1674 | # Check what percentage of strings a .po translates
#
# This will reject translations that fall below a certain threshold of
# translated strings.
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and c... | lgpl-2.1 |
shipci/sympy | sympy/vector/tests/test_printing.py | 10 | 5621 | # -*- coding: utf-8 -*-
from sympy import Integral, latex, Function
from sympy import pretty as xpretty
from sympy.vector import CoordSysCartesian, Vector, Dyadic, express
from sympy.abc import a, b, c
from sympy.core.compatibility import u_decode as u
from sympy.utilities.pytest import XFAIL
def pretty(expr):
"""... | bsd-3-clause |
SnowWalkerJ/quantlib | quant/data/wind/tables/asharestockrating.py | 1 | 2127 | from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE
VARCHAR2 = VARCHAR
class AShareStockRating(BaseModel):
"""
4.75 中国A股投资评级明细
Attributes
----------
object_id: VARCHAR2(100)
对象ID
s_info_windcode: VARCHAR2(40)
Wind代码 ... | gpl-3.0 |
nikpap/inspire-next | inspirehep/modules/workflows/tasks/classifier.py | 1 | 4238 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2015 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 2 of the
# License, or (at your option) any later... | gpl-2.0 |
trishnaguha/ansible | lib/ansible/modules/network/ios/ios_system.py | 61 | 12174 | #!/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 |
mpetyx/palmdrop | venv/lib/python2.7/site-packages/cms/migrations/0015_modified_by_added.py | 385 | 19523 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Dummy migration
pass
def backwards(self, orm):
# Dummy migration
pass
models = {
... | apache-2.0 |
hperadin/FrameworkBenchmarks | frameworks/PHP/hhvm/setup.py | 19 | 1384 |
import subprocess
import setup_util
import os
def start(args, logfile, errfile):
setup_util.replace_text("hhvm/once.php.inc", "host=localhost;", "host=" + args.database_host + ";")
setup_util.replace_text("hhvm/deploy/config.hdf", "SourceRoot = .*\/FrameworkBenchmarks/hhvm", "SourceRoot = " + args.troot)
setup_... | bsd-3-clause |
abhaykadam/vm | tools/inifile/inifile.py | 11 | 12748 | #!/usr/bin/python
# Copyright (C) 2009 Rafael Ubal Tena
#
# 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-3.0 |
aam-at/tensorflow | tensorflow/python/eager/benchmarks/resnet50/resnet50_test_util.py | 14 | 2218 | # 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 |
SlimLPXperia/android_kernel_sony_u8500 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
herow/planning_qgis | python/ext-libs/pygments/styles/vs.py | 364 | 1073 | # -*- coding: utf-8 -*-
"""
pygments.styles.vs
~~~~~~~~~~~~~~~~~~
Simple style with MS Visual Studio colors.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Co... | gpl-2.0 |
mne-tools/mne-python | mne/utils/_bunch.py | 14 | 3076 | # -*- coding: utf-8 -*-
"""Bunch-related classes."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Joan Massich <mailsik@gmail.com>
#
# License: BSD (3-clause)
from copy import deepcopy
#########################################################... | bsd-3-clause |
zhaozhi406/news | config.py | 1 | 1431 | #-*- coding:utf-8 -*-
import logging.config
IMAGE_SIZES = {
"large": (680,382),
"middle": (720, 0),
"small": (226,150 )
}
IMAGE_SAVE_DIR = "/Users/jiangqiurong/Desktop"
mongodb_conn_string = "mongodb://47.88.194.127:27017/"
mysql_config = {
"user": "zhaozhi",
"password": "zzhao",
"host": "47... | mit |
trosa/forca | reportlab/lib/testutils.py | 1 | 11504 | #Copyright ReportLab Europe Ltd. 2000-2008
#see license.txt for license details
__version__='''$Id: testutils.py 3662 2010-02-09 11:23:58Z rgbecker $'''
__doc__="""Provides support for the test suite.
The test suite as a whole, and individual tests, need to share
certain support functions. We have to put these ... | gpl-2.0 |
Senseg/Py4A | python3-alpha/python3-src/Lib/idlelib/ScriptBinding.py | 45 | 8161 | """Extension to execute code outside the Python shell window.
This adds the following commands:
- Check module does a full syntax check of the current module.
It also runs the tabnanny to catch any inconsistent tabs.
- Run module executes the module's code in the __main__ namespace. The window
must have been sa... | apache-2.0 |
gimite/personfinder | app/vendors/google/auth/jwt.py | 3 | 26709 | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
zxqzx/scripts | emailmodule.py | 1 | 1669 | #!/usr/bin/env python3
# Import smtplib for the actual sending function
import smtplib
# Import the email modules we'll need
from email.mime.text import MIMEText
import sys
import argparse
#User Options
globalsender = ""
loginrequired = "no"
server = "localhost"
port = "587"
starttls = "no"
username = "username"
p... | mit |
jmesteve/openerp | openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tiny_socket.py | 386 | 3270 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
Potin/linux-am33x-04.06.00.10 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
dgarage/bc3 | test/functional/txn_doublespend.py | 35 | 6727 | #!/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 the wallet accounts properly when there is a double-spend conflict."""
from test_framework.test_f... | mit |
haddocking/disvis | disvis/IO/mmcif.py | 1 | 1979 | from __future__ import print_function
import sys
from collections import OrderedDict
import numpy as np
def parse_cif(infile):
if isinstance(infile, file):
pass
elif isinstance(infile, str):
infile = open(infile)
else:
raise TypeError("Input should either be a file or string.")
... | apache-2.0 |
dadarakt/owl | owl/Adafruit_PWM_Servo_Driver.py | 33 | 3163 | #!/usr/bin/python
import time
import math
from Adafruit_I2C import Adafruit_I2C
# ============================================================================
# Adafruit PCA9685 16-Channel PWM Servo Driver
# ============================================================================
class PWM :
# Registers/etc.
... | apache-2.0 |
midma101/m0du1ar | .venv/lib/python2.7/site-packages/setuptools/command/bdist_egg.py | 306 | 17184 | """setuptools.command.bdist_egg
Build .egg distributions"""
from distutils.errors import DistutilsSetupError
from distutils.dir_util import remove_tree, mkpath
from distutils import log
from types import CodeType
import sys
import os
import marshal
import textwrap
from pkg_resources import get_build_platform, Distri... | mit |
Jgarcia-IAS/localizacion | openerp/addons-extra/odoo-pruebas/odoo-server/addons/website/models/ir_actions.py | 363 | 3074 | # -*- coding: utf-8 -*-
import urlparse
from openerp.http import request
from openerp.osv import fields, osv
class actions_server(osv.Model):
""" Add website option in server actions. """
_name = 'ir.actions.server'
_inherit = ['ir.actions.server']
def _compute_website_url(self, cr, uid, id, websit... | agpl-3.0 |
uclouvain/osis | attribution/tests/ddd/domain/test_teacher.py | 1 | 2419 | ##############################################################################
#
# 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 |
z1gm4/desarrollo_web_udp | env/lib/python2.7/site-packages/pkg_resources/extern/__init__.py | 145 | 2474 | import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(ve... | gpl-3.0 |
galenhz/micropython | tests/basics/string_format.py | 6 | 4990 | # Change the following to True to get a much more comprehensive set of tests
# to run, albeit, which take considerably longer.
full_tests = False
def test(fmt, *args):
print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<')
test("}}{{")
test("{}-{}", 1, [4, 5])
test("{0}-{1}", 1, [4, 5])
test("{1}-{0}", 1, [... | mit |
crepererum/invenio | invenio/legacy/authorextract/regexs.py | 15 | 23368 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2010, 2011 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... | gpl-2.0 |
kenxwagner/PythonPlay | Project/webscrap/websc/Lib/site-packages/chardet/langgreekmodel.py | 269 | 12688 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | mit |
TeamRegular/android_kernel_lge_c50 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
daniel-hou0/horizon | django-openstack/django_openstack/tests/broken/base.py | 17 | 2759 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | apache-2.0 |
lukaslundgren/django-rest-framework-json-api | example/tests/utils.py | 8 | 1164 | import json
from django.utils.encoding import force_bytes, force_text
def load_json(data):
return json.loads(force_text(data))
def dump_json(data):
'''
Converts a Python object to a JSON formatted string.
'''
json_kwargs = {
'sort_keys': True,
'indent': 4,
'separators':... | bsd-2-clause |
anderdl/test3repo | build/lib.linux-x86_64-2.7/photologue/tests/test_gallery.py | 9 | 2219 | from .. import models
from .helpers import PhotologueBaseTest
from .factories import GalleryFactory, PhotoFactory
class GalleryTest(PhotologueBaseTest):
def setUp(self):
"""Create a test gallery with 2 photos."""
super(GalleryTest, self).setUp()
self.test_gallery = GalleryFactory()
... | bsd-3-clause |
defionscode/ansible | lib/ansible/module_utils/gce.py | 187 | 2535 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
manipopopo/tensorflow | tensorflow/python/profiler/model_analyzer_test.py | 7 | 32532 | # 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 |
halbbob/dff | api/gui/model/search_model.py | 1 | 16526 | # DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009-2011 ArxSys
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.digital-forensic.org for more information about this... | gpl-2.0 |
angelapper/edx-platform | common/lib/xmodule/xmodule/tests/test_randomize_module.py | 78 | 3960 | """
Test cases covering workflows and behaviors for the Randomize XModule
"""
import unittest
from datetime import datetime, timedelta
from django.utils.timezone import UTC
from opaque_keys.edx.locator import BlockUsageLocator
from xblock.fields import ScopeIds
from xmodule.randomize_module import RandomizeModule
fro... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.