text
stringlengths
3.07k
22.1k
import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), "..")) import random import logging import math import sc2 from sc2 import Race, Difficulty from sc2.constants import * from sc2.player import Bot, Computer from sc2.data import Alliance from sc2.position import Pointlike, Point2, Point3 from sc...
# Natural Language Toolkit: NIST Score # # Copyright (C) 2001-2022 NLTK Project # Authors: # Contributors: # URL: <https://www.nltk.org/> # For license information, see LICENSE.TXT """NIST score implementation.""" import fractions import math from collections import Counter from nltk.util import ngrams def sentenc...
import sys sys.path.append('../../../') import os from multiprocessing import Pool from data_processor.GOA_preprocessor.goa_data_wrapper import load_Lai_EIS_data from goa.integration.goa_intergration import goa_fitter_multiProcess_Pool_0 from playground.laiZhaoGui.goa.GOAs_fit_EIS_0 import get_para_range from playgrou...
# -*- coding: utf-8 -*- ''' Publish a command from a minion to a target ''' from __future__ import absolute_import, unicode_literals, print_function # Import python libs import time import logging # Import salt libs import salt.crypt import salt.payload import salt.transport import salt.utils.args from salt.exception...
#! -*- coding:utf-8 -*- import json import numpy as np from random import choice from keras_bert import load_trained_model_from_checkpoint, Tokenizer import re, os import codecs mode = 0 maxlen = 100 learning_rate = 5e-5 min_learning_rate = 1e-5 config_path = './FinBERT_L-12_H-768_A-12_tf/bert_config.json' checkpoi...
# Thanks to https://github.com/spesmilo/electrum storage implementation import copy import json import os import stat import threading from decimal import Decimal from functools import singledispatch class DBFileException(Exception): pass def standardize_path(path): return os.path.normcase(os.path.realpath(...
#!/usr/bin/python # Copyright (c) 2020, 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...
import logging import os import shlex import subprocess from typing import ( TYPE_CHECKING, Any, Callable, Iterable, List, Mapping, Optional, Union, ) from pip._vendor.rich.markup import escape from pip._internal.cli.spinners import SpinnerInterface, open_spinner from pip._internal.exc...
import hashlib from typing import Dict, List from urllib3 import disable_warnings import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * INTEGRATION_COMMAND_NAME = "lastline" INTEGRATION_NAME = "Lastline v2" SUFFIX_TRANSFORMER = {'/analysis/submit/file': {'url': 'papi/ana...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline from astropy.utils import lazyproperty from astropy import units as u from astropy.table import Table from ..utils.scripts import make_path from ..utils.time import time_ref_from...
#!/usr/bin/env python # # mallard2man.py # # Copyright (C) 2014 MongoDB, Inc. # # This program 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 ...
import os import time import subprocess import torch as t from jukebox.hparams import Hyperparams from jukebox.utils.torch_utils import empty_cache from jukebox.utils.audio_utils import save_wav, load_audio from jukebox.make_models import make_model from jukebox.align import get_alignment from jukebox.save_html import...
from __future__ import print_function, absolute_import import contextlib from io import StringIO import importlib import logging import os import sys import xml.etree.ElementTree as xml from maya import OpenMayaUI from pymel.core import confirmDialog as confirmDialog_orig # I think the * imports are for the compili...
""" A run script that runs the simulation multiple times with various parameters and generates statistics regarding the success rate of the chosen attack. """ import os import time import numpy import pickle import itertools import seaborn import matplotlib.pyplot as pyplot from statistics import variance from pathos....
# coding=utf-8 # Copyright 2018 The Google Research 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 applicab...
import sys from decimal import Decimal from io import BytesIO from django.contrib.auth.models import AbstractUser from django.contrib.contenttypes.models import ContentType from django.core.files.uploadedfile import InMemoryUploadedFile from django.db import models from django.db.models import Avg from django.urls imp...
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os import subprocess import tempfile from flexmock import flexmock import pytest import json import tarfile import re from atomic_rea...
# Copyright 2012 OpenStack Foundation # 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 requ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
# # Copyright 2017 the original author or 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...
import unittest from nacc.uds3 import packet from nacc.uds3.ivp import builder as ivp_builder from nacc.uds3.fvp import builder as fvp_builder class TestC1SC2(unittest.TestCase): def test_c1s_blank_not_added_to_ivp(self): """ When the C1S form is blank, there should be an error """ record = make_...
import numpy as np import matplotlib.pyplot as plt import scipy.optimize from scipy.odr import odrpack def fit_smorzata(x, v0, damp): return v0*np.e**(-damp*x) def odr_periodo_theta(B, theta) : return 2*np.pi*np.sqrt(l/980.7) * (1 + B[0]*theta**2 + B[1]*theta**4) def fit_periodo_theta(theta, a, b) : ...
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
from __future__ import absolute_import import click import six as _six from flytekit.clis.helpers import construct_literal_map_from_parameter_map as _construct_literal_map_from_parameter_map from flytekit.clis.sdk_in_container import constants as _constants from flytekit.common import utils as _utils from flytekit.co...
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2018-2021 www.open3d.org # # Permission i...
# Copyright 2013: Mirantis 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 b...
# -*- coding: utf-8 -*- # # Copyright 2017 Mycroft AI 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 ...
# coding=utf-8 # Copyright 2020 The SimCLR 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...
# This file is part of Scapy # Copyright (C) 2007, 2008, 2009 <NAME> # 2015, 2016, 2017 <NAME> # This program is published under a GPLv2 license """ TLS Pseudorandom Function. """ from __future__ import absolute_import from scapy.error import warning from scapy.utils import strxor from scapy.layers.tls.crypto.hash i...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import logging import math from typing import List import numpy as np import torch import torch.distributed as dist import torch.nn.functional as F from scipy.optimize import linear_sum_assignment from torch import nn from detectron2.l...
__author__ = 'archanda' __date__ = '3-Oct-2021' __copyright__ = "Copyright 2021" __credits__ = ["archanda"] __license__ = "All rights reserved" __maintainer__ = "archanda" __email__ = "<EMAIL>" __status__ = "dev" import logging import requests from fastapi import FastAPI, Body, APIRouter, Request, Response, status, ...
import hashlib import random from aiogram.types import InlineQuery, InlineQueryResultArticle, InputTextMessageContent, CallbackQuery from aiogram.utils.markdown import hbold, hitalic from app.data.convert import ERROR, PREPODS, sticker from app.data.messages import donuts from app.keyboards.inline.callback_datas impo...
# -*- coding: utf-8 -*- # Rapid prototyping notebook # Commented out IPython magic to ensure Python compatibility. # %%capture # ! pip install pytorch-lightning # ! pip install pytorch-lightning-bolts import pytorch_lightning as pl import torch import numpy as np import matplotlib.pyplot as plt from sklearn.model_s...
from ctapipe.utils import get_dataset_path import numpy as np import pytest import os import shutil import pandas as pd from lstchain.io.io import dl1_params_lstcam_key, dl2_params_lstcam_key from lstchain.reco.utils import filter_events import astropy.units as u test_dir = 'testfiles' os.makedirs(test_dir, exist_ok...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import contextlib DEPS = [ 'depot_tools/git', 'file', 'gsutil', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_...
# -*- coding: utf-8 -*- import urllib.request, urllib.error, urllib.parse from time import sleep from random import randint import re from html.parser import HTMLParser import json import os from spotipy import Spotify from spotipy.oauth2 import SpotifyClientCredentials import sys """ This program will look for mentio...
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018 # # 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 # r...
# Copyright 2017 Capital One Services, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
from neo4j_engine import Neo4JEngine from os import path import pandas as pd import numpy as np import pathlib from utils import parse_data, extract_gpa_data, merge_gpa_data from tqdm import tqdm # not official courses, but need to be taken into account special_prereqs = ['THREE YEARS OF HIGH SCHOOL MATHEMATICS', 'ON...
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: omr/evaluators.py # Purpose: music21 module for evaluating correcting of output from OMR software # # Authors: <NAME> # <NAME> # # Copyright: Copyright © 2014 <NAME>, <NAME...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2017 <NAME>- Grupo de Sistemas Inteligentes # gzhu[at]dit.upm.es # DIT, UPM # # 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...
import os def test_simple_prefix(): from params_proto.neo_proto import ParamsProto class Root(ParamsProto, cli=False): _prefix = "not_root" assert Root._prefix == "not_root" assert Root(_prefix='yo')._prefix == "yo" class Root2(ParamsProto, prefix="this", cli=False): pass a...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
from bolsonaro.models.omp_forest import OmpForest, SingleOmpForest from bolsonaro.utils import binarize_class_data, omp_premature_warning import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import OrthogonalMatchingPursuit import warnings class OmpForestBinaryClassifier(S...
################################################################################ # Copyright (c) 2017 <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 restr...
import torch from torch import nn from torch.nn import init import torch.nn.functional as F import math from torch.autograd import Variable import numpy as np from .deeplab_resnet import resnet50_locate from .vgg import vgg16_locate config_vgg = { "convert": [[128, 256, 512, 512, 512], [64, 128, 256, 512, 512]],...
#!/usr/bin/env/ python ################################################################################ # Copyright (c) 2017 <NAME> # This file is part of gadmpy. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "...
"""Authenticatior class implementations""" from abc import abstractmethod from http import HTTPStatus import reprlib import json from typing import Optional, Tuple from aiocometd import AuthExtension from aiocometd.typing import JsonObject, JsonLoader, JsonDumper, Payload, \ Headers from aiohttp import ClientSessi...
import datetime import functools import re from typing import Callable, Iterable, Tuple, Union, cast import dateparser import gamla import inflect import number_parser import phonenumbers import pyap import spacy import agenda _nlp = spacy.load("en_core_web_lg") @functools.cache def _cached_inflect_engine(): r...
import sys import json import platform from pathlib import Path from contextlib import contextmanager import pytest import npmenv # TEST DATA EXAMPLE_PACKAGE = 'to-no-case@1.0.2' # Tiny package with no dependencies EXAMPLE_PACKAGE_WITH_SCRIPT = 'username-cli@2.0.0' # Tiny with a script PACKAGE_JSON = '''{ "p...
import os import numpy as np import tensorflow as tf import bundle_entropy import icnn_nets_dm from replay_memory import ReplayMemory flags = tf.app.flags FLAGS = flags.FLAGS # Input Convex Neural Network class Agent: def __init__(self, dimO, dimA): dimA = list(dimA) dimO = list(dimO) ...
from __future__ import division from __future__ import absolute_import import six __copyright__ = """ Copyright (C) 2014 <NAME> """ __license__ = """ 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 Softwa...
import argparse import logging import sys from typing import Any, Dict, List, Optional import annofabapi import pandas from annofabapi.models import OrganizationMember, Project from more_itertools import first_true import annofabcli from annofabcli import AnnofabApiFacade from annofabcli.common.cli import ( COMMA...
import os import time import warnings import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import classification_report from sklearn.metrics import accuracy_score, roc_auc_score, f1_score from sklearn.model_selection import cross_val_score from imblearn.ove...
from collections import namedtuple from typing import Union, Optional, Any import torch import torch.nn as nn from torch.ao.quantization.fake_quantize import ( FakeQuantize, default_fake_quant, default_per_channel_weight_fake_quant, default_weight_fake_quant, default_fused_act_fake_quant, defau...
from enum import IntFlag from typing import List, Optional, Union from .operation import Operation from .utils import check_ed25519_public_key from ..keypair import Keypair from ..signer import Signer from ..strkey import StrKey from ..utils import pack_xdr_array, unpack_xdr_array from ..xdr import Xdr __all__ = ["Fl...
import typing as t from typing import TYPE_CHECKING import numpy as np from simple_di import inject from simple_di import Provide from bentoml import Tag from bentoml import Runner from bentoml.exceptions import BentoMLException from bentoml.exceptions import MissingDependencyException from ..models import Model fro...
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
from monk.system.imports import * @accepts(post_trace=False) #@TraceFunction(trace_args=True, trace_rv=True) def get_base_system_dict(): system_dict = {}; system_dict["verbose"] = 1; system_dict["cwd"] = False; system_dict["master_systems_dir"] = False system_dict["master_systems_dir_relative"] =...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 23 21:12:52 2020 @author: sabkhalid """ # Airflow module from airflow.operators.python_operator import PythonOperator from airflow.models import DAG from bs4 import BeautifulSoup import urllib.request as urllib2 import re import os import os.path...
import os import six import json import gramex import tornado.gen from oauthlib import oauth1 from orderedattrdict import AttrDict from tornado.web import HTTPError from tornado.auth import TwitterMixin, FacebookGraphMixin from tornado.httputil import url_concat, responses from .basehandler import BaseHandler from gram...
""" Implementations of layer 4 attack methods of MHDDoS. """ import time from contextlib import suppress from itertools import cycle from os import urandom as randbytes from random import choice, randbytes from random import randint from socket import (AF_INET, IP_HDRINCL, IPPROTO_IP, IPPROTO_TCP, IPPROTO_UDP, SOCK_DGR...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import csv import math import random from dataclasses import dataclass from functools im...
from .rxdException import RxDException from neuron import h try: from . import geometry3d, dimension3 except: pass import copy import itertools import numpy from . import geometry as geo import weakref from . import initializer import warnings _all_regions = [] _region_count = 0 def _sort_secs(secs): # sort t...
# Copyright (c) Open-MMLab. All rights reserved. import io import os.path as osp from pathlib import Path import cv2 import numpy as np from cv2 import IMREAD_COLOR, IMREAD_GRAYSCALE, IMREAD_UNCHANGED from mmdet.cv_core.utils import check_file_exist, is_str, mkdir_or_exist try: from turbojpeg import TJCS_RGB, TJ...
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring,line-too-long,unused-argument import os import pathlib import shutil import sys import tempfile from pathlib import Path from unittest import mock import pytest from eze.utils.io import ( get_absolute_filename, prett...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. """ Userbot module for having some fun with people. """ from asyncio import sleep from random import choice, getrandbits...
#!/usr/bin/env python3 """Dynamic dns to ip address firewall rule creator. Resolve dynamic dns names into ips and automatically create/destroy firewall rules. Script requires to run as super user in order to be able to create the firewall rules. Requirements: The following packages should be installed and enable...
# coding:utf-8 """ 所有功能模块的基类,包含一些工具、请求对象、配置对象 主要放置一些基类 """ __author__ = 'BLUE' __time__ = 'Sun Oct 28 2018 21:14:44 GMT+0800' # ------------------------------------------------------------------------ import time import string import random from .WechatConf import WechatConf from .WechatRequest import WechatRequest fr...
import cv2 import mediapipe as mp import triangulation_media_pipe as tmp import numpy as np mp_drawing = mp.solutions.drawing_utils mp_face_mesh = mp.solutions.face_mesh change_face_list = ["jim_carrey.jpg", "bradley_cooper.jpg", "trump.jpg"] MAX_FACESWAP_IMAGES = len(change_face_list) - 1 def load_base_img(face_mes...
# Author : <NAME> # Date : 19/02/2018 # Version : 1.02.1 import pandas as pd import pprint as pprint import json import sys import os try: from tqdm import tqdm except ImportError: print("Warning : tqdm module not available, the nice little progress bar won't show up :(") tqdm = lambda x,total : x VERSION...
"""Functions to visualize human poses""" import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation, ImageMagickWriter from mpl_toolkits.mplot3d import proj3d import cv2 def get_3d_axes(*subplot): """ Creates a 3D Matplotlib axis. The arguments are the same as of the `...
import json import time import yaml import calendar from clickclick import print_table, OutputFormat, action, secho, error, ok, info # fields to dump as literal blocks LITERAL_FIELDS = set(['command', 'condition', 'description']) # custom sorting of YAML fields (i.e. we are not using the default lexical YAML order...
# Copyright 2019, The TensorFlow Federated 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 o...
""" Bidirectional dataloader """ import sys sys.path.append('../') import time from copy import deepcopy import tensorflow as tf from utils.encode.encoder import START, NEXTCAPTION_START from utils.model_utils import get_shape_list, encode_string, lightweight_image_augment, sample_bernoulli, resize_and_pad, pad_to_fi...
# -*- coding: utf-8 -*- """ # @Time : 07/07/18 10:30 PM # @Author : <NAME> # @FileName: Classfication_model.py # @Software: PyCharm # @Github : https://github.com/hzm2016 """ import gym import gym.spaces from sklearn.neural_network import MLPClassifier import numpy as np import tensorflow as tf import pandas as ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # TensorFlow Chessbot # This contains ChessboardPredictor, the class responsible for loading and # running a trained CNN on chessboard screenshots. Used by chessbot.py. # A CLI interface is provided as well. # # $ ./tensorflow_chessbot.py -h # usage: tensorflow_chess...
# -*- coding: utf-8 -*- """ Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Kodi library integration: items library SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from __future__ import absolute_import, division,...
from flask import Flask, render_template, request, Blueprint,send_from_directory,session,redirect,url_for,jsonify import os from random import randint import binascii import time from similarUI import SimilarUIBOW,similarUIUtility # from similarUI import SimilarUIBOWTest from helpers import StrokeParse import...
import pkgutil import platform import random import re import hunspell from consolemenu.screen import Screen from typing import List, TypeVar from wordfreq import word_frequency def setup_spellchecker(): if platform.system() == 'Windows': raise Exception('Your OS is not currently supported.') elif pla...
# import the necessary packages import random, string import datetime, copy import credentials from azure.storage import CloudStorageAccount from azure.storage.table import TableService, Entity from azure.storage.blob import BlockBlobService, PageBlobService, AppendBlobService import cropdata1440 #defines ball crops -...
"""Structures for representing cloud resources and references within the framework """ from functools import wraps from typing import List, Optional, Any from enum import Enum from core.constructs.models import ImmutableModel from core.constructs.cloud_output import OutputType, Cloud_Output_Str from core.constructs....
# -*- coding: utf-8 -*- import datetime import pandas as pd import numpy as np from dateutil.parser import parse as parse_datetime from dateutil.relativedelta import relativedelta from six import string_types, integer_types, PY2, binary_type def iterable(it): return hasattr(it, "__next__") or hasattr(it, "__it...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Some math formula for various calculations """ import sys import numpy as np from math import log, exp, sqrt from jcvi.utils.cbook import human_size def mean_confidence_interval(data, confidence=0.95): # Compute the confidence interval around the mean impor...
import collections import functools import inspect import io import typing class Buffer(typing.Sized): def __init__(self) -> None: self.queue = collections.deque() # type: collections.deque[bytes] self.position = 0 def write(self, chunk: bytes) -> None: self.queue.append(chunk) ...
# encoding: utf-8 """ @author: huayuxiu RCLSTM block """ import torch from torch import nn # from torch.autograd import Variable from torch.nn import functional, init import numpy as np import random import math # generate mask matrix based on uniform distribution def generate_mask_matrix(shape, connection=1.): ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, <NAME> <<EMAIL>>, and others # # 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,...
import distutils.cmd import glob import os import pathlib import shutil import subprocess import sys import tempfile import urllib.request import zipfile from distutils.command import build from setuptools import setup from setuptools.command import develop # TODO: change this to something more stable when available...
import base64 import hashlib import datetime import msgpack from utils import dictargs, utcnow import config from key import key ALIAS_ACCESS = "alias/access" ALIAS_AUTHZ = "alias/authorize" ALIAS_BIND = "alias/bind" ALIAS_CERT = "alias/crt" ALIAS_REFRESH = "alias/refresh" ALIAS_REGISTER = "alias/register" ALIAS_REV...
import os import sys import glob import argparse import numpy as np import pandas as pd ## Filtering of speed, position, **sampling rate differs across trials! ##Global variable for adjusting offsets between beacon position and rat position for FS04 x_max, x_min = 0.2, -0.76 x_offset = x_max - (x_max - x_min)/2 y_ma...
import os import sys from flask import Flask import requests as r import time import json from signal import signal, SIGINT import threading from datetime import datetime import numpy as np import math ##globals## threads = 8 threadL = [] orderAddr = [] order = [] startTimes = [] mainThread = None totalAddr = None t...
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
# Copyright (C) 2007-2011 <NAME> # URL: <http://www.cs.famaf.unc.edu.ar/~francolq/> # For license information, see LICENSE.txt import itertools import nltk from nltk.util import LazyMap from . import util from . import wsj class WSJn(wsj.WSJ): def __init__(self, n, basedir=None, load=True, extra_tags=None): ...
from pycocotools.coco import COCO import numpy as np import logging import os import sys import cv2 import shutil import json """ COCO SUPPORT """ def _mapSubject(annotation,mapping): """ map annotation category_id to a subject :param mapping: :param annotation: :return: @type mapping: dict ...
import re import warnings from http.client import responses from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Set, Tuple, Type from pydantic import BaseModel from pydantic.schema import model_schema as pydantic_model_schema from ninja.constants import NOT_SET from ninja.errors import ConfigError...
#!/usr/local/bin/python3 # this is the grunt git-based run tool user-script: https://github.com/emer/grunt # it must be checked into your local source repository and handles any user commands # including mandatory submit and results commands. # # script is run in the jobs path: # ~/grunt/wc/server/username/projname/jo...
# Copyright 2016 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 applicable law ...
# pylint: disable=wrong-or-nonexistent-copyright-notice """Demonstrates the algorithm for solving linear systems by Harrow, <NAME> (HHL). The HHL algorithm solves a system of linear equations, specifically equations of the form Ax = b, where A is a Hermitian matrix, b is a known vector, and x is the unknown vector. To...
# All Rights Reserved. # Copyright 2019 HoneycombData 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...
import PyQt5.QtWidgets as qtw from PyQt5 import QtCore, QtGui import pyqtgraph.opengl as gl from pyqtgraph import Transform3D from vizualization.customClasses import GLAxisItemOwn, SegmentItem, GLViewWidgetWithText import numpy as np import pyqtgraph as pg # %% Visualization with pyqtgraph colorVecs = [ [0.5, 1, 1, ...