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 |
|---|---|---|---|---|---|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... | citrix-openstack-build/ironic | ironic/openstack/common/service.py | Python | apache-2.0 | 10,246 |
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
r"""Calculate Round Constant
"""
import argparse
import bitarray as ba
import logging as log
def main():
parser = argparse.ArgumentParser(
... | lowRISC/opentitan | util/design/keccak_rc.py | Python | apache-2.0 | 1,923 |
from django.apps import apps
from django.conf.urls import url
from c3nav.editor.views.account import change_password_view, login_view, logout_view, register_view
from c3nav.editor.views.changes import changeset_detail, changeset_edit, changeset_redirect
from c3nav.editor.views.edit import edit, graph_edit, level_detai... | c3nav/c3nav | src/c3nav/editor/urls.py | Python | apache-2.0 | 4,247 |
#
# Copyright (c) 2008-2015 Citrix 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 l... | mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/ns/nssimpleacl6.py | Python | apache-2.0 | 12,674 |
# Copyright 2016 Bridgewater Associates
#
# 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... | markofu/security_monkey | security_monkey/watchers/rds/rds_security_group.py | Python | apache-2.0 | 5,590 |
#!/usr/bin/python2.4
#
# Copyright 2009 Empeeric LTD. 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
#
# Unl... | poeks/twitterbelle | lib/bitly.py | Python | apache-2.0 | 7,225 |
import setuptools
import glob
setuptools.setup(
name='umbra',
version='2.1.dev10',
description='Browser automation via chrome debug protocol',
url='https://github.com/internetarchive/umbra',
author='Eldon Stegall',
author_email='eldon@archive.org',
long_descripti... | internetarchive/umbra | setup.py | Python | apache-2.0 | 789 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.daylighting import OutputControlIlluminanceMapStyle
log = logging.getLogger(__name__)
class TestOutputControlIlluminanceMapStyle(unittest.TestCase):
def setUp(self):
... | rbuffat/pyidf | tests/test_outputcontrolilluminancemapstyle.py | Python | apache-2.0 | 1,023 |
INDENT = " "
def escape_text_html(str): return str.replace("&", "&").replace("<", "<")
def escape_attr_html(str): return str.replace("\"", """)
class Node(object):
ELEMENT = 1
TEXT = 2
ROOT = 3
type = 0
parent = None
def insert_before(self, node):
if node.parent: node.pa... | operasoftware/dragonfly-build-tools | df2/codegen/node.py | Python | apache-2.0 | 4,544 |
'''some useful functions when working with web servers'''
import re
import os
import base64
import zlib
# import blockdiag
# import blockdiag.imagedraw
# import blockdiag.noderenderer
# import blockdiagcontrib
# import actdiag.plugins
# import blockdiag.plugins
# for supporting base64.js
def base64_decode(the_string)... | rajpushkar83/cloudmesh | cloudmesh/util/webutil.py | Python | apache-2.0 | 4,482 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | kdart/pycopia | QA/pycopia/smartbits/smartlib.py | Python | apache-2.0 | 8,204 |
import logging
import os
import pytest
import sdk_cmd
import sdk_install
import sdk_marathon
import sdk_plan
import sdk_utils
from tests import config
log = logging.getLogger(__name__)
POD_NAMES = ["hello-0", "world-0", "world-1"]
REMOTE_REGION = os.environ.get("REMOTE_REGION") or None
def remote_region_enabled():... | mesosphere/dcos-commons | frameworks/helloworld/tests/test_region_awareness.py | Python | apache-2.0 | 3,469 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2016 Julien LE CLEACH
#
# 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 Lice... | julien6387/supervisors | supvisors/client/subscriber.py | Python | apache-2.0 | 6,689 |
from django.contrib.admin import site, ModelAdmin
from site_tracking.models import VerificationCode, TrackingCode
class VerificationCodeAdmin(ModelAdmin):
list_display = ('site', 'verification_type', 'code',)
list_editable = ('code',)
site.register(VerificationCode, VerificationCodeAdmin)
class Tracking... | wlashell/lyrical_page | site_tracking/admin.py | Python | apache-2.0 | 493 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | skuda/client-python | kubernetes/client/models/v1_label_selector.py | Python | apache-2.0 | 4,559 |
import sys
from setuptools import setup
from setuptools import find_packages
version = '0.20.0.dev0'
# Please update tox.ini when modifying dependency version requirements
install_requires = [
'acme=={0}'.format(version),
'certbot=={0}'.format(version),
'mock',
'python-augeas',
# For pkg_resourc... | jsha/letsencrypt | certbot-apache/setup.py | Python | apache-2.0 | 2,131 |
from flask import render_template
from flask.ext.appbuilder.models.sqla.interface import SQLAInterface
from flask.ext.appbuilder import ModelView
from app import appbuilder, db
"""
Create your Views::
class MyModelView(ModelView):
datamodel = SQLAInterface(MyModel)
Next, register your Views::
... | msampathkumar/rms | app/old_views.py | Python | apache-2.0 | 709 |
"""
This module calls the AWS ListMetrics() API followed by multiple calls to
GetMetricStatistics() to get metrics from AWS.
A dictionary configured by the 'metrics' key in the configuration file is
used to determine which metrics should lead to a call to GetMetricStatistics().
Each metric value returned from GetMetr... | wavefrontHQ/wavefront-collector | wavefront/awsmetrics.py | Python | apache-2.0 | 18,849 |
from collections import OrderedDict
# Model class for resource elements
class Resource:
def __init__(self,uri,label,support,keyword):
self.uri = uri # URI of the resource.
self.label = label # Label of the resource
self.support = int(support) # Importance/ represents the number ... | usc-isi-i2/graph-keyword-search | src/resourceGraph.py | Python | apache-2.0 | 2,182 |
#! /usr/bin/python
#
# Copyright 2016 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 agreed to i... | xively/node-red-nodes | hardware/sensehat/sensehat.py | Python | apache-2.0 | 6,966 |
#!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import json
import copy
from netaddr import IPNetwork
from pprint import pformat
from vnc_api.vnc_api import *
from vnc_admin_api import VncApiAdmin
def get_ip(ip_w_pfx):
return str(IPNetwork(ip_w_pfx).ip)
# end get_ip
clas... | nischalsheth/contrail-controller | src/config/utils/provision_bgp.py | Python | apache-2.0 | 7,230 |
from __future__ import print_function
from datetime import datetime
import unittest
from mock import patch
import netkraken
from testhelper import myAssertDictEqual
class NetKrakenTests(unittest.TestCase):
def test_get_timestamp(self):
self.assertEquals(("minute", "2042-12-12T12:12"),
... | arnehilmann/netkraken | src/unittest/python/netkraken_tests.py | Python | apache-2.0 | 1,468 |
from ray.rllib.utils.deprecation import deprecation_warning
from ray.rllib.utils.tf_utils import * # noqa
deprecation_warning(
old="ray.rllib.utils.tf_ops.[...]",
new="ray.rllib.utils.tf_utils.[...]",
error=True,
)
| ray-project/ray | rllib/utils/tf_ops.py | Python | apache-2.0 | 229 |
from setuptools import setup
long_description = """A collection of heuristic algorithms for solving the 2D knapsack problem,
also known as the bin packing problem. In essence packing a set of rectangles into the
smallest number of bins."""
setup(
name="rectpack",
version="0.2.2",
description="2D Rectangle... | secnot/rectpack | setup.py | Python | apache-2.0 | 876 |
"""
Support for Portage
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
:optdepends: - portage Python adap... | saltstack/salt | salt/modules/ebuildpkg.py | Python | apache-2.0 | 39,670 |
x = 10
print("id(x) is ", id(x))
y = 20
print("id(y) is ", id(y))
print("id(x) == id(y): ", id(x) == id(y))
| padmacho/pythontutorial | objects/id_demo.py | Python | apache-2.0 | 113 |
#!/usr/bin/env python
#
# Copyright 2011 Splunk, 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 ... | rmak/splunk-sdk-python | examples/handlers/handler_urllib2.py | Python | apache-2.0 | 1,492 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 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 app... | openstack/neutron-vpnaas | doc/source/conf.py | Python | apache-2.0 | 8,813 |
from __future__ import print_function
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
# number 1 to 10 data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def compute_accuracy(v_xs, v_ys):
global prediction
y_pre = sess.run(prediction, feed_dict={xs: v_xs, keep... | del680202/MachineLearning-memo | src/tensorflow/cnn_deep_with_dropout.py | Python | apache-2.0 | 3,448 |
import json
import numpy as np
from gameanalysis import dominance
from gameanalysis import gamegen
from gameanalysis import gameio
from gameanalysis import rsgame
def test_weakly_dominated():
profiles = [
[2, 0],
[1, 1],
[0, 2],
]
payoffs = [
[2, 0],
[2, 1],
... | yackj/GameAnalysis | test/dominance_test.py | Python | apache-2.0 | 5,333 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Last modified: Wang Tai (i@wangtai.me)
"""
"""
__revision__ = '0.1'
from unittest import TestCase
class simpleTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testExample(self):
from gif_thumb import create_thumb... | wangtai/py_gif_processor | test.py | Python | apache-2.0 | 761 |
from lab.nodes import LabNode
class Asr(LabNode):
def cmd(self, command):
from fabric.api import settings, run
with settings(host_string='{user}@{ip}'.format(user=self._username, ip=self._ip), password=self._password, connection_attempts=50, warn_only=False):
return run(command, shell... | CiscoSystems/os-sqe | lab/nodes/asr.py | Python | apache-2.0 | 393 |
# -*- coding: utf-8 -*-
# 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... | googleapis/python-aiplatform | samples/generated_samples/aiplatform_generated_aiplatform_v1_model_service_export_model_sync.py | Python | apache-2.0 | 1,552 |
# -*- coding: utf-8 -*-
"""
Test parsing of strings that are phrases with the
ptc.StartTimeFromSourceTime flag set to True
"""
import sys
import time
import datetime
import unittest
import parsedatetime as pdt
from parsedatetime.context import pdtContext
from . import utils
class test(unittest.TestCase):
@utils.... | bear/parsedatetime | tests/TestStartTimeFromSourceTime.py | Python | apache-2.0 | 2,109 |
# ! /usr/bin/env python
from __future__ import print_function
import random
from terminalone import T1, filters
from terminalone.utils import credentials
from terminalone.vendor import six
from terminalone.errors import AuthRequiredError
from dotenv import load_dotenv
import os
dotenv_path = os.path.join(os.getcwd... | MediaMath/t1-python | run_acs.py | Python | apache-2.0 | 8,732 |
"""
Binary Tree
"""
import sys,random
class Tree:
def __init__(self, item, left=None, right=None):
self.item = item
self.left = left
self.right = right
def __repr__(self):
return "Tree(%s)" % str(self.item)
def insert(tree, a):
"""
Insert an item into the tree. This is... | cbare/Etudes | python/binary_tree.py | Python | apache-2.0 | 5,399 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future.utils import bytes_to_native_str
from hypothesis import given
import hypothesis.strategies as st
import unittest
from caffe2.proto import caffe2_pb2
from caf... | xzturn/caffe2 | caffe2/python/core_gradients_test.py | Python | apache-2.0 | 34,409 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from leagueofladders import settings
urlpatterns = patterns('',
url(r'^l/', include('leagueofladders.apps.myleague.urls', namespace='myleague')),
url(r'^admin/', include(admin.site.urls)... | dylanseago/LeagueOfLadders | leagueofladders/urls.py | Python | apache-2.0 | 420 |
__author__ = 'popov.sn'
from selenium.webdriver.firefox.webdriver import WebDriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self):
self.wd = WebDriver()
self.wd.implicitly_wait(2)
... | popovsn777/python_training_2 | fixture/application.py | Python | apache-2.0 | 807 |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'],
[TestAction.create_volume, 'volume1', 'cluster=cluster2', ... | zstackio/zstack-woodpecker | integrationtest/vm/mini/multiclusters/paths/multi_path131.py | Python | apache-2.0 | 2,990 |
#---------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# Gabriel de Queiroz Sousa 1715310044
# Lucas Gabriel Silveira Duarte 1715310053
# Matheus de Olive... | jucimarjr/IPC_2017-1 | lista06/lista06_lista04_questao14.py | Python | apache-2.0 | 1,317 |
# -*- coding:utf-8 -*-
import re, json, time, codecs, urllib, requests, click
from tyc_conf_and_parse import *
class TianYanCha():
item = None
session = requests.session()
session.cookies.set("tnet", "123.114.125.92")
referer_url = get_conf('referer_url')
public_headers = get_conf('public_headers')... | AisinoPythonTeam/PythonAiniso | gjqyxyxxcxxt/gjqyxyxxcxxt/spiders/parser/tyc_dispatcher.py | Python | apache-2.0 | 3,856 |
#!/usr/bin/env python
# encoding: utf-8
# Copyright 2014 Xinyu, He <legendmohe@foxmail.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 at
#
# http://www.apache.org/licenses/LICENSE-2.0... | fangjing828/LEHome | home.py | Python | apache-2.0 | 9,281 |
#
# Autogenerated by Thrift Compiler (0.8.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException
from ttypes import *
| humangeo/rawes | rawes/thrift_elasticsearch/constants.py | Python | apache-2.0 | 220 |
import glob
import json
import pkg_resources
from collections import defaultdict, namedtuple
from multiprocessing import Value
from unittest import TestCase
import snappy
from perfrunner.settings import ClusterSpec, TestConfig
from perfrunner.workloads.bigfun.query_gen import new_queries
from perfrunner.workloads.tcm... | couchbase/perfrunner | unittests.py | Python | apache-2.0 | 28,115 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Cisco 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... | armando-migliaccio/neutron | neutron/plugins/cisco/network_plugin.py | Python | apache-2.0 | 17,219 |
import logging
from datetime import timedelta
from core import Feed
from core.errors import ObservableValidationError
from core.observables import Ip
class AlienVaultIPReputation(Feed):
default_values = {
"frequency": timedelta(hours=4),
"name": "AlienVaultIPReputation",
"source": "http:/... | yeti-platform/yeti | plugins/feeds/public/alienvault_ip_reputation.py | Python | apache-2.0 | 1,699 |
#!/usr/bin/env python3
# Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | google/pigweed | pw_presubmit/py/presubmit_test.py | Python | apache-2.0 | 1,944 |
# 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 t... | jamielennox/python-kiteclient | kiteclient/common/meta_data.py | Python | apache-2.0 | 1,416 |
# Copyright 2016-2017 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 ... | jimmyraywv/cloud-custodian | c7n/resources/account.py | Python | apache-2.0 | 35,461 |
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | pombredanne/pymaven | tests/test_client.py | Python | apache-2.0 | 8,637 |
# Copyright 2020 Makani Technologies 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... | google/makani | config/base_station/sim/perch_sim.py | Python | apache-2.0 | 5,391 |
#!/usr/bin/python -u
# Copyright (c) 2010-2011 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/LICENSE-2.0
#
# Unless required by applica... | ceph/swift | test/functional/tests.py | Python | apache-2.0 | 63,978 |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | google-research/google-research | task_set/tasks/fixed/fixed_mlp_ae_test.py | Python | apache-2.0 | 1,322 |
import io
import shutil
import tarfile
import zipfile
import tempfile
from synapse.tests.common import *
import synapse.exc as s_exc
import synapse.lib.filepath as s_filepath
class TestFilePath(SynTest):
def test_filepath_objects(self):
temp_dir = tempfile.mkdtemp()
name = temp_dir
# F... | williballenthin/synapse | synapse/tests/test_lib_filepath.py | Python | apache-2.0 | 12,830 |
# Copyright (c) 2005-2015 Apple 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... | red-hood/calendarserver | txdav/caldav/datastore/scheduling/ischedule/scheduler.py | Python | apache-2.0 | 22,345 |
from __future__ import absolute_import
from docker_registry_client.Image import Image
from docker_registry_client._BaseClient import BaseClientV1
from tests.mock_registry import mock_v1_registry
class TestImage(object):
def test_init(self):
url = mock_v1_registry()
image_id = 'test_image_id'
... | twaugh/docker-registry-client | tests/test_image.py | Python | apache-2.0 | 409 |
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | google/qkeras | qkeras/qpooling.py | Python | apache-2.0 | 6,418 |
# -*- 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 | google/cloud/securitycenter_v1p1beta1/types/source.py | Python | apache-2.0 | 2,762 |
# -*- encoding: 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, softwar... | rdo-management/tuskar | tuskar/tests/storage/drivers/test_base.py | Python | apache-2.0 | 3,829 |
# 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... | tensorflow/tensorboard | tensorboard/plugins/scalar/scalars_plugin.py | Python | apache-2.0 | 6,802 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import uuid
class Migration(migrations.Migration):
dependencies = [
('core', '0040_auto_add_status_types'),
]
operations = [
migrations.CreateModel(
... | CCI-MOC/GUI-Backend | core/migrations/0041_user_ssh_keys.py | Python | apache-2.0 | 1,036 |
# Copyright 2015 Isotoma 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 agreed to in writing... | yaybu/touchdown | touchdown/aws/route53/alias_target.py | Python | apache-2.0 | 689 |
# 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... | derekjchow/models | research/object_detection/builders/model_builder.py | Python | apache-2.0 | 23,976 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-26 12:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('codenerix_products', '0011_auto_20180202_0826'),
]
operations = [
migration... | centrologic/django-codenerix-products | codenerix_products/migrations/0012_productunique_caducity.py | Python | apache-2.0 | 516 |
# coding=utf-8
# Copyright 2017 Christopher Bartz <bartz@dkrz.de>
#
# 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... | cbartz/git-lfs-swift-server | git_lfs_swift_server/__init__.py | Python | apache-2.0 | 637 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'ssssss.views.home', name='home'),
# ... | huaijiefeng/contact-sync-server | contactsync/urls.py | Python | apache-2.0 | 759 |
#!/usr/bin/env python
from distutils.core import setup
setup(
name='hapipy',
version='2.5.0',
description="A python wrapper around HubSpot's APIs",
long_description = open('README.md').read(),
author='HubSpot Dev Team',
author_email='devteam+hapi@hubspot.com',
url='https://github.com/HubSpo... | ack8006/hapipy | setup.py | Python | apache-2.0 | 561 |
from unittest import mock
from aiohttp import web
import pytest
from aiohttp.test_utils import make_mocked_coro
from sockjs.transports import htmlfile
@pytest.fixture
def make_transport(make_manager, make_request, make_handler, make_fut):
def maker(method="GET", path="/", query_params={}):
handler = mak... | aio-libs/sockjs | tests/test_transport_htmlfile.py | Python | apache-2.0 | 2,175 |
import json
import logging
import os
import re
from .. import auth
from .. import constants
from .. import errors
from .. import utils
log = logging.getLogger(__name__)
class BuildApiMixin(object):
def build(self, path=None, tag=None, quiet=False, fileobj=None,
nocache=False, rm=False, stream=Fal... | vpetersson/docker-py | docker/api/build.py | Python | apache-2.0 | 13,266 |
import numpy as np
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.preprocessors import get_preprocessor
from ray.rllib.models.tf.recurrent_net import RecurrentNetwork
from ray.rllib.models.torch.recurrent_net import RecurrentNetwork as TorchRNN
from ray.rllib.utils.annotations import override
from ... | ray-project/ray | rllib/examples/models/rnn_model.py | Python | apache-2.0 | 5,133 |
#MenuTitle: Set Preferred Names (Name IDs 16 and 17) for Width Variants
# -*- coding: utf-8 -*-
__doc__="""
Sets Preferred Names custom parameters (Name IDs 16 and 17) for all instances, so that width variants will appear in separate menus in Adobe apps.
"""
thisFont = Glyphs.font # frontmost font
widths = (
"Narrow"... | schriftgestalt/Mekka-Scripts | Font Info/Set Preferred Names (Name IDs 16 and 17).py | Python | apache-2.0 | 1,956 |
import os
import shutil
def copytree(src, dst, symlinks=False, ignore=None):
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
shutil.copytree(s, d, symlinks, ignore)
else:
shutil.copy2(s, d)
def get_... | gengjiawen/migratetogradle | file_util.py | Python | apache-2.0 | 440 |
"""add date to static pages
Revision ID: 4d46f8aeed5
Revises: 39f25296cd6
Create Date: 2017-06-30 11:38:03.428087
"""
# revision identifiers, used by Alembic.
revision = '4d46f8aeed5'
down_revision = '39f25296cd6'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Ale... | Code4SA/pmg-cms-2 | migrations/versions/4d46f8aeed5_add_date_to_static_pages.py | Python | apache-2.0 | 840 |
#!/usr/bin/env python
#
# Copyright 2014 (c) Lei Xu <eddyxu@gmail.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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | vsfs/vsfs-bench | ec2/vsfs_ec2.py | Python | apache-2.0 | 43,680 |
LIMIT = 2000000
SIZE = (LIMIT - 1) // 2
def f():
ans = 2
sieve = [False] * SIZE
for i in range(0, SIZE):
if not sieve[i]:
p = 2 * i + 3
ans += p
for j in range(p * p, LIMIT, 2 * p):
sieve[(j - 3) // 2] = True
return ans
import ctypes
imp... | japaric/eulermark.rs | problems/010/010.py | Python | apache-2.0 | 1,006 |
#!/usr/bin/env python
"""
Driver for OpenVPN client
"""
import time
import base64
import hashlib
import struct
import hmac
import pollengine
# ---
class OVDriveData:
"""OpenVPN authentication data"""
def __init__( self ):
self.otp_secret = NO_SECRET
# ---
class ShellAdmin:
"""Driver for admin ... | cnamejj/PollEngine | just-otp.py | Python | apache-2.0 | 4,562 |
#!/usr/bin/env python
from setuptools import setup
setup(
name='phantom-requests',
version='0.0.1',
description='Use PhantomJS As You Are Using Requests.',
author='Tomer Zait (RealGame)',
author_email='realgam3@gmail.com',
packages=['phantom_requests'],
package_data={
'phantom_requ... | realgam3/phantom-requests | setup.py | Python | apache-2.0 | 721 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------------------------------------------------
# INFO:
# -----------------------------------------------------------------------------------------------------------------------
"""
Authors: Evan Hu... | evhub/coconut | coconut/command/util.py | Python | apache-2.0 | 20,011 |
#
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | sassoftware/conary | conary_test/repositorytest/netclienttest.py | Python | apache-2.0 | 53,858 |
# Copyright 2014 Isotoma 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 agreed to in writing... | yaybu/touchdown | touchdown/frontends/__init__.py | Python | apache-2.0 | 761 |
# -*- coding:utf-8 -*-
import json
import logging
import os
from tornado import gen
from tornado.gen import coroutine, Task
from tornado.httpclient import AsyncHTTPClient
from tornado.ioloop import IOLoop
from tornado.web import RequestHandler
from core import settings
import constant
__author__ = 'george'
@corout... | hulingfeng211/weixin | wechat/__init__.py | Python | apache-2.0 | 2,996 |
import os
import re
import sys
# This import is apparently needed for Nose on Red Hat's Python
import multiprocessing
from distutils.command.build_ext import build_ext
from distutils.errors import (CCompilerError, DistutilsExecError,
DistutilsPlatformError)
try:
from setuptools impo... | kikinteractive/MaxMind-DB-Reader-python | setup.py | Python | apache-2.0 | 5,415 |
"""
Utilities for managing Debian preseed
.. versionadded:: 2015.8.0
"""
import shlex
import salt.utils.files
import salt.utils.stringutils
import salt.utils.yaml
def mksls(src, dst=None):
"""
Convert a preseed file to an SLS file
"""
ps_opts = {}
with salt.utils.files.fopen(src, "r") as fh_:
... | saltstack/salt | salt/utils/preseed.py | Python | apache-2.0 | 2,707 |
#!/usr/bin/env python3
#
# Copyright 2013 Simone Campagna
#
# 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 ... | simone-campagna/statcode | lib/python/statcode/project_file.py | Python | apache-2.0 | 5,340 |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | google/tangent | tests/test_compile.py | Python | apache-2.0 | 1,290 |
#codeing=utf-8
# @Time : 2017-11-08
# @Author : J.sky
# @Mail : bosichong@qq.com
# @Site : www.17python.com
# @Title : 实战:利用Django开发部署自己的个人博客(2)视图/路由
# @Url : http://www.17python.com/blog/53
# @Details : 实战:利用Django开发部署自己的个人博客(2)视图/路由
# @Other : OS X 10.11.6
# Python 3.6.1
# VSC... | bosichong/17python.com | Django/Django02.py | Python | apache-2.0 | 3,182 |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | boto/s3transfer | s3transfer/constants.py | Python | apache-2.0 | 910 |
# Copyright 2019, 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 appli... | tensorflow/model-optimization | tensorflow_model_optimization/python/core/internal/tensor_encoding/encoders/common_encoders_test.py | Python | apache-2.0 | 4,757 |
# Copyright 2020 Nokia.
#
# 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 wr... | nuagenetworks/nuage-openstack-horizon | nuage_horizon/dashboards/project/networks/workflows.py | Python | apache-2.0 | 19,029 |
# Copyright (c) 2022 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 ap... | PaddlePaddle/Paddle | python/paddle/fluid/tests/unittests/auto_parallel/test_auto_parallel_while_op.py | Python | apache-2.0 | 17,997 |
# -*- coding: utf-8 -*-
import os
MODULE_PATH = os.path.split(os.path.realpath(__file__))[0]
def typical_fixtures():
# models.User.add_system_users()
# typical_users()
pass
def typical_picture():
return open(os.path.join(MODULE_PATH, "data/led-hallway.jpg"), 'rb')
# def typical_users():
# mod... | msarfati/InstaCommander | instacommander/tests/fixtures.py | Python | apache-2.0 | 657 |
# ===============================================================================
# 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... | UManPychron/pychron | pychron/canvas/canvas2D/extraction_line_canvas2D.py | Python | apache-2.0 | 10,949 |
import olymap.char
def test_get_char_attack():
tests = (
({}, 0),
({'CH': {'at': ['60']}}, 60),
({'CH': {'de': ['1234']}}, 0),
({'IM': {'at': ['1234']}}, 0),
)
for box, answer in tests:
assert olymap.char.get_char_attack(box) == answer
def test_get_char_break_point... | olympiag3/olypy | tests/unit/test_olymap_char.py | Python | apache-2.0 | 8,125 |
import sure # noqa # pylint: disable=unused-import
import unittest
import boto3
from moto import mock_sqs, mock_ec2
from tests import EXAMPLE_AMI_ID
class TestNestedDecoratorsBoto3(unittest.TestCase):
@mock_sqs
def setup_sqs_queue(self):
conn = boto3.resource("sqs", region_name="us-east-1")
... | spulec/moto | tests/test_core/test_nested.py | Python | apache-2.0 | 736 |
from graphics import *
class Board:
def __init__(self,w,h):
self.win = GraphWin('Scrabble',w,h)
self.win.setCoords(-30,-30,180,180)
self.markers = []
tws_j = [0,0,0,7,7,14,14,14]
tws_i = [0,7,14,0,14,0,7,14]
dls_j = [0,0,2,2,3,3,3,6,6,6,6,7,7,8,8,8,8,11,11,1... | itsallvoodoo/csci-school | CSCI220/Week 13 - APR09-13/Board.py | Python | apache-2.0 | 4,833 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Entity tag interface. This file implements the interfaces that will be used
to access and store tags of an entity.
"""
import hszinc
try:
import collections.abc as col
except ImportError:
import collections as col
import weakref
from ...util.asyncexc import ... | ChristianTremblay/pyhaystack | pyhaystack/client/entity/tags.py | Python | apache-2.0 | 4,785 |
# -*- coding: utf-8 -*-
from logger.log_repository import LogRepository
from mdstudio.api.api_result import APIResult
from mdstudio.api.comparison import Comparison
from mdstudio.api.endpoint import endpoint, cursor_endpoint
from mdstudio.api.exception import CallException
from mdstudio.component.impl.core import CoreC... | MD-Studio/MDStudio | core/logger/logger/application.py | Python | apache-2.0 | 4,843 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under the Apach... | 394954369/horizon | openstack_dashboard/api/cinder.py | Python | apache-2.0 | 13,116 |
# Copyright 2017 - Nokia
#
# 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, sof... | openstack/vitrage | vitrage/tests/unit/datasources/test_transformer_base.py | Python | apache-2.0 | 1,151 |