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 |
|---|---|---|---|---|---|
SINGROUP/pycp2k | pycp2k/classes/_opt_ri_basis3.py | 1 | 1543 | from pycp2k.inputsection import InputSection
class _opt_ri_basis3(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Delta_i_rel = None
self.Delta_ri = None
self.Eps_deriv = None
self.Max_iter = None
self.Num_func = None
self.Basis_size = No... | lgpl-3.0 |
kisna72/django | django/contrib/gis/gdal/layer.py | 477 | 8693 | from ctypes import byref, c_double
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import (
GDALException, OGRIndexError, SRSException,
)
from django.contrib.gis.gdal.feature import Feature
from django.contrib.g... | bsd-3-clause |
alexgorban/models | research/maskgan/pretrain_mask_gan.py | 5 | 8816 | # 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 applicab... | apache-2.0 |
mantidproject/mantid | Framework/PythonInterface/test/testhelpers/tempfile_wrapper.py | 3 | 1910 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | gpl-3.0 |
xalopp/npm | node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py | 1355 | 44604 | # Copyright (c) 2013 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.
"""cmake output module
This module is under development and should be considered experimental.
This module produces cmake (2.8.8+) input as its output. One CMake... | artistic-2.0 |
jamesr/sky_engine | sky/tools/objcopy.py | 14 | 1244 | #!/usr/bin/env python
# Copyright 2013 The Flutter 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 argparse
import os
import subprocess
import sys
# BFD architecture names recognized by objcopy.
BFD_ARCH = {
'arm': 'arm',
'... | bsd-3-clause |
wilebeast/FireFox-OS | B2G/gecko/media/webrtc/trunk/tools/gyp/test/variables/commands/gyptest-commands-repeated.py | 330 | 1313 | #!/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.
"""
Test variable expansion of '<!()' syntax commands where they are evaluated
more then once..
"""
import TestGyp
test = TestGyp.TestGyp(... | apache-2.0 |
attakei/ansible | test/units/module_utils/test_basic.py | 73 | 32372 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | gpl-3.0 |
edf-hpc/python-pyslurm | examples/blocks_list.py | 2 | 1695 | #!/usr/bin/env python
from __future__ import print_function
import pyslurm
from time import gmtime, strftime
def display(block_dict):
if block_dict:
date_fields = [ ]
print('{0:*^80}'.format(''))
for key, value in block_dict.items():
print("{0} :".format(key))
... | gpl-2.0 |
JakubBrachTieto/openthread | tools/harness-automation/cases/router_5_3_4.py | 16 | 1873 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
glmcdona/meddle | examples/base/Lib/encodings/mac_roman.py | 593 | 13736 | """ Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,err... | mit |
Denisolt/Tensorflow_Chat_Bot | local/lib/python2.7/site-packages/scipy/sparse/sputils.py | 25 | 12255 | """ Utility functions for sparse matrix module
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
__all__ = ['upcast', 'getdtype', 'isscalarlike', 'isintlike',
'isshape', 'issequence', 'isdense', 'ismatrix', 'get_sum_dtype']
supported_dtypes = ['bool',... | gpl-3.0 |
yangw1234/BigDL | pyspark/bigdl/optim/optimizer.py | 2 | 40389 | #
# 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 |
rednaxelafx/apache-spark | python/pyspark/sql/tests/test_functions.py | 2 | 17119 | #
# 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 |
uglyfruitcake/Axelrod | axelrod/tests/unit/test_cooperator.py | 1 | 1499 | """Test for the cooperator strategy."""
import axelrod
from .test_player import TestPlayer
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestCooperator(TestPlayer):
name = "Cooperator"
player = axelrod.Cooperator
expected_classifier = {
'memory_depth': 0,
'stochastic': False,
... | mit |
souravbadami/oppia | core/storage/base_model/gae_models.py | 1 | 36051 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
idlead/scikit-learn | sklearn/metrics/cluster/bicluster.py | 359 | 2797 | from __future__ import division
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
from sklearn.utils.validation import check_consistent_length, check_array
__all__ = ["consensus_score"]
def _check_rows_and_columns(a, b):
"""Unpacks the row and column arrays and checks their shap... | bsd-3-clause |
dodi/google-python-exercises | babynames/solution/babynames.py | 212 | 3852 | #!/usr/bin/python
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
import sys
import re
"""Baby Names exercise
Define the extract_names() function below and c... | apache-2.0 |
pettarin/penelope | setup.py | 1 | 2657 | #!/usr/bin/env python
# coding=utf-8
"""
Set penelope package up
"""
from setuptools import Extension
from setuptools import setup
__author__ = "Alberto Pettarin"
__copyright__ = "Copyright 2012-2016, Alberto Pettarin (www.albertopettarin.it)"
__license__ = "MIT"
__version__ = "3.1.3"
__email__ = "alberto@albertopet... | mit |
m0ppers/arangodb | 3rdParty/boost/1.61.0/tools/build/test/custom_generator.py | 17 | 1599 | #!/usr/bin/python
# Copyright 2003, 2004, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Attempt to declare a generator for creating OBJ from RC files. That generator
# should be considered together wi... | apache-2.0 |
mandeepdhami/horizon | openstack_dashboard/dashboards/settings/user/tests.py | 73 | 1493 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
ity/pants | tests/python/pants_test/core_tasks/test_roots.py | 15 | 1306 | # coding=utf-8
# Copyright 2014 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)
import os
from pant... | apache-2.0 |
DomainDrivenConsulting/dogen | projects/masd.dogen.dia/python/add_to_package.py | 1 | 1625 | # -*- mode: python; tab-width: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2012-2015 Marco Craveiro <marco.craveiro@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 version... | gpl-3.0 |
bigswitch/snac-nox-zaku | src/nox/lib/token_bucket.py | 10 | 1535 | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... | gpl-3.0 |
BracketMonks/hackathon-frontend | gulp/node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | gpl-3.0 |
abacuspix/NFV_project | Mastering Flask_Code Bundle/chapter_12/webapp/extensions.py | 4 | 2838 | from flask import (
flash,
redirect,
url_for,
session
)
from flask.ext.bcrypt import Bcrypt
from flask.ext.openid import OpenID
from flask_oauth import OAuth
from flask.ext.login import LoginManager
from flask.ext.principal import Principal, Permission, RoleNeed
from flask.ext.restful import Api
from fl... | mit |
kikocorreoso/mplutils | mplutils/axes.py | 1 | 8516 | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 21 23:43:37 2016
@author: kiko
"""
from __future__ import division, absolute_import
from .settings import RICH_DISPLAY
import numpy as np
if RICH_DISPLAY:
from IPython.display import display
def axes_set_better_defaults(ax,
axes_color ... | mit |
ancafarcas/superdesk-core | superdesk/media/media_operations.py | 1 | 5561 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import arro... | agpl-3.0 |
FirmlyReality/docklet | src/master/testTaskMgr.py | 2 | 5417 | import master.taskmgr
from concurrent import futures
import grpc
from protos.rpc_pb2 import *
from protos.rpc_pb2_grpc import *
import threading, json, time, random
from utils import env
class SimulatedNodeMgr():
def get_batch_nodeips(self):
return ['0.0.0.0']
class SimulatedMonitorFetcher():
def __init__(self,... | bsd-3-clause |
AndreasMadsen/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/quantized_distribution_test.py | 12 | 17667 | # 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 |
gonzolino/heat | heat/tests/openstack/sahara/test_templates.py | 2 | 15666 | # Copyright (c) 2014 Mirantis 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 writ... | apache-2.0 |
tvalacarta/tvalacarta | python/main-classic/lib/youtube_dl/extractor/freesound.py | 64 | 2496 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
float_or_none,
get_element_by_class,
get_element_by_id,
unified_strdate,
)
class FreesoundIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?freesound\.org/people/[^/]+/sounds/(?P<id>[^/]+... | gpl-3.0 |
mapledyne/skytap | skytap/models/Vm.py | 2 | 2708 | """Support for a VM resource in Skytap."""
import json
from skytap.framework.ApiClient import ApiClient
from skytap.framework.Suspendable import Suspendable
import skytap.framework.Utils as Utils
from skytap.Labels import Labels
from skytap.models.Interfaces import Interfaces
from skytap.models.Notes import Notes
from... | mit |
themurph/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.28/roles/openshift_health_checker/openshift_checks/package_availability.py | 15 | 2100 | # pylint: disable=missing-docstring
from openshift_checks import OpenShiftCheck, get_var
from openshift_checks.mixins import NotContainerizedMixin
class PackageAvailability(NotContainerizedMixin, OpenShiftCheck):
"""Check that required RPM packages are available."""
name = "package_availability"
tags = [... | apache-2.0 |
2014cdag4/2014cdag4 | wsgi/static/Brython2.1.0-20140419-113919/Lib/abc.py | 765 | 8057 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
from _weakrefset import WeakSet
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or der... | gpl-2.0 |
fastinetserver/portage-idfetch | pym/portage/cache/sql_template.py | 1 | 9336 | # Copyright: 2005 Gentoo Foundation
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
import sys
from portage.cache import template, cache_errors
from portage.cache.template import reconstruct_eclasses
class SQLDatabase(template.database):
"""template class for RDBM based caches
This class is desig... | gpl-2.0 |
Ryex/Rabbyt | rabbyt/sprites.py | 1 | 6567 | from rabbyt._sprites import cBaseSprite, cSprite
from rabbyt._rabbyt import pick_texture_target
from rabbyt.anims import anim_slot, swizzle, Animable
from rabbyt.primitives import Quad
class BaseSprite(cBaseSprite, Animable):
"""
``BaseSprite(...)``
This class provides some basic functionality fo... | mit |
pH14/rubinius | vendor/libffi/generate-ios-source-and-headers.py | 183 | 5303 | #!/usr/bin/env python
import subprocess
import re
import os
import errno
import collections
import sys
class Platform(object):
pass
sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
def sdkinfo(sdkname):
ret = {}
for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PI... | bsd-3-clause |
haad/ansible | test/units/modules/network/onyx/test_onyx_config.py | 50 | 4600 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
agent010101/agent010101.github.io | vendor/bundle/ruby/2.0.0/gems/pygments.rb-0.6.1/vendor/pygments-main/tests/test_string_asserts.py | 30 | 1238 | # -*- coding: utf-8 -*-
"""
Pygments string assert utility tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import unittest
from string_asserts import StringTests
class TestStringTests(StringTests, unit... | mit |
deka108/meas_deka | apiv2/utils/formula_util.py | 2 | 3007 | from itertools import chain
from apiv2.models import Formula, FormulaCategory, Question
from apiv2.utils import formula_bracket as fb
def init_formula_categories():
FormulaCategory.objects.all().delete()
update_formula_categories()
def update_formula_categories():
for category in fb.FORMULA_CATEGORIES:... | apache-2.0 |
aronasorman/kolibri | kolibri/logger/serializers.py | 1 | 2680 | from kolibri.logger.models import AttemptLog, ContentRatingLog, ContentSessionLog, ContentSummaryLog, MasteryLog, UserSessionLog
from rest_framework import serializers
class ContentSessionLogSerializer(serializers.ModelSerializer):
class Meta:
model = ContentSessionLog
fields = ('pk', 'user', 'co... | mit |
fpsluozi/youtube-dl | youtube_dl/extractor/foxgay.py | 146 | 1735 | from __future__ import unicode_literals
from .common import InfoExtractor
class FoxgayIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?foxgay\.com/videos/(?:\S+-)?(?P<id>\d+)\.shtml'
_TEST = {
'url': 'http://foxgay.com/videos/fuck-turkish-style-2582.shtml',
'md5': '80d72beab5d04e1655a56ad37... | unlicense |
abimannans/scikit-learn | sklearn/linear_model/__init__.py | 270 | 3096 | """
The :mod:`sklearn.linear_model` module implements generalized linear models. It
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
estimators computed with Least Angle Regression and coordinate descent. It also
implements Stochastic Gradient Descent related algorithms.
"""
# See http://scikit-le... | bsd-3-clause |
ingted/crmsh | modules/ui_maintenance.py | 2 | 3723 | # Copyright (C) 2014 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
from . import command
from . import completers as compl
from .cibconfig import cib_factory
from . import utils
from . import xmlutil
_compl_actions = compl.choice(['start', 'stop', 'monitor', 'meta-data', 'validate-al... | gpl-2.0 |
julen/babel | babel/messages/jslexer.py | 162 | 5317 | # -*- coding: utf-8 -*-
"""
babel.messages.jslexer
~~~~~~~~~~~~~~~~~~~~~~
A simple JavaScript 1.5 lexer which is used for the JavaScript
extractor.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from operator import itemgetter
import re
from babel._co... | bsd-3-clause |
Bjwebb/pytest | testing/test_pdb.py | 30 | 8903 |
import py
import sys
def runpdb_and_get_report(testdir, source):
p = testdir.makepyfile(source)
result = testdir.runpytest_inprocess("--pdb", p)
reports = result.reprec.getreports("pytest_runtest_logreport")
assert len(reports) == 3, reports # setup/call/teardown
return reports[1]
class TestPDB:... | mit |
frreiss/tensorflow-fred | tensorflow/python/distribute/input_ops.py | 9 | 3990 | # 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 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/pytz-2014.4-py2.7.egg/pytz/exceptions.py | 657 | 1333 | '''
Custom exceptions raised by pytz.
'''
__all__ = [
'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError',
'NonExistentTimeError',
]
class UnknownTimeZoneError(KeyError):
'''Exception raised when pytz is passed an unknown timezone.
>>> isinstance(UnknownTimeZoneError(), LookupError)... | gpl-2.0 |
m0ppers/arangodb | 3rdParty/boost/1.61.0/libs/compatibility/generate_cpp_c_headers.py | 67 | 9123 | # This Python script creates a full set of C++ C header files that
# are missing on some platforms.
#
# Usage:
# mkdir cpp_c_headers
# cd cpp_c_headers
# python generate_cpp_c_headers.py
#
# The files created by this script are in the directory:
# root/boost/compatibility/cpp_c_headers
#
# Supported platforms:
... | apache-2.0 |
DiamondLightSource/auto_tomo_calibration-experimental | measure_resolution/lmfit-py/examples/confidence_interval.py | 4 | 2924 | # -*- coding: utf-8 -*-
"""
Created on Sun Apr 15 19:47:45 2012
@author: Tillsten
"""
import numpy as np
from lmfit import Parameters, Minimizer, conf_interval, report_fit, report_ci
from numpy import linspace, zeros, sin, exp, random, sqrt, pi, sign
from scipy.optimize import leastsq
try:
import matplotlib.pypl... | apache-2.0 |
SAAVY/magpie | client/blacklist.py | 1 | 1546 | from flask import current_app
from netaddr import IPNetwork, IPAddress
from netaddr.core import AddrFormatError
bl_website_ip = [] # array of tuples (network mask, port)
def build_website_blacklist(logger):
with open("config/blacklist_website_ip.txt") as f:
for line in f:
network_address = ... | mit |
mkoistinen/django-cms | cms/cache/page.py | 3 | 4437 | # -*- coding: utf-8 -*-
import hashlib
from datetime import timedelta
from django.conf import settings
from django.utils.cache import add_never_cache_headers, patch_response_headers, patch_vary_headers
from django.utils.encoding import iri_to_uri
from django.utils.timezone import now
from cms.cache import _get_cach... | bsd-3-clause |
wkentaro/chainer | tests/chainer_tests/functions_tests/array_tests/test_tile.py | 8 | 2118 | import unittest
import numpy
from chainer import functions
from chainer import testing
@testing.parameterize(*testing.product({
'in_shape': [(), 2, (2, 3)],
'reps': [(), 0, 2, (0, 0), (1, 2), (2, 2), (2, 0)],
'dtype': [numpy.float16, numpy.float32, numpy.float64],
}))
@testing.inject_backend_tests(
... | mit |
Jonekee/chromium.src | tools/memory_inspector/memory_inspector/frontends/background_tasks.py | 35 | 5318 | # 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.
"""Background tasks for the www_server module.
This module has the logic for handling background tasks for the www frontend.
Long term actions (like periodi... | bsd-3-clause |
jakobharlan/avango | avango-blender/blender-addon/nodes/light.py | 3 | 2009 | import bpy
from bpy.types import Node
from bpy.props import StringProperty
from .. import node_tree
class Light(Node, node_tree.AvangoCustomTreeNode):
bl_idname = 'Light'
bl_label = 'Light'
def update_name(self, context):
if self.referenced_object in bpy.data.objects:
bpy.data.object... | lgpl-3.0 |
Team-Cody/android_kernel_htc_pico | 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 |
8l/connectal | scripts/adb/adb_protocol.py | 3 | 13753 | # 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 by applicable law or a... | mit |
Dandandan/wikiprogramming | jsrepl/extern/python/closured/lib/python2.7/lib2to3/fixes/fix_idioms.py | 327 | 4889 | """Adjust some old Python 2 idioms to their modern counterparts.
* Change some type comparisons to isinstance() calls:
type(x) == T -> isinstance(x, T)
type(x) is T -> isinstance(x, T)
type(x) != T -> not isinstance(x, T)
type(x) is not T -> not isinstance(x, T)
* Change "while 1:" into "while True:".... | mit |
pycrystem/pycrystem | pyxem/tests/test_signals/test_power2d.py | 1 | 3662 | # -*- coding: utf-8 -*-
# Copyright 2017-2019 The pyXem developers
#
# This file is part of pyXem.
#
# pyXem 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 optio... | gpl-3.0 |
vvv1559/intellij-community | python/helpers/py3only/docutils/transforms/frontmatter.py | 44 | 19348 | # $Id: frontmatter.py 7595 2013-01-21 17:33:56Z milde $
# Author: David Goodger, Ueli Schlaepfer <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to tra... | apache-2.0 |
robertabbott/kubernetes | third_party/htpasswd/htpasswd.py | 897 | 5219 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Edgewall Software
# Copyright (C) 2008 Eli Carter
# 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://trac.edge... | apache-2.0 |
jerrylei98/Dailydos | venv/lib/python2.7/site-packages/pip/_vendor/lockfile/sqlitelockfile.py | 487 | 5540 | from __future__ import absolute_import, division
import time
import os
try:
unicode
except NameError:
unicode = str
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based locking."
testdb = None
def __init__(self, path, t... | mit |
j00bar/ansible | lib/ansible/modules/network/nxos/nxos_vrf_interface.py | 13 | 9494 | #!/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 |
polimediaupv/edx-platform | pavelib/utils/test/bokchoy_utils.py | 54 | 4800 | """
Helper functions for bok_choy test tasks
"""
import sys
import os
import time
import httplib
import subprocess
from paver.easy import sh
from pavelib.utils.envs import Env
from pavelib.utils.process import run_background_process
try:
from pygments.console import colorize
except ImportError:
colorize = lamb... | agpl-3.0 |
McGillX/edx_data_research | edx_data_research/parsing/parse_course_structure.py | 1 | 4815 | import json
from edx_data_research.parsing.parse import Parse
class CourseStructure(Parse):
def __init__(self, args):
super(CourseStructure, self).__init__(args)
self.collections = ['course_structure']
self.course_structure_file = args.course_structure_file
self.drop = a... | mit |
tiancj/emesene | emesene/e3/papylib/papyon/papyon/service/Spaces/scenario/base.py | 7 | 1059 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Youness Alaoui <kakaroto@users.sourceforge.net>
#
# 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 op... | gpl-3.0 |
lizardsystem/threedilib | threedilib/modeling/convert.py | 1 | 8275 | # (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
"""
Convert shapefiles with z coordinates. Choose from the following formats:
'inp' to create an inp file, 'img' to create an image with a plot of the
feature, or 'shp' to output a shapefile with the average height of a
feature stored in ... | gpl-3.0 |
robhudson/django | tests/forms_tests/tests/test_utils.py | 130 | 6239 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.test import SimpleTestCase
from django.utils import six
from django.utils.encoding import force_text, python_2_unicode... | bsd-3-clause |
skyddv/neutron | neutron/plugins/embrane/base_plugin.py | 42 | 17433 | # Copyright 2013 Embrane, 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 by... | apache-2.0 |
msmolens/VTK | ThirdParty/Twisted/twisted/trial/_dist/test/test_disttrial.py | 31 | 12392 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.trial._dist.disttrial}.
"""
import os
import sys
from cStringIO import StringIO
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.defer import fail, succeed
from twisted.internet.task import Coop... | bsd-3-clause |
bhairavmehta95/flashcard-helper-alexa-skill | venv/lib/python2.7/site-packages/pymysql/tests/test_connection.py | 20 | 24275 | import datetime
import sys
import time
import unittest2
import pymysql
from pymysql.tests import base
from pymysql._compat import text_type
class TempUser:
def __init__(self, c, user, db, auth=None, authdata=None, password=None):
self._c = c
self._user = user
self._db = db
create =... | mit |
holzenburg/feedshare | feedshare/feedlists/migrations/0002_auto__add_feedlistfeed__del_field_feed_feedlist__del_field_feed_tags__.py | 1 | 8074 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FeedListFeed'
db.create_table(u'feedlists_feedlistfeed', ... | mit |
RealP/Everpy | examples.py | 1 | 1776 | """Some examples of how to use modules."""
# from everpy_extras import EverPyExtras
from everpy_pro import EverPyPro
import everpy_utilities
PATH_TO_ENSCRIPT = r"C:\Program Files (x86)\Evernote\Evernote\ENScript.exe"
def createnote(epy):
"""Example of how to make a note from python."""
content = open("READM... | gpl-3.0 |
ujdhesa/unisubs | apps/auth/migrations/0016_auto__del_field_customuser_new_message_notification.py | 5 | 10227 | # encoding: 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):
# Deleting field 'CustomUser.new_message_notification'
db.delete_column('auth_customuser', 'new_messag... | agpl-3.0 |
MingdaZhou/gnuradio | gnuradio-runtime/python/gnuradio/gr_unittest.py | 58 | 6303 | #!/usr/bin/env python
#
# Copyright 2004,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 optio... | gpl-3.0 |
Stemer114/Reprap_KTY-84-130 | repetier/KTY84-130_repetier.py | 1 | 1879 | # based on python script from
# http://diyhpl.us/reprap/trunk/users/wizard23/python/lookupTables/KTY84-130.py
#
# adapted by Stemer114 for usage with 4.7k pull-up resistor
# table format for repetier firmware
# https://github.com/Stemer114/Reprap_KTY-84-130
#
# generates a Lookuptable for the following termistor
# KT... | mit |
collinjackson/mojo | tools/idl_parser/idl_ppapi_lexer.py | 81 | 2012 | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Lexer for PPAPI IDL
The lexer uses the PLY library to build a tokenizer which understands both
WebIDL and Pepper tokens.
WebI... | bsd-3-clause |
khushboo9293/Hyperkitty | hyperkitty/jobs/update_and_clean_index.py | 1 | 1238 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 by the Free Software Foundation, 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) ... | gpl-3.0 |
buuck/root | bindings/pyroot/JupyROOT/html/cpphighlighter.py | 40 | 2104 | """This preprocessor marks cell's metadata so that the appropriate
highlighter can be used in the `highlight` filter afterwards.
More precisely, the language of a cell is set to C++ in two scenarios:
- Python notebooks: cells with `%%cpp` magic extension.
- ROOT C++ notebooks: all cells.
This preprocessor relies on the... | lgpl-2.1 |
sirkubax/ansible-modules-extras | web_infrastructure/ejabberd_user.py | 108 | 7253 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013, Peter Sprygada <sprygada@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 version 3 of the License, or
# (at ... | gpl-3.0 |
cs411-entree-app/entree | entree_project/entree_project/urls.py | 1 | 1445 | """entree_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | apache-2.0 |
inclement/p4a-revamp-old | pythonforandroid/bootstraps/pygame/build/buildlib/jinja2.egg/jinja2/environment.py | 199 | 43213 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import *
from ... | mit |
peastman/msmbuilder | msmbuilder/tests/test_tpt.py | 9 | 8593 | from __future__ import print_function, division, absolute_import
import numpy as np
import numpy.testing as npt
from msmbuilder import tpt
from msmbuilder.msm import MarkovStateModel, BayesianMarkovStateModel
def test_paths():
net_flux = np.array([[0.0, 0.5, 0.5, 0.0, 0.0, 0.0],
[0.0, 0... | lgpl-2.1 |
mruse/wechatpy | tests/test_messages.py | 7 | 2687 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import unittest
import time
from datetime import datetime
class MessagesTestCase(unittest.TestCase):
def test_base_message(self):
from wechatpy.messages import TextMessage
timestamp = int(time.time())
msg = ... | mit |
Ruide/angr-dev | angr/angr/blade.py | 1 | 12198 | import networkx
import pyvex
from .slicer import SimSlicer
class Blade(object):
"""
Blade is a light-weight program slicer that works with networkx DiGraph containing CFGNodes.
It is meant to be used in angr for small or on-the-fly analyses.
"""
def __init__(self, graph, dst_run, dst_stmt_idx, d... | bsd-2-clause |
jasonseminara/OpenSourceFinal | myvenv/lib/python3.5/site-packages/django/contrib/auth/base_user.py | 282 | 4438 | """
This module allows importing AbstractBaseUser even when django.contrib.auth is
not in INSTALLED_APPS.
"""
from __future__ import unicode_literals
from django.contrib.auth import password_validation
from django.contrib.auth.hashers import (
check_password, is_password_usable, make_password,
)
from django.db imp... | mit |
40223142/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/importlib/_bootstrap.py | 623 | 63710 | """Core implementation of import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing ver... | gpl-3.0 |
garciaadrian/ECU | extern/clang-format/clang-format.py | 20 | 4659 | # This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
#
# The first line enables clang-fo... | bsd-3-clause |
chineyting/lab4-Info3180 | server/lib/werkzeug/contrib/securecookie.py | 318 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | apache-2.0 |
blomquisg/heat | heat/common/client.py | 1 | 21833 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack, LLC
# 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... | apache-2.0 |
brendandahl/servo | components/script/dom/bindings/codegen/parser/tests/test_overload.py | 134 | 2020 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestOverloads {
void basic();
void basic(long arg1);
boolean abitharder(TestOverloads foo);
boolean abitharder(boolean foo);
void abitharder(ArrayBuffer? foo);
};
""")
... | mpl-2.0 |
nlu90/heron | heronpy/streamlet/impl/joinbolt.py | 4 | 8539 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
Kriechi/mitmproxy | mitmproxy/addons/tlsconfig.py | 1 | 12516 | import os
from pathlib import Path
from typing import List, Optional, TypedDict, Any
from OpenSSL import SSL
from mitmproxy import certs, ctx, exceptions, connection
from mitmproxy.net import tls as net_tls
from mitmproxy.options import CONF_BASENAME
from mitmproxy.proxy import context
from mitmproxy.proxy.layers impo... | mit |
mydongistiny/external_chromium_org | tools/usb_gadget/mouse_gadget.py | 101 | 5065 | # 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.
"""Implementation of a USB HID mouse.
Two classes are provided by this module. The MouseFeature class implements
the core functionality of a HID mouse and c... | bsd-3-clause |
seet61/one | v2/requests/packages/urllib3/util/ssl_.py | 305 | 4235 | from binascii import hexlify, unhexlify
from hashlib import md5, sha1
from ..exceptions import SSLError
try: # Test for SSL features
SSLContext = None
HAS_SNI = False
import ssl
from ssl import wrap_socket, CERT_NONE, PROTOCOL_SSLv23
from ssl import SSLContext # Modern SSL?
from ssl import... | bsd-2-clause |
Carreau/difflib2.py | examples/lcs_cutmodule.py | 1 | 5199 | from __future__ import print_function
from array import array
from itertools import islice
def lcs_cut2(s1, s2, lcs_low_bound=0, bg=None, debug=False):
"""Compule the length of the LCS 2 sequences s1 and s2.
lcs_low_bound : (int), hint of lower bound for the lenght of the lcs
to search for. Default to... | bsd-3-clause |
kartvep/Combaine | combaine/common/configloader/config.py | 1 | 2022 | import yaml
import json
import os
from functools import partial
from combaine.common.loggers import CommonLogger
from combaine.common import constants
__all__ = ["FormatError", "MissingConfigError", "parse_agg_cfg", "parse_parsing_cfg", "parse_common_cfg"]
class ConfigError(Exception):
pass
class FormatError(C... | lgpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/pickleshare.py | 12 | 9849 | #!/usr/bin/env python
""" PickleShare - a small 'shelve' like datastore with concurrency support
Like shelve, a PickleShareDB object acts like a normal dictionary. Unlike
shelve, many processes can access the database simultaneously. Changing a
value in database is immediately visible to other processes accessing the... | bsd-3-clause |
edwards-lab/MVtest | tests/test_cmdline.py | 1 | 17297 | #!/usr/bin/env python
import sys
# For debug, preference local install over all else
if "DEBUG" in sys.argv:
sys.path.insert(0, "../")
sys.path.insert(0, "../../") # For mvtest
sys.path.insert(0, ".")
sys.argv.remove("DEBUG")
import numpy
import os
import mvtest
import unittest
import test_analyze_tped... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.