text
stringlengths
6.04k
39.5k
# -*- coding: utf-8 -*- import os import pandas as pd pd.options.display.max_rows=10 import numpy as np from indicators import indicators_for_dirverse,indicators_for_crosses from dateutil.parser import parse import talib import sys from scipy import interpolate from datetime import datetime reload(sys) sys.setdefault...
import os import glob import click import logging import comet_ml from dataset import get_dataset_by_name, TokenizerDataModule import IPython import pdb import numpy as np import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader, random_split import pytorch_light...
import random from dataclasses import dataclass from dataclasses import field from enum import Enum from enum import auto import gamebook_core from character_sheet import CharacterSheet from equipment import Armor from equipment import Item from equipment import Money from equipment import Shield from equipment import...
""" The collection of callbacks. Classes: BatchMetricScorer: Calculate and log metrics after batch sampling and forward computation. EarlyStopping: Stop training when a monitored evaluation function has stopped improving. EpochMetricScorer: Calculate and log metrics at the end of ev...
from __future__ import print_function, division import argparse import os, sys import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data from tensorboardX import SummaryWriter from datasets.messytable_dataset import MessytableDataset from models import __models__,...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import logging import os import shutil import tempfile import typing from collections import OrderedDict from functools import wraps from importlib import reload from typing import Union, List import numpy as np from cave.__version__ import __version__ as cave_version from cave.analyzer.apt.apt_overview import APTOve...
from neuron import h from neuron.units import ms, mV h.load_file("stdgui.hoc") # import matplotlib # matplotlib.use('TkAgg') import matplotlib.pyplot as pyplot import math #neuron.load_mechanisms("./mod") import logging logging.basicConfig(filename='logs.log', filemode='a', ...
#! /usr/bin/python3 -uW all # -*- coding: utf-8 -*- ## # scrape-usc.py - convert the Cornell USC XML files into RDF # # @todo # In progress. # # for enum, ty=2 gives "(a)", ty=3 gives "(1)", # ty=4 gives "(A)", ty=5 gives "(i)", ... usage=""" scrape-usc.py - convert the Cornell USC XML files into RDF Get the data fr...
import json import time import pygame from pygame.rect import Rect from pygame.locals import KEYDOWN, K_ESCAPE, MOUSEBUTTONDOWN, QUIT, Color from media import sounds, images, music_path from machines import load_machines import events from util import in_pixels, in_norm if not pygame.image.get_extended(): raise S...
""" MSBClientIntegrationTest is an integration test for the MSB Python client library. Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) Author: <NAME> mailto: <EMAIL> DOT stock AT ipa DOT fraunhofer DOT com See the file "LICENSE" for the full license governing this code. """ im...
import enum from datetime import datetime from flask import Flask, Response, render_template, request, jsonify from flask_socketio import SocketIO, emit, send import airsim import numpy as np import math import time import sys from threading import Thread import json app = Flask(__name__,instance_relative_config=Tr...
import base64 import functools import vyxal from vyxal import words # Generic type constants Number = "NUMBER" Iterable = "ITERABLE" Function = type(lambda: None) Python_Generator = type( i for i in (0,) ) # https://chat.stackexchange.com/transcript/message/57555979#57555979 NEWLINE = "\n" ONE_TWO_EIGHT_KB = 1...
import os import io import sys import base64 import contextlib import functools import uuid import itertools import logging import random import shutil import string import textwrap import threading import typing import inspect from six.moves import urllib from typing import Any, Callable, Iterator, List, NoReturn, Opt...
import math import re from enum import Enum from typing import Callable, Any, Optional, Union, Tuple, Pattern from moonspec import _MOONSPEC_RUNTIME_STATE # TODO: what was I thinking... class ComparatorExpectations(Enum): ABSENT = 0 PRESENT = 1 EQUAL = 2 NOT_EQUAL = 3 NOT_CHANGED = 4 SELF_IS_...
# ------------------------------------------------------------------------------ # CodeHawk Binary Analyzer # Author: <NAME> # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2021-2022 Aarno Labs, LLC # # Permission is hereby granted, free of char...
import torch from torch import nn import torch.nn.functional as F import math import numpy as np ''' According to deepmind imp and that[*] implementation ''' ''' fundamental building blocks MLP with n (hidden layers + Relu ) # Comment, the sequential infor is neglected one final layer without activation **Pytor...
"""Defines general classes used to manage metrics""" from __future__ import unicode_literals import abc import datetime import logging import sys import django.utils.timezone as timezone logger = logging.getLogger(__name__) # Each metrics type model should be registered here to make them available to the REST laye...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2021 <NAME> <<EMAIL>> # # Distributed under terms of the BSD 3-Clause license. """Objects holding simulation configuraions. """ import pathlib as _pathlib from typing import Literal as _Literal from typing import Tuple as _Tuple from typi...
#!/usr/bin/python # License: Apache # Author: <NAME> # History: # 2017-08-31 pt: add IP whiltelist # 2017-08-31 pt: add multithreading # 2017-08-31 pt: Add password as authentication method import os import time import socket import argparse import sys import textwrap import paramiko import logging import threadin...
# !/usr/bin/python """ Copyright ©️: 2020 Seniatical / _-*™#7519 License: Apache 2.0 A permissive license whose main conditions require preservation of copyright and license notices. Contributors provide an express grant of patent rights. Licensed works, modifications, and larger works may be distributed un...
import argparse import cv2 import colorsys import os import numpy as np import pickle import quaternion from glob import glob from tqdm import tqdm from PIL import Image import habitat_sim import utils parser = argparse.ArgumentParser() parser.register("type", "bool", lambda v: v.lower() == "true") parser.add_argum...
# # nuna_sql_tools: Copyright 2022 Nuna Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software #...
######################################################################################### # Author: <EMAIL> # # Copyright 2018 SKA South Africa (http://ska.ac.za/) # # ...
from keras import Model, models, applications import cv2 import tensorflow as tf # Need this to run import numpy as np import os import pickle """ Author: <NAME> Email: <EMAIL> Purpose: Load the already trained model and test against another image Lessons Learnt 1) Must have tensorflow...
"""Utilities used for the transport layer.""" import json import uuid import os import shutil import logging import hashlib import rdflib import ast import filecmp from typing import Optional, Tuple, Any from rdflib import __version__ as rdflib_version if rdflib_version >= '6': from rdflib.plugins.serializers.json...
import os import json import time import random import itertools from dataclasses import dataclass from typing import Sequence import sys # for import parent utils sys.path.append('../') import utils from utils import UNK, SEP, SOS, EOS, SPE1, SPE2, CLS import torch from torch import Tensor from torch.nn.utils.rnn i...
import numpy as np def birch_murnaghan(V,E0,V0,B0,B01): """ Return the energy for given volume (V - it can be a vector) according to the Birch Murnaghan function with parameters E0,V0,B0,B01. """ r = (V0/V)**(2./3.) return (E0 + 9./16. * B0 * V0 * ( (r-1.)**3 * B01 + ...
# Copyright 2020 Cloudbase Solutions Srl # # 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 l...
from scipy import io from scipy.spatial.distance import squareform, directed_hausdorff from itertools import combinations from sklearn.cluster import DBSCAN, AgglomerativeClustering import numpy as np import cv2 from tqdm import tqdm from matplotlib import pyplot as plt import matlab.engine import argparse import os i...
import torch import torch.nn as nn class SELayer(nn.Module): def __init__(self, inplanes, isTensor=True): super(SELayer, self).__init__() if isTensor: # if the input is (N, C, H, W) self.SE_opr = nn.Sequential( nn.AdaptiveAvgPool2d(1), nn.Conv2d(inplanes, inplanes // 4, kernel_size=1, stride=1, bia...
""" Source Code of Furry Detector :O Written by: @ZenithO_o on twitter (https://twitter.com/zenithO_o) """ # ML imports import numpy as np import tensorflow as tf from tensorflow import keras from tensorflow.keras.models import model_from_json # Twitter imports from tweepy import API from tweepy import Cursor from tw...
# -*- coding: utf-8 -*- ################################################################################ # LexaLink Copyright information - do not remove this copyright notice # Copyright (C) 2012 # # Lexalink - a free social network and dating website platform for the Google App Engine. # # Original author: <NAME>...
""" Estimate the depth for skyMap patches for given raw files. """ import os import sys import pickle import warnings from collections import defaultdict import sqlite3 import numpy as np import matplotlib import matplotlib.pyplot as plt from astropy.io import fits import pandas as pd import lsst.geom as lsst_geom from...
#!/usr/bin/env python # Copyright 2018 The GraphicsFuzz Project 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 require...
# This file is part of Frhodo. Copyright © 2020, UChicago Argonne, LLC # and licensed under BSD-3-Clause. See License.txt in the top-level # directory for license and copyright information. import io, contextlib import numpy as np from scipy.optimize import minimize_scalar from scipy.interpolate import CubicSpline fr...
from __future__ import print_function import sys import numpy as np import matplotlib.pyplot as plt import subprocess # # # # # # # # # # # # # # Function definitions. # # # # # # # # # # # # # # # Range function for floats. def frange(start, end=None, inc=None): "A range function, that does accept floats" i...
from pyg_base import logger, passthru, tree_update, dictable from pyg_base import zipper, is_strs, is_dict, Dict, is_dictable, is_int, as_list, ulist from pyg_mongo._q import q, _set, _id, _unset, _rename, _deleted, _data from pyg_mongo._reader import mongo_reader from pyg_mongo._base_reader import _pk, _dict1 import ...
''' Packed padded sequences & Masking. ''' import torch import torch.nn as nn import torch.nn.functional as F import spacy import matplotlib.pyplot as plt import matplotlib.ticker as ticker import random import pdb ''' Encoder: Packed padded sequences applied here. The changes here all within the forward method. ...
import unittest import numpy as np from pathlib import Path import uuid import awkward as ak from km3net_testdata import data_path from km3io import OfflineReader from km3io.offline import Header from km3io.tools import usr OFFLINE_FILE = OfflineReader(data_path("offline/km3net_offline.root")) OFFLINE_USR = OfflineR...
import build_buy import services import sims4.resources from bucks.bucks_enums import BucksType from bucks.bucks_utils import BucksUtils from buffs.tunable import TunableBuffReference from business.business_reward_tuning import TunableRewardAdditionalCustomerCount, TunableRewardAdditionalEmployeeSlot, TunableRewardAddi...
import logging, os, sys, json, torch import torch.nn as nn from torch.utils.data.dataset import Dataset from torch.utils.data import DataLoader from torch.nn import MSELoss, CrossEntropyLoss import pytorch_lightning as pl from transformers import AutoTokenizer, AutoModelForTokenClassification, AutoConfig, Trainer, Trai...
from datetime import datetime, timedelta from pandas import json from api.decorators import api_post, api_get from api.helper import json_response, json_error_response from api.utils import int_or_none from broker.models import BrokerVehicle, Broker from fms.decorators import authenticated_user from fms.views import ...
import asyncio class Node: def __init__(self,state,coords, parent,boxes,keeper, cost=None, heuristic=None,): self.state = state self.coords = coords self.parent = parent self.heuristic = heuristic self.cost = cost self.totalCost = 0 self.path = [] s...
#!/usr/bin/env python # # mesh.py - The TriangleMesh class. # # Author: <NAME> <<EMAIL>> # """This module provides the :class:`Mesh` class, which represents a 3D model made of triangles. See also the following modules: .. autosummary:: fsl.data.vtk fsl.data.gifti fsl.data.freesurfer A handful of st...
from django import forms from django.db.models import Q from django.forms.models import BaseInlineFormSet from django.utils.translation import ugettext_lazy as _ from django.utils.text import normalize_newlines from django.core.exceptions import ValidationError from django.contrib.auth.models import Group from evap.ev...
# coding: utf-8 # # Travelling Salesman Problem # # ### <NAME> # ### Doble Grado Matemáticas, Ingeniería Informática, UGR # El problema consiste en modelar un problema de viajante de comercio con # resolución aproximada mediante las metaheurísticas *Enfriamiento Simulado* # y *Búsqueda Tabú* # In[82]: get_ipython...
import argparse import pandas as pd import numpy as np mean_dict = {"phastCons46mammal": 0.09691308336428194, "phastCons46primate": 0.12353343703613741, "phastCons46vertebrate": 0.1366339183101041, "phyloP46mammal": -0.0063575303590607925, "phyloP46primate": -0.0120...
#!/usr/bin/env python3 #Similar to hypermodDistance import sys import os import csv import re import itertools import argparse import subprocess #from subprocess import Popen, PIPE, STDOUT import pandas as pd import time import concurrent.futures #import mpi4py.futures class Filereader : ''' ...
import os from os.path import abspath, dirname, join import torch import torch.nn as nn from torch.utils.data import DataLoader from torchvision.datasets import FakeData import torchvision.transforms as transforms from torch.quantization import fuse_modules use_relu = False disable_single_bns = False class PReLU_Quan...
""" The functions in this file are used to extract data and download images of the human brain ISH data set from the Allen Brain Atlas. Link: http://human.brain-map.org/ish/search """ import urllib.request import xml.etree.ElementTree as et import os import glob import time import sys import pandas as pd from human_IS...
"""ism.py module to cause dispersion """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import sys, os, time import scipy.signal as spsig from . import PSS_utils as utils from . import scintillation as scint __all__ = ['ISM','scintillate...
import argparse import configparser import datetime import json import logging import math import os import re import time from io import StringIO import influxdb import paho.mqtt.client as mqtt import pytz from ruuvitag_sensor.decoder import Df3Decoder, Df5Decoder INFLUX_BUFFER = [] LAST_SAVE_TIME = 0 SN = {} # Sen...
from decimal import Decimal from openslides.assignments.models import AssignmentOption from openslides.core.config import config from openslides.users.models import User from openslides.utils.autoupdate import inform_changed_data, inform_deleted_data from .models import ( MotionAbsenteeVote, AssignmentPollBal...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### """ This file is a part of the VeRyPy classical vehicle routing problem heuristic library and provides an implementation of the general Sweep approach of Gillett and Miller (1974) and Wren & Hol...
"""Models related to the spells section in the library.""" import os import re import urllib.parse from typing import Dict, List, Optional import bs4 from tibiapy import abc, errors from tibiapy.enums import SpellGroup, SpellSorting, SpellType, VocationSpellFilter from tibiapy.utils import get_tibia_url, parse_form_d...
from __future__ import with_statement from random import randint, choice, sample from whoosh import fields, matching, qparser, query from whoosh.compat import b, u, xrange, permutations from whoosh.filedb.filestore import RamStorage from whoosh.query import And, Term from whoosh.util import make_binary_tree from whoos...
import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec from matplotlib.colors import LogNorm import numpy as np from astropy.visualization import SqrtStretch from astropy.visualization.mpl_normalize import ImageNormalize def init_plotting(x=14,y=9): plt.rcParams['figure.figsize'] = (x,y) plt....
#!/usr/bin/env python # -*- coding: utf-8 -*- """EEG-driven deep learning classifications and model generation Software tools used generate results in submitted work to (tentative citation pending review): <NAME>, <NAME>, and <NAME>. Deep Learning and Feature Based Medication Classifications from EEG in a Large Clin...
""" tkVideoUtils: Python module for playing and recording videos (without sound) inside tkinter Label widget using Pillow and imageio Copyright © 2022 <NAME> (<EMAIL>) Released under the terms of the MIT license (https://opensource.org/licenses/MIT) as described in LICENSE.md """ import os import pathlib import shutil...
# External imports import torch import numpy as np import torch.nn.functional as F from torch.autograd import Variable class Rolls(object): def __init__(self, action, proba, multiplicity, depth): self.successor = {} # The action that this node in the tree corresponds to self.action = act...
# ============================================================================== # Copyright 2019 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.apa...
import pickle import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.utils import Registry from mmdet.models.builder import build from ..utils.vis import vis_batched_imgs GRID_GENERATORS = Registry('grid_generator') def build_grid_generator(cfg): """Build grid generator...
''' .. warning:: These drivetrain models are not particularly realistic, and if you are using a tank drive style drivetrain you should use the :class:`.TankModel` instead. Based on input from various drive motors, these helper functions simulate moving the robot in various...
import os import sys import requests import zipfile import pandas as pd from geojson import LineString, Feature, FeatureCollection, dump GTFSDIR = 'gtfs-nl' # https://transitfeeds.com/p/ov/814/20190705 NDOVDIR = 'ndov' displaydate = '20210309' def min2str(minutes): """ Convert hh:mm:ss to seconds since mi...
bl_info = { "name": "Import Shining Force Battle Model", "blender": (2, 80, 0), "category": "Import", } import os import json import math import bpy import bmesh from bpy_extras.io_utils import ImportHelper from bpy_extras import object_utils from collections import OrderedDict from bpy_extras.object_uti...
# coding:utf-8 import linecache import os import torch from logging import getLogger from pathlib import Path from typing import Any, Callable, Dict, List, NewType, Optional, Tuple, Union from transformers import ( AutoTokenizer, DataCollatorForLanguageModeling, ) # import git from torch.utils.data import Data...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of Keepass-Webdav-Git synchro stuff. # # # Software is free software released under the "Modified BSD license" # # Copyright (c) 2015-2015 Psychedelys # import configparser import os import sys from flask import Flask, request, make_response, send_fi...
""" Author: <NAME> """ import subprocess from osgeo import gdal, ogr, osr import os import sys from scipy import stats import numpy as np import matplotlib.pyplot as plt import copy import matplotlib.mlab as mlab from matplotlib import rc gdal.AllRegister() class GeoProps: def __init__(self): self.eDT = N...
# Copyright (C) 2013 by <NAME> (<EMAIL>) # # This file is originally part of the Biopython distribution and governed by your # choice of the "Biopython License Agreement" or the "BSD 3-Clause License". # Please see the LICENSE file that should have been included as part of this # package. # # The file is adapted by <N...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Module to test fitting routines """ from __future__ import (absolute_import, unicode_literals, division, print_function) import os.path import numpy as np from numpy import linalg from numpy.testing.utils import assert_allcl...
from flask import flash, redirect, render_template, request, url_for, jsonify from flask_login import (current_user, login_required, login_user, logout_user) from flask_rq import get_queue import json from dateutil import parser import logging from . import account from .. import db, csrf from...
import operator import typing import collections from functools import reduce from collections import OrderedDict from ..core.plugin import AbstractType, ConcreteType, ConcreteAlgorithm from ..core.typing import Combo from ..core.planning import MultiStepTranslator, AlgorithmPlan # Guiding principles # 1. Make API fun...
#!/usr/bin/env python3.6 # coding=utf-8 ''' Iterating over data set @author: <NAME> (<EMAIL>) @since: 2018-05-30 @author: <NAME> (<EMAIL>) @since: 2019-06-30 ''' from utility.constants import * from utility.data_helper import * import torch import math from torch.nn.utils.rnn import PackedSequence from parser.module...
#!/usr/bin/python3.6 ''' classes and methods for loading twilio configuration and credentials and processing client data. calling this file will send sms messages to clients according to the parameters supplied on the command line ''' import yaml from twilio.rest import Client import argparse from datetime import d...
from manimlib import * # from manimlib.imports import * import numpy as np class shapes(Scene): def construct(self): circle = Circle() square = Square() triangle = Triangle() circle.shift(LEFT) square.shift(UP) triangle.shift(RIGHT) te = TexText("hllo mu...
# This file contains routines from Lisbon Machine Learning summer school. # The code is freely distributed under a MIT license. https://github.com/LxMLS/lxmls-toolkit/ import torch import numpy as np import pdb def log_add_exp(a, b): max_ab = torch.max(a, b) # max_ab[~isfinite(max_ab)] = 0 return torch.lo...
import os import sys import itertools import argparse import random import torch blank_token = '__' bos_token = 'SOS' eos_token = 'EOS' void_concept = 'null' slu_start_concept_mark = '_SOC_' slu_end_concept_mark = '_EOC_' blank_idx = 0 sos_idx = -1 eos_idx = -1 soc_idx = -1 eoc_idx = -1 null_idx = -1 parser = argp...
# Copyright (c) 2016-2019, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions ...
import trimesh from trimesh.intersections import slice_faces_plane import numpy as np from dvidutils import encode_faces_to_custom_drc_bytes import dask import utils import time import os from os import listdir from os.path import isfile, join, splitext import pyfqmr from dask.distributed import Client, worker_client f...
import abc from collections import OrderedDict from itertools import product from functools import partial from time import time import cgen import numpy as np from devito.cgen_utils import ccode from devito.dle.blocking_utils import (BlockDimension, fold_blockable_tree, unfold_...
"""Retrieve run information describing files to process in a pipeline. This handles two methods of getting processing information: from a Galaxy next gen LIMS system or an on-file YAML configuration. """ import copy import itertools import os from contextlib import closing import yaml from bcbio import utils from bc...
from dallinger import networks, nodes, models import random import pytest from collections import defaultdict class TestNetworks(object): def test_create_network(self, db_session): net = models.Network() assert isinstance(net, models.Network) def test_has_a_big_default_max_size(self, a): ...
from SimPEG import ( Problem, Utils, Maps, Props, Mesh, Tests, Survey, Solver as SimpegSolver ) import numpy as np import scipy.sparse as sp import properties from scipy.constants import mu_0 class MT1DSurvey(Survey.BaseSurvey): def __init__(self, srcList, **kwargs): self.srcList = srcList ...
"""Parameters that are used to create jobs. Some are quite simple, like 'description' which is just a input. Others are more complex, such as 'source' which has its own type family and validation. Put these in separate module because rows appear in several guises throughout the job creation process and I want a unifie...
import traceback from flask import Flask, make_response, render_template, request, redirect, session import json import mastodon from misskey import Misskey, MiAuth, Permissions from misskey.exceptions import * import random from datetime import timedelta import urllib.parse import sqlite3 import re import MeCab import...
""" Convolutional Neural Network for kaggle facial keypoints detection contest. Note: Only the labels contain missing values in all of the data. """ # THEANO_FLAGS=mode=FAST_RUN,device=cpu,floatX=float32 python CNN.py from __future__ import division, print_function import time import theano import lasagne import log...
from ..kernel import core from ..kernel.core import VSkillModifier as V from ..character import characterKernel as ck from functools import partial from ..status.ability import Ability_tool from . import globalSkill from .jobclass import heroes from .jobbranch import pirates from . import jobutils from ..execution.rule...
import numpy as np def npzload(npzfile_path): npzfile = np.load(npzfile_path) alloc, rt_50, rt_99, rps=npzfile['alloc'], npzfile['rt_50'], npzfile['rt_99'], npzfile['rps'] rps = rps.astype('float') alloc_list = alloc.astype('int').tolist() return alloc_list, rps def reproduce_x_to_profile_setting_...
import Tkinter as tk from copy import deepcopy from common.styles import BODY_COLOR from common.tools import fit_into GENERAL_SETTINGS_LG_FONT = ('Helvetica', '12') GENERAL_SETTINGS_SM_FONT = ('Helvetica', '9') class ShowTailEditor(tk.Frame): def __init__(self, parent, row=0, value1=5.0, value2=0.5, from1=0.1, t...
import contextvars import dataclasses import functools import inspect import re from collections import abc from typing import ( Any, Callable, Collection, Iterable, NewType, Optional, Sequence, Tuple, TypeVar, Union, ) # Some type definitions to make @supply_args decorator frie...
# -*- coding: utf-8 -*- # Copyright 2017 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
from ...moderation.models import automoderation from abc import ABC from discord import Color, Embed from .base import CosmosGuildBase from .permissions import GuildPermissions class WelcomeBannerSettings(CosmosGuildBase, ABC): def __init__(self, **kwargs): self.welcome_banner_url = kwargs.get("url", s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from framework import utils, game, card, base_player from players import * subclasses = sorted([cls.__name__ for cls in BasePlayer.__subclasses__()]) import tkinter as tk bg = '#%02x%02x%02x' % ((33, 33, 33)) root = tk.Tk() root.resizable(False, False) roo...
import os, sys sys.path.append("/u/qfeng/Project/auto_dataset_foundation/flair/") from flair.data_fetcher import NLPTaskDataFetcher, NLPTask from flair.data import TaggedCorpus, Sentence from flair.models import SequenceTagger from typing import Dict, List import torch from torch.nn.modules.distance import CosineSimila...
''' This is used to generate train.txt data for snips dataset. Entity part: Input: snips/train/label, snips/train/seq.in, snips/train/seq.out Output: snips/train.txt, snips/active_entities Packages part: Input: snips/train.txt, snips/active_entities, Output: snips/active_packages. ''' impo...
''' Evoque - managed eval-based freeform templating Copyright (C) 2007 <NAME> <<EMAIL>> Licensed under the Academic Free License version 3.0 URL: http://evoque.gizmojo.org/ ''' __url__ = "$URL: svn://gizmojo.org/pub/evoque/trunk/test/test_evoque.py $" __revision__ = "$Id: test_evoque.py 1140 2009-01-15 18:26:07Z mario...
#!/usr/bin/python # Classification (U) """Program: elastic_db_admin.py Description: Runs administration tasks on an Elasticsearch database. Usage: elastic_db_admin.py -c file -d path {-D [all | general | memory | node | server | shard | disk] [-t email_addr [email_addr ....
# -------------------------------------------------------- # Tensorflow VCL # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import numpy as np from ult.config import cfg def obtain_hoi_to_obj(): fobj = open(cfg.DATA_DIR + '/...