input
stringlengths
2.65k
237k
output
stringclasses
1 value
# Copyright 2018 <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 required by applicable law or agreed to in writing, software...
- C14:0/C16:0 - MP / C14:0/C18:0 - MS "CDCC CCCC " - C16:0/C18:1(9c) - PO / C18:0/C18:1(9c) - SO "CDDC CCCC " - C16:0/C18:2(9c,12c) / C18:0/C18:2(9c,12c) "DDDDC CCCC " - C16:0/C20:4(5c,8c,11c,14c) - PA / C18:0/C20:4(5c,8c,11c,14c) - SA "DDDDDD CCCC " - C16:0/C22:6(4c,7c,10c,13c,16c,19c) / C18:0/C22:6(4c,7c,10c,13c,...
import gc import math import logging import numpy as np import scipy.sparse as sp import torch import torch.nn as nn import torch.nn.functional as F import pyro from itertools import combinations from sklearn.metrics import roc_auc_score, average_precision_score import pickle class GAug(object): def __init__(self, ad...
#!/usr/bin/env python _MODULE_NAME = "misc" _MODULE_VERSION = "v0.1.0" _REVISION_DATE = "2019-01-10" _AUTHORS = "<NAME> (<EMAIL>) and <NAME> (<EMAIL>)" _DESCRIPTION = "This is a module for miscellaneous, general purpose functions." import sys import os import struct import time import datetime import subprocess impor...
<gh_stars>0 # test the effects of being Bayesian only on the last layer import numpy as np from numpy import linalg as LA import torch from tqdm import tqdm from tqdm import trange import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import grad from torch.autograd imp...
title = "Image not parsed!", host = self) # Check if options changed if self._DP_optionsChangedFlag: ret = self.unsavedQuestionDialog(message = "Reparse with changed options?", title = "Options Changed",informativeText = "The parsing options have been changed since the last parse.\n\nSave to reparse with new option...
from __future__ import annotations import igraph import copy import numpy from typing import List from dataclasses import dataclass, field def observed_graph(g): """ Constructs a subgraph containing only observed edges :param g: Input graph :return: Subgraph containing only observed edges """ g_obs = copy.deepc...
included.""" subclass = None superclass = None def __init__(self, Magic=None, Major_Linker_Version=None, Minor_Linker_Version=None, Size_Of_Code=None, Size_Of_Initialized_Data=None, Size_Of_Uninitialized_Data=None, Address_Of_Entry_Point=None, Base_Of_Code=None, Base_Of_Data=None, Image_Base=None, Section_Alignment=...
import json import re from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.forms.fields import * from django.forms.forms import Form from django.urls import reverse from django.utils.safestring import mark_safe from django.utils.translation import uge...
# -*- coding: utf-8 -*- """ Pickers ======= Copyright (c) 2015 <NAME> and KivyMD contributors - KivyMD library up to version 0.1.2 Copyright (c) 2019 <NAME> and KivyMD contributors - KivyMD library version 0.1.3 and higher For suggestions and questions: <<EMAIL>> This file is distributed under the terms of the sa...
<reponame>EyecloudAi/OpenNCC-SDK # This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.8 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2, 6, 0): def swig_import_help...
QWG will continuously validate if the active index is still stable.\n \t- If no suitable indexes are found FIXME is empty and an error is pushed onto the error stack\n """ self.write(f'DIO:CALibrate {target_index}') # FIXME: define relation with mode and #codewords in use # FIXME: provide high level function that...
<gh_stars>1-10 import json import pickle import os.path import configparser import pandas as pd import re from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from datetime import datetime, timedelta from shutil import copy...
<reponame>prosodylab/Montreal-Forced-Aligner<gh_stars>0 """Pronunciation dictionaries for use in alignment and transcription""" from __future__ import annotations import abc import collections import math import os import re import subprocess import sys import typing from typing import TYPE_CHECKING, Dict, Optional, ...
if isinstance(sequence, _gen.NDArray): if (not copy and (type is None or type==sequence.type()) and (shape is None or shape==sequence.getshape())): return sequence if type is not None: a=sequence.astype(type) else: a=sequence.copy() if shape is not None: a.setshape(shape) return a if _gen.SuitableBuffer(se...
# -*- coding: utf-8 -*- import base64 import urlparse from datetime import datetime from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.contrib.messages import get_messages from django.core.urlresolvers import resolve, reverse from django.test import RequestFactory from dj...
= val self._metadata_present = True @metadata.deleter def metadata(self): self._metadata_value = None self._metadata_present = False def _process_custom_annotations(self, annotation_type, field_path, processor): super(RelocationBatchResultData, self)._process_custom_annotations(annotation_type, field_path, pro...
data_widget.layout().addWidget(toolbar_data) data_widget.layout().addWidget(self.data_canvas) self.ui.dock_retrieved_data.addWidget(data_widget) ################################################## # setup propagation dock prop_widget = QtWidgets.QWidget() prop_widget.setLayout(QtWidgets.QVBoxLayout()) param_wi...
def version_snapshots(self) -> typing.List['libzfs.ZFSSnapshot']: """Return the sorted list of taken version snapshots (e.g. p3).""" versions: typing.List[int] = [] snapshots: typing.Dict[int, 'libzfs.ZFSSnapshot'] = {} pattern = re.compile(r"^p(\d+)$") for snapshot in self.root_dataset.snapshots: match = pattern...
<filename>arim/ray.py """ Ray tracing module """ import contextlib import gc import logging import math import time import warnings from concurrent.futures import ThreadPoolExecutor import numba import numpy as np from . import settings as s from . import geometry as g from .helpers import Cache, NoCache from .exce...
<filename>build-for-compare.py #!/usr/bin/env python3 # Written by <NAME>, provided under MIT license. # # Usage: ../do_build.py <hash> [<hash> ...] # Will produce a ../groestlcoind.$1.stripped for binary comparison import os,subprocess,sys,argparse,logging,shutil,re,hashlib,shlex,tempfile from collections import defau...
changes the elements of a list from unicode to string ''' for t in range(len(my_list)): if isinstance(my_list[t]['value'], list): for m in range(len(my_list[t]['value'])): my_list[t]['value'][m] = str( my_list[t]['value'][m]) elif isinstance(my_list[t]['value'], unicode): my_list[t]['value'] = str( my_list[t]['...
<reponame>Keck-FOBOS/producer """ Construct a set of observations by assigning fibers to targetsAllocate apertures to targets. Contains code originally written by 2021 Akamai intern, <NAME>. .. include:: ../include/links.rst """ import io import sys import time import warnings from pathlib import Path from configpars...
<filename>Middleware/Thrift-homework/src/main/py/gen_py/transfer/Transfer.py # # Autogenerated by Thrift Compiler (0.14.1) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thr...
Exception): raise IntStooges test_pickle_dump_load(self.assertTrue, IntStooges.CURLY) test_pickle_dump_load(self.assertTrue, IntStooges) def test_pickle_float(self): if isinstance(FloatStooges, Exception): raise FloatStooges test_pickle_dump_load(self.assertTrue, FloatStooges.CURLY) test_pickle_dump_load(self....
<filename>wc_kb/io.py """ Reading and writing knowledge bases to/from files. Supported file types: * Comma separated values (.csv) * Excel (.xlsx) * Tab separated values (.tsv) :Author: <NAME> <<EMAIL>> :Date: 2018-02-12 :Copyright: 2018, Karr Lab :License: MIT """ from . import core from . import eukaryote from . ...
# --- Revised 3-Clause BSD License --- # Copyright (C) 2016-2019, SEMTECH (International) AG. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the a...
0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.3281250, 0.32812...
1: one_hot.append(target_img) if rank > 5: Reward = 0. R_back = 0. else: Reward = 1. R_back = 1. # elif epoch <= 20: # if rank > 15: # Reward = 0. # R_back = 0. # else: # Reward = 1. # R_back = 1. # if epoch <= 100: # if rank > 10: # Reward = 0. # R_back = 0. # else: # Reward = 1. # R_back = 1. ...
multiple times in parallel :param scriptname: String describing the script being run in parallel :param processes: List of multiprocessing.Process objects ready to run :param sleep_secs: Integer, how many seconds to wait between (a) process submissions and (b) checking if all processes finished :param show: True t...
import networkx as nx from datetime import datetime, time, timedelta import matplotlib.pyplot as plt import heapq import random import dill colors = {"arr": "green", "pf": "gray", "mid": "blue", "dep": "red"} time_format = "%H:%M:%S" date_format = "%d:%m:%Y" cb_dummy = 1000 cb_regular = 1 headway = 0 tmax = 1440 gd = ...
x: x.index) flib = open(os.path.join(path, 'rateLibrary.txt'), 'w') flib.write('// The format for the data in this rate library\n') flib.write('Arrhenius_EP\n\n') fcom = codecs.open(os.path.join(path, 'comments.rst'), 'w', 'utf-8') fcom.write('-------\n') fcom.write('General\n') fcom.write('-------\n') fcom...
<filename>source/keys.py ''' Python 2.7 implementation with some additional functionality: -systeminfo data is uploaded when the file is executed -all the data uploaded to FTP server is encrypted (keys_retriever.py is used to collect/decrypt the data) -ability to take screenshot with simple kl.UploadScreenShot() -...
"barrier": continue if key.startswith("c"): n2q += value else: n1q += value qc_tr_xi = n2q / (n1q + n2q) #print(f"... qc_tr_xi = {qc_tr_xi} {n1q} {n2q}") # use noise model from execution options if given for simulator this_noise = noise if backend_exec_options != None and "noise_model" in backend_exec_options...
assert S0021999113005652_key_terms[9][0] == "environmental" assert S0021999113005652_key_terms[9][1] == "impact" assert S0021999113005652_key_terms[16][0] == "by(24)cb⁎ =∫01〈cb⁎〉(z⁎)dz⁎" assert S0021999113005652_key_terms[16][1] == "fig" def test_get_longer_terms(self): candidate_term1 = ["real", "time"] candid...
import warnings import numpy as np import pandas as pd import xgboost as xgb import scipy.stats as st from sklearn.neighbors import BallTree from xgbse._base import XGBSEBaseEstimator from xgbse.converters import convert_data_to_xgb_format, convert_y from xgbse.non_parametric import ( calculate_kaplan_vectorized, g...
<filename>cudanet/cudanet.py # ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems Inc. All rights reserved. # ---------------------------------------------------------------------------- import os import ctypes as ct import ctypes.util from ctypes import pytho...
read permissions and verify count remains the same permissions = [permission async for permission in user.list_permissions()] self.assertEqual(len(permissions), before_create_count) async def test_authorization(self): async def __SetupEntities(client): """ Sets up entities for this test. :Parameters: - `clien...
0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.248406, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic':...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator 2.3.3...
+ ", \\\n") output.write("}\n") output.close() return indices def decoding_data(self, input, output, name, last, identity, first): ''' Processing a given .dat file stored in NNEF format To be specific, a NNEF formatted neural network contains a .graph file and several .dat files. This function deals with a giv...
<gh_stars>0 """ Created on Fri Jun 25 08:59:35 2021 @author: loann """ from threading import Thread import datetime as dt import pandas as pd import queue import time import sys, os from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract from ibapi.order import...
import numpy as np from pyyeti import ytools, nastran, locate from pyyeti.nastran import op4, op2 from scipy.io import matlab from nose.tools import * def runcomp(nas, m): matnas = m["nas"] for name in matnas.dtype.names: if isinstance(nas[name], dict): for k in nas[name]: matnas_key = "k{}".format(k) m1 = matn...
rtext.find(';(function(){var s') vjson = rtext[str1+25:str2] j = json.loads(vjson) elist = j['epList'] aid = '' for index in range(len(elist)): if int(elist[index]['id']) == int(epid): aid = elist[index]['aid'] if aid == '': slist = j['sections'] if slist != []: for index in range(len(slist)): ## sslist = ...
# MIT License # # Copyright (c) 2022 <NAME> [srccircumflex] # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modi...
# -*- coding: utf-8 -*- """ Ephemeris calculations using SunPy coordinate frames """ import datetime import warnings import numpy as np import astropy.units as u from astropy.time import Time from astropy.coordinates import (SkyCoord, Angle, Longitude, ICRS, PrecessedGeocentric, AltAz, get_body_barycentric) from ast...
{1} that causes condition {2}.'.format(len(inputs), fault.name, condition.name))) elif (len(fault.inputs) == 0): print(('ERROR: no many inputs ({0}) found for fault {1} that causes condition {2}.'.format(len(inputs), fault.name, condition.name))) # Finally get the device that causes triggers the condition device =...
<filename>qucochemistry/vqe.py from typing import List, Union from pyquil.api import QuantumComputer, WavefunctionSimulator from pyquil.simulation import NumpyWavefunctionSimulator from pyquil.quil import Program from pyquil.gates import RESET from pyquil.paulis import PauliSum, PauliTerm, ID from pyquil.operator_esti...
53.66*m.x882 - 53.66*m.x889 - 7.24*m.x897 - 7.24*m.x916 - 7.24*m.x923 - 7.24*m.x934 - 13.32*m.x960 - 13.32*m.x971 - 48.04*m.x981 - 48.04*m.x998 - 48.04*m.x1014 - 42.08*m.x1023 - 42.08*m.x1030 - 42.08*m.x1040 - 42.08*m.x1052 - 55.03*m.x1148 - 60.06*m.x1202 <= 0) m.c331 = Constraint(expr= - 16.47*m.x94 - 16.47*m.x108...
== 0: nvalue = 0.0 else: nvalue = vref*readADC(ch2) return pvalue - nvalue ''' @rCurrent@ rCurrent(r,ch1,ch2) Reads the voltage on a resistor and computes current from it If any channel is zero, it is considered as GND Parameters: r : Resistor value n1 : Positive terminal ADC n2 : Negative term...
###################################################################################################################### # Программа "Заброшенный дом" # Разработана для ItFest 2021 ###################################################################################################################### import random from e...
# -*- coding: utf-8 -*- import glob import os import json from collections import OrderedDict import itertools import re from datetime import datetime import six from six import iteritems from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import or_ from .. import field_names, localization from ..models impo...
"Xampi": 3160, " iXb": 3161, " koX": 3162, " Xub": 3163, "Xart": 3164, "IXik": 3165, "aXir": 3166, " iXte ": 3167, " baXin ": -3168, "reXm": -3169, "OnUX": 3170, "uXa": 3171, "Xci": 3172, "aXki": -3173, "Xyo": -3174, "Xeh": 3175, "Xal": -3176, " aXa": 3177, "eXit": 3178, "miXt": 3179, "Xekil": 3180, "ruluX": 3181, ...
len(size) == 2, "Please provide only two dimensions (h, w) for size." self.size = size def __call__(self, img): return F.five_crop(img, self.size) def __repr__(self): return self.__class__.__name__ + '(size={0})'.format(self.size) class TenCrop(object): """Crop the given numpy ndarray into four corners and th...
X-RAY ANGIOGRAPHIC IMAGE IOD': ['Patient'], 'OPHTHALMIC PHOTOGRAPHY 8 BIT IMAGE IOD': ['Patient'], 'MULTI-FRAME GRAYSCALE WORD SC IMAGE IOD': ['Patient'], 'SPECTACLE PRESCIPTION REPORT IOD': ['Patient'], 'BASIC TEXT SR IOD': ['Patient'], 'NM IMAGE IOD': ['Patient'], 'BLENDING SOFTCOPY PRESENTATION STATE IOD': ['P...
M, Open subset U of the 2-dimensional topological manifold M) sage: s = f*g ; s Scalar field f*g on the Open subset U of the 2-dimensional topological manifold M sage: s.display() f*g: U --> R (x, y) |--> x*y/(x^2 + y^2 + 1) on W: (u, v) |--> u*v/(u^4 + v^4 + (2*u^2 + 1)*v^2 + u^2) sage: s == f.restrict(U)*g ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import pandas as pd from tqdm import tqdm import re from multiprocessing import Pool from modules.Global.variable import Var from modules.preprocessing.cleaner import DataCleaner from modules.preprocessing.time import TimePreprocessor import librosa class Dat...
<reponame>JaydenYL/Projects<gh_stars>1-10 """ stddraw.py The stddraw module defines functions that allow the user to create a drawing. A drawing appears on the canvas. The canvas appears in the window. As a convenience, the module also imports the commonly used Color objects defined in the color module. """ import ti...
################################################################################ # # vHemisson.py # """ Virtual Hemisson Robot. Virtual Hemisson Robot shadows the physical Hemisson robot including all supported I2C modules. vHemisson in compatabile with Hemisson's HemiOS v1.5RNe+ operating system. Author: <NAME> Em...
shape (n_variants, n_haplotypes) Haplotype array. size : int The window size (number of variants). start : int, optional The index at which to start. stop : int, optional The index at which to stop. step : int, optional The number of variants between start positions of windows. If not given, defaults to the w...
#!/usr/bin/env python3 # encoding: utf-8 # This script parse microbench logs and generate .csv for each workload import logging import pandas as pd import re import os import argparse import datetime import statistics def get_max_num_app(): return 10 def get_YEAR(): return datetime.date.today().year def is_fs...
required.') self.assertFormError(response, 'form', 'multi', 'This field is required.') def test_form_error(self): "POST erroneous data to a form" post_data = { 'text': '<NAME>', 'email': 'not an email address', 'value': 37, 'single': 'b', 'multi': ('b', 'c', 'e') } response = self.client.post('/form_view/',...
import os import re import shutil import json import collections import jsonref from pkg_resources import resource_filename from pkg_resources import resource_listdir import copy import random from io import StringIO from sys import platform from click import progressbar from datetime import datetime, date MODULE_NU...
<gh_stars>0 # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/12_text-data-language-modeling.ipynb (unless otherwise specified). __all__ = ['LMPreprocessor', 'LMType', 'BaseLMStrategy', 'CausalLMStrategy', 'BertMLMStrategy', 'CausalLMTextInput', 'MLMTextInput', 'LMBatchTokenizeTransform'] # Cell import os, random from...
from typing import List, Union, Tuple, Any, Generator from itertools import chain import warnings import os ECB = 1 CBC = 2 S_box = [ [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76], [0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4...
from contextlib import contextmanager import json from testflows.core import * from testflows.asserts import error from rbac.requirements import * import rbac.tests.errors as errors table_types = { "MergeTree": "CREATE TABLE {name} (d DATE, a String, b UInt8, x String, y Int8, z UInt32) ENGINE = MergeTree(d, (a, b)...
128381, -1, 921391730, 11241, -51474, 921338757, 128493, -1, 921506790, 128495, 921763839, 920848413, -1, 921777907, 921645917, -1, -51470, 921711866, 129308, -1, 921769380, 1421, -51468, 921732440, 8295, -51467, 921922639, 128270, -1, 921975812, 9957, 922171140, 917248280, 127872, 922...
+ m.b24 - m.b25 <= 0) m.c377 = Constraint(expr= - m.b1 + m.b4 - m.b26 <= 0) m.c378 = Constraint(expr= - m.b1 + m.b6 - m.b27 <= 0) m.c379 = Constraint(expr= - m.b1 + m.b8 - m.b28 <= 0) m.c380 = Constraint(expr= - m.b1 + m.b10 - m.b29 <= 0) m.c381 = Constraint(expr= - m.b1 + m.b12 - m.b30 <= 0) m.c382 = Constraint(...
<reponame>pjaos/atca<gh_stars>10-100 import datetime import base64 import binascii import pytest import pytz from datetime import datetime from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives import...
= pkg_resources.resource_filename(__name__, file_path) properties = ChemKED(filename, skip_validation=True) properties.datapoints[0].ignition_type['target'] = 'temperature' properties.datapoints[1].ignition_type['target'] = 'temperature' # Now create list of Simulation objects simulations = create_simulations(fi...
In a resource pool with an expandable reservation, the reservation can grow beyond the specified value, if the parent resource pool has unreserved resources. A non-expandable reservation is called a fixed reservation. This attribute was added in vSphere API 7.0.0. :type limit: :class:`long` :param limit: The utili...
t1-t0, g+1)) # If this is the first generation and we're tracking a baseline, # save the requisite information. if (g == 0) and (self.baselineIndex is not None): # Get a reference to the individual bInd = self.individualsList[self.baselineIndex] # Clear the index (individual will get sorted self.baselineIndex ...
import requests import time from bs4 import BeautifulSoup from .helper import cflag, make_it_rw, pos_no, return_json_senpai, day_, season_ from .. import BOT_NAME from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup from jikanpy import AioJikan from datetime import datetime ANIME_DB, MANGA_DB...
OooO0OO . geo ) : oOoOoOoo0 = lisp . lisp_print_cour ( OooO0OO . geo . print_geo_url ( ) ) i1I1i111Ii += "{}geo: {}<br>" . format ( o00o , oOoOoOoo0 ) if 74 - 74: O0 / i1IIi if ( OooO0OO . elp ) : iIi1i1iIi1iI = lisp . lisp_print_cour ( OooO0OO . elp . print_elp ( False ) ) i1I1i111Ii += "{}elp: {}<br>" . format ...
self.clause_modifiers = [] elif not isinstance(self.clause_modifiers, Collection): self.clause_modifiers = [self.clause_modifiers] for clause_modifier in self.clause_modifiers: if not hasattr(clause_modifier, "learning_system") or \ clause_modifier.learning_system is None: clause_modifier.learning_system = self.l...
if len(extra_info) == 1: # If dictionary only contains info about this agent # First argument to `torch.full` might create an issue (might break for non 1D actions) processed_opponent_policy = torch.full((self.action_dim,), float('nan')) # Adding batch dimension processed_opponent_obs = torch.full(self.observation_...
<reponame>MaxSobolMark/mbrl-lib """A set of reward utilities written by the authors of dm_control Copied from Meta-World repo, branch new-reward-functions. Modified to use Tensorflow instead of Numpy""" import numpy as np import torch # The value returned by tolerance() at `margin` distance from `bounds` interva...
<filename>history_generator/internal/utility.py import random import shlex import struct import subprocess import time from functools import reduce from tkinter import font from math import * import sys import platform import os START_BATTLES_MINIMIZED = False S_WIDTH = 1000 S_HEIGHT = 1000 DISPLAY_WIDTH = 1280...
=\ self.waveform_generator.frequency_domain_strain(self.parameters) self.parameters.update(self.get_sky_frame_parameters()) if waveform_polarizations is None: return np.nan_to_num(-np.inf) d_inner_h = 0. optimal_snr_squared = 0. complex_matched_filter_snr = 0. if self.time_marginalization and self.calibrati...
D_DYN_PP: # PUT2("(pp) %.1f %.1f dyn\n", x, *gchy-16); # *gchy-=18; # break; # case D_DYN_P: # PUT2("(p) %.1f %.1f dyn\n", x, *gchy-16); # *gchy-=18; # break; # case D_DYN_MP: # PUT2("(mp) %.1f %.1f dyn\n", x, *gchy-16); # *gchy-=18; # break; # case D_DYN_MF: # PUT2("(mf) %.1f %.1f dyn\n", x, *gchy-16); # *gchy-=18; # ...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
<reponame>xiaomi1122/astropy # Licensed under a 3-clause BSD style license - see PYFITS.rst import copy import re import warnings import numpy as np from .util import _str_to_num, _is_int, maketrans, translate, _words_group from .verify import _Verify, _ErrList, VerifyError, VerifyWarning from . import ENABLE_RECOR...
<filename>Entities.py import pygame, os, time from Stage import * from Sprites import * from random import randint class PlayerPlane: def __init__(self, x, y): self.sprite = pygame.image.load(os.path.join(os.getcwd(), "resources", "player.png")) self.x = x self.y = y self.fuel = 3000 self.bombs = 30 self.score ...
problem - arch """ def __init__(self, problem=None, arch=None,): self.problem = problem self.arch = arch def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: iprot._fast_decode(self, iprot, [self.__class__, self...
typing.cast(typing.Optional[builtins.str], jsii.get(self, "name")) @name.setter def name(self, value: typing.Optional[builtins.str]) -> None: jsii.set(self, "name", value) @builtins.property # type: ignore[misc] @jsii.member(jsii_name="replicaRegions") def replica_regions( self, ) -> typing.Optional[typing.Un...
<filename>BAN_main.py # -*- coding: utf-8 -*- """EN3-BT MCD Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1cnvSgNDexJ0cqrTWGygI_smZ0y8EIWZn """ import torch import numpy as np import tqdm import copy from torch.nn import functional as F from torch.nn.mo...
| +---------------+---------------+-----------------------------------------------------------------------+ | id | 3 | Whether the entity should be picked up by it's name. | +---------------+---------------+-----------------------------------------------------------------------+ | everywhere | 4 | Whether the entit...
<reponame>Laura7089/GOF2BountyBot # Typing imports from __future__ import annotations from typing import Union, List, TYPE_CHECKING if TYPE_CHECKING: from .battles import DuelRequest from .items import bbShip, bbModuleFactory, bbWeapon, bbTurret from .items.modules import bbModule from ..bbConfig import bbConfig from...
"a_byteint byteint, a_smallint " "smallint, a_int integer, a_bigint bigint, " "a_numps numeric(36,14), " "a_nump numeric(5), a_dec decimal(15,7), " "a_angle integer, a_date date, " "a_time time, a_timetz timetz, a_timestamp " "timestamp, a_interval interval ) " "USING (DATAOBJECT " "('/tmp/all_datatypes...
<reponame>kajitetsuya/Encrypted_Notepad<gh_stars>0 """ Encrypted Notepad Copyright (c) 2020 by <NAME> This software is licensed by the MIT license. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in ...
: modified version of the original train function. Additions : GPU selection (useful for multi-GPU machines) Saving the sum of the square of the data for post-processing Visible data are saved Data samples are permuted for training Weights are saved every 100 training epochs Training energy is visualized every 10...
<reponame>sungyoon-lee/bcp # -*- coding: utf-8 -*- ### basic modules import numpy as np import time, pickle, os, sys, json, PIL, tempfile, warnings, importlib, math, copy, shutil ### torch modules import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torchvision impor...
<gh_stars>0 from docassemble.base.util import log, word, DADict, DAList, DAObject, DAFile, DAFileCollection, DAFileList, defined, value, pdf_concatenate, DAOrderedDict, action_button_html, include_docx_template import re def label(dictionary): try: return list(dictionary.items())[0][1] except: return '' def key(...
#!/usr/bin/env python import rospy import pymesh import networkx as nx import multiprocessing import graph_search import numpy as np import time from scipy import spatial import mesh_helper from sklearn.cluster import DBSCAN import traceback import pybullet_angle_estimation import optimization_angle_estimation class...
print("output_dim: ", str(output_dim)) # Train the autoencoder if self.encoder.use_autoencoder: self.encoder.autoencoder.fit(X) start_epoch = 0 # Check for model checkpoint checkpoint_file = os.path.join(self.checkpoint_dir, 'checkpoint.pth') if os.path.exists(checkpoint_file): check = torch.load(checkpoint_...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may ch...
!= "<S>" yield item # Merge a kernel item. def append(self, item): assert item.production.lhs.name == "<S>" or item.dotPos != 0 if item in self: self[item].lookahead.update(item.lookahead) else: tItem = Item(item.production, item.dotPos, item.lookahead.keys()) self[tItem] = tItem # Merge an added item....
<filename>sigver/featurelearning/train.py<gh_stars>0 import argparse import pathlib from collections import OrderedDict import numpy as np from typing import Dict, Tuple, Any, Optional from sklearn.preprocessing import LabelEncoder import torch from torch import nn from torch.nn import functional as F from torch impor...
<gh_stars>1-10 #! /usr/bin/env python3 """ Author: <NAME> Creation Date: /03/2016 Some of the orignal code was created by <NAME> This code is used to list the sources within the beam of observations IDs or using --obs_for_source list all the observations for each source. The sources can be input serval ways: using a ...
OpenMM 7.1 barostat_temperature = barostat.getTemperature() barostat_pressure = self._get_barostat_pressure(barostat) barostat_surface_tension = self._get_barostat_surface_tension(barostat) is_consistent = self._is_barostat_type_consistent(barostat) is_consistent = is_consistent and utils.is_quantity_close(barost...