code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
#!/usr/bin/env python # Copyright 2015 The ChEMBL group. # Author: Nathan Dedman <ndedman@ebi.ac.uk> # 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...
chembl/the-S3-amongos
the-S3-amongos.py
Python
apache-2.0
21,343
# Copyright 2020 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...
jhseu/tensorflow
tensorflow/python/debug/lib/debug_events_monitors_test.py
Python
apache-2.0
18,786
__author__ = 'Conscience' from django.conf.urls import url from django.contrib import admin from . import views urlpatterns = [ url(r'^$', views.post_list, name='post_list'), url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail, name='post_detail'), url(r'^post/$', views.post_list, name='post_list'), url(r...
Rivares/MyBlog
blog/urls.py
Python
apache-2.0
446
# Copyright (c) 2013 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
ativelkov/murano-api
murano/api/v1/deployments.py
Python
apache-2.0
5,151
""" WSGI config for lot project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_M...
Ecotrust/COMPASS
mp/wsgi.py
Python
apache-2.0
378
#!/usr/bin/python # # Copyright 2018 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 ag...
google/google-ctf
2017/quals/2017-re-food/dex_to_bytes.py
Python
apache-2.0
705
"""The tests for local file camera component.""" import asyncio from unittest import mock # Using third party package because of a bug reading binary data in Python 3.4 # https://bugs.python.org/issue23004 from mock_open import MockOpen from homeassistant.bootstrap import setup_component from tests.common import moc...
open-homeautomation/home-assistant
tests/components/camera/test_local_file.py
Python
apache-2.0
2,135
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
GoogleCloudPlatform/python-docs-samples
appengine/standard/blobstore/blobreader/main.py
Python
apache-2.0
3,332
# Copyright 2019, OpenCensus 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 agreed to in w...
census-instrumentation/opencensus-python
contrib/opencensus-ext-azure/opencensus/ext/azure/common/transport.py
Python
apache-2.0
10,424
#!/usr/bin/python2.5 # # Copyright 2009 the Melange 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...
jamslevy/gsoc
app/soc/models/ranker_root.py
Python
apache-2.0
1,077
''' Parse links in html and css pages. ''' import logging import re import hashlib import urllib.parse from functools import partial import multidict import html from bs4 import BeautifulSoup from . import stats from .urls import URL from . import facet from . import config LOGGER = logging.getLogger(__name__) as...
cocrawler/cocrawler
cocrawler/parse.py
Python
apache-2.0
14,541
from ut_arena.settings import *
blstream/ut-arena
ut_arena_py_api/ut_arena/envs/test/settings.py
Python
apache-2.0
31
# -*- coding: utf-8 -*- # pylint: disable=locally-disabled, star-args """ WebDAV upload method for dput. Install to "/usr/share/dput/webdav.py". """ from __future__ import with_statement import re import os import sys import cgi import netrc import socket import fnmatch import getpass import httplib import urllib...
1and1/artifactory-debian
dput-webdav/webdav.py
Python
apache-2.0
17,864
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
bigswitch/nova
nova/tests/functional/api_sample_tests/test_availability_zone.py
Python
apache-2.0
1,634
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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 # # ...
ntt-sic/taskflow
taskflow/flow.py
Python
apache-2.0
2,637
""" CNN on mnist data using fluid api of paddlepaddle """ import paddle import paddle.fluid as fluid def mnist_cnn_model(img): """ Mnist cnn model Args: img(Varaible): the input image to be recognized Returns: Variable: the label prediction """ conv_pool_1 = fluid.nets.simple...
kuke/models
fluid/adversarial/tutorials/mnist_model.py
Python
apache-2.0
2,821
# -*- coding: utf-8 -*- from kubb_match.data.models import GridPosition, Round, Game class BattleService(object): def __init__(self): pass def create_games(self, positions): games = [] nr = int(len(positions) / 5) field = 1 for row in ('A', 'B', 'C', 'D', 'E'): ...
BartSaelen/kubb_match
kubb_match/service/battle_service.py
Python
apache-2.0
3,670
from gittle import Gittle repo = Gittle('.') lastest = [ info['sha'] for info in repo.commit_info()[1:3] ] print(repo.diff(*lastest, diff_type='classic')) print(""" Last Diff """) print(list(repo.diff('HEAD')))
0asa/gittle
examples/diff.py
Python
apache-2.0
227
from setuptools import setup, find_packages from dist_job_mgr.version import VERSION setup( name='dist_job_mgr', version=VERSION, author='genForma Corp', author_email='code@genforma.com', url='', packages=find_packages(), include_package_data=True, zip_safe=False, entry_points = { ...
quaddra/dist_job_mgr
setup.py
Python
apache-2.0
639
# # Validator for "idlebg" Test # from pscheduler import json_validate MAX_SCHEMA = 1 def spec_is_valid(json): schema = { "type": "object", "properties": { "schema": { "$ref": "#/pScheduler/Cardinal" }, "duration": { "$ref": "#/pScheduler/Duration" }, ...
perfsonar/pscheduler
pscheduler-test-idlebgm/idlebgm/validate.py
Python
apache-2.0
1,872
# -*- coding: utf-8 -*- # # phaxio-python documentation build configuration file, created by # sphinx-quickstart on Sun Jan 8 20:17:15 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....
anpolsky/phaxio-python
docs/source/conf.py
Python
apache-2.0
5,715
from datetime import date, datetime, time from decimal import Decimal from django.core.files import File from django.core.files.storage import default_storage from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase from django.utils.timezone import now from i18nfield.strings impo...
Flamacue/pretix
src/tests/base/test_settings.py
Python
apache-2.0
11,458
# Copyright 2015 PerfKitBenchmarker 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...
GoogleCloudPlatform/PerfKitBenchmarker
perfkitbenchmarker/linux_benchmarks/kubernetes_mongodb_ycsb_benchmark.py
Python
apache-2.0
5,544
# coding=utf-8 import pprint import config import json import urllib import requests class Driver(object): def __init__(self): self.driver_type = self.__class__.__name__ # Get credentials from conf files for CMDB pass def get_driver_type(self): return self.driver_type ...
uggla/alexandria
alexandria/drivers.py
Python
apache-2.0
4,848
# # Copyright (c) 2013, Centre National de la Recherche Scientifique # # 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...
StratusLab/client
api/code/src/main/python/stratuslab/installator/CouchbaseServer.py
Python
apache-2.0
4,317
# 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
coltran/models/layers.py
Python
apache-2.0
24,446
from rest_framework import routers from . import views class SecretsRootView(routers.APIRootView): """ Secrets API root view """ def get_view_name(self): return 'Secrets' router = routers.DefaultRouter() router.APIRootView = SecretsRootView # Field choices router.register(r'_choices', view...
lampwins/netbox
netbox/secrets/api/urls.py
Python
apache-2.0
763
# Microsoft Azure Linux Agent # # Copyright 2018 Microsoft 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 b...
Azure/WALinuxAgent
azurelinuxagent/common/utils/textutil.py
Python
apache-2.0
12,526
# -*- coding: utf-8 -*- # Minio Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017 Minio, 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.ap...
NitishT/minio-py
minio/error.py
Python
apache-2.0
23,884
from django.db import models from user.models import State from django.utils.translation import ugettext as _ ## debug from pprint import pprint # Create your models here. class Party(models.Model): short_name = models.CharField(max_length=10, default='***') full_name = models.CharField(max_length=50, default='****...
amitdhiman000/dais
politics/models.py
Python
apache-2.0
2,210
import logging import plistlib from django.http import HttpResponse from django.urls import reverse from zentral.conf import settings from zentral.utils.certificates import split_certificate_chain from zentral.utils.payloads import generate_payload_uuid, get_payload_identifier from zentral.utils.payloads import sign_pa...
zentralopensource/zentral
zentral/contrib/mdm/payloads.py
Python
apache-2.0
6,407
# -*- 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-service-control
samples/generated_samples/servicecontrol_v1_generated_service_controller_check_async.py
Python
apache-2.0
1,437
#!/usr/bin/env python # Copyright 2018 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 ...
google/cloud-berg
examples/mpi_helloworld.py
Python
apache-2.0
855
#!/usr/bin/env python """Test the flow_management interface.""" import os from grr.gui import gui_test_lib from grr.gui import runtests_test from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import flow from grr.lib import hunts from grr.lib import test_lib from grr.l...
destijl/grr
grr/gui/plugins/flow_management_test.py
Python
apache-2.0
14,194
from madrona.features.forms import FeatureForm from django import forms from visualize.models import * class BookmarkForm(FeatureForm): class Meta(FeatureForm.Meta): model = Bookmark
Ecotrust/COMPASS
mp/visualize/forms.py
Python
apache-2.0
197
"""自适应学习率衰减 tf.train.exponential_decay(learning_rate, global_step, decay_steps, decay_rate, staircase=False, name=None) 退化学习率,衰减学习率,将指数衰减应用于学习速率。 计算公式:decayed_learning_rate = learning_rate * decay_rate ^ (global_step / decay_steps) """ # 初始的学习速率是0.1,总的迭代次数是1000次,如果staircase=True,那就表明每decay_ste...
Asurada2015/TFAPI_translation
Training/Decaying the learning rate/tf_train_exponential_decay.py
Python
apache-2.0
1,500
#!/usr/bin/env python3 # Copyright 2021 Stanford University # # 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...
StanfordLegion/legion
bindings/python/tests/pass/print_once.py
Python
apache-2.0
785
# 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 ...
niteoweb/libcloud
libcloud/dns/drivers/cloudns.py
Python
apache-2.0
7,000
from numpy import zeros from gwlfe.Memoization import memoize from gwlfe.MultiUse_Fxns.Runoff.RurQRunoff import RurQRunoff from gwlfe.MultiUse_Fxns.Runoff.RurQRunoff import RurQRunoff_f from gwlfe.Output.Loading.PConc import PConc from gwlfe.Output.Loading.PConc import PConc_f @memoize def pRunoff(NYrs, DaysMonth, I...
WikiWatershed/gwlf-e
gwlfe/MultiUse_Fxns/Runoff/pRunoff.py
Python
apache-2.0
1,598
#!/usr/bin/python # -*- coding: utf8 -*- # National Library of Norway, 2014-2015 # load the packages from pysqlite2 import dbapi2 as sqlite3 from collections import Counter from operator import itemgetter from itertools import chain from flask import Flask, Response, request, session, g, redirect, url_for, \ abo...
NationalLibraryOfNorway/NB-N-gram
backend.py
Python
apache-2.0
19,164
from django.shortcuts import render from django.http import HttpResponse import json def services(request): return render(request, 'services/services.html', {})
Adventure-Inc/chachas-adventures
services/views.py
Python
apache-2.0
167
import paddle.v2 as paddle import paddle.v2.framework.layers as layers import paddle.v2.framework.nets as nets import paddle.v2.framework.core as core import paddle.v2.framework.optimizer as optimizer from paddle.v2.framework.framework import Program, g_program from paddle.v2.framework.executor import Executor import...
pengli09/Paddle
python/paddle/v2/framework/tests/test_recognize_digits_conv.py
Python
apache-2.0
2,759
# -*- coding: utf-8 -*- # # Copyright 2012-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...
oldpa/luigi
luigi/scheduler.py
Python
apache-2.0
45,889
from copy import deepcopy import pytest from sovrin_node.test import waits from stp_core.loop.eventually import eventually from plenum.common.constants import VERSION from sovrin_common.constants import REINSTALL from sovrin_node.test.upgrade.helper import bumpedVersion, checkUpgradeScheduled, \ ensureUpgradeSen...
keenondrums/sovrin-node
sovrin_node/test/upgrade/test_pool_upgrade_no_loop_reinstall.py
Python
apache-2.0
1,232
# Copyright (c) 2016 Iotic Labs 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 # # https://github.com/Iotic-Labs/py-IoticAgent/blob/master/LICENSE # # Unless re...
Iotic-Labs/py-IoticAgent
src/IoticAgent/Datatypes.py
Python
apache-2.0
4,222
import sys, string import os.path import unique import export import gene_associations import traceback import time ################# Parse directory files def filepath(filename): fn = unique.filepath(filename) return fn def read_directory(sub_dir): dir_list = unique.read_directory(sub_dir) #add in c...
wuxue/altanalyze
InteractionBuilder.py
Python
apache-2.0
45,237
# Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net # This file is part of PyGithub. http://vincent-jacques.net/PyGithub # PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License # as published by the Free Software Foundation, either vers...
sagarsane/abetterportfolio
github/GitTag.py
Python
apache-2.0
3,535
# Copyright (c) 2014 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, ...
Mirantis/pumphouse
pumphouse/tasks/node.py
Python
apache-2.0
19,990
# coding=utf-8 # Copyright 2020 The TF-Agents 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 applicable la...
tensorflow/agents
tf_agents/networks/categorical_q_network_test.py
Python
apache-2.0
6,673
# Copyright 2013 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...
darren-wang/ks3
keystone/server/eventlet.py
Python
apache-2.0
5,193
# Copyright (c) 2015 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.org/licenses/LICENSE-2.0 # # Unless re...
openstack/neutron-lib
neutron_lib/exceptions/vlantransparent.py
Python
apache-2.0
902
#!/usr/bin/env python #encoding=utf8 #Copyright [2014] [Wei Zhang] #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 ...
anthonylife/EventPopularity
script/dataAnalysis.py
Python
apache-2.0
8,906
# -*- coding: utf-8 -*- # # Copyright 2015 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 applica...
simone-campagna/invoice
tests/unittests/test_db_types.py
Python
apache-2.0
11,568
import datetime import json import logging import requests from core.analytics import OneShotAnalytics from core.errors import ObservableValidationError from core.observables import Hostname, Email, Ip, Hash class ThreatCrowdAPI(object): """Base class for querying the ThreatCrowd API.""" @staticmethod ...
yeti-platform/yeti
plugins/analytics/public/threatcrowd.py
Python
apache-2.0
9,509
#!/usr/bin/python ### # Copyright (c) 2016 Nishant Das Patnaik. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
dpnishant/appmon
appmon.py
Python
apache-2.0
14,441
# third party # third party import numpy as np import pytest # syft absolute # absolute from syft.core.tensor.smpc.share_tensor import ShareTensor @pytest.mark.smpc def test_bit_extraction() -> None: share = ShareTensor(rank=0, parties_info=[], ring_size=2**32) data = np.array([[21, 32], [-54, 89]], dtype=np...
OpenMined/PySyft
tests/integration/smpc/tensor/share_tensor_test.py
Python
apache-2.0
975
# # Copyright 2015 Quantopian, 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...
magne-max/zipline-ja
tests/data/test_us_equity_pricing.py
Python
apache-2.0
12,525
# 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...
zerovm/zerovm-cli
zpmlib/tests/test_zpm.py
Python
apache-2.0
26,437
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '11.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from __future__ import print_function from keras.preprocessing import sequence from keras.models import Sequential from keras.laye...
nstustudent/krotyuk_social_network_sa
Interface.py
Python
apache-2.0
14,186
# import needed models from django.db import models from django.utils import timezone from django.contrib.auth.models import User # Create your models here. # create user object class Person(User): internal_id = models.CharField(max_length=25, null=True, blank=True) verified = models.NullBoolean...
prakashksinha/playground
bookmarks/models.py
Python
apache-2.0
1,100
# coding=utf-8 # Copyright 2022 The Deeplab2 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 ...
google-research/deeplab2
model/layers/resized_fuse_test.py
Python
apache-2.0
2,422
class Drawable(object): def draw(self, display_screen, dT): pass
bpeck/tumblr-display
src/Drawable.py
Python
apache-2.0
76
# Generated by Django 3.0.3 on 2020-08-20 16:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common', '0002_citation'), ] operations = [ migrations.AddField( model_name='citation', name='page_name', ...
protwis/protwis
common/migrations/0003_citation_page_name.py
Python
apache-2.0
413
import pcbnew from . import toggle_visibility class ToggleVisibilityPlugin(pcbnew.ActionPlugin): def defaults(self): self.name = "Toggle visibility of value/reference (of selected modules)" self.category = "A descriptive category name" self.description = "This plugin toggles the visibility ...
mmccoo/kicad_mmccoo
toggle_visibility/__init__.py
Python
apache-2.0
606
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
google-research/DBAP-algorithm
third_party/rlkit_library/rlkit/samplers/data_collector/step_collector.py
Python
apache-2.0
12,271
import itchat, time, re from itchat.content import * import urllib2, urllib import json from watson_developer_cloud import ConversationV1 response={'context':{}} @itchat.msg_register([TEXT]) def text_reply(msg): global response request_text = msg['Text'].encode('UTF-8') conversation = ConversationV1( username='...
Jonathanliu92251/watson-conversation
wechat/watson-wechat.py
Python
apache-2.0
1,140
# 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/core.py
Python
apache-2.0
23,876
""" Provides functions for evaluating the 'fitness' of ec2 instances. This module really just provides functions for deciding which instance is best to be killed by the autoscaler. """ def sort_by_system_instance_health(instances): return sorted( instances, key=lambda i: ( i.instance_s...
Yelp/paasta
paasta_tools/autoscaling/ec2_fitness.py
Python
apache-2.0
1,916
# Copyright 2018 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, ...
tensorflow/moonlight
moonlight/training/generation/generation.py
Python
apache-2.0
11,447
from orchestra.workflow import Step from orchestra.workflow import Workflow from simple_workflow.crawl import crawl_page crawl_step = Step( slug='crawl', name='Web Crawling', description='Find an awesome image on a website', worker_type=Step.WorkerType.MACHINE, creation_depends_on=[], function...
Sonblind/orchestra
simple_workflow/workflow.py
Python
apache-2.0
1,200
# This is an automatically generated file. # DO NOT EDIT or your changes may be overwritten import base64 from xdrlib import Packer, Unpacker from ..type_checked import type_checked from .liquidity_pool_withdraw_result_code import LiquidityPoolWithdrawResultCode __all__ = ["LiquidityPoolWithdrawResult"] @type_check...
StellarCN/py-stellar-base
stellar_sdk/xdr/liquidity_pool_withdraw_result.py
Python
apache-2.0
2,123
# 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, ...
googleapis/python-aiplatform
samples/snippets/model_service/get_model_evaluation_text_classification_sample.py
Python
apache-2.0
2,069
"""Support for HomematicIP Cloud switches.""" import logging from homematicip.aio.device import ( AsyncBrandSwitchMeasuring, AsyncFullFlushSwitchMeasuring, AsyncMultiIOBox, AsyncOpenCollector8Module, AsyncPlugableSwitch, AsyncPlugableSwitchMeasuring) from homematicip.aio.group import AsyncSwitchingGroup f...
MartinHjelmare/home-assistant
homeassistant/components/homematicip_cloud/switch.py
Python
apache-2.0
5,355
# Copyright (c) 2014 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.org/licenses/LICENSE-2.0 # # Unless re...
CiscoSystems/nova-solver-scheduler
nova/scheduler/solvers/constraints/num_instances_constraint.py
Python
apache-2.0
2,244
# Copyright (c) 2014, 2015, Oracle and/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. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
apporc/cinder
cinder/volume/drivers/zfssa/zfssaiscsi.py
Python
apache-2.0
45,567
# -*- 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 model 'Cloud' db.create_table(u'cloudslave_cloud', ( ('name', self.gf('django.db.models...
sorenh/python-django-cloudslave
cloudslave/migrations/0001_initial.py
Python
apache-2.0
6,224
"""Copyright 2009 Chris Davis 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 dist...
criteo-forks/graphite-web
webapp/graphite/metrics/views.py
Python
apache-2.0
12,370
# import system modules import arcpy from arcpy import env # Set environment settings env.workspace = "C:\Users\Ewan\Desktop\SFTPDST5\MapFiles" try: # Set the local variable in_Table = "Topography.csv" x_coords = "x" y_coords = "y" out_Layer = "Topography_Layer" saved_Layer = "c:\...
harryfb/DST5
ArcPy Code/Topography.py
Python
apache-2.0
1,297
from sqlalchemy import * from sqlalchemy import sql, schema from sqlalchemy.sql import compiler from test.lib import * class QuoteTest(fixtures.TestBase, AssertsCompiledSQL): __dialect__ = 'default' @classmethod def setup_class(cls): # TODO: figure out which databases/which identifiers allow speci...
ioram7/keystone-federado-pgid2013
build/sqlalchemy/test/sql/test_quote.py
Python
apache-2.0
9,788
#!/usr/bin/env python import logging import io from time import sleep import json import requests from . import * logging.basicConfig(filename='terminal.log', level=logging.DEBUG) class PyTerminal(): """ This class allows the execution of a command in the same way as the web-cli does. The return is a Co...
sumanta23/pyscript
pyscript/terminal.py
Python
apache-2.0
6,496
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
polyaxon/polyaxon
core/tests/test_init/test_init_code.py
Python
apache-2.0
2,535
#!/usr/bin/env python """ SlipStream Client ===== Copyright (C) 2015 SixSq Sarl (sixsq.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-...
slipstream/SlipStreamConnectors
openstack/python/tar/test/TestOpenStackClientCloudLive.py
Python
apache-2.0
6,070
# -*- coding: utf-8 -*- # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
googleapis/python-functions
docs/conf.py
Python
apache-2.0
12,404
#!/usr/bin/env python # -*- coding: utf-8 -*- """Script for deploying cloud functions.""" from __future__ import print_function import subprocess import sys from turbinia import config index_file = './index.yaml' if len(sys.argv) > 1: function_names = [sys.argv[1]] else: function_names = ['gettasks', 'closetas...
google/turbinia
tools/gcf_init/deploy_gcf.py
Python
apache-2.0
1,012
# -*- coding: iso-8859-1 -*- """ MoinMoin - Supporting function for Python magic @copyright: 2002 Juergen Hermann <jh@web.de> @license: GNU GPL, see COPYING for details. """ ############################################################################# ### Module import / Plugins ##########################...
RealTimeWeb/wikisite
MoinMoin/util/pysupport.py
Python
apache-2.0
3,165
import matplotlib as mpl mpl.use('Agg') import survivalstan from stancache import stancache import numpy as np from nose.tools import ok_ from functools import partial num_iter = 1000 from .test_datasets import load_test_dataset model_code = survivalstan.models.exp_survival_model make_inits = None def test_model(): ...
jburos/survivalstan
test/test_exp_survival_model.py
Python
apache-2.0
1,679
# isort:skip_file from .data_connector import DataConnector from .runtime_data_connector import RuntimeDataConnector from .file_path_data_connector import FilePathDataConnector from .configured_asset_file_path_data_connector import ( ConfiguredAssetFilePathDataConnector, ) from .inferred_asset_file_path_data_conne...
great-expectations/great_expectations
great_expectations/datasource/data_connector/__init__.py
Python
apache-2.0
1,441
# # 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...
openstack/cloudkitty
cloudkitty/db/sqlalchemy/alembic/versions/464e951dc3b8_initial_migration.py
Python
apache-2.0
1,314
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
quattor/aquilon
lib/aquilon/worker/dbwrappers/search.py
Python
apache-2.0
3,147
# Copyright 2018 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, ...
googleapis/docuploader
docuploader/tar.py
Python
apache-2.0
2,102
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
ptrendx/mxnet
python/mxnet/contrib/onnx/onnx2mx/_translation_utils.py
Python
apache-2.0
9,404
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^webcam/', include('webCam.urls')), ]
EddyTheB/Warbler
Warbler/urls.py
Python
apache-2.0
174
# coding: utf-8 # # Copyright 2010-2014 Ning, Inc. # Copyright 2014-2020 Groupon, Inc # Copyright 2020-2021 Equinix, Inc # Copyright 2014-2021 The Billing Project, LLC # # The Billing Project, LLC licenses this file to you under the Apache License, version 2.0 # (the "License"); you may not use this file except in com...
killbill/killbill-client-python
killbill/api/security_api.py
Python
apache-2.0
44,678
from django import forms class PartnerLogoForm(forms.Form): partner_logo = forms.ImageField( label='Select a file', )
Upande/MaMaSe
apps/partners/forms.py
Python
apache-2.0
134
# Copyright 2012, Julius Seporaitis # # 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...
henrysher/yum-s3-tools
test/tests.py
Python
apache-2.0
1,566
# -*- coding:utf-8 -*- # 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 (c) 2012 Samsung SDS Co., LTD # All Rights Reserved. # # Licensed under the Apache License, Version 2.0...
spcs/synaps
synaps/monitor/__init__.py
Python
apache-2.0
11,730
# Copyright 2013-2021 Aerospike, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
aerospike/aerospike-admin
test/e2e/util.py
Python
apache-2.0
6,156
#!/usr/bin/python # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
nearlyfreeapps/python-googleadwords
examples/adspygoogle/adwords/v201109/basic_operations/update_campaign.py
Python
apache-2.0
1,970
# Copyright (c) 2016 Tigera, 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...
quater/calico-containers
calico_node/filesystem/startup.py
Python
apache-2.0
11,293
from ex import * from ex.alg.common import svdex def RPCA(D, lam = None, tol = 1e-7, maxIter = 500): '''Yi Ma's robust pca return (L, SingularValues(L)) ''' m, n = D.shape maxmn, minmn = (max(m, n), min(m, n)) lam = float(lam) if lam is not None else 1.0 log.info('RPCA for %dx%d matri...
excelly/xpy-ml
ex/ml/rpca.py
Python
apache-2.0
2,134