text stringlengths 1 927k |
|---|
import torch
import torchvision.transforms as transforms
import numpy as np
import cv2
import logging
from .model import Net
class Extractor(object):
def __init__(self, model_path, use_cuda=True):
self.net = Net(reid=True)
self.device = "cuda" if torch.cuda.is_available() and use_cuda else "cpu"
... |
"""
This module contains the logic of the plugin
in charge of creating fake nodes returning
the the data inside an input directory
"""
from typing import Dict, List
from suzieq.poller.worker.inventory.inventory import Inventory
from suzieq.poller.worker.nodes.files import FileNode
class InputDirInventory(Inventory)... |
from __future__ import absolute_import
from __future__ import print_function
import os
import veriloggen
import thread_stream_fsm_as_module
def test(request):
veriloggen.reset()
simtype = request.config.getoption('--sim')
rslt = thread_stream_fsm_as_module.run(filename=None, simtype=simtype,
... |
"""
Copyright (c) 2021, NVIDIA CORPORATION.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
import os
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.views.generic.base import TemplateView
from django_cas_ng import views as cas_views
from wagtail.admin import urls as wagtailadmin_urls
from wagta... |
import random
def quick_sort(data):
left = 0
right = len(data) - 1
output = randomized_quick_sort(data, left, right)
return output
def randomized_quick_sort(data, left, right):
if left <= right:
temp = random.randint(left, right)
data[left], data[temp] = data[temp], data[left]
... |
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import ast
import codecs
import sys
import hashlib
import struct
import re
import os
from keylime import common
from keylime import keylime_logging
logger = keylime_logging.init_logging('ima')
config = common.get_config... |
"""Exception classes for jenkins_jobs errors"""
import inspect
def is_sequence(arg):
return (not hasattr(arg, "strip") and
(hasattr(arg, "__getitem__") or
hasattr(arg, "__iter__")))
class JenkinsJobsException(Exception):
pass
class ModuleError(JenkinsJobsException):
def get_... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Argument parser functions."""
import argparse
import sys
from configs.defaults import get_cfg_defaults
def parse_args():
"""
Parse the following arguments for a default parser for PySlowFast users.
Args:
... |
# Copyright 2020 The TensorFlow 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 law or agreed to i... |
import unittest
from tests.utils import TestHarness, tasks
_final_state = None
@tasks.bind()
def state_passing_workflow():
return _create_workflow_state.send(initial_state=123) \
.continue_with(_add_two_numbers, 3, 5) \
.continue_with(_update_workflow_state) \
.continue_with(_noop) \
... |
from django.conf.urls import patterns, include, url
from .views import (personal_results, output_detail, csv_input, csv_output,
pdf_view, edit_personal_results, submit_micro, file_input)
urlpatterns = patterns('',
url(r'^$', personal_results, name='tax_form'),
url(r'^file/$', file_input,... |
"""An offline label visualizer for BDD100K file.
Works for 2D / 3D bounding box, segmentation masks, etc.
"""
import argparse
import concurrent.futures
from typing import Dict
import numpy as np
from scalabel.common.parallel import NPROC
from scalabel.common.typing import NDArrayF64
from scalabel.label.typing import... |
num1 = 10
num2 = 20
num3 = 300
num4 = 500 |
"""smart_batching.py: "This class test smart batching improvemnt for gsi indexer nodes during rebalance. MB-33546"
__author__ = "Hemant Rajput"
__maintainer = "Hemant Rajput"
__email__ = "Hemant.Rajput@couchbase.com"
__git_user__ = "hrajput89"
__created_on__ = "15/09/21 03:45 pm"
"""
import random
import time
from g... |
"""
This is a non-parallelized implementation of odd-even transpostiion sort.
Normally the swaps in each set happen simultaneously, without that the algorithm
is no better than bubble sort.
"""
def OddEvenTransposition(arr):
"""
>>> OddEvenTransposition([5, 4, 3, 2, 1])
[1, 2, 3, 4, 5]
>>> OddEvenTr... |
"""
"""
class IterationStatistics:
def __init__(self):
self._cells_counter = {}
@property
def cells_counter(self):
return self._cells_counter
def update(self, cell_id):
"""
Updates cell counter.
:param cell_id: CellId enum (id).
:return: None.
"... |
import os
from datetime import date
import altair as alt
import pandas as pd
def tested_lab():
data = "data/tested_lab.csv"
filename = "graphs/tested_lab.png"
if os.path.exists(filename):
os.remove(filename)
df = pd.read_csv(data)
mapping = {
"new_neg": "New (Negative)",
... |
"""
代理方法工具
"""
import asyncio
import sys
PY_35 = sys.version_info >= (3, 5)
if PY_35:
from collections.abc import Coroutine
BASE = Coroutine
else:
# pragma: no cover
BASE = object
def create_future(loop):
# pragma: no cover
"""Compatibility wrapper for the loop.create_future() call introduce... |
MOD = 10**9 + 7
class Solution:
def numDecodings(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
# Should be 1, but for a related problem (#91) the leetcode.com
# online judge wanted 0, so I assume that's preferred here too.
return 0
... |
from os.path import join, exists, dirname, realpath
from setuptools import setup
import os, sys
# validate python version
if sys.version_info < (3,6):
sys.exit('Sorry, PixPlot requires Python 3.6 or later')
# populate list of all paths in `./pixplot/web`
web = []
dirs = [join('pixplot', 'web'), join('pixplot', 'mod... |
from scripts.plugin_base import ArtefactPlugin
from scripts.ilapfuncs import logfunc, tsv
from scripts import artifact_report
class AdbHostsPlugin(ArtefactPlugin):
"""
"""
def __init__(self):
super().__init__()
self.author = 'Unknown'
self.author_email = ''
self.author_url... |
"""Utilities for interacting with a remote device."""
from __future__ import print_function
from __future__ import division
import os
import sys
import re
import subprocess
import textwrap
from time import sleep
def remote_shell(cmd, verbose=True):
"""Run the given command on on the device and return stdout. T... |
from .user import USER_BLUEPRINT
from .learning_history import LEARNER_BLUEPRINT
from .reports import REPORTS_BLUEPRINT |
# Copyright (c) 2018 NEC, 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 agr... |
#!/usr/bin/python2.7
# Copyright https://github.com/kovaxalive
from __future__ import print_function
import subprocess, time, sys, os
import argparse, numpy
import curses
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-u', '--update-time',
help="Time... |
name = "slack-entities" |
from firedrake import *
from firedrake.petsc import PETSc
from mpi4py import MPI # noqa: F401
import sys
import assess
import math
# Set up geometry and key parameters:
rmin, rmax = 1.22, 2.22
k = int(sys.argv[1]) # radial degree
l = int(sys.argv[2]) # spherical harmonic degree
m = int(sys.argv[3]) # spherical har... |
import pytest
from stock_indicators import indicators
class TestUlcerIndex:
def test_standard(self, quotes):
results = indicators.get_ulcer_index(quotes, 14)
assert 502 == len(results)
assert 489 == len(list(filter(lambda x: x.ui is not None, results)))
r = results... |
class KeyGenerationError(Exception):
"""
Raised when unsuitable values are encountered during key generation.
"""
pass |
# engine/cursor.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
"""Define cursor-specific result set constructs including
:class:`.BaseCursorResul... |
import os
import warnings
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List, Tuple, Dict, Optional, Callable, Union, Sequence
import numpy as np
import torch
from torch.utils.data import DataLoader
from nebullvm.api.frontend.utils import (
check_inputs,
ifnone,
inspe... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... |
# -*- coding: utf-8 -*-
""""""
from fart import metadata
__version__ = metadata.version
__author__ = metadata.authors[0]
__license__ = metadata.license
__copyright__ = metadata.copyright |
#!/usr/bin/python
#import math
import pysal
from pysal.cg.standalone import get_shared_segments, get_bounding_box
__author__ = "Sergio J. Rey <srey@asu.edu> "
__all__ = ["QUEEN", "ROOK", "ContiguityWeights_binning",
"ContiguityWeightsPolygons"]
import time
# delta to get buckets right
DELTA = 0.000001
Q... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Centre National d'Etudes Spatiales (CNES)
#
# 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
#
# ... |
"""Support for esphome sensors."""
import logging
import math
from typing import Optional, TYPE_CHECKING
from homeassistant.components.esphome import EsphomeEntity, \
platform_async_setup_entry
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
if TYPE_... |
#========================================================================================
# File: app_code_configs.py
# Author: Tam Ngo/JSC
# Date: 2012-02-22
#========================================================================================
import os, sys, time, datetime, app_utils
#===================... |
#../env/bin python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'togo.settings')
try:
from django.core.management import execute_from_command_line
except ImportErro... |
# -*- 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
#... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "katacoda.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 2
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_7_2.models.nfs_expor... |
import imageio
import logging
import os
from timeit import default_timer
from collections import defaultdict
from utils.datasets import DATASETS_DICT
from tqdm import trange
import torch
from torch.nn import functional as F
from disvae.utils.modelIO import save_model
TRAIN_LOSSES_LOGFILE = "train_losses.log"
clas... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-08 13:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... |
# coding=utf-8
"""PyTorch optimization for BERT model."""
from apex.fp16_utils import FP16_Optimizer
class FP16_Optimizer_State(FP16_Optimizer):
def __init__(self,
init_optimizer,
static_loss_scale=1.0,
dynamic_loss_scale=False,
dynamic_loss_arg... |
import datetime
import sys
import time
import os
from ClusterGivenGraph.Graph import Graph
from ClusterGivenGraph.GraphHelper import get_graph_based_degree_sequence, create_motifs, export_to_pajek, \
motifs_main_calculation, calc_z_score, export_to_pajek_by_z_score
import networkx as nx
from matplotlib import pypl... |
from __future__ import unicode_literals
import collections
import copy
import datetime
import decimal
import functools
import inspect
import re
import uuid
from collections import OrderedDict
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.exceptions import Vali... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteUserResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... |
"""
Django settings for empty_rice_28410 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
imp... |
import logging
import time
from datetime import datetime
from os import path
from pathlib import Path
from requests.exceptions import ConnectionError
from xml.etree.ElementTree import SubElement, Element, Comment, tostring
from xml.dom.minidom import parseString
from zipfile import ZipFile
from jikanpy.exceptions impo... |
import torch
import torch.nn as nn
import torch.nn.functional as F
class VQALoss(nn.Module):
def __init__(self, scale, loss_type='mixed', m=None):
super(VQALoss, self).__init__()
self.loss_type = loss_type
self.scale = scale
self.m = m #
def forward(self, y_pred, y):
r... |
"""
MIT License
Copyright (c) 2020 Airbyte
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distr... |
# Copyright 2019 The OpenRadar 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 applicable law... |
"""
Module for managing a remote date and time values.
DPT 10.001, 11.001 and 19.001
"""
from enum import Enum
import time
from typing import TYPE_CHECKING, List, Optional, Type, Union
from xknx.dpt import DPTArray, DPTBinary, DPTDate, DPTDateTime, DPTTime
from xknx.exceptions import ConversionError
from .remote_val... |
################################################################################
##### Entry script for psp_gcp dir for training on Google Cloud Platform #####
################################################################################
#import required modules and dependancies
import tensorflow as tf
import arg... |
from unittest import TestCase
from ddtrace.ext.http import URL
from ddtrace.filters import FilterRequestsOnUrl
from ddtrace.span import Span
class FilterRequestOnUrlTests(TestCase):
def test_is_match(self):
span = Span(name="Name", tracer=None)
span.set_tag(URL, r"http://example.com")
fil... |
#coding=utf-8
from sklearn import metrics
from sklearn import cross_validation
from sklearn.svm import SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing import MultiLabelBinarizer
import numpy as np
from numpy import random
X=np.arange(15).reshape(5,3)
y=np.arange(5)
Y_1 = np.arange(5)
... |
from bs4 import BeautifulSoup
import requests
RKI_URL = 'https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Risikogebiete_neu.html'
# THIS CODE IS NOT USED YET BY THE APPLICATION!!!
def main():
rki = requests.get(RKI_URL)
soup = BeautifulSoup(rki.text, 'html.parser')
main_div = soup.find('div... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenPublicAccountResetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenPublicAccountResetResponse, self).__init__()
self._agreement_id = None
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
class Student(models.Model):
SEX_ITEMS = [
(1, '男'),
(2, '女'),
(0, '未知'),
]
STATUS_ITEMS = [
(0, '申请'),
(1, '通过'),
(2, '拒绝'),
]
name = models.CharField(max_... |
# -*- coding: utf-8 -*-
# py2.7 and py3 compatibility imports
from __future__ import unicode_literals
from django.test import TestCase
# Create your tests here. |
# A script for running pyperformance out of the repo in dev-mode.
import os.path
import sys
REPO_ROOT = os.path.dirname(os.path.abspath(__file__))
VENVS = os.path.join(REPO_ROOT, '.venvs')
def resolve_venv_root(kind='dev', venvsdir=VENVS):
import sysconfig
if sysconfig.is_python_build():
sys.exit('... |
# -*- coding: utf-8 -*-
"""
test_build_linkcheck
~~~~~~~~~~~~~~~~~~~~
Test the build process with manpage builder with the test root.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import pytest
... |
#!/usr/bin/env python3
"""
Launch handily a local dev setup consisting of one integritee-node and some workers.
Example usage: `./local-setup/launch.py /local-setup/simple-config.py`
The node and workers logs are piped to `./log/node.log` etc. folder in the current-working dir.
run: `cd local-setup && tmux_logger.sh... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
from bearlibterminal import terminal
def draw_page(tx, ty, page):
for y in range(16):
for x in range(16):
terminal.put((x * 2) + tx, y + ty, page + (16 * y) + x)
def main():
terminal.open()
terminal.set("window: title='Test!', size=80x25, cellsize=16x32;")
terminal.set("input.fil... |
import os
import sys
import math
import select
import socket
import getpass
import logging
import textwrap
from addict import Dict
from six import iteritems
from six.moves import urllib
from pymesos import Scheduler, MesosSchedulerDriver
from tfmesos.utils import send, recv, setup_logger
import uuid
FOREVER = 0xFFFFF... |
import pytest
from schemapi import SchemaBase, SchemaModuleGenerator
@pytest.fixture
def schema():
return {
'definitions': {
'Person': {
'properties': {
'name': {'type': 'string'},
'age': {'type': 'integer'},
}
... |
"""Configuration for Sonos tests."""
from copy import copy
from unittest.mock import AsyncMock, MagicMock, Mock, patch
import pytest
from soco import SoCo
from homeassistant.components import ssdp, zeroconf
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.components.sonos impor... |
from flask import Flask,render_template, url_for, flash, redirect
from forms import RegistrationForm, LoginForm
from app import app
app = Flask(__name__)
app.config['SECRET_KEY'] = '4da30bd01c4cd12344b9a7d1b4fb7784'
reviews = [
{
'author': 'John james',
'title': 'Blog Review ',
'content': ... |
import ujson
from typing import Optional, Dict
import asyncio
import aiohttp
import requests
import binance_chain.messages
from binance_chain.exceptions import (
BinanceChainAPIException, BinanceChainRequestException,
BinanceChainSigningAuthenticationException
)
requests.models.json = ujson
class BaseApiS... |
import numpy as np
import cv2
import os
import os.path as osp
import torch
import yaml
from addict import Dict
import matplotlib.pyplot as plt
from .libs.models import *
from .libs.utils import DenseCRF
from demo import preprocessing, inference
class DeepLabV2Masker(object):
def __init__(self, crf=True):
... |
def word_dist_over_year(fw:list,kw:list,yr_key:list,w:int,top_k:int):
yr_words = dict.fromkeys(yr_key,[])
yr_docs = dict.fromkeys(yr_key,0)
for k, v in ab.items():
# pre-screening
incld_fw = [i for i in range(len(v)) if v[i] in fw]
incld_kw = [i for i in range(len(v)) if v[i] in kw... |
x=int(input())
arr=[]
res=[]
def split(word):
return [char for char in word]
for i in range(x):
b=[]
c=[]
arr.append(str(input()))
y=len(arr[i])
p=int(len(arr[i]) /2)
if(y%2!=0):
b.append(split(arr[i][p+1:]))
c.append(split(arr[i][:p]))
else:
b.ap... |
#!/usr/bin/env python3
########################################################################
# Filename : I2CLCD1602.py
# Description : Use the LCD display data
# Author : freenove
# modification: 2018/08/03
########################################################################
from PCF8574 import PCF8574_... |
#!/usr/bin/env python
import sys
import os
# source: https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
# Take a sysroot directory and turn all the absolute symlinks and turn them into
# relative ones such that the sysroot is usable within another system.
if len(sys.argv) != 2... |
#!/usr/bin/env python
"""
Binary task of cover song identification using the Millions Song Dataset
and the Second Hand Song dataset.
It takes the Million Song Dataset path as an argument.
The list of queries to test must be located in:
./SHS/list_500queries.txt
The training set of the Second Hand Song dataset must... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 24 09:33:04 2015
@author: bmmorris
"""
import numpy as np
import triangle
from matplotlib import pyplot as plt
def splitchain(infile, outfile, tossfraction=0.9):
'''
Take the last `savefraction` of file `infile`, save it as the
smaller file `outfile`.
''... |
#!/usr/bin/env python3
import subprocess, sys, os, time
NR_THREAD = 1
start = time.time()
cmd = './utils/count.py tr.csv > fc.trva.t10.txt'
subprocess.call(cmd, shell=True)
cmd = 'converters/parallelizer-a.py -s {nr_thread} converters/pre-a.py tr.csv tr.gbdt.dense tr.gbdt.sparse'.format(nr_thread=NR_THREAD)
subpr... |
#!/usr/bin/env python
""" Mongo Collection records reader that is using parallel processing
for handling records that read. """
__author__ = "Yaroslav Litvinov"
__copyright__ = "Copyright 2016, Rackspace Inc."
__email__ = "yaroslav.litvinov@rackspace.com"
from gizer.etl_mongo_reader import EtlMongoReader
from mo... |
#!/usr/bin/env python3
import re
import sys
import logging
import argparse
from unicon.mock.mock_device import MockDevice, MockDeviceTcpWrapper
logger = logging.getLogger(__name__)
class MockDeviceSpitfire(MockDevice):
def __init__(self, *args, **kwargs):
super().__init__(*args, device_os='iosxr', **kw... |
"""Data aggregators for dashboards
For the purposes of all these numbers, we pretend as if Documents with
is_localizable=False or is_archived=True and Revisions with
is_ready_for_localization=False do not exist.
"""
import logging
from collections import OrderedDict
from datetime import datetime
from django.conf im... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowUserMfaDeviceRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): T... |
import json
async def request_get_stub(url: str, stub_for: str, status_code: int = 200):
"""Returns an object with stub response.
Args:
url (str): A request URL.
stub_for (str): Type of stub required.
Returns:
StubResponse: A StubResponse object.
"""
return StubResponse(s... |
import dynet as dy
import moire
from moire import nn, ParameterCollection, Expression
class GRUCell(nn.Module):
def __init__(self, pc: ParameterCollection, input_size: int, hidden_size: int,
activation=dy.tanh, recurrent_activation=dy.logistic) -> None:
super(GRUCell, self).__init__(pc)
... |
"""
PASSENGERS
"""
numPassengers = 3769
passenger_arriving = (
(0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 2, 2, 0, 0, 1, 0, 0, 0), # 0
(2, 1, 0, 3, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0), # 1
(0, 0, 1, 1, 1, 1, 0, 1, 2, 0, 0, 0, 0, 1, 0, 1, 3, 1, 0, 1, 0, 1, 0, 1, 0, 0), # ... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.17
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import r... |
# -*- coding: utf-8 -*-
##############################################################################
# Author:QQ173782910
##############################################################################
import json
from datetime import datetime
from getaway.base_websocket import BaseWebsocket
from utils.event.engine ... |
from awssg.Client_Interface import Client_Interface
from awssg.VPC_Client import VPC_Client
import boto3
class Client(Client_Interface):
def __init__(self):
self.ec2_client = boto3.client('ec2')
def describe_security_groups(self) -> dict:
return self.ec2_client.describe_security_groups()
... |
"""
Copyright 2020 Inmanta
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 ... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework... |
# -*- coding: utf-8 -*
from .image import load_image
from .misc import Registry, Timer, load_cfg, md5sum, merge_cfg_into_hps
from .path import complete_path_wt_root_in_cfg, ensure_dir
from .torch_module import (average_gradients, convert_numpy_to_tensor,
convert_tensor_to_numpy, move_data_to_... |
#!c:\users\batle\pycharmprojects\rentomatic\venv\scripts\python.exe
# $Id: rstpep2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML from PEP
(Python E... |
# -*- coding: utf-8 -*-
"""
@author: Federico Cerchiari <federicocerchiari@gmail.com>
Places used by Tempy to choose the right TempyREPR to use.
Magically created starting from the tags module.
"""
import importlib
from .tempyrepr import TempyPlace
class Inside(TempyPlace):
"""Check if a TempyREPR object's contai... |
# ---------------------------------------------------------
# Copyright (c) 2015, Saurabh Gupta
#
# Licensed under The MIT License [see LICENSE for details]
# ---------------------------------------------------------
from ...utils import bbox_utils
import numpy as np
def inst_bench_image(dt, gt, bOpts, overlap = None)... |
from scipy.stats import beta
import numpy as np
S = 47
N = 100
a = S+1
b = (N-S)+1
alpha = 0.05;
CI1 = beta.interval(1-alpha, a, b)
l = beta.ppf(alpha/2, a, b)
u = beta.ppf(1-alpha/2, a, b)
CI2 = (l,u)
samples = beta.rvs(a, b, size=1000)
samples = np.sort(samples)
CI3 = np.percentile(samples, 100*np.array([alph... |
#!/usr/bin/env python
# Copyright (C) 2015 UCSC Computational Genomics Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import generics
from django.db.models import Q
from django.contrib.auth import get_user_model
from .serializers import *
from .models import *
# Requests
class CreateRequestVie... |
import numpy as np
def eta_init(eta,eta0,eta_up,eta_up0,nx,dx, \
slope,xl,xb1,xb2,xb3,dbed):
zb0=xl*slope
for i in np.arange(0,nx+2):
xx=dx*float(i)
eta_up[i]=zb0-xx*slope
eta_up0[i]=eta_up[i]
# print(i,nx,eta_up[i])
if xx>xb1 and xx<xb2:
ss=xx-xb1
... |
import pytest
from .adapters import bootstrap_test_app
from karp.services import messagebus
from karp.domain import events, errors, commands
from karp.utility.unique_id import make_unique_id
class TestCreateResource:
def test_create_resource(self):
bus = bootstrap_test_app()
id_ = make_unique_id(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.