input
stringlengths
2.65k
237k
output
stringclasses
1 value
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is govered by a BSD-style # license that can be found in the LICENSE file or at # https://developers.google.com/open-source/licenses/bsd """ Set of functions for detaling with spam reports. """ import collections import httplib2 imp...
pulumi.set(self, "image_id", value) @property @pulumi.getter(name="instanceInitiatedShutdownBehavior") def instance_initiated_shutdown_behavior(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "instance_initiated_shutdown_behavior") @instance_initiated_shutdown_behavior.setter def instance_initiate...
# -*- coding: utf-8 -*- """ Copyright (c) 2018-2021 <NAME>, Typee project, http://www.typee.ovh 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 t...
self._AR_X_final_power.setText("<b style='color: red'>INT!<b>") self._AR_XY_final_power.setText("<b style='color: red'>INT!<b>") else: self._AR_X_intervals.setStyleSheet("background-color: none; color: #000;") if y_isPow and not (y_incr.is_integer()): # y_power error _got_error = True self._AR_Y_intervals.setSt...
<gh_stars>1-10 import functools import importlib import os from pathlib import Path from subprocess import check_call, run, PIPE, CompletedProcess import sys from typing import Optional, Sequence, Iterable, List import traceback from . import LazyLogger log = LazyLogger('HPI cli') @functools.lru_cache() def mypy_cm...
<reponame>m1griffin/arrayfunc<filename>codegen/amaxamin_testgen.py #!/usr/bin/env python3 ############################################################################## # Project: arrayfunc # Purpose: Generate the unit tests for amax and amin. # Language: Python 3.6 # Date: 13-May-2014 # ###############################...
'$expr$[[1]]'. >> First[{a, b, c}] = a >> First[a + b + c] = a >> First[x] : Nonatomic expression expected. = First[x] >> First[{}] : {} has zero length and no first element. = First[{}] """ summary_text = "first element of a list or expression" messages = { "normal": "Nonatomic expression expected.", ...
#!/usr/bin/env python # coding: utf-8 import os import sys import numpy as np import argparse import time from tensorboardX import SummaryWriter import torch import torch.nn as nn from torchvision import datasets import torchvision.transforms as transforms from torch.autograd import Variable from lfads import LFADS...
instead or None if the original URL should be used. """ for url_pattern, endpoint in _oembed_patterns.items(): if url_pattern.fullmatch(url): return endpoint # No match. return None async def _get_oembed_content(self, endpoint: str, url: str) -> OEmbedResult: """ Request content from an oEmbed endpoint. Ar...
<filename>xclim/run_length.py # -*- coding: utf-8 -*- """Run length algorithms module""" import logging from warnings import warn import numpy as np import xarray as xr logging.captureWarnings(True) npts_opt = 9000 def get_npts(da): """Return the number of gridpoints in a data-array. Parameters ---------- da :...
<filename>deepchem/models/fcnet.py """TensorFlow implementation of fully connected networks. """ import logging import warnings import time import numpy as np import tensorflow as tf import threading try: from collections.abc import Sequence as SequenceCollection except: from collections import Sequence as SequenceCo...
if msg.toType == 2: X = cl.getGroup(msg.to) X.name = msg.text.replace("Gn ","") cl.updateGroup(X) else: cl.sendText(msg.to,"It can't be used besides the group.") elif ("Alien gn " in msg.text): if msg.from_ in admin: if msg.toType == 2: X = cl.getGroup(msg.to) X.name = msg.text.replace("Lien gn ","") ki.upda...
<gh_stars>0 #!/bin/bash "exec" "python" "-u" "$0" "$@" """ Build job Usage: source $SITEROOT/setup.sh source $T_DISTREL/AtlasRelease/*/cmt/setup.sh -tag_add=??? buildJob.py -i [sources] -o [libraries] [sources] : an archive which contains source files. each file path must be relative to $CMTHOME [libraries] : a...
psnrs_train.append(float(x[11])) losses_val.append(float(x[15])) psnrs_val.append(float(x[17])) avr_dt = float(lines[-1].split()[5]) bds_dict = { 'near': tf.cast(near, tf.float32), 'far': tf.cast(far, tf.float32), } render_kwargs_train.update(bds_dict) render_kwargs_test.update(bds_dict) # Short circuit if...
= doc(tag) for attr, val in attrs.items(): assert el.attr(attr) == val assert el.text() == text for needle in needles: self.assertContains(response, needle) for tag, needle in url_needles.iteritems(): url = doc(tag).text() self.assertUrlEqual(url, needle) def test_slug(self): Addon.objects.get(pk=5299).up...
"namespace": None, "parent": None, "date_created": ANY, "date_modified": ANY, "user": { "name": "pingou", "fullname": "<NAME>", "url_path": "user/pingou", "full_url": "http://localhost.localdomain/user/pingou", }, "access_users": { "owner": ["pingou"], "admin": [], "commit": [], "collaborator": [], "tick...
'well_id': 186, }, u'H19': { 'col_and_row': u'H19', 'row': 8, 'col': 19, 'well_id': 187, }, u'M24': { 'col_and_row': u'M24', 'row': 13, 'col': 24, 'well_id': 312, }, u'H11': { 'col_and_row': u'H11', 'row': 8, 'col': 11, 'well_id': 179, }, u'H12': { 'col_and_row': u'H12', 'row': 8, 'col': 12, 'we...
import dataclasses import itertools import operator import xml.etree.ElementTree as ET from abc import ABC, abstractmethod import collections from copy import deepcopy from functools import reduce from typing import Optional, Callable, List, Union, Iterable import more_itertools.more import numpy as np from more_iter...
. . # Class Methods # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @classmethod def finalize_quark(klass): """ Finalize quark's class attibutes. Finalization can only proceed when all quark classes have been defined due to interdependencies. """ klass.AntiParticle = klass.q...
# Class: XYZFile # used for getUncertaintyDEM # by <NAME>, Jul 28 2016 # # Class: AmpcoroffFile # manipulating the ampcor outpuf (and translating it into a geotiff) # by <NAME>, Jul 10 2018 import numpy as np from carst.libraster import SingleRaster from scipy.interpolate import griddata from scipy.stats import gaussi...
<reponame>rambasnet/MAKE2 #Boa:MiniFrame:MDIChildTextMining #----------------------------------------------------------------------------- # Name: MDIChildEmails.py # Purpose: # # Author: <NAME> # # Created: 2007/11/01 # Last Modified: 7/2/2009 # RCS-ID: $Id: MDIChildEmails.py,v 1.5 2008/03/17 04:18:38 rbas...
event_object.regvalue else: # TODO: Add a function for this to avoid repeating code. keys = event_object.GetAttributes().difference( event_object.COMPARE_EXCLUDE) keys.discard(u'offset') keys.discard(u'timestamp_desc') attributes = {} for key in keys: attributes[key] = getattr(event_object, key) for attribut...
b0, b1 = self._sweepBorder(index_sweep) self._cache['snippet_'+sniptype][b0:b1,:] = snippet self._cache['snippet_index_'+sniptype][b0:b1] = np.ones(b1-b0, dtype = 'bool') def _extract_all_snippet(self, sniptype): pbar = pgb.ProgressBar(maxval=self.numSweeps(), term_width = 79).start() for index_sweep in rang...
SQLParser#keyOrIndex. def exitKeyOrIndex(self, ctx:SQLParser.KeyOrIndexContext): pass # Enter a parse tree produced by SQLParser#constraintKeyType. def enterConstraintKeyType(self, ctx:SQLParser.ConstraintKeyTypeContext): pass # Exit a parse tree produced by SQLParser#constraintKeyType. def exitConstraintKeyT...
def eval(self, env): return self.left.eval(env) % self.right.eval(env) class ComparisonExpression: def __init__(self, left, right, cond): self.left = left self.right = right self.cond = cond def eval(self, env): left = self.left.eval(env) right = self.right.eval(env) return eval_cond(left, self.cond, right) ...
key='AchievementItems.dat', ), Field( name='Flag0', type='bool', ), Field( name='Unknown0', type='ref|list|int', ), ), ), 'DelveCatchupDepths.dat': File( fields=( Field( name='Unknown0', type='int', ), Field( name='Unknown1', type='int', ), ), ), 'DelveCraftingModifierDescriptions.dat': File( f...
np.log(series / (1 - series)) else: return np.exp(series) / (1 + np.exp(series)) if self.link == "Identity": return series def extract_params(self): """ Returns the summary statistics from the statsmodel GLM. """ summary = pd.read_html( self.results.summary().__dict__["tables"][1].as_html(), header=0 )[0].il...
State.SCHEDULED ti1_3.state = State.SCHEDULED session.merge(ti1_1) session.merge(ti1_2) session.merge(ti1_3) session.commit() res = scheduler._find_executable_task_instances( dagbag, session=session) self.assertEqual(1, len(res)) def test_change_state_for_executable_task_instances_no_tis(self): scheduler ...
from azure.common.credentials import ServicePrincipalCredentials from azure.mgmt.compute import ComputeManagementClient from azure.mgmt.compute.models import StorageAccountTypes from azure.mgmt.compute.models import SnapshotStorageAccountTypes from azure.storage.blob import BlockBlobService from msrestazure.azure_excep...
<filename>geological_toolbox/requests.py """ This module hosts the class Requests, which provides functionality for special (geo-)database requests. """ import sqlalchemy as sq from sqlalchemy.orm.session import Session from typing import List, Tuple from geological_toolbox.exceptions import DatabaseException, Databa...
tf.squeeze( tf_layers_dict[get_tf_edges_from(tf_edges, layer_id, 0)], axis=axis ) tf_layers_dict[layer_id] = extrapolation_of_layers( wr_config[layer_id], inp ) else: tf_layers_dict[layer_id] = tf.squeeze( tf_layers_dict[get_tf_edges_from(tf_edges, layer_id, 0)], axis=axis ) except: if wr_config and laye...
<filename>txmsgpackrpc/protocol.py # http://github.com/donalm/txMsgpack # Copyright (c) 2013 <NAME> # https://github.com/jakm/txmsgpackrpc # Copyright (c) 2015 <NAME> from __future__ import print_function import logging import msgpack import sys from collections import defaultdict, deque, namedtuple from twisted.int...
u=300) _default_initializer = {'states': {'i_sq': 0.0, 'i_sd': 0.0, 'epsilon': 0.0}, 'interval': None, 'random_init': None, 'random_params': (None, None)} IO_VOLTAGES = ['u_a', 'u_b', 'u_c', 'u_sd', 'u_sq'] IO_CURRENTS = ['i_a', 'i_b', 'i_c', 'i_sd', 'i_sq'] def _update_model(self): # Docstring of s...
isinstance(read_only_, bool): raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) self.bus_address = bus_address_ self.device_link = device_link_ self.device_name = device_name_ self.plan_info = plan_info_ self.read_only = read_only_ self.unknown_fields = unknown_fields ...
<filename>src/sims4communitylib/enums/tags_enum.py<gh_stars>0 """ The Sims 4 Community Library is licensed under the Creative Commons Attribution 4.0 International public license (CC BY 4.0). https://creativecommons.org/licenses/by/4.0/ https://creativecommons.org/licenses/by/4.0/legalcode Copyright (c) COLONOLNUTTY "...
import math import gym import cv2 import matplotlib.pyplot as plt import time import json import random import numpy as np import networkx as nx import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import matplotlib matplotlib.use('Agg') from collections import deque DEVICE...
(L*~R*L) * S if not rel.is_one(): verbose("Failed relation A1") return False rel = ~S*R*S*R**(-25) if not rel.is_one(): verbose("Failed relation A2") return False rel = (S*R**5*L*~R*L)**3 * ~(L * ~R * L)**2 if not rel.is_one(): verbose("Failed relation A3") return False return True else: # e>1, m>1 o...
dimension nsg_e, regarding idxsg_e, lsg_e.') if is_empty(constraints.usg_e): constraints.usg_e = np.zeros((nsg_e,)) elif constraints.usg_e.shape[0] != nsg_e: raise Exception('inconsistent dimension nsg_e, regarding idxsg_e, usg_e.') dims.nsg_e = nsg_e nsphi_e = constraints.idxsphi_e.shape[0] if is_empty(constra...
from src.utils.db_utils import execute_sql,insert_query, save_rds_pandas from src.models.save_model import save_upload, parse_filename from datetime import date, datetime from pyspark.sql import SparkSession from pyspark.sql.types import IntegerType, DoubleType from pyspark.sql.functions import monotonically_increasi...
self.percent_usage + 56 data[metric_param]['previous'] = self.percent_usage + 57 self.test_system_alerter._create_state_for_system(self.system_id) self.test_system_alerter._process_results(data, meta_data, data_for_alerting) try: eval(mock_param).assert_called_with( self.system_name, data[metric_param]['current'...
import imgaug.augmenters as iaa >>> crop = iaa.CenterCropToFixedSize(height=20, width=10) Create an augmenter that takes ``20x10`` sized crops from the center of images. """ # Added in 0.4.0. def __init__(self, width, height, seed=None, name=None, random_state="deprecated", deterministic="deprecated"): supe...
@_int_property_decorator def games_pinch_hitter(self): """ Returns an ``int`` of the number of games the player was in the lineup as a pinch hitter. """ return self._games_pinch_hitter @_int_property_decorator def games_pinch_runner(self): """ Returns an ``int`` of the number of games the player was in the l...
not None and type(node.content) is not str: msg = f'Node "{node.name}" content should be type "{TYPE_STR}", not "{type(node.content)}"' if errs is None: raise MetapypeRuleError(msg) else: errs.append( ( ValidationError.CONTENT_EXPECTED_STRING, msg, node, type(node.content), ) ) if node.content is not None:...
<gh_stars>10-100 import atexit import csv import ctypes.util import importlib import os import platform import re import resource import sys import urllib.parse import warnings from collections.abc import Iterable from hashlib import md5 as hashlib_md5 from marshal import dumps as marshal_dumps from math import ceil as...
import requests import csv import logging from requests.auth import HTTPBasicAuth import time from primeapidata import PI_ADDRESS, USERNAME, PASSWORD requests.packages.urllib3.disable_warnings() ''' Call one of those from the main function or put one out of comments here, be carefull of the different filenames. It sh...
import os import ray import time import torch import queue import threading from shutil import copy2 from copy import deepcopy import pytorchrl as prl from pytorchrl.scheme.base.worker import Worker as W from pytorchrl.scheme.utils import ray_get_and_free, broadcast_message, pack, unpack # Puts a limit to the allowed...
plot.xlog = True plot.smoothplot(plot_used_original_data=1) def skip_fields_and_check_accuracy(self): sharpestpoint = self.find_sharpest_raw_point() x = sharpestpoint.x y = sharpestpoint.y fields = self.fields fieldnumbers = list(range(len(fields))) skips = [1, 7] sharps = [] sharps = [] numpoints = [] cou...
<reponame>sandialabs/MPNN #!/usr/bin/env python import sys import copy import torch import functools import numpy as np import matplotlib.pyplot as plt from scipy.spatial.distance import cdist from .utils_gen import rel_l2, linear_transform from .utils_nn import MLPBase ## GLOBAL variables. Not elegant but will do. ...
# -*- 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...
<gh_stars>0 # Copyright (c) 2019 Riverbed Technology, Inc. # # This software is licensed under the terms and conditions of the MIT License # accompanying the software ("License"). This software is distributed "AS IS" # as set forth in the License. import time import select import logging import paramiko from steelsc...
<gh_stars>0 #!/usr/bin/python2.5 # Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
<gh_stars>0 # -*- coding: utf-8 -*- """abaixe.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1RsUIORt1qNzuUX7OAfeYScGkNCI7Q7zt Abaixe - 'put down' v.01: (Sin Thank) _x_ right now all the reads are first processed by _x_ check input a...
import copy import numpy as np from .util import is_ccw from .. import util from .. import grouping from .. import constants try: import networkx as nx except BaseException as E: # create a dummy module which will raise the ImportError # or other exception only when someone tries to use networkx from ..exception...
\n(Horizontal × Vertical)") self.l4a.grid(column=0, row=0, columnspan=3, ipadx=30, pady=5) self.sizevar = StringVar() self.r4a = Radiobutton(self.f4, text='1x1', var=self.sizevar, value='1x1', command=self.setsize) self.r4a.grid(column=0, row=1, padx=2, pady=1) self.r4a.select() self.r4b = Radiobutton(self....
<filename>spex60/core.py # Licensed under a 3-clause BSD style license - see LICENSE.rst import os import re import numpy as np import astropy.units as u from astropy.io import ascii, fits from .config import config __all__ = ['SpeX', 'Prism60'] class Calibration: def __init__(self): calpath = os.path.join( c...
<gh_stars>0 from . import Math import bpy class BezierPoint: @staticmethod def FromBlenderBezierPoint(blenderBezierPoint): return BezierPoint(blenderBezierPoint.handle_left, blenderBezierPoint.co, blenderBezierPoint.handle_right) def __init__(self, handle_left, co, handle_right): self.handle_left = handle_l...
<filename>lexpredict_openedgar/openedgar/tasks.py<gh_stars>0 """ MIT License Copyright (c) 2018 ContraxSuite, LLC 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 wi...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test replace by fee code # from test_framework.test_framework import MincoinTestFramework from test_...
# Circular planar piston # Evaluate the acoustic field generated by a circular planar piston # Collocation ("discrete dipole") approximation of the volume integral # equation for 3D acoustic scattering import os import sys from IPython import embed # FIXME: figure out how to avoid this sys.path stuff sys.path.append(...
<gh_stars>0 #!/usr/bin/env python3 # # 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....
<reponame>Petersontylerd/quickplot<gh_stars>1-10 import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib.patches import Patch import prettierplot.style as style import prettierplot.util as util import textwrap def facet_cat(self, df, feature, label_rotate=0, x_units="s", y_units="f"...
if mask[i, img_l:img_r].sum() > 0: out_t = i break for j in range(img_b, img_t, -1): if mask[j - 1, img_l:img_r].sum() > 0: out_b = j break # Find leftmost and rightmost nonzero column. for k in range(img_l, img_r): if mask[img_t:img_b, k].sum() > 0: out_l = k break for l in range(img_r, img_l, -1): if mas...
correction of the block's short timestamps. :cvar elementName: The name of the element handled by this parser :cvar product: The class of object generated by the parser """ product = SimpleChannelDataBlock elementName = product.__name__ isHeader = False # The default block time scalar. timeScalar = 1000000.0...
"Time", "instances": 22, "metric_value": 0.0909, "depth": 7} if obj[1]>0: return 'False' elif obj[1]<=0: # {"feature": "Education", "instances": 4, "metric_value": 0.3333, "depth": 8} if obj[3]>0: # {"feature": "Restaurant20to50", "instances": 3, "metric_value": 0.0, "dept...
<filename>riboflask.py import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap from matplotlib.transforms import blended_transform_factory import mpld3 import logging from mpld3 import plugins,utils import collections from sqlitedict import SqliteDic...
<gh_stars>1-10 from bilanci.tree_dict_models import deep_sum from bilanci.utils import couch, nearly_equal from bilanci.utils.comuni import FLMapper from django.test import TestCase from django.core.management import BaseCommand from django.conf import settings from collections import OrderedDict from optparse import...
<filename>opfython/models/unsupervised.py<gh_stars>10-100 """Unsupervised Optimum-Path Forest. """ import time import numpy as np import opfython.utils.constants as c import opfython.utils.exception as e import opfython.utils.logging as log from opfython.core import OPF, Heap from opfython.subgraphs import KNNSubgra...
import os import sys import numpy as np import torch as th from torch import nn from collections import defaultdict from latent_dialog.enc2dec.base_modules import summary from latent_dialog.enc2dec.decoders import TEACH_FORCE, GEN, DecoderRNN from datetime import datetime from latent_dialog.utils import get_detokenize ...
<reponame>8by8-org/usvotes<filename>app/main/starter_views.py from __future__ import print_function from app.main import main from flask import g, url_for, render_template, request, redirect, session as http_session, abort, current_app, flash, jsonify, make_response from app.main.forms import * from app.services import...
'success') return redirect(url_for('admin_dashboard')) # admin create user account validator form class AdduserForm(Form): first_name = StringField('First Name', [validators.InputRequired()]) last_name = StringField('Last Name', [validators.InputRequired()]) username = StringField('<NAME>', [validators.InputRequ...
""" Implementation of ODE Risk minimization <NAME>, ETH Zurich based on code from <NAME>, Machine Learning Research Group, University of Oxford February 2019 """ # Libraries from odin.utils.trainable_models import TrainableModel from odin.utils.gaussian_processes import GaussianProcess from odin.utils.tensorflow_o...
description = "a module that simulates Parameter Estimation uploads to GraceDB" author = "<EMAIL>" #------------------------------------------------- import os import random import schedule #------------------------------------------------- ''' generate a different object for each follow-up. These may inherit from...
'S', # \N{LISU LETTER SA} 0x16f3a: 'S', # \N{MIAO LETTER SA} 0x10296: 'S', # \N{LYCIAN LETTER S} 0x10420: 'S', # \N{DESERET CAPITAL LETTER ZHEE} 0x1f75c: 'sss', # \N{ALCHEMICAL SYMBOL FOR STRATUM SUPER STRATUM} 0xfb06: 'st', # \N{LATIN SMALL LIGATURE ST} 0x1d42d: 't', # \N{MATHEMATICAL BOLD SMALL T} 0x1d461: 't'...
<reponame>eiling/SchoolIdolAPI # -*- coding: utf-8 -*- from django.contrib.auth.models import User, Group from django.db import models from django.contrib import admin from dateutil.relativedelta import relativedelta from django.utils.translation import ugettext_lazy as _, string_concat from api.models_languages import...
""" sparse tables ============= Might look like this: level 1 level 2 level 3 columns columns columns idx a b c d e f idx g h i j k l idx m n o p ___ _ _ _ _ _ _ ___ _ _ _ _ _ _ |_0_|_|_|_|_|_|_||_0_|_|_|_|_|_|_| |_1_|_|_|_|_|_|_| |_2_|_|_|_|_|_|_| ___ _ _ _ _ _ _ |_3_|_|_|_|_|_|_||_3_|_|_|_|_|_|_| |_4_|_|_...
0 0 0] [8 2 0 0 0 0 0] [8 4 4 4 4 4 4]] Output: [[8 0 0 0 0 0 2] [8 0 0 0 0 2 0] [8 0 0 0 2 0 0] [8 0 0 2 0 0 0] [8 0 2 0 0 0 0] [8 2 0 0 0 0 0] [8 4 4 4 4 4 4]] Colour Encoding: Black = 0, Dark Blue = 1, Red =2 , Green = 3 , Yellow = 4 , Grey = 5 , Pink = 6 , Orange = 7 , Sky Blue = 8 , Brown = 9 Algo...
med_l: tr = HTMLgen.TR() tr.append(empty_data(2)) # cover for no enstore element self.add_to_row(tr, item.keys()[0], item, outage_d, offline_d) tr.append(empty_data(4)) # cover for no network & alarm elements entable.append(tr) # add any other information we need if other_d: cols = 8 num = 0 entable.app...
<reponame>onlyrico/AliceMind<gh_stars>1-10 # coding=utf-8 # Copyright 2021 The Alibaba DAMO NLP Team Authors. # Copyright 2018 The Google AI Language Team Authors. # Copyright (c) 2018, <NAME>. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in...
<filename>agml/_internal/preprocess.py # Copyright 2021 UC Davis Plant AI and Biophysics Lab # # 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 # #...
0.3474924642544, 0.9999999999729492, 2.7050825080149146e-11), (100, 0.434365580318, 1.0, 1.1316805400125278e-17), (110, 0.016566053235566584, 5.418491679241947e-15, 0.9999999999999946), (110, 0.02070756654445823, 9.015166010325563e-10, 0.9999999990984834), (110, 0.027610088725944303, 1.2616166581384716e-05, 0.99998...
<filename>rpc/train_eval.py<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
files extracted and stored by this packager In this case ["filesandjats_jats.xml", "filesandjats_epmc.xml"] :return: list of metadata files """ return ["filesandjats_jats.xml", "filesandjats_epmc.xml"] def url_name(self): """ Get the name of the package as it should appear in any content urls In this case F...
<reponame>naacl943/simpletransformers #!/usr/bin/env python # coding: utf-8 from __future__ import absolute_import, division, print_function import gc import io import json import logging import math import os import pickle as pkl import random import warnings from dataclasses import asdict from multiprocessing impor...
(кубометр)':0.12, 'Раствор кладочный М200 (кубометр)':0.08, 'Раствор асбестоцементный (кубометр)':0.044, 'Вода для строительства (кубометр)':62.8, 'Использование электростанции передвижной 4 кВт (часов)':2.9, 'Использование установки для гидравлических испытаний трубопрводов (часов)':25, 'Использование трубоуклад...
# ## Copyright (c) 2018-2020, <NAME> ## All rights reserved. ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are met: ## ## 1. Redistributions of source code must retain the above copyright ## notice, this list of conditio...
# Training script with LazyLoader # # Instead of dumping all input into memory, we lazy load on the fly. # This can create an IO bound where slow training down but helping to training large dataset such as MetaVideoLazy import os from tqdm.auto import tqdm from opt import config_parser import logging import ruamel....
<filename>src/v5.1/resources/swagger_client/models/ed_fi_staff_address.py # coding: utf-8 """ Ed-Fi Operational Data Store API The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sani...
<gh_stars>1-10 #!/usr/bin/env python from CMS import CMS import sys import os # Initiate the CMS Class manager = CMS(hostname="localhost", username="test", password="<PASSWORD>", db="CMS") # Misc strings tchar = ": " working = tchar + "Working..." # Checks if user input is an in-program command def verify_input(cmd)...
<filename>telemetry/telemetry/internal/backends/chrome/desktop_browser_backend.py # Copyright 2013 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. from __future__ import print_function import datetime import hashlib import...
<gh_stars>10-100 import os import time from datetime import datetime from pandac.PandaModules import * from direct.distributed.MsgTypes import * from direct.gui.DirectGui import * from direct.fsm import StateData from direct.fsm import ClassicFSM from direct.fsm import State from direct.directnotify import DirectNotify...
# 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. import json import logging import os import shutil import sys import time import traceback from dataclasses import replace from pathlib impor...
from __future__ import print_function # # General # EXIT_SUCCESS = 0 EXIT_FAILURE = 1 def quit(): exit(EXIT_SUCCESS) def exit(status=EXIT_SUCCESS): from slicer import app app.commandOptions().runPythonAndExit = False app.exit(status) def restart(): from slicer import app app.restart() def _readCMakeCache(v...
<gh_stars>0 # Compare ray by ray tracing to Zemax import os import pytest import galsim import numpy as np from scipy.optimize import least_squares import batoid from test_helpers import timer, init_gpu directory = os.path.dirname(__file__) @timer def test_HSC_trace(): telescope = batoid.Optic.fromYaml("HSC_old.y...
msh.Mesh(os.path.join(directories["muscles"], f[:-5] + ".scaled.o.mesh")) half1, half2 = cutMeshInHalf(mesh) half1.write(os.path.join(directories["muscles"], f[:-5]+".R.mesh")) half2.write(os.path.join(directories["muscles"], f[:-5]+".L.mesh")) os.remove(os.path.join(directories["muscles"], f[:-5] + ".scaled.mesh")...
""" Module containing `~halotools.mock_observables.RectangularDoubleMesh`, the primary data structure used to optimize pairwise calculations throughout the `~halotools.mock_observables` sub-package. """ import numpy as np from math import floor __all__ = ('RectangularDoubleMesh', ) __author__ = ('<NAME>', ) default_m...
The default is ``en-US`` return_value_only (bool): ``True`` will return only the value for the policy, without the name of the policy. ``return_full_policy_names`` and ``hierarchical_return`` will be ignored. Default is ``True`` return_full_policy_names (bool): Returns the full policy name regardless of what w...
0))) + self.W_x_b(sent_output_backward[0]) new_output_backward = torch.tanh(new_output_backward) final_output = torch.cat([new_output_forward, new_output_backward], dim = 1) return final_output def sememe_sum(self, input_s): emb_sememe = self.emb_sememe.weight input_sememe = [] for i in range(input_s.size()[0]...
""" Copyright (c) 2021, salesforce.com, inc. All rights reserved. SPDX-License-Identifier: BSD-3-Clause For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause """ import argparse import glob import logging import os import random import sys import timeit from ...
into its current state""" self.forward = None """Scenelet forward direction in world space at mid_frame +-2""" @classmethod def from_mat(cls, angular_edges, radial_edges, bins, categories): h = RadialHistogram(shape=(len(angular_edges)-1, len(radial_edges)-1), r_max=radial_edges[-1], angular_offset=angular_edge...
<gh_stars>1-10 # ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...