text
stringlengths
6.04k
39.5k
#!/usr/bin/env python from bs4 import BeautifulSoup import codecs from collections import defaultdict, OrderedDict import copy import glob from le_utils.constants import licenses, content_kinds, file_formats import hashlib import json import logging import ntpath import os from pathlib import Path import re import req...
import numpy as np import time from scipy.special import gammaln, psi eps = 1e-100 class Corpus: def __init__(self, vocab, word_ids, word_cnt, n_topic): self.vocab = np.array(vocab) self.word_ids = word_ids self.word_cnt = word_cnt self.n_topic = n_topic # num topics self...
# ##### BEGIN MIT LICENSE BLOCK ##### # # Copyright <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 us...
import datetime import logging import mimetypes import uuid from datetime import date from io import BytesIO from typing import List, Optional, Union from django.utils import timezone import pytz from furl import furl from drc_cmis.mixins import RearrangeFilesOnDeleteMixin from drc_cmis.utils.mapper import ( DOC...
"""This module contains functions to parse a list of Tokens into an AST. All parsing-methods take a Tokenizer as Argument and return an AST-node if they can parse the token-sequence that is obtainable by tokenizer.next() or None if it isn't. If the parsing-function is sure that it 'should' be able to parse the token-s...
"""Owner module""" import discord import sys import os import traceback from discord.ext import commands from modules.utils import checks from modules.utils import utils import textwrap import inspect import asyncio import io from contextlib import redirect_stdout import requests from os import listdir ...
import frida import time import os import sys import optparse import threading import codecs import shutil import tempfile import subprocess import re import fnmatch import shlex import psutil import paramiko from paramiko import SSHClient from scp import SCPClient from tqdm import tqdm import traceback from utils.lis...
# -*- coding: utf-8 -*- """ :author: <NAME> (李辉) :url: http://greyli.com :copyright: © 2018 <NAME> :license: MIT, see LICENSE for more details. """ import ast import os import sys import click from flask import Flask, request, jsonify from flask import redirect, url_for, abort, render_template, flash f...
# functions in this file can be run under any environment. # this essentially means no pandas import time import subprocess import dateutil import mwapi from sortedcontainers import SortedDict import sys import datetime import git import re import os import pickle import fire import json from project_settings import * ...
import random def addition(a, b): return a + b def soustraction(a, b): return a - b def multiplication(a, b): return a * b def division(a, b): if b == 0: print("ERREUR - Division par 0") else: return a / b def is_prime(nb): print(nb) if nb <= 3: return nb > ...
# coding=utf-8 from fit.messages import Message from fit.types.array import Array from fit.types.composite import Composite, ComponentField from fit.types.dynamic import Dynamic, SubField from fit.types.general import UInt32Z, UInt16, UInt32, UInt8, SInt16, SInt8, \ String, Byte, UInt8Z, UInt16Z, SInt32 from fit.ty...
import numpy as np import glob import matplotlib.pyplot as plt import cv2 import pickle import matplotlib.image as mpimg ### Global business with open('wide_dist_pickle.p', mode='rb') as f: dist_pickle = pickle.load(f) dist = dist_pickle["dist"] mtx = dist_pickle["mtx"] straight_line_img = cv2.imread('t...
#!/usr/bin/env python3 # Copyright (c) 2014-2020 <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,...
#!/usr/bin/env python # -*- coding: utf8 -*- import re import argparse from random import shuffle from .amr_utils import write_to_file from .var_free_amrs import delete_wiki, delete_amr_variables, single_line_convert '''Script that augments the data to get the best AMR permutation based on word order INPUT SHOULD...
import numpy as np import torch import torch.nn as nn import time from collections import OrderedDict from BuildModelResidual import CreateNetworkResidual import torch.nn.functional as F from torch.autograd import Variable from torch.utils.model_zoo import load_url as load_state_dict_from_url from sklearn.me...
from rdkit.Chem import rdmolfiles, rdmolops from rdkit import Chem import dgl from scipy.spatial import distance_matrix import numpy as np import torch from dgllife.utils import BaseAtomFeaturizer, atom_type_one_hot, atom_degree_one_hot, atom_total_num_H_one_hot, \ atom_implicit_valence_one_hot, atom_is_aromatic, C...
import datetime import decimal import enum import logging from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar, Union import attr from justobjects import transforms, typings, validation logger = logging.getLogger(__name__) SchemaDataType = typings.Literal[ "null", "array", "boolean", "object", ...
from __future__ import print_function import os import random import warnings warnings.simplefilter("ignore") import argparse import cv2 import numpy as np import torch import segmentation_models_pytorch as smp import matplotlib.pyplot as plt import albumentations as albu from torch.utils.data import DataLoader impo...
# -*- coding: utf-8 -*- """ Created on Tue Dec 14 07:48:19 2021 @author: <NAME> """ import pandas as pd import numpy as np # Helper functions from preprocessing import process_text, convert_to_int, lda_preprocess from genre_processing import clean_genre, group_genre from pprint import pprint # BERTopic from sentence...
import geopandas import pandas as pd import xarray as xr import dataimports.waterboundary as wbd from shapely.geometry import Polygon def aggregateprocessedfiles(directory: str, years: range) -> pd.DataFrame: ''' Generates a new dataframe in the form: index 1 2 ... n-1 n <year ...
import os import json import torch import torch.utils.data import torchvision import torchvision.transforms as transforms import h5py import numpy as np import pandas as pd from PIL import Image def get_loader(dataset, batch_size, num_workers=1, shuffle=True): return torch.utils.data.DataLoader( datase...
import random import time import socket import threading import numpy as np import sys # constants p_amb = 101325 # Pa R = 8.314 # m^3 Pa/K/mol nitrogen_molar_mass = 0.028 # kg/mol air_molar_mass = 0.03 # kg/mol def rand(): """ Most of the time we want something evenly distributed about 0. This returns [...
# coding=utf8 """ REST Module Provides interfaces for creating and maintaining REST servers """ __author__ = "<NAME>" __copyright__ = "OuroborosCoding" __version__ = "1.0.0" __email__ = "<EMAIL>" __created__ = "2018-11-11" # Python imports import re import sys import traceback # Pip imports import bottle # Framewo...
# -*- coding: utf-8 -*- # Copyright (c) 2014, 2015 Metaswitch Networks # 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/licen...
import os import json from elasticsearch_dsl import Q from natsort import natsorted import re import stat import subprocess import tempfile from collections import OrderedDict, defaultdict from pathlib import Path from zipfile import ZipFile from django.views.decorators.csrf import csrf_exempt from django.contrib.sta...
''' Detects small RNA peaks with annotated data. ''' from collections import defaultdict from Bio.Alphabet import IUPAC from Bio.Seq import Seq import argparse import ConfigParser import itertools import numpy import os import pysam import re import subprocess import sys def add_strands(beds, bam): ''' Adds ...
""" Hand Tracker on Depth Image based on https://www.learnopencv.com/object-tracking-using-opencv-cpp-python/ """ import os import PIL import glob import numpy as np from matplotlib import pyplot as plt import cv2 import json import configparser import csv DATASET_BASE_DIR_NAME = r"D:\git\HandPointer\dataset" def ...
from torchvision import models import torch.nn.utils.spectral_norm as spectral_norm import torchvision from torch import nn import torch import torch.nn.functional as F class ResBlocks(nn.Module): def __init__(self, num_blocks, dim, norm='in', activation='relu', pad_type='zero'): super(ResBlocks, self).__i...
import torch import numpy as np import matplotlib as mpl import matplotlib.pyplot as pl import scipy.signal as sg from scipy.ndimage import gaussian_filter1d import json import re import os #import copy from masking import * from latencies import * from excitation import * from deconv import * from ur import * f...
import json import os import re import numpy as np from sklearn.metrics import fbeta_score from util import metrics from util import keras_util from util import model_statistics from util import path def get_epoch_cv(): with open(path.EPOCH_CV, "r") as f: return json.load(f) def get_...
"""Sparse Autoencoder """ # Author: <NAME> <<EMAIL>> # Licence: BSD 3 clause import numpy as np from scipy.optimize import fmin_l_bfgs_b from scipy.linalg import norm from itertools import cycle from sklearn.utils import check_X_y,check_array from sklearn.utils import check_random_state from sklearn.utils import gen...
# for training: training/steering-model-training.ipynb try: import vrep except: print('--------------------------------------------------------------') print('"vrep.py" could not be imported. This means very probably that') print('either "vrep.py" or the remoteApi library could not be found.') prin...
import json import os import re import time import shutil from collections import namedtuple from synchronize import synchronized try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse from topics import FormattedFile, GitProject, Pattern, \ RaiseExceptionIfOptionMissed, SubC...
#!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2020/6/10 10:04 # @Author : mantch # @Version:V 1.0 # @desc : https://github.com/NLP-LOVE/Model_Log from flask import Flask, request, jsonify, redirect, session from flask import render_template import webbrowser import argparse import signal import sys import os...
# -*- coding: utf-8 -*- # Copyright (C) 2013-2018 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************# # This module is part of the package MOM.DBW.SAW. # # This module is licensed under the terms of the BSD 3-C...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Test components of specific crowdsourcing tasks. """ import glob import json import os import threading import unitt...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ run_controls.py ... -<NAME> 03-06-2017 """ import os import random import re import sys from ctypes import c_bool, c_double from multiprocessing import Lock, Queue, Value parentdir = os.path.split(os.path.abspath(sys.path[0]))[0] if parentdir.endswith('colr'...
from flask import abort, request, jsonify from werkzeug.exceptions import HTTPException from .web import app from . import crypto from . import model from . import db from . import utils from . import config from . import http from . import filtration import os import time import re # Legacy endpoints, to eventually ...
import os, sys from os.path import join, dirname, basename, exists import shutil import bpy from mathutils import Matrix, Vector from PIL import Image from math import radians, sin, cos import numpy as np import random import json cur_dir = dirname(os.path.abspath(__file__)) sys.path.append(cur_dir) from image_utils i...
import pandas as pd from matplotlib import pyplot as plt import os import numpy as np def process_df(train_df, val_df, test_df, params): loss_metrics = [] acc_metrics = [] for group_idx in range(params['n_groups']): loss_metrics.append(f'avg_loss_group:{group_idx}') acc_metrics.append(f'av...
from iguanas.metrics import FScore, AlertsPerDay import iguanas.utils as utils import pytest import numpy as np import pandas as pd import databricks.koalas as ks from sklearn.metrics import fbeta_score, precision_score, recall_score import string @pytest.fixture def create_data(): np.random.seed(0) y_preds =...
import sys import numpy as np import h5py import cv2 from tqdm import tqdm #### # list of utility functions # 0. I/O util # 1. binary pred -> instance seg # 2. instance seg + pred heatmap -> instance score # 3. instance seg -> bbox # 4. instance seg + gt seg + instance score -> sorted match result # 0. I/O def seg2im...
from datetime import date, datetime from decimal import Decimal from typing import List, Dict, TypeVar, Any, Tuple import sqlalchemy.engine from cerberus import Validator from sqlalchemy import CheckConstraint, Table, PrimaryKeyConstraint, ForeignKeyConstraint, UniqueConstraint, Index, \ text from sqlalchemy.exc i...
""" Python 3 Object-Oriented Programming Case Study Chapter 5, When to Use Object-Oriented Programming """ from __future__ import annotations import collections import csv import datetime import enum from math import isclose from pathlib import Path from typing import ( cast, Any, Optional, Union, ...
#! /usr/bin/python #-*- coding: utf-8 -*- ## How to run: ## 1. make a folder and place the script in the folder ## 2. run pipreqs to create the requirements file; if not installed, use ## $> pip install pipreqs ## $> pipreqs . ## $> pip install -r requirements.txt ## 3. Run the script from __future__ import ...
# -*- coding: utf-8 -*- """Saraga Dataset Loader This repository contains time aligned melody, rhythm and structural annotations for two large open corpora of Indian Art Music (Carnatic and Hindustani music). The repository contains the following manual annotations referring to audio files: Section and tempo annotat...
""" Read bam files""" from __future__ import print_function # from memory_profiler import profile import os.path as op import os import pysam from collections import defaultdict import pybedtools from mirtop.libs import do from mirtop.libs.utils import file_exists import mirtop.libs.logger as mylog from mirtop.mirna...
#!/usr/bin/env python # Classifier using HuggingFace Transformer (by Albert) import importlib import pandas as pd import logging import datetime import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score import torch import os import sys import glob from tqdm impo...
# -*- coding: utf-8 -*- """ Class for reading data from a Neurodata Without Borders (NWB) dataset Depends on: h5py, nwb, dateutil Supported: Read, Write Author: <NAME>, CNRS """ from __future__ import absolute_import from __future__ import division from itertools import chain import shutil import tempfile from dat...
# Author: <NAME> # Date: 04/25/2019 # Git-Hub: Data-is-Life from bs4 import BeautifulSoup import gc from numpy import where from numpy import mean as NpM from pandas import to_timedelta as ToTd from pandas import to_datetime as ToDt from pandas import to_numeric as ToNm from pandas import DataFrame as DF from pandas ...
#!/usr/bin/python3 # https://github.com/Tasm-Devil/lufft-python import time import struct class UMBError(BaseException): pass class WS_UMB: """ This is a simple driver for communicating to Weatherstations made by the German company Lufft. It implements their UMB-Protocol. You just need a USB-to-R...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import cv2 import matplotlib.pyplot as plt import numpy as np import logging from ocr.utils import (default_background_threshold, grayscale_to_black_and_white, transform, show_img) from collections i...
import speech_recognition as sr import pyttsx3 import datetime import wikipedia import webbrowser import os import time import subprocess from tkinter import* from PIL import Image,ImageTk from tkinter import ttk import wolframalpha import json import requests from covid_india import states from gtts imp...
""" @Time : 201/21/19 16:15 @Author : TaylorMei @Email : <EMAIL> @Project : iccv @File : base9.py @Function: base3 + boundary """ import torch import torch.nn.functional as F from torch import nn from backbone.resnext.resnext101_regular import ResNeXt101 ###########################################...
import argparse import os import shutil import time from pathlib import Path import cv2 import torch import torch.backends.cudnn as cudnn from numpy import random import numpy as np import math from models.experimental import attempt_load from utils.datasets import LoadStreams, LoadImages from utils.general import (...
#try to support many flavours of lapack from __future__ import absolute_import from __future__ import division from __future__ import print_function import autoinstall_lib as atl from waflib import Logs import os.path as osp from waflib import Logs from waflib import Context from waflib import Errors import sys impor...
import os import re from uuid import uuid4 from zipfile import ZipFile from datetime import date from pathlib import Path from bs4 import BeautifulSoup from openpecha.core.ids import get_pecha_id from openpecha.utils import dump_yaml def create_metadata(ebook_path, opfs_path, id_): """ It parse through the ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-07-25 19:44:35 # @Author : <NAME> (<EMAIL>) # @Link : http://iridescent.ink # @Version : $1.0$ # from __future__ import print_fntion import time import torchlib as tl import torchsar as ts import torch as th from torch.nn.parameter import Parameter f...
#! pip install git+https://github.com/deepmind/pycolab.git #! pip install git+https://github.com/openai/gym.git from __future__ import absolute_import from __future__ import division from __future__ import print_function import curses import sys import gym from pycolab import ascii_art from pycolab impor...
import operator from itertools import product from itertools import accumulate import numpy as np import random import pickle import os.path from scipy.interpolate import BSpline from sklearn import linear_model from sklearn.linear_model import LinearRegression from numpy.linalg import inv from functools import re...
""" Python API functions related to writing program enrollments. Outside of this subpackage, import these functions from `lms.djangoapps.program_enrollments.api`. """ import logging from simple_history.utils import bulk_create_with_history from common.djangoapps.course_modes.models import CourseMode from common.dj...
import torchvision from PIL import Image import xml.etree.ElementTree as ET import torch import numpy as np import cv2 import random NUM_CLASS_DICT = {'voc':20,'coco':80,'kitti':3} FM_SIZE_DICT = {'voc':(48,48),'coco':(48,48),'kitti':(24,89)} #####################################shared helper functions############...
from fractions import gcd from itertools import starmap, cycle import utilities import base64 import string import hashlib # Set the output width for formatted strings row_format ="{:>30}" * 2 # Parent class for all defined ciphers class Cipher(): socket = '' def __init__(self, socket): self.socket...
""" AI components """ import inspect from json import dumps, loads from math import sqrt from random import choice, randint, random from bear_hug.bear_utilities import BearJSONException from bear_hug.ecs import Component, EntityTracker from bear_hug.event import BearEvent from plot import PlotManager def find_close...
import functools import inspect import logging import re import unicodedata from typing import TYPE_CHECKING, Any, Dict, Iterable, Union from anyascii import anyascii from django.apps import apps from django.conf import settings from django.conf.locale import LANG_INFO from django.core.exceptions import ImproperlyConf...
''' Classes for interpreting and loading metadata and files stored according to the NDNP specification. ''' import csv import logging import lxml.etree as ET import os import requests import sys import mimetypes from rdflib import Graph, Literal, Namespace, URIRef from classes import pcdm, ocr, oa from classes.exc...
# !/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Erebus, a web dashboard for tor relays. # # :copyright: (c) 2015, The Tor Project, Inc. # (c) 2015, <NAME> # (c) 2015, <NAME> # # :license: See LICENSE for licensing information. """ Log handler for both erebus and to...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import argparse import numpy as np import os from os import path import itertools from scipy.stats import entropy import collection...
""" Basin statistics (basin_stats.py) ======================================= Computes basin statistics using Google Earth Engine. """ import ee import re import json import requests import numpy as np import pandas as pd from datetime import date from collections import OrderedDict from rabpro import utils as ru ...
from typing import List from pyhcl.ir.low_ir import * from pyhcl.ir.low_prim import * from pyhcl.passes._pass import Pass, PassException, Error from pyhcl.passes.utils import ModuleGraph, to_flow, flow, create_exps, get_info, has_flip from pyhcl.passes.wir import * # ScopeView class ScopeView: def __init__(self, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Feb 26 15:43:17 2021 @author: nathanielgates """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mtick from IPython.utils.capture import capture_output #%% def set_equal_ylim(axes, ymin=np.nan, ymax=...
import tensorflow as tf import numpy as np from scipy.io import loadmat from tensorflow.examples.tutorials.mnist import input_data import copy import hashlib import errno from numpy.testing import assert_array_almost_equal def return_Obj_data(path_data): Obj_data_all = loadmat(path_data) xx = Obj_data_all['ft...
from rlkit.envs.wrappers import StackObservationEnv, RewardWrapperEnv import rlkit.torch.pytorch_util as ptu from rlkit.samplers.data_collector.step_collector import MdpStepCollector from rlkit.samplers.data_collector.path_collector import GoalConditionedPathCollector from rlkit.torch.networks import ConcatMlp from rlk...
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: <NAME> ## Tianjin University ## <EMAIL> ## Copyright (c) 2019 ## ## This source code is licensed under the MIT-style license found in the ## LICENSE file in the root directory of this source tree ##+++++++++++++++++++++++++++++++...
from __future__ import annotations from enum import IntEnum from typing import List, Optional from pykotor.common.geometry import Vector2, Vector3, Vector4 from pykotor.common.language import LocalizedString from pykotor.common.misc import Game, Color, ResRef from pykotor.resource.formats.gff import GFF, GFFStruct, G...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf import numpy as np import cv2 from tensorpack import dataflow from tensorpack.dataflow.base import RNGDataFlow, ProxyDataFlow try: import ipdb as pdb except Exception: ...
""" @Project : MachineLearningNoteBooks @Module : ml_model.py @Author : HjwGivenLyy [<EMAIL>] @Created : 1/17/19 1:43 PM @Desc : LSTM algorithm """ import time import typing from math import sqrt import matplotlib.pyplot as plt import numpy as np import pandas as pd from keras.layers import Dense, LSTM...
#!/usr/bin/python3 # -*- coding:UTF=8 -*- # ****************************************************************************** # Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. # licensed under the Mulan PSL v2. # You can use this software according to the terms and conditions of the Mulan PSL v...
import torch import torch.nn as nn import higher from uutils.torch_uu import calc_accuracy from uutils.torch_uu import preprocess_grad_loss #### #### from uutils.torch_uu.models.custom_layers import Flatten class EmptyMetaLstmOptimizer(Optimizer): def __init__(self, params, *args, **kwargs): defaults...
# -*- coding: utf-8 -*- """This module defines functions for query CATH database.""" from os import getcwd, remove from os.path import sep as pathsep from os.path import isdir, isfile, join, split, splitext, normpath import re from numbers import Integral from prody import LOGGER, SETTINGS, PY3K from prody.proteins ...
#!/usr/bin/env python import unittest import yaml import copy from api.interfaces.ordering.version1 import API as APIv1 from api.util import lowercase_all from api.util.dbconnect import db_instance import version0_testorders as testorders from api.providers.validation.validictory import BaseValidationSchema from api i...
''' Created on 11 Oct 2016 @author: <NAME> ''' # pylint: disable=missing-docstring import argparse import collections import csv import json import logging import os import re import shutil import sys import zipfile import zlib import jinja2 import msgpack import numpy import pandas import yaml import pubtransit ...
# -*- coding: utf-8 -*- """ Created on Wed Oct 15 17:00:14 2014 @author: codas """ import casadi as C import numpy as NP import scipy def obsv(A, C): # Convert input parameters to matrices (if they aren't already) amat = NP.mat(A) cmat = NP.mat(C) n = NP.shape(amat)[0] # Construct the ...
""" Flattened ResNet50 for ImageNet """ import torch.nn as nn import math __all__ = ['resnet50_flat'] class ResNet50(nn.Module): # This should be redefined by the channel count def __init__(self, num_classes=1000): super(ResNet50, self).__init__() self.conv1 = nn.Conv2d(3, 64, kernel_size=7...
#!/usr/bin/env python import pandas as pd import numpy as np import time import re import os import sys import argparse import configparser import multiprocessing from more_itertools import sliced import codes3d def produce_summary( eqtl_df, snp_df, gene_df, expression_table_fp, fdr_threshold, outpu...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding('utf-8') import bottle from bottle import route, run, app, request, redirect, abort import datetime from bson.objectid import ObjectId from socket import error as SocketError from bottle import jinja2_template as template fro...
#---------------------------------------------- #--- Author : <NAME> #--- Mail : <EMAIL> #--- Date : 27th January 2018 #---------------------------------------------- """A set of functions that are used for visualization. These functions often receive an image, perform some visualization o...
""" Provides the git clone operation """ import asyncio from launchy import Launchy import shlex import uuid import os import re from sqlalchemy import or_ from pathlib import Path from molior.model.database import Session from molior.model.sourcerepository import SourceRepository from molior.model.build import Build ...
# coding=utf-8 """ A module that can leech internet resources. It is able to get new resources since a specified :class:`datetime.datetime`. :author: Daniël <<EMAIL>> """ import datetime import logging from time import mktime import bs4 import feedparser import requests from nagg.tasks import download_youtube, do_on...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Statistical tools for time series analysis """ from __future__ import division from six.moves import range, zip import numpy as np import pandas as pd from scipy import stats from sm2.tools.tools import add_constant from sm2.compat.numpy import lstsq from sm2.regres...
from pathlib import Path from tqdm.notebook import tqdm from tqdm import trange import pickle import nltk import math import os import random import re import torch import torch.nn as nn from transformers import AdamW, get_linear_schedule_with_warmup from torch.utils.data import (DataLoader, RandomSampler, WeightedRand...
# -*- coding: utf-8 -*- import os import time import geopandas as gpd import numpy as np import pandas as pd from bokeh import io, plotting, models, embed from datetime import timedelta from glob import glob from gpxpy import parse, gpxfield from multiprocessing.pool import ThreadPool from shapely.geometry import Lin...
#!/usr/bin/python # # Functions for x843 encoded objects # # @author <NAME> # @email <EMAIL> # from __future__ import unicode_literals, division, absolute_import, print_function import datetime, sys if sys.version_info < (3,): from urllib import quote as urlquote from urllib2 import ( Request as URLReq...
# $Id$ # # Copyright (C) 2001-2006 <NAME> and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """Cluster tree visualizatio...
from __future__ import division, print_function from abc import ABC, abstractmethod import random from scipy.stats import ks_2samp, anderson_ksamp, mannwhitneyu, energy_distance from scipy.signal import argrelmax from scipy.signal import wiener from scipy.optimize import minimize from astropy import units as...
# -*- coding: utf-8 -*- import os from glob import glob import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline from PyMca5.PyMca import ArraySave from PyMca5.PyMcaCore import XiaEdf from ..io.spec import spec from ..xrf.parse_xia import parse_xia_esrf from ..xrf.fit import PerformFit as fitter ...
# -*- python-indent: 4 -*- """A few things that didn't seem to fit anywhere else.""" import os import os.path import pwd import tempfile import fcntl import errno import threading import subprocess import shutil import sys import signal import logger PID_FILE = '/var/run/nodemanager.pid' #################### def...
""" IDA Pro plugin that emulates WebAssembly instructions and shows their effects. Usage: 1. Select a sequence of instructions in the disassembly view. 2. Run this script. 3. Review the output view. You'll see results like this: globals: $frame_stack: ($frame_stack - 0x40) locals: $l...
"""This file contains code used in "Think DSP", by <NAME>, available from greenteapress.com Copyright 2013 <NAME> License: MIT License (https://opensource.org/licenses/MIT) """ import copy import math import numpy as np import random import scipy import scipy.stats import scipy.fftpack import subprocess import warni...
# Geographic geometry utility functions # I tested geo-py but precision was inferior(?). # I'd love to user pyturf but it does not have all function I need # and it loads heavy packages. # So I made the functions I need. # import math import json # Geology constants R = 6371000 # Radius of third rock from t...