text stringlengths 1 927k |
|---|
"""
Provides an extra question and configuration ``docs_semver_over_calver``
to :mod:`doc` to determine whether Semantic or Calendar Versioning is wanted.
"""
from mold import Tool, Question, templates_from_directory
from ...domains import python, module
from ...face.doc import interface as doc, Provides as DocVars
fro... |
import torch
import numpy as np
class AverageMetric(object):
def __init__(self, threshold=0.5):
self.dice_scores = []
self.threshold = threshold
def update(self, outputs, labels):
with torch.no_grad():
probs = torch.sigmoid(outputs)
dice_score = self.dice_metr... |
"""APPLY PYTHAGOREAN THEOREM IN LEARNING DATA + SMOOTH VELOCITIES"""
import os
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from helper import img_id, sub_id, TRIALS_PATH
# Apply PT into smoothed learning data to find sample-to-sample d... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import contextlib
import warnings
from thriftpy2._compat import PY35
from thriftpy2.protocol import TBinaryProtocolFactory
from thriftpy2.server import TThreadedServer
from thriftpy2.thrift import TProcessor, TClient
from thriftpy2.transport import (
... |
from flask import Blueprint, jsonify
from flask import render_template
from flask import request
from sqlalchemy import exc
from project.api.utils import authenticate
from project import db
from project.api.models import User
users_blueprint = Blueprint('users', __name__, template_folder='./templates')
@users_bluepr... |
""" Advent of code 2020 day 08/1 """
import unittest
from solution import solution
class MyTest(unittest.TestCase):
"""Unist tests for actual day"""
def test_basic(self):
""" Test from the task """
self.assertEqual(solution("""\
nop +0
acc +1
jmp +4
acc +3
jmp -3
acc -99
acc +1
jmp -4
acc +6... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
try:
from io import StringIO # py3
except ImportError:
from StringIO import StringIO # py2
def h2ono_progress():
"""
... |
#Faça um programa que leia um número de 0 a 9999 e
#mostre na tela cada um dos dígitos separados.
numero = float(input('Digite um número: '))
unidade = numero // 1 % 10
dezena = numero // 10 % 10
centena = numero // 100 % 10
milhar = numero // 1000 % 10
print(f'Unidade: {unidade}')
print(f'Dezena: {dezena}')
print(f'Ce... |
# -*- 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... |
import radio
import speech
import music
from microbit import *
radio.on()
while True:
try:
incoming = radio.receive()
#display.scroll(incoming,wait=False)
#music.pitch(int(incoming))
speech.say(incoming)
except:
pass |
import pandas as pd
import pyspark.sql.functions as F
from pyspark.sql import SparkSession
import sparknlp
sparknlp.start()
from sparknlp.pretrained import PretrainedPipeline
pd.set_option('max_colwidth', 800)
spark = SparkSession.builder.config("spark.jars.packages", "com.johnsnowlabs.nlp:spark-nlp_2.12:3.0.3").getO... |
# USAGE
# python opencv_generate_aruco.py --id 24 --type DICT_5X5_100 --output tags/DICT_5X5_100_id24.png
# import the necessary packages
import numpy as np
import argparse
import cv2
import sys
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-o", "--output", re... |
"""
Validation of models of any type against basic covalent geometry restraints.
By default this will flag all restrained atoms deviating by more than 4 sigma
from the target value.
"""
from __future__ import absolute_import, division, print_function
from mmtbx.validation import atoms, validation, get_atoms_info
from ... |
#!/usr/bin/env python
"""
Generates an AXI Stream crosspoint wrapper with the specified number of ports
"""
import argparse
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=int, default=[4], nargs='+', help="numbe... |
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... |
from django.db import migrations
from api.metadata.constants import OrganisationType
ORGANISATIONS = [
{
"name": "The Charity Commission",
"organisation_type": OrganisationType.NON_MINISTERIAL_DEPARTMENTS
},
{
"name": "Competition and Markets Authority",
"organisation_type... |
#!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from _adb import Adb
from _benchresult import BenchResult
from _hardware import HardwareException, Hardware
from argparse imp... |
# Written by S. Mevawala, modified by D. Gitzel
# ECE303 Communication Networks
# Project 2: Selective Repeat simulator
# Jon Lu & David Yang 05/02/2021
import logging
import channelsimulator
import utils
import sys
import socket
import array
import hashlib
class Receiver(object):
def __init__(self, inbound_por... |
from ..models import Blog
from django.template import Library
register = Library()
@register.inclusion_tag('blog/feeds.html')
def blog_feeds():
blogs = Blog.objects.all()
return {'blogs': blogs}
@register.inclusion_tag('blog/feeds.html')
def blog_feed(blog):
return {'blogs': (blog,)} |
from telegram import constants
from telegram.ext import Updater
from distutils.version import LooseVersion
from telegram import __version__ as ptb_version
from utils import functions, globals, log
logger = log.get_logger(name='Bot')
def polling(args):
request_kwargs = {
'proxy_url': args.proxy} if args.pr... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import pymongo
import datetime
import logging
from scrapy.conf import settings
import sys
reload(sys)
sys.setdefaultencoding(... |
# python3
def max_pairwise_product_naive(numbers):
assert len(numbers) >= 2
assert all(0 <= x <= 2 * 10 ** 5 for x in numbers)
product = 0
for i in range(len(numbers)):
for j in range(i + 1, len(numbers)):
product = max(product, numbers[i] * numbers[j])
return product
def ... |
import json
import pytest
from rancher import ApiError
from .common import random_str
from .conftest import wait_for
@pytest.mark.skip(reason="cluster-defaults disabled")
def test_generic_initial_defaults(admin_mc):
cclient = admin_mc.client
schema_defaults = {}
setting_defaults = {}
data = cclient.s... |
import time
from Adafruit_PWM_Servo_Driver import PWM
from Servo import Servo
if __name__ == '__main__':
# mg995
servo2 = Servo(channel=0, min=150, max=530, freq=100) # mg995
# sg90
# Servo pan
# servo2 = Servo(channel=2, min=250, max=380, freq=50)
# sg90 2
# servo tilt
# servo3 = S... |
# -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2016 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundat... |
#!/usr/bin/env python3
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# See LICENSE.txt included in this distribution for the specific
# language gove... |
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql import expression
__all__ = ['gen_random_uuid']
class gen_random_uuid(expression.FunctionElement): # noqa Class names should use CamelCase convention
type = UUID()
@compiles(gen_random_uuid, ... |
"""
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 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/
"""
impor... |
class Solution(object):
def convertToTitle(self, n):
"""
:type n: int
:rtype: str
"""
LOOKUP = {
0: 'A', 1: 'B',
2: 'C', 3: 'D',
4: 'E', 5: 'F',
6: 'G', 7: 'H',
8: ... |
from .json_work import JsonWork |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_conv_layer, build_upsample_layer
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import BaseModule, ModuleList, auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
... |
# Generated by Django 2.1.2 on 2018-10-17 07:32
import core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('statistic', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... |
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... |
import sys
import numpy as np
import matplotlib
print("Python:", sys.version)
print("Numpy:", np.__version__)
print("Matplotlib:", matplotlib.__version__) |
"""Currying.
Transform a function that takes multiple arguments into a function for which some of the arguments are preset.
Source: Adrian
"""
# Implementation author: cym13
# Created on 2015-11-30T12:37:28.255934Z
# Last modified on 2019-09-26T16:59:21.413984Z
# Version 3
from functools import partial
def f(a):
... |
import unittest
import pytest
import numpy as np
from spikeinterface.core.tests.testing_tools import generate_recording
from spikeinterface.toolkit.utils import (get_random_data_chunks,
get_closest_channels, get_noise_levels)
def test_get_random_data_chunks():
rec = g... |
'''
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/GetStarted/03_finding_images.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_bla... |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class TreeRegistryCrawlerPipeline(object):
def process_item(self, item, spider):
return item |
from rest_framework.serializers import ValidationError
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import get_user_model, authenticate
User = get_user_model()
def pwdExist(data):
try:
new_password = str(data['new_password'])
return data
except KeyError:
... |
# Generated by Django 2.2.12 on 2020-05-24 21:17
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_add_custom_user'),
]
operations = [
migrations.AlterField(
model_name='user',
... |
# coding=utf-8
# Copyright 2018 Google T5 Authors and HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
import os
import scipy.signal
import numpy as np
from soundfile import SoundFile
from pyutils.iolib.video import getFFprobeMeta
from pyutils.cmd import runSystemCMD
# from scikits.audiolab import Sndfile, Format
import tempfile
import resampy
# import librosa
def load_wav(fname, rate=None):
# fp = Sndfile(fname, ... |
from .api import PayeerAPI, PayeerAPIException |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The AmlBitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p mempool message.
Test that nodes are disc... |
#!/usr/bin/python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of ... |
from GenericRequest import GenericRequest
class TakeMeatFromClosetRequest(GenericRequest):
"Adds meat to the player's closet."
def __init__(self, session, meat=""):
super(TakeMeatFromClosetRequest, self).__init__(session)
self.url = session.serverURL + "closet.php"
self.requestData["pw... |
#!/bin/python3
from courses import Courses
for course in Courses():
lectures = course.lectures
course_title = lectures.course.info["title"]
lines = [r'\documentclass[a4paper]{article}',
r'\input{../preamble.tex}',
fr'\title{{{course_title}}}',
... |
def to_predictionstring(x):
prob, x, y, width, height = x
return "{} {} {} {} {}".format(prob, x, y, width, height)
def create_predict_df(label_predict_df, bb_predict_df):
predict_df = label_predict_df.merge(bb_predict_df, how="left", on="name")
predict_df["patientId"] = predict_df["name"]
predict... |
# Queue
# Queue is a FIFO data structure - - first-in, first-out.
# Deque is a double-ended queue, but we can use it for our queue.
# We use append() to enqueue an item, and popleft() to dequeue an item.
# See Python docs for deque.
"""
from collections import deque
my_queue = deque()
my_queue.append(5)
my_queue.appen... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class Egencia(object):
def __init__(self, credentials):
self.driver = webdriver.Remote('http://localhost:4444/wd/hub', webdriver.DesiredCapabilities.CHROME)
self.__login(credentials)
self.s... |
import numpy as np
import anndata as ad
import pandas as pd
def load_met_noimput(matrix_file, path='', save=False):
"""
read the raw count matrix and convert it into an AnnData object.
write down the matrix as .h5ad (AnnData object) if save = True.
Return AnnData object
"""
matrix = []
cell... |
#!/usr/bin/env python
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... |
#!/usr/bin/env python
## based on https://github.com/dmlc/mxnet/issues/1302
## Parses the model fit log file and generates a train/val vs epoch plot
import matplotlib.pyplot as plt
import numpy as np
import re
import argparse
def log_train_metric(period, auto_reset=False):
"""Callback to log the training evaluati... |
from unittest import TestCase
from ..gib2u import GhebbrishConverter
class TestGhebbrishConverter(TestCase):
gib = GhebbrishConverter('')
def test_gibberish_to_utf8_converter(self):
original_string = "ùìåí çðåê"
expected_output = "שלום חנוך"
self.assertEqual(self.gib.convert_gibberish... |
"""Methods to update test mappings for a project."""
from typing import Any, Dict, List
import structlog
from evergreen.api import EvergreenApi
from pymongo import ReturnDocument, UpdateOne
from pymongo.errors import BulkWriteError
from selectedtests.datasource.mongo_wrapper import MongoWrapper
from selectedtests.he... |
# Generated by Django 2.0.9 on 2018-12-11 18:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0005_profile_card_id'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='card_id',
... |
# 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 dataclasses import dataclass
from typing import List
from salvia.types.peer_info import TimestampedPeerInfo
from salvia.util.streamable import Streamable, streamable
"""
Protocol to introducer
Note: When changing this file, also change protocol_message_types.py, and the protocol version in shared_protocol.py
"""... |
"""
Tests of GridDataSource behavior.
"""
import unittest
from numpy import array
from numpy.testing import assert_array_equal
from chaco.api import GridDataSource
from traits.testing.unittest_tools import UnittestTools
class GridDataSourceTestCase(UnittestTools, unittest.TestCase):
def setUp(self):
s... |
"""pizzarest URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^', views.index),
] |
from aoc_cas.aoc2020 import day7 as aoc
def testPart1():
data = """
light red bags contain 1 bright white bag, 2 muted yellow bags.
dark orange bags contain 3 bright white bags, 4 muted yellow bags.
bright white bags contain 1 shiny gold bag.
muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.
shiny g... |
def write_qs(qs):
with open("qs.txt", "w") as f:
for i in qs:
f.write(i + "\n")
def write_ans(ans):
with open("ans.txt", "w") as f:
for i in ans:
f.write(i + "\n")
def read_qs():
with open("qs.txt", "r") as f:
qs = f.readlines()
qs = [i.rstrip("\n") for ... |
import pandas as pd
from collections import defaultdict
import argparse
parser = argparse.ArgumentParser(description=\
'Renames PacBio and ONT datasets with more\
intelligent names')
parser.add_argument('--f', help='file to swap dataset col names in')
args = parser.parse_args()
f = args.f
# read in mapping file
m... |
#!/usr/bin/env python
import sys
import ctypes
import _ctypes
import numpy
import pyscf.lib
from pyscf import gto
from pyscf.gto.moleintor import make_cintopt
libcvhf = pyscf.lib.load_library('libcvhf')
def _fpointer(name):
return ctypes.c_void_p(_ctypes.dlsym(libcvhf._handle, name))
class VHFOpt(object):
de... |
# YOLOv5 common modules
import math
from copy import copy
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import torch
import torch.nn as nn
from PIL import Image
from torch.cuda import amp
from utils.datasets import letterbox
from utils.general import non_max_suppression, make_divisi... |
from floodsystem.stationdata import build_station_list
from floodsystem.stationdata import update_water_levels
from floodsystem.flood import stations_highest_rel_level
stations = build_station_list()
update_water_levels(stations)
print(stations_highest_rel_level(stations,10)) |
#!/usr/bin/env python
# note we'll use glue to assemble a css sprite
# for now we use this to pickup the images we want, convert
# from svg to png in our preferred size
import click
import cairosvg
import os
from pathlib import Path
from jinja2 import Template
from apichanges.icons import ICON_SERVICE_MAP
CSS_BUILD... |
"""app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... |
import sys
import random
import string
import json
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QStatusBar
from PyQt5.QtWidgets import QToolBar
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QAction
from ... |
import logging
from flask import jsonify, request, abort, Response, stream_with_context
# Code similar to https://github.com/jkaberg/tvhProxy
from util.Helpers import generate_stream_ffmpeg
def setup_hdhrproxy(app, stream_handlers):
lineup = []
for sh in stream_handlers:
name = sh.__class__.__name__... |
#!pip install plotnine
import numpy as np
import pandas as pd
import plotnine
def plot_factor_spatial(
adata,
fact,
cluster_names,
fact_ind=[0],
trans="log",
sample_name=None,
samples_col="sample",
obs_x="imagecol",
obs_y="imagerow",
n_columns=6,
max_col=5000,
col_break... |
from dataclasses import dataclass
from typing import List
from tst.types.condition_opcodes import ConditionOpcode
from tst.util.streamable import Streamable, streamable
@dataclass(frozen=True)
@streamable
class ConditionWithArgs(Streamable):
"""
This structure is used to store parsed CLVM conditions
Cond... |
"""
NCL_scatter_5.py
================
This script illustrates the following concepts:
- Drawing a scatter plot with markers of different colors
- Generating dummy data using "random.normal"
- Manually creating a legend using markers and text
- Customizing the label locations in a legend
- Changing the or... |
from operator import itemgetter
from itertools import groupby
from Decoder import Decoder
from collections import namedtuple
class LimitedReorderDecoder(Decoder):
def __init__(self, tm, lm, maxsize, reorderlimit, threshold):
# model and option inputs
self.tm = tm
self.lm = lm
self... |
# -*- coding: utf-8 -*-
""" ThreatConnect Playbook App """
import requests
# Import default Playbook Class (Required)
from playbook_app import PlaybookApp
class App(PlaybookApp):
""" Playbook App """
def run(self):
""" Run the App main logic.
This method should contain the core logic of t... |
# coding: utf-8
"""
AVACloud API 1.17.3
AVACloud API specification # noqa: E501
OpenAPI spec version: 1.17.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import avacloud_client_python
from avacloud_client_python.... |
import bpy
from . import mcdata
# Class to store collections for section informations
class MCCollectionItem(bpy.types.PropertyGroup):
collection : bpy.props.PointerProperty(name="Collection",type=bpy.types.Collection)
# Class to store section informations
class MCSectionItem(bpy.types.PropertyGroup):
#... |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField
from wtforms.validators import DataRequired, Email, EqualTo
class LoginForm(FlaskForm):
username = StringField('Логин', validators=[DataRequired()])
password = PasswordField('Пароль', validators=[DataRequired()])
class RegisterFo... |
# coding: utf-8
"""
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from h1.configuration import Configuration
class AgentResourceEvent(object):
"""NOTE: This cla... |
"""Preliminary callable-object modelling classes"""
from basicproperty import propertied, basic, common
import inspect
from basictypes import list_types
__NULL__ = []
class Argument( propertied.Propertied ):
"""Representation of a single argument on a callable object"""
name = common.StringLocaleProperty(
'name',... |
import os
import platform
import subprocess
import sys
from pathlib import Path
from core.management.commands.utils import Utils
from django.apps import apps
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = """Manager responsável por analisar as classes de modelos do projeto... |
class MessageId:
"""The CAN MessageId of an PDU.
The MessageId consists of three parts:
* Priority
* Parameter Group Number
* Source Address
"""
def __init__(self, **kwargs): #priority=0, parameter_group_number=0, source_address=0):
"""
:param priority:
... |
import os
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import igibson
from igibson.envs.igibson_env import iGibsonEnv
def get_lidar_sampling_pattern():
lidar_vertical_low = -15 / 180.0 * np.pi
lidar_vertical_high = 15 / 180.0 * np.pi
lidar_vertical_n_beams =... |
# -*- coding: utf-8 -*-
'''
The generic libcloud template used to create the connections and deploy the
cloud virtual machines
'''
from __future__ import absolute_import
# Import python libs
import os
import logging
from salt.ext.six import string_types
import salt.ext.six as six
from salt.ext.six.moves import zip
#... |
"""
SORT: A Simple, Online and Realtime Tracker
Copyright (C) 2016-2020 Alex Bewley alex@bewley.ai
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,... |
import numpy as np
import matplotlib.pyplot as plt
import os
from tensorflow.keras.models import load_model
from tensorflow.keras.backend import clear_session
from keras.utils import to_categorical
import tensorflow.keras as keras
from .common import save_pickle, load_pickle
from tqdm import tqdm
# utils/data_iterator... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 EUDAT.
#
# B2SHARE is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""EUDAT Collaborative Data Infrastructure."""
from __future__ import absolute_import, print_function
from .ext import... |
from __future__ import division
import boost.python
cma_es_ext = boost.python.import_ext("cma_es_ext")
from cma_es_ext import * |
from enum import Enum
#
# This code was taken from:
# https://gist.github.com/cr0hn/89172938b7ac42c3100f4980ad881a24
#
class Serializable:
def _clean_dict_(self,
data = None,
clean_or_raw: str = "clean") -> dict:
# DICT
if type(data) is dict:
r... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, SelectMultipleField
from wtforms.validators import DataRequired
from ...models import Auth
auth_list = Auth.query.all()
class RoleForm(FlaskForm):
name = StringField(
label="角色名称",
validators=[
DataRequired(... |
"""add tick selector index
Revision ID: b601eb913efa
Revises: 16e3115a602a
Create Date: 2022-03-25 10:28:53.372766
"""
from dagster.core.storage.migration.utils import create_tick_selector_index
# revision identifiers, used by Alembic.
revision = "b601eb913efa"
down_revision = "16e3115a602a"
branch_labels = None
dep... |
import bpy
import bmesh
from bpy.props import *
from ... base_types import AnimationNode
class CreateBMeshFromMesh(bpy.types.Node, AnimationNode):
bl_idname = "an_CreateBMeshFromMeshNode"
bl_label = "Create BMesh"
errorHandlingType = "EXCEPTION"
def create(self):
self.newInput("Mesh", "Mesh", ... |
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
from sumy.parsers.html import HtmlParser
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummarizer as Summarizer
from sumy.nlp.stemm... |
from dateutil.parser import parse as dateutil_parse
from datahub.omis.payment.constants import PaymentMethod
from datahub.omis.payment.utils import trasform_govuk_payment_to_omis_payment_data
class TestGetOmisPaymentDataFromGovukPayment:
"""
Tests for the `trasform_govuk_payment_to_omis_payment_data` functio... |
import numpy as np
from gennav.envs.base import Environment
from gennav.utils.common import RobotState
from gennav.utils.geometry import Point
from matplotlib import pyplot as plt
class BinaryOccupancyGrid2DEnv(Environment):
"""Base class for a Binary Occupancy Grid 2D envrionment.
Arguments:
X (unsi... |
import re
from dataclasses import dataclass
from logging import getLogger
from typing import List
logger = getLogger('M3U')
@dataclass
class M3UMedia:
title: str
tvg_name: str
tvg_ID: str
tvg_logo: str
tvg_group: str
link: str
class M3UParser:
"""Mod from https://github.com/Timmy93/M3uP... |
#!/usr/bin/env python
# magic_button_.py
"""
Copyright (c) 2015 ContinuumBridge Limited
Written by Peter Claydon
"""
import sys
import os.path
import time
import json
from twisted.internet import reactor
from cbcommslib import CbApp, CbClient
from cbconfig import *
configFile = CB_CONFIG_DIR + "magic_button.... |
import pandas as pd
from django.contrib.auth import get_user_model
from django.contrib.auth.models import BaseUserManager
from django.core.management.base import BaseCommand
from django.db import IntegrityError
from lowfat.models import Claimant
class Command(BaseCommand):
help = "Import CSV with 2019 applicatio... |
import numpy as np
from datetime import datetime
npe=3
nelem=20
nnode=10
nstation=27
nsnode=3
ntime=8760
nfreq=3
ndir=5
elem=np.arange(nelem*npe,dtype="i4").reshape((nelem,npe))
time=np.datetime64(datetime(2000,1,1))+np.arange((ntime))*np.timedelta64(1, 'h')
lat=np.arange((nnode),dtype="f8")
lon=np.arange((nnode),dty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.