text
stringlengths
3.07k
22.1k
# from flask_mysqldb import MySQL # import MySQLdb.cursors import re from tracemalloc import start from flask import request, abort, redirect, url_for, current_app as app from flask import Flask, render_template, request, session, jsonify import urllib.request from pusher import Pusher from datetime import datetime imp...
#!/usr/bin/env python ######### WORKFLOW DOCUMENTATION of FUNCTIONS ############################################# # First *InputArrays* to output 2 arrays (ppt value and xy values) # Second *Run_IDW* for interpolation of the ppt-values, note has daughter classes # Third *classify* classification of precipitation # Fo...
""" Author: <NAME> GitHub: wafflescore """ from acse_9_irp_wafflescore import MiscHelpers as mh from acse_9_irp_wafflescore import SOMsHelpers as sh from acse_9_irp_wafflescore import FCMHelpers as fh from acse_9_irp_wafflescore import dataPreprocessing as dp import hdbscan from sklearn.cluster import KMeans import n...
#!/usr/bin/env python import os,sys,json,xlrd,requests,logging from flask import Flask from flask import request from flask import make_response def excel2json(workbook): book = xlrd.open_workbook(workbook) sheets = book.sheet_names() source={} sessiondetails = {"signedin":False,"phonenumber":""} for sheet in she...
import os import math import numpy as np import json import _jsonnet import subprocess from datetime import datetime from collections import OrderedDict, defaultdict import skopt from skopt.space.space import Categorical, Integer, Real, Space from skopt.utils import normalize_dimensions from allennlp.common.params i...
import os import unittest import pandas as pd import argopandas.index as dfi from argopandas.mirror import FileMirror class TestDataFrameIndex(unittest.TestCase): def setUp(self) -> None: this_file = os.path.dirname(__file__) mirror_dir = "argo-test-mirror" self.mirror = FileMirror(os.pa...
import asyncio import logging import os import sys import threading from asyncio import Task from dataclasses import dataclass from tempfile import mkdtemp from typing import ( Any, AsyncGenerator, Awaitable, Callable, ClassVar, Dict, Generic, List, Mapping, Optional, Sequenc...
import pytest import numpy as np from lumicks.pylake.detail.image import reconstruct_image, reconstruct_image_sum, reconstruct_num_frames, save_tiff,\ ImageMetadata, line_timestamps_image, histogram_rows def test_metadata_from_json(): json = { 'cereal_class_version': 1, 'fluorescence': True, ...
import arrow from django.conf import settings import pandas as pd from pandas import json_normalize import requests from jira import JIRA from .models import Project, Issue, IssueTypes, IssueImages from django.db import DatabaseError BASE_URL = 'https://atriadev.atlassian.net/rest/api/2/' TOKEN = settings.JIRA_KEY USE...
import sys sys.path.append('.') from pyDist import Interfaces, intercom, exSheet import concurrent import logging import urllib.request import json import os import time import asyncio import subprocess from pyDist.TaskManager import TaskManager import tests.testerHelpers as testHelpers #logging ut...
import requests import json import os import random import threading hostUrl = 'https://g.fallin.dev/' def CheckToken(token): headers = {'content-type': 'application/json'} r = requests.post(hostUrl + 'checktoken', data=json.dumps({'token':token}), headers = headers) if r.status_code == 200: ret...
# Copyright (c) 2022, cemysce # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import enum import itertools from collections import Counter class LetterStatus(enum.Enum): # This is deliberately defined in or...
#!/usr/bin/python3 import os import time import random import argparse import numpy as np from collections import deque import paddle import paddle.nn as nn from config import * from src.utils import logger from src.datasets import get_dataset from src.models import get_model from src.transforms import * from src.utils...
#!/usr/bin/env python3 # USAGE # python real_time_object_detection.py --prototxt MobileNetSSD_deploy.prototxt.txt --model MobileNetSSD_deploy.caffemodel # import the necessary packages from imutils.video import VideoStream from imutils.video import FPS from geometry_msgs.msg import Twist from sensor_msgs.msg import Las...
from __future__ import print_function, division import os, sys, time, gc sys.path.append(os.path.dirname(sys.path[0])) try: import cPickle as pickle # python 2 except ImportError: import pickle # python 3 import numpy as np from matplotlib import pyplot as plt import geometry import density from cryoio im...
#!/usr/bin/env python3 # # SPDX-License-Identifier: MIT import os import shutil import subprocess import sys import zipfile import click from pycdlib import PyCdlib from pycdlib.pycdlibexception import PyCdlibInvalidInput def requireCommands(commands): missing = [] for cmd in commands: if shutil.whi...
from fluiddb.data.namespace import createNamespace from fluiddb.data.path import getParentPath, getPathName from fluiddb.data.permission import ( Operation, Policy, createNamespacePermission, createTagPermission) from fluiddb.data.tag import createTag from fluiddb.data.user import Role, createUser from fluiddb.data...
# import cv2 import os,glob import os import sys import tensorflow as tf import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches import seaborn as sn from mrcnn import utils from mrcnn import visualize from mrcnn.visualize import display_images import mrcnn.model as modellib from mrcnn....
from abc import abstractmethod, abstractproperty from bs4 import BeautifulSoup as bs from os.path import join, exists from os import makedirs, remove from requests import get as request_get from sys import stdout from pickle import load as pickle_load from pickle import dump as pickle_dump from sox_chords.util.utils ...
import yaml import json import random import time import argparse, sys, logging import socket from faker import Faker from confluent_kafka import Producer from exceptions import InvalidStateException, InvalidTransitionException baseurl = "https://imply-news.com" fake = Faker() # Attribute selector dicts. Key is the a...
"""Convenience class and methods to interface with database engines - SQL, sqlalchemy - MongoDB, pymongo - redis Author: <NAME> License: MIT """ import redis import sqlalchemy import pymongo from pyarrow import default_serialization_context as pa import numpy as np import pandas as pd from pandas import DataFrame, Se...
from flask import Flask from flask import request, jsonify, redirect from tempfile import TemporaryFile import os import speech_recognition as sr import myprosody as mysp import logging from werkzeug.utils import secure_filename from timming import Timer from flask.helpers import make_response import language_tool_pyth...
import sys import fasttext import numpy as np import matplotlib.pyplot as plt import pandas as pd import scipy.cluster.hierarchy as shc all_tokens_file = 'ptb_dense_10k_cbow.tokens.txt' all_token_paths_file = 'ptb_dense_10k_cbow.token_paths' corpus = '/home/dave/agi/penn-treebank/simple-examples/data/ptb.train.txt' #...
import discord from discord.app.commands import slash_command from discord.ext import commands from extra import utils from typing import Union, List from extra.language.centish import Centish from PIL import ImageDraw, ImageFont, Image import aiohttp import os guild_ids: List[int] = [int(os.getenv('SERVER_ID'))] dnk...
import base64 import collections import hashlib import hmac import json import logging import time from random import randint import requests from six.moves import urllib from .util import * class ClasslinkConnector(): """ Starts connection and makes queries with One-Roster API""" def __init__(self, ...
#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sys class BAC(object): ''' This is our main model ''' def __init__(self, args): #print(args["elimination_rate"]) self.args = args # initial alcohol concentration (gram) self.alcohol_con ...
from pyqtgraph.Qt import QtGui, QtCore from scipy.fftpack import fft import numpy as np import scipy.stats from GraphicsObject import GraphicsObject import pyqtgraph.functions as fn from pyqtgraph import debug from pyqtgraph.Point import Point import struct __all__ = ['PlotCurveItem'] class PlotCurveItem(GraphicsObjec...
"""Testing of makechat.api.middlewares.""" import falcon import unittest from falcon import testing from makechat.api.middlewares import RequireJSON, JSONTranslator, \ MongoengineObjectsPaginator class ExampleResource: """Simple dummy resource for testing hooks.""" def on_get(self, req, resp): "...
import os import pathlib import warnings import cv2 import numpy as np import PIL import torchvision.transforms as transforms from tiatoolbox.models.dataset import abc from tiatoolbox.tools.patchextraction import PatchExtractor from tiatoolbox.utils.misc import imread from tiatoolbox.wsicore.wsimeta import WSIMeta fr...
# # Copyright (c) 2014, Arista Networks, 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 condit...
#!/usr/bin/env python3 ### System ### import re import sys import time import shutil import argparse from glob import glob from tqdm import tqdm from os import mkdir, remove, listdir from os.path import join, dirname, exists from signal import signal, SIGINT, SIG_IGN from multiprocessing import cpu_count, Pool ### py...
from __future__ import division, absolute_import, print_function import os import sys import tensorflow as tf from tensorflow.python.platform import flags sys.path.append("../") import warnings import numpy as np from sklearn.neighbors import KernelDensity from sklearn.metrics import accuracy_score, precision_score,...
import sqlite3 import simplejson import random TYPE_INTEGER = "integer" TYPE_FLOAT = "float" TYPE_BOOLEAN = "boolean" TYPE_STRING = "string" TYPE_DATETIME = "datetime" TYPE_DATE = "date" #SQLITE_TYPES_MAP = {TYPE_STRING: "VARCHAR(255)", TYPE_INTEGER: "BIGINT", TYPE_FLOAT: "DOUBLE"} SQLITE_TYPES_MAP = {TYPE_STRING: "TE...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, with_statement, unicode_literals import os import re import json import shutil import datetime import unittest from simiki.config import parse_config, get_default_config from simiki.utils import copytree from simiki.generators import...
from __future__ import unicode_literals from __future__ import print_function from .. import errors from ..tools import DummyLock from ..context.expressiontime import TimeSpan from ..containers import LRUCache from ..compat import ( pickle, text_type, binary_type, with_metaclass, implements_to_stri...
import numpy as np import os from FE_mesh.utilities import working_directory, merge_txt_files def section(PID, MID = 1000000, ELFORM = 1): """This function defines a section, which is needed for LS - DYNA keyword file format. Args: PID (int): Property's identification number. MID (int, o...
import hashlib import re import time from datetime import datetime from dateutil.relativedelta import relativedelta from geopy import distance from geopy.geocoders import Nominatim from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.suppo...
''' pagination: Reference: https://docs.djangoproject.com/en/3.2/topics/pagination/ Author: Django doc ''' from re import U from django.core import paginator from django.http.response import FileResponse, JsonResponse, HttpResponse from rest_framework import serializers, status from rest_framework.decorators import api...
from django.http import HttpResponseRedirect from django.shortcuts import render from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.views.generic import TemplateView, ListView, FormView, DetailView from django.core.exceptions import PermissionDenied from net.model...
# -*- coding: utf-8 -*- # author: flower import asyncio import json from base64 import b64encode import nonebot as rcnb from nonebot.command.argfilter.extractors import extract_image_urls import httpx from . import other rcnbot = rcnb.get_bot() def get_g_tk(skey): key_hash = 5381 for i in range(0, len(ske...
""" pygame-menu https://github.com/ppizarror/pygame-menu WIDGET ADDITION EXAMPLE DOCS See https://pygame-menu.readthedocs.io/en/latest/_source/add_widgets.html License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 <NAME>. @ppizarror Permiss...
#!/usr/bin/env nix-shell #!nix-shell -i python3 shell.nix from pathlib import Path import numpy as np from PIL import Image from collections import deque import networkx as nx def parse_point(s): return list(map(int, s.strip("()").split(","))) def parse_point_list(s): return list(map(parse_point, s.split(")...
''' Copyright (c) 2019 <NAME> Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. 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 rig...
from django.conf import settings from django.db import models from django.utils import timezone from django.core.validators import MinValueValidator, MaxValueValidator from django.contrib.auth.models import User from django.http import Http404 from .RichTextBleachField import RichTextBleachField from django.db.models i...
# Author: <NAME> import json import os import sys import random import requests import string import sys import time import zmq from enum import Enum, auto from multiprocessing import Process from Crypto.Hash import SHA3_256 from Crypto.PublicKey import ECC from Crypto.Signature import DSS n = 7 # number of peers t...
# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest import ansible.plugins.filter.mathstuff as ms from a...
#! -*- coding:utf-8 -*- # CLUE评测 # cmrc2018阅读理解 # 思路:基于滑动窗口和GlobalPointer import json import numpy as np from snippets import * from bert4keras.backend import keras from bert4keras.layers import GlobalPointer from bert4keras.snippets import sequence_padding, DataGenerator from bert4keras.snippets import open from bert...
import logging import csv import re can_plot = True try: import matplotlib import matplotlib.pyplot as plt except ImportError: can_plot = False logger = logging.getLogger(__name__) # upper bound P-worker runtime for program with work T1 and parallelism PAR def bound_runtime(T1, PAR, P): # We scale the span t...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import nltk import os import numpy as np import codecs import multiprocessing as mp from collections import Counter def preprocess(email): """ Preprocess (simplifies) raw email. Args: email (str): Raw e-mail Returns: Processe...
import enum import typing from collections import namedtuple from functools import partial, lru_cache from onto.attrs.unit import Monad, MonadPrependMixin try: from pony.orm.core import Attribute, PrimaryKey, Discriminator, Optional, Required except ImportError: import warnings warnings.warn("pony import ...
from datetime import datetime from aiogram import types from aiogram.dispatcher import FSMContext from aiogram.types import CallbackQuery from FSM.Race_states import Race from constants.locations import points from keyboards.inline_kb import got_the_point from keyboards.reply_kb import get_location_button, remove_key...
def runTemplate(system, version, compiler, module, ntasks_node, threads_adjust, tasks, threads, gpus, suffix, rcfg, envar): if gpus > 0: accountgpuline="""#SBATCH --account=su950-gpu #SBATCH --partition=gpu #SBATCH --gres=gpu:ampere_a100:{}""".format(gpus) else: accountgpuline="#SBATCH --accoun...
''' File name: webgression.py Author: <NAME>. ''' import shelve, time, requests from sklearn.feature_extraction.text import TfidfTransformer, CountVectorizer from sklearn.naive_bayes import MultinomialNB as MNB from sklearn.linear_model import SGDClassifier from sklearn.pipeline import Pipeline from sklearn.mod...
import hashlib import tarfile import streamlit as st import logging import os import pandas as pd #import tensorflow as tf import random import time from google.cloud import storage from run import * version = 'v1' # tar -zcvf archive.tar.gz female/ && split -b 250M archive.tar.gz "archive.part" && rm archive.tar.gz...
import abc import time import logging import os.path from typing import Any, List, Optional, Callable, Iterable, cast from concurrent.futures import ThreadPoolExecutor, wait from cephlib.node import IRPCNode from cephlib.units import unit_conversion_coef_f from ..utils import StopTestError, get_time_interval_printab...
"""Holds all code needed for the actual alpha zero search and training. This is the 'core' code that executes the actual parts needed/described in the alpha zero papers. The actual search is executed in the MCTSNode, all other classes coordinate the process. This core could be used by itself to execute the training, ...
import os import random import cv2 import numpy as np import paddle from PIL import Image import dataloaders.helpers as helpers from davisinteractive.utils.operations import bresenham from paddle.vision.transforms import functional as F cv2.setNumThreads(0) NEW_BRANCH = True class Resize(object): """Rescale the ...
"""Static Analysis Setup Windows. Setup script for the Windows vm for usage with MobSF for static analysis of Windows apps. """ import configparser import logging import os import platform import re import shutil import subprocess import sys from os.path import expanduser from six.moves import input try: import ...
# The MIT License (MIT) # # Copyright (c) 2016 <NAME> & <NAME> for Adafruit Industries # # 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 ...
from batteries import * from common import * import ijson import collections import copy import prettytable ''' Problems: smaller number of results for data_type (for booltest - only data_type no exid, batteries) incorrect item - non existing CFG, test name, data_type bad results o...
from contextlib import closing from pathlib import Path from typing import Tuple, List, Optional, Iterator import pandas as pd from xlrd import XLRDError import mocos_helper from src.data.datasets import * from src.data.entities import BasicNode, GENDERS, Gender from src.features import SocialCompetence, SocialCompet...
import tensorflow as tf from functools import partial from .human import Human from .common import rename_tensor from .common import TRAIN,MODEL,DATA,KUNGFU,BACKBONE from .openpose import OpenPose,LightWeightOpenPose,MobilenetThinOpenpose from .pose_proposal import PoseProposal from .backbones import MobilenetV1_backbo...
import asyncio from typing import Dict, Any, Optional import botocore import statey as st from statey.provider import default_provider from statey.lib.aws.base import AWSMachine InstanceConfigType = st.Struct[ # Required args "ami" : st.String, "instance_type" : st.String, "key_name" : st.String, ...
__author__ = 'breddels' # due to 32 bit limitations in numpy, we cannot use astropy's fits module for writing colfits import sys import math import vaex.dataset import astropy.io.fits import numpy as np import logging logger = logging.getLogger("vaex.file.colfits") def empty(filename, length, column_names, data_type...
""" This module is an implement of SHAP (SHapley Additive exPlanation) values on tree ensembles. See "https://arxiv.org/abs/1802.03888" for more details. Citation: <NAME>, <NAME>, <NAME>. Consistent Individualized Feature Attribution for Tree Ensembles[J]. arXiv preprint arXiv:1802.03888, 2018. """ from __future__ im...
import os import shutil import tempfile import unittest from godot_parser import GDScene, Node, SubResource, TreeMutationException from godot_parser.util import find_project_root, gdpath_to_filepath class TestTree(unittest.TestCase): """ Test the the high-level tree API """ def test_get_node(self): ...
from __future__ import print_function import torch import torch.nn as nn from torch.nn import functional as F import models from utils.metric import AverageMeter, Timer import numpy as np from .datafree_helper import Teacher from .default import NormalNN, weight_reset, accumulate_acc, loss_fn_kd import copy from torch....
# %% import numpy as np from parameters import * # %% wxyz_all = () # the tuple that stores all the wannier xyz Oxyz_all = () # the tuple that stores all the Oxygen xyz Hxyz_all = () # the tuple that stores all the Hydrogen xyz fO_all = () fH_all = () boxlength_all = () # the tuple that stores all the boxlengths ...
import pydotplus as pydotplus import itertools from sklearn.tree import export_graphviz import matplotlib.pyplot as plt import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import f1_score, confusion_matrix def visualize_tree(tree, feature_names, name=None): """ Create a ...
from copy import deepcopy from multiprocessing import Pool from autode.ts_base import get_displaced_atoms_along_mode from autode.ts_base import TSbase from autode.templates import TStemplate from autode.calculation import Calculation from autode.config import Config from autode.exceptions import AtomsNotFound, NoNormal...
# Copyright (c) 2015 Gamda Software, LLC # # See the file LICENSE.txt for copying permission. import sys, pygame import pygame.locals from model import Model, Chip from gameboard.coordinate import Coordinate pygame.init() # set up font basic_font = pygame.font.SysFont(None, 36) # window size WINDOW_WIDTH = 800 WINDO...
"""Copyright 2013 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
# 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 applicable law or agreed to in writing, software...
#Classes Challenge 40: Epidemic Outbreak GUI App import math import random import tkinter class Simulation(): """A class to control a simulation and facilitate the spread of a disease.""" def __init__(self): """Initialize attributes""" self.day_number = 1 #Get simulation ini...
# Copyright (c) 2020 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 applic...
"""Solvers for single and multi-dimensional nonlinear problems.""" from typing import Callable, Any import numpy class RootFinder: """A generalized root finder for solving nonlinear equations. Args: func: A callable which returns an array of residuals the same shape as the argument. xo: An a...
# Copyright 2021 QHAna plugin runner contributors. # # 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 ...
### <NAME>'s Safe Driver Prediction ## Importing libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from tqdm import tqdm from sklearn.model_selection import KFold, StratifiedKFold, cross_val_score from lightgbm import LGBMClassifier from sklearn.linear_model import...
from datetime import date, datetime from os import name from django.db.models.fields import DateField from django.http import QueryDict # 引入QueryDict模块 from django.http.response import HttpResponseBadRequest, HttpResponseServerError from django.shortcuts import render from furl import furl # 引入furl模块 from django.db im...
import argparse import datetime import sys from collections import Counter import itertools import numpy as np import pandas as pd from collections import defaultdict def read_fasta(fp): name, seq = None, [] for line in fp: line = line.rstrip() if line.startswith(">"): if name: yi...
# -*- coding: utf-8 -*- # 混淆词提取算法 不考虑多音字,只处理同音字的情况 from pypinyin import lazy_pinyin, pinyin, Style # pinyin 的方法默认带声调,而 lazy_pinyin 方法不带声调,但是会得到不常见的多音字 # pinyin(c, heteronym=True, style=0) 不考虑音调情况下的多音字 from Levenshtein import distance # python-Levenshtein # 编辑距离 (Levenshtein Distance算法) import os from curLine_f...
from __future__ import print_function import os import sys import argparse import pprint import re import mxnet as mx import numpy as np from mxnet.module import Module import mxnet.optimizer as optimizer from utils.logger import logger from utils.config import config, default, generate_config from rcnn.symbol import ...
""" This script discards about 12% (#words) contents without numerical facts """ import re, io, copy, os, sys, argparse, pdb from tqdm import tqdm from collections import Counter, OrderedDict from pprint import pprint from domain_knowledge import Domain_Knowledge knowledge_container = Domain_Knowledge() DELIM = "│...
from typing import Dict, Set, List from urllib.parse import urlparse import csv import nomad import io import os import re import requests from django.conf import settings from django.core.exceptions import ImproperlyConfigured from retrying import retry import hashlib from functools import partial # Found: http://d...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # <NAME> # # Create a table containing GWAS Catalog summary statistic metadata # import sys import os import pandas as pd import re import pickle import json def main(): # Args gcs_input_paths = 'configs/gwascatalog_inputs/ftp_paths.txt' in_study_info = 'c...
""" Neural network fitted to DFM-simulations: Backend. The neural network's frontend is in 'neural_network.py'. Author: <NAME> """ import numpy as np import pandas as pd import logging import torch as torch from sklearn.model_selection import train_test_split from utils.files_dirs import DirConfig from utils.data_co...
#!/usr/bin/python3 """color-icon-matrix barcode Usage: ./cimbar.py <IMAGES>... --output=<filename> [--dark | --light] [--colorbits=<0-3>] [--deskew=<0-2>] [--ecc=<0-150>] [--fountain] [--preprocess=<0,1>] [--color-correct] ./cimbar.py --encode (<src_data> | --src_data=<filename>) (<output...
import argparse import git import json import math import numpy as np import os import time import torch from copy import deepcopy from tqdm import tqdm from torch import optim from torch.utils.tensorboard import SummaryWriter from network import CameraBranch from suncg import get_dataloader, get_dataloader_benchmark...
from collections import defaultdict import logging import numpy as np import pandas as pd from config import paths from descr import dihedrals, contacts, hbonds, params from pdb_component import pdb_interface import traceback import os def calculate_single_tolerant(pdb_id, cid, seq_marker): seq_marker = int(seq_...
import numpy as np import sys from .config import * from util.nlp_utils import get_synonyms, get_antonyms, get_semantic_related_words # get_all_word_forms from common.constants import NLP, INFO_QUESTION_TYPES, BOOL_QUESTION_TYPES, Q_TYPE2ID_DICT from .content_separator import separate_content_function_words def get_...
# @Author: newyinbao # @Date: 2019-09-25 22:31:27 # @Function: # @TODO: # @Last Modified by: newyinbao # @Last Modified time: 2019-09-25 22:31:27 """ Retrain the tiny YOLO model for your own dataset. you can chenge the backbone network with the networks defined in yolo3.model . """ import numpy as np import keras...
import torch import torch.nn as nn import numpy as np import random import time import os from sklearn.model_selection import train_test_split from utils import device, AverageMeter, dir_path, write_log, \ sensor_imag_data_loader, accuracy from models.PHRNN import PHRNN os.chdir('//') # set seed, make result rep...
#!/usr/bin/env python3 import boto3 import botocore import json import datetime import logging import asyncio from enum import Enum, unique, auto from stacklift.templates_config import StackDesiredState # logging.basicConfig(format="[%(levelname)s][%(name)s] %(message)s") logging.basicConfig(format="[%(name)s] %(mes...
#class to store user Data class User: #Default User Details defautlDetail={"admin":["admin",True],"vignesh":["Admin@123",False],"akash":["password",False]} def __init__(self): print("[Message] : User class constructor") self.userData={} for i in User.defautlDetail.keys(): self.userData[i]={"password":hash(...
#!/usr/bin/python3 from defusedxml.ElementTree import parse as parse_xml import sys import os.path import copy import json kanjivg_ns = "{http://kanjivg.tagaini.net}" settings = { 'display': ['ja_on', 'ja_kun', 'meaning', 'remaining_strokes'], 'lookahead': 10, } def transform_stroke_type(s): # Possible s...
from instagram_scraper import InstagramScraper as _InstagramScraper import json import tqdm from instagram_scraper.constants import USER_URL, USER_INFO, STORIES_UA from tempfile import gettempdir from collections.abc import Iterable class Instagram: def __init__(self, guest=True, verbose=False, comments=False, **...
#!/usr/bin/env python3 """module to listen for BLE aderts from Xiaomi Mijia thermometers running custom firstmare and post to Influx or mqtt""" import sys import os import time import logging import threading import signal import json from dataclasses import dataclass, asdict from collections import deque im...
#!/usr/bin/env python3 from itertools import cycle, islice, dropwhile import numpy as np import json import argparse parser = argparse.ArgumentParser(description="create transfer plan.") parser.add_argument("mode", type=str, help="scatter, gather or all2all") parser.add_argument("-m","--main_gpu", type=int, default=0...
#!/usr/bin/python #-*- encoding: utf8 -*- import random import json import threading import rospy from std_msgs.msg import String from geometry_msgs.msg import PointStamped from mind_msgs.msg import RaisingEvents, GazeCommand from mind_msgs.srv import ReadData, ReadDataRequest GAZE_CONTROLLER_PERIOD = 0.2 GLANCE_TI...
import asyncio import weakref import functools import logging from threading import Thread from concurrent.futures import Executor from time import clock from abc import ABCMeta from pymongo.collection import UpdateResult log = logging.getLogger(__name__) class MongoReflectionError(Exception): pass class Syn...