code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/python3
# Thanks to the GNOME theme nerds for the original source of this script
import os
import sys
import xml.sax
import subprocess
INKSCAPE = '/usr/bin/inkscape'
OPTIPNG = '/usr/bin/optipng'
MAINDIR = '../EvoPop'
SRC = os.path.join('.', 'gtk3')
inkscape_process = None
def optimize_png(png_file):
... | solus-cold-storage/evopop-gtk-theme | src/render-gtk3-assets.py | Python | gpl-3.0 | 5,791 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | wrouesnel/ansible | lib/ansible/modules/network/aci/aci_epg_monitoring_policy.py | Python | gpl-3.0 | 6,703 |
from __future__ import print_function
import numpy as np
np.random.seed(42)
complex_numbers = np.random.random(5) + 1j * np.random.random(5)
print("Complex numbers\n", complex_numbers)
print("Sorted\n", np.sort_complex(complex_numbers))
| moonbury/notebooks | github/Numpy/Chapter7/sortcomplex.py | Python | gpl-3.0 | 239 |
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | pymedusa/Medusa | ext/github/UserKey.py | Python | gpl-3.0 | 4,770 |
"""CLI tests for ``katello-agent``.
:Requirement: Host
:CaseAutomation: Automated
:CaseLevel: Component
:CaseComponent: Katello-agent
:Assignee: gtalreja
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import time
import pytest
from broker import VMBroker
from robottelo.api.utils import wait_for... | rplevka/robottelo | tests/foreman/cli/test_katello_agent.py | Python | gpl-3.0 | 11,288 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | jocave/snapcraft | snapcraft/plugins/nodejs.py | Python | gpl-3.0 | 4,091 |
# -*- coding: utf-8 -*-
# An entirely untested jython script to delete all the concepts in the
# CATMAID database for a particular project.
#
# Mark Longair 2010
#
# flake8: noqa
import os, re, sys, ij
from jarray import array
from java.sql import DriverManager, Connection, SQLException, Types
# Set up the JDBC con... | catmaid/CATMAID | scripts/experiment/remove_concepts_after.py | Python | gpl-3.0 | 3,982 |
import os
from pathlib import Path
import larray as la
_TEST_DIR = Path(__file__).parent / 'tests'
EXAMPLE_FILES_DIR = _TEST_DIR / 'data'
AVAILABLE_EXAMPLE_DATA = {
'demography': EXAMPLE_FILES_DIR / 'demography.h5',
'demography_eurostat': EXAMPLE_FILES_DIR / 'demography_eurostat.h5'
}
EXAMPLE_EXCEL_TEMPLATE... | liam2/larray | larray/example.py | Python | gpl-3.0 | 3,569 |
# This file is part of Pyphen
#
# Copyright 2008 - Wilbert Berendsen <info@wilbertberendsen.nl>
# Copyright 2012-2013 - Guillaume Ayoub <guillaume.ayoub@kozea.fr>
#
# This library is free software. It is released under the
# GPL 2.0+/LGPL 2.1+/MPL 1.1 tri-license. See COPYING.GPL, COPYING.LGPL and
# COPYING.MPL for m... | aESeguridad/GERE | venv/lib/python2.7/site-packages/pyphen/__init__.py | Python | gpl-3.0 | 10,375 |
# coding=utf-8
"""Module of Data Types (eg. Temperature, Area, etc.)
Possesses capabilities for unit conversions and range checks.
It also includes descriptions of the data types and the units.
Properties:
TYPES: A tuple indicating all currently supported data types.
BASETYPES: A tuple indicating all base ty... | ladybug-analysis-tools/ladybug-core | ladybug/datatype/__init__.py | Python | gpl-3.0 | 901 |
#!/usr/bin/env python
# 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/.
# Copyright (c) 2017 Mozilla Corporation
from elasticsearch_dsl import Q
def ExistsMatch(field... | gdestuynder/MozDef | mozdef_util/mozdef_util/query_models/exists_match.py | Python | mpl-2.0 | 369 |
import pytest
from umodbus import conf
from umodbus.client import tcp
@pytest.fixture(scope='module', autouse=True)
def enable_signed_values(request):
""" Use signed values when running tests it this module. """
tmp = conf.SIGNED_VALUES
conf.SIGNED_VALUES = True
def fin():
conf.SIGNED_VALUES... | AdvancedClimateSystems/python-modbus | tests/system/responses/test_succesful_responses.py | Python | mpl-2.0 | 2,290 |
# -*- coding: utf-8 -*-
from django.utils.translation import ugettext_lazy as _
a = _("My last changes")
a = _("All last changes")
a = _("My searches")
a = _("Children")
a = _("pattern")
| ANR-kamoulox/Telemeta | telemeta/util/locale_fix.py | Python | agpl-3.0 | 189 |
# -*- coding: utf-8 -*-
#
# Copyright 2016 Taŭga Tecnologia
# Aristides Caldeira <aristides.caldeira@tauga.com.br>
# License AGPL-3 or later (http://www.gnu.org/licenses/agpl)
#
from __future__ import division, print_function, unicode_literals
from odoo import fields, models
from odoo.addons.l10n_br_base.models.spe... | odoo-brazil/l10n-brazil-wip | sped/models/sped_documento_item_declaracao_importacao.py | Python | agpl-3.0 | 2,534 |
import base64
from jarr.bootstrap import conf, session
from jarr.models import Icon
from jarr.utils import jarr_get
from .abstract import AbstractController
class IconController(AbstractController):
_db_cls = Icon
_user_id_key = None # type: str
@staticmethod
def _build_from_url(attrs):
if... | jaesivsm/pyAggr3g470r | jarr/controllers/icon.py | Python | agpl-3.0 | 1,276 |
# ############################################################################
# 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 business i... | uclouvain/OSIS-Louvain | program_management/ddd/validators/_authorized_relationship_for_all_trees.py | Python | agpl-3.0 | 2,629 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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... | numenta/htmresearch | projects/sdr_paper/sdr_paper_unions.py | Python | agpl-3.0 | 16,962 |
from pybullet_utils import pd_controller_stable
from pybullet_envs.deep_mimic.env import humanoid_pose_interpolator
import math
import numpy as np
chest = 1
neck = 2
rightHip = 3
rightKnee = 4
rightAnkle = 5
rightShoulder = 6
rightElbow = 7
leftHip = 9
leftKnee = 10
leftAnkle = 11
leftShoulder = 12
leftElbow = 13
join... | nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_envs/deep_mimic/env/humanoid_stable_pd.py | Python | agpl-3.0 | 42,338 |
# GUI frame for the hprModel_function.py
try:
# for Python2
from Tkinter import * ## notice capitalized T in Tkinter
import tkFileDialog, tkMessageBox
except ImportError:
# for Python3
from tkinter import * ## notice lowercase 't' in tkinter here
from tkinter import filedialog as tkFileDia... | MTG/sms-tools | software/models_interface/hpsModel_GUI_frame.py | Python | agpl-3.0 | 8,438 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-29 08:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('player', '0009_player_ia'),
]
operations = [
migrations.AddField(
... | rarellano/socializa | backend/player/migrations/0010_auto_20170129_0814.py | Python | agpl-3.0 | 752 |
"""
This config file runs the simplest dev environment"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .common import *
from logsettings import get_logger_config
DEBUG = True
TEMPLATE_DEBUG = DEBUG
LOGGIN... | IITBinterns13/edx-platform-dev | cms/envs/dev.py | Python | agpl-3.0 | 6,301 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Camptocamp SA
# @author Nicolas Bessi
# @source JBA and AWST inpiration
# @contributor Grzegorz Grzelak (grzegorz.grzelak@birdglobe.com), Joel Grand-Guillaume
# Copyright (c) 2010 Alexis de Latt... | nareshppts/account_chart_update | currency_rate_update/currency_rate_update.py | Python | agpl-3.0 | 29,434 |
# Generated by Django 2.2.18 on 2021-07-28 20:41
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('discounts', '0006_migrate_discounts'),
]
operations = [
migrations.Remove... | shoopio/shoop | shuup/discounts/migrations/0007_delete_fields.py | Python | agpl-3.0 | 2,742 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... | scylladb/scylla-cluster-tests | sdcm/sct_events/prometheus.py | Python | agpl-3.0 | 1,895 |
# -*- coding: utf-8 -*-
# Copyright 2016-2017 Versada <https://versada.eu/>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo.service import wsgi_server
from odoo.tools import config as odoo_config
from . import const
from .logutils import LoggerNameFilter, OdooSentryHandler
_... | thinkopensolutions/server-tools | sentry/__init__.py | Python | agpl-3.0 | 2,417 |
# -*- 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 super... | mdhaman/superdesk-core | superdesk/io/commands/add_provider.py | Python | agpl-3.0 | 2,040 |
##############################################################################
# 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... | tmerrick1/spack | var/spack/repos/builtin/packages/gmp/package.py | Python | lgpl-2.1 | 2,575 |
##############################################################################
# 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... | mfherbst/spack | var/spack/repos/builtin/packages/perl-extutils-pkgconfig/package.py | Python | lgpl-2.1 | 1,647 |
'''
COM Bridge for SOAP Services
============================
This soaplib extension provides a simple COM bridge for accessing SOAP web
services, especially soaplib web services, via a COM-compliant language. It
was developed primarily for use with standard Windows VBScript/VBA.
To use the COM bridge to access a we... | gsson/soaplib | soaplib/ext/comproxy.py | Python | lgpl-2.1 | 9,149 |
#!/usr/bin/env python3
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free S... | nirbheek/cerbero | cerbero/tools/osxrelocator.py | Python | lgpl-2.1 | 5,546 |
#!/usr/bin/env python
"""Simple Tk example to manually test event loop integration.
This is meant to run tests manually in ipython as:
In [5]: %gui tk
In [6]: %run gui-tk.py
"""
from Tkinter import *
class MyApp:
def __init__(self, root):
frame = Frame(root)
frame.pack()
self.button =... | cloud9ers/gurumate | environment/share/doc/ipython/examples/lib/gui-tk.py | Python | lgpl-3.0 | 612 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Classes for representing multi-dimensional data with metadata.
"""
from collections import OrderedDict
from collections.... | SciTools/iris | lib/iris/cube.py | Python | lgpl-3.0 | 164,190 |
# Copyright (C) 2011-2015 Claas Abert
#
# This file is part of magnum.fe.
#
# magnum.fe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | micromagnetics/magnum.fe | site-packages/magnumfe/common/wrapped_mesh.py | Python | lgpl-3.0 | 4,232 |
VERSION_MAJOR = 0
VERSION_MINOR = 2
VERSION_PATCH = 0
version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
version = '%i.%i.%i' % version_info
__version__ = version
__all__ = ['version', 'version_info', '__version__']
| pyblish/pyblish-standalone | pyblish_standalone/version.py | Python | lgpl-3.0 | 229 |
def itemTemplate():
return ['object/tangible/loot/creature_loot/collections/shared_unknown_shattered_shard_fragment.iff']
def STFparams():
return ['static_item_n','col_shattered_shard_unknown_02_02','static_item_d','col_shattered_shard_unknown_02_02']
def AddToCollection():
return 'col_shattered_shards_01'
de... | agry/NGECore2 | scripts/loot/lootItems/collections/shattered_crystal_shard/unknown_shard_2.py | Python | lgpl-3.0 | 412 |
"""
2D test case with three vortices
"""
from numpy import zeros, exp, pi, loadtxt, allclose, where
import matplotlib.pyplot as plt
from shenfun import Array
from spectralDNS import config, get_solver, solve
def initialize(U, X, U_hat, K_over_K2, T, **context):
w = exp(-((X[0]-pi)**2+(X[1]-pi+pi/4)**2)/(0.2)) \
... | spectralDNS/spectralDNS | demo/Vortices2D.py | Python | lgpl-3.0 | 2,458 |
#
# usage: python k67.py {alias}
#
import sys
import pymongo
def find_aliases(alias):
cn = pymongo.MongoClient().MusicBrainz.artist
return [a for a in cn.find({'aliases.name': alias})]
if __name__ == '__main__':
n = sys.argv[1]
for a in find_aliases(n):
print(a)
| wtsnjp/nlp100 | chap07/k67.py | Python | unlicense | 290 |
"""
Futures tools for threadly
"""
import threading
import time
class ListenableFuture(object):
"""
This class i used to make a Future that can have listeners and callbacks
added to it. Once setter(object) is called all listeners/callbacks are
also called. Callbacks will be given the set object, an... | lwahlmeier/python-threadly | threadly/Futures.py | Python | unlicense | 4,445 |
import random
is_alive = True
while is_alive is True:
guess_right = False
num = random.randrange(1, 100)
guess = 0
guess_num = 0
print("Hi-Lo guessing game")
print("I came up with a number between 1 and 100")
print("You have to guess the number. If your guess is higher, I will tell you so. ... | washbz250/LearnPythonTheHardWay | Python3/Projects/hi_lo.py | Python | unlicense | 1,616 |
# Copyright 2016 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 ag... | YoshikawaMasashi/magenta | magenta/pipelines/lead_sheet_pipelines.py | Python | apache-2.0 | 2,760 |
# Copyright 2012 Red Hat, Inc.
# Copyright 2013 IBM Corp.
# 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.... | tonytan4ever/canary | canary/openstack/common/gettextutils.py | Python | apache-2.0 | 16,232 |
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def headers():
headers = h2o.import_file(pyunit_utils.locate("smalldata/airlines/allyears2k_headers_only.csv"))
headers_and = h2o.import_file(pyunit_utils.locate("smalldata/airlines/allyears2k.zip"))
headers_and.... | madmax983/h2o-3 | h2o-py/tests/testdir_misc/pyunit_headers.py | Python | apache-2.0 | 641 |
# Copyright 2015, 2018 IBM Corp.
#
# 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 require... | powervm/pypowervm | pypowervm/tests/utils/test_uuid.py | Python | apache-2.0 | 2,049 |
# Copyright 2016, IBM US, 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... | open-power-ref-design/opsmgr | plugins/devices/powernode/opsmgr/plugins/devices/powernode/PowerNodePlugin.py | Python | apache-2.0 | 5,846 |
#!/usr/bin/env python
from __future__ import print_function
import sys
import json
import csv
import StringIO
import io
from dictUtil import as_dict, merge_dicts
import urllib
# import jq
from itertools import izip
from logUtil import logging
# for manifest introspection only
import inspect
from pyspark import SparkC... | usc-isi-i2/WEDC | spark_dependencies/python_lib/digSparkUtil/fileUtil.py | Python | apache-2.0 | 11,462 |
# Copyright 2020 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, s... | googleapis/python-aiplatform | .sample_configs/param_handlers/predict_sample.py | Python | apache-2.0 | 1,015 |
import logging
from dvc.cli import parse_args
from dvc.command.imp_url import CmdImportUrl
from dvc.exceptions import DvcException
def test_import_url(mocker):
cli_args = parse_args(
[
"import-url",
"src",
"out",
"--file",
"file",
"-... | efiop/dvc | tests/unit/command/test_imp_url.py | Python | apache-2.0 | 3,589 |
#!/usr/bin/python
DEFAULT_DBURL="postgresql+psycopg2:///cqm"
DEFAULT_SOURCE_SCHEMA="results"
DEFAULT_KEY_SCHEMA="expected"
import sys
from TestKey import TestKey
if __name__ == '__main__':
measures = sys.argv[1:]
dburl=DEFAULT_DBURL
source_schema=DEFAULT_SOURCE_SCHEMA
key_schema=DEFAULT_KEY_SCHEMA
... | pSCANNER/USC-source-code | hqmf2sqlserver/tests_postgres/create_test_key.py | Python | apache-2.0 | 432 |
# 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... | yanchen036/tensorflow | tensorflow/contrib/tpu/python/tpu/tpu_estimator.py | Python | apache-2.0 | 121,921 |
# ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | foursquare/commons-old | src/python/twitter/pants/tasks/filedeps.py | Python | apache-2.0 | 1,488 |
# 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
# distributed under the... | Juniper/nova | nova/api/openstack/placement/microversion.py | Python | apache-2.0 | 9,893 |
"""Config flow for OpenWeatherMap."""
from pyowm import OWM
from pyowm.exceptions.api_call_error import APICallError
from pyowm.exceptions.api_response_error import UnauthorizedError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,... | GenericStudent/home-assistant | homeassistant/components/openweathermap/config_flow.py | Python | apache-2.0 | 4,415 |
# 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/compute/drivers/ktucloud.py | Python | apache-2.0 | 3,502 |
# encoding: utf-8
# Copyright 2013–2017 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
from .setuphandlers import publish
from edrn.rdf import DEFAULT_PROFILE
from plone.dexterity.utils import createContentInContainer
from edrn.rdf.labcascollectionrdfgenerator impo... | EDRN/CancerDataExpo | src/edrn.rdf/edrn/rdf/upgrades.py | Python | apache-2.0 | 2,788 |
#!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2010 OpenStack, 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/... | ntt-pf-lab/backup_keystone | keystone/middleware/remoteauth.py | Python | apache-2.0 | 4,006 |
from common import * # NOQA
SERVICE = 'com.docker.compose.service'
PROJECT = 'com.docker.compose.project'
NUMBER = 'com.docker.compose.container-number'
def test_container_create_count(client, context):
project, service, c = _create_service(client, context)
assert c.labels['io.rancher.service.deployment.u... | wlan0/cattle | tests/integration-v1/cattletest/core/test_compose.py | Python | apache-2.0 | 5,735 |
#
# 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... | apache/airflow | airflow/migrations/versions/952da73b5eff_add_dag_code_table.py | Python | apache-2.0 | 2,906 |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | detiber/lib_openshift | test/test_v1beta1_deployment_rollback.py | Python | apache-2.0 | 1,366 |
# 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)
from pants.build_gra... | dturner-tw/pants | src/python/pants/backend/graph_info/tasks/sorttargets.py | Python | apache-2.0 | 1,081 |
#!/usr/bin/env python
# Copyright (c) 2017 Trail of Bits, 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 applic... | trailofbits/mcsema | tools/mcsema_disass/ida7/disass.py | Python | apache-2.0 | 2,610 |
"""
# Name: check_answer_api/utilities/answer_transformer.py
# Description:
# Created by: Unknown
# Date Created: ---
# Last Modified: Dec 2, 2016
# Modified by: Martinus Alexander
"""
import re
import pattern_dictionary_all
import pattern_dictionary_standardize_mathquill
"""
Helper method to make... | deka108/meas_deka | assessment/utilities/answer_transformer.py | Python | apache-2.0 | 1,384 |
# Copyright 2012-2014 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... | dougwig/x-neutron-lbaas | neutron_lbaas/openstack/common/systemd.py | Python | apache-2.0 | 3,066 |
#!/usr/bin/env python
"""This file imports the Python std lib so it can be used by components."""
# pylint: disable=g-import-not-at-top, unused-import, using-constant-test
if False:
import BaseHTTPServer
import CGIHTTPServer
import ConfigParser
import Cookie
import DocXMLRPCServer
import HTMLParser
impo... | destijl/grr | grr/client/stdlib.py | Python | apache-2.0 | 8,367 |
#!/usr/bin/python
#
# Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | caioserra/apiAdwords | examples/adspygoogle/dfp/v201308/update_teams.py | Python | apache-2.0 | 2,513 |
# 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... | SylvainA/os-event-catcher | openstack/common/report/models/threading.py | Python | apache-2.0 | 3,320 |
# Copyright 2013 IBM Corp.
#
# 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 agree... | rahulunair/nova | nova/tests/unit/objects/test_instance_fault.py | Python | apache-2.0 | 4,346 |
# sudo apt install python-lxml,python-requests
from lxml import html
import requests
urlPrefix = 'https://book.douban.com/subject/'
candidateBookNums = []
candidateBookNums.append('3633461')
selectedBooks = {}
# i = 1
while candidateBookNums:
bookNum = candidateBookNums.pop(0)
bookUrl = urlPrefix + str(bookNum)
... | frank-cq/Toys | searchBook.py | Python | apache-2.0 | 1,673 |
## -*- coding: utf-8 -*-
## Copyright (c) 2015-2018, Exa Analytics Development Team
## Distributed under the terms of the Apache License 2.0
#import six
##import numpy as np
#import pandas as pd
#from io import StringIO
##from exa import Series, TypedMeta
#from exa import TypedMeta
#from exatomic.core import Editor, Te... | avmarchenko/exatomic | exatomic/interfaces/tens.py | Python | apache-2.0 | 2,737 |
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.log import lg, setLogLevel
from mininet.cli import CLI
from mininet.node import RemoteController
FANOUT = 2
SWITCH_NUM = 2
CORES = {}
for i in range(1, SWITCH_NUM + 1):
CORES['s%d' % i] = {}
if i < 10:
CORES['s%d' % i]['dpid'] =... | ndsc-mimic/MimicNOS | experiments/ExprTopo/multiple.py | Python | apache-2.0 | 1,693 |
# Copyright (c) 2020 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/xpu/test_gaussian_random_op_xpu.py | Python | apache-2.0 | 1,364 |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import itertools
import numpy as np
import sklearn.datasets
import sklearn.cross_validation
import sklearn.metrics
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
import canopy
imp... | diogo149/treeano | examples/mnist_ml_l2.py | Python | apache-2.0 | 3,309 |
# Copyright (c) 2017 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/api/exceptions.py | Python | apache-2.0 | 935 |
# ===============================================================================
# Copyright 2011 Jake Ross
#
# 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... | USGSDenverPychron/pychron | pychron/extraction_line/extraction_line_manager.py | Python | apache-2.0 | 34,407 |
# Copyright 2014: Kylin Cloud
# 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 ... | varunarya10/rally | tests/unit/benchmark/scenarios/quotas/test_utils.py | Python | apache-2.0 | 4,630 |
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.multi_map_message_type import *
REQUEST_TYPE = MULTIMAP_CONTAINSVALUE
RESPONSE_TYPE = 101
R... | cangencer/hazelcast-python-client | hazelcast/protocol/codec/multi_map_contains_value_codec.py | Python | apache-2.0 | 1,156 |
import os
from g import config_dir, templates_dir, DEFAULT_GID, DEFAULT_UID
from utils.misc import prepare_dir
from utils.jinja import render_jinja
registryctl_config_dir = os.path.join(config_dir, "registryctl")
registryctl_config_template_path = os.path.join(templates_dir, "registryctl", "config.yml.jinja")
registr... | wy65701436/harbor | make/photon/prepare/utils/registry_ctl.py | Python | apache-2.0 | 1,152 |
"""Creates a supervision tree which splits the jobs into buckets.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import shutil
from treadmill import fs
from treadmill import spawn
from t... | Morgan-Stanley/treadmill | lib/python/treadmill/spawn/tree.py | Python | apache-2.0 | 3,867 |
# Copyright (c) 2011-2012 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
#
# Un... | sacharya/nova | nova/weights.py | Python | apache-2.0 | 4,485 |
# 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... | superstack/nova | nova/api/ec2/admin.py | Python | apache-2.0 | 13,151 |
# -*- coding: utf-8 -*-
# Copyright 2015 Metaswitch Networks
#
# 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... | alexhersh/calico | calico/felix/test/__init__.py | Python | apache-2.0 | 659 |
# 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... | nathanielvarona/airflow | airflow/providers/tableau/operators/tableau_refresh_workbook.py | Python | apache-2.0 | 3,881 |
# coding: utf-8
#
# Copyright 2010 Alexandre Fiori
# based on the original Tornado by Facebook
#
# 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... | dpnova/cyclone | cyclone/__init__.py | Python | apache-2.0 | 714 |
# Copyright (c) 2013 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... | crobby/sahara | sahara/tests/unit/conductor/manager/test_clusters.py | Python | apache-2.0 | 13,755 |
"""Support for Acmeda Roller Blind Batteries."""
from __future__ import annotations
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE
from homeassistant.core import HomeAssistant, callback
from hom... | mezz64/home-assistant | homeassistant/components/acmeda/sensor.py | Python | apache-2.0 | 1,666 |
import cv2
import numpy as np
filename = '/home/greg/Databases/images/0c9a02a8-2b7d-484e-ba18-e35d33800774.jpeg'
img = cv2.imread(filename)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
gray = np.float32(gray)
dst = cv2.cornerHarris(gray,2,3,0.04)
#result is dilated for marking the corners, not important
dst = cv2.dil... | zooniverse/aggregation | experimental/algorithms/test.py | Python | apache-2.0 | 475 |
# -*- coding: utf-8 -*-
"""Operating system independent (generic) preprocessor plugins."""
from dfvfs.helpers import file_system_searcher
from plaso.lib import definitions
from plaso.preprocessors import interface
from plaso.preprocessors import manager
class DetermineOperatingSystemPlugin(
interface.FileSystem... | log2timeline/plaso | plaso/preprocessors/generic.py | Python | apache-2.0 | 3,399 |
# 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 appli... | reyoung/Paddle | python/paddle/fluid/tests/unittests/test_sequence_unpad_op.py | Python | apache-2.0 | 2,170 |
import os
import sys
import subprocess
import tempfile
import time
import unittest2 as unittest
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
BASE_DIR = os.path.abspath(os.path.join(TEST_DIR, '..', '..'))
def execute(cmd, raise_error=True):
"""
Executes a command in a subprocess. Returns a tuple
... | genius1611/Keystone | keystone/test/__init__.py | Python | apache-2.0 | 4,496 |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | tseaver/google-cloud-python | securitycenter/google/cloud/securitycenter_v1/gapic/transports/security_center_grpc_transport.py | Python | apache-2.0 | 13,088 |
# -*- 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):
# Changing field 'P3Talk.sub_community'
db.alter_column(u'p3_p3talk', 's... | leriomaggio/pycon_site | p3/migrations/0004_auto__chg_field_p3talk_sub_community.py | Python | bsd-2-clause | 21,667 |
from srqi.core import inquiry
import matplotlib.pyplot as plt
import numpy as np
def get_accumulation_fig(proc):
fig = plt.figure()
plt.title("Accumulation During Procedure for Patient " + str(proc.PatientID) + " on " + str(proc.StudyDate))
event_starts = [e.DateTime_Started for e in proc.get_events... | mcstrother/dicom-sr-qi | inquiries/high_cases.py | Python | bsd-2-clause | 7,573 |
# -*- 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 'Accreditation'
db.create_table(u'units_accreditation', (
... | ArcaniteSolutions/truffe2 | truffe2/units/migrations/0004_auto__add_accreditation.py | Python | bsd-2-clause | 8,999 |
# -*- coding: utf-8 -*-
"""
Project name: Open Methodology for Security Tool Developers
Project URL: https://github.com/cr0hn/OMSTD
Copyright (c) 2014, cr0hn<-AT->cr0hn.com
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following ... | cr0hn/OMSTD | examples/develop/lp/002/lp-002-s1.py | Python | bsd-2-clause | 2,001 |
"""Emission python module
This module is for everyone who wants to build tools / systems for calculating vehicle
emissions for various types of vehicles (Trucks, Buses, Cars, Vans, scooters, ..).
The calculation and factors is provided by the EU EEA guidebook: http://www.eea.europa.eu/publications/emep-eea-guidebook-... | NPRA/EmissionCalculatorLib | emission/__init__.py | Python | bsd-2-clause | 1,488 |
# $Id: images.py 7062 2011-06-30 22:14:29Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Directives for figures and simple images.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes, utils
from docutils.... | cuongthai/cuongthai-s-blog | docutils/parsers/rst/directives/images.py | Python | bsd-3-clause | 6,587 |
#
#
#
#
from framework.deprecated.controllers import CommScheduler, CheckpointDriving, VisualSearchTask
from framework.latentmodule import LatentModule
from framework.convenience import ConvenienceFunctions
from framework.ui_elements.EventWatcher import EventWatcher
from framework.ui_elements.ScrollPresenter import S... | sccn/SNAP | src/modules/MBF/MBF2_A.py | Python | bsd-3-clause | 69,902 |
from itertools import combinations
def check_adding_elements(integers_list):
if [item for i in range(len(integers_list), 0, -1) for item in
combinations(integers_list, i) if sum(item) == 0]:
return True
return False
| vigojug/reto | 201705/alexhermida/reto.py | Python | bsd-3-clause | 247 |
# Copyright (c) 2016, Xilinx, 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | VectorBlox/PYNQ | python/pynq/iop/tests/test_pmod_cable.py | Python | bsd-3-clause | 7,289 |
import colorsys
import numpy as np
import matplotlib as mpl
import pytest
import numpy.testing as npt
from .. import palettes, utils, rcmod
from ..external import husl
from ..colors import xkcd_rgb, crayons
class TestColorPalettes:
def test_current_palette(self):
pal = palettes.color_palette(["red", "... | mwaskom/seaborn | seaborn/tests/test_palettes.py | Python | bsd-3-clause | 14,313 |
# Copyright (c) 2009, 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... | scheib/chromium | third_party/blink/tools/blinkpy/common/net/results_fetcher.py | Python | bsd-3-clause | 12,013 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.