input
stringlengths
2.65k
237k
output
stringclasses
1 value
######################################## # # These functions edit sessions # ######################################## from datetime import date, timedelta, datetime from skipole import FailPage, GoTo, ValidateError, ServerError from .. import sun, database_ops def fill_edit_sessions(skicall): """Populates the ed...
''' Created on Jan 11, 2012 @author: <NAME>, 2nd Look Consulting http://www.2ndlookconsulting.com/ Copyright (c) 2013, <NAME>, Argonne National Laboratory All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following con...
string_array.num_total_chars, builder.extract_value(ptr, 0), length, kind, is_ascii, ind ]) return context.get_dummy_value() return types.void(str_arr_t, ind_t, ptr_t, len_t), codegen def lower_is_na(context, builder, bull_bitmap, ind): fnty = lir.FunctionType(lir.IntType(1), [lir.IntType(8).as_pointer(), lir...
+ m.b431 <= 1) m.c4622 = Constraint(expr= m.b326 - m.b342 + m.b432 <= 1) m.c4623 = Constraint(expr= m.b327 - m.b328 + m.b433 <= 1) m.c4624 = Constraint(expr= m.b327 - m.b329 + m.b434 <= 1) m.c4625 = Constraint(expr= m.b327 - m.b330 + m.b435 <= 1) m.c4626 = Constraint(expr= m.b327 - m.b331 + m.b436 <= 1) m.c4627 =...
# -*- coding: utf-8 -*- """ Created on Mon Sep 25 15:52:05 2017 @author: Xian_Work """ param_path="../Parameters/params_ui.json" execfile("prelim.py") from model_plotting import norm , compute_dist, gen_model_target, sim_plot, make_base_plot, mk_mix_agent, gen_evolve_share_series #For writing output import xlsxwrit...
client extensions to add to the Order. Do not set, modify, or delete clientExtensions if your account is associated with MT4. take_profit_on_fill: :class:`~async_v20.TakeProfitDetails` TakeProfitDetails specifies the details of a Take Profit Order to be created on behalf of a client. This may happen when an Order ...
refreshing the WSDL file terminated with error message') self.log('Changing wsdl to wsdl which can\'t be validated') warning, error, console = edit_wsdl(self, wsdl_error_url) expected_error_msg = WSDL_EDIT_ERROR_VALIDATION_FAILED.format(wsdl_error_url) self.log('SERVICE_10 3a.1 System displays the error message "{0...
to solve i think, 152 has high occlusion and 4 objects skip_list = ['kitchen_4/000006.left.jpg', 'kitchen_4/000014.left.jpg', 'kitchen_4/000169.left.jpg', 'kitchen_4/000177.left.jpg'] # 120 has some bug # for img_i in range(0,100): # for img_i in range(100,150): # for img_i in range(155,177): #for img_i in list...
# Copyright 2014 Cisco Systems, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
<filename>layerserver/api/dblayer_content.py import logging import mimetypes import os import warnings from functools import reduce from operator import __or__ as OR from django.conf import settings from django.contrib.gis.gdal import CoordTransform, SpatialReference from django.contrib.gis.geos import GEOSGeometry, ...
= [event['daily_perf']['capital_used'] for event in results] self.assertEqual(cash_flows, [-1000, 0, 1000, 0, 0, 0]) cumulative_cash_flows = \ [event['cumulative_perf']['capital_used'] for event in results] self.assertEqual(cumulative_cash_flows, [-1000, -1000, 0, 0, 0, 0]) cash_pos = \ [event['cumulative_perf']...
1 to n-2, with point 2 to n-1 as other vertex of triangle # this could definitely be written more nicely b_point = vertices[1] root_b_dist = haversine_distance(root_point, b_point) for i in np.arange(1, n - 1): a_point = b_point b_point = vertices[i + 1] root_a_dist = root_b_dist root_b_dist = haversine_distanc...
#!/usr/bin/env python3 # smugsync v2.3 # to keep my sanity since local directories can be both folders and galleries in SmugMug # I use the following terminology in the code: # local filesystem directory intended to be a 'Folder' in SmugMug is called a directory # local filesystem directory intended to be a 'Gallery'...
from django.shortcuts import render from django.contrib import messages from django.shortcuts import render_to_response, redirect from django.contrib import auth from django.contrib.auth.decorators import login_required from django.http import JsonResponse, HttpResponse from django.utils import timezone from django.cor...
<reponame>ZihanWangKi/scratch import collections import os import unicodedata from transformers.tokenization_utils import PreTrainedTokenizer, _is_control, _is_punctuation, _is_whitespace def load_vocab(vocab_file): """Loads a vocabulary file into a dictionary.""" vocab = collections.OrderedDict() with open(vocab_...
cannot really do much to recover, because cluster is not in usable state anyway metadata = flink.get("metadata") labels = metadata.get("labels") config_sha = labels.get(paasta_prefixed("config_sha")) if config_sha is None: raise ValueError(f"expected config sha on Flink, but received {metadata}") if config_sha.st...
<filename>environment.py from tkinter import * from tkinter import ttk import time import numpy as np import copy import random from mujoco_py import load_model_from_path, MjSim, MjViewer from gym.envs.robotics import rotations, utils from gym.utils import seeding def seed(self, seed=None): self.np_random, seed = see...
<reponame>turicas/nltk # Natural Language Toolkit: Concordance Application # # Copyright (C) 2001-2013 NLTK Project # Author: <NAME> <<EMAIL>> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from __future__ import print_function import re import threading import tkFont from Tkinter import (Tk,...
= reward_network.estimate_temporal_difference(mu1[t1_i].unsqueeze(0), mu1[t2_i].unsqueeze(0)) est_dt_j = reward_network.estimate_temporal_difference(mu2[t1_j].unsqueeze(0), mu2[t2_j].unsqueeze(0)) real_dt_i = (times_i[t2_i] - times_i[t1_i])/100.0 real_dt_j = (times_j[t2_j] - times_j[t1_j])/100.0 actions_1 = reward...
'sections in model': sec_in_model, 'recorded sections': recorded_sections, 'spacings': spacing, 'max spacing': max(spacing), 'min spacing': min(spacing)} line_color_coding, puls_method_map, puls_sp_or_up_map = \ {}, {None: 0, 'buckling': 0.5, 'ultimate': 1}, {None:0, 'SP': 0.5, 'UP': 1} cmap_sections = plt.get_cma...
defined one. Note that this may happen # on a first poll after server side config for a bot has changed. The bot # doesn't know about new server-assigned dimensions yet in this case. Also # don't report ['default'], bot sends it in the handshake before it knows # anything at all. for dim_key, from_cfg in bot_group...
if X_embedding is None: if vkey == "velocity_S": X_embedding = adata.obsm["X_" + basis] else: adata = reduceDimension(adata, layer=layer, reduction_method=basis) X_embedding = adata.obsm[layer + "_" + basis] if X.shape[0] != X_embedding.shape[0] and X.shape[1] > X_embedding.shape[1]: raise Exception(f"X and X_e...
" to method proxy_get_namespaced_node_19" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'name' is set if ('name' not in params) or (params['name'] is None): raise ValueError("Missing the required parameter `name` when calling `proxy_get_namespaced_node_19`") # verify the require...
<gh_stars>10-100 import argparse import glob import logging import os import subprocess from collections import defaultdict from datetime import datetime import pandas as pd from tqdm import tqdm from nanocompare.global_config import set_log_debug_level, pic_base_dir, logger run_log_dir = '/projects/li-lab/Nanopore_...
<reponame>artbees/python-aiplatform # -*- 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 # # Unl...
# -*- coding: utf-8 -*- """Simple functions and lookup tables for nucleic acid and amino acid sequences. """ import logging import re from string import ascii_lowercase _logger = logging.getLogger(__name__) aa3_to_aa1_lut = { "Ala": "A", "Arg": "R", "Asn": "N", "Asp": "D", "Cys": "C", "Gln": "Q", "Glu": "E",...
<filename>mcos/optimizer.py from __future__ import division from abc import ABC, abstractmethod from typing import Dict, List import numpy as np import pandas as pd import scipy.cluster.hierarchy as sch from numpy.linalg import inv, pinv #Compute the (multiplicative) inverse of a matrix. from pypfopt.efficient_front...
Node.TEXT_NODE) : data['fromPeriod']=node2.data for node1 in xmlTree.getElementsByTagName("error") : for node2 in node1.childNodes: if(node2.nodeType == Node.TEXT_NODE) : data['error']=node2.data for node1 in xmlTree.getElementsByTagName("status") : for node2 in node1.childNodes: if(node2.nodeType == Node.TEXT_...
<gh_stars>10-100 # Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT) # Bespoke Link to Instruments and Small Satellites (BLISS) # # Copyright 2018, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any # commercial use must be ne...
<filename>util_write_cap.py #! /usr/bin/env python # -*- coding: utf-8 -*- """ Utilities to prepare files for CAP For reference see versions prior to Aug 25, 2016 for: getwaveform_iris.py getwaveform_llnl.py 20160825 cralvizuri <<EMAIL>> """ import obspy from obspy.io.sac import SACTrace import obspy.signal.rotate ...
import argparse import collections import copy import json import os import pprint import re from operator import itemgetter from warnings import warn import pandas as pd import plotly import plotly.graph_objs as go from docopt import docopt from matplotlib import cm from matplotlib.colors import rgb2hex from munkres ...
<gh_stars>0 # Omid55 # Test module for group dynamics logs library. from __future__ import division, print_function, absolute_import, unicode_literals import os import unittest import numpy as np import pandas as pd from pandas import testing as pd_testing from numpy import testing as np_testing from parameterized i...
DialogResult """ pass def ShowModal(self): """ ShowModal(self: LayerTransparencyDialog) -> Nullable[bool] """ pass Percent = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """Get: Percent(self: LayerTransparencyDialog) -> UInt32 Set: Percent(self: LayerTransparen...
<reponame>nitram509/nitram-micro-font<gh_stars>1-10 #!/usr/bin/python # -*- coding: utf-8 -*- nitram_micro_mono_CP437 = [ 0, 0, 0, 0, 0, 10, 0, 4, 17, 14, 10, 0, 0, 14, 17, 27, 31, 31, 14, 4, 0, 0, 0, 0, 0, 0, 4, 10, 4, 14, 4, 14, 14, 4, 14, 0, 14, 14, 14, 0, 0, 0, 0, 0, 0, 0, 4, 10, 4, 0, 0, 0, 0, 0, 0, 3...
import codecs import errno import fcntl import io import os import pty import resource import signal import struct import sys import termios import time try: import builtins # Python 3 except ImportError: import __builtin__ as builtins # Python 2 # Constants from pty import (STDIN_FILENO, CHILD) from .util import ...
<reponame>bb-froggy/tpm2-pkcs11 # SPDX-License-Identifier: BSD-2-Clause # python stdlib dependencies import binascii import io import os import struct import sys import yaml from tempfile import mkstemp # local imports from .command import Command from .command import commandlet from .db import Db from .objects impor...
"""Compilation of functions for analyzing maizsim output.""" import os import collections import pandas as pd import numpy as np from numpy import genfromtxt from sklearn.decomposition import PCA from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LinearRegression from sklearn.metrics im...
<filename>Lib/test/test_xml_etree.py # IMPORTANT: the same tests are run from "test_xml_etree_c" in order # to ensure consistency between the C implementation and the Python # implementation. # # For this purpose, the module-level "ET" symbol is temporarily # monkey-patched when running the "test_xml_etree_c" test suit...
<filename>models.py import torch from torch import nn from torch.nn import CrossEntropyLoss import torch.nn.functional as F import math import os from pytorch_pretrained_bert.file_utils import PYTORCH_PRETRAINED_BERT_CACHE from pytorch_pretrained_bert.modeling import BertConfig, WEIGHTS_NAME, CONFIG_NAME, BertPreTraine...
''' Created on Apr 15, 2014 @author: <NAME> ''' import argparse import cv2 import numpy as np import os from obj_detect import SegmentedObject from obj_baxter import BaxterObject class BaxterExperiment(BaxterObject): ''' A BaxterExperiment is a BaxterObject with methods to facilitate the use a ...
import numpy as np import math def l2_regularization(W, reg_strength): ''' Computes L2 regularization loss on weights and its gradient Arguments: W, np array - weights reg_strength - float value Returns: loss, single value - l2 regularization loss gradient, np.array same shape as W - gradient of weight by l2...
import numpy as np from cdlib.evaluation.internal import onmi from cdlib.evaluation.internal.omega import Omega from nf1 import NF1 from collections import namedtuple, defaultdict __all__ = [ "MatchingResult", "normalized_mutual_information", "overlapping_normalized_mutual_information_LFK", "overlapping_normalized...
<gh_stars>0 import time import numpy as np import numpy.random as rd import gym import torch import torch.nn as nn class EvaluateRewardSV: # SV: Simplify Version. Only for tutorial. def __init__(self, env): self.env = env self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") def get_eva_rew...
""" Notebook management module. """ import os import markdown from copy import deepcopy from PyQt5.QtCore import Qt from PyQt5 import QtCore, QtGui, QtWidgets """ from PyQt4.QtCore import Qt, QDir, QFile, QSettings, QSize from PyQt4.QtGui import (QAbstractItemDelegate, QAbstractItemView, QColor, QDialog, QDialogButto...
local_var_params and len(local_var_params['namespace']) > 1024): raise ValueError("Invalid value for parameter `namespace` when calling `namespaces_namespace_jobs_get`, length must be less than or equal to `1024`") # noqa: E501 collection_formats = {} path_params = {} if 'namespace' in local_var_params: path_par...
# -*- coding: utf-8 -*- # Copyright (c) 2009-2014, <NAME> # # This module is part of oyProjectManager and is released under the BSD 2 # License: http://www.opensource.org/licenses/BSD-2-Clause import os import logging logger = logging.getLogger(__name__) class Config(object): """Config abstraction Idea is coming...
#This file is part of ElectricEye. #SPDX-License-Identifier: Apache-2.0 #Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you unde...
#!/usr/bin/python # todo: preview doesnt work # TODO: new types: pixel (rgba) # todo: legacy? e.g. compute image of points, computation illustration etc. # todo: doesn't detect wrong number of args # todo: set color # todo: filled julia with the number of it # todo: implement missing rect and arg and line complex # to...
################################ ########### Imports ############ ################################ import sys import traceback import numpy as np import scipy.special as ss import scipy.optimize as so import scipy.integrate as si import scipy.interpolate as inter try: import h5py as h5 h5py = 1 except ModuleNotFoundE...
# -*- coding: utf-8 -*- # Copyright 2020 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type """ The Bgp_global parser templates file. This contains a list of parser definitions an...
<filename>visnav/dataset-gen.py<gh_stars>1-10 import argparse import csv import sys import math import re import cv2 import numpy as np import quaternion from tqdm import tqdm from visnav.algo import tools from visnav.algo.keypoint import KeypointAlgo from visnav.algo.tools import PositioningException f...
#!/usr/local/bin/python # -*- coding: utf-8 -*- from IPython import embed from multiprocessing import Pool, cpu_count #import mega_nn import numpy as np import scipy as sc import scipy.stats as stats import pandas as pd from itertools import product, chain import pickle import os import sys import time networks_path = ...
<filename>miner/strategies/kubernetes/dynamic/k8sDynamicMiner.py from miner.generic.dynamic.dynamicMiner import DynamicMiner from topology.node import Node, Direction from topology.communication import Communication from topology.communicationFactory import CommunicationFactory from topology.concreteCommunicationFactor...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # -*- mode: Python -*- ''' LJ Laser Server v0.8.2 Inspiration for a future WebUI icon menu : https://codepen.io/AlbertFeynman/pen/mjXeMV Laser server + webUI servers (ws + OSC) - get point list to draw : /pl/lasernumber - for report /lstt/lasernumber /lack/lasernumber /cap/...
def enabled(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "enabled") @enabled.setter def enabled(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "enabled", value) @property @pulumi.getter(name="externalTrafficPolicy") def external_traffic_policy(self) -> Optional[pulumi.Input[str]...
<reponame>sparkslabs/kamaelia_orig<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this no...
<gh_stars>1-10 import math import os import pickle import typing from concurrent.futures.thread import ThreadPoolExecutor import torch from sklearn import mixture from sklearn.exceptions import NotFittedError from torch import nn as nn from torch.nn import functional as F from config import WAVENET_LAYERS, WAVENET_BL...
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: atts_assign.py # # Tests: Behavior of assignment for attribute objects. Ensures good cases # succeed and bad cases fail with specific python exceptions. Tests variety # of types present in members of VisIt a...
<filename>test/unit_tests/braket/aws/test_aws_quantum_job.py<gh_stars>0 # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # ht...
<gh_stars>0 # -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2020 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.nsx_policy.infra.tier_0s.locale_services. #------------------------------...
from __future__ import absolute_import, unicode_literals, print_function, division import datetime import decimal import json import logging import re from dateutil.parser import parse as date_parse from django.contrib.gis.geos import Point from future.utils import raise_with_traceback from tableschema import Field a...
import logging import sys import pandas as pd import pyprind import six import warnings from joblib import Parallel, delayed from collections import deque, OrderedDict import heapq from itertools import chain import py_entitymatching.catalog.catalog_manager as cm from py_entitymatching.blocker.blocker import Blocker ...
{POS: ADP}, "<first-cjt>|PRP|@<OA": {POS: ADP}, "<first-cjt>|PRP|@<OC": {POS: ADP}, "<first-cjt>|PRP|@<PIV": {POS: ADP}, "<first-cjt>|PRP|@<PRED": {POS: ADP}, "<first-cjt>|PRP|@<SA": {POS: ADP}, "<first-cjt>|PRP|@<SC": {POS: ADP}, "<first-cjt>|PRP|@A<": {POS: ADP}, "<first-cjt>|PRP|@A<ARG": {POS: ADP}, ...
<gh_stars>1-10 from collections import deque import pickle class EpicTree: """Epic Tree module""" # Constructor def __init__(self, filename=''): self.tree = {} self.materialised_paths = [] self.garbage = [] # Load data file if provided if filename != '': self.tree = pickle.load(open(filename, "rb")) # reg...
# Saves distribution and dependency for particular dimension distributions.append(distribution) dependencies.append(dependency) # Add fit inspection data for current dimension self.multiple_fit_inspection_data.append(fit_inspection_data) # Save the used number of intervals for dep_index, dep in enumerate(depend...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use...
# Autogenerated file. ANY CHANGES WILL BE OVERWRITTEN from to_python.core.types import FunctionType, \ FunctionArgument, \ FunctionArgumentValues, \ FunctionReturnTypes, \ FunctionSignature, \ FunctionDoc, \ FunctionOOP, \ FunctionOOPField, \ CompoundOOPData, \ FunctionData, \ CompoundFunctionData DUMP_PARTI...
<gh_stars>10-100 """ This module uses the h5py (HDF5) package to read and write numpy arrays to disk. See the h5py and HDF5 documentation for further info on the details of this approach. """ # pylint: disable=no-member import h5py as h5 import numpy as np from . import base from ..data import base_legacy as db from...
<filename>galois/_fields/_linalg.py<gh_stars>0 """ A module that contains linear algebra routines over Galois fields. """ import numpy as np from ._dtypes import DTYPES def _lapack_linalg(a, b, function, out=None, n_sum=None): """ In prime fields GF(p), it's much more efficient to use LAPACK/BLAS implementations o...
<filename>mars/dataframe/base/cut.py # 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...
np.zeros(im_size, dtype=np.uint8) for i in range(nb_patterns): label = (i + 1) if len(im_size) == 2: atlas = draw_rand_ellipse(atlas, color=label) elif len(im_size) == 3: atlas = draw_rand_ellipsoid(atlas, clr=label) # logging.debug(type(atlas)) atlas_def = image_deform_elastic(atlas) # logging.debug(np.unique...
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.0293014, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic'...
<gh_stars>1-10 # pylint: disable-msg=E1101,W0612 import operator import nose # noqa from numpy import nan import numpy as np import pandas as pd from pandas import Series, DataFrame, bdate_range, Panel from pandas.tseries.index import DatetimeIndex import pandas.core.datetools as datetools import pandas.util.testing...
# Copyright (c) 2021, DjaoDjin inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the ...
import os, re, sys, shutil, glob, time, csv, xlsxwriter import argparse as ap import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib matplotlib.style.use('ggplot') import msvcrt as m version = "VNX Onions for MS Windows 0.1" # col_filter = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14...
from datetime import datetime from typing import List, Dict, Union import pytest from dataclasses import field from krake.data.config import HooksConfiguration from krake.data.core import Metadata, ListMetadata from krake.data.kubernetes import ClusterList from marshmallow import ValidationError from krake.data.serial...
# encoding: utf-8 import os import pytest from ...config import Configuration from ...testing import DummyHTTPClient from ...model import create from ...model.datasource import DataSource from ...model.edition import Edition from ...model.identifier import Identifier from ...model.licensing import RightsStatus from .....
<reponame>usermicrodevices/pywingui ## Copyright (c) 2003 <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, ...
== int(abs(y)) and abs(y) <= 512: pow2 = [xsym] pow2_scal = [theano.scalar.get_scalar_type(xsym.dtype)()] y_to_do = abs(y) for i in xrange(int(numpy.log2(y_to_do))): pow2.append(T.sqr(pow2[i])) pow2_scal.append(theano.scalar.sqr(pow2_scal[i])) rval1 = None rval1_scal = None while y_to_do > 0: log_to_do = int(...
IV'] = sum([c['Minimum Levenshtein Distance'] for c in eval_distance_result if c['Minimum Levenshtein Distance'] == 1 and c['original spelling status'] == 'misspell' and c['OOV/IV'] == 'IV']) / ALL_IV_NEED_CORRECTION original_dict['Minimum Levenshtein Distance']['Recall for Minimum Levenshtein Distance on Entire Datase...
uk_98 + 31680 * uk_99, uk_0 + 50719 * uk_1 + 2789545 * uk_10 + 170280 * uk_100 + 297000 * uk_101 + 60720 * uk_102 + 915255 * uk_103 + 1596375 * uk_104 + 326370 * uk_105 + 2784375 * uk_106 + 569250 * uk_107 + 116380 * uk_108 + 10648 * uk_109 + 1115818 * uk_11 + 22264 * uk_110 + 11616 * uk_111 + 62436 *...
import pandas as pd def get_toy_data_seqclassification(): train_data = { "sentence1": [ 'Amrozi accused his brother , whom he called " the witness " , of deliberately distorting his evidence .', "Yucaipa owned Dominick 's before selling the chain to Safeway in 1998 for $ 2.5 billion .", "They had published an ad...
fields = ("id","state","alter") # 所有字段验证 def validate(self, attrs): try: del attrs['alter'] # 删除alter字段 except Exception: pass return attrs # 状态字段验证 def validate_state(self, value): validate_states2(self.instance.state, value) if not self.instance.state == "使用中": if ((self.instance.create_us...
== subject_tokens: if forbidden_index is None: labels[index][label_subject] = 1 for i in range(subject_tokens_len - 1): labels[index + i + 1][1] = 1 break elif index < forbidden_index or index >= forbidden_index + len( object_tokens): labels[index][label_subject] = 1 for i in range(subject_tokens_len - 1): la...
data_type=(u'R',u'1',u'18'), position=4, codes=[] ) ), Element( u'STC05', Properties(desc=u'Monetary Amount', req_sit=u'R', data_type=(u'R',u'1',u'18'), position=5, codes=[] ) ), Element( u'STC06', Properties(desc=u'Date', req_sit=u'S', data_type=(u'DT',u'8',u'8'), position=6, codes=[] ) ), Element( u'STC07', Pro...
1)*ido; ch[ah] = ref(cc,ac - ido - 1) + tr2 + tr3; ch[ah + 1] = ref(cc,ac - ido) + ti2 + ti3; cr2 = ref(cc,ac - ido - 1) + tr11*tr2 + tr12*tr3; ci2 = ref(cc,ac - ido) + tr11*ti2 + tr12*ti3; cr3 = ref(cc,ac - ido - 1) + tr12*tr2 + tr11*tr3; ci3 = ref(cc,ac - ido) + tr12*ti2 + tr11*ti3; cr5 = isign*(ti11*tr5 + ti1...
{} body_params = None if 'body' in local_var_params: body_params = local_var_params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_conte...
to form initial markov state. Stack along last dimension init_markov_state = torch.cat(self.markov_length * [initial_env_state], dim=-1) return init_markov_state def env2markov(self, old_markov_state: torch.tensor, new_env_state: np.ndarray): # Function to update Markov states by dropping the oldest environmenta...
value. value: The value to locate in the System.Collections.SortedList object. The value can be null. Returns: true if the System.Collections.SortedList object contains an element with the specified value; otherwise,false. """ pass def CopyTo(self,array,arrayIndex): """ CopyTo(self: SortedList,array...
x+2, y, s->dots); # } else { # PUT0("\n"); # } # } # # #************************************************************************* # * draw_tabrest - draws rest at position x # ************************************************************************* # void draw_tabrest (float x, struct SYMBOL *s) # { # int flags; # flo...
<reponame>louisVottero/vtool<filename>python/vtool/maya_lib/corrective.py # Copyright (C) 2022 <NAME> <EMAIL> All rights reserved. from __future__ import absolute_import import string from .. import util if util.is_in_maya(): import maya.cmds as cmds from . import anim from . import core from . im...
from __future__ import annotations __all__ = ( "ResourceEvent", "ResourceConflict", "ResourceNotFound", "NoCurrentContext", "TeardownError", "Context", "executor", "context_teardown", "current_context", "get_resource", "get_resources", "require_resource", "_Dependency", "inject", "resource", ) import l...
path(self, *paths): """Convert build path to msvc path and prepend root""" return self.rootpath + msvc_path_join(*list(map(msvc_path, paths))) def apath(self, path, *paths): """Convert build path to msvc path and prepend root if not absolute""" ### On Unix, os.path.isabs won't do the right thing if "item" ### co...
<reponame>paulguerrero/points2surf<gh_stars>100-1000 import os import os.path import sys import torch import torch.utils.data as data import numpy as np import scipy.spatial as spatial import trimesh from source.base import mesh_io from source.base import utils from source.base import file_utils from source import sdf...
from tkinter import * from tkinter import Tk, ttk, messagebox, simpledialog from classes import readFile from random import randint objList = [] tournamentList = [] gender = "" read = readFile.ReadFile() json = read.readPrize() ranking = read.readRankingPoints() tournamentList = read.readTournement() class App: def ...
kwargs}} def model_HistGradientBoostingRegressor(self, **kwargs): ### https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.HistGradientBoostingRegressor.html # TODO not hpo not converging self.path = "sklearn.ensemble.HistGradientBoostingRegressor" self.param_space = [ Real(low=0.0001, high=0.9, pr...
'QL User\'s Timer count-from date time must remain unchanged') def test_set_description_valid_q(self): new_desc_q1 = 'New Timer Description Q1' desc_changed = self.write_timer_helper_q.set_description( self.timer_q1_p_id, new_desc_q1) ref_timestamp = timezone.now().timestamp() timer_rel = PADSTimer.objects.get(...
ccs_seq[i] for i in reads if i is not None] jobs.append(pool.apply_async(scan_ccs_chunk, (chunk, is_canonical))) pool.close() prog = ProgressBar() finished_cnt = 0 reads_count = defaultdict(int) short_reads = [] with open('{}/{}.cand_circ.fa'.format(out_dir, prefix), 'w') as out: for job in jobs: ...
matplotlib axes containing a plot of the surface. Parameters ========== ax : Axes An existing matplotlib axes to plot to. plot_kwargs : dict Arguments to be passed to Axes.plot(). """ if ax is None: fig, ax = plt.subplots(1, 1) ax.set_ylabel('Vertical Position [m]') ax.set_xlabel('Horizontal Position [m]'...
<reponame>psuchand/capstone-taxi ############################################## #Helper functions #Plot profit for given cabbies ############################################## import pandas as pd import numpy as np def plot_profit_for_drivers(drivers): """ If cabbies is a list, we plot the profit (calculated via ...