text stringlengths 6.04k 39.5k |
|---|
#! /usr/bin/env python3
import cv2
import yaml
import rospy
import rospkg
import numpy as np
from copy import deepcopy
from threading import Lock
from cv_bridge import CvBridge
from collections import deque
from sensor_msgs.msg import Image
from bitbots_msgs.msg import ColorLookupTable, Config
from bitbots_vision.visi... |
#!/usr/bin/env python3
import pandas as pd
import numpy as np
import logging
import argparse
import textwrap
import sys
import os
from pathlib import Path
import xlsxwriter
import json
import ast
def init():
global parser
parser = argparse.ArgumentParser( prog='prometheus_comparison.py', description=textwrap.dede... |
#!/usr/bin/env python
import os, sys, inspect
# pythonpath=os.path.realpath(os.path.abspath(os.path.join(os.getenv('OMNIVOR_MKF_DIR', './'),'_PythonPath')))
pythonpath=os.path.realpath(os.path.abspath(os.path.join('./','_OmnivorPythonPath')))
sys.path.insert(0, pythonpath)
#
from matplotlib.pylab import *
from numpy im... |
#!/usr/bin/python3
from __future__ import print_function
import os
from frc971.control_loops.python import basic_window
from frc971.control_loops.python.color import Color, palette
import random
import gi
import numpy
gi.require_version('Gtk', '3.0')
from gi.repository import Gdk, Gtk
import cairo
import graph_generat... |
"""Run spectral fits with Gammapy and sherpa."""
import logging
from pathlib import Path
import numpy as np
from time import time
import copy
import astropy.units as u
from .models import Log10Parabola
from gammapy.spectrum import SpectrumFit
from . import utils
import sherpa.astro.datastack as sh
from .conf import con... |
#!/usr/bin/env python
# Copyright 2016 VMware, 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 ... |
# MIT License
#
# Copyright (c) 2021 <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, publi... |
from dataclasses import dataclass
@dataclass
class var:
type: str
address: str
addr_offset: int
val: int
class Compiler:
def __init__(self,file):
self.file = file
with open(file,"r") as f:
lines = f.read().split(";")
out = []
for i in lines:
... |
# -*- coding: utf-8 -*-
# 170401009 <NAME>
# python3 ile kodlandı.
import decimal
import itertools # RANGE STEPLERİ İNT DEĞER KABUL EDİYOR SADECE
# FLOAT BİR DEĞERLE İLERLETMEK İÇİN SEQ FONKSİYONU EKLENDİ
veriler_x = [[]]
veriler_y = [[]]
katsayilar_matrisi = []
def dosya_oku(dosya="veriler.txt", veriler_x=veri... |
from .utils import dotdict, json_clone
from bson import ObjectId
from bson.codec_options import CodecOptions
from pymongo import ReadPreference, WriteConcern, ReturnDocument, read_preferences
import collections
import base64
from .document import Document
from .exceptions import MultipleResultsFound, ImmutableDocumentE... |
# Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
from six.moves import configparser
import six
import json
import os
import sys
import jq
import requests
from jenkinsapi.jenkins import Jenkins
import gluetool
from gluetool import GlueError
from gluetool.log import log_dict
... |
"""
file: subnet-calculator.py
Usage: subnet-calculator.py
description: This program will calculate possible subnets
and their details based user inputs
language: python3
author: <NAME> (<EMAIL>)
"""
import sys
class IP(object):
"""
IP object
"""
__slots__ = 'ip_decimal', 'ip_binary',... |
# -*- coding: utf-8 -*-
#############################################################################
# __________ #
# __ __/ ____/ __ \__ __ This file is part of MicroGP4 v1.0 "Kiwi" #
# / / / / / __/ /_/ / // / (!) by <NAME> and <NAME> #
# /... |
import time
import torch
torch.set_printoptions(precision=7)
from addict import Dict as adict
from torch.nn import functional as F
from zerovl.core import DistHook, HookMode, WandbHook
from zerovl.core.hooks.log import LogHook
from zerovl.core.runners.builder import RUNNER
from zerovl.core.runners.epoch_runner impor... |
"""Training script for multi-gpu training PSPNet/ResNet-101 with SegSort."""
from __future__ import print_function
import argparse
import math
import os
import time
import utils.general
from utils.logger import Logger
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from t... |
'''
Utilities for bitcoin tests.
Copyright 2019-2020 DeNova
Last modified: 2020-12-08
'''
import os
import shutil
from datetime import datetime, timedelta
from subprocess import CalledProcessError
from time import sleep
from django.core.management import call_command
from django.utils.timezone import now... |
from __future__ import absolute_import, print_function, division
import base64
import numpy as np
import tensorflow as tf
from niftynet.layer.grid_warper import AffineGridWarperLayer
from niftynet.layer.resampler import ResamplerLayer
from tests.niftynet_testcase import NiftyNetTestCase
test_case_2d_1 = ... |
"""
ImagingDataObject for visanalysis data files.
Associated with an hdf5 data file and series number
https://github.com/ClandininLab/visanalysis
<EMAIL>
"""
import functools
import os
import h5py
import numpy as np
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import seaborn as sns
import sc... |
# logic_puzzles.py
from logic_puzzle_tools import *
'''
A general puzzle solver with a permutation generator
and associations and relationships.
'''
def einstein ():
'''
Einstein puzzle
There are five houses in a row in different colors.
In each house lives a person with a different ... |
import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import cv2
import Line
import ImageAnalyzer
class LaneTracker:
def __init__(self):
self.line_left = Line.Line()
self.line_right = Line.Line()
self.image = None
#TODO: modify this method to read con... |
import datetime
import sys
from unittest import mock
from botocore.exceptions import ClientError
import boto3
import flask
from moto import mock_s3
import pytest
from freezegun import freeze_time
from io import BytesIO
from urllib.parse import parse_qs, urlparse
from dmutils.s3 import S3, get_file_size, default_regio... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 25 18:18:21 2017
Energy and Jacobian
@author: amit
"""
import vtk as v
import matplotlib.pyplot as plt
from numba import jit
from numpy import zeros, array, arcsin, sin, cos, pi, logspace, mean, \
absolute, sqrt
from numpy.linalg import norm... |
import math
import numpy as np
import cv2
from operator import itemgetter
from hailo_model_zoo.core.postprocessing.centerpose_postprocessing import centerpose_postprocessing
BODY_PARTS_KPT_IDS = [[1, 2], [1, 5], [2, 3], [3, 4], [5, 6], [6, 7], [1, 8], [8, 9], [9, 10], [1, 11],
[11, 12], [12, 13... |
#!/usr/bin/python3
import sys
sys.path.append('../')
import argparse
import os
import time
from loguru import logger
import cv2
import numpy as np
import torch
from multiprocessing import Process
from yolox.exp import get_exp
from yolox.utils import fuse_model, get_model_info
from PARAMETERS import *
from subvision.yol... |
# Copyright 2021 The PyMC Developers
#
# 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 ag... |
from io import BytesIO as StringIO
from twisted.internet.protocol import ClientFactory
from twisted.web import http
from twisted.application import service
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet import defer, error
from .policies import TCPKeepAliveMixin
from .logging import l... |
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from datetime import datetime
from django.views.generic import ListView, DetailView
from django.views.generic.edit import FormView, DeleteView
from django.core.exceptions import PermissionDenied
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.urls import reverse_lazy
from nu... |
# Copyright (C) 2020 The Android Open Source Project
#
# 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 sys
import random
import math
import copy
#### FUNCTIONS #########
###################
#### Supplementary function to compute dot product
###################
def dotproduct(u, v):
assert len(u) == len(v), "dotproduct: u and v must be of same length"
dp = 0
for i in range(0, len(u), 1):
dp +... |
#Endpoints to different Pages/Endpoints
import json
import re
import requests
from operator import countOf
from builtins import Exception
from flask import Flask, request, flash, url_for, redirect, render_template, jsonify,session
from sqlalchemy.orm.exc import MultipleResultsFound
from . models import Articles, db, A... |
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Merge and denoise dwi images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_dwi_preproc_wf
.. autofunction:: init_dwi_derivatives_wf
"""
from nipype impor... |
from typing import Optional, Tuple, List, Union
import pandas as pd
import numpy as np
import seaborn as sns
import sklearn
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from sklearn.preprocessing import StandardScaler
import plotly.graph_objs as go
import... |
from enum import Enum
class OrderedEnum(Enum):
def __ge__(self, other):
if self.__class__ is other.__class__:
return self.value >= other.value
return NotImplemented
def __gt__(self, other):
if self.__class__ is other.__class__:
return self.value > other.va... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import numpy as np
import numpy.random as npr
import random
import os
import cv2
import math
from detectron.core.config import cfg
import detectron.modeli... |
#!/usr/bin/env python
# A quick start at a smart grading program
import re as re
from difflib import ndiff
from enum import Enum
from math import cosh, exp, log
from lark import Lark
# from WSUAutograder import TestCase, TestResult
TOKEN_GRAMMER = '''
start: (float | int | word | space)*
INTEGER: "0".."9"+
SPACE: ... |
import os
import sys
import numpy as np
from tqdm import tqdm
import math
import pickle
from IPython import embed
import torch
import random
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
from collections import defaultdict
import heapq... |
#!/usr/bin/env python
# Copyright (c) 2017, DIANA-HEP
# 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/26 00:32
# @Author : <NAME>
# @Site : www.nanosparrow.com
# @File : stock_manager
# @Software: PyCharm
import tushare as ts
import traceback
import threading
from queue import *
from pandas import *
from database_manager.database_manager import *... |
import numpy as np
import numpy.linalg as la
import scipy.signal as scisig
import random
from func import *
import time
from sympy import symbols, Matrix, Poly, zeros, eye, Indexed, simplify, IndexedBase, init_printing, pprint
from operator import mul
from functools import reduce
def At(a,m,n):
return Matrix(m, ... |
from ..logger import LoggingHandler
from .framework import MultiCurveTabularWindowedPredictor
from ..utils import clear_tf_mem
from keras.models import Sequential
from keras.layers import LSTM, Dense, TimeDistributed, Reshape
from keras.callbacks import Callback
from sklearn.preprocessing import MinMaxScaler
impo... |
from objects.qubit import Qubit
# DATA TYPES
from components.logger import Logger
from components.network import Network
from objects.packet import Packet
import numpy as np
import random
# CONSTANTS
GENERATE_EPR_IF_NONE = 'generate_epr_if_none'
AWAIT_ACK = 'await_ack'
SEQUENCE_NUMBER = 'sequence_number'
PAYLOAD = 'p... |
import collections
import pysam
from genomeview.track import Track
from genomeview.intervaltrack import Interval, IntervalTrack
from genomeview import MismatchCounts
from genomeview.utilities import match_chrom_format
def allreads(read):
return True
def color_by_strand(interval):
# brightness = 0.2 + (cur_r... |
import contextlib
import datetime
import sys
import time
from collections import Counter
from couchdbkit import ResourceConflict
from couchexport.export import FormattedRow, get_writer
from couchexport.models import Format
from dimagi.utils.logging import notify_exception
from soil import DownloadBase
from corehq.ap... |
from . import AbstractPlugin
from ..elasticsearch_wrapper import elastic_conn
from datetime import datetime
from django.http import HttpResponse
from neogeo_xml_utils import ObjToXML
from neogeo_xml_utils import XMLToObj
from pathlib import Path
import re
from requests.auth import HTTPBasicAuth
from requests import get... |
"""Serverless module."""
from __future__ import annotations
import argparse
import logging
import os
import re
import subprocess
import sys
import tempfile
import uuid
from pathlib import Path
from typing import IO, TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union, cast
import yaml
from .._logging import Pr... |
# Most code in this file was shamelessly borrowed from MoviePy
# http://zulko.github.io/moviepy/
# The MIT License (MIT)
#
# Copyright (c) 2015 Zulko
# Copyright (c) 2015-2016 CNRS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... |
import io
import pytest
from werkzeug import urls
from werkzeug.datastructures import OrderedMultiDict
def test_parsing():
url = urls.url_parse("http://anon:hunter2@[2001:db8:0:1]:80/a/b/c")
assert url.netloc == "anon:hunter2@[2001:db8:0:1]:80"
assert url.username == "anon"
assert url.password == "<... |
"""
--------------------------------------------------------------------------------------------------------------------
This program creates 2D light effects onto a pygame surface/image (32 bit PNG file encoded with
alpha channels transparency).
The files radial4.png, RadialTrapezoid, RadialWarning are controlling... |
"""This module contains the general information for HuuFirmwareUpdater ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class HuuFirmwareUpdaterConsts:
ADMIN_STATE_TRIGGER = "trigger"
ADMIN_STATE_TRIGGERED = "triggered"
... |
# 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... |
import os
import sys
import time
import shutil
import subprocess
import ConfigParser
from oeqa.oetest import oeRuntimeTest
from apprt_nodejs_runtime_log_parser import print_test_results
from apprt_nodejs_runtime_log_parser import parse_test_cases
from apprt_nodejs_runtime_log_parser import write_test_results
from nod... |
# coding: utf-8
from __future__ import unicode_literals
# NeoNippori - Danmaku to ASS converter for "Unlicense"d applications
import io
import json
import math
import random
import re
import xml.dom.minidom
import xml.etree.ElementTree as ET
from .version import __version__
def noop(*a, **b):
return
NICONICO_... |
"""
stdint
======
Although Python has native support for arbitrary-precision integers,
Javascript by default uses 64-bit floats as the only numeric type,
signifying they cannot store more than 53 integral bits.
Therefore, in Javascript, 64-bit integers are stored as an array
of 2 numbers. ... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding: utf-8
# Copyright 2014 Orange
#
# 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
#
# Un... |
import json
from io import SEEK_CUR
from d2lib.classes import CLASS_NAMES, CLS_NECROMANCER
from d2lib.errors import D2SFileParseError, ItemParseError, StashFileParseError
from d2lib.item import Item
from d2lib.items_storage import ItemsDataStorage
from d2lib.skills import SKILL_NAMES, SKILL_OFFSETS
from d2lib.utils im... |
"""Functions to convert objects between PyAmf and AmFast."""
import pyamf
import pyamf.remoting as pyamf_remoting
import pyamf.flex.messaging as pyamf_messaging
import amfast
import amfast.class_def as class_def
import amfast.remoting as amfast_remoting
import amfast.remoting.flex_messages as amfast_messaging
class ... |
# guide the flow
import os
import subprocess as sp
from nexus import obj
from lxml import etree
def nscf_input_from_scf_input(scf,scf_inputs,suffix='-scf'):
""" take an scf simulation object along with the inputs for it, create an nscf simulation to generate orbitals only at kpoints needed for wavefunction.
Args:... |
from collections import defaultdict
from datetime import datetime, timedelta
import logging
from multiprocessing import Pool
import pathlib
import warnings
import tarfile
import tempfile
from time import time
from typing import Union
import urllib
from appdirs import user_data_dir
import boto3
from botocore import UNS... |
from django.http import JsonResponse
# django basic tools
from django.contrib.auth import authenticate
from django.http import HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
# for auth
from dja... |
'''
Single-GPU training.
'''
import argparse
import cv2
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import importlib
import os
import sys
import h5py
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = BASE_DIR
sys.path.append(os.path.join(... |
import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="",
database="test"
)
db_req2= mydb.cursor()
db_req2.execute("select * from enseignants")
enss=db_req2.fetchall()
db_req= mydb.cursor()
db_req.execute("DELETE from generation_scheduals")
db_req= mydb.curso... |
import math
from collections import defaultdict
from dataclasses import dataclass
from typing import Dict, List, Optional, Any, Set
import networkx as nx
import numpy as np
from arbor.arbor import BaseArbor, ArborNX, FlowCentrality
from arbor.arborparser import ArborParser
def id_generator(start=0):
while True:... |
import argparse
import collections
import os
import platform
import sys
from . import defs
from . import util
from . import pgnames
from . import system_internal
from . import station
from . import db_sqlite3
from . import env_backend as eb
from . import filtering
# Convenience and backwards compatibility
from .util i... |
import argparse
import cv2 as cv
import hashlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import os
import readline # Don't remove !! For prompt of input() to take effect
import sys
import toolz
import urllib.error
import urllib.parse
import urllib.request
import uuid
f... |
#:coding=utf-8:
from unittest import TestCase
import redis
import redis_mock
__all__ = (
'RedisMockStringTest',
'RedisMockListTest',
'RedisMockSetTest',
'RedisMockHashTest',
'RedisPipelineTest',
)
class RedisMockStringTest(TestCase):
def setUp(self):
self.mock = redis_mock.Redis()
... |
'''
# Versions
# PA1 First version 09/11/18
# PA2 Try to fix multiprocessing crash 11/11/18
# PA3 change color green Vector and line graph to red 12/11/18
add "s" to draw square remove import log of
Processplotter
# PA4 Add c... |
""" Default configurations for faceswap.
Extends out :class:`configparser.ConfigParser` functionality by checking for default
configuration updates and returning data in it's correct format """
import logging
import os
import sys
import textwrap
from collections import OrderedDict
from configparser import Con... |
import os
import argparse
import numpy as np
import pandas as pd
from time import time
from scipy.stats import norm
from scipy.spatial.distance import euclidean
from editing_dist_n_lcs_dp import edit_distance
from editing_dist_n_lcs_dp import lcs
#global variables
# BREAK_POINTS = []
# LOOKUP_TABLE = []
... |
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 7 13:41:20 2018
@author: HUST
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 3 10:25:36 2018
@author: HUST
"""
import time
import random
import operator
import numpy as np
import pandas as pd
# import lightgbm as lgb
import xgboost as xgb
from sklearn.cross_valida... |
import re
import sys
import json
import uuid
import sqlite3
from datetime import datetime, timedelta
from hashlib import sha256, md5
from geoip import geolite2
from modularodm import Q
from website.app import init_app
from website.models import User, Node, NodeLog
from website.util.metrics import get_entry_point
fr... |
"""
This is app.py the main file for flask to run.
Here all the routes of the app are defined and setup.
"""
import os
import uuid
from datetime import datetime
from flask_session import Session
from werkzeug.security import check_password_hash, generate_password_hash
from flask import Flask, redirect, flash, render_te... |
"""
Copyright (c) 2019, <NAME>
Copyright (c) 2019-2020, the Decred developers
See LICENSE for details
PyQt5 utilities.
"""
import re
from PyQt5 import QtCore, QtGui, QtWidgets
from decred.util import helpers
log = helpers.getLogger("QUTIL")
# Some colors,
QT_WHITE = QtGui.QColor("white")
WHITE_PALETTE = QtGui.QP... |
################################################################################
# Copyright (C) 2011-2012,2014 <NAME>
#
# This file is licensed under the MIT License.
################################################################################
"""
Module for the mixture distribution node.
"""
import warnings
im... |
import torch
from data_edge import *
from torch import nn
from torch.nn import init
import torch.nn.functional as F
from torch.autograd import Variable
from config import *
# vgg choice
base = {'dss': [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M']}
# extend vgg choice --- fol... |
# © 2019 University of Illinois Board of Trustees. All rights reserved
from more_itertools import peekable
import vcf
import ast
from ReferenceCache import ReferenceCache
import argparse
import logging
def modifyFeatures(record, newStart, newStop, cache):
cache.chrom = record['chromosome'];
allelicMapping = ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
@author: <NAME>
'''
import sys
import numpy as np
import pandas as pd
# import statsmodels.sandbox.stats.multicomp
import statsmodels.stats.multitest
from scipy.stats import hypergeom
# def enrichmentOneSided(GOid, background, subset, GOdict, gafDict, gafSubset, mi... |
# Plotting utilities for output of simulation files
import ipywidgets as ipw
import IPython.display as ipd
import re
import warnings
import tqdm
import numpy as np
import pandas as pd
import scipy.interpolate as sci
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.collecti... |
#!/usr/bin/env python
# https://github.com/thomas-coudrat/toolbx_pdb
# <NAME> <<EMAIL>>
from openeye import oechem #, oemolbase
import os
class Complex:
def __init__(self, pdbPath):
self.pdbPath = pdbPath
self.residues = {}
self.ligand = None
self.pocketResidues = []
self... |
from .PG import PG, PG_Softmax, PG_Gaussian
from .NPG import NPG, NPG_Softmax, NPG_Gaussian
import torch
from torch import nn
from torch.autograd import Variable
import numpy as np
from .Agent import Agent
from .config import AdaptiveKLPPO_CONFIG,PPO_CONFIG
import copy
import abc
from utils.mathutils import explained_v... |
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from transformers import BertTokenizer
from transformers import BertForSequen... |
"""
Script en desuso. Versión no optimizada y sin soporte para volcar información sobre una base de datos.
"""
import argparse
import json
import logging
import sys
from selenium.common.exceptions import TimeoutException, NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.web... |
import copy
import os
import numpy as np
import pandas as pd
import h5py
import pickle as pkl
# import glob
from pathlib import Path
# %% Hyperparameters
DATA_FILE_NAME = 'model_data'
RUN_NAME = 'run'
# data_filetype = 'pkl'
# %% Helper functions
def __unique_to_set(a, b):
"""
Return elements that are unique... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This file is part of CbM (https://github.com/ec-jrc/cbm).
# Author : <NAME>
# Credits : GTCAP Team
# Copyright : 2021 European Commission, Joint Research Centre
# License : 3-Clause BSD
# Created on Sun Oct 31 10:41:24 2021
from ipywidgets import (Text, VBox, Dr... |
"""
OpenVINO Model Experiment Package
"""
import os
from math import exp
import numpy as np
from numpy.lib.stride_tricks import as_strided
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy.ndimage.filters import maximum_filter
from openvino.inference_engine import IECore, IENetw... |
""" CLI for Hyper parameter optimisation
prompt_toolkit run sequential model algorithmic optimisation
based on gaussian processes, random forests etc.
"""
import sys
import GPUtil
import click
import csv
import importlib
import logging
import multiprocessing as mp
import os
from matplotlib import pyplot as plt
from m... |
import math
import time
from util import *
import torch
import torch.utils.data
from torch.utils.data import TensorDataset
from torchsummary import summary
import torch.nn as nn
import sys
from torch.optim import lr_scheduler
import re
import random
import torch.nn.functional as F
#from unet import UNet
from unet2 impo... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import json
import cv2
import cv2.aruco as aruco
import numpy as np
import pyrealsense2 as rs
import sys
import rospy
from std_msgs.msg import Bool
from std_msgs.msg import Float6... |
#from TASSELpy.javaObj import javaObj,genericJavaObj
import TASSELpy.javaObj
from TASSELpy.utils.OrderedSet import lruOrderedSet
from TASSELpy.utils.caching import LRUcache
from functools import wraps,update_wrapper,partial
import numpy as np
import javabridge
import re
if not javabridge.get_env():
from TASSELpy i... |
import abc
import numpy as np
from gym.spaces import Box
from softgym.utils.misc import rotation_2d_around_center, extend_along_center, quatFromAxisAngle
import pyflex
import scipy.spatial
class ActionToolBase(metaclass=abc.ABCMeta):
def __init__(self):
pass
@abc.abstractmethod
def reset(self, st... |
import pygame
from pygamepages import*
from pieces import*
from random import choice
from functools import partial
import json
pygame.init()
pygame.font.init()
pygame.mixer.init()
sound_chanel = pygame.mixer.Channel(1)
def read_json(fname):
with open(fname, 'r', encoding='utf-8') as file:
json_dict = jso... |
"""
GPU driver for C kernels (with CUDA)
To select cuda, use SAS_OPENCL=cuda, or SAS_OPENCL=cuda:n for a particular
device number. If no device number is specified, then look for CUDA_DEVICE=n
or a file ~/.cuda-device containing n for the device number. Otherwise, try
all available device numbers.
TODO: docs are ou... |
import numpy as np
# input format
# convex_list -> [convex,convex,...]
# convex -> [face,face,...]
# face -> [a,b,c,d]
# ax+by+cz+d=0 is the plane
# ax+by+cz+d>0 is the inner part
# generate 18-face-shape
def ballike(x, y, z, a, b, c):
v_center = np.array([-x, -y, -z, 1], np.float32)
v_span = np.array([1/a,... |
import pytest
from pyproj import CRS
from pyproj.exceptions import CRSError
def test_from_proj4_json():
json_str = '{"proj": "longlat", "ellps": "WGS84", "datum": "WGS84"}'
proj = CRS.from_string(json_str)
assert proj.to_proj4(4) == "+proj=longlat +datum=WGS84 +no_defs +type=crs"
assert proj.to_proj4... |
## Copyright [2017] UMR MISTEA INRA, UMR LEPSE INRA, UMR <NAME>, ##
## EPI Virtual Plants Inria ##
## ##
## This file is part of the StatisKit project. More information can be ##
## found at ... |
import matplotlib
matplotlib.use('Agg')
import sample_utils as su
import config
import parse_midas_data
import os.path
import pylab
import sys
import numpy
import diversity_utils
import gene_diversity_utils
import calculate_temporal_changes
import calculate_substitution_rates
import stats_utils
import calculate_sing... |
#!/usr/bin/env python
# MIT License
#
# Copyright (c) 2017 <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, cop... |
#!/usr/bin/env python
"""A sublime-text plugin for saving and loading easy workspaces
This module contains code for the sublime-text plugin EasyWorkspace.
EasyWorkspace aims to provide an easier way for saving and loading workspaces
in sublime-text. The native sublime-text workspace functionality, while useful in
so... |
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QRect, QSize, pyqtSignal, QRectF, Qt, QPoint, QTimer
from PyQt5.QtGui import QIcon, QPixmap, QPainter, QImage, QColor, QPen, QBrush
from PyQt5.QtWidgets import (QWidget, QLabel, QPushButton, QApplication,
QSizePolicy, QHBoxLayout, QSl... |
from copy import copy
from io import UnsupportedOperation
import os
import struct
import numpy as np
from nptdms import types
from nptdms.common import toc_properties
from nptdms.log import log_manager
log = log_manager.get_logger(__name__)
_struct_unpack = struct.unpack
RAW_DATA_INDEX_NO_DATA = 0xFFFFFFFF
RAW_DATA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.