text
stringlengths
3.07k
22.1k
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
import os import sys import logging import re import difflib import p4_changelist_cfg as cfg import p4_changelist_utils as p4cl_utils import p4 import marshal import io import zipfile import datetime from dateutil.tz import tzlocal def dump_changelist(): logging.debug('dump change list:%s', cfg.arguments.p4_cha...
"""Data set tool of MVTEC author: <NAME> e-mail: <EMAIL> """ import os import re import cv2 import random import torch import torch.utils.data as data from collections import OrderedDict from .augment import * from .eval_func import * class Preproc(object): """Pre-procession of input image includes resize, crop ...
""" Copyright (c) 2022 <NAME>, <NAME>, <NAME>, <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publ...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
# -*- coding: utf-8 -*- r""" Sequence Models and Long-Short Term Memory Networks =================================================== At this point, we have seen various feed-forward networks. That is, there is no state maintained by the network at all. This might not be the behavior we want. Sequence models are centra...
import os from os.path import join from glob import glob import torch import cv2 import numpy as np import xml.etree.ElementTree as ET from metric.BoundingBox import BoundingBox from metric.BoundingBoxes import BoundingBoxes from metric.Evaluator import Evaluator from metric.utils import BBFormat, BBType, CoordinatesTy...
# Copyright 2018 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
import os import re import ssl import time from bs4 import BeautifulSoup from operator import itemgetter from selenium.webdriver.support.ui import Select from urllib.request import urlopen # Configuration verbose = False delay = 0 last_request = 0 output_files = [] errors = [] scraped_courses = {} # Regular expressio...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. """Video models.""" import torch.nn as nn import utils.weight_init_helper as init_helper from models.batchnorm_helper import get_norm from .build import MODEL_REGISTRY from . import head_helper, resnet_helper, stem_helper...
#-*- coding: utf-8 -*- import sys import os import numpy as np import shutil import traceback import hashlib import time import datetime import tarfile import hashlib #import SimpleITK as sitk import pandas from PIL import Image ### #import pydicom from pydicom import dcmread from scipy.ndimage.interpolation import zo...
import networkx as nx from nose.tools import * def test_random_partition_graph(): G = nx.random_partition_graph([3, 3, 3], 1, 0, seed=42) C = G.graph['partition'] assert_equal(C, [set([0, 1, 2]), set([3, 4, 5]), set([6, 7, 8])]) assert_equal(len(G), 9) assert_equal(len(list(G.edges())), 9) G ...
from boolean2.boolmodel import BoolModel from boolean2 import util, odict, tokenizer from boolean2.plde import helper from importlib import reload import numpy as np import os path = os.path def default_override(node, indexer, tokens): """ Gets called before the generating each equation. If this functio...
# -*- coding: utf-8 -*- """ This module simplifies the process of obtaining an authenticated session for steam websites. After authentication is completed, a :class:`requests.Session` is created containing the auth cookies. The session can be used to access ``steamcommunity.com``, ``store.steampowered.com``, and ``help...
import os import sys import stat import re import multiprocessing import pytest from mltk import MLTK_ROOT_DIR from mltk.utils.test_helper import get_logger, run_mltk_command from mltk.utils.shell_cmd import run_shell_cmd from mltk.utils.archive_downloader import download_verify_extract from mltk.utils.path import c...
from pathlib import Path import numpy as np import pandas as pd from .engine import abc_smc from .misc import create_images_from_data from .models import Models, Model from .priors import Beta def distance(x,y): return abs(x.sum() - y.sum()) def simulate(priors, observation): return np.random.binomial(n=1, ...
import numba as nb import numpy as np from math import ceil from math import floor from math import sqrt from numba import cuda @cuda.jit("int64(float64[:], float64[:], int64[:])", device=True) def cu_cell_id(p, box, ibox): # In the Fortran way ret = floor((p[0] / box[0] + 0.5) * ibox[0]) tmp = ibox[0] f...
from dask.distributed import Client import dask.dataframe as dd import os, uuid, time import argparse import mlflow from pathlib import Path # if running in a notebook, uncomment these 2 lines # import sys # sys.argv = [''] for k, v in os.environ.items(): if k.startswith("MLFLOW"): print(k, v) parser = a...
import copy import datetime import logging import os import sys import ciso8601 import numpy as np import pandas as pd import pytz logger = logging.getLogger('tsdataformat') class Tsdata(object): """ Tsdata is a class to manage Tsdata metadata and validate data lines. """ header_size = 7 # lines i...
from __future__ import absolute_import from __future__ import division # from __future__ import print_function import numpy as np import time import sys import paddle import paddle.fluid as fluid import reader import argparse import functools from utility import add_arguments, print_arguments import paddle.fluid.core a...
import pytest from pysmt.shortcuts import * from kipro2.k_induction.incremental_k_induction import * from kipro2.utils.statistics import Statistics from tests.sample_programs import * from tests.programs import * def run_kinduction(program, post_exp, pre_exp): statistics = Statistics(dict()) res = Increment...
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # Modified by <NAME> from typing import List, Optional, Union import torch import torchvision.transforms as T from .utils import padded_to_list, padded_to_packed """ This file has functions for interpolating textures after rasterization. """ ...
# Code for "ActionCLIP: ActionCLIP: A New Paradigm for Action Recognition" # arXiv: # <NAME>, <NAME>, <NAME> import os from re import T from torch._C import dtype from torch.autograd.grad_mode import no_grad import clip import torch.nn as nn from datasets import Action_DATASETS from torch.utils.data impor...
import torch import torch.nn as nn import torchvision import numpy as np import math import webcolors import cv2 import gdown import matplotlib.pyplot as plt import matplotlib.patches as patches from torch.nn.init import _calculate_fan_in_and_fan_out, _no_grad_normal_ STANDARD_COLORS = [ 'LawnGreen', 'LightBlue' ,...
from __future__ import print_function import os import sys import tempfile import gc import unittest import gevent from gevent import fileobject import gevent.testing as greentest from gevent.testing.sysinfo import PY3 from gevent.testing.flaky import reraiseFlakyTestRaceConditionLibuv from gevent.testing.skipping im...
# Copyright 2013 OpenStack Foundation # Copyright 2013 Rackspace Hosting # # 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 # # ...
# 问句天几高,心中志比天更高 from flask import abort from flask import current_app, jsonify from flask import g from flask import render_template from flask import request from flask import session from main_info import constants, db from main_info.models import News, Comment, CommentLike, User from main_info.response_code import ...
from __future__ import unicode_literals import sys import traceback import time from traitlets import Unicode, Undefined from uuid import uuid4 from ipykernel.kernelbase import Kernel from .coqtop import Coqtop, CoqtopError from .renderer import Renderer, HTML_ROLLED_BACK_STATUS_MESSAGE, TEXT_ROLLED_BACK_STATUS_MESSA...
# -*- coding: utf-8 -*- """ This module is dedicated to create the numeric representation of the keyboard in a dict with the params midi_id, name id (number), color(white|black) , associated synesthesia color id, pos (x, y) size (width, height) """ import synesthesia #Key codes associated with the note name NAM...
from typing import Optional, List, Dict, Any import numpy as np import torch import torch.nn as nn # Hydra and OmegaConf from hydra.conf import dataclass, MISSING, field # Project Imports from hydra.core.config_store import ConfigStore from slam.common.geometry import compute_normal_map, projection_map_to_points fr...
import contextlib import importlib import os import stat import tempfile import textwrap from typing import Dict, Generator, List, Mapping, Optional import appdirs import attr import desert # TODO: should be a desert.ib() but mypy doesn't understand it then, see below import desert._make import marshmallow import pend...
# -*- coding: utf-8 -*- # import statements from math import inf from numpy import nan import pandas import cobra import json import re empty = ['', '-', '', None, nan, 'NaN'] # add the units of logarithm to the Magnesium concentration def isnumber(string): string = str(string) try: string = st...
## Logging import logging import sys import requests from zipfile import ZipFile from io import BytesIO logger = logging.getLogger() fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' formatter = logging.Formatter(fmt) ## Import basic scientific stack import numpy as np import scipy as sp import pandas as p...
import os import torch as th import json try: from metrics import MeanMetric, TransformMetric, ConstantMetric, OracleMetric from metrics import logit_ml_accuracy, auc_curve, pairwise_auc from loss import MLCrossEntropy except ImportError: from .metrics import MeanMetric, TransformMetric, Const...
import os, os.path, yaml, logging, random, subprocess, hashlib, re, tempfile, json, time from threading import Thread, Event from queue import Queue, Empty from .bus import bus from . import alerts from .config import config from . import settings _audioFileName = 'audio.yaml' _logger = logging.getLogger('Audio') ...
""" These tests require extensive manual setup, e.g. creating a DockerHub account and uploading an image to it. """ import subprocess from meadowrun.azure_integration.azure_core import get_subscription_id from meadowrun.azure_integration.azure_ssh_keys import get_meadowrun_vault_name from meadowrun.credentials import...
""" This script renames BRATS dataset to OUTPUT_path, each subject's images will be cropped and renamed to "TYPEindex_modality.nii.gz". output dataset folder will be created if not exists, and content in the created folder will be, for example: OUTPUT_path: HGG100_Flair.nii.gz HGG100_Label.nii.gz HGG100_T1c....
"""BioGRID API methods.""" import json from math import ceil from flask import request from sqlalchemy import or_, and_ from collections import namedtuple from typing import List, Dict, Optional from ebel import Bel from ebel.manager.orientdb.biodbs.biogrid import MODIFICATIONS from ebel.manager.rdbms.models.biogrid ...
import threading import socket import time import select from core.display import Text from core.configs import get_value, change_config input_color = get_value("customization", "input_color") choice_size = get_value("display", "choice_font_size") choice_font = get_value("display", "choice_font") server_color = get_v...
import os import random import asyncio import yt_dlp from os import path from . import queues from ... import config from typing import Dict, Union from Yukki import BOT_USERNAME from asyncio import QueueEmpty from pytgcalls import PyTgCalls from pytgcalls.types import Update from Yukki import app, BOT_USERNAME from py...
from . import util import os import numpy as np import random import sys from alphafold.common import protein from alphafold.model import data from alphafold.model import config from alphafold.model import model from typing import Any, List, Mapping, NoReturn from absl import logging def set_config( use_templa...
"""Parser for Google-formatted log files.""" from __future__ import unicode_literals import re from dfdatetime import time_elements as dfdatetime_time_elements import pyparsing from plaso.containers import events from plaso.containers import time_events from plaso.lib import errors from plaso.lib import definition...
from unittest import mock from zeit.cms.interfaces import ICMSContent from zeit.cms.workflow.interfaces import IPublishInfo, IPublish import lxml.etree import transaction import zeit.cms.checkout.helper import zeit.content.article.interfaces import zeit.content.article.testing import zope.i18n.translationdomain class...
import os, sys, json, operator DECL_PUBLIC = 0x000001 DECL_PRIVATE = 0x000002 DECL_PROTECTED = 0x000004 DECL_INTERNAL = 0x000008 DECL_VIRTUAL = 0x000100 DECL_OVERRIDE = 0x000200 DECL_ABSTRACT = 0x000400 DECL_FINAL = 0x000800 DECL_EXTERN = 0x001000 DECL_EXTENSION = 0x002000 DECL_DE...
# -*- coding: utf-8 -*- import copy from picklable_itertools.extras import equizip from theano import tensor from ..base import application, lazy from ..parallel import Fork from ..simple import Initializable, Linear from .base import BaseRecurrent, recurrent class Bidirectional(Initializable): """Bidirectional...
import argparse import uuid import sys import os import hashlib import re import cv2 import numpy as np import pandas as pd from ellipse import EllipseGroup from bspline import BSplineGroup from drawing_group import newDrawingGroup #np.set_printoptions(threshold=50) # Create a black image, a window and bind the fu...
import os import sqlite3 from stat import ( S_ISDIR, S_ISREG, ST_MODE ) from urllib.parse import urljoin from psyion.resources import ( ChameleonTemplates, ChameleonTemplate, map_directory_tree ) from psyion.media import types as media_types from psyion...
from basicBlock import BasicBlock from indicators import * import copy import math import sys import optParser import libraries.yacc as yacc def printExpr(expr): if(isBinary(expr)): return printExpr(expr[1]) + " " + expr[0] + " " + printExpr(expr[2]) elif(isUnary(expr)): return expr[0] + pr...
""" This is the parent indicator processing playbook. It assigns the appropriate workbook and calls the user, computer, filehash, ip, domain and url enrichment playbooks depending on if the indicators are present. """ import phantom.rules as phantom import json from datetime import datetime, timedelta def on_start(con...
#!/usr/bin/python # coding=utf-8 # Copyright 2020 getcarrier.io # # 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 # # ...
#!/usr/bin/env python3 # coding=utf-8 # # Copyright (c) 2020 Huawei Device 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 # # Unle...
import os import glob import numpy as np import argparse import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.python.keras.callbacks import ReduceLROnPlateau, EarlyStopping, CSVLogger from tensorflow.python.keras.applications.inception_v3 import preprocess_input from tensorflow.python.keras.preproce...
# MIT License # Copyright (c) 2022 <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish...
# Copyright 2009-2017 <NAME> # Copyright 2009-2020 PyUSB contributors # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of condit...
import json import time import datetime from pick import pick from colorama import Fore from six.moves import input from pytimeparse.timeparse import timeparse from plugin import plugin from utilities.textParser import parse_date """ Module content: * RemindTodoBase: Shared functionality between Remind and Todo * ...
# Copyright 2019 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://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
""" Recurrent model training """ import argparse from functools import partial from os.path import join, exists from os import mkdir import torch import torch.nn.functional as f from torch.utils.data import DataLoader from torchvision import transforms import numpy as np from tqdm import tqdm from utils.misc import sav...
import abc import logging import time import warnings from enum import Enum from typing import Any from dateutil.parser import parse from great_expectations.core.expectation_suite import ExpectationSuite from great_expectations.core.run_identifier import RunIdentifier from great_expectations.data_asset import DataAss...
import numpy as np import cvxpy as cp class Controller(): def __init__(self, T, dt, **kwargs): ''' dt: planning timestep T: planning horizon **kwargs: Model Parameters ''' self.T = T self.dt = dt self.err_count = 0 self.R = kwargs["R...
# -*- coding: utf-8 -*- from geoalchemy2.shape import from_shape, to_shape from geoalchemy2.types import Geometry from geoalchemy2.elements import WKBElement from sqlalchemy import (CheckConstraint, Column, ForeignKey, Integer, String, Text, DateTime, Boolean) from sqlalchemy.orm import relation...
import logging import urllib.parse from collections import defaultdict from distutils.version import LooseVersion from detectem.utils import ( get_most_complete_version, get_url, ) from detectem.settings import ( VERSION_TYPE, INDICATOR_TYPE, HINT_TYPE, MAIN_ENTRY, RESOURCE_ENTRY, INLINE_SCRIPT_ENTRY,...
import os import sys import re import uuid from threading import Thread from queue import Queue import subprocess from charts import plot_relative_time, plot_comparison_bar_chart,\ plot_compare_sizes from common import STATE_SIZES, TIME_NAMES, FUNCTION_NAMES,\ COMPARISON_STATE_SIZES, INTERPRETERS, CONTRACTS, CO...
import os import pathlib import uuid import pandas as pd import pytest import yaml from airflow.hooks.base import BaseHook from airflow.models import DAG, Connection, DagRun from airflow.models import TaskInstance as TI from airflow.utils import timezone from airflow.utils.db import create_default_connections from air...
# -*- coding: utf-8 -*- # cython: language_level=3 # Copyright (c) 2020 Nekokatt # # 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...
from pumapy.utilities.workspace import Workspace import math import numpy as np def size_check(size): if not (isinstance(size, tuple) and len(size) == 3): raise Exception("Error, invalid size, must be tuple of size 3") if size[0] <= 0: raise Exception("Error, invalid size, must be >= 0") i...
# # 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 o...
from django import forms from django.contrib.auth.models import User from django.utils.html import strip_tags from django.utils import timezone from taggit.forms import * from nadine.models import * from nadine.utils.payment_api import PaymentAPI from nadine import email import datetime import logging logger = loggi...
#!/usr/bin/env python import argparse import time import sys from sys import exit from Emulator import Emulator import generators from generators.fba2x.fba2xGenerator import Fba2xGenerator from generators.kodi.kodiGenerator import KodiGenerator from generators.linapple.linappleGenerator import LinappleGenerator from g...
#!/bin/python # -*- coding: UTF-8 -*- from __future__ import print_function import os, sys import cPickle as pickle import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.utils import shuffle cfg_folder = "../BigCloneBench/dcsim" \ "/cfgs_antlr" labels...
#!/usr/bin/env python # coding: utf-8 # In[1]: import sim import time import cv2 import numpy as np from PIL import Image from queue import PriorityQueue import math from numpy import sqrt import itertools # In[2]: def resize(img,resolution): scale_percent = 500 # percent of original size width = int(res...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import datetime import subprocess import sys from colorama import Fore from .settings import Settings class Git: @staticmethod def check_working_directory(): pipe = subprocess.PIPE process = subprocess.Popen(['git', 'status'], stdout=pipe, std...
""" Convert to/from Transformation Matrix (Rotation Matrix + Translation Vector). Zivid primarily operate with a (4x4) transformation matrix. This example shows how to use Eigen to convert to and from: AxisAngle, Rotation Vector, Roll-Pitch-Yaw, Quaternion. The convenience functions from this example can be reused in...
"""generate dataset to pipeline Revision ID: 192b3a65a251 Revises: 260ffba4b041 Create Date: 2020-10-08 15:52:26.141457 """ """ OpenVINO DL Workbench Migration: Generate dataset to pipeline Copyright (c) 2020 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use thi...
import os import matplotlib import matplotlib.image as mpimg import numpy as np import numpy.random import pandas as pd import pylab as pl from plotnine import * from scipy.spatial import Delaunay from skimage import feature N = 1000 def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.2989, 0.5870, 0.1140]) dimg = m...
from warnings import warn import numpy as np from scipy.stats import norm as ndist from ..constraints.affine import constraints from .debiased_lasso_utils import solve_wide_ def debiasing_matrix(X, rows, bound=None, linesearch=True, # do a linesearch? ...
import json import logging import sys import time from datetime import datetime from typing import List, Dict, Iterator import editdistance import requests from pymongo import MongoClient from pymongo.errors import DuplicateKeyError from requests import HTTPError from tqdm import tqdm import config from MAG_model imp...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose import astropy.units as u from astropy.table import Table from gammapy.catalog.fermi import SourceCatalog3FGL from gammapy.estimators import FluxPoints from gammapy.modeling.models ...
# Import comet_ml in the top of your file from comet_ml import Experiment # Create an experiment experiment = Experiment(api_key="<KEY>", project_name="robert4qa", workspace="shizhediao") import numpy as np import pandas as pd import torch import torch.nn as nn import tokenizers import transf...
"""USAGE twitter-follow [options] <user> DESCRIPTION Display all following/followers of a user, one user per line. OPTIONS -o --oauth authenticate to Twitter using OAuth (default no) -r --followers display followers of the given user (default) -g --following display users the given...
import json from datasette.utils import RequestParameters from mimetypes import guess_type from urllib.parse import parse_qs, urlunparse, parse_qsl from pathlib import Path from html import escape import re import aiofiles class NotFound(Exception): pass class Request: def __init__(self, scope, receive): ...
import os import json import requests from functools import partial from ..exception import FrictionlessException from ..metadata import Metadata from ..resource import Resource from ..package import Package from ..storage import Storage from ..dialect import Dialect from ..parser import Parser from ..plugin import Plu...
"""Fetch cytogenetic band data from remote MySQL databases """ # TODO: # - Bonus: Convert this data into AGP 2.0, send data missing from NCBI to them import os import json from concurrent.futures import ThreadPoolExecutor import argparse from . import settings parser = argparse.ArgumentParser( description=__doc...
import os import sys import time import glob import numpy as np import torch import utils import logging import argparse import torch.nn as nn import torch.utils import torch.nn.functional as F import torchvision.datasets as dset import torch.backends.cudnn as cudnn from torch.autograd import Variable from model_searc...
from selenium.webdriver.firefox.options import Options as FirefoxOptions from selenium.webdriver.support.ui import Select from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import Timeout...
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
"""Tests for the video encoder, text encoder, and associated layers. 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 Unle...
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- # # This file is part of the LibreOffice project. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # ...
import csv import itertools import sys import random PROBS = { # Unconditional probabilities for having gene "gene": { 2: 0.01, 1: 0.03, 0: 0.96 }, "trait": { # Probability of trait given two copies of gene 2: { True: 0.65, False: 0.35 ...
#!/usr/bin/env python # coding: utf-8 import sys sys.path.append('../isoclique') import isoclique as ic import math import time import numpy as np from scipy import stats from sklearn.datasets import make_blobs from sklearn.metrics.pairwise import rbf_kernel from sklearn.metrics import f1_score, adjusted_rand_score,...
import base58 import base64 import json import logging import re import time import requests from solana.blockhash import Blockhash from solana.publickey import PublicKey from solana.rpc.api import Client as SolanaClient from solana.rpc.api import SendTransactionError from solana.rpc.commitment import Confirmed from s...
# Copyright (c) 2013 Rackspace Hosting, 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 agreed ...
import ast import sys class ASTGenerator: def __init__(self): self.asts = dict() self.filename = None self.block_types = [ ast.If, ast.For, ast.While, ast.Try, ast.ExceptHandler, ast.With, ast.ClassDef, ...
import numpy as np import networkx as nx def __knn(k, x): from sklearn.neighbors import NearestNeighbors neigh = NearestNeighbors(k + 1, metric='euclidean', n_jobs=-1).fit(x) k_neighbors = neigh.kneighbors(x, k + 1, ) distance = np.array(k_neighbors[0][:, 1:]) indices = np.array(k_neighbors[1][:, ...
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["GP"] import numpy as np import scipy.optimize as op from scipy.linalg import LinAlgError from .basic import BasicSolver from .utils import multivariate_gaussian_samples, nd_sort_samples # MAGIC: tiny epsilon to add on the diagonal...
# This file is part of the pyMOR project (https://www.pymor.org). # Copyright 2013-2021 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause) import numpy as np from pymor.operators.constructions import IdentityOperator, ZeroOperator fro...
import os import platform import subprocess import textwrap import unittest import six from parameterized.parameterized import parameterized_class from conans.client.generators.virtualenv import VirtualEnvGenerator from conans.client.tools import OSInfo from conans.client.tools.env import environment_append from cona...
import data_readers import numpy as np import os import pickle import random from collections import defaultdict from config import Config from console import log_info from data_readers import read_dataset_splits from keras.callbacks import Callback from keras.layers import Dense, Embedding, Input, LSTM, Bidirectional...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian, FixedCategorical, FixedNormal, MaxNormal from a2c_ppo_acktr.utils import init class Flatten(nn.Module): def forward(self, x): return x.view(x...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ example.py ~~~~~~~~~ A simple command line application to run flask apps. :copyright: 2019 Miller :license: BSD-3-Clause """ # Known bugs that can't be fixed here: # - synopsis() cannot be prevented from clobbering existing # load...
import numpy as np import keras from keras import layers from keras import activations import keras.backend as K from scipy import ndimage import tensorflow as tf def basic_encoder(): '''basic auto encoder model found at https://blog.keras.io/building-autoencoders-in-keras.html''' #The encoding...