input
stringlengths
2.65k
237k
output
stringclasses
1 value
'std'==format: out.write("ChanMngmt:\n") if 'MessageID' in params: out.write(" MessageID: "+str(params['MessageID'])+"\n") if 'RepeatIndicator' in params: out.write(" RepeatIndicator: "+str(params['RepeatIndicator'])+"\n") if 'UserID' in params: out.write(" UserID: "+str(params['UserID'])+"\n") if 'Spare' in param...
# coding: utf-8 """ Rumble API Rumble Network Discovery API # noqa: E501 OpenAPI spec version: 2.11.0 Contact: <EMAIL> Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class Event(object): """NOTE: This class is auto generated by the swagge...
other[cut2:] offspring.append(hijo2) return offspring def mutacion(self, individuo): # probabilidad de mutación p = self.diversityIndex*self.pm #*self.N; size = len(individuo) # swap 1 bit # for i in range(0, size): if(r.uniform(0, 1) < p): i = r.randrange(0, size); j = r.randrange(0, size); prev = indiv...
\ 0.6 if board_type == "rainbow" and flop[0] - flop[1] >= 5 else \ 0.8 if board_type != "rainbow" and flop[0] - flop[1] <= 4 else \ 0.7 # Determine my opponent's strategy this hand #### Identify which of the 8 flops this is to decide the opponent's strategy they will use flop_type_number = get_flop_type_number()...
m1[n] def edit_distance_backpointer( seq1, seq2, action_function=lowest_cost_action, test=operator.eq ): """ Similar to :py:func:`~edit_distance.edit_distance` except that this function keeps backpointers during the search. This allows us to return the opcodes (i.e. the specific edits that were used to change fr...
"""Provides access to application-level structures. This module is the starting point for getting access to windows and other application-global data. """ import iterm2.broadcast import iterm2.connection import iterm2.notifications import iterm2.rpc import iterm2.session import iterm2.tab import iterm2.window impor...
move axis a to position b. Also see `numpy.moveaxis`. """ re=ch.functions.moveaxis(a.re,b,c) im=ch.functions.moveaxis(a.im,b,c) return Array(re,im) def apply_action(action, reg): """ Applies the action to the register reg, thereby chainging the resister's state (reg.psi). Parameters ---------- action : qem...
<filename>test.py # coding=utf-8 # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import cld import unittest import sys from testData import * VERBOSE = False # MKM: ported from FullTests in compact_...
</footer>\n", " </div>\n", "</div>\n", "</div>\n", "\n", " </div>\n", " </div>\n", " </section>\n", " </body>\n", "</html>\n", "\n" ] } ], "source": [ "import requests\n", "\n", "URL = \"https://realpython.github.io/fake-jobs/\"\n", "page = requests.get(URL)\n", "\n", "print(page.text)" ] }, { "...
# -*- coding: utf-8 -*- """ *Module* ``project.generator`` This module provides some classes to generate and handle different types of data during running the application. This can be used outside the application as it works independently. """ from statistics import stdev from collections import Counter from random ...
cfl_safety_factor self._no_dimensions = no_dimensions super().__init__() @property def cfl_safety_factor(self) -> float: return self._cfl_safety_factor @property def no_dimensions(self) -> bool: return self._no_dimensions def get_time_step(self, grid): dt = self._cfl_safety_factor * grid.step / SPEED_OF_S...
<filename>database/dataio.py #pulled this out of api.py import inspect from database.main import printD,tdb #tdb.off() class BaseDataIO: """ Base class for all experiment steps This should be extended for each type of step Step types should then be extended once more To define individual records/steps :attr::cl...
<filename>server/www/packages/packages-windows/x86/ldap3/abstract/entry.py """ """ # Created on 2016.08.19 # # Author: <NAME> # # Copyright 2016 - 2020 <NAME> # # This file is part of ldap3. # # ldap3 is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License ...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Provide a unix-like grep function for Python. Author: <NAME>. Since: 2017. """ import re # get python base string for either Python 2.x or 3.x try: _basestring = basestring except NameError: _basestring = str def __fix_args(kwargs): """ Set all named arguments short...
= set() for (chain_id,) in cursor.fetchall(): chain_ids.add(chain_id) for chain_id in sorted(chain_ids): chain = CommentChain.fromId(db, chain_id, user, review=review) chain.loadComments(db, user) result.append(chain) return result def createCommentChain(db, user, review, chain_type, commit_id=None, origin=N...
<filename>uipath/sequence.py from bs4 import BeautifulSoup class Sequence: def __init__(self, file): self.file = file self.init_vars() # load all the vars from the xaml file #Initializes all variables for the class file def init_vars(self): self.xaml = self.read_xaml() # Read xaml file self.name = self.ge...
<filename>music.py """ MicroPython on the BBC micro:bit comes with a powerful music and sound module. It’s very easy to generate bleeps and bloops from the device if you attach a speaker. Use crocodile clips to attach pin 0 and GND to the positive and negative inputs on the speaker - it doesn’t matter which way roun...
produce 1 page TLS Validation Reports # functions needed to produce 1 page TLS Validation Reports # functions needed to produce 1 page TLS Validation Reports # functions needed to produce 1 page TLS Validation Reports # functions needed to produce 1 page TLS Validation Reports def plot_odd_even_transits(LC_df, TLSbe...
<gh_stars>1-10 # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. """ A plugin to navigate HDUs in a FITS file or planes in a 3D cube or higher dimension dataset. **Plugin Type: Local** ``MultiDim`` is a local plugin, which means it is associated with a channel...
from DejaVu import Viewer from DejaVu.Spheres import Spheres from DejaVu.IndexedPolylines import IndexedPolylines from DejaVu.Materials import propertyNum from time import sleep import unittest import sys #declare the 'showwarning' variable that is used in the code returned by maa.getSourceCode() showwarning = False ...
# -*- coding: utf-8 -*- import base64 import decimal from decimal import Context, Decimal, Inexact from .asset import Asset from .stellarxdr import Xdr from .utils import (account_xdr_object, best_rational_approximation as best_r, division, encode_check, signer_key_xdr_object, is_valid_address, convert_hex_to_bytes...
self.icdf.conf_set(conf['ICDF']) if self.FIELD is None: pass else: self.FIELD.conf_set(conf['FIELD']) if self.VEL is None: pass else: self.VEL.conf_set(conf['VEL']) # ==================== class DrawingConfig(): # ==================== def __init__(self): # ======================== self.FILECONF = '%s' % ...
test_in_use_with_available_volume(self): volume = self._create_volume_dict() self.assertIsNone(self._driver._in_use(volume)) @mock.patch.object(VMDK_DRIVER, '_in_use', return_value=True) def test_retype_with_in_use_volume(self, in_use): context = mock.sentinel.context volume = self._create_volume_dict( status='...
#!/usr/bin/env python # $Id: Compiler.py,v 1.148 2006/06/22 00:18:22 tavis_rudd Exp $ """Compiler classes for Cheetah: ModuleCompiler aka 'Compiler' ClassCompiler MethodCompiler If you are trying to grok this code start with ModuleCompiler.__init__, ModuleCompiler.compile, and ModuleCompiler.__getattr__. Meta-Data ==...
import torch import torch.nn as nn from collections import OrderedDict import os import numpy as np import utils as utils import torch.nn.functional as F def get_batch_params(x): batch_size = x.shape[0] bessel = (batch_size - 1) / batch_size mean = torch.mean(x, 0) std = torch.sqrt(torch.var(x, 0) * bessel + 1e-0...
. . . . . . set/get chapter in current item # | chapter_n . . . . . . . . . . . . . . next chapter in current item # | chapter_p . . . . . . . . . . . . previous chapter in current item # | # | seek X . . . . . . . . . . . seek in seconds, for instance `seek 12' def _rc_seek(self, time: int): self._rc_send('title %i...
# MIT License # # Copyright (c) 2019 <NAME>, <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, me...
IncUnempRet : float Transitory income received while "unemployed" when retired. T_cycle : int Total number of non-terminal periods in the consumer's sequence of periods. Returns ------- IncomeDstn : [[np.array]] A list with T_cycle elements, each of which is a list of three arrays representing a discrete appro...
#!/usr/bin/env python from glob import glob from accessoryFunctions.accessoryFunctions import * import shutil __author__ = 'adamkoziol' def relativesymlink(src_file, dest_file): """ https://stackoverflow.com/questions/9793631/creating-a-relative-symlink-in-python-without-using-os-chdir :param src_file: the file ...
# ============= # INTERNET # ============= SUBREDDITS = [ "/r/AskReddit", "/r/IAmA", "/r/bestof", "/r/fatpeoplestories", "/r/pettyrevenge", "/r/TalesFromRetail", "/r/DoesAnybodyElse", "/r/CrazyIdeas", "/r/WTF", "/r/aww", "/r/cringepics", "/r/cringe", "/r/JusticePorn", "/r/MorbidReality", "/r/rage", "/r/...
if __name__ == "__main__": #%% import sys import time from sklearn.model_selection import StratifiedKFold, train_test_split from tqdm import trange sys.path.append('..') import os import torch import pandas as pd import numpy as np from torch.nn import CrossEntropyLoss, BCEWithLogitsLoss from lens.mod...
<filename>src/pretix/presale/checkoutflow.py # # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero Gene...
<filename>src/celpy/celtypes.py # SPDX-Copyright: Copyright (c) Capital One Services, LLC # SPDX-License-Identifier: Apache-2.0 # Copyright 2020 Capital One Services, 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 obta...
import os import glob import scipy import pickle import numpy as np from source.offline_ds_evaluation.metrics_manager import MetricsManager import matplotlib import matplotlib.pyplot as plt from matplotlib.colors import Normalize # Turn interactive plotting off plt.ioff() import seaborn as sns sns.set() matplotlib.rc(...
""" Inline separated list of species and their weights of an observable Attributes: separator (:obj:`str`): list separator """ def __init__(self, related_class, separator=' + ', related_name='', verbose_name='', verbose_related_name='', help=''): """ Args: related_class (:obj:`class`): related class separator...
< self._assets["A-s"]: result.update({"entrant": self.ENTRANT_CHOICES["indifferent"]}) result.update({"incumbent": self.INCUMBENT_CHOICES["copy"]}) result.update({"development": self.DEVELOPMENT_OUTCOME["failure"]}) else: result.update({"entrant": self.ENTRANT_CHOICES["substitute"]}) result.update({"development":...
<reponame>forgeservicelab/ansible.account-cleanup<gh_stars>0 #!/usr/bin/env python # (c) 2012, <NAME> <<EMAIL>> # modified by <NAME> <<EMAIL>> # # This file is part of Ansible, # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # t...
import numpy as _np class Full: def __init__(self): """ Full fitting, no omissions to rate equations """ pass def C(self, t, k1, k2, k3, k4, k5, k6, k7, rho1, rho2, C0, CO0, O0, OH0, O20, HCO0): output = C0 * (_np.exp((((-k2) - k1) * (rho2 * t)))) return output def CO(self, t, k1, k2, k3, k4, k5, k6, k7,...
<reponame>neilferg/matlab2cpp import logging import re import os from os.path import sep import matlab2cpp from . import m2cpp import matlab2cpp.pyplot from . import reference def flatten(node, ordered=False, reverse=False, inverse=False): """ Backend for the :py:func:`~matlab2cpp.Node.flatten` function. Args: no...
left: 30%; } .uk-push-7-10 { left: 70%; } .uk-push-9-10 { left: 90%; } /* * Pull */ /* Halves */ .uk-pull-1-2, .uk-pull-2-4, .uk-pull-3-6, .uk-pull-5-10 { left: -50%; } /* Thirds */ .uk-pull-1-3, .uk-pull-2-6 { left: -33.333%; } .uk-pull-2-3, .uk-pull-4-6 { left: -66.666%; } /* Quarters */ ....
: Python dictionary parameter from the froce plate calibration file keys: 'fp', 'scale', 'size', 'cal_matrix', 'origin', 'center', 'orientation' """ fp, scale, size, cal_matrix, origin, center, orientation = [], [], [], [], [], [], [] with open(file=fname, mode='rt', encoding='utf-8', newline='') as f: if s...
(1, time//iks[1]), strides=(1, s), use_bias=False, padding='same', name='input_over_' + str(iks[1]))(inputs) w2 = layers.BatchNormalization(name='input_over_' + str(iks[1]) + '_bn')(w2) w2 = layers.Activation('relu', name='input_over_' + str(iks[1]) + '_relu')(w2) w3 = layers.Conv2D(2, (1, time//iks[2]), strid...
seconds." % (num_kmers, time_spent) # return reversed slice return kmer_arr[0:count][::-1] def clear_kmer(self, kmer): if isinstance(kmer, str): kmer = kmer_to_intval(kmer) ck = self.get_central_kmer(kmer) node = self.get_node_for_central_kmer(ck) return self.remotemultiset[node].delete(kmer) def prune_kme...
This is used when changing the model. """ self._remove_labels() reset_minus1 = True # new geometry if reset_minus1: self.label_actors = {-1 : []} else: for idi in self.label_actors: if idi == -1: continue self.label_actors[idi] = [] self.label_ids = {} #self.case_keys = [ #(1, 'ElementID', 1, 'centroid'...
self.button_deletar_registro_10.setGeometry(QtCore.QRect(200, 2, 221, 27)) font = QtGui.QFont() font.setFamily("Segoe UI Black") font.setPointSize(9) font.setBold(True) font.setWeight(75) self.button_deletar_registro_10.setFont(font) self.button_deletar_registro_10.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandC...
# -*- coding: utf-8 -*- """ Created on Sat Sep 29 20:55:53 2018 Image dataset loader for a .txt file with a sample per line in the format 'path of image start_frame verb_id noun_id' @author: Γιώργος """ import os import pickle import cv2 import numpy as np from scipy.spatial.distance import pdist, squareform from t...
<reponame>benshaw/modeldb # -*- coding: utf-8 -*- import glob import json import os import pickle import shutil import sys import tarfile import tempfile import time import zipfile import cloudpickle import pytest import six import verta from verta.tracking.entities._deployable_entity import _CACHE_DIR from verta._i...
truth from h5py vfile.f.create_dataset(f'data{i}', data=data, fillvalue=-1, chunks=chunks, maxshape=(None, None, None)) vfile.f[f'data{i}'].resize(newshape) new_data = vfile.f[f'data{i}'][()] # resize after creation with vfile.stage_version(f'version1_{i}') as group: group.create_dataset(f'dataset1_{i}', data=d...
m.b2270 <= 0) m.e2463 = Constraint(expr= m.x1723 - 1.10947836929589 * m.b2271 <= 0) m.e2464 = Constraint(expr= m.x1724 - 1.10947836929589 * m.b2272 <= 0) m.e2465 = Constraint(expr= m.x1725 + 1.10947836929589 * m.b2269 <= 1.10947836929589) m.e2466 = Constraint(expr= m.x1726 + 1.10947836929589 * m.b2270 <= 1.1094783692...
will find the scale automatially by the minimum and maximum # values in the field # contour_lim A two array or tuple containing the lower and upper bounds for the contour lines # levels: The levels to draw contours for, if an int then they will be evenly spaced between clim[0] and clim[1]. # Can also be a list/arra...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import datetime import json import re import string import textwrap import traceback from recipe_engine.types import freeze RESULTS_URL = 'https://chromep...
import xml.etree.ElementTree as ET import os from PIL import Image import pathlib import shutil import base64 from tkinter import filedialog import pandas as pd import shutil from tkinter import messagebox import sqlite3 import xlsxwriter import collections.abc as byteobj from pandas import ExcelWriter class XML_Inter...
= [get_special(base_type).import_str] else: retval = [] elif not msg_context.is_registered(full_msg_type): retval = [] else: retval = ['import %s.msg'%pkg] iter_types = get_registered_ex(msg_context, full_msg_type).types for t in iter_types: assert t != full_msg_type, "msg [%s] has circular self-dependencies"%...
and won't be scanned. # Duplication note: When scanning multple copies, the original # or multiple copy #Determine if the destination file is a multple copy or not. # Remove the src_bfid from original_copy_list, so that we can tell # the difference between the cases listed below. #There are two conditions we wa...
<reponame>piyush82/elastest-device-emulator-service from base64 import b64encode, b64decode from datetime import datetime from futile import uc from futile.etree import ElementTree as ET, tostring from futile.etree.ElementTree import QName from futile.logging import DEBUG from openmtc.model import EntityAttribute from...
None maximum_value: Optional[int] = None none_of: Optional[Union[Union[dict, AnonymousTypeExpression], List[Union[dict, AnonymousTypeExpression]]]] = empty_list() exactly_one_of: Optional[Union[Union[dict, AnonymousTypeExpression], List[Union[dict, AnonymousTypeExpression]]]] = empty_list() any_of: Optional[Union[U...
provided, the provider project is used. """ return pulumi.get(self, "project") @project.setter def project(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "project", value) @property @pulumi.getter def region(self) -> Optional[pulumi.Input[str]]: """ The region where the managed instance group r...
> 0 def test_real_request_part_upload_drive_media(self): with pytest.raises(pylark.PyLarkError) as e: self.module_cli.part_upload_drive_media(pylark.PartUploadDriveMediaReq()) assert e.type is pylark.PyLarkError assert e.value.code > 0 def test_real_request_finish_upload_drive_media(self): with pytest.raises(...
XXXX XXXX XXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXX XX XXX XXXXX XXXXXXXX XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX XXXXXX XX XXXXXXXXXXXXXXXXX XXX XXXXXXXXXXXX XXXX X XXXXXXX XX XX XXXX XX XXXXXX XX X XXXXXXX XXXXX XXXXXXXXXX XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXX XX XXXX XXX X...
""" IBM PAIRS RESTful API wrapper: A Python module to access PAIRS's core API to load data into Python compatible data formats. Copyright 2019-2021 Physical Analytics, IBM Research All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause """ # fold: Import Python Standard Library {{{ # Python Standard Library: imp...
<reponame>MHelena45/feup-iope import math from gurobipy import * d={} d={ ("Doce","Doce"): 0, ("Doce","Bom"):math.inf, ("Doce","Sky"):6000, ("Doce","Moon"):5000, ("Doce","Mars"):5500, ("Bom","Doce"):math.inf, ("Bom","Bom"):0, ("Bom","Sky"): 6000, ("Bom","Moon"): 5800, ("Bom","Mars"):4800, ("Sky","Doce"): 6000, ("Sky...
<gh_stars>0 #!/usr/bin/env python2.7 import functools import pydot import tac from symbol_table import * node_counter = 0 def make_node(name, graph): global node_counter node = pydot.Node("{}".format(node_counter), label='"{}"'.format(name)) graph.add_node(node) node_counter += 1 return node def add_edge(graph, ...
import sublime import sys import threading # Helper module try: from .helper import H except: from helper import H # Settings variables try: from . import settings as S except: import settings as S # DBGp protocol constants try: from . import dbgp except: import dbgp # Config module from .config import get_v...
<reponame>pwmarcz/madness from random import choice, random, shuffle from math import log import tcod as T from settings import * from util import * from item import Item import ui class Mob(object): x, y = None, None glyph = UNKNOWN_GLYPH map = None enters_walls = False sanity_dice = None real = True # -4 ...
<filename>fairseq/models/nat/vatex_cmlm_transformer.py # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ This file implements: Ghazvininejad, Marjan, et al. "Constant-time machine translat...
""" build layer Programmer: <NAME> Date: 2021.3 """ import inspect import platform import torch.nn as nn import torch.nn.functional as F if platform.system() == 'Windows': import regex as re else: import re from dl_toolbox_cwm.model.utils import xavier_init from dl_toolbox_cwm.model.utils.core.misc import is_tuple_of...
-np.inf, 335: -np.inf, 336: -np.inf, 337: -np.inf, 338: -np.inf, 339: -np.inf, 340: -np.inf, 341: -np.inf, 342: -np.inf, 343: -np.inf, 344: -np.inf, 345: -np.inf, 346: -np.inf, 347: -np.inf, 348: -np.inf, 349: -np.inf, 350: -np.inf, 351: -np.inf, 352: -np.inf, 353: -np.inf, 354: -np.inf, 355: -np.i...
eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='Contact'): pass def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='Contact', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ =...
+ __d3diskmass__ time_ = d3class.get_time_for_it(it, "profiles", "prof") time_arr.append(time_) it_arr.append(it) if os.path.isfile(fpath): data_ = np.float(np.loadtxt(fpath, unpack=True)) data_arr.append(data_) else: data_arr.append(np.nan) # it_arr = np.array(it_arr, dtype=int) time_arr = np.array(time_arr...
- 2 label_length[i] = 1 source_str.append('') else: if K.image_data_format() == 'channels_first': X_data[i, 0, 0:self.img_w, :] = ( self.paint_func(self.X_text[index + i])[0, :, :].T) else: X_data[i, 0:self.img_w, :, 0] = ( self.paint_func(self.X_text[index + i])[0, :, :].T) labels[i, :] = self.Y_data[index +...
GeoTiff file using the ``gs`` scheme. If the :py:class:`~descarteslabs.catalog.StorageState` is :py:attr:`~descarteslabs.catalog.StorageState.REMOTE`, this field is optional and you can use one of the schemes ``gs``, ``http``, ``https``, ``ftp``, or ``ftps``; if the scheme is ``gs``, it must be a valid reference b...
== "offset": estoffset = rawvalue if self.showunits else value elif name == "pmode": # FIXME, pmode never used. pmode = value elif name == "ppoll": ppoll = value if ppoll < 0: ppoll = ntp.magic.NTP_MINPOLL elif name == "precision": # FIXME, precision never used. precision = value elif name == "reach": # Sh...
import numpy as np import math import sys import scipy.ndimage import pickle import graph as splfy import code import random import showTOPO from rtree import index from time import time from hopcroftkarp import HopcroftKarp from sets import Set from subprocess import Popen def latlonNorm(p1, lat = 40): p11 = p1[1...
eval acc, best eval micro_f1, best eval macro_f1, best test acc, for each experiment we record: 1. the args used for the experiment 2. append record eval and test performance after each training epoch 3. append the summary performance to a file. 4. save the best evaluation model. 5. copy all model files to tensor...
(ex: NameArea='P1') noiseReduction (int) Maximal size of the area which will be removed in the function 'noiseRemoval' (ex: noiseReduction=100) numberOfClasses (int): Number of classes (ex: numberOfClasses=2) classesNamesList (List of strings): List of the names of the classes (ex: classesNamesList=[...
<filename>sdk/python/pulumi_google_native/notebooks/v1/instance.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping,...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torch.nn import Parameter from torch.distributions import Bernoulli import math from core import metrics class ModuleWrapper(nn.Module): """Wrapper for nn.Module with support for arbitrary flags and...
as well as time variables t_age and t_cycle. Normalized assets and permanent income levels are drawn from lognormal distributions given by aNrmInitMean and aNrmInitStd (etc). Parameters ---------- which_agents : np.array(Bool) Boolean array of size self.AgentCount indicating which agents should be "born". Return...
<filename>dimod/serialization/format.py<gh_stars>0 # Copyright 2019 D-Wave Systems 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 # # Unle...
= DataFrame([[1, 'A'], [2, 'A']], columns=midx) expected = df.groupby('to filter').groups result = df.groupby([('to filter', '')]).groups tm.assert_dict_equal(result, expected) def test_groupby_multiindex_tuple(self): # GH 17979 df = pd.DataFrame([[1, 2, 3, 4], [3, 4, 5, 6], [1, 4, 2, 3]], columns=pd.MultiInde...
{ content: "\\f1cd"; } .uk-icon-circle-o-notch:before { content: "\\f1ce"; } .uk-icon-ra:before, .uk-icon-rebel:before { content: "\\f1d0"; } .uk-icon-ge:before, .uk-icon-empire:before { content: "\\f1d1"; } .uk-icon-git-square:before { content: "\\f1d2"; } .uk-icon-git:before { content: "\\f1d3"; } .uk-icon-hack...
from __future__ import absolute_import, division, unicode_literals import re import time, datetime import threading from. import settings import xbmc import xbmcgui from . import kodigui from .smoothstreams import timeutils, chanutils, skinutils, schedule, authutils, windowutils from . import util from .kodijsonrpc imp...
<filename>skyfit.py """ Sky fitting. These functions were ported from IDL codes used by ACS/WFC reference files generation and statistics. Examples -------- >>> import matplotlib.pyplot as plt >>> from astropy.io import fits >>> import skyfit Read EXT 1 of ACS/WFC superbias image: >>> im = fits.getdata('x1o1958ej_b...
}, bases=('gedungbangunan.tahunberkuranggedungbangunan',), ), migrations.CreateModel( name='TahunBerkurangGedungBangunanPariwisata', fields=[ ], options={ 'verbose_name': '46 Tahun Berkurang Gedung Pariwisata', 'proxy': True, 'verbose_name_plural': '46 Tahun Berkurang Gedung Pariwisata', }, bases=('gedungba...
post_processing=post_processing) def ProcessAction(self, action: actions.Action, post_processing=True): if self.is_gameover: return # print(f"Processed action: {action.direction}, {action.rotation}, {action.swap}") # self.test += 1 # print(self.test) if action.swap: self.Swap() self.Rotate(action.rotation) s...
# NOTE: See note above for variable name "expr" # for expr,conc in self.concjs: for exprj, concj in self.concjs: def rule_j_lb(m, i, j): e = exprj._pyomo_expr(index=(j,)) c = concj.expr._pyomo_expr(index=(j,)) body = e - c body_LB = getLB(body) MLBj = ( body_LB if body_LB is not None else -ImpliesSiteCombin...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """A miscellaneous collection of basic functions.""" import sys import copy import os import warnings from collections.abc import Iterable from pathlib import Path import tempfile from scipy.interpolate import interp1d from scipy.stats import ncx2 import...
initialized or checked * @param val The integer value to set/check against, see below * * Note that equality means something special for strings. Each byte * is initialized to an incrementing value. So check is done against that. * */ """) for t in scalar_types: if t in integer_types: out.write(""" #define VA...
for spatial plots # ==================================== sub_fig_text = ['(a)', '(b)', '(c)', '(d)', '(e)', '(f)'] Wins_to_Plot = ['1850-74', '1900-24', '1950-74', '2000-24', '2050-74', '2075-99'] Wins_to_Plot_idxs = [0,2,4,6,8,9] import cartopy.crs as ccrs from matplotlib.axes import Axes from cartopy.mpl.gridliner i...
<reponame>deepmind/kfac_jax<gh_stars>1-10 # Copyright 2022 DeepMind Technologies Limited. 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/licens...
== 'macro', average f-beta of all the class is given. * When ``average`` == `weighted`, average f-beta of all the class weighted by support of every true classes is given. :Example: Assume we have a table named 'predicted' as follows: ======== =================== label prediction_result ======== =============...
<filename>lib/kinematics/HTM.py # Access to parent folder to get its files import sys, os from pandas import array sys.path.append(sys.path[0].replace(r'/lib/kinematics', r'')) # Libraries import numpy as np from lib.movements.HTM import * from lib.dynamics.Solver import * from sympy import * def forwardHTM(robot : ...
`pdf` = if not None, figures will be appended to the existing PDF Returns: `D_params` = dictionary of fit parameters If `with_delay=True`, returns `D_params, delays`, where `delays` dictionary of fitted delay with same structure as `D_params`. Here, `D_params` loses delay parameters. """ if not return_...
<reponame>rt112000/CDM # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. import importlib import json from collections import OrderedDict from typing import Any, Optional, TYPE_CHECKING from cdm.enums import CdmO...
ex_primary_nic_private_ipv4='10.0.0.1', ex_is_started=False, ex_disks=disks) def test_create_node_ipv4_gateway(self): rootPw = NodeAuthPassword('<PASSWORD>') image = self.driver.list_images()[0] node = self.driver.create_node(name='test2', image=image, auth=rootPw, ex_description='test2 node', ex_network_dom...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import numpy as np import os import re import sys from argparse import ArgumentParser from datetime import datetime, timedelta from itertools import product from scipy.interpolate import griddata from serial import Serial from time import sleep, time class Pr...
# This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the Apache License, Version 2.0 (the "License"); # you may ...
all data from the MGH file and return it as a numpy array. Optionally, collect meta data from the mgh file header. Parameters ---------- mgh_file_name: string A string representing a full path to a file in FreeSurfer MGH file format. If the file name end with '.mgz' or '.mgh.gz', the file is assumed to be in gzipp...
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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 # (at your option) any later version. # # Ansible is distribut...
5],[8, 325])) df = pd.DataFrame(datos, columns = ["Masculino", "Femenino"]) MC = df indices_personalizados(MC) # #### 7. Compare los resultados con los obtenidos en las tareas del curso anterior. # In[104]: cadena = "Cuadro Comparativo entre Modelos Supervisados" print(cadena.center(35," ")) print(" ============...