text
stringlengths
3.07k
22.1k
import argparse from collections import namedtuple from itertools import count import os, sys, random import numpy as np import gym import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Normal from tensorboardX import SummaryWriter device = 'cu...
#This script is intended to find the top and the mid pedestal of the H mod plasma profile for the pre and post processing of the simulation #Developed by <NAME> on 02/03/2020 import numpy as np import matplotlib.pyplot as plt import scipy.optimize as opt import re from max_stat_tool import * # some_file.py import sys...
import os os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'google-cloud.json' from drive2 import Drive2 from flask_app.legacy.models import Game, Player, Schedule from flask_app.group_select.selection import Group from flask_app import za_app from flask_app.legacy import routes def delete_all(game_id: str): prin...
import numpy as np import torch class MergeLayer(torch.nn.Module): def __init__(self, dim1, dim2, dim3, dim4): super().__init__() self.fc1 = torch.nn.Linear(dim1 + dim2, dim3) self.fc2 = torch.nn.Linear(dim3, dim4) self.act = torch.nn.ReLU() torch.nn.init.xavier_normal_(se...
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2014-2015 <NAME> <<EMAIL>> # # diffoscope 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 ...
"""Utilities for formatting API responses and model objects, for convenience/readability when exploring data. Not used directly by API functions. These functions will accept any of the following: * A JSON response * A list of response objects * A single response object """ import json from copy import deepcopy from d...
'''--------------------------- Core Script ---------------------------------''' ''' Description: This library is based on the algorithms described in [1] <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (2016). Matrix Profile I: All Pairs Similarity Joins for Ti...
# -*- coding: utf-8 -*- """This module defines classes for handling mode data.""" import numpy as np __all__ = ['Mode', 'Vector'] class VectorBase(object): """A base class for :class:`Mode` and :class:`Vector`. This base class defines some shared methods, such as scalar multiplication or addition of mo...
from thread import * from flask import * import json import string import datetime import time import configparser from flask_login import * from flask.ext.login import (LoginManager, UserMixin, login_required, login_user, logout_user, current_user) import hashlib import flask.ext.login import Config import EventList ...
#!/usr/bin/python2 from github import Github, BadCredentialsException, UnknownObjectException from cerberus import Validator from config_schema import schema from ruamel.yaml import YAML import os import re import tempfile import requests import argparse import logging as log import json import getpass import hashlib i...
from priorityqueue import PriorityQueue from math import sqrt from pygame import Color import configparser # Konfiguration config = configparser.ConfigParser() config.read('config.ini') WHITE = Color(config['COLOR']['WHITE']) BLUE = Color(config['COLOR']['BLUE']) GREEN = Color(config['COLOR']['GREEN']) RED = Color(co...
#!/usr/bin/env python3 """ Note: To Run this script gui should be opened with path: cd LANforgeGUI_5.4.3 (5.4.3 can be changed with GUI version) pwd (Output : /home/lanforge/LANforgeGUI_5.4.3) ./lfclient.bash -cli-socket 3990 Note: This script is used to create a DUT in chamber view. M...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright 2013 <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 requ...
import datetime import json import os import pytz from django.conf import settings from django.core.files import File from ..models import Media, Tweet, User from ...core.utils import truncate_string from ...core.utils.downloader import DownloadException, filedownloader # Classes that take JSON data from the Twitter...
#!/usr/bin/python # -*- coding: utf-8 -*- """ get mapbox files, draw POIs and merge to pdf. (linkz 2019) usage: ./getmap.py <TDoA-LAT> <TDoA-LON> <known-LAT> <known-LON> <map-style> <filename> known bug: maximum 24 mapmarkers are allowed at this time : fixed for IQ recordings < 22 """ import sys import os import json ...
import sys import queue import signal import threading from tkinter import StringVar import tkinter as tk from tkinter.scrolledtext import ScrolledText from tkinter import ttk, VERTICAL, HORIZONTAL, N, S, E, W from tkinter import filedialog import synchdir defaultSrc = "D:/Backup/e/news" defaultDst = "E:/Backup/e/new...
import sys import struct import socket from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtNetwork import * from proto.grSim_Packet_pb2 import grSim_Packet from proto.grSim_Commands_pb2 import grSim_Commands, grSim_Robot_Command #This can act as a template for later. #TODO: Merge the code from clientRec...
#!/usr/bin/env python3 import collections import itertools import json import logging import re import sys import click TypedProperty = collections.namedtuple( 'TypedProperty', [ 'interface', 'property', 'type', 'comment', ], ) _GEO_POINT_TYPE = '{lat: number, lon: number}...
"""integration tests for read-in and writing for RPG files""" # - compare key data in generated NetCDF with reference NetCDF file # - check run for missing brt or blb file # - check run for missing irt file # - check run for missing met file # # - additionally test if all works when removing BL_scan active from HKD i...
import sqlite3 from cryptography.fernet import Fernet from excecoes import DelecaoInvalida conexao = sqlite3.connect("Senhas.bd") c = conexao.cursor() def criptografa_file(): cr = '0B8KeSGboeH3H_UT7V7J4PgrZ6PzUDjX9zvOpOyV_xE=' f = Fernet(cr) with open('Senhas.bd', 'rb') as arquivo: arquivo_or...
import pandas as pd import periodictable as pt from compositions import renormalise from text_accessories import titlecase def simple_oxides(cation, output='formula'): """ Creates a list of oxides for a cationic element (oxide of ions with c=1+ and above). """ if not isinstance(cation, pt.core.Ele...
# !/usr/bin/env python3 # -*- coding: utf-8 -*- # # @Time: 2021/4/4 21:54 import json import time from collections import deque from urllib import parse from bs4 import BeautifulSoup import util from logger import logger from push import push from sign import sign DYNAMIC_DICT = {} LIVING_STATUS_DICT = {} LEN_OF_DE...
"""Library with fake Google Cloud client, used for testing of eval_lib. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy from io import StringIO import six class FakeBlob(object): """Fake for google.cloud.storage.blob.Blob to be used in t...
from sklearn.cluster import KMeans import collections import time import numpy as np import torch import torch.nn.functional as F from torch import nn from torch.utils.data import DataLoader from torchvision import datasets, transforms from torch.autograd import Variable from numpy import genfromtxt from baselines.fair...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\whims\whim_set.py # Compiled at: 2019-02-20 22:33:37 # Size of source mod 2**32: 14884 bytes from as...
import psycopg2 from rest_framework import serializers from doobi.recc.serializers import FoodsSerializer from doobi.recc.models import Foods from django.db.models import Q import time # def load_food_db(): # # 장고 orm으로 쿼리셋 가져오면 너무느림.... 일단 다시 psycopg이용. # # foods_all = Foods.objects.all() # # foods = Fo...
from numerous.multiphysics.equation_decorators import Equation from numerous.multiphysics.equation_base import EquationBase from numerous.engine.system.item import Item from numerous.engine.system import Subsystem, ConnectorTwoWay, ItemsStructure import numpy as np if __name__ == "__main__": from numerous.engine ...
__author__ = "<NAME>" __contact__ = "<EMAIL>" import random as rnd import os import pickle from operator import itemgetter from copy import deepcopy from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt import numpy as np class Executor: def __init__(self, nsensors=72, fan_in...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import os from mininet.topo import Topo from mininet.net import Mininet from mininet.cli import CLI from mininet.node import Controller from mininet.node import OVSKernelSwitch, RemoteController from mininet.link import TCLink import json class MobileInfrastructure(...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import with_statement import glob import os import hmac import hashlib import shutil import socket import subprocess import ipaddress import struct import re import six from twisted.internet import de...
""" Module containing a synchronous implementation of the :class:`~interface.HttpClient` interface via the popular `requests` library. """ from __future__ import annotations import logging import time from typing import Any, Callable, Dict, Tuple, Union import requests from requests.auth import AuthBase from dsw_sd...
# -*- coding: utf-8 -*- import io import os import stat import sys import shutil import re import subprocess as sp from copy import deepcopy try: from nbformat import read, write from nbconvert.preprocessors import ClearOutputPreprocessor except ImportError: print("Warning: nbformat and/or nbconvert could...
import copy import os import sys import time import math import cv2 import numpy as np import pandas as pd from PIL import Image from scipy import spatial import torch import torch.nn.functional as F import torch.optim as optim from torch.optim import lr_scheduler from torchvision import transforms sys.path.append('....
import numpy as np from feastruct.fea.node import Node class FiniteElementAnalysis: """Parent class for a finite element analysis. Establishes a template for each different type of finite element analysis, e.g. frame, membrane, plate etc. and provides a number of generic methods which are useful for all ...
#!/usr/bin/python # -*- coding: utf-8 -*- """Input in entry boxes of 'Year', 'Month' and 'Day""" """Month must be written as an integer between 1-12""" """Press "Calculate" button to return weekday of given date""" """Importing necessary modules""" from time import* from tkinter import* class Calculator_UI(): def...
import subprocess as sp from ..exceptions import ProgramNotFoundError ATTRIBUTES = { "graph": {"rankdir": "TD", "bgcolor": "transparent", "nodesep": 1, "ranksep": 1}, "node": { "shape": "circle", "label": "", "width": 0.2, "height": 0.2, "fontsize": 12, }, "edge...
# language-learning/src/grammar_learner/write_files.py # 90119 import logging import os, linkgrammar from collections import OrderedDict from copy import deepcopy from .utl import UTC def list2file(lst, out_file): string = '' for i, line in enumerate(lst): if i > 0: string += '\n' ...
from keras.models import Model, clone_model from keras.layers import Input, Conv2D, Dense, Reshape, Dot, Activation, Multiply from keras.optimizers import SGD import numpy as np import keras.backend as K def policy_gradient_loss(Returns): def modified_crossentropy(action, action_probs): cost = (K.categori...
bl_info = { 'name': 'Load Obj and Rigid Sequence as Base Frame', 'author': '<NAME>', 'version': (0, 1), 'blender': (2, 6, 7), 'category': 'Import-Export', 'location': 'File > Import/Export', 'wiki_url': ''} # ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or ...
# Copyright (c) 2016, <NAME> # All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the BSD license. See the accompanying LICENSE file # or read the terms at https://opensource.org/licenses/BSD-3-Clause. from __future__ import absolute_import, pri...
# -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”), # 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时...
import uuid, os, copy, json from builtins import object from uptune.add.constraint import register, VarNode from uptune.template.access import request, retrieve, export_meta_data from uptune.src.codegen import ( random_name, TPL_INT, TPL_ENUM, TPL_FLOAT, TPL_BOOL, TPL_PERM, TPL_LOG ) class MetaInstanceRegistry...
#!/usr/bin/env python # Copyright (C) <2019-2021> Intel Corporation # SPDX-License-Identifier: MIT # Author: <NAME> """ 1. truncate bag by filtering out messages out of a given timestamp range 2. add a bias to all unix stamps in the bag 3. remove pose stream from T265 """ import rospy import rosbag import sys import ...
import io import logging from typing import Any, Callable, Dict, Tuple import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy import core.explore as exp import core.pandas_helpers as pde import core.residualizer as res import helpers.dbg as dbg import helpers.printing as pri import helper...
from kivymd.app import MDApp from kivymd.uix.screen import MDScreen from kivy.uix.screenmanager import Screen, ScreenManager from kivymd.uix.gridlayout import MDGridLayout from kivymd.uix.label import MDLabel from kivy.properties import ObjectProperty, BooleanProperty from kivy.lang import Builder from kivy.uix.widget ...
# Copyright 2015 FUJITSU LIMITED # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
import urllib.request import ssl import os import sys, argparse import re from selenium import webdriver def getParams(sysArgs): """get search parameters from arguments""" def validDir(userDir): """check that the output directory is valid""" if os.path.exists(userDir): return userDi...
# Copyright 2017-2021 typed_python 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Credits: <NAME>, <NAME>, <NAME>, <NAME> import numpy as np from skimage import draw import math from numpy import matlib from loguru import logger import constants def compute_nucleus_and_cytoplasm_line_segments(nucleus_mask: np.ndarray, cytoplasm_mask: np.ndarray, ...
""" Methods for creating and managing committees in the DAO. Committees are defined to have certain privileges, such as the ability to approve proposals and distribute treasury funds. """ import enum import logging from typing import List import algosdk.encoding import pyteal from algosdk.v2client.algod import AlgodCl...
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. """ Data pre...
# GtkSpellCheckerDialog for pyenchant # # Copyright (C) 2004-2005, <NAME> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any la...
#=============================================================================== # Copyright 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
#!/usr/bin/env python # # Original Version: bjian 2008/10/27 # 3-D extension: PJackson 2013/06/06 # More datatypes, Multiple Channels, Python 3, ...: <NAME> # from __future__ import division, print_function import os import numpy as np import array import zlib def read_meta_header(filename): """Return a di...
import enum import json from typing import Any, Awaitable, Callable, Dict, List, Optional, Union from ..models import ( AllowedMentions, InteractionChannel, InteractionMember, InteractionUser, Object ) from ..utils import MISSING from .components import ComponentList from .rest import InteractionRequester __a...
"""BLE scanning filters, wrappers for Java class `android.bluetooth.le.ScanFilter.Builder` https://developer.android.com/reference/android/bluetooth/le/ScanFilter.Builder """ from abc import abstractmethod from dataclasses import dataclass, field from typing import List, Union import uuid from jnius import autoclass ...
from apps import App, action from libnmap.parser import NmapParserException from libnmap.process import NmapProcess from libnmap.parser import NmapParser import networkx from networkx.readwrite import json_graph from jinja2 import Environment import json import sys import xml.etree.ElementTree as etree import logging ...
import psycopg2 import psycopg2.pool import threading import datetime import re import json import os from kafka import KafkaAdminClient, KafkaConsumer, KafkaProducer from kafka.admin import NewTopic import kafka.errors # # Errors # class DatabaseError(Exception): pass class KafkaError(Exception): pass # ...
""" This is a subfile for IsyEvent.py """ __author__ = '<NAME> <<EMAIL>>' __copyright__ = "Copyright (C) 2015 <NAME>" __license__ = "BSD" import time import sys from ISY.IsyEventData import EVENT_CTRL, EVENT_CTRL_ACTION # @staticmethod def _action_val(a): if isinstance(a, str): return a elif isins...
import warnings import numpy as np from ..model import LinearModel, Model def create_C_thikonov(n_dims): C = np.zeros((n_dims, n_dims)) C[0, 0] = -1 C[0, 1] = 1 idx_N = n_dims - 1 for i in range(1, idx_N): C[i, i] = -2. C[i, i - 1] = 1 C[i, i + 1] = 1 C[idx_N, idx_N] ...
import json import logging import os import struct import tempfile from argparse import Action, ArgumentParser from glob import glob from multiprocessing import cpu_count from multiprocessing.pool import ThreadPool from pathlib import Path from random import shuffle from threading import RLock, local from typing import...
import random import numpy as np import time from typing import Tuple, Optional ### CONSTANTS ### VOXEL_TYPES = { 'EMPTY': 0, 'RIGID': 1, 'SOFT': 2, 'H_ACT': 3, 'V_ACT': 4, 'FIXED': 5, } BASELINE_ENV_NAMES = [ 'Walker-v0', 'BridgeWalker-v0', 'BidirectionalWalker-v0', 'Carrier-...
import sys import os import json import logging import datetime import yaml import requests from hellosign_sdk import HSClient import time from django.conf import settings creds = yaml.load(open('creds.yml')) FAX_API_ACCOUNT = creds['helaineHelloFaxAPIKey'] FAX_PASSWORD = creds['<PASSWORD>'] FAX_EMAIL = creds['helain...
from sklearn.datasets import make_circles from sklearn.neighbors import kneighbors_graph from sklearn.cluster import KMeans import numpy as np import matplotlib.pyplot as plt # create the data xmax = 1464 / 100 ymax = 794 / 100 # These are fixations, not raw gaze data. # fixationX = np.array([518.4234619140625, 436.2...
# -*- coding: utf-8 -*- """ Created on Sat Apr 2 09:31:14 2016 @author: <NAME>, <EMAIL> """ from multiprocessing import Process from test.context import api, core, elasticsearch_util import requests import unittest import os import json import time from elasticsearch.exceptions import ConnectionError class ApiUnit...
import json import sys import base64 import threading import time import pytest import requests import numpy as np import webbrowser import plotly.graph_objs as go import plotly.io as pio from plotly.offline import get_plotlyjs from plotly.io._utils import plotly_cdn_url if sys.version_info >= (3, 3): import uni...
import numpy as np import pickle as pk import os, sys, torch sys.path.insert(1, os.path.join(sys.path[0], '../..')) import bayesiancoresets as bc #make it so we can import models/etc from parent folder sys.path.insert(1, os.path.join(sys.path[0], '../common')) from model_neurlinr import * from neural import * def line...
from django.shortcuts import render,get_object_or_404,redirect from django.http import HttpResponse, Http404, HttpResponseRedirect, JsonResponse from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView from d...
from flask import Flask, flash, render_template, request, redirect, session, url_for, g import logging from logging.handlers import RotatingFileHandler from planigale import Question, Species, Planigale, PlanigaleGame, PlanigaleConsole import os import sys from uuid import uuid4 import redis import pickle import jsonpi...
from pathlib import Path import datetime import json import os import shutil try: from bw2data import config, projects from bw2data.sqlite import SubstitutableDatabase def presamples_dir(): """Needs to be function for tests""" return Path(projects.request_directory("presamples")) except Im...
#!/usr/bin/env python3 # Preprocessing for a maven module before instrumenting and running # Import libLF import os import sys import re sys.path.append('{}/lib'.format(os.environ['REGEX_GENERALIZABILITY_PROJECT_ROOT'])) import libLF import argparse import subprocess import sys import json import traceback import xml...
""" """ from datetime import datetime import numpy as np from copy import deepcopy from typing import List from openeo_odc.utils import get_oeop_str from openeo_odc.string_creation import create_param_string def map_load_collection(id, process): """ Map to load_collection process for ODC datacubes. Creates...
# client.py Client class for resilient asynchronous IOT communication link. # Released under the MIT licence. # Copyright (C) <NAME>, <NAME> 2019-2020 # Now uses and requires uasyncio V3. This is incorporated in daily builds # and release builds later than V1.12 # After sending ID now pauses before sending further d...
import random, string, os, math from tkinter import * from tkinter import ttk, messagebox from PIL import Image #window root = Tk() root.title("Random Image Grid Generator") root.resizable(0, 0) #################################### VARS #################################### dir_path = os.path.dirname(os.p...
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# -*- coding: utf-8 -*- from Linephu.linepy import * from Linephu.akad.ttypes import * import timeit from time import strftime import time client = LINE() client.log("Auth Token : " + str(client.authToken)) MySelf = client.getProfile() oepoll = OEPoll(client) groups = {} def readtexts(): f = open("admins.txt") ...
########### SPECIAL WEBSITES FROM ORIGINAL SOURCE GIVERS from api.magna import Magna, GenkanWP, MStreamWP, WordpressSites class MMScans(WordpressSites, Magna): """ MM-Scans.com scraper """ def __init__(self, soup, url): # parent class init WordpressSites.__init__(self, soup) ...
""" Classes useful for making interactive plots. """ from __future__ import division, print_function, unicode_literals import numpy as np from barak.utilities import between from barak.plot import get_flux_plotrange from barak.convolve import convolve_psf from barak.interp import AkimaSpline from barak.io import savej...
# ######################################################################### # Copyright (c) , UChicago Argonne, LLC. All rights reserved. # # # # See LICENSE file. # # ##############...
import math import time import displayio import vectorio import random # This example demonstrates some of the features in `vectorio`. # # It was written for a Feather M4 Express with an ST7789 320x240 display. # # Individually scheduled active shapes: # * Randart polygon # Makes 40 random points...
from uuslug import uuslug from django.db import models from django.utils.html import format_html from django.contrib.postgres.fields import JSONField, ArrayField from cccatalog.api.licenses import ATTRIBUTION, get_license_url from oauth2_provider.models import AbstractApplication import cccatalog.api.controllers.search...
__author__ ='<EMAIL>' import os import sys import collections import re import json import functools import itertools from flask import jsonify from flask import request from sqlalchemy.orm.relationships import RelationshipProperty from sqlalchemy.orm.exc import NoResultFound from sqlalchemy.exc import IntegrityErro...
""" """ import json import logging import shutil from pathlib import Path import cv2 import numpy as np from lib.app.exceptions import AppException from lib.core import DEPRICATED_DOCUMENT_VIDEO_MESSAGE from ..common import blue_color_generator from ..common import hex_to_rgb from ..common import write_to_json logge...
from typing import List import pytest from blacksheep import JSONContent, Request, StreamedContent from blacksheep.contents import ( FormPart, HTMLContent, MultiPartFormData, TextContent, parse_www_form, write_www_form_urlencoded, ) from blacksheep.multipart import ( get_boundary_from_head...
import hatpehda from hatpehda.ros import RosNode from copy import deepcopy from typing import Dict """ Simple domain where a robot and a human have 3 different numbered cube each. They must build a 3 block height stack with a specific order. The order is such as the robot must place one cube, then the human and fin...
"""Script used to train neural parts.""" import argparse import json import random import os import string import subprocess import sys import numpy as np import torch from torch.utils.data import DataLoader from arguments import add_dataset_parameters from utils import load_config from neural_parts.datasets import...
# Python plugin for controlling energenie OOK devices # # Author: DerekGn # """ <plugin key="RfmEnergOok" name="RfmUsb Energenie OOK" author="DerekGn" version="1.0.1" wikilink="http://www.domoticz.com/wiki/plugins/plugin.html" externallink="https://github.com/DerekGn/rfmusb-mihome-ook-plugin"> <description> ...
import json import h5py import pyedflib from robust_sleep_net.utils.utils import standardize_signals_durations import mne import numpy as np import pandas as pd from dateutil import parser stages_lookup = { "Sleep stage 1": 1, "Sleep stage 2": 2, "Sleep stage 3": 3, "Sleep stage 4": 3, "Movement ...
import os from pathlib import Path from typing import Union import torch import torch.nn.functional as F import re from gpt2 import GPT2LMHeadModelExperimental from transformers import GPT2Tokenizer, GPT2LMHeadModel from getconfig import settings, logger from utils import cut_trailing_sentence, output, clear_lines, fo...
import os import re import csv import html import emot import numpy as np from pyfasttext import FastText from gensim.models import Word2Vec, KeyedVectors from sklearn.cluster import KMeans from sklearn.feature_extraction.text import TfidfVectorizer from utils import sentence from ._recommender import AbstractRecommen...
import re import datetime from dateutil.relativedelta import * from django.conf import settings from django.forms.widgets import Widget, Select, HiddenInput from django.utils.dates import MONTHS_3 as MONTHS from django.utils.safestring import mark_safe from django.template.defaultfilters import capfirst from django.te...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import ins...
""" Code by <NAME> was forked from https://github.com/tonyduan/normalizing-flows Implementation of rational-quadratic splines in this file is taken from https://github.com/bayesiains/nsf MIT License Copyright (c) 2019 <NAME>, <NAME>, <NAME>, <NAME>, 2019 <NAME>, 2019 <NAME> Permission is hereby granted, free of char...
from __future__ import division # (jEdit options) :folding=explicit:collapseFolds=1: ################################################################################ # # Sandbox to play with cablam objects # ################################################################################ import os, sys from mmtbx.cabl...
import os from random import shuffle import numpy as np from tfaip.base.data.pipeline.definitions import PipelineMode, INPUT_PROCESSOR, TARGETS_PROCESSOR from tqdm import tqdm from lxml import etree import cv2 as cv from typing import List, Generator from enum import IntEnum from calamari_ocr.ocr.dataset.params import...
import numpy as np def iterative_cumulative_shape_measure( pos, weights, rmin=0.0, rmax=1.0, ITER_MAX=10, TOL=0.01 ): """ Measure the shape of a halo within a given aperture Arguments: -pos : ARRAY containing 3D particle positions -weights : ARRAY containing particle weight (typical...
#!/usr/bin/python3 from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import torch import re from torch.utils.data import Dataset from sklearn.utils import shuffle as shuffle def split_body(body, atom): ''' input: body in form ...
# SPDX-FileCopyrightText: Copyright (c) 2021 ladyada for Adafruit # # SPDX-License-Identifier: MIT """ `adafruit_aw9523` ================================================================================ Python library for AW9523 GPIO expander and LED driver * Author(s): ladyada Implementation Notes -----------------...
import os from typing import List from numpy.lib.function_base import msort from pygame import mixer from random import shuffle, triangular from tkinter import Listbox, Tk, Button, Label import socket import time import torch import numpy as np import torch.nn as nn from torch.utils.data import Dataset, Data...
import shlex import os.path dir_path = os.path.dirname(os.path.realpath(__file__)) from db import Database from misc import convert_cost_to_currency # Controls all admin actions to modify database class Admin(): db = Database() day_of_week = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", ...