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 |
|---|---|---|---|---|---|
import numpy as np
import tensorflow as tf
from recognition.utils.rect import Rect
def intersection(box1, box2):
x1_max = tf.maximum(box1[:, 0], box2[:, 0])
y1_max = tf.maximum(box1[:, 1], box2[:, 1])
x2_min = tf.minimum(box1[:, 2], box2[:, 2])
y2_min = tf.minimum(box1[:, 3], box2[:, 3])
x_diff ... | Queuer/queue-vision | recognition/utils/train_utils.py | Python | apache-2.0 | 6,412 |
"""
This module (mostly) uses the XenAPI to manage Xen virtual machines.
Big fat warning: the XenAPI used in this file is the one bundled with
Xen Source, NOT XenServer nor Xen Cloud Platform. As a matter of fact it
*will* fail under those platforms. From what I've read, little work is needed
to adapt this code to XS/... | saltstack/salt | salt/modules/xapi_virt.py | Python | apache-2.0 | 24,657 |
# coding: utf-8
#
# Copyright 2015 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 requi... | zgchizi/oppia-uc | core/domain/classroom_domain.py | Python | apache-2.0 | 1,980 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | cxxgtxy/tensorflow | tensorflow/api_template_v1.__init__.py | Python | apache-2.0 | 6,757 |
"""Apply the same action to the simulated and real A1 robot.
As a basic debug tool, this script allows you to execute the same action
(which you choose from the pybullet GUI) on the simulation and real robot
simultaneouly. Make sure to put the real robbot on rack before testing.
"""
from absl import app
from absl im... | google-research/motion_imitation | motion_imitation/examples/a1_robot_exercise.py | Python | apache-2.0 | 1,931 |
# Copyright (c) 2010, 2011 Arek Korbik
#
# 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... | arkadini/twimp | twimp/primitives.py | Python | apache-2.0 | 1,077 |
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems 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.o... | Bam4d/neon | neon/backends/tests/test_randomstate.py | Python | apache-2.0 | 3,295 |
import ConfigParser
import os
import re
import ldap
import asfgit.cfg as cfg
import asfgit.log as log
import asfgit.util as util
GROUP_DN="cn=%(group)s,ou=groups,dc=apache,dc=org"
DN_RE=re.compile("uid=([^,]+),ou=people,dc=apache,dc=org")
SUBPROJECT_RE=re.compile("-.+$")
def authorized_committers(repo_name):
w... | chtyim/infrastructure-puppet | modules/gitserver_dual/files/asfgit/auth.py | Python | apache-2.0 | 1,642 |
from armstrong.core.arm_sections import utils
from armstrong.core.arm_sections.models import Section
from ._utils import ArmSectionsTestCase, override_settings
from .support.models import SimpleCommon
def rel_field_names(rels):
return [rel.field.name for rel in rels]
class get_configured_item_modelTestCase(Arm... | armstrong/armstrong.core.arm_sections | tests/utils.py | Python | apache-2.0 | 3,181 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
# Copyright (c) 2011-2013 University of Southern California / ISI
# 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 ... | imsplitbit/nova | nova/tests/virt/baremetal/test_tilera.py | Python | apache-2.0 | 15,118 |
__all__ = ('WebSocketResponse', 'MsgType')
import asyncio
import warnings
from . import hdrs
from .errors import HttpProcessingError, ClientDisconnectedError
from .websocket import do_handshake, Message, WebSocketError
from .websocket_client import MsgType, closedMessage
from .web_exceptions import (
HTTPBadReque... | lfblogs/aio2py | aio2py/required/aiohttp/web_ws.py | Python | apache-2.0 | 8,999 |
#!/usr/bin/python3
__author__ = 'nhumrich'
import logspit.runner
if __name__ == '__main__':
logspit.runner.run()
| CanopyTax/logspit | run.py | Python | apache-2.0 | 118 |
#
# 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
# ... | noironetworks/heat | heat/tests/api/openstack_v1/test_events.py | Python | apache-2.0 | 28,895 |
# Copyright 2015 Cisco Systems
# 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... | Tehsmash/cisco-ironic-contrib | cisco_ironic_contrib/tests/__init__.py | Python | apache-2.0 | 1,348 |
# Copyright 2015 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 writing... | openstack/oslo.cache | oslo_cache/tests/unit/test_dict_backend.py | Python | apache-2.0 | 4,186 |
"""The tests for the MQTT light platform.
Configuration for RGB Version with brightness:
light:
platform: mqtt
name: "Office Light RGB"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: "office/rgb1/brightness/status"
brightness_command_topic: "offic... | adrienbrault/home-assistant | tests/components/mqtt/test_light.py | Python | apache-2.0 | 68,757 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | google-research/language | language/common/utils/experiment_utils_test.py | Python | apache-2.0 | 2,572 |
import hashlib
import logging
from lxml import etree
from mock import Mock, patch
import os
import requests
import unittest
from six.moves.urllib.request import url2pathname
from eulfedora.models import DigitalObject
from eulfedora.server import Repository
from eulfedora.syncutil import ArchiveExport, endswith_partial... | WSULib/eulfedora | test/test_fedora/test_syncutil.py | Python | apache-2.0 | 12,920 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import csv
import logging
import pickle
import numpy as np
from __future__ import division
# <codecell>
# Logging definition
logger = logging.getLogger('analyzing')
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('log/process_ngrams.log')
fh.s... | rmaestre/amazon-sentiwordnet | Analysis.py | Python | apache-2.0 | 3,539 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-dialogflow | samples/generated_samples/dialogflow_v2_generated_versions_delete_version_sync.py | Python | apache-2.0 | 1,386 |
# -*- coding: utf-8 -*-
# Copyright 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | dovf/matrix-python-sdk | matrix_client/client.py | Python | apache-2.0 | 18,097 |
# Copyright 2014
# The 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | MayankGo/ec2-api | ec2api/api/apirequest.py | Python | apache-2.0 | 5,353 |
from nose.tools import eq_
from .. import OnExp, OnState, OnTime
import datetime
from collections import defaultdict
def dt2s(dt):
return dt.strftime('%Y-%m-%d %H:%M:%S')
def test_one_date():
exp = OnExp("0 6 1,31 * tue,wed")
st = exp.state(datetime.datetime(2014,6,13,0,0,0))
#rules = exp.rules[s... | walnutgeek/OnTimer | ontimer/tests/test_ontimer.py | Python | apache-2.0 | 1,348 |
"""
Copyright 2015 Brocade Communications Systems, 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 t... | DavidJohnGee/clicrud | clicrud/device/generic/__init__.py | Python | apache-2.0 | 1,768 |
#$language = "python"
#$interface = "1.0"
# Document_Device.py
#
# Description:
# Sends a series of Cisco Show commands one by one as listed in the
# COMMANDS array. The results of each command are captured into a
# variable, and then written to an individual log file (one log file
# for each command).
#
# ... | DN0000/SecureCRT | Document_Device.py | Python | apache-2.0 | 5,211 |
# Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | deepmind/xmanager | xmanager/xm/job_operators.py | Python | apache-2.0 | 4,103 |
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import re
import signal
import time
from pathlib import Path
from typing import List, Tuple
import pytest
from pants.base.build_environment import get_buildroot
from pants.base... | pantsbuild/pants | src/python/pants/base/exception_sink_integration_test.py | Python | apache-2.0 | 4,970 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-securitycenter | samples/generated_samples/securitycenter_v1_generated_security_center_get_big_query_export_sync.py | Python | apache-2.0 | 1,513 |
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
import unittest
import sys
import itertools
import os
import shutil
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology.context import ConfigParams, submit
from streamsx import rest
import test_fun... | wmarshall484/streamsx.topology | test/python/topology/test2.py | Python | apache-2.0 | 8,958 |
import unittest
import mock
from kafka_influxdb.reader import kafka_python
from kafka.common import Message
class TestKafkaPython(unittest.TestCase):
def setUp(self):
self.host = "myhost"
self.port = 1234
self.group = "mygroup"
self.topic = "mytopic"
self.offset = "largest"... | mre/kafka-influxdb | kafka_influxdb/tests/reader_test/test_kafka_python.py | Python | apache-2.0 | 1,320 |
# -*- coding: utf-8 -*-
#
# 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
... | gritlogic/incubator-airflow | airflow/utils/helpers.py | Python | apache-2.0 | 15,004 |
#!/usr/bin/env python
#
# Copyright 2016 Medoly
#
# 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 agr... | whiteclover/Medoly | examples/demo/app/user/model.py | Python | apache-2.0 | 825 |
# 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 th... | flochaz/horizon | openstack_dashboard/dashboards/vledashboard/stacks/urls.py | Python | apache-2.0 | 1,491 |
#!/usr/bin/env python3
import os
from litmus.core.util import load_yaml
from litmus.core.manager import manager
from litmus.helper.helper import tizen_snapshot_downloader as downloader
from litmus.helper.tests import add_test_helper
def main(*args, **kwargs):
# init manager instance
mgr = manager(*args, **kw... | dhs-shine/litmus | litmus/templates/standalone_tm2/userscript.py | Python | apache-2.0 | 1,815 |
#!/usr/bin/python
#! -*- Encoding: Latin-1 -*-
import ConfigParser
import os
import threading
import logging
import logging.handlers
import eftepede_globals
import re
import socket
import pyftpdlib.servers
import pyftpdlib.handlers
import eftepede_authorizer
try:
import _winreg
except:
_winreg = None
class co... | gersonkurz/eftepede | eftepede_server.py | Python | apache-2.0 | 6,104 |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=8, path_list=[
[TestAction.create_vm, 'vm1', ],
[TestAction.create_volume, 'volume1', 'flag=scsi'],
[TestAction.attach_volume, 'vm1', 'volume1'],
... | zstackio/zstack-woodpecker | integrationtest/vm/multihosts/vm_snapshots/paths/ceph_path24.py | Python | apache-2.0 | 1,940 |
"""Component to interface with cameras."""
import asyncio
import base64
import collections
from contextlib import suppress
from datetime import timedelta
import logging
import hashlib
from random import SystemRandom
import attr
from aiohttp import web
import async_timeout
import voluptuous as vol
from homeassistant.c... | Cinntax/home-assistant | homeassistant/components/camera/__init__.py | Python | apache-2.0 | 21,499 |
import random
import string
from six.moves.urllib.parse import urlparse
def region_from_glacier_url(url):
domain = urlparse(url).netloc
if "." in domain:
return domain.split(".")[1]
else:
return "us-east-1"
def vault_from_glacier_url(full_url):
return full_url.split("/")[-1]
def ... | william-richard/moto | moto/glacier/utils.py | Python | apache-2.0 | 441 |
# 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 ... | cloudkick/libcloud | test/compute/test_softlayer.py | Python | apache-2.0 | 3,233 |
'''
Created on 2017年3月5日
@author: 张志远
'''
import pandas as pd
class Menu():
'''
整个软件的菜单结构
'''
def __init__(self, cur):
'''
Constructor
'''
self.menu_dict = {}
self.cur = cur
sql_str = 'SELECT t.id, t.name, nvl(t.parent_id,0) pare... | zzy93421/HFOrder | source/Menu.py | Python | apache-2.0 | 968 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA, Junki MIZUSHIMA
#
# 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:/... | mzsm/IkaLog | ikalog/version.py | Python | apache-2.0 | 1,006 |
import unittest
from hepixvmitrust import VMListControler
il_simple_json = """"hv:imagelist": {
"hv:uri": "https://example.org/example-image-list.image_list",
"hv:version": "1",
"dc:description": "a README example of an image list",
"dc:date:created": "2011-03-10T17:09:12Z",
"dc:source": "example.... | hepix-virtualisation/hepixvmitrust | test/test_first.py | Python | apache-2.0 | 1,829 |
###
from naoqi import ALProxy
port = 9559
robotIP = '192.168.0.102'
anim=ALProxy("ALAnimatedSpeech",robotIP,port)
cong={"bodyLnguageMde":"contextual"}
tts = ALProxy("ALTextToSpeech", robotIP, 9559)
tts.setParameter("speed", 80)
anim.say("Hi hello! I'm a robot that moving my hands following the movements of your... | CuriosityLabTAU/physicial_curiosity_big_experiment | for_aminations.py | Python | apache-2.0 | 1,653 |
# Copyright 2012 Locaweb.
# 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... | uni2u/neutron | neutron/agent/linux/iptables_manager.py | Python | apache-2.0 | 26,354 |
# Copyright 2019 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | jhuapl-boss/intern | intern/resource/dvid/__init__.py | Python | apache-2.0 | 870 |
# 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... | tomasdubec/openstack-cinder | cinder/test.py | Python | apache-2.0 | 9,604 |
# 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... | juharris/tensorflow | tensorflow/contrib/learn/python/learn/estimators/linear_test.py | Python | apache-2.0 | 57,856 |
# Copyright (C) 2018 RedHat 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 ... | openstack/glance | glance/db/sqlalchemy/alembic_migrations/versions/rocky_expand01_add_os_hidden.py | Python | apache-2.0 | 1,135 |
"""Converts cplate betas to a BED file."""
import argparse
import os
import re
import pandas as pd
COLUMNS = ['chrom', 'start', 'end', 'name', 'score', 'strand']
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--summaries', dest='summaries',
help='cplate sum... | awblocker/cplate | scripts/betas_to_bed.py | Python | apache-2.0 | 1,878 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2020 BigML
#
# 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 ... | jaor/bigmler | bigmler/checkpoint.py | Python | apache-2.0 | 22,228 |
# Copyright 2014 Rackspace
#
# 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... | openstack/octavia | octavia/api/v2/types/pool.py | Python | apache-2.0 | 11,027 |
from pyspark import SparkContext, SparkConf, SparkFiles
from pyspark.sql import SQLContext, Row
import ConfigParser as configparser
from subprocess import Popen, PIPE
from datetime import datetime
from vina_utils import get_directory_complex_pdb_analysis, get_files_pdb, get_name_model_pdb, get_ligand_from_receptor_liga... | rodrigofaccioli/drugdesign | virtualscreening/vina/spark/buried_area_ligand.py | Python | apache-2.0 | 13,488 |
# Copyright 2013-2016 DataStax, 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 writi... | vipjml/python-driver | tests/integration/cqlengine/test_connections.py | Python | apache-2.0 | 21,818 |
from doajtest.helpers import DoajTestCase
from portality import models
from portality import lcc
from portality.forms.application_forms import JournalFormFactory
from portality.forms.application_processors import ManEdJournalReview
from doajtest.fixtures import JournalFixtureFactory
from copy import deepcopy
JOURNA... | DOAJ/doaj | doajtest/unit/application_processors/test_maned_journal_review.py | Python | apache-2.0 | 8,279 |
# 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
# d... | dims/cinder | cinder/db/sqlalchemy/migrate_repo/versions/063_drop_iscsi_targets_table.py | Python | apache-2.0 | 769 |
#!/usr/bin/env python
# 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
#
# https: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleinterns/risr | risr-app/risr_proj/risr_proj/urls.py | Python | apache-2.0 | 1,476 |
# Copyright 2012 NEC 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 ag... | Tesora/tesora-horizon | openstack_dashboard/dashboards/project/networks/workflows.py | Python | apache-2.0 | 26,337 |
from .selector_spec import ( # noqa: F401
SelectionUnion,
SelectionSpec,
SelectionIntersection,
SelectionDifference,
SelectionCriteria,
)
from .selector import ( # noqa: F401
ResourceTypeSelector,
NodeSelector,
)
from .cli import ( # noqa: F401
parse_difference,
parse_from_selecto... | analyst-collective/dbt | core/dbt/graph/__init__.py | Python | apache-2.0 | 430 |
# 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, ... | google/tink | python/tink/streaming_aead/_streaming_aead_test.py | Python | apache-2.0 | 4,470 |
# Copyright 2018 The TensorFlow Probability 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 o... | tensorflow/probability | tensorflow_probability/python/optimizer/nelder_mead.py | Python | apache-2.0 | 40,382 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | ram8647/gcb-mobilecsp | models/resources_display.py | Python | apache-2.0 | 51,422 |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | edgedb/edgedb | edb/pgsql/__init__.py | Python | apache-2.0 | 715 |
# Copyright (c) 2014 Hitachi Data Systems, 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
#
# U... | abusse/cinder | cinder/tests/test_hds_iscsi.py | Python | apache-2.0 | 16,039 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | ZhangXinNan/tensorflow | tensorflow/python/kernel_tests/array_ops_test.py | Python | apache-2.0 | 48,533 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-14 12:27
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("peering", "0004_auto_20171004_2323")]
operations = [
migrations.CreateModel(
name=... | respawner/peering-manager | peering/migrations/0005_auto_20171014_1427.py | Python | apache-2.0 | 1,688 |
from os.path import dirname, basename, isfile, realpath
import glob
import sys
sys.path.append(dirname(realpath(__file__)))
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = []
for f in modules:
m = basename(f)[:-3]
if m == '__init__' or m == '_export' or not isfile(f): continue
module = __import... | uperetz/AstroTools | models/_export.py | Python | apache-2.0 | 419 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def weights_gamma():
htable = h2o.upload_file(pyunit_utils.locate("smalldata/gbm_test/moppe.csv"))
htable["premiekl"] = htable["premiekl"].asfactor()
htable["moptva"] = htable["moptva"].asfactor()
htable["zon"] = h... | pchmieli/h2o-3 | h2o-py/tests/testdir_algos/gbm/pyunit_DEPRECATED_weights_gammaGBM.py | Python | apache-2.0 | 1,246 |
from __future__ import absolute_import, print_function
from django.conf import settings
class NoIfModifiedSinceMiddleware(object):
def __init__(self):
if not settings.DEBUG:
from django.core.exceptions import MiddlewareNotUsed
raise MiddlewareNotUsed
def process_request(self... | lyoniionly/django-cobra | src/cobra/middleware/debug.py | Python | apache-2.0 | 389 |
# Copyright 2018 Rackspace US 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... | openstack/octavia | octavia/api/drivers/amphora_driver/flavor_schema.py | Python | apache-2.0 | 2,189 |
#
# Copyright 2014-15 the original author or 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 ag... | cabalgata/cabalgata-silla-de-montar | test/test_factories.py | Python | apache-2.0 | 2,490 |
#!/usr/bin/env python
'''
Scriot that gets
# Uptime when running config last changed
ccmHistoryRunningLastChanged = '1.3.6.1.4.1.9.9.43.1.1.1.0'
and
# Uptime when startup config last saved
ccmHistoryStartupLastChanged = '1.3.6.1.4.1.9.9.43.1.1.3.0'
compare them and decided whether or not latest changes in runn... | laetrid/learning | Second_course/ex1_2.py | Python | apache-2.0 | 1,680 |
"""Base configuration implementation."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | shivarammysore/faucet | faucet/conf.py | Python | apache-2.0 | 9,565 |
# 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
# d... | igor-toga/local-snat | neutron/tests/unit/objects/test_subnet.py | Python | apache-2.0 | 9,765 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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/LICEN... | Aloomaio/googleads-python-lib | examples/adwords/v201802/campaign_management/set_ad_parameters.py | Python | apache-2.0 | 3,262 |
import json
import pytz
from unittest2 import skipIf
from datetime import date, datetime
from django.test.utils import override_settings
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from myuw.test.api import missing_url, get_user, get_user_pass
from... | fanglinfang/myuw | myuw/test/dao/calendar.py | Python | apache-2.0 | 3,758 |
from highton.models import HightonModel
from highton.highton_constants import HightonConstants
from highton import (
fields,
call_mixins,
)
from highton.models.attachment import Attachment
class Email(
HightonModel,
call_mixins.DetailCallMixin,
call_mixins.CreateCallMixin,
call_mixins.UpdateCa... | seibert-media/Highton | highton/models/email.py | Python | apache-2.0 | 2,952 |
#
# Copyright (c) 2013 Preet Kukreti
#
# Excerpt of code taken at
# http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python
import os
import sys
import stat
import tempfile
def is_case_sensitive_filesystem():
tmphandle, tmppath = tempfile.mkstemp()
is_insensitive = os.path.exists(tmppat... | hirokihamasaki/irma | common/plugins/which.py | Python | apache-2.0 | 3,234 |
Hi, <%= to_name %><br>
<br>
Someone asked to recover this account on <%= app_name %>.<br>If you want to recover this account, Please click the following link and set new password! Otherwise please ignore this e-mail.<br>
<a href="<%= app_url %>/token/verify/!recovery/!<%str= mail_verify_token %>">Click here to set new ... | vinoth3v/In | In/templates/html/AccountRecoveryEmail.tpl.py | Python | apache-2.0 | 445 |
# -*- coding: utf-8 -*-
# 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, softw... | jiahaoliang/group-based-policy | gbpservice/nfp/orchestrator/config_drivers/heat_client.py | Python | apache-2.0 | 2,625 |
"""Auto-generated file, do not edit by hand. MK metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_MK = PhoneMetadata(id='MK', country_code=389, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[2-578]\\d{7}', possible_length=(8,), po... | gencer/python-phonenumbers | python/phonenumbers/data/region_MK.py | Python | apache-2.0 | 1,725 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/global_/afi_safis/afi_safi/route_selection_options/__init__.py | Python | apache-2.0 | 18,590 |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/grace_lsa/tlvs/tlv/unknown_tlv/__init__.py | Python | apache-2.0 | 12,510 |
# Copyright 2020 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 agreed to in writing, ... | openvswitch/ovn-scale-test | rally_ovs/plugins/ovs/context/ovnnbctl_daemon.py | Python | apache-2.0 | 1,593 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | google/cloud-forensics-utils | tests/providers/gcp/internal/test_log.py | Python | apache-2.0 | 1,867 |
# -*- 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 'Localisation'
db.create_table(u'cms_localisation', (
... | universalcore/unicore-cms-django | cms/migrations/0013_auto__add_localisation__add_field_post_localisation__del_field_categor.py | Python | bsd-2-clause | 9,317 |
"""Navigation along a white line using visual feedback."""
import numpy as np
try:
import cv2
except ImportError:
print "You need OpenCV to use vision modules, sorry."
sys.exit(1)
from util import Enum, rotateImage
from base import DependentFrameProcessor
from main import main
from linedetection import Line, L... | IEEERobotics/high-level | qwe/vision/linewalking.py | Python | bsd-2-clause | 3,459 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('routes', '0003_add_validators'),
('redirects', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | Ian-Foote/django-conman | conman/redirects/migrations/0002_urlredirect.py | Python | bsd-2-clause | 776 |
# -*- 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 'VisitRegistrationErrorLog.error_type'
db.alter_column(... | myvoice-nigeria/myvoice | myvoice/clinics/migrations/0014_auto__chg_field_visitregistrationerrorlog_error_type.py | Python | bsd-2-clause | 13,224 |
import os
import numpy as np
import re
import sys
try:
import h5py
except ImportError:
h5py = None
'''
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
'''
from .. import logger, logging
from .base import MFPackage, MissingFile
from .name import Modflow
... | mwtoews/moflow | moflow/mf/reader.py | Python | bsd-2-clause | 22,960 |
#!/usr/bin/env python
import os
import sys
# Add the project to the path
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
# setup the environment
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dicom_review.conf.settings')
os.environ.setdefault('PYTHON_EGG_CACHE', '/tmp')
from django.core.management i... | chop-dbhi/django-dicom-review | bin/manage.py | Python | bsd-2-clause | 380 |
import mufsim.gamedb as db
import mufsim.stackitems as si
from mufsim.interface import network_interface as netifc
from mufsim.logger import log
from mufsim.errors import MufRuntimeError
from mufsim.insts.base import Instruction, instr
@instr("descriptors")
class InstDescriptors(Instruction):
def execute(self, fr... | revarbat/mufsim | mufsim/insts/descriptors.py | Python | bsd-2-clause | 6,210 |
from setuptools import setup
setup(
name='tracer', version='0.1', description="Symbolically trace concrete inputs.",
packages=['tracer', 'tracer.cachemanager' ],
install_requires=[ 'shellphish-qemu'],
)
| angr/tracer | setup.py | Python | bsd-2-clause | 207 |
from django.core.management.base import BaseCommand
from twiggy_goodies.django import LogMixin
from allmychanges.models import Repo
class Command(LogMixin, BaseCommand):
help = u"""Deletes all repositories and related information."""
def handle(self, *args, **options):
Repo.objects.all().delete()
| AllMyChanges/allmychanges.com | allmychanges/management/commands/cleardb.py | Python | bsd-2-clause | 318 |
# THIS FILE IS GENERATED FROM THE PERMUTE SETUP.PY
version='0.1.alpha4'
| qqqube/permute | permute/version.py | Python | bsd-2-clause | 72 |
class GraphQLException(Exception):
pass
| tallstreet/graphql-parser-python | graphqlparser/exceptions.py | Python | bsd-2-clause | 44 |
#
# Command Generator
#
# Send SNMP GETBULK request using the following options:
#
# * with SNMPv2c, community 'public'
# * over IPv4/UDP
# * to an Agent at demo.snmplabs.com:161
# * with values non-repeaters = 0, max-repetitions = 25
# * for two OIDs in string form
# * stop when response OIDs leave the scopes of initi... | ww9rivers/pysnmp | examples/v3arch/oneliner/manager/cmdgen/getbulk-v2c.py | Python | bsd-2-clause | 1,059 |
from __future__ import absolute_import, unicode_literals
import re
from collections import OrderedDict
from django import template
from django.template import loader
from django.urls import NoReverseMatch, reverse
from django.utils import six
from django.utils.encoding import force_text, iri_to_uri
from django.utils.... | kgeorgy/django-rest-framework | rest_framework/templatetags/rest_framework.py | Python | bsd-2-clause | 13,205 |
"""
This module includes a class for interfacing scikit-learn's logistic
regression model.
"""
import numpy as np
import sklearn.linear_model
from libact.base.interfaces import ProbabilisticModel
class LogisticRegression(ProbabilisticModel):
"""Logistic Regression Classifier
References
----------
h... | ntucllab/libact | libact/models/logistic_regression.py | Python | bsd-2-clause | 1,314 |
#===========================================================================
#
# MQTT message broker location. Default broker location is port 1883
# for regular and 8883 for SSL.
#
#===========================================================================
host = '192.168.1.5'
port = 1883
# Keep alive time in secon... | TD22057/T-Home | conf/broker.py | Python | bsd-2-clause | 955 |
from decimal import Decimal
from functools import partial
import html
import json
from django.core.serializers import serialize
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models.query import QuerySet
from django.utils.encoding import force_str
from django.utils.encoding import smart_str
... | makinacorpus/Geotrek | mapentity/serializers/helpers.py | Python | bsd-2-clause | 2,369 |