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
# Copyright 2015 ETH Zurich # # 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...
FR4NK-W/osourced-scion
python/test/lib/path_store_test.py
Python
apache-2.0
22,153
import hashlib from collections import OrderedDict from moto.core import BaseBackend, BaseModel from moto.core.utils import BackendDict from .exceptions import ClientError class Object(BaseModel): def __init__(self, path, body, etag, storage_class="TEMPORAL"): self.path = path self.body = body ...
spulec/moto
moto/mediastoredata/models.py
Python
apache-2.0
2,506
#!/usr/bin/env python from setuptools import setup setup(name='sgwarden', version='1.0', description='Managing Security Groups', author='Vigith Maurice', author_email='vigith@gmail.com', url='https://github.com/sharethis-github/sgwarden', packages=['sgwarden',], scripts=[ ...
sharethis-github/sgwarden
sgwarden/setup.py
Python
apache-2.0
440
from modules import calculator, currency, images, utils from modules import standard_search, shopping_search from modules import direction_search
kreuks/liven
google_search/__init__.py
Python
apache-2.0
146
# 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 or agreed to in...
UTSA-ICS/keystone-SID
keystone/tests/test_v3_oauth1.py
Python
apache-2.0
25,789
# -*- 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_pipeline_service_get_pipeline_job_sync.py
Python
apache-2.0
1,472
# Copyright (c) 2016 Cisco Systems # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
noironetworks/aci-integration-module
aim/tests/unit/test_infra_manager.py
Python
apache-2.0
3,823
import os import re from osgtest.library import core from osgtest.library import service def name(): if core.el_release() < 7: return 'mysql' else: return 'mariadb' def daemon_name(): if core.el_release() < 7: return 'mysqld' else: return 'mariadb' def pidfile(): ...
efajardo/osg-test
osgtest/library/mysql.py
Python
apache-2.0
2,716
from datetime import date from decimal import Decimal from requests import Response YAHOO_RESPONSE = b""" { "spark": { "result": [ { "symbol": "USDEUR=X", "response": [ { "meta": { "currency": "EUR", "symbol": "USDEUR=X", "exc...
business-factory/gold-digger
tests/data_providers/test_yahoo.py
Python
apache-2.0
5,423
#!/usr/bin/env python # Copyright (c) 2015, 2016 IBM. 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 requir...
cloudant/python-cloudant
src/cloudant/error.py
Python
apache-2.0
7,385
from hazelcast import HazelcastClient from hazelcast.config import ReconnectMode from hazelcast.errors import ClientOfflineError, HazelcastClientNotActiveError from hazelcast.lifecycle import LifecycleState from tests.base import HazelcastTestCase from tests.util import random_string class ConnectionStrategyTest(Haze...
hazelcast/hazelcast-python-client
tests/integration/backward_compatible/connection_strategy_test.py
Python
apache-2.0
4,726
# -*- coding: utf-8 -*- # Copyright (c) 2010-2016, MIT Probabilistic Computing Project # # 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/LICENS...
probcomp/bayeslite
src/backends/nig_normal.py
Python
apache-2.0
19,474
# Copyright 2011 Justin Santa Barbara # 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 requ...
Akrog/cinder
cinder/api/v1/snapshots.py
Python
apache-2.0
8,045
from django.conf import settings from django.utils import httpwrappers from django.core.mail import mail_managers import md5, os class CommonMiddleware: """ "Common" middleware for taking care of some basic operations: - Forbids access to User-Agents in settings.DISALLOWED_USER_AGENTS - URL r...
tungvx/deploy
Django-0.90/django/middleware/common.py
Python
apache-2.0
3,684
import yaml import sys import os help = """ Converts two .csv files into YAML configuration files. This program requires three arguments: -The path to the .csv table of VCF fields -The path to the .csv table of the MySQL clinical database fields -The destination path where YAML files will be generated The...
jpoullet2000/cgs-data
cgsdatatools/cgs_generate_config.py
Python
apache-2.0
6,484
""" This is an integration-level test for checking CVE updates at fine granularity. """ import sqlalchemy.exc from anchore_engine.db import ( FixedArtifact, Image, ImagePackage, Vulnerability, VulnerableArtifact, ) from anchore_engine.db import get_thread_scoped_session as get_session from anchore_...
anchore/anchore-engine
tests/integration/services/policy_engine/test_cve_updates.py
Python
apache-2.0
7,228
# -*- encoding: utf-8 -*- """ Rapids expressions. These are helper classes for H2OFrame. :copyright: (c) 2016 H2O.ai :license: Apache License Version 2.0 (see LICENSE for details) """ from __future__ import division, print_function, absolute_import, unicode_literals import collections import copy import gc import m...
mathemage/h2o-3
h2o-py/h2o/expr.py
Python
apache-2.0
15,701
#!/usr/bin/env python """Tests for the dtypes and converters arguments to CSV import. """ import pytest from io import BytesIO from unittest import mock from tdclient import api, Client from tdclient.util import read_csv_records from tdclient.test.test_helper import gunzipb from tdclient.test.test_helper import ma...
treasure-data/td-client-python
tdclient/test/dtypes_and_converters_test.py
Python
apache-2.0
7,897
__author__ = 'max' import time import sys import argparse from lasagne_nlp.utils import utils import lasagne_nlp.utils.data_processor as data_processor from lasagne_nlp.utils.objectives import crf_loss, crf_accuracy import lasagne import theano import theano.tensor as T from lasagne_nlp.networks.networks import build_...
XuezheMax/LasagneNLP
bi_lstm_cnn_crf.py
Python
apache-2.0
15,909
# Copyright 2014 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 in writ...
sileht/python-gnocchiclient
gnocchiclient/osc.py
Python
apache-2.0
1,874
#coding=utf-8 #-*- coding: utf-8 -*- import os import re import sys import time import MySQLdb import urllib2 sys.path.append("../frame/") from loggingex import LOG_INFO from loggingex import LOG_ERROR from loggingex import LOG_WARNING from mysql_conf_parser import mysql_conf_parser from scheduler_frame_conf_inst im...
f304646673/scheduler_frame
src/tools/repair_tables.py
Python
apache-2.0
5,015
from Networking import Networking from Model import Playlist from SpotifyAPI import SpotifyAPI import Security import json class PlaylistAPI(SpotifyAPI): base_url = "https://api.spotify.com" def __init__(self, categoryID): super(PlaylistAPI, self).__init__() self.list_of_playlist = [] ...
fbuitron/FBMusic_ML_be
BATCH/PlaylistAPI.py
Python
apache-2.0
1,427
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('scoreboard', '0001_initial'), ] operations = [ migrations.AlterField( model_name='score', name='lose...
PeterHo/mysite
scoreboard/migrations/0002_auto_20160204_0121.py
Python
apache-2.0
892
#!/usr/bin/env python """Wordnik.com's Swagger generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of the methods and models for each application are generated from the Swagger templates.""" import sys import os import re import urllib.request, u...
liosha2007/temporary-groupdocs-python3-sdk
groupdocs/ApiClient.py
Python
apache-2.0
11,500
''' Utilities Created on Mar 3, 2017 @author: cyoung ''' class Util: # Get a class by fully qualified name. def getClass(self, kls): parts = kls.split('.') moduleName = ".".join(parts[:-1]) #print("module "+module) #print("attr "+parts[-1]) mod = __impor...
charles-g-young/Table2NetCDF
gov/noaa/gmd/table_2_netcdf/Util.py
Python
apache-2.0
428
__author__ = 'asdf2014' print(__doc__) import numpy as np import matplotlib.pyplot as plt def modified_huber_loss(y_true, y_pred): z = y_pred * y_true loss = -4 * z loss[z >= -1] = (1 - z[z >= -1]) ** 2 loss[z >= 1.] = 0 return loss xmin, xmax = -4, 4 xx = np.linspace(xmin, xmax, 100) plt.plo...
MasteringSpark/FirstStep
src/main/python/scikit/loss_function.py
Python
apache-2.0
918
# -*- 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
google/cloud/aiplatform_v1/types/tensorboard.py
Python
apache-2.0
4,087
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Mar 4 13:13:13 2017 @author: avaldes """ from __future__ import division, print_function import numpy as np import matplotlib.pyplot as plt from MLP import MLP #%% Create data #np.random.seed(5) nb_black = 50 nb_red = 50 nb_data = nb_black + nb...
daxadal/Computational-Geometry
Practica_2/classify_plane_points_template1.py
Python
apache-2.0
2,030
# 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...
sxjscience/tvm
python/tvm/micro/session.py
Python
apache-2.0
4,567
# -*- coding: utf-8 -*- # this default value is just for testing in a fake. # pylint: disable=dangerous-default-value """Fake Module containing helper functions for the SQLite plugin""" from plasoscaffolder.bll.services import base_sqlite_plugin_helper from plasoscaffolder.bll.services import base_sqlite_plugin_path_he...
ClaudiaSaxer/PlasoScaffolder
src/tests/fake/fake_sqlite_plugin_helper.py
Python
apache-2.0
7,987
# -*- 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-speech
samples/generated_samples/speech_v1p1beta1_generated_speech_recognize_async.py
Python
apache-2.0
1,643
# coding=utf-8 # Copyright 2015 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 logging impor...
landism/pants
src/python/pants/engine/scheduler.py
Python
apache-2.0
21,934
# Copyright 2015 Cloudbase Solutions Srl # 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 r...
cloudbase/heat2arm
heat2arm/parser/tests/hot/test_template.py
Python
apache-2.0
2,462
# Copyright 2013 dotCloud inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed t...
clarete/docker-py
docker/client.py
Python
apache-2.0
11,678
from __future__ import unicode_literals import logging import re from datetime import datetime from bson import ObjectId from bson.json_util import loads from flask import request from flask_classy import route from flask_login import current_user from core import investigation from core.entities import Entity from ...
yeti-platform/yeti
core/web/api/investigation.py
Python
apache-2.0
5,579
# Copyright 2008-2013 Nokia Siemens Networks Oyj # # 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...
yamateh/robotframework
src/robot/running/arguments/argumentvalidator.py
Python
apache-2.0
2,829
# 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
non_semantic_speech_benchmark/data_prep/beam_dofns_test.py
Python
apache-2.0
16,889
#!usb/bin/env/python import ctypes import datetime import os import speech import sys import time from ctypes import * from numpy import * from ctypes.util import find_library # print (ctypes.util.find_library('edk.dll')) # print (os.path.exists('edk.dll')) libEDK = cdll.LoadLibrary("edk.dll") if...
andres-de-castro/kineSYS
motor_imagery_trainer.py
Python
apache-2.0
5,885
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc. ############################################################################## # # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compli...
rcbops/opencenter
tests/test_ast.py
Python
apache-2.0
13,977
# -*- 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-datalabeling
google/cloud/datalabeling_v1beta1/types/evaluation.py
Python
apache-2.0
12,885
import os import unittest import nbformat from nbconvert.preprocessors import ExecutePreprocessor import pytest import itertools as itt DIRECTORY = os.path.dirname(os.path.realpath(__file__)) # CHECK THIS http://stackoverflow.com/questions/1676269/writing-a-re-usable-parametrized-unittest-testcase-method def get_a...
pybel/pybel-notebooks
test.py
Python
apache-2.0
849
# 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 from pants.base.hash_utils import stable_json_hash from pants.base.payload import Payload...
foursquare/pants
src/python/pants/backend/docgen/targets/doc.py
Python
apache-2.0
4,885
# Copyright 2015: Mirantis 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...
aforalee/rally
tests/unit/task/processing/test_charts.py
Python
apache-2.0
19,909
import sys sys.path.append("api") sys.path.append("util") from flask import Flask, make_response, request from flask.ext.cors import CORS import messages import api import json app = Flask(__name__) CORS(app) # GENERAL @app.errorhandler(404) def not_found(error): return make_response(json.dumps(messages.notFou...
danielvdende/VizServe
server.py
Python
apache-2.0
3,799
import cPickle as pickle score_dict = pickle.load(open('counterpoint.p')) import matplotlib.pyplot as plt import numpy as np from sklearn.naive_bayes import MultinomialNB from sklearn.linear_model import LogisticRegression from sklearn import cross_validation import sklearn.svm from sklearn.utils import shuffle def c...
fcchou/CS229-project
learning/old/cp_analysis.py
Python
apache-2.0
2,588
# -*- 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-compute
google/cloud/compute_v1/services/region_instance_group_managers/transports/base.py
Python
apache-2.0
13,869
# Copyright 2015 Mirantis, 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 a...
VTabolin/vmware-dvs
vmware_dvs/agent/dvs_neutron_agent.py
Python
apache-2.0
17,391
# Copyright 2012 Cloudbase Solutions Srl # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
stefan-caraiman/cloudbase-init
cloudbaseinit/shell.py
Python
apache-2.0
1,433
# Copyright 2016 Pinterest, 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...
pinterest/teletraan
deploy-agent/tests/unit/deploy/utils/test_exec.py
Python
apache-2.0
5,911
# Copyright 2015 Canonical 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 # # Unless required by...
Saviq/nova-compute-lxd
nclxd/tests/test_driver_api.py
Python
apache-2.0
28,337
# python3 # Copyright 2018 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 re...
deepmind/acme
acme/agents/tf/bcq/discrete_learning_test.py
Python
apache-2.0
2,614
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from builtins import str as unicode from quark_runtime import * _lazyImport.plug("package_md.test_Test_go_Method") import quark.reflect class test_Test_go_Method(quark.r...
datawire/quark
quarkc/test/ffi/expected/py/package/package_md/__init__.py
Python
apache-2.0
3,603
# # # 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 n...
jmckaskill/subversion
build/generator/gen_make.py
Python
apache-2.0
21,368
# -*- coding: utf-8 -*- # auxilium # -------- # Python project for an automated test and deploy toolkit. # # Author: sonntagsgesicht # Version: 0.1.9, copyright Saturday, 02 October 2021 # Website: https://github.com/sonntagsgesicht/auxilium # License: Apache License 2.0 (see LICENSE file) from logging import l...
sonntagsgesicht/regtest
.aux/venv/lib/python3.9/site-packages/auxilium/tools/git_tools.py
Python
apache-2.0
3,958
# -*- coding: utf-8 -*- """Time manipulation functions and variables. This module contain common methods that can be used to convert timestamps from various formats into number of micro seconds since January 1, 1970, 00:00:00 UTC that is used internally to store timestamps. It also contains various functions to repre...
dc3-plaso/plaso
plaso/lib/timelib.py
Python
apache-2.0
30,598
# # 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 us...
saltstar/spark
python/pyspark/sql/streaming.py
Python
apache-2.0
40,553
# Copyright 2016 Leon Sixt # # 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...
BioroboticsLab/diktya
tests/test_blocks.py
Python
apache-2.0
1,576
# 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...
mrunge/openstack_horizon
openstack_horizon/dashboards/admin/volumes/volume_types/extras/views.py
Python
apache-2.0
3,595
# See http://zulip.readthedocs.io/en/latest/events-system.html for # high-level documentation on how this system works. from __future__ import absolute_import from typing import cast, AbstractSet, Any, Callable, Dict, List, \ Mapping, MutableMapping, Optional, Iterable, Sequence, Set, Text, Union from django.utils...
jrowan/zulip
zerver/tornado/event_queue.py
Python
apache-2.0
37,008
from ..remote import RemoteModel class NetworkNetworkExplorerSummariesSummaryGridRemote(RemoteModel): """ | ``id:`` none | ``attribute type:`` string | ``DeviceID:`` none | ``attribute type:`` string | ``DeviceIPNumeric:`` none | ``attribute type:`` string | ``DeviceIPDott...
infobloxopen/infoblox-netmri
infoblox_netmri/api/remote/models/network_network_explorer_summaries_summary_grid_remote.py
Python
apache-2.0
1,486
# -*- coding: utf-8 -*- # # English Language RTD & Sphinx config file # # Uses ../conf_common.py for most non-language-specific settings. # Importing conf_common adds all the non-language-specific # parts to this conf module try: from conf_common import * # noqa: F403,F401 except ImportError: import os im...
espressif/esp-idf
docs/zh_CN/conf.py
Python
apache-2.0
789
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import unittest from pants.option.parser_hierarchy import InvalidScopeError, all_enclosing_scopes, enclosing_scope from pants.option.scope import GLOBAL_SCOPE class TestEnclosingScopeTr...
wisechengyi/pants
src/python/pants/option/enclosing_scopes_test.py
Python
apache-2.0
3,058
from appython.components.api.common_fields import IsSetField from appython.components.models.base_model import BaseModel from appython.components.user.base_manager import BaseManager from flask.ext.restful import fields, marshal from google.appengine.ext import ndb class UserModel(BaseModel): # Every user must ha...
zugaldia/capitalbikeshare
appengine/app/shared/models/user_model.py
Python
apache-2.0
2,057
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from datetime import ( datetime, timedelta, ) from dateutil.relativedelta import relativedelta from base.tests.model_maker import clean_and_save from booking.models import ( Booking, Category, Location, ) def get_alpe_d_huez(): ...
pkimber/booking
booking/tests/scenario.py
Python
apache-2.0
2,769
import json import dnot from mock import patch import unittest2 class NotifierTest(unittest2.TestCase): @patch("dnot.sns.connect_to_region") def test_parameters_are_submitted(self, connect_to_region_mock): topic = "abc" region = "eu-west-2" result_topic = "result" stack_name = ...
ImmobilienScout24/aws-deployment-notifier
src/unittest/python/notifier_tests.py
Python
apache-2.0
900
# Copyright 2015 Nicta # # 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, softwa...
sirca/clusterous
clusterous/defaults.py
Python
apache-2.0
3,073
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto/lib/python/bool.proto """Generated protocol buffer code.""" # third party from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import m...
OpenMined/PySyft
packages/syft/src/syft/proto/lib/python/bool_pb2.py
Python
apache-2.0
1,474
from datetime import datetime from sevenbridges.errors import SbgError class Transform: @staticmethod def to_resource(resource): from sevenbridges.meta.resource import Resource if not resource: raise SbgError('Invalid id value!') elif isinstance(resource, Resource) and has...
sbg/sevenbridges-python
sevenbridges/meta/transformer.py
Python
apache-2.0
10,566
# Lint as: python3 # Copyright 2021 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 requ...
petewarden/tensorflow
tensorflow/python/keras/distribute/dataset_creator_model_fit_test.py
Python
apache-2.0
8,765
# Copyright 2015-2017 ARM 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 w...
ARM-software/trappy
tests/test_duplicates.py
Python
apache-2.0
4,015
"""Predicate: output token.""" from gtd.utils import ComparableMixin class Predicate(ComparableMixin): """Represents a step in the logical form (i.e., an output token).""" __slots__ = ['_name', '_original_string', '_types'] def __init__(self, name, original_string=None, types=None): """Create Pr...
kelvinguu/lang2program
strongsup/predicate.py
Python
apache-2.0
1,835
# =============================================================================== # Copyright 2013 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/envisage/tasks/editor_task.py
Python
apache-2.0
6,344
from enum import Enum, IntEnum, unique from hamcrest import assert_that, equal_to, is_ from marshmallow import Schema from microcosm_flask.fields import EnumField from microcosm_flask.swagger.api import build_parameter @unique class Choices(Enum): Profit = "profit" @unique class ValueType(IntEnum): Foo = ...
globality-corp/microcosm-flask
microcosm_flask/tests/swagger/parameters/test_enum.py
Python
apache-2.0
1,133
# -*- 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...
googleads/google-ads-python
google/ads/googleads/v9/services/services/customer_feed_service/transports/grpc.py
Python
apache-2.0
12,306
# -*- 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 #...
owlabs/incubator-airflow
tests/contrib/operators/test_redis_publish_operator.py
Python
apache-2.0
2,312
# encoding:utf8 import numpy as np import cv2 import base64 import beesion import time import logging logging.basicConfig(format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s', datefmt='%H:%M:%S', level=logging.DEBUG) frame_processing_ratio = 4 fram...
beeva-albertorincon/beeva-poc-google-ocr-faces
code/demo.py
Python
apache-2.0
2,248
from config.settings import STREAM_COLLECTION from bson.objectid import ObjectId from radio_db.models import BaseModel class Stream(BaseModel): def __init__(self, db, data): super().__init__(db, collection=STREAM_COLLECTION) self.stream_ip = data.get('stream_ip') self.name = data.get...
wolendranh/movie_radio
admin/models.py
Python
apache-2.0
415
# Copyright 2022 The Waymo Open Dataset 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...
waymo-research/waymo-open-dataset
waymo_open_dataset/utils/keypoint_data.py
Python
apache-2.0
16,518
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-04-12 20:30 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('crowdcop_web', '0021_auto_20160412_1629'), ] operations = [ migrations.Alter...
bocaaust/CrowdCop
CrowdCop_test/crowdcop/crowdcop_web/migrations/0022_auto_20160412_1630.py
Python
apache-2.0
791
# # 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...
hpproliant/ironic
ironic/tests/unit/drivers/modules/amt/test_management.py
Python
apache-2.0
10,845
# -*- coding: utf-8 -*- # Copyright 2014 Metaswitch Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
fasaxc/felix
calico/felix/test/test_frules.py
Python
apache-2.0
13,792
import os import re import setuptools def get_version(package: str) -> str: """Return package version as listed in __version__ variable at __init__.py""" init_py = open(os.path.join(package, '__init__.py')).read() return re.search(r"__version__\s*=\s*['\"]([^'\"]+)['\"]", init_py).group(1) with open("RE...
ikvk/imap_tools
setup.py
Python
apache-2.0
1,092
""" Copyright 2017 Ronald J. Nowling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
rnowling/humbaba
humbaba/augment_samples.py
Python
apache-2.0
6,775
# Copyright 2014 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
viggates/nova
nova/virt/hardware.py
Python
apache-2.0
27,991
from unittest.mock import mock_open, patch, call import pytest from pytest import raises from vang.misc.wc import is_excluded, is_included, count_words, count_letters, count, count_all, get_files, parse_args @pytest.mark.parametrize('excluded, expected', [ [('foo.txt',), True], [('.*.txt',), True], [('....
bjuvensjo/scripts
vang/misc/tests/test_wc.py
Python
apache-2.0
2,185
######## # Copyright (c) 2014 GigaSpaces Technologies 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 # # Unless...
szpotona/cloudify-openstack-plugin
system_tests/openstack_handler.py
Python
apache-2.0
17,759
# # author: Cosmin Basca # # Copyright 2010 University of Zurich # # 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 a...
cosminbasca/rdftools
rdftools/__version__.py
Python
apache-2.0
707
#!/usr/bin/env python # Copyright 2015-2018 Yelp 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 ...
Yelp/paasta
paasta_tools/setup_kubernetes_job.py
Python
apache-2.0
7,313
''' Graph representation of the knowledge base ''' import networkx as nx import math import sys from util import exception MAXLOGDEG = 'maxlogdeg' SQRTLOGDEG = 'sqrtlogdeg' MAX_LEVEL = 5 EQUAL_WEIGHT = 'equal_weight' LEVEL_WEIGHT = 'level_weight' EPSILON = sys.float_info.epsilon class Graph(object): ''' ...
deliarusu/text-annotation
knowledgebase/kbgraph.py
Python
apache-2.0
8,665
import logging import random import numpy as np from ray.rllib.agents import with_common_config from ray.rllib.agents.dreamer.dreamer_torch_policy import DreamerTorchPolicy from ray.rllib.agents.trainer_template import build_trainer from ray.rllib.execution.common import STEPS_SAMPLED_COUNTER, \ LEARNER_INFO, _ge...
richardliaw/ray
rllib/agents/dreamer/dreamer.py
Python
apache-2.0
8,885
import json import uuid from django.core.urlresolvers import reverse from models import CrowdModelSpecification # Required implementation for a new crowd type class CrowdInterface(object): def __init__(self, crowd_name): self.crowd_name = crowd_name @staticmethod def validate_configuration(conf...
amplab/ampcrowd
ampcrowd/basecrowd/interface.py
Python
apache-2.0
12,316
from __future__ import print_function from lector import * from lpSolv import * import sys import math def generarRestriccionesTipo(matriz, tipo): numeroRestricciones = (n* (n-1)) / 2 if tipo == 0 or tipo == 1: for j in range(0, n): restriccionCanecaI = [] for k in range(0, i * ...
carlochess/proyectoComplejidad
Organizar/segundaParte.py
Python
apache-2.0
4,712
import itertools import textwrap import warnings from datetime import datetime from inspect import getfullargspec from typing import Any, Iterable, Mapping, Tuple, Union import numpy as np import pandas as pd from ..core.options import OPTIONS from ..core.utils import is_scalar try: import nc_time_axis # noqa: ...
xray/xray
xarray/plot/utils.py
Python
apache-2.0
26,251
from sqlalchemy import Column, String, BigInteger from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine import time BaseModel = declarative_base() class Video(BaseModel): __tablename__ = 'video' id = Column(BigInteger, primary_key=True, autoincrement=True) name = ...
AcerFeng/videoSpider
spider/models.py
Python
apache-2.0
2,458
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2017-08-04 09:36 from __future__ import unicode_literals import datetime from django.conf import settings from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): ...
glon/django_test
article/migrations/0005_auto_20170804_0936.py
Python
apache-2.0
1,345
from typing import Dict, List, Tuple import numpy from overrides import overrides from ..instance import TextInstance, IndexedInstance from ...data_indexer import DataIndexer class VerbSemanticsInstance(TextInstance): """ A VerbSemanticsInstance is a :class:`TextInstance` that is a single sentence of text,...
matt-gardner/deep_qa
deep_qa/data/instances/sequence_tagging/verb_semantics_instance.py
Python
apache-2.0
9,078
# 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...
Laurawly/tvm-1
tests/python/driver/tvmc/test_model.py
Python
apache-2.0
2,481
import httplib from twisted.web import server, resource from twisted.internet import reactor, endpoints class Health(resource.Resource): isLeaf = True def render_GET(self, request): request.setHeader("content-type", "application/json") return '{"status":"UP"}\n' class Fortune(resource.Resour...
IECCTB/springcloud
node-service/py-app.py
Python
apache-2.0
912
#------------------------------------------------------------------------------ # Get similarity score between two color terms. # GET /v1/colors/color_terms_similarity #------------------------------------------------------------------------------ import os import json import requests from urlparse import urljoin fro...
cognitivefashion/cf-sdk-python
color_similarity_score.py
Python
apache-2.0
1,049
from marshmallow import Schema, fields from .author import AuthorSchema class RevisionSchema(Schema): id = fields.UUID(dump_only=True) sha = fields.Str() message = fields.Str() authors = fields.List(fields.Nested(AuthorSchema()), dump_only=True) created_at = fields.DateTime(attribute="date_create...
getsentry/zeus
zeus/api/schemas/revision.py
Python
apache-2.0
419