text stringlengths 8.04k 46.5k |
|---|
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Source overlap tools.
"""
from __future__ import print_function, division
import json
import os
import logging
import numpy as np
from numpy import exp, pi, log, sqrt
from astropy.extern.configobj import configobj
from astropy.io import fits, ascii
from... |
import uuid
from datetime import * #import everything from datetime
'''
Customer class is used to assign values to the values for the specified object created of type
cutomer as well as account because account is the child of customer class
'''
#customer class to store customer details
class Customer(obj... |
import argparse
import concurrent.futures
import copy
import ipaddress
import os
import subprocess
import sys
from datetime import datetime
import json
from json import JSONEncoder
import logging
import traceback
import icmplib
import requests
class Bucket:
def __init__(self, id):
self.id = id
se... |
import hashlib
import logging
from rdflib import URIRef, BNode, Literal, ConjunctiveGraph, Graph, Namespace
from rdflib.namespace import RDF, RDFS, XSD, DC, DCTERMS, FOAF, SKOS
from rdflib.plugins.memory import IOMemory
from rdflib.plugins.sparql import prepareQuery
import stix2
from taxii2client.v20 import Server, Col... |
"""
Various tools for interacting with opendap thredds datasets
<NAME>
Stanford University
October 2014
"""
import os
import time
import collections
import numpy as np
from netCDF4 import Dataset, MFDataset, date2num, date2index
from cftime import num2pydate
from datetime import datetime
from sfoda.utils import other... |
# Distributed under the Apache License, Version 2.0.
# See accompanying NOTICE file for details.
import os
import cv2
import json
import ntpath
import numpy as np
from scipy.spatial import cKDTree
from trailblazer.traffic.vital import Detection
from trailblazer.traffic.vital import Track
from trailblazer.traffic.vita... |
#!/usr/bin/env python
# This is the TypeLoader BLAST parser for finding the closest known allele for an input sequence
"""
This routine makes the following assumptions :
1. The sequence being queried is a full length allele
2. The closest known allele will align as a single HSP ( http://www.ncbi.nlm.nih.gov/B... |
#!/usr/bin/env python3
##############################################################################
# EVOLIFE http://evolife.telecom-paris.fr <NAME> #
# Telecom Paris 2021 www.dessalles.fr #
# ------------------------------------------------------------------------... |
"""Provides a Discord bot cog containing a collection of commands for interacting with a game server running on an AWS instance."""
import asyncio
import logging
import os
from datetime import datetime
from typing import Optional
# Third party imports
import discord
import pytz
from discord.ext import commands, tasks
... |
# External Dependencies
from __future__ import division
from math import sqrt
from numpy import poly1d
from warnings import warn
import os
from svgpathtools import (Path, Line, polyroots, real,
imag, disvg, wsvg)
from svgpathtools.misctools import isclose
poly_imag_part = imag
poly_real_part =... |
import os
import pickle
import time
import numpy as onp
from jax.config import config
config.update("jax_enable_x64", True)
from jax import numpy as np
import matplotlib
matplotlib.use('svg')
from matplotlib import pyplot as plt
import exputils
from kernels import *
from iv import kiv, kiv_hps_selection, krr, bootst... |
import time
import numpy as np
import scipy.sparse as ssp
from .solver import Solver
from .conjugateGradient import cg
from .stack3DHelper import crosscorrelateStacks, getSubstack, findLocalDisplacement
class timeit:
def __init__(self, name):
self.name = name
def __enter__(self):
... |
# import the nessecary pieces from Flask
import sqlite3
from flask import current_app, g
from flask import Flask,render_template, request,jsonify,Response, flash, redirect
from flask import send_file, send_from_directory
import os
import csv
import json
from keras import backend as K
import gzip
from images import imag... |
# coding: utf-8
# ## Import Packages
# In[1]:
#importing some useful packages
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import glob
get_ipython().run_line_magic('matplotlib', 'inline')
# ## Calibrate Camera
# In[2]:
# Make a list of camera calibration image... |
## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) <NAME> <<EMAIL>>
## This program is published under a GPLv2 license
"""
DNS: Domain Name System.
"""
import socket,struct
from scapy.packet import *
from scapy.fields import *
from scapy.ansmachine import... |
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
import os
from nipype.interfaces.base import (CommandLineI... |
from __future__ import unicode_literals
import functools
import json
import logging
import copy
import warnings
import re
from moto.autoscaling import models as autoscaling_models
from moto.awslambda import models as lambda_models
from moto.batch import models as batch_models
from moto.cloudwatch import models as clou... |
import numpy as np
import pandas as pd
import hnswlib
from scipy.sparse import csr_matrix
import igraph as ig
import leidenalg
import time
class PARC:
def __init__(self, data, true_label=None, dist_std_local = 2,jac_std_global='median', keep_all_local_dist = 'auto',too_big_factor = 0.4, small_pop = 10, jac_weig... |
# Copyright 2017 Red Hat, 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... |
#!/usr/bin/env python
"""
Creates pdb data files from lammps data files, given a template pdb file.
"""
from __future__ import print_function
import copy
import re
import sys
import argparse
import numpy as np
try:
# noinspection PyCompatibility
from ConfigParser import ConfigParser
except ImportError:
# n... |
from __future__ import annotations
import networkx
import threading
import pickle
import json
import re
from cklib.logging import log
from cklib.baseresources import GraphRoot, Cloud, BaseResource
from cklib.utils import json_default, get_resource_attributes
from cklib.args import ArgumentParser
from cklib.graph.export... |
"""
Key functions for the ADFQ algorithms
posterior_numeric_exact
posterior_numeric
posterior_adfq
posterior_adfq_v2
"""
import numpy as np
from scipy.stats import norm
from scipy.special import logsumexp
import pdb
REW_VAR_0 = 1e-3
DTYPE = np.float64
def posterior_numeric_exact(n_means, n_vars, c_mean, c_var, rewa... |
"""Core views, including the main homepage, post-commit build hook,
documentation and header rendering, and server errors.
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404, ... |
import os
import os.path
import sys
import re
import glob
import string
import subprocess
from compat import iteritems, isbasestring, decode_utf8
def add_source_files(self, sources, files, warn_duplicates=True):
# Convert string to list of absolute paths (including expanding wildcard)
if isbasestring(files):
... |
import copy
import re
from collections import defaultdict, namedtuple
from collections.abc import Mapping
from itertools import chain
from typing import Any, Dict, List, NamedTuple, Optional, Tuple, Union
import torch
from torch import Tensor
from torch_sparse import SparseTensor
from torch_geometric.data.data import... |
import copy
import random
import warnings
import torch
import cv2
import numpy as np
from gym.spaces import Box, Dict
import rlkit.torch.pytorch_util as ptu
from multiworld.core.multitask_env import MultitaskEnv
from multiworld.envs.env_util import get_stat_in_paths, create_stats_ordered_dict
from rlkit.envs.wrappers... |
"""This file handles variable types, function signatures and struct layouts
based on a C AST. Based on the pycparser library."""
import copy
import functools
import hashlib
import pickle
import re
from collections import defaultdict
from dataclasses import dataclass, field
from pathlib import Path
from typing import (... |
import asyncio
import copy
import os
import random
import textwrap
import pytest
import sys
import uuid
from _pytest.python import Function
from spacy import Language
from rasa.engine.graph import ExecutionContext, GraphSchema
from rasa.engine.storage.local_model_storage import LocalModelStorage
from rasa.engine.sto... |
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import logging
import os
import unittest
import warnings
from abc import ABC, ABCMeta, abstractmethod
from collections import defaultdict
from contextlib import contextman... |
import torch
import torch.optim as optim
import os
import csv
from utils import AdvAttack, get_lp_loss, my_cauchy
from tqdm import tqdm
from zonotope import clamp_image, HybridZonotope
from tabulate import tabulate
from layers import Entropy
def test(device, args, cnet, test_loader, layers, stats=None, ind_class=Fals... |
import itertools
import heapq
import collections
import operator
from functools import partial
from random import Random
from toolz.compatibility import (map, filterfalse, zip, zip_longest, iteritems,
filter)
from toolz.utils import no_default
__all__ = ('remove', 'accumulate', 'group... |
#
# SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Miscellaneous utility functions of the Sionna package."""
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.layers import L... |
"""Contains the drivers and interface code for pinball machines which use the Multimorphic P3-ROC hardware controllers.
Much of this code is from the P-ROC drivers section of the pyprocgame project,
written by <NAME> and <NAME>. It was originally released under
the MIT license and is released here under the MIT Licens... |
import asyncio
import collections
import logging
import random
from itertools import chain
from kafka.protocol.fetch import FetchRequest
from kafka.protocol.message import PartialMessage
from kafka.protocol.offset import OffsetRequest, OffsetResetStrategy
import aiokafka.errors as Errors
from aiokafka import ensure_f... |
"""
detrend.py - <NAME> (<EMAIL>) - Jul 2019, Nov 2020
Contents:
Very useful:
detrend_flux: a wrapper to wotan pspline or biweight detrending (given
vectors of time and flux).
PCA / "shared systematic trend" detrending:
detrend_systematics: removes systematic trends, by wrapping prepare_pca,
... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2010 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... |
"""Conversion tool from EDF+,BDF to FIF
"""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os
import calendar
import datetime
import re
import warnings
from math import ceil, floor
import numpy as np
from ...utils import verbose, logger
from ..base import _BaseRaw, _chec... |
#
# Copyright (c) 2018 Two Sigma Open Source, LLC
#
# 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, m... |
import datetime
import unittest
import unittest.mock
from unittest.mock import patch
from entry_changer import EntryChanger # noqa
from database_intermediary import DatabaseIntermediary
import database_work_log # noqa
class EntryChangeMock():
""" Mock for EntryChanger."""
def test_date(self, *args, **kwargs... |
"""
Support for actions and tasks.
Actions have a beginning and an eventual end, and can be nested. Tasks are
top-level actions.
"""
from __future__ import unicode_literals, absolute_import
import threading
from uuid import uuid4
from itertools import count
from contextlib import contextmanager
from warnings import ... |
import struct
import sys
import capstone as cs
from typing import Any, BinaryIO, List, Optional, Set, TextIO, Tuple
from elf_file import ElfFile, ElfSection, ElfSymbol
# Based on `doldisasm.py` from camthesaxman:
# https://gist.github.com/camthesaxman/a36f610dbf4cc53a874322ef146c4123
# Minimal stubs for Capstone
# f... |
import struct
import itertools
import envi
import envi.exc as e_exc
import envi.bits as e_bits
import envi.common as e_common
import envi.memory as e_memory
import visgraph.pathcore as vg_path
import vivisect.exc as v_exc
from vivisect.const import *
import logging
logger = logging.getLogger(__name__)
# Pre-initi... |
# Copyright 2017 Calico 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, ... |
# pylint:disable-msg=E0611,I1101
"""
Module bundling all functions needed to extract the text in a webpage.
"""
## This file is available from https://github.com/adbar/trafilatura
## under GNU GPL v3 license
# standard
import logging
import re # import regex as re
from copy import deepcopy
from lxml import etree, ... |
#!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
#!/usr/bin/env python
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Description: Transforms a remote host for which you have ad... |
import numpy as np
import cv2
import gopro_calib as calib
from copy import deepcopy
# import matplotlib.pyplot as plt
# from mpl_toolkits.mplot3d import Axes3D
# from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# https://stackoverflow.com/questions/12299870/computing... |
from datetime import date
from datetime import datetime
from datetime import timedelta as delta
import sys
import numpy as np
import xarray as xr
from parcels.grid import GridCode
from parcels.kernel import Kernel
from parcels.particle import JITParticle
from parcels.particlefile import ParticleFile
from parcels.tool... |
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
# coding=utf-8
from terminaltables import AsciiTable
import numpy as np
from random import randint
from mygrid.rnp import Arvore, Aresta
from mygrid.util import Fasor, Base
class Setor(Arvore):
def __init__(self, nome, vizinhos, nos_de_carga, prioridade=0):
assert isinstance(nome, str), 'O parâmetro nome ... |
"""Various i18n functions.
Helper functions for both the internal localization system and for
TranslateWiki-based translations.
By default messages are assumed to reside in a package called
'scripts.i18n'. In pywikibot 3+, that package is not packaged with
pywikibot, and pywikibot 3+ does not have a hard dependency o... |
from __future__ import nested_scopes
import fnmatch
import os.path
from _pydev_runfiles.pydev_runfiles_coverage import start_coverage_support
from _pydevd_bundle.pydevd_constants import * # @UnusedWildImport
import re
import time
#=====================================================================================... |
import glob
import os
import numpy as np
from unyt import dimensions, unyt_array
from unyt.unit_registry import UnitRegistry
from yt.data_objects.time_series import DatasetSeries, SimulationTimeSeries
from yt.funcs import only_on_root
from yt.loaders import load
from yt.utilities.cosmology import Cosmology
from yt.ut... |
# -*- encoding: utf-8 -*-
"""Test unicode/str's format method"""
class BaseStringFormatTests:
"""Test format and __format__ methods of string objects."""
def test_escape(self):
assert self.s("{{").format() == self.s("{")
assert self.s("}}").format() == self.s("}")
assert self.s("{} {{... |
import requests
import jwt
import gzip
import platform
import hashlib
from collections import defaultdict
from pathlib import Path
from datetime import datetime, timedelta
import time
import json
from typing import List
from enum import Enum, auto
from .resources import *
from .__version__ import __version__ as versio... |
#! /usr/bin/env python
"""
Script for finding optimal static mesh refinement grid in spherical coordinates.
Requires matplotlib if output other than "show" is specified. Requires scipy if
r_ratio is not specified.
"""
# Python standard modules
import argparse
import math
# Other Python modules
import numpy as np
... |
import copy
import json
import logging
import ldap
import random
import string
from collections import OrderedDict
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import get_user_model, login, logout, authenticate
from django.contrib.auth.decorators import login_required
f... |
'''
File name: Isonet_star_app.py
Author: <NAME> (EICN)
Date created: 4/21/2021
Date last modified: 06/01/2021
Python Version: 3.6.5
'''
import sys,os
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QTableWidgetItem,QMessageBox
from PyQt5.QtCore import QObject, pyq... |
import os, sys, warnings, time, copy
import pandas as pd, numpy as np
from collections import OrderedDict
from datetime import datetime, timedelta, timezone
from sklearn.preprocessing import LabelEncoder
from sklearn.ensemble import RandomForestRegressor
from bokeh import layouts
from bokeh.io import output_file, outp... |
from __future__ import annotations
import os
import sys
import click
import datetime
import shutil
import json
import traceback
from contextlib import AbstractContextManager
from typing import Optional
from ufotest.config import Config, get_path, get_builds_path
from ufotest.exceptions import raise_if, IncompleteBuild... |
# -*- coding: utf-8 -*-
'''
Directives that define automatically assessed questionnaires.
'''
import html
from docutils import nodes
from docutils.parsers.rst import Directive, directives
from sphinx.errors import SphinxError
from sphinx.util import logging
from sphinx.util.nodes import nested_parse_with_titles
impor... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\outfits\outfit_change.py
# Compiled at: 2019-03-20 20:43:05
# Size of source mod 2**32: 39442 b... |
# -*- coding: utf-8 -*-
""" S3 Organizer (Calendar-based CRUD)
@copyright: 2018-2021 (c) Sahana Software Foundation
@license: MIT
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 Softw... |
import requests
import re
import json
import ast
import os
import ui
import threading
import tarfile
import math
import time
import plistlib
import console
import shutil
import sqlite3
import base64
import clipboard
import os
import Image
import io
import copy
import yaml
from Managers import DBManager, TypeManager
fro... |
# lilypondpngvideogenerator -- processes lilypond file, scans postscript
# file for page boundaries, analyzes tempo
# track and generates MP4 video and
# subtitle file
#
# author: Dr. <NAME>, 2006 - 2017
#====================
# IMPO... |
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... |
import dragonfly as df
import constants
class Item:
def __init__(self, name: str, commands=None):
self.name = name
if commands is None:
self.commands = self.commands_from_name(name)
else:
self.commands = commands
def commands_from_name(self, name: str):
... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 12 10:31:02 2020
@author: mazal
"""
"""
=========================================
Support functions of imageio
=========================================
Purpose: Create support functions for the pydicom project.
"""
"""
Test mode 1 | Basics
testMode = ... |
#!/usr/bin/env python3
# coding=utf-8
"""
Mreleaser __init__.py Module
"""
from __future__ import annotations
__all__ = (
"AnyPath",
"ExcType",
"TemporaryFileType",
"CmdError",
"Env",
"Git",
"Path",
"Releaser",
"TempDir",
"aiocmd",
"cli_invoke",
"cmd",
"suppress",
... |
import numpy as np
import nitrogen.dfun as dfun
import nitrogen.autodiff.forward as adf
__all__ = ["CoordSys", "CoordTrans", "CompositeCoordTrans",
"QTransCoordSys"]
class CoordSys(dfun.DFun):
"""
A generic coordinate system base class, which
extends the dfun.DFun generic differentiable
fun... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
from __future__ import print_function
import ast
import os
import string
import time
import unicodedata
from contextlib import contextmanager
from pprint import pformat
from subprocess import (STDOUT, CalledProcessError, call, check_call,
check_output)
from threading import Lock
from typing imp... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import erpnext
from frappe import _
from frappe.model.document import Document
from frappe.utils.data import nowdate, ge... |
"""
This module implements all the read modifications that cutadapt supports.
A modifier must be callable and typically implemented as a class with a
__call__ method.
"""
import re
from types import SimpleNamespace
from typing import Sequence, List, Tuple, Optional, Set
from abc import ABC, abstractmethod
from collecti... |
"""
Classes representing basic models for data obtained or retrieved from the SMC
ElementBase is the top level parent class that provides the instance level
cache, meta data and basic methods to model the retrieved elements.
Element is the common interface that exposes methods and a retrieval
descriptor for elements ... |
from alento_bot import StorageManager, BaseModule, user_data_transformer, universal_text, cache_transformer
from discord.ext.commands.errors import MissingRequiredArgument, BadArgument
from discord.ext import commands, tasks
from typing import Dict, Optional, Union, Set
from datetime import datetime, timedelta
import d... |
from json.decoder import JSONDecodeError
from django.contrib.auth.decorators import login_required
import json
from django.core.mail import EmailMultiAlternatives, message, send_mail
from django.core.mail import EmailMessage
from django.http.response import HttpResponse
from django.utils.html import strip_tags
from dja... |
import numpy as np
import pandas as pd
import mdtraj as md
from collections import defaultdict, Counter
from prolintpy.utils.martinilipids import martini_lipids, lipid_species, martini_headgroups
from prolintpy.utils.metrics import FUNCS, calculate_metric, residence_time
# from prolintpy.core.systemtopology impor... |
#-*-coding:utf-8-*-
import socket, threading, os, sys, time, datetime
import hashlib, platform, stat
from os.path import join, getsize
listen_ip = "0.0.0.0"
listen_port = 21
conn_list = []
root_dir = "C://Autodesk"
if sys.version_info < (3, 0):
root_dir = root_dir.decode('utf-8').encode('gb2312')#目录 windows目... |
"""Conversation objects."""
import asyncio
import datetime
import logging
from hangups import (parsers, event, user, conversation_event, exceptions,
hangouts_pb2)
logger = logging.getLogger(__name__)
CONVERSATIONS_PER_REQUEST = 100
MAX_CONVERSATION_PAGES = 100
async def build_user_conversatio... |
import re
import sys
from mako.template import Template
import functools
import shlex
if sys.version_info < (3,):
string_types = basestring # noqa
else:
string_types = str
# {{{ generation helpers
def parse_args(args):
args_re = re.compile(r"^\s*([a-z]+(?:\s*\*\s*[0-9]+)?)\s+(.*)\s*$")
array_re = ... |
"""
Author: <NAME>
Create on: 2021-10-23
This module crawls data from different sources and save them locally.
"""
from datetime import date
from functools import reduce
import json
import pandas as pd
from pytrends import dailydata
import requests
import time
import yfinance as yf
import random
# pandas setting
p... |
# -*- coding: utf-8 -*-
"""Manage the data of a field in a table."""
from pineboolib.core.utils.utils_base import aqtt
from pineboolib.core.utils import logging
from pineboolib.interfaces import IFieldMetaData
from typing import List, Optional, Union, Any, TYPE_CHECKING
from .pnrelationmetadata import PNRelationMet... |
#!/bin/python3
"""
Provide a basic spectrum analyser for digitised complex samples
## TODOs, in no particular order
* TODO: Add a seconds marker to the bottom (left) of the spectrogram
* TODO: Plugin for triggering snapshot on fft bin power, with masks
* TODO: On web interface update just the rows that cha... |
import json
import logging
import os
import re
import time
from datetime import datetime
from logging.handlers import RotatingFileHandler
from string import Template
import boto3
import yaml
from aws.utils.common.instancetype import types
from dateutil import parser
from file_read_backwards import FileReadBackwards
fr... |
# encoding: utf-8
"""
A script for running the following experiments:
* dataset: Overnight
* model: BART encoder + vanilla Transformer decoder for LF
* training: normal (CE on teacher forced target)
"""
import json
import random
import string
from copy import deepcopy, copy
from functools import partial
from typing im... |
'''Utilities used in bpmn.py.
'''
from collections import OrderedDict
from typing import Any, Generator, Mapping, List, Set, Union, Optional
import yaml
from hashlib import sha1, sha256
import re
import json
from flowlib.constants import (
BPMN_TIMER_EVENT_DEFINITION,
TIMER_DESCRIPTION,
TIMER_RECOVER_POLICY... |
"""Entity Identification Module"""
import json
import re
import pprint
import networkx as nx
import matplotlib.pyplot as plt
import pandas as pd
import plotly.graph_objects as go
from collections import defaultdict
from pathlib import Path
from typing import Dict, List, Tuple
from IPython.display import HTML, display... |
#!/usr/bin/env python3
'''
Copyright or © or Copr.
This software is a computer program whose purpose is to generate random
test case from a template file describing the data model.
This software is governed by the CeCILL-B license under French law and
abiding by the rules of distribution of free software. Y... |
#############################################################################
# Functions to read and handle phylogenetic trees
# <NAME>
#############################################################################
import os
import re
import math
import random
import itertools
import phyloacc_lib.core as PC
import mul... |
'''
Created on 22 Jan 2021
@author: thomasgumbricht
'''
# Standard library imports
import os
import subprocess
from sys import exit
from shutil import copyfile, copyfileobj
from osgeo import gdal
# Third party imports
# Package application imports
from geoimagine.params import Composition, RegionLayer, Raster... |
try:
import micropython
except ImportError:
class micropython(object):
@staticmethod
def native(func):
return func
class _TimingConst(object):
"""
Constants used to calculate the bit timing registers
If wanting to expand the bitrate calculations so it will support a
... |
# -*- coding: utf-8 -*-
"""
define/load tweet data to populate tweets and concord
"""
#import sys
#import string
#import collections
import spacy # linguistic module words to lemmas ( might not be correct explain )
import datetime
import sqlite3 as lite
from app_global import AppGlobal
#import app_global... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
pywrapbokeh, Copyright (c) 2018, <NAME>, All Rights Reserved
License: MIT License
"""
from datetime import datetime, timedelta
from bokeh.embed import components
from bokeh.layouts import layout
from bokeh.models.callbacks import CustomJS
from bokeh.models i... |
"""Utilities for working with MTF data."""
import operator
from scipy.interpolate import griddata, RegularGridInterpolator as RGI
from .mathops import engine as e
from .util import share_fig_ax
from .io import read_trioptics_mtf_vs_field, read_trioptics_mtfvfvf
class MTFvFvF(object):
"""Abstract object represen... |
# -*- coding: utf-8 -*-
"""
Validation rules defined in `the specification`_.
.. _the specification: http://facebook.github.io/graphql/June2018/#sec-Validation
"""
from collections import defaultdict
from typing import Dict, List, Set, Tuple, cast
from ..._string_utils import infer_suggestions, quoted_options_list
f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# models.plot.py
"""
Classes to generate bokeh plots
"""
# Copyright (c) 2016-2019 <NAME>
# This file is part of DVH Analytics, released under a BSD license.
# See the file LICENSE included with this distribution, also
# available at https://github.com/cutright/DVH-A... |
import json
import os
import time
from collections import deque
import numpy as np
import tensorflow as tf
from models.replay_buffer import ReplayBuffer
class RL_Model(object):
def __init__(self, config, train_simulator, test_simulator):
self.config = config
self.train_simulator = train_simulator... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.