content stringlengths 5 1.05M |
|---|
# Generated by Django 3.0.7 on 2021-04-29 02:51
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import filemanager.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappa... |
import functools
import json
import logging
from typing import Any
import pytest
from airflow.settings import Session
from flask import url_for
from flask_appbuilder.security.sqla.models import User as ab_user
from pytest import fixture
from six.moves.urllib.parse import quote_plus
from targets import target
logg... |
#!/usr/bin/env python3
import funct
import sql
from jinja2 import Environment, FileSystemLoader
env = Environment(extensions=["jinja2.ext.do"], loader=FileSystemLoader('templates/'), autoescape=True)
template = env.get_template('servers.html')
form = funct.form
print('Content-type: text/html\n')
funct.check_login()
fu... |
import os
class Config(object):
SECRET_KEY = os.environ.get("SECRET_KEY")
HOST = os.environ.get("HOST_URI")
DB = os.environ.get("DB")
SHOPIFY_CONFIG = {
"API_KEY": os.environ.get("API_KEY"),
"API_SECRET": os.environ.get("API_SECRET"),
"APP_HOME": f"http://{HOST}",
"CAL... |
import numpy as np
import pytest
from conftest import skipif_yask
from sympy import diff
from devito import Grid, Eq, Operator, clear_cache, Function
@skipif_yask
@pytest.mark.parametrize('space_order', [2, 4, 6, 8, 10, 12, 14, 16, 18, 20])
# Only test x and t as y and z are the same as x
@pytest.mark.parametrize('d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Magpie helpers for database migration.
"""
import argparse
from typing import TYPE_CHECKING
from magpie.constants import get_constant
from magpie.db import run_database_migration
if TYPE_CHECKING:
# pylint: disable=W0611,unused-import
from typing import Any, O... |
import json
from cloudmesh_client.cloud.hpc.BatchProvider import BatchProvider
# TODO: is this outdated and superseded by hpc.py?
class Squeue(object):
@staticmethod
def squeue_to_json(input_str):
d = {}
for i, line in enumerate(input_str.splitlines()):
if not line.startswith('Warn... |
import logging
import argparse
from lsdscc import HypothesisSet, ReferenceSet
from lsdscc import compute_score_on_corpus
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='evaluate diversity oriented metrics of LSDSCC')
parser.add_argument('hypothesis_file', help='file containing response... |
from rest_framework.views import APIView
from django.http import JsonResponse
from api.utils.response import MyResponse
import requests
from django.core.files.uploadedfile import InMemoryUploadedFile
class MyView(APIView):
HOST = ''
SERVICE_NAME = ''
SCHEME = 'http'
def get_url_parts(self,path):
... |
from unittest import TestCase
from osbot_utils.utils.Dev import pprint
from osbot_k8s.kubernetes.Cluster import Cluster
from osbot_k8s.kubernetes.Pod import Pod
from osbot_k8s.manifests.Pod_Manifest import Pod_Manifest
from osbot_utils.utils.Misc import random_string, lower, list_set
class test_Pod(TestCase):
p... |
# Copyright (c) 2014 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... |
import numpy as np
from scipy.optimize import minimize
class SVM:
w: np.ndarray
w0: float
def __init__(self,
l: float = 1.0,
kernel: callable = lambda X, w: X @ w
) -> None:
self.l: float = l
self.kernel: callable = kernel
def train(... |
import re
def main(request, response):
key = request.GET[b'id']
action = request.GET[b'action']
if action == b'put':
# We want the raw input for 'q'
q = re.search(r'q=([^&]+)', request.url_parts.query).groups()[0]
request.server.stash.put(key, q)
return [(b"Content-Type", b"... |
###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
imp... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyTrojanzooSphinxTheme(PythonPackage):
"""TrojanZoo Sphinx Theme"""
homepage = "https... |
# Copyright 2020 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
# This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import next
import re
import time
import math
import json
from morphenepython.instance import shared_mo... |
# Copyright 2019 British Broadcasting 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 a... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018-2021, Eduardo Rodrigues and Henry Schreiner.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/particle for details.
from __future__ import absolute_import
from .particle import Particle
from .particle import P... |
# coding: utf-8
# pylint: disable=invalid-name, protected-access, too-many-arguments, too-many-lines
"""Symbolic configuration API."""
from __future__ import absolute_import as _abs
import ctypes
import sys
from numbers import Number as Number
from .._base import _LIB
from .._base import c_str, py_str, string_types
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 2 of t... |
#
# Copyright (c) 2022, 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 License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
#!/usr/bin/python
import time
import random
import subprocess
import datetime
import sys
import requests
import os
import requests
MINUTE = 60
def main():
# initially sleep for a (uniformly) random time between 0 and 6 seconds
# time.sleep(random.randint(0,6))
first_start_time = time.time()
# ... |
def WordOfFourInList(list):
resultlist = []
for word in list:
if len(word) == 4: resultlist.append(word)
print("De nieuw-gemaakte lijst met alle vier-letter strings is:\n",resultlist)
WordOfFourInList(eval(input("Geef lijst met minimaal 10 strings: ")))
|
# Single Element 2D
#
# Simplest model to test for OpenMOC compatability
import elements
from common_layers import get_fuel_layer
import materials
man = elements.geometry.Manager()
matlib = materials.get_library("NRL")
fuel_layer = get_fuel_layer(man, matlib)
elem2d = elements.Element2D().fromLayer(fuel_layer)
elem2d... |
valorCasa = int(input("Qual o valor da casa?: "))
salario = int(input("Qual o seu salário?: "))
tempo = int(input("Em quantos anos pretende pagar esse financiamento?: "))
if (valorCasa / (tempo * 12)) > (salario * 0.3):
print("NEGADO.")
else:
print("CONCEDIDO.") |
num_lines=10000
import sys
import os.path
if len(sys.argv) <= 1:
print("Usage: python ", sys.argv[0], " <file_in.csv> [<num_lines (def=", num_lines, ")>]")
exit(-1)
if len(sys.argv) > 1:
file_in = sys.argv[1]
if len(sys.argv) > 2:
num_lines = int(sys.argv[2])
if not os.path.exists(file_in):
... |
from mqtt_manager import MQTTManager
import uasyncio as asyncio
import time
from machine import Pin
import ujson
from static_values import MQTT_NOTIFY_TOPIC
from task import Task
from pulse_sensor import PulseSensor
MAX_HISTORY = 250 # depends on the frequency of reading
TOTAL_BEATS = 30 # num last beats to calcul... |
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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
#
# ... |
# Databricks notebook source
# MAGIC %run ./create_base_table_functions
# COMMAND ----------
# set some initial values
project_code = 'dars_nic_391419_j3w9t_collab.ccu014_01'
table_stamp_code = 'rt_211217'
pmeds_archive = 'dars_nic_391419_j3w9t_collab.primary_care_meds_dars_nic_391419_j3w9t_archive'
gdppr_archive =... |
def data_loading(filename, entity2id, relation2id, is_unweigted=False, directed=True):
with open(filename) as f:
lines = f.readlines()
triples_data = []
rows, cols, data = [], [], []
unique_entities = set()
for index, line in enumerate(lines):
line = line.strip().split()
... |
import torch
from torch import nn
from torch.autograd import Function
from torch.autograd.function import once_differentiable
import alphaction._custom_cuda_ext as _C
class _SigmoidFocalLoss(Function):
@staticmethod
def forward(ctx, logits, targets, gamma, alpha):
ctx.save_for_backward(logits, target... |
from __future__ import unicode_literals
from django.db import models
from django.db.models import permalink
class NewsColumn(models.Model):
title = models.CharField(max_length=100, unique=True)
def __unicode__(self):
return '%s' % self.title
class NewsPost(models.Model):
title = models.CharFie... |
import sys
from pgshovel.interfaces.configurations_pb2 import (
DatabaseConfiguration,
TableConfiguration,
ReplicationSetConfiguration,
)
from pgshovel.utilities.protobuf import TextCodec
dsn = sys.argv[1]
configuration = ReplicationSetConfiguration(
database=DatabaseConfiguration(dsn=dsn),
tab... |
# 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... |
import numpy as np
import skimage
import skimage.transform
import skimage.feature
import skimage.io
import os
from os.path import join
train_dir = "copy"
items = sorted([x for x in os.listdir(train_dir) if x.endswith(".png")], key=lambda x: int(x.split(".")[0]))
for name in items:
image = skimage.io.imread(join(t... |
# ------------------------------------------------------------------------------
# Copyright IBM Corp. 2018
#
# 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/licens... |
while True:
choice = input("Coffe (0), cigs(1), terminate(2): ")
if choice == "0":
print("Take ut coffe")
elif choice == ("1"):
print("take ur cigs")
elif choice == "2":
break
print("out of loop")
|
__version__ = "0.1.0"
from .resp3 import Connection
__all__ = ["Connection"]
|
###| Copyright 2014 Esri
###|
###| 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... |
# Apache License Version 2.0
# Copyright 2022 Xin Huang
#
# 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... |
import os
from ansible.parsing.dataloader import DataLoader
from ansible.inventory.manager import InventoryManager
from ansible.vars.manager import VariableManager
from ansible.playbook import Playbook
from ansible.executor.task_queue_manager import TaskQueueManager
from args import get_arguments, OCI, ANSIBLE
here = ... |
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
from steinie import Steinie
app = Steinie()
@app.param("username")
def capitalize(param):
return param.capitalize()
@app.get("/<username:some_user>")
def handler(request, response):
return "Hello, %s\n" % request.params... |
from rest_framework import serializers
from .models import Advice, Cloth
class ClothSerializer(serializers.Serializer):
pk = serializers.IntegerField(read_only=True)
name = serializers.CharField()
image_url = serializers.CharField()
link = serializers.CharField()
def create(self, validated_data)... |
import os
import sys
parent = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../..")
sys.path.insert(0, parent)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'testproject.db',
}
}
SECRET_KEY = '215e15dfu^)2)mn1e5660f+%52*c141x=hzgpl@!4t-iv&n^iy'
ROO... |
from __future__ import print_function
import os
import numpy as np
import netCDF4
class PrmtopLoad(object):
"""
Load a AMBER prmtop file.
The format of prmtop files is explained here http://ambermd.org/formats.html.
All the AMBER prmtop data stored to the dictionary self._parameters which can be a... |
from headers import Headers
from url import Url
class Request(object):
"""
The ``Request`` object encapsulates HTTP style requests
"""
def __init__(self, method, url, headers=None, content=None):
"""
Construct a new ``Request`` object
:param method: HTTP method
:type ... |
# -*- coding: utf-8 -*-
import networkx.algorithms.isomorphism as iso
import networkx,sys,codecs
from scipy.spatial.distance import cosine
from sklearn.neighbors import NearestNeighbors
from sklearn.preprocessing import normalize
import numpy as np
import operator, time
reload(sys)
sys.setdefaultencodi... |
from .client import SmsClient
|
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-10-11 10:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('image', '0003_image_image'),
]
operations = [
... |
import requests
import json
def prompt_choose_from_list(lst):
if not lst:
return
if len(lst) == 1:
return lst[0]
print 'Choose from the following:'
for i, val in enumerate(lst):
print '{0} - {1}'.format(i + 1, val.encode('utf-8'))
choice = raw_input('Enter your choice: ')... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides the focus function for Individual Views
"""
__author__ = "Argentina Ortega Sainz"
__copyright__ = "Copyright (C) 2015 Argentina Ortega Sainz"
__license__ = "MIT"
__version__ = "2.0"
from PyQt4.QtGui import (QLabel)
from PyQt4.QtCore import (pyqtSignal, QObje... |
from pylabnet.network.client_server import si_tt
from pylabnet.utils.logging.logger import LogClient, LogHandler
from pylabnet.gui.igui.iplot import SingleTraceFig, MultiTraceFig
from pylabnet.gui.pyqt.external_gui import Window
from pylabnet.utils.helper_methods import (generic_save, get_gui_widgets,
... |
#!/usr/bin/python3
'''Updates the user ranking.'''
import argparse
import datetime
import logging
import os
import sys
from typing import Sequence, NamedTuple
import mysql.connector
import mysql.connector.cursor
sys.path.insert(
0,
os.path.join(
os.path.dirname(os.path.dirname(os.path.realpath(__fil... |
#!/usr/bin/env python
import h5py
import sys
import argparse
import multiprocessing as mp
import time
import os
import shutil
import logging
import hashlib
import numpy
import itertools
from ising import Ising
from blessings import Terminal
from ext.progressbar import ProgressBar
from ext.hdf5handler import HDF5Handle... |
# Copyright 2016 Canonical Ltd
#
# 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... |
from typing import Dict, Union
import pandas as pd
import plotly.express as px
"""
Script for various diagrams visualisation.
"""
def show_bar_plot(stats: Dict[str, Union[int, float]], x_label: str, y_label: str, title: str) -> None:
"""
Show a bar chart based on the passed data.
:param stats: dict wh... |
"""
Tuple Unpacking
(=Multiple Assignment)
(=Iterable Unpacking)
"""
dimensions = 52, 40, 100
length, width, height = dimensions
#In short
length, width, height = 52, 40, 100
|
# Generated by Django 3.0.5 on 2020-06-19 08:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('crud', '0022_result'),
]
operations = [
migrations.AlterField(
model_name='result',
name='score',
field=... |
from __future__ import absolute_import, division, print_function, unicode_literals
import subprocess as sp
from scannerpy.config import Config
c = Config()
build_flags_output = [
s.strip()
for s in sp.check_output(
[c.config['scanner_path'] + '/build/scanner/engine/build_flags']).split("\n")
]
inclu... |
# Copyright (c) 2021-2022, InterDigital Communications, Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistributions of source cod... |
"""Tests for the ATAG integration."""
from unittest.mock import patch
import aiohttp
from homeassistant.components.atag import DOMAIN
from homeassistant.config_entries import ENTRY_STATE_SETUP_RETRY
from homeassistant.core import HomeAssistant
from tests.components.atag import init_integration
from tests.test_util.a... |
from datadog import initialize, api
import time
options = {
'api_key': '<YOUR_API_KEY>',
'app_key': '<YOUR_APP_KEY>'
}
initialize(**options)
# Taking the last 24hours
from_time = int(time.time()) - 60 * 60 * 24 * 1
result = api.Metric.list(from_time)
print(result)
|
import importlib
import sys
import random
parameters = importlib.import_module(sys.argv[1])
globals().update(parameters.__dict__)
def f_lateral(discharge,lateral_incision,lateral_incision_cumulative,area,slope,direction,lateral_incision_threshold,eta_old):
for x in xrange(x_lower,x_upper):
for y in xrange(y_lower,y... |
from mosaic import config
|
print('='*20, 'DESAFIO 021', '='*20)
import pygame
pygame.mixer.init()
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
from PIL import Image
def parser(serialized_example, resolution):
image_key = 'image'
if resolution != 128:
image_key += str(resolution)
... |
from torch import nn
from transformers import CamembertForMaskedLM, CamembertForTokenClassification
class BertPunc(nn.Module):
def __init__(self, segment_size, output_size, dropout):
super(BertPunc, self).__init__()
self.bert = CamembertForMaskedLM.from_pretrained('camembert-base')
self.b... |
import click
from stiff.eval import get_eval_paths
from stiff.sup_corpus import iter_lexelts, next_key
from finntk.wordnet.reader import fiwn
def iter_tags(inf, keyin):
for lexelt, item_pos in iter_lexelts(inf):
for instance in lexelt.xpath("instance"):
key_id, synset_ids = next_key(keyin)
... |
import pika
# 建立连接
connection = pika.BlockingConnection(pika.ConnectionParameters(host="localhost"
))
# 创建channel
channel = connection.channel()
# 创建名字为hello的queue
channel.queue_declare(queue="hello")
# 默认交易所,我们通过空字符串 (“”)来标识
channel.basic_publish(exchange... |
def calc_y_max_heat_map(grid_rollout: list):
coverd_dists = [max(rollout['observations'][:, 1]) for rollout in grid_rollout]
return coverd_dists
|
from rest_framework import pagination
from rest_framework.response import Response
class CommentPagination(pagination.PageNumberPagination):
page_size = 1
page_size_query_param = 'page_size'
max_page_size = 200
last_page_strings = ('the_end',)
#class PostPagination(pagination.PageNumberPagination):
# ... |
"""
http://www.theatlantic.com/past/docs/unbound/poetry/gioia/gioia.htm?src=longreads
https://www.wired.com/2016/11/poetry-popularity-on-twitter/
"""
class Poem(object):
def __init__(self, document):
self.document = document
def iterpositions(self):
analyzed = self.document.get('analyzed', ... |
import os
from urllib import parse
from flask import (
Blueprint, send_from_directory, send_file
)
from . import cluster
from flask_clustering.auth import login_required
from flask_clustering.db import get_db
bp = Blueprint('resource', __name__, url_prefix='/resource')
@bp.route("/<path:path>")
def get_image_ur... |
# -*- coding: utf-8 -*-
try:
print('enter a number')
num = int (input())
print('enter a denom')
denom = int (input())
print(str(num/denom))
#you can raise the exceptions as follows
#raise ZeroDivisionError
except ZeroDivisionError:
#except IOError:
print('Canno... |
__author__ = 'Eli Rodgers-Melnick'
__license__ = 'BSD'
# Make imports
from Ranger.src.Range.Range import Range
from Ranger.src.Collections.RangeSet import RangeSet
from Ranger.src.Collections.RangeMap import RangeMap
from Ranger.src.Collections.RangeBucketMap import RangeBucketMap
|
#!/usr/bin/env python3
"""
Build a simple bare-minimum quantum circuit that starts with a single
qubit (by default, in state 0) and inverts it. Run the experiment 1000
times and print the total count of the states finally observed.
Qiskit Docs: https://qiskit.org/documentation/getting_started.html
"""
import qiskit as... |
from pytz.exceptions import UnknownTimeZoneError
from extutils.dt import now_utc_aware
from extutils.locales import sec_diff_to_utc_offset, get_locales, LocaleInfo
from tests.base import TestCase
__all__ = ["TestLocaleInfo", "TestLocaleFunctions"]
class TestLocaleFunctions(TestCase):
def test_sec_diff_to_utc_of... |
import os
from pyln.testing.fixtures import * # noqa: F401,F403
plugin_path = os.path.join(os.path.dirname(__file__), "donations.py")
def test_donation_starts(node_factory):
l1 = node_factory.get_node()
# Test dynamically
l1.rpc.plugin_start(plugin_path)
l1.rpc.plugin_stop(plugin_path)
l1.rpc.pl... |
import inspect
import logging
import typing
from typing import (
Optional,
Callable,
Text,
Tuple,
Dict,
Type,
Any,
Set,
Union,
TypeVar,
List,
)
import dataclasses
from rasa.core.policies.policy import PolicyPrediction
from rasa.engine.training.fingerprinting import Fingerpr... |
from scrapely.extraction.regionextract import (
RecordExtractor, BasicTypeExtractor
)
from slybot.plugins.scrapely_annotations.extraction import (
BaseContainerExtractor
)
from .utils import extractor_to_field, container_to_item
class ItemBuilder(object):
def __init__(self, schemas, extractors, items, def... |
from decouple import config
GOOGLE_API_KEY = config("GOOGLE_API_KEY")
FLASK_DEBUG = config("FLASK_DEBUG", default=True, cast=bool)
|
import unittest
from unittest import mock
from pydactyl import PterodactylClient
class SettingsTests(unittest.TestCase):
def setUp(self):
self.api = PterodactylClient(url='dummy', api_key='dummy')
@mock.patch('pydactyl.api.base.PterodactylAPI._api_request')
def test_rename_server(self, mock_api... |
from setuptools import setup
setup(
name="odc_io",
use_scm_version={"root": "../..", "relative_to": __file__},
setup_requires=["setuptools_scm"],
author="Open Data Cube",
author_email="",
maintainer="Open Data Cube",
maintainer_email="",
description="Miscellaneous file IO helper methods... |
import json
import plotly
import pandas as pd
import joblib
import sys
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
from sqlalchemy import create_engine
app = Flask(__name__)
# load data
engine = create_engine('sqlite:///../data/DisasterResponse.db')
d... |
# Copyright (c) Megvii, Inc. and its affiliates.
"""do the evaluation work with single gpu
"""
import argparse
import os
import megengine as mge
import megengine.data as data
import megengine.data.transform as T
import megengine.functional as F
import numpy as np
from tqdm.auto import tqdm
from recognition.datasets ... |
# Auto generated from ghga.yaml by pythongen.py version: 0.9.0
# Generation date: 2021-12-16T09:15:32
# Schema: GHGA-Metadata-Schema
#
# id: https://w3id.org/GHGA-Metadata-Schema
# description: The metadata schema for the German Human Genome-Phenome Archive (GHGA).
# license: https://creativecommons.org/publicdomain/ze... |
from datetime import datetime
from typing import Optional
import attr
from monograph.model.schema import CrossRefAttrsSchema
@attr.s(auto_attribs=True)
class SomeDateTimeField:
a_date: Optional[datetime] = None
class SomeDateTimeFieldSchema(CrossRefAttrsSchema):
class Meta:
target = SomeDateTimeFi... |
# !/usr/bin/env python
# coding=utf-8
# @Time : 2019-07-18 13:08
# @Author : yingyuankai@aliyun.com
# @File : builder_utils.py
import math
import os
import logging
import tensorflow as tf
import tensorflow_datasets as tfds
from tensorflow_datasets.core.download.download_manager import DownloadConfig
from aispa... |
#!/usr/bin/env python
# vim: fdm=indent
'''
author: Fabio Zanini
date: 05/08/13
content: Get the allele frequencies out of a BAM file and a reference.
'''
# Modules
import os
import argparse
import subprocess as sp
import cPickle as pickle
from Bio import SeqIO
from hivwholeseq.sequencing.samples import l... |
"""
Crie um programa que leia um número Real qualquer pelo teclado e mostre
na tela a sua porção inteira.
Ex:
Digite um número: 6.127
O número 6.127 tem a parte inteira 6
"""
from math import trunc
num = float(input('Digite um número: '))
print('O número {} tem a parte inteira {} '.format(num, trunc(num)))
print(f'O n... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------
# main.py :
# - lecture et affichage des mesures d'une balance Adam Highland Series
# - enregistrement dans un fichier pour import sur un tableur
#
# v1.0 : Version initiale
#
# Olivier boesch(c)20... |
#%%
import pandas as pd
import yfinance as yf
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from statsmodels.tsa.stattools import adfuller
from statsmodels.stats.diagnostic import acorr_ljungbox
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa.arima_model imp... |
#!/usr/bin/env python
__author__ = 'Sergei F. Kliver'
import argparse
from RouToolPa.Routines import NCBIRoutines
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input", action="store", dest="input", required=True,
help="Input NCBI protein tab file")
parser.add_argument("-o", "--o... |
class Vehicle():
def setName(self,name):
self.name = name
def get_name(self):
return self.name
class Car (Vehicle):
wheels = 4
def get_num_wheels(self):
return self.wheels
if __name__ == "__main__":
mustang = Car()
mustang.setName("mustang")
print(mustang.get_... |
import operator
import random
import math
import json
import threading
import numpy as np
# import tensorflow as tf
import torch as tf
import torch.nn.functional as F
import torch.nn as nn
from torch import optim
from torch import autograd
import util
import coref_ops
import conll
import metrics
c... |
import pyaudio
import math
import struct
import wave
#Assuming Energy threshold upper than 30 dB
Threshold = 30
SHORT_NORMALIZE = (1.0/32768.0)
chunk = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
swidth = 2
Max_Seconds = 5
TimeoutSignal=((RATE / chunk * Max_Seconds) + 2)
silence = True
FileNameTmp = 'de... |
from typing import List
from typing import Optional
from typing import Union
from sklearn.preprocessing import PowerTransformer
from etna.transforms.math.sklearn import SklearnTransform
from etna.transforms.math.sklearn import TransformMode
class YeoJohnsonTransform(SklearnTransform):
"""YeoJohnsonTransform app... |
"""
Use serial protocol of EMU2 meter to obtain state of the connected meter.
For more details about this component, please refer to the documentation
at https://github.com/jrhorrisberger/home-assistant/blob/master/custom_components/rainforest/readme.md
"""
from homeassistant.helpers.entity import Entity
import homeas... |
# (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.