code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
import os
import platform
from spack import *
from spack... | LLNL/spack | var/spack/repos/builtin/packages/nvhpc/package.py | Python | lgpl-2.1 | 12,661 |
# -*- coding: utf-8 -*-
#
# pyblock documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 24 18:28:48 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | hande-qmc/hande | tools/pyblock/docs/conf.py | Python | lgpl-2.1 | 8,844 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/libsplash/package.py | Python | lgpl-2.1 | 3,176 |
##! /usr/bin/env python
# _*_ coding: latin-1 _*_
import jtdialog
import jttoolbar
import jthglue
import jtpush
import jttextarea
def jtmemoedit(t=None,l=None,b=None,r=None,text="",editable=1):
dlg=jtdialog.new(t,l,b,r)
dlg.layout="vbox"
bar=jttoolbar.new()
bar.additem(jthglue.new())
... | mrev11/ccc3 | jt/jtpython/jtlib/jtmemo.py | Python | lgpl-2.1 | 985 |
'''
Created on 27 janv. 2015
@author: Remi Cattiau
'''
from PyQt4 import QtGui, QtCore
from nxdrive.logging_config import get_logger
from nxdrive.wui.dialog import WebDialog, WebDriveApi
from nxdrive.wui.translator import Translator
from nxdrive.osi import AbstractOSIntegration
log = get_logger(__name__)
class Drive... | DirkHoffmann/nuxeo-drive | nuxeo-drive-client/nxdrive/wui/systray.py | Python | lgpl-2.1 | 9,800 |
#! /usr/bin/env python
#
# SCons - a Software Constructor
#
# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
#
# 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, ... | bilke/OpenSG-1.8 | SConsLocal/scons.py | Python | lgpl-2.1 | 5,103 |
# Copyright Cartopy Contributors
#
# This file is part of Cartopy and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
import copy
from io import BytesIO
import os
from pathlib import Path
import pickle
import numpy as np
from numpy.testi... | SciTools/cartopy | lib/cartopy/tests/test_crs.py | Python | lgpl-3.0 | 12,418 |
import re
import os
import pyblish.api
class ValidateFilename(pyblish.api.Validator):
"""
"""
families = ['filename']
hosts = ['maya', 'modo']
version = (0, 1, 0)
pattern = re.compile('(.+)\.([a-z]+)\.([v])([0-9]{3})\.([a-z]+)')
def process_context(self, context):
"""
"""... | ProgressiveFX/pyblish-pfx | pyblish_pfx/plugins/todo/validate_filename.py | Python | lgpl-3.0 | 497 |
# Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt5.QtCore import pyqtSlot, pyqtProperty, QObject, pyqtSignal, QRegExp
from PyQt5.QtGui import QValidator
import os #For statvfs.
import urllib #To escape machine names for how they're saved to file.
from UM.Resourc... | Patola/Cura | cura/Settings/MachineNameValidator.py | Python | lgpl-3.0 | 3,304 |
#!/usr/bin/env python
# Test focusing infrastrucure
import rts2.focusing
import sys
from astropy.io import fits
from scipy import *
from matplotlib.pyplot import *
tries = {}
for fn in sys.argv[1:]:
ff = fits.open(fn)
focpos=len(tries)
try:
focpos=float(ff[0].header['FOC_POS'])
except KeyError,ke:
pass
tr... | jstrobl/rts2 | scripts/test_focusing.py | Python | lgpl-3.0 | 544 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.5
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | mohseniaref/six-library | modules/python/cphd/source/generated/cphd.py | Python | lgpl-3.0 | 124,977 |
#!/usr/bin/env python3
#
# Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
... | JonatanAntoni/CMSIS_5 | CMSIS/NN/Tests/UnitTest/unittest_targets.py | Python | apache-2.0 | 16,995 |
# Copyright (c) 2019 PaddlePaddle 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 app... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_square_error_cost.py | Python | apache-2.0 | 2,530 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Cloudscaling Group, 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/LI... | tucbill/manila | manila/openstack/common/rpc/impl_zmq.py | Python | apache-2.0 | 27,345 |
#!/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 Licens... | apache/cloudstack-gcestack | tests/discovery_tests.py | Python | apache-2.0 | 1,053 |
# Copyright (c) 2016 Presslabs SRL
#
# 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... | PressLabs/silver | silver/models/billing_entities/__init__.py | Python | apache-2.0 | 703 |
# Copyright (c) 2018 PaddlePaddle 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 app... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_dequantize_abs_max_op.py | Python | apache-2.0 | 2,153 |
# 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... | zhreshold/mxnet | example/ssd/train/metric.py | Python | apache-2.0 | 2,920 |
# 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... | frreiss/tensorflow-fred | tensorflow/python/autograph/pyct/error_utils.py | Python | apache-2.0 | 7,465 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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 ... | opveclib/opveclib | opveclib/test/test_gradients.py | Python | apache-2.0 | 3,897 |
# Copyright 2014-2018 The PySCF Developers. 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 appl... | sunqm/pyscf | pyscf/pbc/mpitools/mpi_helper.py | Python | apache-2.0 | 3,158 |
#!/usr/bin/env python
#
# Copyright 2013 Dominic LoBue
#
# 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 a... | dlobue/chef-solo-client | cookbooks/solo_client/files/default/delete_sdb_record.py | Python | apache-2.0 | 2,551 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the ... | gaolichuang/py-essential | essential/rpc/__init__.py | Python | apache-2.0 | 10,495 |
from __future__ import absolute_import, unicode_literals
import pytest
from case import Mock, patch, skip
from celery.exceptions import ImproperlyConfigured
from celery.worker.components import Beat, Hub, Pool, Timer
# some of these are tested in test_worker, so I've only written tests
# here to complete coverage. ... | cloudera/hue | desktop/core/ext-py/celery-4.2.1/t/unit/worker/test_components.py | Python | apache-2.0 | 2,493 |
import django.dispatch
from django.apps import apps
from django.dispatch.dispatcher import NO_RECEIVERS
from .models import Event
class EventPluginSignal(django.dispatch.Signal):
"""
This is an extension to Django's built-in signals which differs in a way that it sends
out it's events only to receivers w... | akuks/pretix | src/pretix/base/signals.py | Python | apache-2.0 | 3,146 |
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | dougwig/x-neutron-lbaas | neutron_lbaas/openstack/common/versionutils.py | Python | apache-2.0 | 7,332 |
#!/usr/bin/env python
# Copyright 2010 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 ... | rbruyere/appengine-mapreduce | python/test/mapreduce gcs/mapreduce/cloudstorage_compose_stub.py | Python | apache-2.0 | 6,202 |
# -*- coding: utf-8 -*-
from . import db
from .mail import MailQueue
import logging
from Queue import Queue
import subprocess
from threading import Thread
import time
from pushmanager.core.util import add_to_tags_str
from pushmanager.core.util import del_from_tags_str
from pushmanager.core.util import EscapedDict
from ... | asottile/pushmanager | pushmanager/core/git.py | Python | apache-2.0 | 13,241 |
# Copyright 2015-2018 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | Sutto/cloud-custodian | tools/c7n_azure/c7n_azure/output.py | Python | apache-2.0 | 7,167 |
from functools import partial
from random import shuffle
import pytest
from plenum.common.constants import VALIDATOR, POOL_LEDGER_ID, TYPE, NODE, DATA, ALIAS, CLIENT_IP, CLIENT_PORT, NODE_IP, \
NODE_PORT, BLS_KEY, TARGET_NYM, SERVICES, CURRENT_PROTOCOL_VERSION, DOMAIN_LEDGER_ID
from plenum.common.messages.interna... | evernym/zeno | plenum/test/consensus/order_service/test_sim_ordering_node_txn.py | Python | apache-2.0 | 16,153 |
# -*- encoding: utf-8 -*-
#
# Copyright 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
#
# ... | CiscoUcs/Ironic | ironic/drivers/pxe.py | Python | apache-2.0 | 11,508 |
# Copyright (c) 2020 Dell Inc. or its subsidiaries.
# 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
#
# ... | openstack/cinder | cinder/tests/unit/volume/drivers/dell_emc/powermax/test_powermax_migrate.py | Python | apache-2.0 | 26,942 |
# Autor: Alexander Herbrich
# Wann: 30.01.2016
# Thema: Errechnen von Summen nach Gauss
def summe(n):
s = 0
while n > 0:
s = s + n
n = n - 1
return s
def g_summe(n):
s = 0
while n > 0:
if (n % 2) == 0:
s = s + n
n = n - 1
return s
def ug_summe(n):
... | phy234/FirstPythonSteps | Summe.py | Python | apache-2.0 | 626 |
# 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/airflow | tests/models/test_trigger.py | Python | apache-2.0 | 7,246 |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | GoogleCloudPlatform/public-datasets-pipelines | datasets/bls/pipelines/unemployment_cps_series/unemployment_cps_series_dag.py | Python | apache-2.0 | 6,297 |
from hazelcast.serialization.bits import *
from hazelcast.protocol.client_message import ClientMessage
from hazelcast.protocol.custom_codec import *
from hazelcast.util import ImmutableLazyDataList
from hazelcast.protocol.codec.client_message_type import *
REQUEST_TYPE = CLIENT_AUTHENTICATIONCUSTOM
RESPONSE_TYPE = 107... | cangencer/hazelcast-python-client | hazelcast/protocol/codec/client_authentication_custom_codec.py | Python | apache-2.0 | 2,558 |
# Copyright 2016 Intel Corporation
#
# 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... | brainiak/brainiak | brainiak/fcma/mvpa_voxelselector.py | Python | apache-2.0 | 4,426 |
#
# 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... | shakamunyi/beam | sdks/python/apache_beam/examples/cookbook/datastore_wordcount.py | Python | apache-2.0 | 10,720 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | dims/oslo.messaging | oslo_messaging/tests/functional/test_functional.py | Python | apache-2.0 | 12,459 |
# Copyright (c) 2013 Hortonworks, 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 ... | zhangjunli177/sahara | sahara/utils/openstack/neutron.py | Python | apache-2.0 | 3,615 |
import urllib
import requests
import datetime
import json
import xml.etree.ElementTree as ET
from pymongo import MongoClient
namespaces = {'cf': 'http://ns.medbiq.org/competencyframework/v1/',
'lom': 'http://ltsc.ieee.org/xsd/LOM'}
mongo = MongoClient()
db = mongo.compapp
# same comp could be in more than
# one... | adlnet-archive/competency-example | util/__init__.py | Python | apache-2.0 | 9,086 |
#!/usr/bin/env python
#6. Write a Python program that creates a list. One of the elements of the list should be a dictionary with at least two keys. Write this list out to a file using both YAML and JSON formats. The YAML file should be in the expanded form.
import yaml
import json
my_list = range(10)
my_list.append... | joeyb182/pynet_ansible | yaml_json.py | Python | apache-2.0 | 629 |
#!/usr/bin/env vpython3
# Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import logging
import math
import os
import platform
import re
import shutil
import socket
import subprocess
import sys
im... | luci/luci-py | appengine/swarming/swarming_bot/api/os_utilities_test.py | Python | apache-2.0 | 11,209 |
# (c) Copyright 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
#
# Unless re... | github-borat/cinder | cinder/brick/initiator/linuxscsi.py | Python | apache-2.0 | 7,104 |
#!/usr/bin/env python
#
# Copyright (C) 2013-2014 eNovance SAS <licensing@enovance.com>
#
# Author: Frederic Lepied <frederic.lepied@enovance.com>
#
# 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... | redhat-cip/edeploy | server/upload.py | Python | apache-2.0 | 11,493 |
"""Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2015 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | agentr13/python-phonenumbers | python/phonenumbers/geodata/data9.py | Python | apache-2.0 | 912,871 |
# Copyright (c) 2014 Red Hat.
#
# 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, ... | paramite/blazar | climate/states.py | Python | apache-2.0 | 3,226 |
# -*- coding: utf-8 -*-
from django.db import models
# Create your models here.
class OperateRecord(models.Model):
'''
记录用户操作信息;
'''
nowtime = models.DateTimeField(blank=True, null=True, verbose_name=u'操作时间')
username = models.CharField(max_length=20, blank=True, verbose_name=u'用户名')
user_oper... | yaoice/dzhops | record/models.py | Python | apache-2.0 | 1,660 |
# Copyright (c) 2015 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 ... | waltBB/neutron_read | neutron/agent/l3/dvr_router.py | Python | apache-2.0 | 22,997 |
# Copyright 2015 Alex Meade
#
# 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 ... | jcsp/manila | manila/tests/share/test_rpcapi.py | Python | apache-2.0 | 9,978 |
from indy import IndyError
from indy import payment
from indy.error import ErrorCode
from tests.payment.constants import *
import pytest
@pytest.mark.asyncio
async def test_build_mint_request_works_for_unknown_payment_method(wallet_handle, did_trustee):
with pytest.raises(IndyError) as e:
await payment.b... | srottem/indy-sdk | wrappers/python/tests/payment/test_build_mint_request.py | Python | apache-2.0 | 1,071 |
# Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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 ... | hewlettpackardlabs/opveclib | lstm/profile_lstm.py | Python | apache-2.0 | 10,580 |
# 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 use ... | apache/libcloud | libcloud/test/loadbalancer/test_elb.py | Python | apache-2.0 | 9,865 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sensitivity', '0014_auto_20171113_1827'),
]
operations = [
migrations.AlterModelOptions(
name='sensitivearea',
options={'verbose_name': 'Sensitive area', 'verbose_name_plura... | makinacorpus/Geotrek | geotrek/sensitivity/migrations/0015_auto_20180206_1238.py | Python | bsd-2-clause | 434 |
import unittest
from streamlink.plugins.idf1 import IDF1
class TestPluginIDF1(unittest.TestCase):
def test_can_handle_url(self):
# should match
self.assertTrue(IDF1.can_handle_url("http://www.idf1.fr/live"))
self.assertTrue(IDF1.can_handle_url("http://www.idf1.fr/videos/jlpp/best-of-2018-... | javiercantero/streamlink | tests/test_plugin_idf1.py | Python | bsd-2-clause | 872 |
#!/usr/bin/env python
'''======================================================
Created by: D. Spencer Maughan
Last updated: February 2015
File name: Inverted_Pendulum_Sim.py
Organization: RISC Lab, Utah State University
======================================================'''
import roslib; ro... | riscmaster/risc_maap | risc_simulator/src/Inverted_Pendulum_Sim.py | Python | bsd-2-clause | 4,691 |
# -*- coding: UTF-8 -*-
# Copyright 2002-2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""The :mod:`lino_book` package contains a set of example projects
used both for testing and explaining Lino framework.
It is not published on PyPI because that would make no sense. You use it by
cloning the re... | lino-framework/book | lino_book/__init__.py | Python | bsd-2-clause | 990 |
# 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 th... | klim-iv/phantomjs-qt5 | src/webkit/Tools/Scripts/webkitpy/tool/steps/checkstyle.py | Python | bsd-3-clause | 2,913 |
#!/usr/bin/env vpython3
# Copyright 2020 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 six
import sys
import unittest
import zipfile
import mock # pylint: disable=import-error
from mock imp... | nwjs/chromium.src | android_webview/tools/update_cts_test.py | Python | bsd-3-clause | 16,968 |
"""
Test functions for stats module
"""
import warnings
import re
import sys
import pickle
from pathlib import Path
import os
import json
import platform
from numpy.testing import (assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal,
as... | tylerjereddy/scipy | scipy/stats/tests/test_distributions.py | Python | bsd-3-clause | 259,727 |
# -*- coding: utf-8 -*-
#
# Virtual Watershed Documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 16 16:02:33 2015.
#
# 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
# a... | VirtualWatershed/virtualwatershed.github.io | source/conf.py | Python | bsd-3-clause | 11,125 |
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
import numpy as np
import scipy as sp
from scipy import ndimage
from scipy.sparse.csgraph import connected_components
import pytest
from sklearn.feature_extraction.im... | scikit-learn/scikit-learn | sklearn/feature_extraction/tests/test_image.py | Python | bsd-3-clause | 11,743 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from django.conf import settings
from django.test.utils import override_settings
from machina.core.db.models import get_model
from machina.core.loading import AppNotFoundError
from machina.core.loading import ClassNotFoundError
from machin... | reinbach/django-machina | tests/unit/core/test_loading.py | Python | bsd-3-clause | 3,737 |
import re
import warnings
import gsw
import numpy as np
import numpy.ma as ma
def spdir2uv(spd, ang, deg=False):
"""
Computes u, v components from speed and direction.
Parameters
----------
spd : array_like
speed [m s :sup:`-1`]
ang : array_like
direction [deg]
deg : ... | pyoceans/python-oceans | oceans/ocfis.py | Python | bsd-3-clause | 20,695 |
# $Id$
#
# Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
from rdkit import Geome... | rdkit/rdkit-orig | rdkit/Chem/Pharm3D/Pharmacophore.py | Python | bsd-3-clause | 5,924 |
from social.backends.open_id import OpenIdAuth
class BelgiumEIDOpenId(OpenIdAuth):
"""Belgium e-ID OpenID authentication backend"""
name = 'belgiumeid'
URL = 'https://www.e-contract.be/eid-idp/endpoints/openid/auth'
| nvbn/python-social-auth | social/backends/belgiumeid.py | Python | bsd-3-clause | 230 |
"""
Example 10
++++++++++
Retrieve Hubble archival data of M83 and make a figure
"""
from astropy.io import fits
from astropy.visualization import make_lupton_rgb, ImageNormalize
import matplotlib.pyplot as plt
import reproject
from astroquery.mast import Observations
result = Observations.query_object('M83')
select... | imbasimba/astroquery | docs/gallery-examples/example10_mast.py | Python | bsd-3-clause | 1,562 |
# -*- coding: utf-8 -*-
"""
__init__.py
"""
from trytond.pool import Pool
from carrier import Carrier, TestConnection, TestConnectionStart
from party import Address
from shipment import ShipmentOut, GenerateShippingLabel, ShippingDPD, Package
from sale import Sale, SaleConfiguration
def register():
Pool.regi... | fulfilio/trytond-shipping-dpd | __init__.py | Python | bsd-3-clause | 667 |
#!/usr/bin/env python
# Copyright 2015 The PDFium 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 datetime
import glob
import os
import re
import subprocess
import sys
def os_name():
if sys.platform.startswith('linux'):
... | endlessm/chromium-browser | third_party/pdfium/testing/tools/common.py | Python | bsd-3-clause | 5,423 |
# -*- coding: utf-8 -*-
import json
import shutil
from os.path import join
from cms.api import add_plugin, create_page
from cms.utils.conf import get_cms_setting
from cms.utils.urlutils import admin_reverse
from djangocms_text_ckeditor.models import Text
from django.conf import settings
from django.contrib import adm... | keimlink/django-cms | cms/tests/test_reversion_tests.py | Python | bsd-3-clause | 29,363 |
from django.utils.translation import ugettext_lazy as _
from django.forms.forms import NON_FIELD_ERRORS
from django.forms.util import ErrorDict
class V(object):
"""
A validator object (similar to the ORM's Q object) with the ability to OR
and AND.
Eg:
V(some_validator(...)) | V(some_oth... | ojii/django-sitepermissions | sitepermissions/validators.py | Python | bsd-3-clause | 4,078 |
import math
import random
def gengrid(step, xcount, ycount):
step = int(step)
xcount = int(xcount)
ycount = int(ycount)
points = []
for xcoord in range(xcount):
for ycoord in range(ycount):
point = (xcoord*step,ycoord*step, 0)
points.append(point)
return(points)
def gengrid_ratio(step, ratio, count):
s... | bluerover/6lbr | examples/6lbr/test/coojagen/src/generators.py | Python | bsd-3-clause | 2,633 |
# carlos@lacnic.net 20121128
# version 0.1
#===============================================================================
# Copyright (c) 2012 LACNIC - Latin American and Caribbean Internet
# Address Registry
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and as... | carlosm3011/rir-stats-tools | lib/commons/dprint.py | Python | bsd-3-clause | 2,482 |
# -*- coding: utf-8 -*-
#
# python-amazon-product-api documentation build configuration file, created by
# sphinx-quickstart on Fri Nov 11 19:21:34 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
# autogener... | prats226/python-amazon-product-api-0.2.8 | docs/source/conf.py | Python | bsd-3-clause | 9,578 |
import pyCiscoSpark
import sys
def search (values, searchFor):
for k in values["items"]:
print (k["title"])
if (k["title"] == searchFor) : return k["id"]
return None
at="Bearer "+str(sys.argv[1])
name="New messages in Room XYZ"
targetUrl="http://YOURIPorURL/ciscospark.php"
resource="messages"... | gmartinez3/Spark-Bot | createwebhook.py | Python | mit | 445 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dialogos.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| bertucho/moviestalk2 | dialogos/manage.py | Python | mit | 257 |
# Stop words
STOP_WORDS = set(
"""
ஒரு
என்று
மற்றும்
இந்த
இது
என்ற
கொண்டு
என்பது
பல
ஆகும்
அல்லது
அவர்
நான்
உள்ள
அந்த
இவர்
என
முதல்
என்ன
இருந்து
சில
என்
போன்ற
வேண்டும்
வந்து
இதன்
அது
அவன்
தான்
பலரும்
என்னும்
மேலும்
பின்னர்
கொண்ட
இருக்கும்
தனது
உள்ளது
போது
என்றும்
அதன்
தன்
பிறகு
அவர்கள்
வரை
அவள்
நீ
ஆகிய
இருந்தது
உள்... | explosion/spaCy | spacy/lang/ta/stop_words.py | Python | mit | 2,018 |
from ...attrs import LIKE_NUM
_num_words = set(
"""
zero unu doi două trei patru cinci șase șapte opt nouă zece
unsprezece doisprezece douăsprezece treisprezece patrusprezece cincisprezece șaisprezece șaptesprezece optsprezece nouăsprezece
douăzeci treizeci patruzeci cincizeci șaizeci șaptezeci optzeci nouăzeci
s... | spacy-io/spaCy | spacy/lang/ro/lex_attrs.py | Python | mit | 1,680 |
import unittest, tempfile, os
from pychemy.peptide_sets import *
import random
import numpy as np
AA_dict = {1:'A', 2:'C', 3:'D', 4:'E', 5:'F', 6:'G', 7:'H', 8:'I', 9:'L', 10:'K',
11:'M', 12:'N', 13:'P', 14:'Q', 15:'R', 16:'S', 17:'T', 18:'V', 19:'W', 20:'Y'}
def gen_protein(num_AA = 20):
out = ''
for... | ginkgobioworks/pychemy | tests/test_peptide_sets.py | Python | mit | 10,938 |
import random
from dice import d, xdy
class Character(object):
def __init__(self):
attributes = [6, 8, 10, 12]
random.shuffle(attributes)
self.str = attributes[0]
self.sta = attributes[1]
self.agi = attributes[2]
self.int = attributes[3]
self.calling... | liorvh/randomcharacter | adventuregame.py | Python | mit | 11,283 |
#!/usr/bin/env python
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Govern... | wawiesel/BootsOnTheGround | external/TriBITS/tribits/dashboard_driver/tdd_driver.py | Python | mit | 9,538 |
# -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... | kotnik/nikola | nikola/plugins/compile_bbcode.py | Python | mit | 2,812 |
# -*- coding: utf-8 -*-
"""
Calculates the temperature at a given r for a power law:
T = T0(r/r0)^Tpower
If r_in has no units, au are assumed
Created on Wed Jan 29 13:20:04 2014
@author: ibackus
"""
import numpy as np
import pynbody
SimArray = pynbody.array.SimArray
import isaac
class T:
"""
Calculates t... | dflemin3/ICgen | calc_temp.py | Python | mit | 2,778 |
"""
Copyright (c) 2016 Keith Sterling
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute,... | dkamotsky/program-y | src/programy/parser/template/nodes/think.py | Python | mit | 1,804 |
"""
2D rendering framework
"""
from __future__ import division
import os
import six
import sys
if "Apple" in sys.version:
if 'DYLD_FALLBACK_LIBRARY_PATH' in os.environ:
os.environ['DYLD_FALLBACK_LIBRARY_PATH'] += ':/usr/lib'
# (JDS 2016/04/15): avoid bug on Anaconda 2.3.0 / Yosemite
from gym.utils... | machinaut/gym | gym/envs/classic_control/rendering.py | Python | mit | 10,637 |
import numpy as np
import pandas
import matplotlib.pyplot as plt
def entries_histogram(turnstile_weather):
'''
Before we perform any analysis, it might be useful to take a
look at the data we're hoping to analyze. More specifically, lets
examine the hourly entries in our NYC subway data and determine ... | KellyChan/python-examples | python/data_science/NYC/analysis1_entries_histogram.py | Python | mit | 1,545 |
"""
Common Exception and Error classes.
"""
class InputError(Exception):
"""Exception raised for errors in the input.
I assume this is what DBG wanted in d922023e8a1d4e7757bfa3e68aba3ace89f2a749.
Attributes:
msg -- explanation of the error
"""
def __init__(self, msg):
self.msg =... | woodymit/millstone_accidental_source | genome_designer/main/exceptions.py | Python | mit | 419 |
from pyquark.arduino import *
import logging
if __name__ == '__main__':
log = logging.getLogger('pyquark')
log.setLevel(logging.INFO)
pinMode(10, OUTPUT)
pinMode(11, OUTPUT)
digitalWrite(10, HIGH)
digitalWrite(11, LOW)
delay(1000)
digitalWrite(10, LOW) | rli9/pygalileo | example/arduino_blink.py | Python | mit | 289 |
import unittest
from PyFoam.Infrastructure.RunHooks.WriteToSqliteDatabase import WriteToSqliteDatabase
theSuite=unittest.TestSuite()
| Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam | unittests/Infrastructure/RunHooks/test_WriteToSqliteDatabase.py | Python | gpl-2.0 | 135 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 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,... | jmacmahon/invenio | modules/bibedit/lib/bibeditcli.py | Python | gpl-2.0 | 10,744 |
import sys
import os
import json
import glob
sys.path.append(
os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'../python/ext-libs'))
from six import string_types
cpp = open(sys.argv[1], "w")
cpp.write(
"#include \"qgsexpression.h\"\n"
"\n"
"QHash<QString, QgsExpression::Hel... | NINAnor/QGIS | scripts/process_function_template.py | Python | gpl-2.0 | 4,104 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-02 05:59
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.management import create_permissions
import logging
logger ... | Krienas/allianceauth | allianceauth/services/modules/market/migrations/0002_service_permissions.py | Python | gpl-2.0 | 2,153 |
#!/usr/bin/env/python
"""
make_enum.py -- make enumerations for grants
"""
from datetime import datetime
from pump.vivopump import get_parms, create_enum
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2016 (c) Michael Conlon"
__license__ = "BSD 3-Clause license"
__version__ = "0.1.1"
def main():
... | dofeldsc/vivo_uos | pump_examples/grants/make_enum.py | Python | gpl-3.0 | 2,063 |
"""
Wraps various asyncio functions
"""
import asyncio
import sys
from functools import partial
from cloudbot.util.func_utils import call_with_args
def wrap_future(fut, *, loop=None):
"""
Wraps asyncio.ensure_future()
:param fut: The awaitable, future, or coroutine to wrap
:param loop: The loop to r... | linuxdaemon/CloudBot | cloudbot/util/async_util.py | Python | gpl-3.0 | 1,701 |
# rodc related commands
#
# Copyright Andrew Tridgell 2010
#
# 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 pr... | freenas/samba | python/samba/netcmd/rodc.py | Python | gpl-3.0 | 5,899 |
# coding=utf-8
"""ra_bmp"""
from ._commandbase import RadianceCommand
import os
from ..parameters.raBmp import RaBmpParameters
from ..datatype import RadiancePath
class RaBmp(RadianceCommand):
input_hdr_file = RadiancePath('inputHdr', 'inputHDR file')
output_bmp_file = RadiancePath('outputBmp', 'output TIFF ... | ladybug-analysis-tools/honeybee | honeybee_plus/radiance/command/raBmp.py | Python | gpl-3.0 | 1,748 |
"""Create tables
Revision ID: 1bd6c5129d29
Revises: None
Create Date: 2014-09-29 15:24:03.369025
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql.ddl import CreateSchema, DropSchema
from indico.core.db.sqlalchemy import UTCDateTime
# revision identifiers, used by Alembic.
revision = '1bd6c512... | pferreir/indico-plugins | chat/indico_chat/migrations/201409291524_1bd6c5129d29_create_tables.py | Python | gpl-3.0 | 2,447 |
#!/usr/bin/env python
#********************************************************************
# Filename: utils.py
# Authors: Daniel Sisco
# Date Created: 1-22-2008
#
# Abstract: A collection of utilities for the Fin-ally project. This
# file should include most generic utilities. Examples include ... | tectronics/fin-ally | utils.py | Python | gpl-3.0 | 3,447 |
#! /usr/bin/env python
import sys, shutil
from numpy import *
from os import path, makedirs
from glob import glob
import subprocess
class color:
"""
define colors in the terminal
"""
purple = '\033[95m'
cyan = '\033[96m'
darkcyan = '\033[36m'
blue = '\033[94m'
green = '\033[92m'
ye... | chunshen1987/superMC | scripts/generate_3d_profiles/generate_ebe_3d_profiles.py | Python | gpl-3.0 | 7,993 |
#!/usr/bin/python
# Copyright: (c)2012 Ardavon Falls
#
# This file is part of xsd-tools.
#
# xsd-tools is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | Ardy123/xsd-tools | test/java-json.org-test.py | Python | gpl-3.0 | 6,532 |