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
# Copyright 2013 OpenStack Foundation # Copyright 2013 Rackspace Hosting # Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 co...
cp16net/trove
trove/guestagent/datastore/mysql/service.py
Python
apache-2.0
43,814
# -*- coding: utf-8 -*- # # Python-Starter documentation build configuration file, created by # sphinx-quickstart on Thu Apr 13 16:29:44 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
intel-ctrlsys/actsys
docs/conf.py
Python
apache-2.0
4,819
# Copyright 2014-2016 Open Source Robotics Foundation, 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 applicabl...
ruffsl/ros_buildfarm
ros_buildfarm/status_page.py
Python
apache-2.0
38,413
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
our-city-app/oca-backend
src/solutions/common/to/app.py
Python
apache-2.0
854
from django.conf.urls import include, url from .views import BlogIndex, BlogDetail from .feed import LatestPosts urlpatterns = [ url(r'^$', BlogIndex.as_view(), name="blog"), url(r'^feed/$', LatestPosts, name="feed_blog"), url(r'^(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/(?P<slug>\S+)$', BlogDetail.as_view(), name=...
sheshkovsky/jaryan
blog/urls.py
Python
apache-2.0
337
import numpy as np import pandas as pd from scipy import stats data = pd.read_csv("advertisement_clicks.csv") X1 = data[data['advertisement_id'] == 'A'] X2 = data[data['advertisement_id'] == 'B'] A0 = X1[X1['action'] == 0].shape[0] A1 = X1[X1['action'] == 1].shape[0] B0 = X2[X2['action'] == 0].shape[0] B1 ...
balazssimon/ml-playground
udemy/lazyprogrammer/ab-testing-python/chisquare_exercise.py
Python
apache-2.0
448
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
derekjchow/models
research/slim/nets/mobilenet/conv_blocks.py
Python
apache-2.0
13,351
# 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 agreed to in writing, ...
google/gazoo-device
gazoo_device/primary_devices/esp32_matter_allclusters.py
Python
apache-2.0
4,394
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
aselle/tensorflow
tensorflow/python/distribute/distribute_coordinator.py
Python
apache-2.0
13,612
from django.db import migrations, models VLAN_STATUS_CHOICES = ( (1, 'active'), (2, 'reserved'), (3, 'deprecated'), ) def vlan_status_to_slug(apps, schema_editor): VLAN = apps.get_model('ipam', 'VLAN') for id, slug in VLAN_STATUS_CHOICES: VLAN.objects.filter(status=str(id)).update(status...
digitalocean/netbox
netbox/ipam/migrations/0030_3569_vlan_fields.py
Python
apache-2.0
760
#!/usr/bin/env python # -*- 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 ...
pmverdugo/fiware-validator
validator/tests/api/middleware/test_ssl.py
Python
apache-2.0
1,568
# 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
basisnet/personalization/centralized_emnist/data_processing.py
Python
apache-2.0
4,786
# Copyright (c) 2014 Rackspace, 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 wr...
obulpathi/cdn1
cdn/transport/pecan/controllers/__init__.py
Python
apache-2.0
879
# Copyright 2015 Intel Corporation # 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...
lakshmisampath/searchlight
searchlight/elasticsearch/plugins/glance/metadefs.py
Python
apache-2.0
5,700
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
wavemind/mlgcb
tests/functional/tags_include.py
Python
apache-2.0
4,751
# coding=utf-8 # Copyright 2022 The TensorFlow GAN 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 applicabl...
tensorflow/gan
tensorflow_gan/examples/mnist/infogan_eval.py
Python
apache-2.0
2,490
#!/usr/bin/env python3 # # Script which serves local solr tgz files simulating an Apache mirror server # from http.server import BaseHTTPRequestHandler, HTTPServer import os import sys PORT_NUMBER = 8083 #This class will handle any incoming request class myHandler(BaseHTTPRequestHandler): def do_GET(self): ...
docker-solr/docker-solr
tools/serve_local.py
Python
apache-2.0
1,512
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import unittest fro...
pgroudas/pants
tests/python/pants_test/python/test_resolver.py
Python
apache-2.0
667
# Copyright 2012, Nachi Ueno, NTT MCL, 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 # # Unles...
jumpstarter-io/neutron
neutron/agent/securitygroups_rpc.py
Python
apache-2.0
15,480
#!/usr/bin/env python # # mintest - a minimal C unit testing framework, inspired by minunit # # Copyright 2013, Marshall Culpepper # Licensed under the Apache License, Version 2.0 # # waf tool for configuring and building mintest import os this_dir = os.path.abspath(os.path.dirname(__file__)) def options(opt): o...
marshall/mintest
mintest.py
Python
apache-2.0
919
# (c) Copyright 2015 Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
HewlettPackard/ratekeeper-neutron-ml2-plugin
patches/nova/ratekeeper_monkey_patch.py
Python
apache-2.0
2,041
#!/usr/bin/env python # coding=utf-8 """围绕mysql官方python数据库驱动,对torndb极简改造 torndb原为facebook/tornado的一部分,自3.0版本后已经剥离成独立的开源项目""" from __future__ import absolute_import, division, with_statement import copy import itertools import logging import os import time try: from mysql import connector except ImportError: ...
cyouwork/Python_Factory
DbUtil/itorndb.py
Python
apache-2.0
5,890
"""Convenience Validations for working with Cassandra""" from fabric.operations import run from alarmageddon.validations.validation import Priority from alarmageddon.validations.ssh import SshValidation def _get_percentage(text): """Converts strings like '12.2' or '32.4%' into floating point numbers.""" tex...
curtisallen/Alarmageddon
alarmageddon/validations/cassandra.py
Python
apache-2.0
4,308
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 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/LICE...
sridevikoushik31/nova
nova/tests/virt/xenapi/test_volumeops.py
Python
apache-2.0
8,108
import pytest import sys import time from random import random try: import pytest_timeout except ImportError: pytest_timeout = None import ray import ray.cluster_utils from ray._private.test_utils import wait_for_condition from ray.util.placement_group import placement_group, remove_placement_group def run...
ray-project/ray
python/ray/tests/test_placement_group_mini_integration.py
Python
apache-2.0
4,294
# -*- 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
monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py
Python
apache-2.0
52,223
# Copyright 2015 Spotify AB # # 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, so...
nresare/ssh-agent-proxy-python
tests/list_and_dump.py
Python
apache-2.0
1,214
# # repos.py: public Python interface for repos components # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. # ###################################################################### # Licensed to the Apache Software Foundation (ASF) under one # or more contrib...
YueLinHo/Subversion
subversion/bindings/swig/python/svn/repos.py
Python
apache-2.0
12,959
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 NEC Corporation # 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...
sajuptpm/neutron-ipam
neutron/tests/unit/_test_extension_portbindings.py
Python
apache-2.0
17,806
_base_ = '../mask_rcnn/mask_rcnn_r50_fpn_2x_coco.py' model = dict( backbone=dict( type='Res2Net', depth=101, scales=4, base_width=26, init_cfg=dict( type='Pretrained', checkpoint='open-mmlab://res2net101_v1d_26w_4s')))
open-mmlab/mmdetection
configs/res2net/mask_rcnn_r2_101_fpn_2x_coco.py
Python
apache-2.0
287
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
our-city-app/oca-backend
src/rogerthat/bizz/payment/to.py
Python
apache-2.0
1,164
from ...call_builder.base import BaseOffersCallBuilder from ...call_builder.call_builder_async.base_call_builder import BaseCallBuilder from ...client.base_async_client import BaseAsyncClient from ...type_checked import type_checked __all__ = ["OffersCallBuilder"] @type_checked class OffersCallBuilder(BaseCallBuilde...
StellarCN/py-stellar-base
stellar_sdk/call_builder/call_builder_async/offers_call_builder.py
Python
apache-2.0
887
# # Copyright 2019 The FATE 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...
FederatedAI/FATE
python/fate_arch/storage/hdfs/_table.py
Python
apache-2.0
5,051
""" ICS Ops Common Library """ import os from os.path import dirname from os.path import realpath from os.path import join as pathjoin import boto __version__ = "0.0.3.3" __release__ = "alpha" CONFIG = "opslib.ini" LOG_NAME = "opslib" AWS_ACCESS_KEY_NAME = "aws_access_key_id" AWS_SECRET_KEY_NAME = "aws_secret_acces...
henrysher/opslib
opslib/__init__.py
Python
apache-2.0
1,905
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com from lib import environment from lib.constants import url from lib.page.widg...
jmakov/ggrc-core
test/selenium/src/lib/page/widget/admin_people.py
Python
apache-2.0
457
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Views tests for the OSF.''' from __future__ import absolute_import import unittest import json import datetime as dt import mock import httplib as http from nose.tools import * # noqa PEP8 asserts from tests.test_features import requires_search from modularodm import...
barbour-em/osf.io
tests/test_views.py
Python
apache-2.0
162,417
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Glossary.slug' db.add_column(u'core_glossary', 'slug', self.gf('django...
shh-dlce/pulotu
website/apps/core/migrations/0031_auto__add_field_glossary_slug.py
Python
apache-2.0
9,362
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, ...
bernard357/shellbot
examples/todos.py
Python
apache-2.0
3,482
class QuietImplementationRunner: def __init__(self): pass def run(self): pass
julianghionoiu/tdl-client-python
test/runner/quiet_implementation_runner.py
Python
apache-2.0
104
# 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 agreed to in writing, s...
googleapis/python-storage
tests/conformance/conftest.py
Python
apache-2.0
3,881
# Copyright 2014 Rackspace, 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 writin...
ramineni/myironic
ironic/tests/drivers/test_agent_client.py
Python
apache-2.0
4,574
#!/usr/bin/python2.5 # # Copyright 2008 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 ...
dinomite/uaParser
uaParser/test/test_user_agent_parser.py
Python
apache-2.0
6,889
from django.core.urlresolvers import reverse_lazy from django.conf.urls import url from django.contrib.auth import views from core.views import HomeView, UserAuthView, UserCreateView urlpatterns = [ url(r'^$', HomeView.as_view(), name='home'), url(r'^login/$', UserAuthView.as_view(), ...
lamenezes/agendi
core/urls.py
Python
apache-2.0
542
# -*- 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-aiplatform
samples/generated_samples/aiplatform_v1_generated_tensorboard_service_read_tensorboard_blob_data_sync.py
Python
apache-2.0
1,581
# # 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...
lulf/qpid-dispatch
python/qpid_dispatch_internal/tools/command.py
Python
apache-2.0
9,029
# Copyright 2015 iNuron NV # # Licensed under the Open vStorage Modified Apache License (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.openvstorage.org/license # # Unless required by applicable law or agreed to in writing,...
openvstorage/openvstorage-flocker-driver
openvstorage_flocker_plugin/__init__.py
Python
apache-2.0
1,409
#! /usr/bin/python import socket from ansible.module_utils import mt_api from ansible.module_utils.basic import AnsibleModule def main(): module = AnsibleModule( argument_spec=dict( hostname=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), )...
zahodi/ansible-mikrotik
library/mt_login_test.py
Python
apache-2.0
1,151
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/...
rcbops/glance-buildpackage
glance/registry/db/migration.py
Python
apache-2.0
3,992
# SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2017, ARM Limited and contributors. # # 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 # # ...
credp/lisa
tests/test_wlgen_rtapp.py
Python
apache-2.0
10,670
from io import StringIO from unittest import TestCase from genty import genty, genty_dataset @genty class TestMultiprocessStringIO(TestCase): _unicode_string = 'Plain Hello' _unicode_string_non_ascii = 'ńőń ȁŝćȉȉ ŝƭȕƒƒ' def setUp(self): super().setUp() from flaky.multiprocess_string_io i...
box/flaky
test/test_multiprocess_string_io.py
Python
apache-2.0
1,556
''' Created on 24.01.2015 @author: Iris ''' from Component.Component import Component from Network import xprotocol from IdleState import IdleState class SessionHandler(Component): def __init__(self): Component.__init__(self) self.state = None self.peers = set() self.num_players =...
irisSchaffer/component-based-asteroids
State/SessionHandler.py
Python
apache-2.0
702
# 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, print_function, unicode_literals import os import unittest from pants.build_graph.address import Address from pants.build...
foursquare/pants
tests/python/pants_test/build_graph/test_build_file_aliases.py
Python
apache-2.0
5,509
# Copyright 2010-2011 OpenStack Foundation # Copyright 2011 Piston Cloud Computing, Inc. # All Rights Reserved. # 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 Li...
ewindisch/nova
nova/tests/api/openstack/compute/test_servers.py
Python
apache-2.0
193,825
import uuid import requests import logging import logging.handlers import flask_restful from functools import wraps from flask import request from flask_cors import CORS from flask_restful import Resource, reqparse from sqlalchemy.orm.relationships import RelationshipProperty from .. import db, app from ..models im...
eResearchSA/reporting-unified
unified/apis/__init__.py
Python
apache-2.0
10,242
# Copyright 2019 DeepMind Technologies Limited. 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 ...
deepmind/rlax
rlax/_src/nonlinear_bellman.py
Python
apache-2.0
7,670
#!/usr/bin/env python import os import math from collections import Iterable, OrderedDict import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.ioff() from matplotlib.patches import Rectangle from matplotlib.colors import LinearSegmentedColormap from matplotlib import cm fro...
mahajrod/MACE
MACE/Routines/Drawing.py
Python
apache-2.0
49,658
""" Contains PascalVOC dataset and labels for different tasks """ import os from os.path import dirname, basename from io import BytesIO import tarfile import tempfile from collections import defaultdict import PIL import tqdm import numpy as np import requests from . import ImagesOpenset class BasePascal(ImagesOp...
analysiscenter/dataset
batchflow/opensets/pascal.py
Python
apache-2.0
7,260
# Copyright 2014 Kylincloud # # 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 ...
xuweiliang/Codelibrary
openstack_dashboard/dashboards/admin/networks/agents/tables.py
Python
apache-2.0
3,868
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import matplotlib from pylab import * import numpy from copy_reg import remove_extension from heapq import heappush from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA colors = ["red", "green", "blue", "orange", "brown", "black",...
mavlyutovrus/interval_index
python/graphs_9_hdfs_indices.py
Python
apache-2.0
5,475
# 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
libcloud/compute/drivers/dummy.py
Python
apache-2.0
9,524
"""Parse the biothings schema""" from .config import BIOTHINGS_SCHEMA_URL, PREFIX_TO_REMOVE from .utils.dataload import load_json_or_yaml from .utils.common import remove_prefix class SchemaParser(): def __init__(self): self.schema_json = remove_prefix(load_json_or_yaml(BIOTHINGS_SCHEMA_URL), ...
biothings/biothings_explorer
biothings_explorer/_deprecated_schema_parser.py
Python
apache-2.0
1,071
# Zed Attack Proxy (ZAP) and its related class files. # # ZAP is an HTTP/HTTPS proxy for assessing web application security. # # Copyright 2022 the ZAP development team # # 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...
zaproxy/zap-api-python
src/zapv2/authentication.py
Python
apache-2.0
3,748
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Mixins to add common attributes and relationships. Note, all model classes must also inherit from ``db.Model``. For example: color color .. class Market(BusinessObject, db.Model): __tablena...
AleksNeStu/ggrc-core
src/ggrc/models/mixins/__init__.py
Python
apache-2.0
26,526
from quark_runtime import * import quark.reflect import marshalling_md import quark class Inner(object): def _init(self): self.inner_int = None self.inner_string = None self.inner_float = None self.inner_string_list = None def __init__(self): self._init() def setup(self,...
bozzzzo/quark
quarkc/test/emit/expected/py/marshalling/m/__init__.py
Python
apache-2.0
3,469
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
Fokko/incubator-airflow
airflow/operators/pig_operator.py
Python
apache-2.0
2,775
from allocation.models.inputs import TimeUnit, Provider, Machine, Size, Instance, InstanceHistory, AllocationIncrease, AllocationUnlimited, AllocationRecharge, Allocation from allocation.models.results import InstanceHistoryResult, InstanceResult, TimePeriodResult, AllocationResult from allocation.models.rules import R...
CCI-MOC/GUI-Backend
allocation/models/__init__.py
Python
apache-2.0
866
# 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 agreed to in writing, ...
google/jax
tests/lax_autodiff_test.py
Python
apache-2.0
51,968
import pyglet from gamewindow import GameWindow from menu import MainMenuState from pyglet.gl import * window = GameWindow(width=800, height=600) pyglet.gl.glClearColor(0.1, 0.1, 1.0, 1.0); glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) pyglet.resource.path = ['assets'] pyglet.resourc...
chris-statzer/survivebynine
test_states.py
Python
apache-2.0
383
#!/usr/bin/env python from __future__ import print_function import pyacc class App(pyacc.AccCommandLineApp): """ List controllers """ def build_arg_parser(self): """ Add some more args to the standard set """ super(App, self).build_arg_parser() self.parser.add...
CA-APM/ca-apm-acc-api-scripts
python-library-and-examples/controllers.py
Python
apache-2.0
1,784
from primitive_pb2 import Amount, uint256 UINT64_NUMBER = int(18446744073709551616) def amount_to_int(amount): """ Translater Protobuf Amount -> python int type Args: amount ( `Amount` ) : protobuf amount type ( don't care precision ) Returns: int: int value equal to arg amount. ""...
MizukiSonoko/iroha-cli
iroha_cli/libs/amount.py
Python
apache-2.0
1,298
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core import caffe2.python.hypothesis_test_util as hu import hypothesis from hypothesis import given import hypothesis.strategies as st import n...
bwasti/caffe2
caffe2/python/operator_test/momentum_sgd_test.py
Python
apache-2.0
3,891
import struct from graphene.storage.base.general_store import * from graphene.storage.base.relationship import * class RelationshipStore(GeneralStore): """ Handles storage of relationships to a file. It stores relationships using the format: (inUse_direction, firstNode, secondNode, relType, firstPrev...
PHB-CS123/graphene
graphene/storage/base/relationship_store.py
Python
apache-2.0
7,198
# # Database Cursor # import pscheduler import psycopg2 import sys import threading import time from .log import log module = sys.modules[__name__] module.tries = 10 module.interval = 0.5 module.threadlocal = threading.local() module.dsn = None # DSN for DB connection def dbcursor_init(dsn): """Initialize...
perfsonar/pscheduler
pscheduler-server/pscheduler-server/api-server/pschedulerapiserver/dbcursor.py
Python
apache-2.0
3,080
from math import * class Point: def __init__(self, _x, _y): self.x =_x self.y=_y def distance (self, p2): dx = p2.x - self.x dy = p2.y - self.y return sqrt(dx*dx + dy*dy) def __eq__(self, other): return self.x == other.x and self.y == other.y a = Point(0,0...
TerekhovaKate/Python_training
1.py
Python
apache-2.0
393
"""Test suite for the runtime profiler.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from pyperf.profilers import runtime def test_runtime_gives_reasonable_results(): """Ensure runtime is measured within s...
kevinconway/PyPerf
tests/profilers/test_runtime.py
Python
apache-2.0
672
#!/usr/bin/env python # # Author: Qiming Sun <osirpt.sun@gmail.com> # ''' A simple example to run DOCI-CASCI and DOCI-CASSCF calculation. ''' from pyscf import gto from pyscf import doci mol = gto.M(atom='N 0 0 0; N 0 0 2.', basis='6-31g') mf = mol.RHF().run() mc = doci.CASSCF(mf, 18, 14) mc.verbose = 4 mc.kernel() ...
gkc1000/pyscf
examples/doci/00-simple_doci_casscf.py
Python
apache-2.0
361
#!/usr/bin/env python # Cloudsnake Application server # Licensed under Apache License, see license.txt # Author: Markus Gronholm <markus@alshain.fi> Alshain Oy import libCloudSnakeClient as SnakeClient import pprint, sys, time client = SnakeClient.CloudSnakeClient( 'http://localhost:8500', sys.argv[ 1 ] ) mapped...
Alshain-Oy/Cloudsnake-Application-Server
clients/client_analytics_clear.py
Python
apache-2.0
451
from datetime import date from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.urls import reverse from rest_framework import status from dcim.models import Site from extras.constants import CF_TYPE_TEXT, CF_TYPE_INTEGER, CF_TYPE_BOOLEAN, CF_TYPE_DATE, CF_TYPE_SELECT...
lampwins/netbox
netbox/extras/tests/test_customfields.py
Python
apache-2.0
13,178
import logging from zentral.core.exceptions import ImproperlyConfigured default_app_config = "zentral.core.compliance_checks.apps.ZentralComplianceChecksAppConfig" logger = logging.getLogger("zentral.core.compliance_checks") # compliance checks classes compliance_check_classes = {} def register_compliance_che...
zentralopensource/zentral
zentral/core/compliance_checks/__init__.py
Python
apache-2.0
1,092
import shutil import argparse import os import subprocess import SimpleHTTPServer import SocketServer import socket parser = argparse.ArgumentParser( description = 'Present summary of tests results in a webpage.' ) parser.add_argument("--root", default="logs.racktest") parser.add_argument("--whiteboxRoot", action="sto...
Stratoscale/pycommonlog
js/main.py
Python
apache-2.0
1,322
# 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-research/federated
reconstruction/reconstruction_model.py
Python
apache-2.0
5,300
# -*- coding: utf-8 -*- print "#"*3 +" Iterativos "+"#"*3 print "while:" x = 0 while x <= 5: print x x += 1 print "\nfor-in:" for x in range(5): print x print "\nbreak:" for x in range(5): if x == 2: break print x print "\ncontinue:" nuevo = "" for x in "abac": if x != "a": ...
mario21ic/python_curso
session1/9_iterativos.py
Python
apache-2.0
356
# Copyright (c) 2012 OpenStack Foundation. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
sajuptpm/neutron-ipam
neutron/tests/unit/test_extension_security_group.py
Python
apache-2.0
72,038
import os serverA = open('serverlistA.list', 'r') serverB = open('serverlistB.list', 'r') numA = int(serverA.readline()) numB = int(serverB.readline()) iplistA = open('iplistA', 'w') iplistB = open('iplistB', 'w') sshconfig = open('/Users/iqua/.ssh/config', 'w') csshconfig = open('/etc/clusters', 'w') csshconfig.wr...
NetX-lab/RepNet
exp_code/0_setiplist.py
Python
apache-2.0
1,777
# Copyright 2017 The Chromium Authors. # # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd. """Command line interface to Chromium Code Search. Currently emits JSON formatted responses from the Chromium Cod...
karlinjf/ChromiumXRefs
third_party/codesearch/__main__.py
Python
apache-2.0
7,908
# coding: utf-8 """Predefined and pretrained models.""" from . import model_store from . import vision
hesseltuinhof/mxnet
python/mxnet/gluon/model_zoo/__init__.py
Python
apache-2.0
105
# 'Data Science from Scratch' Chapter 1 exampl # Create list of users userNames = ["Hero", "Dunn", "Sue", "Chi", "Thor", "Clive", "Hicks", "Devin", "Kate", "Klein"] users = [] for ind, name in enumerate( userNames ): users.append( {"id": ind, "name": name}) # Helper function to get id get_id = lambda userlist...
mattmcd/PyAnalysis
scripts/dsfs_chapter01.py
Python
apache-2.0
3,086
#!/usr/bin/env python # 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...
googlecodelabs/cts-snippets
jobs-and-companies-codelab/list_companies.py
Python
apache-2.0
1,392
#!/usr/bin/env python # Copyright (C) 2015 Wayne Warren # # 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...
tamac-io/jenkins-job-builder
jenkins_jobs/cli/entry.py
Python
apache-2.0
5,508
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
elastic/elasticsearch-py
elasticsearch/_sync/client/xpack.py
Python
apache-2.0
4,223
""" The function cache system allows for data to be stored on the master so it can be easily read by other minions """ import logging import time import traceback import salt.channel.client import salt.crypt import salt.payload import salt.transport import salt.utils.args import salt.utils.dictupdate import salt.util...
saltstack/salt
salt/modules/mine.py
Python
apache-2.0
19,294
import os import subprocess import tempfile import time from config import dataDir from scapetesting.fileEval.FileEvaluation import fileReportLoader, fileEval __author__ = 'abr' def fileRunner(reportfile): with open(reportfile,"w") as fileThing: start = time.time() for dir, dirs, files in os.walk(...
openpreserve/Scape-Tool-Tester
app/fileEvaluator.py
Python
apache-2.0
985
""" Generates HTML from markdown Usage: practice.py <filepath> """ import docopt import os from jinja2 import Environment from jinja2 import PackageLoader from jinja2 import Template def generator(lines): """ >>> lines = ['Question: 1', 'Option: 1', 'Question: 2', 'Option: 3', "Question: 3", "Option: 4"] >>> qu...
derekwan1/practice
practice/practice.py
Python
apache-2.0
1,441
import functools import inspect import random from math import pi from operator import mul import numpy as np import pytest from pyquil.api import WavefunctionSimulator from pyquil.gates import ( CNOT, CPHASE, H, HALT, I, MEASURE, MOVE, PHASE, RESET, RX, RY, RZ, SWA...
rigetticomputing/pyquil
pyquil/simulation/tests/test_reference_wavefunction.py
Python
apache-2.0
26,274
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
grehx/spark-tk
regression-tests/sparktkregtests/testcases/dicom/take_dicom_test.py
Python
apache-2.0
3,835
#!/usr/bin/python3 import pymysql # 打开数据库连接 db = pymysql.connect("localhost","root","","webgis_house",charset='utf8') # 使用cursor()方法获取操作游标 cursor = db.cursor() # SQL 插入语句 sql = "INSERT INTO HOUSE(address, \ total, price, area, type, floor, info_url) \ VALUES ('%s', '%d', '%d', '%d', '%s', '%s', '%...
cxyxc/webgis-house
spider/fangjiawang/test_mysql_insert.py
Python
apache-2.0
634
# 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 agreed to in writing, ...
google-research/lag
libml/layers.py
Python
apache-2.0
18,151
#FLM: AT ChrisCorner """Round selected corners: RADIUS is a Point instance that represents the x and y radius of the corner HANDLELENGTH is a number between 0. and 1. that determines how long the bezier handles should be, affecting the steepness of the curve """ import math def getContourRange(nid,g): cID = g....
huertatipografica/huertatipografica-fl-scripts
AT_Outlines/AT-RoundCorners.py
Python
apache-2.0
2,230
# # Author: Daniel Dittenhafer # # Created: Sept 27, 2016 # # Description: Main entry point for emotional faces data set creator. # __author__ = 'Daniel Dittenhafer' import os import operator import csv import time import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from scipy import misc...
dwdii/emotional-faces
src/main.py
Python
apache-2.0
7,136
from __future__ import absolute_import import itertools import lit.Util from lit.ShCommands import Command, Pipeline, Seq class ShLexer: def __init__(self, data, win32Escapes = False): self.data = data self.pos = 0 self.end = len(data) self.win32Escapes = win32Escapes def eat(...
indashnet/InDashNet.Open.UN2000
android/external/llvm/utils/lit/lit/ShUtil.py
Python
apache-2.0
12,179