text stringlengths 3.07k 12.6k |
|---|
import signal
from glob import glob
from os import path
import pytest
from config import Config
from . import get_timeout
@pytest.fixture
def dicom_path(scope='session'):
dir1 = path.join(Config.SMALL_DICOM_PATHS, 'LIDC-IDRI-0001')
dir2 = '1.3.6.1.4.1.14519.5.2.1.6279.6001.298806137288633453246975630178'
... |
from kafka.producer import KafkaProducer
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)))
from lib.commonsplunk import check_events_from_splunk
from lib.commonkafka import *
from lib.helper import *
from datetime import datetime
import threading
import loggin... |
import io
import numpy as np
import pdb
import sys
import tensorflow as tf
import tensorflow_addons as tfa
import tensorflow_datasets as tfds
'''
Q: what is variables?
'''
def get_char_LSTM(batch_size, vocab_size=11, embedding_size=512, variables=1, bidirectional=True, share_embeddings=True):
lstm_features = 512
... |
import logging
from reportportal_client.helpers import gen_attributes
from .variables import Variables
from .model import Keyword, Test, Suite, LogMessage
from .service import RobotService
class DryRunRP:
def __init__(self, verbose=False):
self._logger = logging.getLogger('RP(DRYRUN)')
if verbos... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# clingen_pars.py
# made by <NAME>
# 2020-03-03 15:42:28
#########################
import sys
import os
SVRNAME = os.uname()[1]
if "MBI" in SVRNAME.upper():
sys_path = "/Users/pcaso/bin/python_lib"
elif SVRNAME == "T7":
sys_path = "/ms1/bin/python_lib"
else:
sys... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 9 16:11:56 2019
@author: sjmoneyboss
"""
import pandas as pd
import statsmodels
from statsmodels.tsa.stattools import adfuller
import statsmodels.api as sm
import datetime
import math
import pandas_datareader.data as web
import datetime as dt
from... |
import re
from logging import getLogger
from os import makedirs
from os.path import dirname
import pandas as pd
from jinja2 import Template
from pyinaturalist.converters import try_datetime
from inat_backlog_slogger.constants import (
JSON_OBSERVATIONS,
JSON_OBSERVATION_EXPORT,
RANKING_WEIGHTS,
REPOR... |
import matplotlib
matplotlib.use('Agg')
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate
import tecplot as tp
import wake_config as conf
import matplotlib.ticker as ticker
width = 3
#from helpers.setup_plot import *
#plot_style = 'THESIS'
#line_style, markers = setup_plot('THESIS', width, w... |
import math
import warnings
from torch.optim.lr_scheduler import _LRScheduler, CosineAnnealingLR
class CosineAnnealingWarmRestarts(_LRScheduler):
r"""Set the learning rate of each parameter group using a cosine annealing
schedule, where :math:`\eta_{max}` is set to the initial lr, :math:`T_{cur}`
is the n... |
"""
This module contains some useful tool for simplifying request process
"""
import os
from dingtalk_sdk_gmdzy2010.authority_request import AccessTokenRequest,\
SnsAccessTokenRequest, PersistentCodeRequest, SnsTokenRequest,\
UserInfoRequest
from dingtalk_sdk_gmdzy2010.department_request import DeptsRequest,\
... |
"""Automatic differentiation of tensor expressions."""
from ._ffi.function import _init_api
from ._ffi.node import NodeBase, register_node
_init_api("tvm.autodiff")
@register_node
class DifferentiationResult(NodeBase):
"""Result of differentiation.
Parameters
----------
result : List[Tensor]
... |
import random, json
from django.core import serializers
from django.http import HttpResponse, JsonResponse
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_http_methods
from datahandler.models import *
@csrf_exempt
def test(req... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import matplotlib.cm as cm
from matplotlib.lines import Line2D
def plotMeasurement(L, indices, measurements, s=0.25, filename=None, title=None, url=None):
fig = plt.figure()
axes = fig.add_subplot(111, pro... |
import numpy as np
import theano
import theano.tensor as T
from nose.tools import assert_true
from numpy.testing import assert_equal, assert_array_equal
from smartlearner.interfaces.dataset import Dataset
floatX = theano.config.floatX
ALL_DTYPES = np.sctypes['int'] + np.sctypes['uint'] + np.sctypes['float']
def te... |
try:
from loguru import logger
except ImportError: # pragma: no cover
import logging
logger = logging.getLogger(__name__)
import asyncio
from typing import Dict, Tuple, Set, Optional
from pydispatch import Dispatcher, Property, DictProperty, ListProperty
from tslumd import Tally, Screen, TallyKey, Message... |
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
from copy import copy
from .layers import ConvexQuadratic, View, WeightTransformedLinear
class GradNN(nn.Module):
def __init__(self, batch_size=1024):
super(GradNN, self).__init__()
self.ba... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 27 17:30:06 2018
@author: kennedy
Wiley Online Library
Help paper:
https://onlinelibrary.wiley.com/doi/full/10.1111/coin.12158
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__version__ = '1.0'
import pandas as pd
import numpy as np
import os
from sklear... |
"""Microscope API specific modules."""
import asyncio
import json
import logging
import voluptuous as vol
from camacq.const import (
COMMAND_EVENT,
IMAGE_EVENT,
START_COMMAND_EVENT,
STOP_COMMAND_EVENT,
)
from camacq.event import Event
from camacq.helper import BASE_ACTION_SCHEMA
_LOGGER = logging.get... |
from dataclasses import dataclass
import datetime
import logging
import os
import sqlite3
from typing import List, Tuple
sqlite3.paramstyle = "named"
DB_NAME = os.path.join("data", "inlet_data.db")
def _table_name(inlet_name: str) -> str:
return inlet_name.lower().replace(" ", "_")
@dataclass(frozen=True)
cla... |
import matplotlib.pyplot as plt
import numpy as np
import math
import time
import sys
def input_coordinates(filename, showmap=False):
with open(filename, 'r') as fin:
X = []
Y = []
while True:
line = fin.readline()
if not line:
break
x, y ... |
from collections import Mapping
import os
from six import string_types
import sys
import yaml
# set the base dir path
DIR = os.path.abspath(os.path.dirname(__file__))
def get_test_dirs():
# get the list of directories to run tests on
# if provided on the command line
if len(sys.argv) > 2:
return... |
# Copyright (c) 2017 <NAME>
# 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, distribute, su... |
# Copyright 2020 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
from dash import html, dcc
APP_CONSTANTS = {
"graph_color" : '#23359d'
}
def Header(app):
return html.Div([get_header(app), html.Br([]), get_menu()])
def get_header(app):
header = html.Div(
[
html.Div(
[
html.A(
[
... |
"""Test each form directly for expected validation behavior."""
from django.contrib.auth.models import User
from django.test import TestCase, Client
from issues.forms import (
UserForm,
UserGroupForm,
ManagePasswordForm,
ProjectForm,
ProjectIssueForm,
IssueForm,
CommentForm,
ReplyForm
... |
import json
import numpy as np
import itertools
import sys
path_name = sys.argv[1] + "/" + sys.argv[2]
pred_labels = np.load("./tmp/" + path_name + "/pred_labels_valid.npy")
num_classes = int(sys.argv[3])
num_layers = int(sys.argv[4])
total_layers = [x for x in range(num_layers)]
print("path_name: {}, num_classes: {... |
#!/usr/bin/env python3
"""
Make python installation relocatable which mainly involves fixing the shebang
in scripts installed by pip and making directories in .pth and .egg-link files
in the path relative.
Mostly stolen from virtualenv but slightly adapted to our needs
"""
import sys
import os
import itertools
impor... |
import numpy as np
import torch
"""
this file contains various functions for point cloud transformation,
some of which are not used in the clean version of code,
but feel free to use them if you have different forms of point clouds.
"""
def swap_axis(input_np, swap_mode='n210'):
"""
swap axis for point clouds... |
import json
import mock
'''
Mock Request and Response objects needed for many tests.
'''
class MockRequest(object):
'''
This is a mocked Request object containing only an url,
as this is the only attribute accessed during the tests.
There is a default value for it, but it can also be passed.
'''
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##
## @author <NAME>
##
## @copyright 2017, <NAME>, all right reserved
##
## @license APACHE v2.0 (see license file)
##
import os
import sys
import fnmatch
import copy
from . import debug
from . import arg as arguments
from . import env
from . import tools
from . import module
... |
# Copyright (c) 2019 PaddlePaddle 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 app... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiprocessing import cpu_count
from multiprocessing.dummy import Pool
try:
from .util.fingerprint import input_data_fingerprint
from .pkg.sfm import nameddict
from .pkg.sfm.exception_mate import get_last_exc_info
from .pkg.loggerFactory import Strea... |
# -*- coding: utf-8 -*-
"""Provides functions for handling images."""
import pygame
try:
import numpy
HAS_NUMPY = True
except ImportError:
HAS_NUMPY = False
from thorpy import miscgui
def detect_frame(surf, vacuum=(255, 255, 255)):
"""Returns a Rect of the minimum size to contain all that is not <v... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) IBM Corporation 2021
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r"""
---
module: zmf_authenticate
short_description: Au... |
# Copyright (c) 2022 <NAME>
# This software is published under MIT license. Full text of the license is available at https://opensource.org/licenses/MIT
from ___basal.___logging import Logging
from ___blocks.___block_types import BlockTypes
import machine
import time
from micropython import const
_power_save_comman... |
import unittest
from unittest.mock import Mock
from pyats.topology import Device
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.libs.parser.iosxr.show_dampening import (ShowImDampening,
ShowImDampeningIntf)
class TestShowImDampeni... |
# 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... |
"""
Explain complex things in simple terms
"""
from concurrent.futures import thread
import inspect
import os
import re
import sys
import threading
import time
import feynman.server
ispath = re.compile(r".*[/\\]")
ispyfile = re.compile(r".*\.py$")
file2mod = re.compile(r".*python[23].[0-9]*[/\\](.*)")
path2mod = re.... |
from tkinter import *
import datetime
import threading
import feed
import pcap
import string
import crypto
import event
import os
global username
class Chat(Frame):
def save(self, contend):
feed._appendIt(self.username, 'append', contend)
def add(self, username, contend, event=None):
self.t... |
#!/usr/bin/env python
'''General interface for SDL to read and write data sources.
For files, use `SDL_RWFromFile`. Other Python file-type objects can be
used with `SDL_RWFromObject`. If another library provides a constant void
pointer to a contiguous region of memory, `SDL_RWFromMem` and
`SDL_RWFromConstMem` can b... |
import html
from pyrogram import Client, filters
from pyrogram.errors.exceptions.bad_request_400 import MessageNotModified
from .. import config, help_dict, get_entity, log_errors, public_log_errors
ZWS = '\u200B'
def _generate_sexy(entity, ping):
text = getattr(entity, 'title', None)
if not text:
text... |
from django.db import models
from django.contrib.sites.models import Site
# Create your models here.
class Config(models.Model):
site = models.OneToOneField(Site, on_delete=models.PROTECT)
nome = models.CharField('Nome do Site', max_length=255)
telefone = models.CharField('Telefone de Contato', max_length=... |
import os
import datetime
from typing import Dict, Optional, Any, List
from markdown_subtemplate import caching as __caching
from markdown_subtemplate.infrastructure import markdown_transformer
from markdown_subtemplate.exceptions import ArgumentExpectedException, TemplateNotFoundException
from markdown_subtemplate im... |
import cv2
import numpy as np
import socket
# Define IP Address for Arduinos and PORT Number
Arduino_1 = '192.168.100.16'
Arduino_2 = '192.168.100.17'
Server_Result = '192.168.100.13'
PORT_1 = 8888
MONITORING_PORT = 4500
class Connection:
def __init__(self, HOST, PORT):
self.HOST = HOST
... |
"""Helper functinos for pgesmd."""
import json
import os
import requests
import logging
import time
from datetime import datetime
from operator import itemgetter
from xml.etree import cElementTree as ET
from io import StringIO
_LOGGER = logging.getLogger(__name__)
def get_auth_file(auth_path=f"{os.getcwd()}/auth/au... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## mds.py
##
## Created on: Dec 3, 2017
## Author: <NAME>
## E-mail: <EMAIL>
##
# print function as in Python3
#==============================================================================
from __future__ import print_function
from minds.check import Consiste... |
import os
import sys
import math
import api_check
class Project:
def __init__(self, path_prefix, filename, full_set):
self.path = path_prefix + '/' + filename
self.name = filename.split(".capi.dat")[0]
print("===== " + self.name + " =====")
self.full_set = full_set
def get_dat... |
# -*- coding: utf-8 -*-
import config
import telebot
import db
import threading
import traceback
import time
from otrh import function as otrh_f
from otrh import names
from otrh import equip
db.init()
temp_data = {}
API_TOKEN = config.market_token
bot = telebot.TeleBot(API_TOKEN, skip_pending = True)
game_bot = teleb... |
import itertools
import time
# I want to use the memoize pattern (instead of setting up a grid) - to see how it changes and if it is possible in Nim:
def memoize(func):
cache = dict()
def memoized_func(*args):
if args in cache:
return cache[args]
result = func(*args)
cache[... |
from typing import Tuple, Union
from Crypto.Cipher.AES import MODE_ECB
from Crypto.Cipher.AES import new as new_aes_ctx
from Crypto.Cipher.PKCS1_OAEP import new as new_pkcs1_oaep_ctx
from Crypto.Hash import SHA256
from Crypto.PublicKey.RSA import import_key as import_rsa_key
from enum import IntEnum
from json import du... |
# ----------------------------------------------------------------------
# |
# | ParserInfo.py
# |
# | <NAME> <<EMAIL>>
# | 2021-09-28 17:13:44
# |
# ----------------------------------------------------------------------
# |
# | Copyright <NAME> 2021
# | Distributed under the Boost Software License, ... |
import argparse
import json
import os
import pandas as pd
import random
import sys
from evaluation.decomposition import Decomposition, get_decomposition_from_tokens
from model.rule_based.rule_based_model import RuleBasedModel
from model.rule_based.copy_model import CopyModel
from model.seq2seq.seq2seq_model import Se... |
import sympy
from cached_property import cached_property
from devito import Dimension
from devito.types import SparseTimeFunction
from devito.logger import error
import numpy as np
__all__ = ['PointSource', 'Receiver', 'Shot', 'RickerSource', 'GaborSource', 'TimeAxis']
class TimeAxis(object):
"""
Data obj... |
import itertools
from collections import defaultdict
import numpy as np
from scipy import stats
def max_accuracy(y_true, y_pred):
names_true, names_pred, max_result = list(set(y_true)), list(set(y_pred)), 0
for perm in itertools.permutations(names_pred):
acc = np.average([1. if names_true.index(ti) =... |
import argparse
import random
import json
from typing import List, Dict
import torch
from torch.utils.data import Dataset
from transformers import AutoTokenizer, Trainer, TrainingArguments, logging
from transformers import AutoModelForCausalLM
from tqdm import tqdm
from util.io import read_jsonl
from util.dl import s... |
'''
Created on Feb 8, 2017
@author: julien
'''
from inspect import isfunction, isclass
from random import Random
import numpy
rand = Random()
class ParameterConstraint(object):
levels = ['row', 'block', 'layer']
def __init__(self, namespace_id, name, value, **kwargs):
self.namespace_id = namesp... |
# Copyright 2021 Huawei Technologies Co., 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("../")
import argparse
import tensorflow as tf
import random
from models.data_generator import tf_data_generator
from models.gan import Discriminator, Generator, sample_noise
from deeploglizer.common.preprocess import FeatureExtractor
from deep... |
import math
from utils.points_utils import distance, distance_squared
#this code: import with_nolib.unsupervised.clustering.metrics as mu
def sum_of_squared(data, assignments, centroids):
return -99
def sum_of_squared_within(data, assignments, centroids): #SSW cohesion
ssw = 0.0
for idata in range(len(da... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from ....cart.app import cart_app
from ....cart.models import Cart, CART_SESSION_KEY
from ....delivery.tests import... |
#!/usr/local/bin
import pickle
import itertools
import heapq
from collections import defaultdict
import numpy as np
import pandas as pd
from scipy.stats import binom
import matplotlib.pyplot as plt
def generate_mi(rsIDs):
""" Usefuls for reindexing for a new subset of rsIDS
"""
BASES = ['A', 'C', 'G', '... |
import unittest
import mock
import logging
from docker import DockerClient
from docker.errors import DockerException
from subprocess import Popen
import signal
from daemon.events import DockerEventDaemon
import config
logger = logging.getLogger(__name__)
logging.basicConfig(format=config.logger.format)
logging.root.se... |
""" Developer note
- This module defines the Django command `fetch_variables` which is run in terminal by: `python manage.py fetch_variables`.
This command is defined in the `Command.handle()` method
- In practice, this method calls the OpenFisca API to get the details of each variable. This could be hund... |
#!/usr/bin/env python
"""
Commandline tool for extracting unique neoepitopes from mztab files and the
and the FRED2 vcf_neoepitope_predictor.py script.
usage: found_neoepitopes.py [-h]
-m MZTAB
-n NEOEPITOPES
[-f FILEFORMAT ... |
"""
Support for binary sensors triggered by http GET requests.
For more details about this component, please refer to the documentation at
https://github.com/rotx/homeassistant-components/
"""
import asyncio
import logging
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
import voluptuous ... |
# -*- coding: utf-8 -*-
"""
根据手工标注的标签生成npy文件,每个npy文件保存了一个二维数组(width, height, 8+1),
前8个通道是图像数据,最后一个通道是标签
"""
import os
import sys
import glob
import json
import tqdm
import skimage.io
import numpy as np
import matplotlib.pyplot as plt
def find_bnd(img):
"""
从标签图像中找到标注的区域(矩形),标签图像是与卫星图大小一致的RGBA图像,未标注的
... |
"""
This test need a set of pins which can be set as inputs and have no external
pull up or pull down connected.
THIS TEST ONLY PASSES USING EXPANSION BOARD 2.1
ON EXPANSION BOARD 3.0 THE TEST FAILS ON LOPY4 AND WIPY DUE TO DIFFERENT REASONS
"""
from machine import Pin
from machine import UART
import os
mch = os.uname... |
#!/usr/bin/env python
from flask import Flask, jsonify, request, _app_ctx_stack
from flask_restful import Resource, Api, reqparse
from PIL import Image
import argparse
import io
import os
import sys
import time
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
from copper.model import Model
fro... |
# -*- coding: utf-8 -*-
from collections import OrderedDict
from threading import Lock
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
class PyeeException(Exception):
"""An exception internal to pyee."""
class EventEmitter:
"""The base event emitter class. All other event emitters inheri... |
"""
Utilities to extract information from scraped GM fixtures and standings pages.
"""
import collections
import csv
from pathlib import Path
from typing import Dict, Generator, List, Type
from unicorner import SeasonParse
from unicorner.dtos import DtoMixin, FranchiseDto, GameDto, SeasonDto, TeamDto
from unicorner.en... |
"""
Settings helpers for the ``azimuth`` Django app.
"""
from settings_object import (
SettingsObject,
Setting,
NestedSetting,
ObjectFactorySetting
)
from .zenith import Zenith
class AwxSettings(SettingsObject):
"""
Settings object for the AWX settings.
"""
####
# General setting... |
import torch
from torch import nn
from torch.nn import functional as F
import math
class Network(nn.Module):
def __init__(self, num_actions, image_channels, vec_size, cnn_module, hidden_size=256,
dueling=True, double_channels=False):
super().__init__()
self.num_actions = num_ac... |
from telegram import InlineKeyboardMarkup
from telegram.message import Message
from telegram.update import Update
import time
import psutil
from bot import AUTO_DELETE_MESSAGE_DURATION, LOGGER, bot, \
status_reply_dict, status_reply_dict_lock, download_dict, download_dict_lock
from bot.helper.ext_utils.bot_u... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 27 15:54:52 2019
@author: <NAME>.
"""
#importing the libraries.
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.autograd as variable
from sklearn.model_selection import train_test_... |
"""
1 1: 73 's'
2 2: 4f73 'Os'
3 3: 204f73 ' Os'
4 4: 68204f73 ... |
import itertools as it
import math
from . import base_objs
import gen_basis_helpers.shared.misc_utils as misc
import numpy as np
class BroadenFunctCompositeStandard(base_objs.BroadenFunctionStandard):
leafObjs = misc.StandardComponentDescriptor("leafObjs")
def __init__(self, objs:iter):
""" Initializer for comp... |
# -*- coding:utf-8 -*-
'''
For full text searching.
'''
from config import CMS_CFG
from torcms.core.base_handler import BaseHandler
from torcms.core.tool.whoosh_tool import YunSearch
from torcms.model.category_model import MCategory
from torcms.core.tools import logger
def gen_pager_bootstrap_url(cat_slug, page_num... |
# Copyright 2018 The CapsLayer 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 applicab... |
"""
75. Sort Colors
Medium
6543
338
Add to List
Share
Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
We will use the integers 0, 1, and 2 to represent the color red, white, and blu... |
from scipy.io import wavfile
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
import pylab
import math
from utils import escribir_pixel, filtrar
from PIL import Image
''' constantes '''
PORCH_TIME = 0.00208
SYNC_TIME = 0.02
DETECT_SYNC_TIME = SYNC_TIME * 0.7
LINE_COMP_TIME = 0.1216
#fs, data = w... |
# Copyright 2016 by MPI-SWS and Data-Ken Research.
# Licensed under the Apache 2.0 License.
"""Adapters for reading/writing event streams to CSV (spreadsheet) files.
"""
"""Define an event type for time-series data from sensors.
from collections import namedtuple
# Define a sensor event as a tuple of sensor id, times... |
# coding:utf8
"""消费者模块"""
import os
import sys
import json
from multiprocessing import Process
from fastweb import app
from fastweb.manager import Manager
from fastweb.util.tool import timing
from fastweb.exception import TaskError
from fastweb.component.task import Task
from fastweb.util.python import load_object
f... |
import collections
import math
from typing import Counter, List, Tuple, Union
import torch
__all__ = [
"sentence_bleu",
"corpus_bleu",
"evaluate_attribute_transfer_model"
]
def _get_ngrams(segment,
max_order: int) -> Counter[Tuple[str, ...]]:
r"""Extracts all n-grams up to a given max... |
import os
import requests
from bs4 import BeautifulSoup
from coveopush import CoveoConstants
from coveopush import CoveoPermissions
from coveopush import CoveoPush
from coveopush import Document
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
def find_gen(index):
if 1 <= index <= 151:
... |
# Copyright (c) 2016, 2017, 2018, 2019 <NAME>.
#
# clgen 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, or
# (at your option) any later version.
#
# clgen is distributed in th... |
# <NAME> Python 3.8 2020-08-18 - 2020-09-01 #
# zipgeo.py takes a .csv file with 6 fields and geocodes it
# *by zipcode* first; then via api and address.
# ("AnyID","address","city","state","zip","country")
import pandas as pd
from uszipcode import SearchEngine
import os
import sys
from keys import ... |
###################################################################################################
# Copyright (c) 2021 <NAME>
#
# 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 restr... |
#!/usr/bin/env python
# Columbia Engineering
# MECS 4603 - Fall 2017
import math
import numpy
import time
import rospy
import random
from std_msgs.msg import Header
from geometry_msgs.msg import Pose2D
from state_estimator.msg import RobotPose
from state_estimator.msg import SensorData
from state_estimator.msg impor... |
import datetime
import logging
import os
import pdb
import sys
import numpy as np
import torch
from transformers import BertTokenizer
from sklearn.metrics import classification_report, recall_score, f1_score, precision_score
from torch import nn
from torch.utils.data import DataLoader
from model import (KvretConfig... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from dgl import model_zoo
from torch.utils.data import DataLoader
import math, random, sys
import argparse
from collections import deque
import rdkit
from jtnn import *
torch.multiprocessing.set_sharing_str... |
# Standard library
import atexit
import os
import socket
import sys
import time
# Third-party
# Third-party
import theano
theano.config.optimizer = 'None'
theano.config.mode = 'FAST_COMPILE'
theano.config.reoptimize_unpickled_function = False
theano.config.cxx = ""
from astropy.table import QTable
import h5py
import n... |
"""
Work with analyses in the database.
"""
import asyncio
from typing import Any, Dict, List, Optional, Tuple
import virtool.bio
import virtool.db.utils
import virtool.utils
from virtool.config.cls import Config
from virtool.indexes.db import get_current_id_and_version
from virtool.subtractions.db import attach_subt... |
"""
Author: <NAME>
Last change: 7pm 8/12/2020
linkedin: https://www.linkedin.com/in/abraham-lemus-ruiz/
"""
import requests
import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score,mean_squared_error, r2_score
from sklearn.model_selection import train_test_split
from sklearn.linear_model imp... |
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import render
from django.http import HttpResponse, HttpResponseBadRequest
from django.contrib.auth import authenticate
from django.db import connection
from datetime import datetime
from vehicle.models import Vehicle, Route, VehicleRoute, Vehic... |
# Copyright (c) 2020, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
import sys
import torch
import transformers
import numpy as np
from contexttimer import Timer
from typ... |
import datetime
import operator
import time
from functools import reduce
from app.main.model.snapshot_model import Snapshot
from app.main.model.synonym_model import Synonym
_current_milli_time = lambda: int(round(time.time() * 1000))
def _format_chart_date(date):
return datetime.datetime.strftime(date, '%Y-%m-%... |
# Copyright 2021 - 2022 Universität Tübingen, DKFZ and EMBL
# for the German Human Genome-Phenome Archive (GHGA)
#
# 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/... |
# Copyright 2018 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 to in writing, ... |
# coding=utf-8
import argparse
from ..molPred.molPred_datas import *
from hyperopt import tpe
from ..toolPack.tools_hpOpt import fmin_multiProcess, Fmin_process, file_progress
from ..toolPack import tools_log
from ..toolPack.tools_metric import metric_betters
from ..toolPack import tools_data_io
from ..toolPack import ... |
import gym
import numpy as np
import os
import random
import time
import pandas
from tqdm import tqdm
import matplotlib.pyplot as plt
from sklearn.model_selection import ParameterGrid
np.random.seed(42)
random.seed(42)
def print_state_values_tabular(Q, size=8):
# Get the max value for state
V = [max(q_s) fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.