text
stringlengths
6.04k
39.5k
""" XVM (c) www.modxvm.com 2013-2017 """ __all__ = ['start', 'stop', 'call'] # PUBLIC import os import threading import simplejson import traceback import uuid import BigWorld from gui.shared import g_eventBus, events import pika from pika import exceptions as pika_exceptions from xfw import * from xvm_main.pyth...
#!/usr/bin/env python3 import os import sys import time import argparse import re import subprocess import requests import shutil from bs4 import BeautifulSoup from termcolor import cprint from multiprocessing import Pool import traceback MARKDOWN_SEARCH_TERM = r'\.md$' # Regex to find a URL URL_SEARCH_TERM = r'(\b(h...
import os import time import tensorflow as tf import numpy as np import scipy.io as sio import argparse import random from models import fmnet_model # os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # from tensorflow.python.client import device_lib # print(device_lib.list_local_devices()) flags = tf.app.flags FLAGS = fla...
import argparse import numpy as np import logging import random import torch import sys from functools import partial from dataclasses import dataclass, field from typing import Optional, Union from tqdm import tqdm import json from pathlib import Path from datasets import load_dataset, load_metric import transforme...
""" test_mechanisms.py This program displays the results of inserting NEURON mechaanisms from .mod files into a point cell to voltage steps in voltage clamp. This code is primarily for visual verification of model function. usage: test_mechanisms.py [-h] [-e] test ion channel mechanisms positional arguments: {Ca...
#!/usr/bin/env python # -*- coding: utf-8 -*- """diskover - Elasticsearch file system crawler diskover is a file system crawler that index's your file metadata into Elasticsearch. See README.md or https://github.com/shirosaidev/diskover for more information. Copyright (C) <NAME> 2017-2019 diskover is released under th...
import os import re from shutil import copyfile import torch from fastNLP import Trainer, Vocabulary from fastNLP.core.optimizer import AdamW from fastNLP.io.file_utils import cached_path from .model.bert import BertEmbedding from .model.finetune_dataloader import (fastHan_CWS_Loader, fastHan_NER_Loader, ...
# 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, ...
import hashlib import itertools import logging from django.utils.translation import ugettext as _ import psycopg2 import sqlalchemy from memoized import memoized from sqlalchemy.exc import ProgrammingError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.schema import Index, PrimaryKeyConstrain...
#! /usr/bin/env python # -*- coding: utf-8 -*- #################### # Copyright (c) 2016, Perceptive Automation, LLC. All rights reserved. # http://www.indigodomo.com import indigo import threading import Queue import time # Note the "indigo" module is automatically imported and made available inside # our global nam...
""" Technique : BPDA from Anish et. al (https://arxiv.org/abs/1802.00420) Attack : This attacks the robustness of Feature Squeezers as reported in Table 3 of Feature Squeezing Paper (https://arxiv.org/pdf/1704.01155.pdf) Since this is BPDA, we do not modify the model by itself, so vanil...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # Importes das bibliotecas utilizadas import logging import time import pandas as pd import pickle from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.ensemble i...
from typing import List import streamlit as st from arxiv_miner.config import Config import dateparser from streamlit.cli import main import datetime from functools import wraps import arxiv_miner from arxiv_miner import \ KeywordsTextSearch,\ TermsAggregation,\ DateAggregation,\ TextSea...
''' LICENSING ------------------------------------------------- daemoniker: Cross-platform daemonization tools. Copyright (C) 2016 Muterra, Inc. Contributors ------------ <NAME> <EMAIL> | <EMAIL> | <EMAIL> This library is free software; you can redistribute it and/or modify it und...
#!/usr/bin/env python """ QEMU CPU Testing Tool """ from sys import ( stderr ) from os.path import ( dirname, join, exists, basename ) from os import ( makedirs, killpg, setpgrp ) from signal import ( SIGTERM, SIGKILL ) from argparse import ( Action, ArgumentParser ) fro...
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
from lxml import etree import os import re import json import copy import logging import collections from matplotlib import cm from matplotlib import colors from indra.sources.indra_db_rest import get_statements from indra.ontology.bio import bio_ontology from indra.databases import context_client from indra.assembler...
# -*- coding: utf-8 -*- # 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, softw...
import curses import random import time import os from json import JSONDecodeError from math import ceil from json import dumps, loads class SistemaOperativo: """Sistema operativo chidi""" MEMORY_SIZE = 128 PAGE_SIZE = 4 OS_SIZE = 8 def __init__(self, quantum): self.procesos = [] s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 11 09:37:49 2018 Modified on 11/27/2018 to clean up comments Modified Wed Dec 5 2018 (Fix Issue 2, Handle DC Loads) Modified on 02/25/2019 for version 0.1.0 Modified on Wed 01/20/2021 to add computeOutputResults @author: <NAME> ------------------...
import os import shutil import subprocess from dataclasses import dataclass from datetime import datetime from typing import Dict, List, Optional, Tuple import requests from huggingface_hub import Repository from loguru import logger from prettytable import PrettyTable from tqdm import tqdm from .audio_utils import S...
# # Copyright 2018 Alpaca # # 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, sof...
import sys sys.path.append('./lib') import os # utils import argparse import time from glob import glob #torch import torch import torch.backends.cudnn as cudnn import torch.nn as nn from torch.utils.data import DataLoader,Dataset from torch.autograd import Variable import torch.optim as optim from torch.optim import A...
from django.utils import translation from django.utils.translation import ugettext import waffle from elasticsearch_dsl import Q, query from rest_framework import serializers from rest_framework.filters import BaseFilterBackend from olympia import amo from olympia.addons.indexers import WEBEXTENSIONS_WEIGHT from oly...
#!/usr/bin/env python import tensorflow as tf import sys import random import numpy as np import re ############################# from collections import deque sys.path.append('../user_simulator') from CompleteUser import * sys.path.append('../LU_model') import db sys.path.append('../data_resource') import CrawlerTim...
import tables as pt, numpy as np, pickle from models.StrategyDataModel import StrategyDataModel import numpy as np class StrategyData: def __init__(self,dataFile, dataAccess, isTable = False): ''' @param dataFile: The filename of the data file (array or pytables) @param isTable...
import numpy as np import os import random import shutil from statistics import mean from tensorflow.python.keras.backend import dtype from game_models.base_game_model import BaseGameModel from convolutional_neural_network import ConvolutionalNeuralNetwork import torch import torch.nn as nn import torch.optim as opti...
class Arco(): def __init__(self, origem, destino, valor): self.valor = valor self.vertices = (origem, destino) def __hash__(self): return hash(self.vertices + (self.valor,)) def __eq__(self, arco): return (self.valor,) + self.vertices == (arco.valor,) + arco.vertices ...
import os import sys from bcbio.rnaseq import (featureCounts, cufflinks, oncofuse, count, dexseq, express, variation, stringtie, sailfish, spikein, pizzly, ericscript, kallisto, salmon) from bcbio.rnaseq.gtf import tx2genefile from bcbio.ngsalign import bowtie2, align...
# -*- coding: utf-8 -*- # -*- mode: python -*- """ CommandLine: python %CODE_DIR%/ibeis/_installers/ibeis_pyinstaller_data_helper.py --test-get_data_list """ from __future__ import absolute_import, division, print_function import os import sys from os.path import join, exists, realpath, abspath, dirname, relpath ...
''' Script with all sampling methods. Computation of effective sampling size from: https://github.com/jwalton3141/jwalton3141.github.io following definition from: ref Gelman, Andrew, <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>. 2013. Bayesian Data Analysis. Third Edition. London: Chapman & Hall / CRC Press. ''' impor...
import operator import re import sys import sympy import pyparsing from chempy import Substance from chempy import balance_stoichiometry from chemsolve.element import Element from chemsolve.element import SpecialElement from chemsolve.compound import Compound from chemsolve.compound import FormulaCompound from chems...
""" CORE ANALYTICS MODULE: Generates the analytical meta-data from tables database, this distribution is consumed in data generation and augmentation methods. Max Row Support: 17 Max Column Support: 40 """ import os import cv2 import glob import pickle import numpy as np import utility as ut from tqdm import tqdm ...
# SPDX-License-Identifier: Apache-2.0 """CDS Blueprint module.""" import json import re from dataclasses import dataclass, field from datetime import datetime from io import BytesIO from typing import Any, Dict, Generator, Iterator, List from uuid import uuid4 from zipfile import ZipFile import oyaml as yaml from ona...
from time import strftime import os from .xbin import XBinIO # Can be int or float # Changes the internal type for frames indices FRAME_TYPE = float ''' ------------------- ---< NT_EXPORT >--- ------------------- ''' class Note(object): __slots__ = ('frame', 'string') def __init__(self, frame...
#!/usr/bin/python # # 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 ag...
# -*- coding: utf-8 -*- """ Created on Sun Apr 28 00:33:10 2019 @author: Aalap """ # -*- coding: utf-8 -* """ Created on Thu Mar 28 18:47:25 2019 @author: Aalap """ import numpy as np import matplotlib.pyplot as plt import math class Node: def __init__(self, nodex, nodey,nodetheta, cost, p...
from scipy.stats import kurtosis, skew from torch.utils.data import Dataset from sklearn.datasets import make_spd_matrix from sklearn.covariance import empirical_covariance from sklearn.metrics import mean_squared_error from torch.utils.data import DataLoader import numpy as np import itertools import torch.nn.function...
# -*- coding: utf-8 -*- """ Created on Thu Feb 01 14:23:18 2018 @authors: rafip, T.J.Ashby """ import yaml from os.path import join import pandas as pd import numpy as np from utils import SQLConnection, clean_nan_columns, get_features_from_labevents, get_features_from_chartevents pd.set_option('mode.chained_assignm...
import json import logging import sys import time import traceback from datetime import datetime from typing import List from typing import Optional from uuid import uuid4 import requests from folio_uuid.folio_namespaces import FOLIONamespaces from pydantic import BaseModel from folio_migration_tools.custom_exception...
# coding=utf-8 import os import sys import platform import time from threading import Thread # Python版本 简要区分2.x 及3.X PY_VERSION = 3 # Linux发行版本 简要区分主流CentOS以及Ubuntu LINUX_KERNEL = "" COMMAND_HEADER = "" # 工程根目录 PROJECT_ROOT = "/qinse" # 运行模式 DEBUG = True # PIP 源 PIP_SOURCE = "-i https://pypi.tuna.tsinghua.edu.cn/simpl...
import json import redis import time from .redis_stream_utilities_py3 import Redis_Stream from .redis_rpc_client_py3 import Redis_Rpc_Client from .redis_rpc_server_py3 import Redis_Rpc_Server class Field_Not_Defined(Exception): pass class FIELD_TYPE_ERROR(Exception): pass class ...
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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...
import numpy as np import pandas as pd from scipy.stats import invgamma, multivariate_normal from scipy.special import logsumexp from typing import Dict, Union from replay_structure.metadata import MODELS_AS_STR from replay_structure.structure_models_gridsearch import Structure_Gridsearch from replay_structure.utils i...
# The piwheels project # Copyright (c) 2017 <NAME> <https://github.com/bennuttall> # Copyright (c) 2017 <NAME> <<EMAIL>> # # 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 ...
# !/usr/bin/env python3 import asyncio import logging from datetime import datetime, timedelta from typing import List import discord from discord.commands import slash_command from discord.ext import commands, tasks from .utils.common import CommonUtil from .utils.guild_setting import GuildSettingManager from .util...
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2017, 2018 # -------------------------------------------------------------------------- # Author: <NAME>, IBM A...
import numpy as np import hashlib import copy import datetime import threading # Notation: [ROW][COL] # Note: Add Forbidden Cells to improve the efficiency # Check duplicate state in the search tree, keep DEPTH info # Add Progress Monitoring # ?Store Search Nodes for next batch # ?Add Heuristic...
import folium import geopy.distance import math import matplotlib.pyplot as plt import numpy as np from scipy.signal import butter,filtfilt,sosfilt import os import sys import time import serial from pathlib import Path Path(__file__).parents[1] cwd = os.getcwd() input_file_path = str(Path(__file__).parents[1]) + '\P...
"""Validate a model per the AaC DSL.""" import copy from contextlib import contextmanager from typing import Union from attr import attrib, attrs, validators, Factory from iteration_utilities import flatten from aac import plugins, util from aac.spec.core import get_aac_spec, get_primitives VALIDATOR_CONTEXT = None...
import sys import os import datetime # add parent dir to path to access webrecorder package wr_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, wr_path) from redis import StrictRedis from fakeredis import FakeStrictRedis import fakeredis import json import shutil from six.moves...
#!/usr/bin/python3 """ Copyright (c) 2018 <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, ...
"""Johnny's main caching functionality.""" from hashlib import md5 from uuid import uuid4 import django from django.db.models.signals import post_save, post_delete from . import localstore, signals from . import settings from .compat import ( force_bytes, force_text, string_types, text_type, empty_iter) from .de...
# -*- coding: utf-8 -*- """Additional constraints to be used in an oemof energy model. SPDX-FileCopyrightText: <NAME> <<EMAIL>> SPDX-FileCopyrightText: <NAME> SPDX-FileCopyrightText: <NAME> SPDX-FileCopyrightText: <NAME> SPDX-License-Identifier: MIT """ import pyomo.environ as po from oemof.solph.plumbing import s...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import nipype.interfaces.fsl as fsl # fsl from nipype.algorithms.misc import TSNR import nipype.interfaces.utility as util # utility import nipype.pipeline.engine as pe # pypeline eng...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean CLI v1.0. Copyright 2021 QuantConnect 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...
#!/usr/bin/env python """ Copyright 2020 Johns Hopkins University (Author: <NAME>) Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """ import sys import os from jsonargparse import ( ArgumentParser, ActionConfigFile, ActionParser, namespace_to_dict, ) import time import logging from path...
import os import sys import configparser import csv import fiona import time from shapely.geometry import shape, Point, LineString, mapping from shapely.ops import cascaded_union from tqdm import tqdm from rtree import index from collections import OrderedDict CONFIG = configparser.ConfigParser() CONFIG.read(os.pa...
import requests import re, json from datetime import datetime, date, timedelta from time import mktime, sleep from io import StringIO from urllib.parse import urlencode from wallstreet.constants import DATE_FORMAT, DATETIME_FORMAT from wallstreet.blackandscholes import riskfree, BlackandScholes from functools import...
import random, math from copy import deepcopy from operator import attrgetter from scipy.stats import norm, rv_discrete import numpy as np class ACOR: def __init__(self, obj, dimension, **kwargs): # Parameters for objective function self.obj = obj self.dimension = dimension self.m...
import subprocess import json import os import re from enum import Enum from tqdm import tqdm import pandas as pd # sript for extracting data def upsearch(dir): curdir = os.getcwd() while os.getcwd() != "/": cwd = os.getcwd() if dir in os.listdir(cwd): found_dir = os.path.abspath(di...
# coding: utf8 # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # # 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 # # Un...
import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.colors import is_color_like from collections.abc import Iterable import matplotlib.lines as mlines import scipy.stats as st import warnings def _assert_plot_defaults(twotailed=True, difference_cutoff=.1, differentcolor='red', diffe...
# Parsegen: # written by <NAME> # email: <EMAIL> # License - Free for non-commercial, educational use. # (c) 2016 # This program may be used in part or its entirety for non-commercial, educational # purposes. import sys import stack import streamreader from lr0state import * class ParserGenerator: def __init__(s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 <NAME> # 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...
import struct import util from blat import BlatRecord class Primer: __slots__ = ('__sequence', '__pos') def __init__(self, sequence, pos): self.__sequence = sequence self.__pos = pos def __str__(self): return '[%s] %s' % (self.__pos, self.__sequence) @property def sequen...
# -*- coding: utf-8 -*- """Tests for XGBoost integration""" # pylint: disable=R0201, R0915 import math import os import numpy as np import pytest import treelite import treelite_runtime from treelite.contrib import _libext from sklearn.datasets import load_boston, load_iris from sklearn.model_selection import train_te...
""" Adapted from https://github.com/trent-b/iterative-stratification This file includes multilabel cross validators based on an implementation of the Iterative Stratification algorithm described in the following paper: <NAME>., <NAME>., <NAME>. (2011) On the Stratification of Multi- Label Data. In: <NAME>., <NAME>., <...
from __future__ import absolute_import, division, print_function import argparse from collections import OrderedDict import csv import logging import os import random import sys import pandas as pd import numpy as np import torch.nn as nn import torch import torch.nn.functional as F from torch.utils.data import (Data...
""" Generate the graphics assets for ../www/img/ -folders. """ from argparse import ArgumentParser import re import os import sys import shutil import subprocess from pathlib import Path from pprint import pprint TEST_TEMPLATE = """ <html> <head> <style> i {{ display: block; height: 32px; width: 32px; image-r...
#!/usr/bin/python3 # -*- coding: UTF-8 -*- import os import sys import time import json import subprocess ''' @Author : Npist <<EMAIL>> @File : v2rayMS_Client.py @License : http://opensource.org/licenses/MIT The MIT License @Link : https://npist.com/ @Time : 2019.03.28 @Ver : 0.5.1 ''' UPDATE...
# Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# Copyright 2017 ZTE Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
import docx from docx.oxml.ns import qn import re from mysite.core.paser import read_doc_chx import psycopg2 from mysite.core.paser import insertData def assessmentMethodProcessor(assessment_methods): output = [] temp = [] for item in assessment_methods: if (type(item) == str and item.startswith("S...
# Copyright (c) 2019 University Corporation for Atmospheric Research/Unidata # Distributed under the terms of the BSD 3-Clause License. import getpass import io import json import logging import os import sys import urllib.parse import xml.etree.ElementTree as ET from collections import namedtuple from datetime import ...
## Xilun: Need modify this file ## copied from data_loader.py import os from tempfile import NamedTemporaryFile import librosa import numpy as np import scipy.signal import torch import torchaudio from torch.utils.data import DataLoader from torch.utils.data import Dataset import time import json import argparse imp...
import sys, os import time import argparse import numpy as np from bilby.core.prior import Uniform as bilbyUniform from bilby.core.prior import DeltaFunction as bilbyDeltaFunction from bilby.core.prior import Gaussian as bilbyGaussian from PyGRB.main.fitpulse import PulseFitter from PyGRB.backend....
# Copyright 2021 DeepMind Technologies Limited. 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 ...
#!/usr/bin/python3 # check_imm2.py - IMM2 # for nagios style monitoring systems # # this checks via SNMP v3 # # copyright C-Store 2016 # Author <NAME> import argparse from sys import exit from subprocess import check_output from collections import OrderedDict # define all oids tree= { 'ibm': { 'fans': '1.3...
import json import pickle as pkl import os import nltk import re from pytorch_pretrained_bert.tokenization import BertTokenizer tokenizer_bert = BertTokenizer.from_pretrained('../../pre_trained_models_base_cased/', \ do_lower_case=False, cache_dir='../../pre_trained_models_base_cased/') def resolv_schema...
import rospy import numpy from gym import spaces from openai_ros.robot_envs import deepsoccer_env from gym.envs.registration import register from geometry_msgs.msg import Point from openai_ros.task_envs.task_commons import LoadYamlFileParamsTest from openai_ros.openai_ros_common import ROSLauncher import os import cv2 ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # list...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # rule_engine/parser.py # # 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...
""" A file dedicated to useful functions related to position weight matrices that describe the binding profiles of RBPs, such as scanning an RNA sequence to detect where the RBP might bind on it. Possibly the file I had the most pleasure writing, despite its simplicity. What is a PWM? A PWM is a position weight matrix...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Feb 23 12:11:22 2020 @author: abdulroqeeb """ #ibapi imports from ibapi import wrapper from ibapi import utils from ibapi import client from ibapi.account_summary_tags import AccountSummaryTags from PyQt5 import QtWidgets from PyQt5 import QtCore import...
##################################################################### # # # /devices/adwin.py # # # # Copyright 2013, Monash University ...
#!/usr/bin python3 """ Utilities available across all scripts """ import logging import os import urllib import warnings import zipfile from socket import timeout as socket_timeout, error as socket_error from hashlib import sha1 from pathlib import Path from re import finditer import cv2 import numpy as np from tqd...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# <NAME> # This module provides classical simulations of basic quantum algorithms (once you write them). # In numpy, I think that the default complex dtype varies from platform to platform. If you want to explicitly use the default type in your code, use one.dtype (where one is defined just below). import random imp...
# -*- coding: utf-8 -*- import argparse import os import os.path as path from time import time import sys import logging import tensorflow as tf from jtr.preprocess.batch import get_feed_dicts from jtr.preprocess.vocab import NeuralVocab from jtr.train import train from jtr.util.hooks import ExamplesPerSecHook, Lo...
# -*- coding: utf-8 -*- # Copyright (C) 2017, 2018 """ Backups the entire Fledge repository into a file in the local filesystem, it executes a full warm backup. The information about executed backups are stored into the Storage Layer. The parameters for the execution are retrieved from the configuration manager. It ...
from typing import List import flair from flair.data import Dictionary, Sentence, Token, Label #from flair.datasets import CONLL_03, CONLL_03_DUTCH, CONLL_03_SPANISH, CONLL_03_GERMAN import flair.datasets as datasets from flair.data import MultiCorpus, Corpus from flair.list_data import ListCorpus import flair.e...
from __future__ import print_function import sys sys.path.insert(0, '.') import torch from torch.autograd import Variable import torch.optim as optim from torch.nn.parallel import DataParallel import time import os.path as osp from tensorboardX import SummaryWriter import numpy as np import argparse ...
import statistics from bson.objectid import ObjectId import pymongo import datetime import sys portNumber = int(input("Enter the port number: ")) # get port number from input connection = pymongo.MongoClient("localhost", portNumber) # connect to to local host using portnumber...
# # Copyright (c) 2006-2013, Prometheus Research, LLC # """ :mod:`htsql.core.tr.fn.encode` ============================== """ from ...adapter import Adapter, adapt, adapt_many, adapt_none from ...domain import UntypedDomain, BooleanDomain, IntegerDomain from ..encode import EncodeBySignature, EncodingState from ......
# 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, software # distributed under t...
from copy import deepcopy import click import signal_analog.util as util from signal_analog.charts import Chart from signal_analog.errors import ResourceMatchNotFoundError, ResourceAlreadyExistsError from signal_analog.resources import Resource class DashboardGroup(Resource): """Representation of a Dashboard Gr...
from copy import deepcopy from functools import partial import numpy as np from numpy.random import randint import torch as th from torch import nn from torch.autograd import Variable from torch.optim import RMSprop from debug.debug import IS_PYCHARM_DEBUG from components.scheme import Scheme from components.transform...
import cv2 import argparse import numpy as np from tqdm import trange import imageio import time W = 256 H = 256 ref_ptr = [] src_ptr = [] dst_ptr = [] src_flag = False #src: [77,132;109,144;184,116;149,143;115,176;151,177] #dst: [77,112;120,107;196,89;154,101;119,154;161,146] def clickndraw(event, x, y, flags, param...
import collections import io import json import signal import threading from typing import Dict, List, Tuple from collections import Counter from search import FuzzySearch import textdistance from glob import glob from text import Alphabet, TextCleaner, levenshtein, similarity from utils import enweight from dsalign_m...