text
stringlengths
3.07k
22.1k
# coding=utf-8 # Copyright 2019 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from typing import Union from git import Repo from pkginfo import Wheel from collections import defaultdict import datetime import subprocess import sys import glob import os import json import requests from utils.utils import get_category_mapping from utils.github import github_pattern, get_github_metadata, get_github...
#!/usr/bin/env python import os import json import torch import numpy as np import queue import pprint import random import argparse import importlib import threading import traceback import torch.distributed as dist import torch.multiprocessing as mp from tqdm import tqdm from torch.multiprocessing import Process, Q...
""" Turtle Graphics - Shooting Game """ import turtle """ Constants and variables """ screen_width, screen_height = 900, 564 turtle.reset() # Reset the turtle turtle.setup(screen_width, screen_height) # Set the size of the screen turtle.bgpic("Hogwarts-castle-har...
from argparse import ArgumentParser from time import sleep import math import socket import threading import signal from frankx import Robot, RobotMode, Affine, MotionData, Reaction, Measure, JointMotion, ImpedanceMotion, StopMotion, PathMotion, LinearMotion, WaypointMotion, Waypoint, LinearRelativeMotion exit_event ...
import xml.sax import copy from math import * from graphserver.vincenty import vincenty INFINITY = float('inf') def download_osm(left,bottom,right,top): """ Return a filehandle to the downloaded data.""" from urllib.request import urlopen fp = urlopen( "http://api.openstreetmap.org/api/0.5/map?bbox=%f,%f,...
#!/usr/bin/env python3 import os import re import subprocess from argparse import ArgumentParser class Subcommand(object): def __init__(self, command, description, args, switches): self.command = command self.description = description self.args = args self.switches = switches cla...
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import * from modeles import modeleResanet from technique import datesResanet app = Flask( __name__ ) app.secret_key = 'resanet' @app.route( '/' , methods = [ 'GET' ] ) def index() : return render_template( 'vueAccueil.html' ) @app.route( '/usager/session/choi...
""" Tudalenau allanol yr trawsgrifiwr. """ import logging import os import re import shutil import unicodedata import uuid from pyramid.httpexceptions import HTTPFound from pyramid.response import FileResponse from pyramid.view import ( view_config, view_defaults ) from ..tasks import youtube_dl, convert_file...
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT """ # Test case ID : C4044697 # Test Case Title : Verify that each surface picks up the material assigned to it and...
#!/usr/bin/env python # # Copyright (C) 2011, 2012 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
# Copyright 1999-2020 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# Copyright 2016 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 os import sys from datetime import datetime as dt from googleapiclient import errors as googleErrors from helpers import ( filter_events, get_calendar_service, parse_api_response, set_bold_text, ) from logger import getLogger def check_existing_events(yaml_future_events, calendar_future_events...
# -------------------------------------------------------- # SoCo # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- import json import math import os import time from shutil import copyfile import t...
# yellowbrick.classifier.classification_report # Visual classification report for classifier scoring. # # Author: <NAME> # Author: <NAME> # Author: <NAME> # Author: <NAME> # Author: <NAME> # Created: Wed May 3 18:15:42 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see ...
import numbers import random import numpy as np from PIL import Image, ImageOps import torch class RandomCrop(object): def __init__(self, size): if isinstance(size, numbers.Number): self.size = (int(size), int(size)) else: self.size = size def __call__(self, image, la...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from collections import defaultdict import json from flask.helpers import url_for import os from flask_login import current_user from flask import abort, render_template, request, redirect, current_app, jsonify, make_response import flask_featureflags as...
# encoding: utf-8 """ Test suite for pptx.action module """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) import pytest from pptx.action import ActionSetting, Hyperlink from pptx.enum.action import PP_ACTION from pptx.opc.constants import RELATIONSHIP_TYPE as RT from ppt...
# Copyright (c) 2021, Hitachi America Ltd. 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 appli...
############################################################################### # WaterTAP Copyright (c) 2021, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National # Laboratory, National Renewable Energy Laboratory, and National Energy # Technology Laboratory ...
import logging from os import environ from time import time, sleep import blinker import urwid as uw from qbittorrentui.config import APPLICATION_NAME from qbittorrentui.config import config from qbittorrentui.connector import Connector from qbittorrentui.daemon import DaemonManager from qbittorrentui.events import c...
from typing import Any, Dict, List, Optional, Tuple from fastapi import Depends from pydantic import BaseModel, Field from rubrix.server.commons.errors import EntityAlreadyExistsError, EntityNotFoundError from rubrix.server.commons.es_helpers import filters from rubrix.server.commons.helpers import unflatten_dict fro...
#!/usr/bin/env python import numpy as np from AlphaGo.preprocessing.preprocessing import Preprocess from AlphaGo.util import sgf_iter_states import AlphaGo.go as go import os import warnings import sgf import h5py as h5 class SizeMismatchError(Exception): pass class game_converter: def __init__(self, featu...
brands = ["Fender", "Gibson", "Ibanez"] brands [] list() len(brands) len([]) brands = [ "Fender", "Gibson", "Ibanez" ] brands brands[0] brands[len(brands) - 1] brands[-1] brands[-len(brands)] try: print(brands[10]) except: print("Whoops, something went wrong.") print("We are still wo...
import argparse import os import sys sys.path.append('/usr/local/CyberCP') from plogical import CyberCPLogFileWriter as logging from plogical import backupUtilities as backupUtil import time from multiprocessing import Process import subprocess import shlex from shutil import move from plogical.virtualHostUtilities imp...
#!/usr/bin/env python3 """Execute a submission""" import argparse import os import signal import subprocess import tempfile import time import json import traceback import socket import logging import pathlib import sys episode_length = 2 * 60 * 1000 class LocalExecutionConfig: """Configuration for local execut...
import discord import random def winnerMsg (): global winner, settings id = int(settings['sessionID']) settings['sessionID'] = id +1 return "Congratulations "+winner.name +' for winning BINGO session ' + str(id) +"!" def verify(board): global bingoSession, bingo, bingoEnded, rolls length = 5 ...
from urllib.request import urlopen from bs4 import BeautifulSoup import csv # function for extracting college stats def weird_scrape(mstr, substr): cs_tag1, cs_tag2 = '<td class="right " data-stat="', '" >' found = mstr.split(cs_tag1 + substr + cs_tag2)[1].split('<')[0] return 0 if found == '' else int(fou...
#!/usr/bin/env python3 import sys if len(sys.argv) < 2: print("Provide the integer size in 32-bit words") sys.exit(1) size = int(sys.argv[1]) if size > 8: print("This script doesn't work with integer size %s due to laziness" % (size)) sys.exit(1) init_size = 0 if size > 6: init_size = size - 6 ...
from typing import Any, Dict, List, Optional, Tuple import emojis ALLIANCE_MEMBERSHIP: Dict[str, str] = { 'Candidate': 'Candidate', 'Ensign': 'Ensign', 'Lieutenant': 'Lieutenant', 'Major': 'Major', 'Commander': 'Commander', 'ViceAdmiral': 'Vice Admiral', 'FleetAdmiral': 'Fleet Admiral' } ...
# -*- coding: utf-8 -*- """ Created on Tue Sep 5 10:50:32 2017 @author: brucedai """ import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import ffn from feature import timer_decorator buy_dir = './output/stocks' sell_dir = '../DeepTrade_Sell/output/stocks' output_dir...
"""Defines the Session class, used to handle user interaction. """ from . import entities from . import verbs as v from . import util import textwrap class Session: """This class handles interaction with a single user, though it can send messages to other users as well, to inform them of the session's user actions...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
#!/usr/bin/python # Copyright (C) 2013 <NAME> # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import sys def create(t): t.write('''mockinfo.py''', ''' import re import optparse import os parser = optparse.Opti...
""" directory naming functions """ import os import string import numbers import elstruct import automol from autofile.system._util import (is_valid_inchi_multiplicity as _is_valid_inchi_multiplicity) from autofile.system._util import short_hash as _short_hash from autofile.system._ut...
import os import time import glob import rawpy import torch import random import argparse import numpy as np from PIL import Image from model_light import LightModel from model_normal import NormalModel from model_light_resiual import LightResiualModel from model_light_resiual_reduce import LightResiualReduce from con...
# -*- coding: utf-8 -*- """ Media processor module for cutting, converting media contents (audio, video, etc.) """ # This source code utilise ideas and sample processing codes from Victoria Chua # Github profile: https://github.com/vicchuayh # This code is a part of speach library: https://github.com/neocl/speach...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from collections import defaultdict from hashlib import md5 from itertools import chain from flask import...
# RUN: SUPPORT_LIB=%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext \ # RUN: %PYTHON %s | FileCheck %s import ctypes import numpy as np import os import sys from mlir import ir from mlir import runtime as rt from mlir import execution_engine from mlir.dialects import sparse_tensor as st from mlir.dialects im...
# This file is part of the Trezor project. # # Copyright (C) 2012-2022 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
"""An example of training A2C against OpenAI Gym Envs. This script is an example of training a A2C agent against OpenAI Gym envs. Both discrete and continuous action spaces are supported. To solve CartPole-v0, run: python train_a2c_gym.py 8 --env CartPole-v0 """ from __future__ import division from __future__ imp...
''' Author: <NAME> Class: CS451 Course Project Data: Global Fishing Watch ''' #%% load up the data import csv import arrow num_var = ["length_m_gfw","engine_power_kw_gfw", "tonnage_gt_gfw"] str_var = ["date","flag_gfw","vessel_class_gfw"] examples = [] # training data collected from 2018 ys = [] # label is acc...
from scipy.sparse import issparse import numpy as np import pandas as pd from multiprocessing.dummy import Pool as ThreadPool import itertools from tqdm import tqdm from .utils import normalize_data, TF_link_gene_chip from ..tools.utils import flatten, einsum_correlation def scribe(adata, genes=None, ...
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from datetime import timedelta from sqlalchemy import DDL from s...
# Objective: provide estimates of the drop-rate of Common/Uncommon/Rare items, for profile backgrounds and for emoticons # # NB: with 95% confidence, drop-rates are different for profile backgrounds and for emoticons. # Reference: http://udsmed.u-strasbg.fr/labiostat/IMG/pdf/proportions-2.pdf (in French) # # NB²: we as...
""" Author : Guillaume "iXce" Seguin Email : <EMAIL> Copyright (C) 2008, <NAME> <<EMAIL>>. All rights reserved. Author : <NAME> "blackdaemon" Email : <EMAIL> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistr...
import random import torch import torch.multiprocessing as multiprocessing from torch._C import _set_worker_signal_handlers, _update_worker_pids, \ _remove_worker_pids, _error_if_any_worker_fails from torch.utils.data.sampler import SequentialSampler, RandomSampler, BatchSampler import signal import functools impor...
# -*- coding: utf-8 -*- import os, sys import tempfile import time import logging from subprocess import call import numpy as np import json import uuid import cv2 import csfm from opensfm import context logger = logging.getLogger(__name__) def resized_image(image, config): feature_process_size = config.get('...
#!/usr/bin/env python3.6 import os import subprocess import time import csv import datetime from create_args_generator import create_args_generator # Runs a full tests suite using Docker to run and track multiple test instances in parallel # All test results are aggregated and stored in /test_results/results.csv # De...
"""Implicit plotting module for Diofant The module implements a data series called ImplicitSeries which is used by ``Plot`` class to plot implicit plots for different backends. See Also ======== diofant.plotting.plot """ from ..core import Dummy, Eq, Symbol, Tuple from ..core.relational import Equality, GreaterTha...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Segmentation methods for 1D signals This module gathers a collection of functions to detect regions of interest on 1D signals Authors: <NAME>, <NAME> License: 3-Clause BSD license """ import numpy as np from scipy import signal import matplotlib.pyplot as plt import...
""" SoftLayer.firewall ~~~~~~~~~~~~~~~~~~ Firewall Manager/helpers :license: MIT, see LICENSE for more details. """ from SoftLayer import utils RULE_MASK = ('mask[orderValue,action,destinationIpAddress,' 'destinationIpSubnetMask,protocol,destinationPortRangeStart,' 'destinati...
from __future__ import absolute_import from abc import ( ABC, abstractmethod, ) import codecs import collections.abc import sys from typing import ( # noqa: F401 Any, Tuple, Union, Type, TYPE_CHECKING, ) from client_sdk_python.packages.eth_utils import ( big_endian_to_int, encod...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """utilities script copied from GSW-Python (https://github.com/TEOS-10/GSW-Python) """ from functools import wraps import numpy as np def masked_to_nan(arg): """ Convert a masked array to a float ndarray with nans; ensure other arguments are float arrays or ...
"""This module provides an API to validate and to some extent manipulate data structures, such as JSON and XML parsing results. Example usage: >>> validate(int, 5) 5 >>> validate({text: int}, {'foo': '1'}) ValueError: Type of '1' should be 'int' but is 'str' >>> validate({'foo': transform(int)...
from typing import List, Tuple from utils import ConceptNet, removeprefix def render_path_verbose(path: List[int], graph: ConceptNet): """this function gives a verbose textual representation for the given path, including all edges between the given nodes, node and label indices and label weights. Example ...
## # file grammar.py # # brief A module - realization Grammar # # section libraries_main Libraries/Modules # - logging - module # section author Author(s) # - Created by <NAME> on 14/12/2021 # - Modified by <NAME> on 14/12/2021 # # Copyright (c) 2021 <NAME>. All rights reserved. # imports import logging #######...
# Copyright (c) 2021 Moneysocket Developers # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php import json from .fiat import FIAT from .cryptocurrency import CRYPTOCURRENCY from .rate import Rate BTC = {"code": "BTC", "d...
# 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 # d...
# Vibroacoustics # # E.Rohan, V.Lukeš # Homogenization of the vibro–acoustic transmission on periodically # perforated elastic plates with arrays of resonators. # https://arxiv.org/abs/2104.01367 (arXiv:2104.01367v1) import os.path as op import numpy as nm from acoustics_macro_utils import get_homogmat from sfepy.homo...
# -*- coding: utf-8 -*- ''' Module for sending messages to Slack .. versionadded:: 2015.5.0 :configuration: This module can be used by either passing an api key and version directly or by specifying both in a configuration profile in the salt master/minion config. For example: .. code-block:: yaml ...
#!/usr/bin/env python3 import configparser import praw import json import time from datetime import datetime, timezone, timedelta import logging global DEBUG #logging.basicConfig(format = '%(asctime)s | %(levelname)s \t| %(message)s', # datefmt = '%H:%M:%S') logging.basicConfig(format = '%(leveln...
import math import os import re import sys import rootpath from tqdm import tqdm try: sys.path.append(os.path.join(rootpath.detect())) import setup from argU.preprocessing.texts import clean_to_nl from argU.preprocessing.texts import NUM_TOKEN from argU.preprocessing.texts import PERCENT_TOKEN ...
from typing import Dict, List def nwchem_list() -> List: """Return an array of NWChem methods with energies. Appended to procedures[qcdb.energy()]. """ val = [] val.append("nwchem") val.append("nwc-scf") val.append("nwc-hf") val.append("nwc-mp2") val.append("nwc-mp3") val.appe...
import argparse from collections import Counter import time import numpy as np from cnn_models.cnn_model import CnnModel, test_model_evaluation import config from data_operations.dataset_feed import create_dataset from data_operations.data_preprocessing import calculate_class_weights, dataset_stratified_split, \ ...
from __future__ import unicode_literals import json import six from moto.core.responses import BaseResponse from moto.core.utils import camelcase_to_underscores from .models import dynamodb_backend2, dynamo_json_dump GET_SESSION_TOKEN_RESULT = """ <GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06...
import os import sys import json import logging from pathlib import Path from datetime import datetime as dt import torch from torch.nn import functional as F import numpy as np def tensor2image(x, size=(64, 64)): return x.cpu().detach().numpy().reshape(size) def print_size(net): """ Print the number of...
import snake import random import numpy as np import pickle from Arena import Arena import argparse from input import * import matplotlib.pyplot as plt import time # used to show the progress bar def progress_bar(curr, total, length): frac = curr/total filled_bar = round(frac*length) print('\r', '#'*fille...
"""LVM based local disk management service. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import math import os import six from treadmill import cgroups from treadmill import cgutils from treadm...
import mmcv import numpy as np import os.path as osp from mmcv.parallel import DataContainer as DC from torch.utils.data import Dataset from .transforms import (GroupImageTransform) from .utils import to_tensor class RawFramesRecord(object): def __init__(self, row): self._data = row @property de...
from django.shortcuts import render from django.shortcuts import render, redirect from django.http import HttpResponse from django.http import JsonResponse from backstage.models import Student, Teacher, College, Major, MajorPlan, ClassRoom, AdmClass from scoreManagement.models import Course, MajorPlan, MajorCourses, Co...
from errno import EINTR from pypy.interpreter.baseobjspace import W_Root from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.typedef import ( TypeDef, GetSetProperty, generic_new_descr, descr_get_dict, descr_set_dict, make_weakref_descr) from pypy.interpreter.gateway import interp2app...
# -*- coding: utf-8 -*- from django.apps import apps from django.conf import settings from django.contrib import messages from django.contrib.auth.models import Group from django.contrib.auth.models import User from django.core import serializers from django.db.models import Q from django.http import HttpResponse from...
# SPDX-License-Identifier: Apache-2.0 import warnings from distutils.version import StrictVersion import onnx from .common import utils def convert_coreml(model, name=None, initial_types=None, doc_string='', target_opset=None, targeted_onnx=None, custom_conversion_functions=None, custom_shape_calc...
#!/usr/bin/env python """ The MIT License (MIT) Copyright (c) 2015-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,...
# -*- coding: utf-8 -*- """ Created on Mon Jun 26 13:53:41 2017 @author: siddhant """ import unittest from point import Point import constants as c from line import Line import numpy as np p1 = Point(1.0, 2.0, 3.0) p2 = Point(2.0, 4.0, 6.0) p3 = Point(6.0, 12.0, 18.0) p4 = Point(8.0, 12.0, 14.0) l1 = Line(p1, p2) ...
""" ################################################################################################## # Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved. # Filename : general.py # Abstract : Implementations of the General Recognizor Structure # Current ...
import mxnet as mx import numpy as np import time import warnings import math from functools import partial class Timer(object): def __init__(self): self.reset() def tic(self): self.start = time.time() def toc(self): self.time += time.time() - self.start self.count += 1 ...
#!/usr/bin/env python """Carry out standard MBAR analysis on 1D REMC simulation output. The exchange variable is assumed to be temperature. """ import argparse import numpy as np from scipy import interpolate from origamipy import conditions from origamipy import biases from origamipy import files from origamipy i...
# encoding: utf-8 import _init_paths import csv import fire import time import pandas as pd import os import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torchvision import torch.nn.functional as F from tqdm import tqdm from collections import OrderedDict ...
# unionrepo.py - repository class for viewing union of repository changesets # # Derived from bundlerepo.py # Copyright 2006, 2007 <NAME> <<EMAIL>> # Copyright 2013 Unity Technologies, <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or ...
import asyncio import functools import types import typing as t from contextlib import suppress from discord import Member, NotFound from discord.ext import commands from discord.ext.commands import Cog, Context from bot.constants import Channels, DEBUG_MODE, RedirectOutput from bot.log import get_logger from bot.uti...
# Copyright 2021 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 dash import dash_html_components as html import dash_core_components as dcc import dash_trich_components as dtc from dash.dependencies import Output, Input, State from dash.exceptions import PreventUpdate import dash_bootstrap_components as dbc from pandas.core.groupby.generic import DataFrameGroupBy import load...
# Copyright (C) 2012-2018 The python-bitcoinlib developers # -*- coding: utf-8 -*- # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified,...
""" EinsteinToolkit geometry code """ # ----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------...
import csv import io import json from itertools import chain from typing import Generator import click from pandas import concat from pandas import notnull from code42cli.enums import FileEventsOutputFormat from code42cli.enums import OutputFormat from code42cli.errors import Code42CLIError from code42cli.logger.form...
# Copyright (C) 2014 Universidad Politecnica de Madrid # # 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 la...
import numpy as np import bokeh from bokeh import models from bokeh import plotting import pandas as pd def log_odds_to_proba(log_odds): return np.exp(log_odds) / (1 + np.exp(log_odds)) def proba_to_log_odds(proba): return np.log(proba / (1 - proba)) def summary_explanation(output, level=0, separator="__"...
""" Code for DAgger Example usage: python dagger.py --num_expert_rollouts=5 Author of this modified script: <EMAIL> """ import os import numpy as np from osim.env import L2M2019Env from osim.control.osim_loco_reflex_song2019 import OsimReflexCtrl import tensorflow as tf from tqdm import tqdm import collections ...
"""Prediction explanation tools.""" import sys import traceback from collections import namedtuple from enum import Enum from timeit import default_timer as timer import numpy as np import pandas as pd from evalml.exceptions import PipelineScoreError from evalml.model_family import ModelFamily from evalml.model_under...
# General cmds for any BotChannel that runs races. The BotChannel should implement: # current_race -> Race : Gets the "current" race (for Enter/Ready) # last_begun_race -> Race : Gets the race that most recently started (GO!), or None if no such # change_race_info(RaceInfo) : Changes the type of ra...
import snap import networkx as nx import numpy as np import os from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt def switch_to_snap_format(g): """ parameter: g : a networkx graph return: snap_graph : an undirected snap graph """ network = nx....
from operator import getitem from functools import partial import numpy as np from .core import Array, elemwise, blockwise, apply_infer_dtype, asarray from .utils import empty_like_safe, IS_NEP18_ACTIVE from ..base import is_dask_collection, normalize_function from .. import core from ..highlevelgraph import HighLeve...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
import numpy as np import scipy as sp import datajoint as dj import matplotlib.pyplot as plt from scipy import signal from pipeline import experiment, tracking, ephys def plot_correct_proportion(session_key, window_size=None, axis=None): """ For a particular session (specified by session_key), extract all b...
"""Jetstream CLI """ import argparse import importlib import json import logging import os import pkg_resources import sys import textwrap import traceback from collections import OrderedDict import jetstream import jetstream.cli.subcommands log = logging.getLogger('jetstream') # This describes the commands that sho...
""" On Panorama: 1. Admin > Go to module > Query 2. Click on targetedms folder 3. couldn't figure out how to display data...hmmph Result of query of 'replicateannotation' with one RunId: - dict with length 7; keys = ['rows', 'queryName', 'rowCount', 'formatVersion', 'columnModel', 'schemaName', 'metaData'] - len(dict...
import argparse import json import time import jax import numpy as np import optax import wandb from tqdm import tqdm from mesh_transformer import util from mesh_transformer.checkpoint import read_ckpt, write_ckpt from mesh_transformer.transformer_shard import CausalTransformer from tfrecord_loader import TFRecordN...