text stringlengths 2 999k |
|---|
def f(x):
u"""<caret> |
"""
Sentinel Search & Download API
Authors: Jonas Eberle <jonas.eberle@uni-jena.de>, Felix Cremer <felix.cremer@uni-jena.de>, John Truckenbrodt <john.truckenbrodt@uni-jena.de>
Example usage: Please see the "main" function at the end of this file
TODO:
- Documentation
"""
#############################################... |
#!/usr/bin/env python
import os
import socket
import logging
from bottle import route, request, response, error, default_app, view, static_file, template, hook
from tinydb import TinyDB, Query
from tinydb.operations import increment
def return_tpl(tpl, *data):
if not appMode is 'prod':
return template("m... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-29 13:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mpinstaller.models
import tinymce.models
class Migration(migrations.Migration):
initial = True
dependencies = [
... |
import time
import logging
import pytest
from itertools import count
from .cl_node.casperlabsnode import ( COMBINED_CONTRACT, COUNTER_CALL, HELLO_WORLD, MAILING_LIST_CALL)
from .cl_node.wait import wait_for_block_hash_propagated_to_all_nodes
from test import contract_hash
@pytest.fixture(scope='module')
def three_nod... |
from .stackhourglass import PSMNet as stackhourglass
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The setup script is the centre of all activity in building, distributing,
and installing modules using the Distutils. It is required for ``pip install``.
See more: https://docs.python.org/2/distutils/setupscript.html
"""
from __future__ import print_function
import o... |
from ckeditor.fields import RichTextField
from django.db import models
# Create your models here.
from questions.models import Tag
from users.models import User
from ckeditor_uploader.fields import RichTextUploadingField
class HeadlinesCategory(models.Model):
"""
头条分类
"""
name = models.CharField(max_... |
# -*- coding: utf-8 -*-
# Heap-Sort
# A = list/array
def heapSort(A):
build_max_heap(A)
for i in range(len(A) - 1, -1, -1):
swap(A, 0, i)
max_heapify(A, 0, i)
# -- START help functions --
# A = list/array
# i = largest index
# end = A.length (end of A)
def max_heapify(A, i, end):
left =... |
"""
This file is used to generate the files from template
"""
import sys
import os
from jinja2 import Template
TEMPLATES_DIR = "templates/"
def template(filename, template_file=None, template_args=None):
"""Function helping to generate final files from templates"""
if template_file is None:
templat... |
# -*- coding: utf-8 -*-
import json
import logging
from pprint import pprint as pp
import click
from loqusdb.commands.cli import cli as base_command
LOG = logging.getLogger(__name__)
@base_command.command("cases", short_help="Display cases in database")
@click.option("-c", "--case-id", help="Search for case")
@cli... |
import sys
from dataclasses import asdict
from typing import Dict, Optional
import gevent
import structlog
from web3 import Web3
from web3.contract import Contract
from monitoring_service.constants import MAX_FILTER_INTERVAL
from pathfinding_service.database import PFSDatabase
from pathfinding_service.exceptions impo... |
"""Contains utilities that extend the Django framework."""
from django.db import models
class PycontModel(models.Model):
"""Base model for the entire application, adding created_at and last_updated_at columns."""
class Meta:
"""Make it abstract."""
abstract = True
created_at = models.Da... |
from typing import Any, Dict, List, Optional
from .api.client import APIClient
from .common import SizedIterable, AbstractSizedIterator
from . import job_definition_version, job, model
# Entity class
class JobDefinition():
"""Training job definition object.
"""
def __init__(self,
api: A... |
from pdf2image import convert_from_path, convert_from_bytes
import requests
import cv2
import numpy as np
import re
import pytesseract
# config
DPI = 200 #-> default img shape 2339x1654, do not change this
BIN_INV_THRESHOLD = 192
#
VERTICAL_FILTER = cv2.getStructuringElement(cv2.MORPH_RECT, (1, 20))
ROW_FILTER = cv2... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
# -*- coding: utf-8 -*-
"""
:Author: Dominic Hunt
"""
import logging
import numpy as np
import scipy as sp
import itertools
from fitAlgs.fitAlg import FitAlg
class Minimize(FitAlg):
"""The class for fitting data using scipy.optimise.minimize
Parameters
----------
fit_sim : fit... |
import pandas as pd
import dash
from dash.dependencies import Input, Output, State
from flask import send_file
import os
import io
from . markergenes_functions import identify_marker_genes
from plotting.plotting_functions import *
from helper_functions import *
from status.status_functions import *
from app impor... |
import sys, os
sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定
import numpy as np
from dataset.mnist import load_mnist
from controller import Controller
# データの読み込み
(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, one_hot_label=True)
# instance
controller = Controller()
# accuracy
trycount = ... |
'''
Created on Nov 14, 2017
@author: Salim
'''
class FormatTypeNotAcceptable(Exception):
'''
Exception to FormatTypeNotAcceptable
'''
def __init__(self, msg):
Exception.__init__(self, msg)
class InvalidStateException(Exception):
'''
Exception to InvalidStateException... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
from meeshkan.nlp.ids.id_classifier import IdType
def test_github(analyzer):
path_item = analyzer.extract_values("/search/users")
assert "user" == path_item.entity
assert path_item.id is None
def test_opbank(analyzer):
path_item1 = analyzer.extract_values("/v1/payments/confirm")
assert "payment"... |
from server.BasicClientActorAbs import BasicClientActorAbs
import TOURNAMENT, ANET
class BasicClientActor(BasicClientActorAbs):
def __init__(self, ip_address=None, verbose=True):
self.series_id = -1
self.anet = None
BasicClientActorAbs.__init__(self, ip_address, verbose=verbose)
def h... |
from jinja2 import Environment
env = Environment(line_statement_prefix='%', variable_start_string="${", variable_end_string="}")
tmpl = env.from_string("""\
% macro foo()
${caller(42)}
% endmacro
<ul>
% for item in seq
<li>${item}</li>
% endfor
</ul>
% call(var) foo()
[${var}]
% endcall
% filter escape
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
class RestApi(pulumi.CustomResource):
"""
Provides an API Gateway REST API.
"""
de... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Reformats Wise's CSV file into a format usable by personal finance software.
#
# Copyright (c) 2020-2021, Sasmito Adibowo
# https://indiespark.top
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitte... |
# Copyright (c) 2015-2021 Vector 35 Inc
#
# 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, ... |
#
# PySNMP MIB module HH3C-BFD-STD-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-BFD-STD-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:12:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... |
# Copyright (c) 2018 Red Hat, 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... |
from django.db import models
from django_extensions.db.fields.json import JSONField
class SettingsModule(models.Model):
name = models.CharField(max_length=128)
class CommandLine(models.Model):
command = models.CharField(max_length=64)
module = models.ForeignKey(SettingsModule)
when = models.DateTimeF... |
# DESAFIO 055
# Faça um programa que leia o peso de 5 pessoas. No final, mostre qual foi o maior e o menor peso lidos.
maior = 0
menor = 0
for p in range(1, 6):
peso = float(input(f'Qual o peso da {p}ª pessoa? Kg '))
if p == 1:
maior = peso
menor = peso
else:
if peso > maior:
... |
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QVBoxLayout, QSplitter
from xu.compa.Parapluie import PWidget, Parapluie
from xu.src.python.Module.ParamEditor import TextEditWidget, EditorType, ParamEditor, ParamEditorConnect
from xu.src.python.Request.Model import BodyType
class RequestBody(PWidget):
d... |
from typing import List
from moodle import MoodleWarning
from moodle.attr import dataclass, field
@dataclass
class View:
"""View Resource
Args:
status (int): status: true if success
warnings (List[Warning]): list of warnings
"""
status: int
warnings: List[MoodleWarning] = field(f... |
# Copyright (c) 2020 UATC, 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... |
import scipy.special as sc
from scipy import integrate
from numpy import exp
yp = 40
yc = 50
alpha = 0.2
beta = 1
t = 7
delta_y = 1.4
shape = alpha*t
gamma_shape = sc.gamma(shape)
gamma_shape_1 = sc.gamma(shape-1)
gammainc_yp = sc.gammaincc(shape-1, yp)*gamma_shape_1 # because funct calculates normaliz... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... |
"""
===============================================
vidgear library source-code is deployed under the Apache 2.0 License:
Copyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with th... |
#!/usr/bin/env python
# https://oj.leetcode.com/problems/excel-sheet-column-number/
class Solution:
# @param s, a string
# @return an integer
def titleToNumber(self, s):
s = s[::-1]
result = 0
for i in range(len(s)):
n = ord(s[i]) - ord('A') + 1
result += n ... |
from __future__ import absolute_import
from kdeLF import *
__version__ = '1.3.0'
|
from whyclick import whyq
|
import gym
import click
import os
import gym
import numpy as np
import pickle
import torch
import skvideo.io
import mj_envs
from mjrl.utils.gym_env import GymEnv
from decision_transformer.evaluation.evaluate_episodes import evaluate_episode_rtg
from decision_transformer.models.decision_transformer import DecisionTran... |
import os
import pytest
from stable_baselines import A2C, ACER, PPO2
from stable_baselines.common.policies import MlpLstmPolicy, LstmPolicy
class CustomLSTMPolicy1(LstmPolicy):
def __init__(self, sess, ob_space, ac_space, n_env, n_steps, n_batch, n_lstm=128, reuse=False, **_kwargs):
super().__init__(ses... |
import csv
import datetime
import io
from collections import OrderedDict
from pipeline.exceptions import IsHeaderException
from xlrd import open_workbook, xldate_as_tuple, XL_CELL_DATE
class Extractor(object):
def __init__(self, connection):
self.connection = connection
self.checksum = None
... |
import unittest
import tempfile
import os
import numpy as np
import caffe
def simple_net_file(num_output):
"""Make a simple net prototxt, based on test_net.cpp, returning the name
of the (temporary) file."""
f = tempfile.NamedTemporaryFile(delete=False)
f.write("""name: 'testnet' force_ba... |
import gym
import numpy as np
from quadruped_spring.utils.timer import Timer
class LandingWrapper(gym.Wrapper):
"""
Wrapper to switch controller when robot starts taking off.
Dear user please pay attention at the order of the wrapper you are using.
It's recommended to use this one as the last one.
... |
import pickle
from .. import croatian
from ...datasources import revision_oriented
from ...dependencies import solve
from .util import compare_extraction
BAD = [
"fuck",
"jebi",
"jebite",
"jebanje",
"kučka",
"kurva",
"kuja",
"kuje",
"prokleta",
"proklet",
"proklete",
"... |
import unittest
import numpy as np
from skactiveml.utils import (
is_labeled,
is_unlabeled,
labeled_indices,
unlabeled_indices,
check_missing_label,
check_equal_missing_label,
)
class TestLabel(unittest.TestCase):
def setUp(self):
self.y1 = [np.nan, 2, 5, 10, np.nan]
self... |
import torch
import torch.nn as nn
import torch.nn.functional as F
DEVICE = torch.device('cuda')
class Selection(nn.Module):
def __init__(self, in_channels, reduction, save_device=torch.device('cpu')):
super(Selection, self).__init__()
self.save_device = save_device
self.reduction = redu... |
#!/usr/bin/env python3
"""
Interactive Pixel Drill for AGDCv2.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib; matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import matplotlib.animation... |
#!/usr/env/python3
'''
Script which reads in Falkor mission data and estimates the extraction efficiency of the
gas sensor based on data readings.
Maintainer: vpreston-at-{whoi, mit}-dot-edu
'''
import numpy as np
from parseyak import jetyak
import utm
from gasex import airsea
from gasex.diff import schmidt
import m... |
"""
Random generation of approval profiles
"""
import random
from math import fabs, sqrt
from abcvoting.preferences import Profile
def random_urn_profile(num_cand, num_voters, setsize, replace):
"""Generate Polya Urn profile with fixed size approval sets."""
currsize = 1.
apprsets = []
replacedsets ... |
# -*- 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
import json
from jupyter_server.base.handlers import APIHandler
from jupyter_server.utils import url_path_join
import tornado
from tornado.web import StaticFileHandler
from os import path
ROOT = path.dirname(__file__)
PUBLIC = path.join(ROOT, 'zethus')
class RouteHandler(APIHandler):
# The following decorator... |
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive
# SMUGMUG = "http://photos.reinout.vanrees.org"
TAGLINK = "../../../tags/%s.html"
ROOTTAGLINK = "tags/%s.html"
# SERMONTAGLINK = "../tags/%s.html"
# SERMONREFERENTLINK = "../predikanten/%s.html"
# SERMONCH... |
# Copyright 2015 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... |
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... |
# Copyright 2016 IBM Corp.
# Copyright 2017 Rackspace Australia
# Copyright 2018 Michael Still and Aptira
#
# 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.apach... |
from gaphor import UML
from gaphor.diagram.presentation import ElementPresentation, LinePresentation
class DummyVisualComponent:
def size(self, ctx):
return 0, 0
def draw(self, ctx, bounding_box):
pass
class StubElement(ElementPresentation):
def __init__(self, diagram, id=None):
... |
# coding: utf-8
from __future__ import unicode_literals
import uuid
from .common import InfoExtractor
from ..compat import (
compat_str,
compat_urllib_parse_urlencode,
compat_urlparse,
)
from ..utils import (
int_or_none,
extract_attributes,
determine_ext,
smuggle_url,
parse_duration,
... |
# -*- coding: utf-8 -*- #
# Copyright 2013 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 requir... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
#!/usr/bin/env python
# coding: utf-8
# # Exercise: CPU and the Devcloud
#
# Now that we've walked through the process of requesting a CPU on Intel's DevCloud and loading a model, you will have the opportunity to do this yourself with the addition of running inference on an image.
#
# In this exercise, you will do t... |
import numpy as np
from qiskit.circuit import QuantumCircuit
from qiskit.circuit import Parameter
from evaluator import Evaluator
from pauli_string import PauliString
from evaluator import BasicEvaluator
from qiskit import Aer, execute
from hamiltonian import MolecularFermionicHamiltonian
from mapping import JordanWign... |
from django_evolution.mutations import AddField, ChangeField
from django.db import models
MUTATIONS = [
AddField('ReviewRequest', 'local_site', models.ForeignKey, null=True,
related_model='site.LocalSite'),
AddField('ReviewRequest', 'local_id', models.IntegerField, initial=None,
null... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.Product import Product
from alipay.aop.api.domain.Sale import Sale
class AlipayEcoMycarFuellingShopQueryResponse(AlipayResponse):
def __init__(self... |
# This test needs face_recognition library
# You can install it with: pip install face_recognition
import argparse
import face_recognition
import cv2
from cv2_tools.Management import ManagerCV2
from cv2_tools.Selection import SelectorCV2
from cv2_tools.Storage import StorageCV2
def face_detector(frame, scale, detail... |
EMAIL_PASSWORD = 'password from your email' #'ddbmsqbsmbmtmeeu'
EMAIL_ADDRESS = 'your email address'
LIST_EMAIL_COLLEAGUES = {
'name1': "xxxxxxxxxxx@elektroline.cz",
'name2': "xxxxxxxxx@elektroline.cz",
'name3': "xxxxx.x@gmail.com"
} |
#
# Copyright 2019 Bernhard Walter
#
# 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... |
import cv2
import numpy as np
import math
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# from OpenGL.GL import *
# from OpenGL.GLU import *
def make_gaussian(size, fwhm=3, center=None):
""" Make a square gaussian kernel.
size is the length of a side of the square
fwhm is full-wi... |
# -*- coding: utf-8 -*-
'''
The module used to execute states in salt. A state is unlike a module
execution in that instead of just executing a command it ensure that a
certain state is present on the system.
The data sent to the state calls is as follows:
{ 'state': '<state module name>',
'fun': '<state fun... |
"""image_io.py
Purpose: contains functions to read image data and extract metadata.
"""
import numpy as np
import logging
try:
from osgeo import gdal
except ImportError:
import gdal
class RasterIO:
@staticmethod
def open_raster(i):
"""Open raster as GDAL object
Args:
i <s... |
# -*- coding: utf-8 -*-
""" Deeplabv3+ model for Keras.
This model is based on TF repo:
https://github.com/tensorflow/models/tree/master/research/deeplab
On Pascal VOC, original model gets to 84.56% mIOU
MobileNetv2 backbone is based on this repo:
https://github.com/JonathanCMitchell/mobilenet_v2_keras
# Reference
- [... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'farm-widgets.ui'
#
# Created by: PyQt5 UI code generator 5.13.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
M... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import torch.utils.data as data
from PIL import Image
import PIL
import os
import os.path
import pickle
import random
import numpy as np
import pandas as pd
from StackG... |
# Copyright 2015 Huawei Technologies Co., Ltd.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
from dataclasses import dataclass
from typing import List
@dataclass
class Order:
quantity: int
item_price: int
def price_before(order: Order):
# price is base price - quantity discount + shipping
return (
order.quantity * order.item_price
- max(0, order.quantity - 500) * order.ite... |
import cv2
from Classifier.KeypointsFinder.Keypoints_Finder import KeypointsFinder
from Classifier.PostureClassifier.Posture_Classifier import PostureClassifier
def analyze_prediction(prediction):
if prediction[0][0] < prediction[0][1]:
prediction = "Good"
else:
prediction = "Bad"
return ... |
import unittest
import pytest
from influxdb_client import BucketRetentionRules
from influxdb_client.rest import ApiException
from tests.base_test import BaseTest, generate_bucket_name
class BucketsClientTest(BaseTest):
def setUp(self) -> None:
super(BucketsClientTest, self).setUp()
response = s... |
# Copyright 2021 Injective Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
from django.contrib import admin
from backend.apps.analysis.models import Analysis
from backend.apps.child.models import Child
from backend.apps.healthexamination.models import HealthExamination
from backend.apps.parent.models import Parent
from backend.apps.vaccination.models import Vaccination
admin.site.register(P... |
"""Collection of tests for elementwise functions."""
# global
import numpy as np
from hypothesis import given, assume, strategies as st
from numbers import Number
# local
import ivy
import ivy_tests.test_ivy.helpers as helpers
import ivy.functional.backends.numpy as ivy_np
# abs
@given(
dtype_and_x=helpers.dtyp... |
import _plotly_utils.basevalidators
class MetasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="metasrc", parent_name="funnelarea", **kwargs):
super(MetasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... |
import queue
import threading
import time
class MyThread(threading.Thread):
def __init__(self, thread_name, work_queue):
self.thread_name = thread_name
self.work_queue = work_queue
super().__init__()
def run(self):
print(f'Starting {self.thread_name}')
while not exit... |
from functools import partial
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init
from mmdet.core import (PointGenerator, build_assigner, build_sampler,
images_to_levels, multi_apply, multiclass... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup, find_packages
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
# Add your dependencies in requirements.txt
# Note: you can ad... |
"""
hard-encoded corresponding 2D map of CYC 4th floor
"""
import math
import numpy as np
from ssl_setup import STEP_SIZE
class Map:
def __init__(self):
# start position
# mass center of the walker
self.walker_pos_x = None
self.walker_pos_z = None
# world axis indicat... |
import time
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import carla
import pygame
import random
import math
from skimage.transform import resize
from collections import deque
from gym_carla_feature.start_env.render import BirdeyeRender
from gym_carla_feature.start_env.route_plann... |
from base import BaseFBWeb
from utilfile import FileUtil
from database import Database
from initial import FBInit
import os
svm_path = '/home/ubuntu/liblinear-ovo-1.94'
is_db_save = True
class FBCredibility(BaseFBWeb):
def __init__(self, request):
self.request = request
def get_credibility(self):... |
# from core.settings import app
# from core.utils import version
# import sys
# import os
# sys.path.insert(0, os.path.abspath('..')) |
# Generated by Django 1.9.2 on 2016-02-27 20:22
import machina.core.validators
import machina.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("forum_member", "0002_auto_20160225_0515"),
]
operations = [
migrations.AlterField(
... |
import re
import dask.dataframe as dd
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.ensemble import RandomForestClassifier
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_selection import SelectPerce... |
import unittest
import numpy as np
import numpy.testing as npt
from gym_anm_custom.simulator import Simulator
from tests.base_test import BaseTest
class TestSimulator(BaseTest):
def setUp(self):
self.baseMVA = 10
network = {
'baseMVA': self.baseMVA,
'bus': np.array([[0, 1... |
from django.urls import path
from django_cradmin.apps.cradmin_resetpassword.views.begin import BeginPasswordResetView
from django_cradmin.apps.cradmin_resetpassword.views.email_sent import EmailSentView
from django_cradmin.apps.cradmin_resetpassword.views.reset import ResetPasswordView
urlpatterns = [
path('begin... |
""" Robolfd loggers."""
from robolfd.utils.loggers.base import Logger
from robolfd.utils.loggers.terminal import TerminalLogger |
import torch
import numpy as np
torch.manual_seed(120)
from tqdm import tqdm
from pytorch3d.loss import chamfer_distance
from NURBSDiff.surf_eval import SurfEval
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from geomdl import exchange
from geomdl.visualization import... |
# Copyright (c) 2014-2019 The Bitcoin Core Developers
# Copyright (c) 2014-2019 Dash Developers
# Copyright (c) 2018-2019 True Crypto OSS Community
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regres... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-05-09 08:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0027_auto_20180503_1520'),
]
operations = [
migrations.AddField(
... |
#!D:\PycharmProjects\TohoMusicPy\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
... |
"""
A directive for including a matplotlib plot in a Sphinx document.
By default, in HTML output, `plot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the plot may be included in one of three ways:
1. **A path to a source file** as t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.