input
stringlengths
2.65k
237k
output
stringclasses
1 value
import json from os import path from os import mkdir import matplotlib.pyplot as plt import matplotlib.colors as mcolors import numpy as np from astropy.time import Time import glob import matplotlib.cm as cm def convert_dict_to_nested_type(report): if type(report) is dict: for k, v in report.items(): print(k) co...
<gh_stars>0 # Licensed under a 3-clause BSD style license - see LICENSE.rst import logging import numpy as np from astropy import units as u from astropy.io.registry import IORegistryError from astropy.table import Table, vstack from gammapy.modeling import Dataset, Datasets, Fit, Parameters from gammapy.modeling.model...
<filename>htm_rl/htm_rl/modules/htm/temporal_memory.py<gh_stars>1-10 from functools import reduce from htm_rl.modules.htm.connections import Connections from htm.bindings.sdr import SDR from htm.advanced.support.numpy_helpers import setCompare, argmaxMulti, getAllCellsInColumns import numpy as np from htm.bindings.math...
<reponame>AntonBiryukovUofC/unearthed-zinc import numpy as np from sklearn.model_selection import TimeSeriesSplit from sklearn.neighbors import KNeighborsRegressor from sklearn.preprocessing import QuantileTransformer from sklearn.decomposition import PCA from sklearn.pipeline import make_pipeline from sklearn.utils im...
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
map.get('body') is not None: self.body = map.get('body') if map.get('id') is not None: self.id = map.get('id') if map.get('status') is not None: self.status = map.get('status') return self class CancelLinkRequest(TeaModel): """ * """ def __init__(self, headers=None, temporary_token=None): self.headers = he...
#!/usr/bin/env python3 ####################### # # FireEye API # # Copyright (c) 2015 United States Government/National Institutes of Health # Author: <NAME> # Modifications from original made by: <NAME>, <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and ass...
<filename>peripheral/tcc_u2213/config/tcc.py<gh_stars>0 # coding: utf-8 """***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivati...
<filename>list6/task1.py """ Filtry dolno i górnoprzepustowe """ from sys import argv class EliasGamma: def encode(self, number): code = bin(number)[2:] code = "0" * (len(code) - 1) + code return code def decode(self, code): codes = [] counter = 0 idx = 0 while idx < len(code): if code[idx] == "0": count...
import discord import sys import random import hashlib import time import requests import asyncio import math import re from typing import NamedTuple from discord.ext import commands TOKEN, KEY, SECRET, GROUP_LINK = None, None, None, None def setup(bot): print('Admin_extension se loada.') with open...
and subpixel, are skipped. If dither_direct is true, then primary # and subpixel dithers are both done. It is guaranteed (by APT) in this case that # then number of exposures is a multiple of 3. try: dither_direct = observation_dict['DitherNirissWfssDirectImages'] if dither_direct == 'NO_DITHERING': if verbose: ...
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
# Copyright (c) 2018 <NAME>, Inc. # # This file is part of Mycroft Skills Manager # (see https://github.com/MycroftAI/mycroft-skills-manager). # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional informat...
import os import subprocess import sys # import random import time from sysconf import cfg from util import util import numpy as np import xml.etree.ElementTree as ElementTree from space_expl_framework.abs_classes import AbstractProfiler class HadoopProfiler(AbstractProfiler): def __init__(self): self.itertime = 1 ...
<filename>test_haproxy.py #!/usr/bin/env python import collections from mock import MagicMock from mock import Mock from mock import patch from mock import call import sys class MockCollectd(MagicMock): """ Mocks the functions and objects provided by the collectd module """ @staticmethod def log(log_str): prin...
# Copyright 2020 The KNIX Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
self.tseries), numpy.ma.masked_where(Dseries<=0, topstack+Dseries), topstack, color=color_D_E, alpha=0.5, label='$D_{all}$', zorder=2) ax.plot( numpy.ma.masked_where(Dseries<=0, self.tseries), numpy.ma.masked_where(Dseries<=0, topstack+Dseries), color=color_D_E, zorder=3) topstack = topstack+Dseries else: if(any(D_...
self._handle_id = self._common_name + "_" + str(id(self.primary)) else: self._handle_id = self._common_name def __getattr__(self, name): if _enclosing_tpu_context() is None: return super(TPUVariableMixin, self).__getattr__(name) else: raise AttributeError( "'{}' not accessible within a TPU context.".format(nam...
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # ---------------------------------------------------------------------------- import os.path, re, sys, glob import ctypes import ctypes.util def _environ_path(name): if name...
#!/usr/bin/env python # coding=utf-8 """ Trees for generating. """ from __future__ import unicode_literals from collections import namedtuple, deque from pytreex.core.node import T __author__ = "<NAME>" __date__ = "2014" class NodeData(namedtuple('NodeData', ['t_lemma', 'formeme'])): """This stores the actual da...
newly sampled rows back onto the sample dataframe. : param sample_df: Dataframe containing rows which were sampled from original_df : param original_df: Dataframe from which the sample was drawn. : param n_close_points: Number of points required by user to be 'close' to each point in the sample. : return new_sampl...
a submodel is dynamic and hasn't overridden # `compute_output_shape`. outputs = None self._set_output_attrs(outputs) @trackable.no_automatic_dependency_tracking def _set_input_attrs(self, inputs): """Sets attributes related to the inputs of the Model.""" if self.inputs: raise ValueError('Model inputs are alre...
<gh_stars>10-100 # Copyright (c) 2020 LightOn, All Rights Reserved. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. """ This module contains the OPU class """ import time from math import sqrt import pkg_resources from lightonml.encoding.b...
"""JSON implementations of logging sessions.""" # pylint: disable=no-init # Numerous classes don't require __init__. # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=protected-access # Access to protected methods allowed in package json...
= "+", c = "gray") ax1.plot(x_ticks, knn_rr, "k-o", transform = trans0, label = "KNN") ax1.plot(x_ticks, nn_rr, "k:^", transform = trans1, label = "NN") ax1.legend(loc = rr_legend_loc, frameon = False, prop = {"size" : rr_legend_size}) ax1.set_xticks(x_ticks) ax1.set_xticklabels(sample_size_ls) ax1.set_ylabel("Nu...
<reponame>KnugiHK/synapse-admin-api-python<gh_stars>1-10 """MIT License Copyright (c) 2020 Knugi 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 ...
""" SAX style events again. """ # pylint: disable=too-many-lines import ast from collections import ChainMap from dataclasses import dataclass from functools import singledispatch from typing import ChainMap as CM from typing import Dict, Iterator, List, Optional, Set, Tuple, Union from pytest import mark from brea...
+ m.x603 + m.x607 + m.x611 + m.x615 + m.x619 + m.x623 + m.x627 + m.x631 + m.x635 + m.x639 + m.x643 + m.x647 + m.x651 + m.x655 + m.x659 + m.x663 + m.x667 + m.x671 + m.x675 + m.x679 + m.x683 + m.x687 + m.x691 + m.x695 + m.x699 + m.x703 + m.x707 + m.x711 + m.x715 + m.x719 + m.x723 + m.x727 + m.x731 + m.x735 + m.x739 =...
necessary, downloads the Stanford HARDI dataset into DIPY directory and creates a BIDS compliant file-system structure in AFQ data directory: ~/AFQ_data/ └── stanford_hardi ├── dataset_description.json └── derivatives ├── freesurfer │ ├── dataset_description.json │ └── sub-01 │ └── ses-01 │ └── anat │ ├── ...
<reponame>SHIVJITH/Odoo_Machine_Test<filename>addons/purchase_stock/models/purchase.py # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, SUPERUSER_ID, _ from odoo.tools.float_utils import float_compare, float_round from datetime impo...
('Start','End','Battery Level','Usage in Seconds','Day of the Week','GMT Offset','Entry Creation' ) report.write_artifact_data_table(data_headers, data_list, file_found) report.end_artifact_report() tsvname = 'KnowledgeC Battery Level' tsv(report_folder, data_headers, data_list, tsvname) tlactivity = 'Knowl...
<reponame>jefftc/changlab """ Glossary: data A unit of information. Typically a file made by a program. attribute Describes something about the data. e.g. logged="yes". input attribute An attribute of an input data. output attribute An attribute of an output data. user attribute An attribute provided by the user that ...
to `values`' first dimension. num_groups: A `Tensor`. name: (string, optional) A name for the operation. Returns: A `Tensor` of the same type as `values`. """ with tf.name_scope(name): return _unsorted_segment_reduction_or_zero( tf.math.unsorted_segment_min, values, indices, num_groups) def unsorted_segment_...
""" Optimal binning algorithm for continuous target. """ # <NAME> <<EMAIL>> # Copyright (C) 2019 import numbers import time from sklearn.utils import check_array import numpy as np from ..information import solver_statistics from ..logging import Logger from .auto_monotonic import auto_monotonic_continuous from .a...
from scapy.all import * from collections import Counter # Otvorenie .pcap súboru def otvor_pcap_subor(subor): pakety = rdpcap("vzorky_pcap_na_analyzu/" + subor) packet_list = PacketList([p for p in pakety]) return packet_list # Zistenie dĺžky rámca prenašaného po médiu def dlzka_ramca_po_mediu(dlzka_ramc...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
<filename>single_objective_trainer.py """Copyright © 2020-present, Swisscom (Schweiz) AG. All rights reserved. This class is used for training models and is the core of the framework. With the help of this class, the user of the framework is able to train and develop models. The framework gets all the relevant object...
typeLower, parameters=settingFunctionEventParameters)) self.SetFunctionCompletions(result.type, functions, False) except: return if functions: completions.extend(functions) properties = self.GetPropertyCompletions(result.type) if...
computeMVEE(Q[:, :-1], alg_type=0) # compute the MVEE of Q else: # otherwise # get the index of the maximal and minimal point on the line, i.e., both its ends idx_in_P = np.unique([np.argmin(Q[:, :-1]).astype(np.int), np.argmax(Q[:, :-1]).astype(np.int)]).tolist() return Q[idx_in_P], idx_in_P, Utils.UPPER_B...
#<NAME> #Settlers of Catan, 2020 import pygame from hexTile import * from hexLib import * pygame.init() #Class to handle catan board display class catanGameView(): 'Class definition for Catan board display' def __init__(self, catanBoardObject, catanGameObject): self.board = catanBoardObject self.game = catanGame...
test_teams_id_team_data_records_count_get(self): """ Test case for teams_id_team_data_records_count_get Count Dynamic Data records """ pass def test_teams_id_team_data_records_delete(self): """ Test case for teams_id_team_data_records_delete Delete all matching records. """ pass def test_teams_id_team_d...
<gh_stars>0 # -*- coding: utf-8 -*- """ Defines unit tests for :mod:`colour.plotting.geometry` module. """ from __future__ import division, unicode_literals import numpy as np import unittest from colour.plotting import quad, grid, cube __author__ = '<NAME>' __copyright__ = 'Copyright (C) 2013-2019 - Colour Develop...
An EVE character ID (required) :param str datasource: The server name you would like data from :param str token: Access token to use if unable to set a header :param str user_agent: Client identifier, takes precedence over headers :param str x_user_agent: Client identifier, takes precedence over User-Agent :return...
= Constraint(expr= - m.b28 + m.x1074 <= 0) m.c1035 = Constraint(expr= - m.b28 + m.x1075 <= 0) m.c1036 = Constraint(expr= - m.b28 + m.x1076 <= 0) m.c1037 = Constraint(expr= - m.b28 + m.x1077 <= 0) m.c1038 = Constraint(expr= - m.b28 + m.x1078 <= 0) m.c1039 = Constraint(expr= - m.b28 + m.x1079 <= 0) m.c1040 = Constr...
old_dict : dict remaining undefined mappings combined_dict : dict 1.8 nested config dictionary plus remaining undefined mappings Examples -------- >>> a, b, c = update_config_dict({'pipelineName': 'example-pipeline', '2': None}) >>> a {'pipeline_setup': {'pipeline_name': 'example-pipeline'}} >>> b {'2': Non...
# # Copyright (c) 2019 <NAME> <<EMAIL>> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL...
# -*- coding: utf-8 -*- from datetime import datetime CSV_BOM = [u"\uFEFF他们 (für)"] CSV_HEADER_COMMON = ["format_s","arkid","filename"] # The Main CSV File: columns with below headers are extracted,updated and written to ESRI ISO; # An extracted value from ESIR ISO is stored at a column with a header of "*_o". # with...
= len(verts) Deg_Step = 360.0 /float(6) for i in range((6/2)+1): x = sin(radians(i*Deg_Step))* Flat_Radius y = cos(radians(i*Deg_Step))* Flat_Radius verts.append([x,y,0-Outter_Radius_Height]) faces.extend(Allen_Fill(FaceStart_Outside,0)) FaceStart_Bottom = len(verts) Deg_Step = 360.0 /float(6) fo...
default=False) stack_field = models.ForeignKey(Stack, verbose_name='Pilha', blank=True, null=True) # warranty = models.DateTimeField('Garantia', blank=True, null=True) snmp = models.BooleanField(u'Habilitado para SNMP?', default=False, editable=False) snmpcom = models.CharField(u'SNMP Community - RO', max_length=25...
self.conf[DEFAULT_CONTEXT_KEY] = manifest_data.get(DEFAULT_CONTEXT_KEY) self.conf[IMPORTS_CONTEXT_KEY] = manifest_data.get(IMPORTS_CONTEXT_KEY) self.conf[CLASS_REGISTRY_CONTEXT_KEY] = manifest_data.get(CLASS_REGISTRY_CONTEXT_KEY) indexed_db_path = p(bundle_directory, BUNDLE_INDEXED_DB_NAME) store_name, store_conf =...
from models import * import sqlalchemy as sqla import enum DIMENSIONS = 8 class State(enum.Enum): Win = 0 Loss = 1 Draw = 2 Playing = 2 def exists(board: dict, piece: Piece): return board.get((piece.row, piece.column)) is not None # Determines if you can jump an already existing piece. If it can, it returns...
<gh_stars>1-10 #!/usr/bin/env python """Unit tests run as PYTHONPATH=../../.. python3 ./test_valve_stack.py.""" # Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd. # Copyright (C) 2015--2019 The Contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not u...
self.assertEqual(normalize("won't"), "will not") self.assertEqual(normalize("won't've"), "will not have") self.assertEqual(normalize("would've"), "would have") self.assertEqual(normalize("wouldn't"), "would not") self.assertEqual(normalize("wouldn't've"), "would not have") self.assertEqual(normalize("ya'll"), "you...
the FST. Returns: self. See also: `encode`. """ self._ops.decode(self, encoder) self._check_mutating_imethod() return self def delete_arcs(self, state, n=None): """ Deletes arcs leaving a particular state. Args: state: The integer index of a state. n: An optional argument indicating how many arcs to be...
reference system for the georeferenced array. Defaults to EPSG 4326 ('epsg:4326'). Returns ------- metadata : dict Dictionary containing the export metadata. Example ------- >>> # Imports >>> import numpy as np >>> from rasterio.transform import from_origin >>> # Create array >>> arr = np.array([[1,2],[3,...
<reponame>gfreewind/sonic-swss<filename>tests/test_mirror_port_span.py # This test suite covers the functionality of mirror feature in SwSS import pytest @pytest.mark.usefixtures("testlog") @pytest.mark.usefixtures('dvs_vlan_manager') @pytest.mark.usefixtures('dvs_lag_manager') @pytest.mark.usefixtures('dvs_mirror_man...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- __author__ = "<NAME>" __credits__ = ["<NAME>"] __license__ = "MIT" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import ctypes import os import threading import time from datetime import date from functools import partial from pathlib import Path from typing import An...
9': 34, 'rock': 3, 'side l': 23, 'side r': 14, 'sidefill1': 6, 'sidefill2': 23, } subs[('*2-01-0-dance', 'white')]={ 'b32': 43, 'b34': 30, 'cycleft': 19, 'cycright': 19, 'desk2': 24, 'hotback': 100, 'hotbox1': 42, 'hotbox2': 78, 'main 10': 100, 'main 11': 46, 'main 2': 46, 'main 3': 46, 'main 4': 46, 'main 5': 100, 'm...
<reponame>evereux/catia_python #! /usr/bin/python3.6 # module initially auto generated using V5Automation.chm from CATIA R25 from pywintypes import com_error from pathlib import Path from pycatia.enumeration.enumeration_types import cat_script_language from pycatia.exception_handling.exceptions import CATIAApplicati...
# -------------------------------------------------------- # Sparse Steerable Convolutions # Common utils w.r.t rotation # Written by <NAME> # Modified from https://github.com/tscohen/se3cnn # -------------------------------------------------------- import torch import os import numpy as np dir_path = ...
1: print('Reverse degrees') return m = zeros(deg_f - deg_g + 2, col_num) for i in range(deg_f - deg_g + 1): m[i, :] = rotate_r(row1, i) m[deg_f - deg_g + 1, :] = row2 return m def find_degree(M, deg_f): ''' Finds the degree of the poly corresponding (after triangularization) to the _last_ row of the ``sma...
import os import logging import copy import numpy as np import pandas as pd from oemof.solph import EnergySystem, Bus, Sink, Source import oemof.tabular.tools.postprocessing as pp from oemof.tools.economics import annuity from oemof_flexmex.helpers import delete_empty_subdirs, load_elements, load_scalar_input_data,\ ...
to tweak (increase) parameter `tokens_in_batch`, though result is " f"not guaranteed." ) return batch_beginnings, batch_sizes, batch_seq_lengths num_cut = 0 for ss in [8, 1]: # ss - split_size old_num_batches = len(batch_sizes) # Starting from the last batch because its size is likely to be not multiple of 8. Th...
trajectories are to be saved model_utils: ModelUtils instance """ args = parse_arguments() forecasted_trajectories = {} for i, (_input, target, helpers) in enumerate(test_loader): _input = _input.to(device) batch_helpers = list(zip(*helpers)) helpers_dict = {} for k, v in config.LSTM_HELPER_DICT_IDX.items...
<reponame>milos-korenciak/2018.ossconf.sk<filename>views.py #!/usr/bin/python # -*- coding: utf8 -*- import os import re import textwrap import requests import unicodedata from datetime import datetime, timedelta from flask import Flask, g, request, render_template, abort, make_response from flask_babel import Babel, ...
print(prop_get_resp) assert(len(prop_get_resp["properties"]) > 0) # Update an existing Property print("Update Property") prop_upd = AeselProperty() prop_upd.name = "testProperty2" prop_upd_resp = None try: prop_upd_resp = transaction_client.update_property("propTestScene", prop_key, prop_upd) except Exception...
<reponame>ToDuyHung/tool-facebook<gh_stars>0 # -*- coding: utf-8 -*- import re import requests import modules.make_up.miscellaneous.normalize.convention as convention from modules.make_up.miscellaneous.normalize.Price import Price s1 = "ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯưẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂể...
<filename>tools/gcmole/gcmole.py #!/usr/bin/env python3 # Copyright 2020 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This is main driver for gcmole tool. See README for more details. # Usage: CLANG_BIN=clang-bin-di...
<reponame>jart/rules_closure # Copyright 2016 The Closure Rules Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- ''' ############################################################################### # # This code is used to parcellate the cortical surface from dMRI information # (tractograms in nii.gz files) using the Mutual Nearest Neighbor Condition # ###############################...
y x x) """ with h5py.File(path_form + str(file_idx) + ".hdf5","r") as input_file: if to_8bit: trench_array_list = np.empty_like(input_file[key], dtype=np.uint8) for tr in range(trench_array_list.shape[0]): for t in range(trench_array_list.shape[1]): trench_array_list[tr,t,:,:] = self.to_8bit(input_file[key][tr,t...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import streamlit as st import time import seaborn as sns import squarify import pycountry import geopandas import plotly.graph_objects as go from PIL import Image from wordcloud import WordCloud, STOPWORDS,ImageColorGenerator st.title("Nobelevo4k...
<filename>build/lib/thoryvos/main_ui.py # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Main.ui' # # Created by: PyQt5 UI code generator 5.15.0 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doi...
= syn_tyme.hour*10000 + syn_tyme.minute*100 + syn_tyme.second if filename is None: #filename = '%s/%s.obs.%d_%02dz.ods'%(dir,expid,nymd,nhms/10000) filename = '%s/%s.obs.%d.ods'%(dir,expid,nymd) # Interval for this synoptic time # ------------------------------- dt = timedelta(seconds=60*60*int(24/nsyn)/2) # us...
<filename>tests/test_openpgp.py # gemato: OpenPGP signature support tests # vim:fileencoding=utf-8 # (c) 2017-2020 <NAME> # Licensed under the terms of 2-clause BSD license import datetime import io import logging import os import shlex import signal import tempfile import pytest import gemato.cli from gemato.compre...
self.offset * lims[3] hvals *= 1-self.offset hvals += offset lims = lims[0:3] + (lims[3] + offset,) return edges, hvals, widths, lims def _update_artists(self, n, element, edges, hvals, widths, lims, ranges): super(SideHistogramPlot, self)._update_artists(n, element, edges, hvals, widths, lims, ranges) self._u...
float < float if scalar_ty.is_floating(): return tl.tensor(builder.create_fcmpOLE(input.handle, other.handle), _bool_like(input)) # < int elif scalar_ty.is_int(): if scalar_ty.is_int_signed(): return tl.tensor(builder.create_icmpSLE(input.handle, other.handle), _bool_like(input)) else: return tl.tensor(builder....
<reponame>BXuan694/SOLO-pytorch<gh_stars>1-10 import os.path as osp import numpy as np import pycocotools.mask as maskUtils from collections.abc import Sequence import torch from .data_container import DataContainer as DC from .compose import Compose import cv2 from .imgutils import rescale_size, imresize, imrescale,...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
{ "cell_type": "code", "metadata": { "id": "TE8DC7VJi_zO", "outputId": "0596c486-9a80-4d93-8238-4c4cf94e0c94", "colab": { "base_uri": "https://localhost:8080/", "height": 34 } }, "source": [ "df_ratings.shape" ], "execution_count": 10, "outputs": [ { "output_type": "execute_result", "data": { "text/pl...
-467, "ranXe": -468, "orveX": 469, "leriX": -470, "maXis": -471, "Xamag": 472, "aS iX": 473, "a uXa": 474, "anXin": -475, "Xerel": -476, "rt aX": 477, "Xalig": -478, "ediXi": -479, "t ilX": 480, "myonX": -481, "Xetes": 482, "retiX": -483, "Xanli": -484, " Xesa": -485, "bovaX": -486, "pis X": -487, "Xecen": 488, ...
<gh_stars>100-1000 import asyncio import os import uuid import json import sqlite3 import dask from dask.utils import tmpfile from dask_cloudprovider.generic.vmcluster import ( VMCluster, VMInterface, SchedulerMixin, ) from dask_cloudprovider.gcp.utils import build_request, is_inside_gce from distributed.core imp...
always round fractional pixel locations in such a way as to make the images bigger. This setting may be useful if pixel rounding errors are causing images to have a gap between them, when they should appear flush. """) # TODO: (bev) support anchor property for ImageRGBA # ref: https://github.com/bokeh/bokeh/iss...
FAKE_RESPONSE_HEADERS, {'services': [{'binary': binary, 'host': host, 'zone': 'nova', 'status': 'enabled', 'state': 'up', 'updated_at': datetime.datetime( 2012, 10, 29, 13, 42, 2), 'id': service_id_1}, {'binary': binary, 'host': host, 'zone': 'nova', 'status': 'disabled', 'state': 'down', 'updated_at': da...
"port-id-value" self._is_frozen = True def __setattr__(self, name, value): self._perform_setattr(Cfm.Global.TracerouteCaches.TracerouteCache.LinktraceReply.ReplyIngress.PortId.PortIdValue, ['port_id_format', 'port_id_string', 'port_id_mac', 'port_id_raw'], name, value) class ReplyEgress(Entity): """ Reply egre...
y: concat(x, y)[3:] = y[3:] return Extract(x.args[1], i, j) elif j >= x.args[1].width: # 4-bit x, y: concat(x, y)[:5] = x[:1] offset = x.args[1].width return Extract(x.args[0], i - offset, j - offset) elif isinstance(x, (BvShl, RotateLeft)) and \ isinstance(x.args[1], (int, core.Constant)) and int(x.args[1]) <= ...
<filename>common/xrd-ui-tests-python/tests/xroad_ss_backup_configuration/ss_management.py<gh_stars>1-10 # coding=utf-8 from selenium.webdriver.common.by import By from view_models import sidebar, popups, ss_system_parameters, messages, log_constants, keys_and_certificates_table from helpers import auditchecker, ssh_cli...
WLOK * WLOK GB = 9.784 * (1.0 - 0.0026 * math.cos(PHI + PHI) - 0.00000028 * HMOK) if OPTIC: A = (287.604 + (1.6288 + 0.0136 / WLSQ) / WLSQ) * 273.15e-6 / 1013.25 else: A = 77.624e-6 GAMAL = (GB * DMD) / GCR GAMMA = GAMAL / ALPHA GAMM2 = GAMMA - 2.0 DELM2 = DELTA - 2.0 TDC = TDKOK - 273.15 PSAT = 10.0**((0....
beta-test code") self.native = mavnative.NativeConnection(MAVLink_message, mavlink_map) else: self.native = None if native_testing: self.test_buf = bytearray() self.mav20_unpacker = struct.Struct('<cBBBBBBHB') self.mav10_unpacker = struct.Struct('<cBBBBB') self.mav20_h3_unpacker = struct.Struct('BBB') self.mav...
<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/envs/test.py<gh_stars>1-10 """ This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location o...
this kind of news analysis can also prove useful for individual stocks. News articles can often explain \ why a stock is outpacing the growth of the market or lagging behind. In the \"Try it Yourself!\" section below you can do your own \ research. One interesting thread is to input TSLA as your stock ticker. You wil...
""" Tests for the particle array module. """ # standard imports import unittest import numpy # local imports from pysph.base import particle_array from pysph.base import utils from pyzoltan.core.carray import LongArray, IntArray, DoubleArray import pickle import pytest from pysph.cpy.config import get_config def...
frames of a dot moving across an image def build_frames(size, timeStep=0): frames = list() labelA = list() labelB = list() labelC = list() # create the first frame frame = np.zeros((size, size)) step = np.randint(0, size - 1) # decide if we are heading left or right right = 1 if np.random() < 0.5 else 0 col =...
in gRNAs: # for every gRNA candidate within recoded region, if g.index[0] >= startRecode-frame and g.index[1] <= endRecode+frame2: # if grna is inside recoded region gOnSeq = g.seq; # get original gRNA sequence wholeRecSeq = nonRecodedStart + recodedSeq; # add initial bases gOffSeq = ""; anchor = -1; # will store ...
<filename>dev/testingUncertProp.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 14 20:35:03 2017 test functions that propagate uncertanty @author: sebalander """ # %% #import time #import timeit import numpy as np import numdifftools as ndf from calibration import calibrator as cl import mat...
<filename>roll/ast.py import logging import random from abc import ABC, abstractmethod from copy import copy from enum import Enum, auto import roll.exceptions as rollerr # import * imports all tokens, operators, the Assignment class, and the root Program class __all__ = [ "TokenNumber", "TokenString", ...
import os import sys import time import numpy as np import json import torch import torch.nn as nn import torch.nn.functional as F import torch_geometric from torch_geometric.nn import (NNConv, GMMConv, GraphConv, Set2Set) from torch_geometric.nn import (SplineConv, graclus, max_pool, max_pool_x, global_mean_pool) #f...
<reponame>rickyHong/parallel-wave-vocoder-repl<gh_stars>100-1000 # -*- coding: utf-8 -*- # !/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from tensorflow.contrib.signal import stft def causal_conv(value, filter...
the no_ext argument when pulling/downloading') @click.option('-o', '--overwrite', flag_value=True, help='Overwrite previously added file if the file has been modified') @click.option('-s', '--srx', type=click.Path(exists=True), help='srx file') @click.option('-si', '--srx_id', help='srx id') @click.option('-i', '--its'...
from collections import namedtuple from copy import copy from datetime import * from geojson import Feature, Point, FeatureCollection, LineString from geojson.mapping import to_mapping from typing import List, Dict import functools import os import struct from KMALL import kmall from hyo2.mate.lib.scan import Scan, A_...