text
stringlengths
6.04k
39.5k
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import ipaddress import threading import sys import signal import os import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn from sqlalchemy.exc ...
# coding=utf-8 # Copyright 2017 The Tensor2Tensor Authors. # # 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...
import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier # from sklearn.model_selection import train_test_split # from xgboost import XGBClassifier from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matr...
from __future__ import unicode_literals import vim import re import subprocess from functools import wraps from sys import version_info def vim_func(vim_fname_or_func=None, conv=None): '''Expose a python function to vim, optionally overriding its name.''' def wrap_func(func, vim_fname, conv): fname ...
import getpass import inspect import json import kubernetes import yaml RESOURCE_PLURAL = 'pipelines' VERSION = 'v1alpha1' GROUP = 'dataflow.argoproj.io' DEFAULT_RUNTIME = 'python3-9' GROUPS_VOLUME_NAME = 'groups' USER = getpass.getuser() def str_presenter(dumper, data): if '\n' in data or '"' in data or "'" i...
import logging import datetime as dt from dateutil.parser import parse import pytz from bs4 import BeautifulSoup as bs from pyo365.utils import OutlookWellKnowFolderNames, ApiComponent, BaseAttachments, BaseAttachment, AttachableMixin, ImportanceLevel, TrackerSet log = logging.getLogger(__name__) class Recipient: ...
#!/usr/bin/python import sys import time import numpy as np marker = 1 node = {} local_skyline = {} candidate_skyline = [] global_skyline = [] shadow_skyline = {} virtual_point = {} why_not_points = {} n_updated_flag = {} data_length = 0 t = 5 indexhelper = 1 def Insert_Local_Skyline(current_specs, current_bit): gl...
# Copyright 2022 The T5X Authors. # # 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 writ...
#!/usr/bin/env python3 import argparse import math import threading import time import os from multiprocessing import Process, Queue from typing import Any import carla # pylint: disable=import-error import numpy as np import pyopencl as cl import pyopencl.array as cl_array from lib.can import can_function import ce...
""" voltLib: Load fontFeatures objects from Microsoft VOLT ====================================================== This module is experimental and incomplete. """ import logging import re from io import StringIO from fontTools.ttLib import TTFont, TTLibError from fontTools.voltLib import ast as VAst from fontTools.vol...
from numpy import (array, zeros, arange, searchsorted, unique, cross) from numpy.linalg import norm # type: ignore from pyNastran.dev.bdf_vectorized.cards.elements.shell.shell_element import ShellElement from pyNastran.bdf.field_writer_8 import print_card_8 from pyNastran.bdf.bdf_interface.assign_...
""" TITLE: asset.py AUTHOR: <NAME> & <NAME> VERSION: 2020-08-26 DESCRIPTION: Defines the Asset and AssetList classes. Asset: Attributes: url: str, the URL to download an asset. Ex: https://ca-menlopark.civicplus.com/AgendaCenter/ViewFile/Agenda/_12082020-3549 asset_name: str, the title of an asset....
""" Copyright 2018 IBM Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
# Copyright 2018 Kyoto University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """CNN encoder.""" from distutils.util import strtobool import logging import math import numpy as np import torch import torch.nn as nn from neural_sp.models.modules.initialization import init_with_lecun_normal fr...
# Copyright 2015 The TensorFlow 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...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Copyright (c) 2020-2021, NVIDIA CORPORATION. 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 # c...
""" Visualization script. I used this to create the figures in the paper. WARNING: I haven't tested this in a while. It's possible that some later features I added break things here, but hopefully there should be easy fixes. I'm uploading this in the off chance it might help someone. If you get it to work, let me kno...
# coding=utf-8 # Copyright 2021 The HuggingFace Team. 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 requir...
import calendar import datetime import math import random import asyncio import collections from typing import Union import discord from dateutil import tz from discord.ext import commands, menus from clam.utils import colors, fuzzy from clam.utils.formats import plural from clam.utils.menus import MenuPages from cla...
import textwrap as tw import re ############################################################################### #Supporting Imports ############################################################################### import numpy as np import pandas as pd ##################################################...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * ''' IMPORTS ''' import urllib3 import requests from typing import Optional, Pattern, List # disable insecure warnings urllib3.disable_warnings() ''' GLOBALS ''' TAGS = 'tags' TLP_COLOR = 'trafficlightprotocol' DATE_FO...
# # This file is part of LUNA. # # Copyright (c) 2020 Great Scott Gadgets <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause """ Data Packet Payload (DPP) management gateware. """ import unittest from amaranth import * from usb_protocol.types import USBDirection from usb_protocol.types.superspeed import HeaderPacketT...
r"""Tests for parallel implementation of triangulations.""" import nose.tools as nt import numpy as np import os import time from cgal4py import _use_multiprocessing from cgal4py import parallel, delaunay from cgal4py.domain_decomp import GenericTree from cgal4py.tests.test_cgal4py import make_points, make_test, MyTest...
# pylint: disable=invalid-name,too-many-locals,too-many-arguments,line-too-long,no-value-for-parameter,unexpected-keyword-arg # We ignore no-value-for-parameter and unexpected-keyword-arg because of https://github.com/PyCQA/pylint/issues/3613 import typing import string import tensorflow as tf from tensorflow import k...
import numpy as np import pandas as pd from sklearn import preprocessing import matplotlib.pyplot as plt import seaborn as sns # %matplotlib inline # Set random seed np.random.seed(42) identifier_feature = ['RESTAURANT_SERIAL_NUMBER'] continuous_features = ['MEDIAN_EMPLOYEE_AGE', 'MEDIAN_EMPLOYEE_TENURE'] nominal_f...
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2013 Riverbank Computing Limited. ## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## ## This file is part of the examples of PyQt. ## ## $QT_BEGIN_LICENS...
#!/usr/bin/env python # coding: utf-8 # This is a demo, given a T-LESS image 0001.png, it could do 2D detection with RetinaNet, and do 6D pose estimation then for the box model. # To run it: python single3_test_demo.py #Prerequisite: #ckpt: under path_workspace/experiments/<experiment_name>/checkpoints_lambda250/checkp...
import contextlib import functools import operator import sys import threading import numpy import six import chainer from chainer.backends import cuda _thread_local = threading.local() @contextlib.contextmanager def get_function_check_context(f): try: default = _thread_local.current_function exce...
# This file is part of the Trezor project. # # Copyright (C) 2012-2022 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
# vim:fileencoding=utf-8:noet from __future__ import absolute_import import os import sys import logging from powerline.colorscheme import Colorscheme from powerline.lib.config import ConfigLoader from threading import Lock, Event DEFAULT_SYSTEM_CONFIG_DIR = None def find_config_file(search_paths, config_file): ...
#!/usr/bin/python # -*- coding: utf-8 -*- import datetime from flask_login import UserMixin, AnonymousUserMixin from flask import current_app, request, url_for from hashlib import md5 from werkzeug.security import generate_password_hash, check_password_hash from markdown import markdown import bleach from itsdangerous...
"""The executor module knows how to run stages. A Stage consists of a main script to run, some files, and some metadata such as a description. Stages, including metadata, are stored on disk. When a Stage is run, its .output (StageOutput) contains basic information such as STDOUT and STDERR. A DockerExecutor uses D...
import matplotlib.pyplot as plt import tensorflow as tf import numpy as np from sklearn.metrics import confusion_matrix import time from datetime import timedelta import math import os import sys # Use PrettyTensor to simplify Neural Network construction. import prettytensor as pt # lib path to load data etc. libpath ...
""" Testing Variational Quantum Circuits. """ import numpy as np import pathlib import pytest import qibo from qibo import gates, models, hamiltonians, K from qibo.tests.utils import random_state from scipy.linalg import expm REGRESSION_FOLDER = pathlib.Path(__file__).with_name("regressions") def assert_regression_f...
import argparse import logging import os import glob import random import copy import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn from torch.nn import CrossEntropyLoss, MSELoss from torch.utils.data import DataLoader, TensorDataset from transformers.modeling_albert import AlbertPreTr...
# -*- coding: utf-8 -*- # # Copyright 2015 Twitter Inc # # 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 ...
#!/usr/bin/env python3 import os import re import sys from collections import Counter from time import sleep import threading import tkinter as tk from tkinter import ttk import tkinter.font as tkFont from pykms_Format import MsgMap, unshell_message, unformat_message #------------------------------------------------...
"""Command line interface.""" from argparse import ( Action, ArgumentParser, ) from datetime import datetime from datetime import date import pandas from pandas import DataFrame from penn_chime.constants import CHANGE_DATE from penn_chime.model.parameters import Parameters, Disposition from penn_chime.model...
"""The module for detecting axes""" import traceback import math import cv2 import numpy as np from pytesseract import pytesseract as pt from sklearn.cluster import KMeans from .__settings__ import TESTING from .image_processing import CV2PIL, contrast_enhance GRAY_SCALE_LEVEL = 64 GRAY_SCALE_BINARY = 128 GRAY_RANGE =...
from typing import Callable, Dict, List, Optional, TypeVar, Union, Any from . import ( MetricaEPTSSerializer, DatafactorySerializer, MetricaEventsJsonSerializer, MetricaCsvTrackingSerializer, OptaSerializer, SportecEventSerializer, SkillCornerTrackingSerializer, SecondSpectrumSerializer...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import cStringIO import re import ipaddr from bob.forms import AutocompleteWidget from django import forms from django.forms import formsets fro...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import copy import os import os.path as op import numpy as np from ..constants import FIFF from ..open import fiff_open, _fiff_get_fid, _get_next_fna...
import glob import os from pathlib import Path import yaml from typing import Any, Dict, List, Union import warnings from .data_interface import MagicDataInterface from .self_aware_data import SelfAwareData, SelfAwareDataInterface DIRS_TO_IGNORE = ['__pycache__'] class DataDirectoryManager: config_file_name =...
""" Copyright (c) 2017 Dependable Systems Laboratory, EPFL Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,...
############################################################################## # Copyright by The HDF Group. # # All rights reserved. # # # # Th...
import os import time import sys import subprocess import argparse import re import platform from .settings import CONFIG_FILE, __version__ from . import MainWindow from . import Client, Server from gi import require_version as gi_require_version gi_require_version('Gtk', '3.0') from gi.repository import Gtk # type: i...
#!/usr/bin/env python import sys, os import numpy as np import argparse import bisect from scipy.stats import linregress from file_read_backwards import FileReadBackwards from collections import defaultdict import re SEED_LEN = 22 MIN_CLUST = 25 SAMPLE_RATE = 4000 CHUNK_LEN = 4000 #Guppy basecalled event stride and ...
## set up logging import logging, os logging.basicConfig(level=os.environ.get("LOGLEVEL","INFO")) log = logging.getLogger(__name__) import argparse, copy, copyreg, glob, multiprocessing, rasterio, shutil, subprocess, sys, types from collections import Counter from datetime import datetime from rasterio.windows import ...
# ============================================================================== # Copyright 2019-2020 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://ww...
#!/usr/bin/env python3 # Copyright 2018 Canonical Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
""" Utility functions for processing point clouds. Author: <NAME>, <NAME> Date: November 2016 """ import os import numpy as np from plyfile import PlyData, PlyElement import sys import trimesh # ---------------------------------------- # Point Cloud Sampling # ---------------------------------------- def random_sa...
#!/usr/bin/env python3 import argparse import json import os import re import sys from typing import List, Optional, Tuple HERE = os.path.dirname(__file__) ALL_PKGS = ["expconf"] URLBASE = "http://determined.ai/schemas" def camel_to_snake(name: str) -> str: """Convert CamelCase to snake_case, handling acronyms ...
"""Base class extended by connection adapters. This extends the connection.Connection class to encapsulate connection behavior but still isolate socket and low level communication. """ import abc import functools import logging import pika.compat import pika.exceptions import pika.tcp_socket_opts from pika.adapters....
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
import matplotlib.pyplot as plt import numpy as np import collections from matplotlib import animation from scipy.spatial import Delaunay from .utilities import ( sarea, segment_crossing, point_in_polygon, get_angles, in_circle, project_vector, ) class Vertex: """DCEL Vertex""" def ...
from pepper.framework import * from pepper.responder import * from pepper.knowledge import sentences, animations from pepper.language import Utterance from pepper.language.generation.reply import reply_to_question from pepper import config from threading import Thread from random import choice from time import time S...
import torch import torch.nn as nn from torch.nn.modules.loss import _WeightedLoss import torch.nn.functional as F import numpy as np from numpy.random import choice from IPython import embed import os from CLAPPVision.utils import model_utils class ContrastiveLoss(nn.Module): def __init__(self, opt, in_channel...
from typing import Union import discord from discord import app_commands from discord.ext import commands import utils.search from utils.ids import GuildIDs class Responses(discord.ui.Select): """Contains the Dropdown Menu for our custom help command. Every command is explained in here. """...
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
#! /usr/bin/env python import importlib import os import logging import tempfile import signal import shutil import time import sys import threading import json import optparse import email import subprocess import hashlib import yaml import requests import coloredlogs import alexapi.config import alexapi.tunein as ...
#! /usr/bin/env python """ This script computes the correlation between spatial eccentriicty and momentum anisotropy """ from sys import argv, exit from os import path, mkdir from glob import glob from numpy import * import h5py import matplotlib.pyplot as plt import shutil def compute_psi_n(ep_n_cos, ep_n_...
from aiida.orm import Code, DataFactory, WorkflowFactory from aiida.orm.workflow import Workflow from aiida.orm.calculation.inline import make_inline #from aiida.workflows.wf_phonon import WorkflowPhonon from aiida.orm import load_node, load_workflow import numpy as np WorkflowPhonon = WorkflowFactory('wf_phonon') S...
#! /usr/bin/env python3 # Script to crawl the file system for changed files # # fs-crawler dirkpetersen / Oct 2019 # import sys, os, argparse, subprocess, re, time, datetime, tempfile, random, threading, filecmp class KeyboardInterruptError(Exception): pass def main(): #log = logger('fs-crawler', args.debug)...
# Copyright (c) 2009-2016 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. R""" Deprecated initialization routines. """ from hoomd.deprecated import _deprecated; import hoomd; import math import os from hoomd import _hoomd def read_xml(...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 21 23:17:47 2018 @author: virati LFP Dynamics script Captures DO changes """ import sys sys.path.append('/home/virati/Dropbox/projects/Research/MDD-DBS/Ephys/DBSpace/') import DBSpace as dbo from DBSpace import nestdict from matplotlib import cm f...
from sympy.core import S, sympify, diff from sympy.core.decorators import deprecated from sympy.core.function import Function, ArgumentIndexError from sympy.core.logic import fuzzy_not from sympy.core.relational import Eq, Ne from sympy.functions.elementary.complexes import im, sign from sympy.functions.elementary.piec...
# Copyright 2021 The SODA Authors. # # 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 writin...
import csv import re import pickle import operator import numpy as np from itertools import combinations class Bundle: def __init__(self, user_index_map, recipe_index_map): self.user_index_map = user_index_map self.recipe_index_map = recipe_index_map def serialize(self, file_name): wit...
# Copyright (c) 2009-2022 The Regents of the University of Michigan. # Part of HOOMD-blue, released under the BSD 3-Clause License. """Implement data classes for supporting HOOMD walls.""" from abc import ABC, abstractmethod from copy import copy from collections.abc import MutableSequence from hoomd.data.syncedlist ...
from railroad import * NSTAR_STYLE = '''\ svg.railroad-diagram { background-color:rgba(0,0,0,0); } svg.railroad-diagram path { stroke-width:3; stroke:black; fill:rgba(0,0,0,0); } svg.railroad-diagram text { font:bold 14px monospace; text-anchor:middle; } svg.railroad-diagram text....
from django.core.urlresolvers import reverse from django.utils.translation import ugettext_noop from django.utils.translation import ugettext as _ from corehq.apps.es import users as user_es, filters from corehq.apps.domain.models import Domain from corehq.apps.groups.hierarchy import get_user_data_from_hierarchy from...
# -*- coding: utf-8 -*- import json import re from django.shortcuts import render_to_response from django import forms from django.contrib import admin from django.contrib import messages from django.core.exceptions import ( ImproperlyConfigured, ObjectDoesNotExist, ValidationError, ) from django.utils im...
## @file # This file is used to implement of the various bianry parser. # # Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent ## from re import T import copy import os from edk2basetools.FMMT.PI.Common import * from edk2basetools.FMMT.core.BiosTreeNode impor...
""" Train baseline models (AlexNet, VGG, ResNet, and MobileNet) """ import os, csv, json os.environ['CUBLAS_WORKSPACE_CONFIG'] = ':4096:8' import random import argparse import numpy as np from tqdm import tqdm # torch modules import torch import torch.nn as nn import torch.nn.functional as F import torch.backends....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The F4PGA Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ Classes for representing and creating a physic...
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: lab3_Shadings Description : Author : zdf's desktop date: 2019/2/24 ------------------------------------------------- Change Activity: 2019/2/24:23:27 ----------------------------...
import sys import os from pathlib import Path import argparse from library_id import LibraryID import re # Map headers in Rebecca's sample spreadsheet to the library spreadsheet # key is sample spreadsheet column name, value is library spreadsheet column name header_mapping_sample = {} # Rebecca removed these columns ...
import os import os.path import uuid from collections import defaultdict import blitzdb from blitzdb.backends.base import ( Backend as BaseBackend, NotInTransaction, ) from blitzdb.backends.file.index import ( Index, TransactionalIndex, ) from blitzdb.backends.file.queries import compile_query from b...
#Copyright (c) 2015 Microsoft Corp #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ...
import torch.nn as nn import torch.nn.functional as F import torch import torchvision from utils.util import decimate class VGGBase(nn.Module): def __init__(self): super().__init__() self.conv1_1 = nn.Conv2d(3, 64, kernel_size=3, padding=1) self.conv1_2 = nn.Conv2d(64, 64, kernel_size=3, ...
from ursina import * from ursina import curve from particles import ParticleSystem import json sign = lambda x: -1 if x < 0 else (1 if x > 0 else 0) Text.default_resolution = 1080 * Text.size class Car(Entity): def __init__(self, position = (0, 0, 0), rotation = (0, 65, 0), topspeed = 30, acceleration = 0.35, bra...
import json import os from urllib.parse import urlparse import cirrocumulus.data_processing as data_processing from flask import Blueprint, Response, request, stream_with_context from .anndata_util import adata_to_df from .blueprint_util import get_database, map_url, get_auth from .dataset_api import DatasetAPI from ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import unittest from io import BytesIO from itertools import cycle from unittest import mock import numpy as np import numpy.testing as npt import torch from parameterized.parameterized import parameterized from pytorch_lig...
#!/usr/bin/env python import codecs import os import re import xml import xml.sax.saxutils as saxutils from lib.core.common import getUnicode from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core.exception import SqlmapFilePathException from lib.core.settings impo...
# Copyright 2017 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 a...
"""A library to store useful routines and keep the clutter to a minimum.""" import os.path import argparse import pkg_resources as pkg from yices.Types import Types from yices.Terms import Terms from .StringBuilder import StringBuilder int_t = Types.int_type() class SudokuError(Exception): """An application s...
from enum import Enum from typing import Type, Tuple import torch import torch.nn as nn from cvmodels.segmentation.backbones import resnet as rn, xception as xc class ASPPVariants(Enum): """Enum describing the possible dilations in the Atrous spatial Pyramid Pooling block. There are essentially two combinati...
from typing import List, Dict from collections import defaultdict def longestPalindrome(s: str) -> str: j = len(s) def look_left_right(l, r): while l >= 0 and r < j: if s[l] == s[r]: l -= 1 r += 1 else: return l+1, r-1, r-l-2 ...
from __future__ import division # # Coded by: <NAME> <<EMAIL>> # University of Vienna, Department of Theoretical Chemistry # # -*- Style -*- # Use double quotes or '#' for comments, such that single quotes are available # for uncommenting large parts during testing # # *) do not exceed 80 characters per line # # ...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import sys import pytest import spack.util.environment as environment from spack.paths import spack_root from ...
# maze example import collections import numpy as np import matplotlib from matplotlib import pyplot as plt import sys from collections import defaultdict import random import math def plot_value_function(V, title="Value Function", scale_vmin=0): """ Plots the value function as a surface plot. """ min...
from __future__ import division import os import sys import numpy as np import ctypes import PyQt5 from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLineEdit, QGridLayout, QToolTip, QPushButton, QSlider, QFileDialog from PyQt5.QtGui import QIcon from matplotlib.backends.backe...
""" Functions to correct and filter data matrix from LC-MS Metabolomics data. """ import numpy as np import pandas as pd from scipy.interpolate import CubicSpline, interp1d from statsmodels.nonparametric.smoothers_lowess import lowess from typing import List, Callable, Union, Optional from ._names import * def input...
#!/usr/bin/python3 ## author: <EMAIL> from ._nodes import TreeNode from random import random, randint, shuffle import sys sys.setrecursionlimit(10000) class TreapNode(TreeNode): def __init__(self, val, priority): super().__init__(val) self.priority = priority self.size = 1 def set_...
import json import glob, os import dash import plotly.io as pio import datetime import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.express as px from django_plotly_dash import DjangoDash from django.apps import apps import plotly.g...
""" The command-line module of the library. There are some simple utilities included, and a playground for some of the interesting parts of pytermgui. See `ptg --help` for more information. """ from __future__ import annotations import os import sys import platform import subprocess from random import randint from ...
import struct import socket import hashlib import sqlite3 import time import shamir_auth import rsa_encrypt import aes_crypt import threading import settings import shamir_gen import comms import base64 import shamir_update_client import auth_update import sys import json from Crypto import Random #set unique number ...
""" @Time: 2020/8/13 17:06 @Author: Zhirui(<NAME> @E-mail: <EMAIL> @Program: """ import random import pandas as pd import numpy as np from sklearn import preprocessing from sklearn.utils import shuffle from sklearn.impute import SimpleImputer import tensorflow as tf from tensorflow.keras import layers, optimizers ...