input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>dmccloskey/listDict # system from copy import copy # Calculate utilities from .listDict_dependencies import * # Resources from io_utilities.base_importData import base_importData from io_utilities.base_exportData import base_exportData class listDict(): '''Utility functions for converting and extracting a li...
<filename>my_utils/languages.py def get_content(content_type: str, lang: str): return LANGUAGES[lang][content_type] LANGUAGES = { 'ru': { 'ERRORS_DESCRIPTIONS': { 'COG_DISABLED': 'Эта команда отключена на этом сервере!', 'COMMAND_DISABLED': 'Эта команда или группа команд была отключена на этом сервере!', 'TAG_N...
# 相手の駒配置を予測 # これは不完全情報ゲームにおいて動作するようにする # 正体が不明な相手の駒をとりあえず-1としておく # board→14R24R34R44R15B25B35B45B41u31u21u11u40u30u20u10u # move import numpy as np import itertools import time from game import State # from pv_mcts import predict from pathlib import Path from tensorflow.keras.models import load_model from test imp...
self.multi_tenancy = multi_tenancy def set_new_switch_flows(self, dpid, topology, vmac_manager): """Set up flows when a new switch(dpid) is connected""" self.set_default_flows(dpid) self.set_interswitch_flows(dpid, topology, vmac_manager) if topology.gateway_connected(): self.set_switch_dcenter_flows(dpid, topol...
<reponame>cs6ting/pytorch_geometric_temporal """Tests for batch behaviour.""" import numpy as np import networkx as nx from torch_geometric_temporal.signal import temporal_signal_split from torch_geometric_temporal.signal import StaticGraphTemporalSignalBatch from torch_geometric_temporal.signal import DynamicGraphT...
import hashlib import json import os from argparse import ArgumentParser, Namespace from collections import defaultdict from copy import deepcopy from functools import partial from typing import Dict, List, Optional, Type import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn import torch...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.13.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% _uuid="8f2839f25d086af736a60e9eeb907d3b93b6e0e5" _cell_guid="b1076d...
ii) cObj.setValue(entryId, "entry_id", ii) cObj.setValue(entityId, "entity_id", ii) cObj.setValue(asymId, "asym_id", ii) cObj.setValue(authAsymId, "auth_asym_id", ii) cObj.setValue(confType, "type", ii) # cObj.setValue(str(hId), "feature_id", ii) cObj.setValue(ssType, "name", ii) # cObj.setValue(begSeqId, "fe...
<reponame>BrentG-1849260/PyVoxelizer import sys import os import numpy as np from ctypes import cdll, Structure, c_float class Point3(Structure): _fields_ = [ ("x", c_float), ("y", c_float), ("z", c_float) ] class Triangle3(Structure): _fields_ = [ ("v1", Point3), ("v2", Point3), ("v3", Point3) ] triang...
<gh_stars>0 # coding: utf-8 # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0...
<filename>sysinv/sysinv/sysinv/sysinv/puppet/kubernetes.py # # Copyright (c) 2018-2020 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # from __future__ import absolute_import from eventlet.green import subprocess import json import keyring import netaddr import os import random import re import tempf...
<gh_stars>1-10 import pandas as pd import numpy as np import sklearn from sklearn.ensemble import BaggingClassifier from sklearn import metrics from sklearn.model_selection import StratifiedKFold from sklearn.dummy import DummyClassifier from sklearn import tree from sklearn import svm import pickle import os import ut...
# -*- coding: future_fstrings -*- # Copyright 2018 <NAME>. 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 requi...
frame for this location. """ confidence = _messages.FloatField(1, variant=_messages.Variant.FLOAT) timeOffset = _messages.StringField(2) class GoogleCloudVideointelligenceV1p2beta1LabelSegment(_messages.Message): r"""Video segment level annotation results for label detection. Fields: confidence: Confidence th...
""" Implementation of window function estimation, following https://github.com/cosmodesi/GC_derivations, and https://fr.overleaf.com/read/hpgbwqzmtcxn. """ import time import numpy as np from scipy import special from pmesh.pm import ParticleMesh, RealField, ComplexField from . import mpi from .fftlog import PowerToC...
import time import numpy as np import scipy.integrate import scipy.linalg import ross from ross.units import Q_, check_units from .abs_defect import Defect from .integrate_solver import Integrator __all__ = [ "Rubbing", ] class Rubbing(Defect): """Contains a rubbing model for applications on finite element mode...
<reponame>tomatze/opendihu-webapp<gh_stars>10-100 from python_settings.python_settings import * # each dict entry corresponds to a cpp-template # each template-dict can have a ordered list with template_arguments (assuming there are no template_arguments if omitted) # possible outer templates (runnables) have the key...
self.tree_frame.columnconfigure(1, weight=0) self.tree_frame.grid( row=1, column=0, sticky=tk.NSEW, padx=(10, 5), pady=10 ) self.tree_files = my_widgets.My_Treeview( master=self.tree_frame, columns=('Test', 'Ignore', 'Type', 'ID'), selectmode='extended' ) self.tree_files.bind('<Double-Button-1>', self.__ignore_...
"""Generated message classes for genomics version v1. Stores, processes, explores and shares genomic data. This API implements the Global Alliance for Genomics and Health (GA4GH) v0.5.1 API as well as several extensions. """ # NOTE: This file is autogenerated and should not be edited by hand. from googlecloudsdk.thir...
<reponame>demosdemon/pyup # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from unittest import TestCase from pyup.requirements import Requirement from mock import patch, PropertyMock, Mock from pyup.requirements import RequirementFile, RequirementsBundle from .test_packa...
"""distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. """ zaimportuj sys zaimportuj os zaimportuj re z email zaimportuj message_from_file spróbuj: zaimportuj warnings wyjąwszy ImportError: warnings = Nic z distutils.errors zaimportuj * z dis...
# -*- coding: utf-8 -*- # Python2 Compatibility from __future__ import absolute_import, division, print_function, unicode_literals import os import json import conda_content_trust.metadata_construction as cct_metadata_construction import conda_content_trust.common as cct_common import conda_content_trust.signing as ...
<filename>tests/contrib/gp/test_models.py<gh_stars>1-10 from __future__ import absolute_import, division, print_function import logging from collections import defaultdict, namedtuple import pytest import torch import pyro import pyro.distributions as dist import pyro.optim as optim from pyro.contrib.gp.kernels impo...
struct . unpack ( "H" , packet [ : 2 ] ) [ 0 ] self . rloc . afi = socket . ntohs ( oOo00Oo0o00oo ) if ( len ( packet ) < self . rloc . addr_length ( ) ) : return ( None ) packet = self . rloc . unpack_address ( packet [ 2 : : ] ) if ( packet == None ) : return ( None ) self . rloc . mask_len = self . rloc . host_...
import pygame from pygame.locals import * from obstacles.floor_collision import FloorCollision from obstacles.teleporter import Teleport from Points import Points from player.player import Player from pygame import sprite from AI.enemy import Gumba from AI.enemy import Koopatroops from AI.enemy import Paratroops from A...
from __future__ import absolute_import from __future__ import print_function from __future__ import division import collections import signal import socket import time import msgpack import requests import simplejson import sys import six from paramiko.ssh_exception import NoValidConnectionsError from aetros.utils ...
2): (0, 1), (8, 21, -4, 3): (0, 1), (8, 21, -4, 4): (0, 1), (8, 21, -4, 5): (0, 1), (8, 21, -3, -5): (0, 1), (8, 21, -3, -4): (0, 1), (8, 21, -3, -3): (0, 0), (8, 21, -3, -2): (0, 1), (8, 21, -3, -1): (0, 1), (8, 21, -3, 0): (0, 1), (8, 21, -3, 1): (0, 1), (8, 21, -3, 2): (0, 1), (8, 21, -3, 3): (1, 1), (8...
<reponame>oliver306/TREE<gh_stars>0 import networkx as nx import copy import random import sys import matplotlib.pyplot as plt from matplotlib import cm import Colorizer from datetime import datetime from pathlib import Path import pickle import numpy as np import csv from kResiliencePaths import kResiliencePaths impor...
P HAVE OTH DIAG TESTEXAM", max_length=2) SURGPROC = models.CharField("WAS SURG PROC PERFORMED ON P THIS VISIT", max_length=2) MEDPRESC = models.CharField("ANY MEDICINE PRESCRIBED FOR P THIS VISIT", max_length=2) OPCCC1X = models.CharField("MODIFIED CLINICAL CLASSIFICATION CODE", max_length=3) OPCCC2X = models.CharF...
# Trezor interaction script from ..hwwclient import HardwareWalletClient from ..errors import ActionCanceledError, BadArgumentError, DeviceAlreadyInitError, DeviceAlreadyUnlockedError, DeviceConnectionError, DEVICE_NOT_INITIALIZED, DeviceNotReadyError, UnavailableActionError, common_err_msgs, handle_errors from .trezo...
query.message.delete() try: prev_message = bot.get_messages(query.from_user.id, int(query.message.message_id) - 1) if prev_message.text: print("before contains:", prev_message.text) if str(prev_message.text).__contains__("Take your audio searching to the speed"): print("after contains:", prev_message.text) text...
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the MIT license. # See the LICENSE file in the project root for more information. from dataclasses import dataclass from pathlib import Path from typing import Callable, cast, Dict, Iterable, Mapping, ...
<reponame>python-happybase/aiohappybase """ HappyBase tests. """ import gc import random import logging import asyncio as aio from functools import partial from typing import AsyncGenerator, Tuple, List import pytest from thriftpy2.thrift import TException from aiohappybase import ( Table, Connection, Connection...
if ( iIIiI11II != None and O00O0 . itr_rlocs != [ ] ) : I1i11111i = O00O0 . itr_rlocs [ 0 ] else : if ( deid . is_ipv4 ( ) ) : I1i11111i = II1ii1ii elif ( deid . is_ipv6 ( ) ) : I1i11111i = I11ii1i1i else : I1i11111i = II1ii1ii if 64 - 64: i1IIi / O0 - oO0o if 7 - 7: IiII . IiII * Ii1I if 1 - 1: i11iIiiIii ...
'.format(language=language) if copyright != None: cmd += '--copyright-notice {copyright} '.format(copyright=copyright) cmd += '-i "{path}"?par={par} -i "{audio_path}"?encoder-delay={delay}, -o "{output}"'.format(path=path, par=par, audio_path=audio_path, delay=delay, output=output) print(cmd) os.system('"%s"' % c...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
# ======================================================================================== # # Description: # # Emulates execution of VM code. # # Attribution: # # Code by www.jk-quantized.com # # Redistribution and use of this code in source and binary forms must retain # the above attribution notice and this conditio...
<reponame>abael/eli5 # -*- coding: utf-8 -*- from __future__ import absolute_import from functools import partial import re from singledispatch import singledispatch from typing import Any, Dict, List, Tuple import numpy as np # type: ignore import scipy.sparse as sp # type: ignore from xgboost import ( # type: ignore...
import collections import gc import inspect import math from multiprocessing.spawn import import_main_path import os import re import shutil import sys import time import warnings from logging import StreamHandler from pathlib import Path from typing import ( TYPE_CHECKING, Any, Callable, Counter, Dict, List, Op...
<reponame>opnfv/samplevnf #!/usr/bin/python ## ## Copyright (c) 2020 Intel Corporation ## ## 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...
project_id: int = None ) -> schemas.Project: project_record = self._get_project_record(session, name, project_id) return self._transform_project_record_to_schema(session, project_record) def delete_project( self, session: Session, name: str, deletion_strategy: schemas.DeletionStrategy = schemas.DeletionStrate...
<gh_stars>0 """This file outlines the interaction between snek and Discord's Gateway API.""" import asyncio import collections import logging import random import sys import time import zlib from types import TracebackType from typing import TypeVar, TYPE_CHECKING from aiohttp import WSMsgType from dis_snek.api impor...
with self.assertRaises(ValueError) as err: coerce_dtypes(in_series, datetime) self.assertEqual(str(err.exception), err_msg) # dataframe in_df = pd.DataFrame({self.col_name: in_data}) err_msg = (f"[datatube.dtype.coerce_dtypes] cannot coerce column " f"{repr(self.col_name)} to {datetime} without losing " f"infor...
#!/usr/bin/env python # # 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 law or ag...
<reponame>PENGUINLIONG/tinyspv """ Generate machine readable JSON referring to the SPIR-V specification. @PENGUINLIONG """ from html.parser import HTMLParser import json from collections import defaultdict import re import os from typing import List with open("specs/unified1/SPIRV.html") as f: spec = f.read() class ...
from pymatgen import PeriodicSite from Voronoi_sites import add_voronoi from empty_polyhedra_util import * __author__ = 'Tina' """ Created March 17, 2015 Takes code with all Voronoi points inserted into structure (as cif file from Voronoi_sites) as input These points are indicated by Rn, an element not present in an...
the Tcl/Tk libraries przerwij # Now check dla the header files jeżeli tklib oraz tcllib: # Check dla the include files on Debian oraz {Free,Open}BSD, where # they're put w /usr/include/{tcl,tk}X.Y dotversion = version jeżeli '.' nie w dotversion oraz "bsd" w host_platform.lower(): # OpenBSD oraz FreeBSD use Tc...
"""Callbacks used by the :mod:`responses` module for mocking out API requests.""" import json try: from urllib.parse import parse_qs except ImportError: from urlparse import parse_qs from requests_toolbelt.multipart import decoder from tests.constants import * def get_content_disposition_name(headers): """Get t...
#!/usr/bin/python # -*- coding: utf-8 -*- """ **Project Name:** MakeHuman **Product Home Page:** http://www.makehuman.org/ **Code Home Page:** http://code.google.com/p/makehuman/ **Authors:** <NAME> **Copyright(c):** MakeHuman Team 2001-2011 **Licensing:** GPL3 (see also http://sites.google.com/sit...
<reponame>Wassaf-Shahzad/micromasters<filename>discussions/api_test.py """Tests for discussions API""" # pylint: disable=redefined-outer-name from django.core.exceptions import ImproperlyConfigured from django.db.models.signals import post_save from elasticsearch_dsl import Search from factory.django import mute_signal...
"""Functions to calculate electron probe""" import numpy as np import pyTEMlib.image_tools import scipy.ndimage as ndimage def make_gauss(size_x, size_y, width=1.0, x0=0.0, y0=0.0, intensity=1.0): """Make a Gaussian shaped probe """ size_x = size_x/2 size_y = size_y/2 x, y = np.mgrid[-size_x:size_x, -size_y:size_...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
import re from enum import IntEnum from typing import Tuple, Optional from datetime import datetime, timedelta, timezone from flask import redirect, url_for, request, current_app, g, make_response from flask.views import MethodView from flask_smorest import Blueprint, abort from swpt_lib.utils import u64_to_i64 from sw...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.base.exchange import Exchange from ccxt.base.errors import ExchangeError from ccxt.base.errors import BadRequest from ccxt.base.e...
<reponame>SpaceTeam/space-event-trace<filename>space_trace/views.py from datetime import date, datetime, timedelta from functools import wraps from io import StringIO from traceback import format_exception import csv from typing import List, Tuple import flask from flask import session, redirect, url_for, request, fla...
the example, the before string is "The phone number is" ( can be blank ) :param after: In the example, the after string is "how cool is that?" ( defaults to blank ) :param data: Data to be spoken as :param content: see https://msdn.microsoft.com/en-us/library/system.speech.synthesis.sayas(v=vs.110).aspx ) Example:...
g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter]) def doModifyAlarm(args, parsed_globals): g_param = parse_global_arg(parsed_globals) cred = credential.Credential( g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token] ) http_profile = HttpProfile( reqTimeou...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
# These are all the modules we'll be using later. Make sure you can import them # before proceeding further. from __future__ import print_function import matplotlib.pyplot as plt import matplotlib.image as mpimg import random import numpy as np import os import sys import tarfile from IPython.display import display, Im...
<reponame>icebreaker/dotfiles<filename>gnome/gnome2/gedit/plugins.symlink/tm_autocomplete.py # -*- coding: utf-8 -*- # # Gedit Plugin for TextMate style autocompletion. Tap Esc to cycle through # completions. # # Copyright © 2010, <NAME> <<EMAIL>> # # Thanks to <NAME> <<EMAIL>> for the proximity based search # code, ...
"outstunt", "outsulks", "outsware", "outswear", "outsweep", "outswept", "outswims", "outswing", "outswore", "outsworn", "outswung", "outtalks", "outtasks", "outtells", "outthank", "outthink", "outthrew", "outthrob", "outthrow", "outtower", "outtrade", "outtrick", "outtrots", "outtrump", "outturn...
<filename>common_utils.py !pip install kaggle import os def get_size(path = os.getcwd()): print("Calculating Size: ",path) total_size = 0 #if path is directory-- if os.path.isdir(path): print("Path type : Directory/Folder") for dirpath, dirnames, filenames in os.walk(path): for f in filenames: fp = os.path.jo...
<reponame>nicolargo/clize # clize - function decorator for creating commands # Copyright (C) 2011, 2012 by <NAME> <<EMAIL>> # Copyright (C) 2012 by <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to...
<filename>scripts/discovery_tests_with_setup.py # Need to import path to test/fixtures and test/scripts/ # Ex : export PYTHONPATH='$PATH:/root/test/fixtures/:/root/test/scripts/' # # To run tests, you can do 'python -m testtools.run tests'. To run specific tests, # You can do 'python -m testtools.run -l tests' # Set th...
z: z[0] * z[1])([m120, m220]) #mul = multiply([m1,m2]) multiplied_out.append(mul20) m121 = Lambda(lambda x: x[:, 9])(image_y) m221 = Lambda(lambda y: y[:, 9])(pi) mul21 = Lambda(lambda z: z[0] * z[1])([m121, m221]) #mul = multiply([m1,m2]) multiplied_out.append(mul21) m122 = Lambda(lambda x: x[:, 10])(image_y) m222 =...
# # Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list o...
# Copyright (c) 2018 <NAME> at the University of Rochester # This file is part of the Hoomd-Tensorflow plugin developed by <NAME> import tensorflow as tf import numpy as np from os import path import pickle import hoomd ## \internal # \brief load the TensorFlow variables from a checkpoint # # Adds variables from mod...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2019, Battelle Memorial Institute. # # 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...
: 'ardent' , '12425' : 'are' , '12426' : 'area' , '12431' : 'arena' , '12432' : 'ares' , '12433' : 'argive' , '12434' : 'argo' , '12435' : 'argon' , '12436' : 'argot' , '12441' : 'argue' , '12442' : 'argus' , '12443' : 'arhat' , '12444' : 'arid' , '12445' : 'aries' , '12446' : 'arise' , '12451' : 'ark' , '12452' : 'arl...
= average_precision_score(truth, scores) fpr, tpr, thrs = roc_curve(truth, scores) area = roc_auc_score(truth, scores) dt[rr_file] = truth ds[rr_file] = scores metrics[rr_file] = [fpr, tpr, thrs, area, pr] plt.figure() lw = 2 for rr_file in rr_files: i = rr_files.index(rr_file) [fpr, tpr, thrs, area, pr] = m...
cluster, security group, snapshot or parameter group can be obtained by providing the name as a parameter. By default, the past hour of events are returned. See also: AWS API Documentation :example: response = client.describe_events( SourceIdentifier='string', SourceType='cluster'|'cluster-parameter-group'|'clu...
'Memorizer': 'User' } # Maps model names to the names of other models they can be joined to for # queries. The values of the join models are the attributes of the original # model that the joins are actually made on, e.g., outerjoin(model.Form.tags) models2joins = { 'Form': { 'File': 'files', 'Translation': 't...
# -*- coding: utf-8 -*- from __future__ import print_function import numpy as np from numpy.linalg import LinAlgError, inv, solve, norm from numpy import dot, exp from numpy.random import beta from scipy.integrate import trapz import scipy.stats as stats import pandas as pd from lifelines.plotting import plot_estimat...
import random as r import math #import matplotlib.pyplot as plotter import numpy import scipy from scipy import stats # Rideshare service simulation model that includes rider choice # Author: <NAME> # SOURCES AND DERIVATIONS FROM V2: # In 2019 and 2020, there were 5 million Uber drivers and 18.7 million trips per d...
<reponame>huicheese/Django-test3<filename>django/contrib/gis/tests/distapp/tests.py<gh_stars>0 import os, unittest from decimal import Decimal from django.db.models import Q from django.contrib.gis.gdal import DataSource from django.contrib.gis.geos import GEOSGeometry, Point, LineString from django.contrib.gis.measur...
from __future__ import absolute_import, division, print_function from libtbx import easy_run small_pdb = ''' CRYST1 67.764 73.374 89.188 90.00 90.00 90.00 P 21 21 21 SCALE1 0.014757 0.000000 0.000000 0.00000 SCALE2 0.000000 0.013629 0.000000 0.00000 SCALE3 0.000000 0.000000 0.011212 0.00000 ATOM 1 CD1 LEU B 72 8.667 -...
contains: destination: description: - Conceptually, this is the range of IP addresses that a packet originating from the instance can go to. - "Allowed values:" - " * IP address range in CIDR notation. For example: `192.168.1.0/24`" - " * The `cidrBlock` value for a L(Service,https://docs.cloud.oracle.com/en-us/...
cdf['y'] cluster = cdf['cluster'] customdata = cdf['id'] if self.cluster_wf.is_gpu_enabled(): x_data = x_data.to_array() y_data = y_data.to_array() cluster = cluster.to_array() customdata = customdata.to_array() df_size = cupy.asnumpy(df_size) df_shape = cupy.asnumpy(df_shape) scatter_trace = go.Scattergl({...
features """ # UNCOMMENT var below if standard library combinations is used #allowed_c = set(allowed_c) spectrum = zip(mz_list,intensity_list) dists_mz = [] dists_mz_intens = [] prev_analyzed = set() #Make deepcopy since we are going to change the spectra! spec_one = list(copy.deepcopy(spectrum)) spec_two...
color, 'alpha': 0.7, 'label': 'beginning'}, # 'axvline': {'x': 0, 'linestyle': 'dashed', 'color': 'gray', 'linewidth': 0.5}, # 'axhline': {'y': 0, 'linestyle': 'dashed', 'color': 'gray', 'linewidth': 0.5} } if it == avail_its[-1]: plot_dic['axvline'] = {'x': 0, 'linestyle': 'dashed', 'color': 'gray', 'linewidth': ...
from paida.paida_core.PAbsorber import * from paida.paida_core.IFunctionCatalog import * from paida.paida_core.IFunction import * from paida.paida_core.PUtilities import _Shlex from paida.paida_core.PExceptions import * import os class _EOFException(Exception): pass class _ItemObject: _zeros = ['0.0', '-0.0', '(0....
from collections import OrderedDict import numpy as np import pytest from pandas._libs.tslib import Timestamp from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike import pandas as pd from pandas import Index, MultiIndex, date_range import pandas.util.testing as tm def test_constructor_singl...
/ self.zeta[link][k] for k in range(condition, self.nij[link])]) if not self.full_links: zero_out = (self.node_ts[link[0]] >= self.Tau[link]) sum_1 = np.sum((np.exp(-(mu+phi) * t_diff) - 1)[zero_out]) sum_2 = np.sum(np.multiply(t_diff,np.exp(-(mu+phi) * t_diff))[zero_out]) vals_mu += [...
*need* to implement: * doRead(maxage) Subclasses *can* implement: * doReset() * doPoll(n, maxage) Subclasses *can* override: * doStatus(maxage) * valueInfo() """ parameters = { 'fmtstr': Param('Format string for the device value', type=str, default='%.3f', settable=True), 'unit': Param('Unit of the de...
0: src_ix = np.insert(src_ix, 0, src_ix[0] - 1) # check right edge intervals = np.append(intervals, dt_trg[i + 1] - dt_src[src_ix[-1]]) if src_ix[-1] > (len(dt_src) - 1): src_ix = np.append(src_ix, src_ix[-1] + 1) # convert to seconds intervals = np.array([_tdelta2seconds(interval) for interval in inter...
""" /****************************************************************************** * $Id$ * * Project: libLAS - http://liblas.org - A BSD library for LAS format data. * Purpose: Python ctypes function calls * Author: <NAME>, <EMAIL> * *****************************************************************************...
<filename>deep_polygoggles.py # coding: utf-8 # # Porting Tensorflow tutorial "Deep MNIST for Experts" to polygoggles # # based on https://www.tensorflow.org/versions/r0.7/tutorials/mnist/pros/index.html # In[21]: import math import tensorflow as tf import datasets import make_polygon_pngs def get_data_sets_and...
<filename>font_icons/management/commands/loadfontawesome5_free.py from django.core.management.base import BaseCommand from ...models import FontIconModel class Command(BaseCommand): help = "Load all free fontawesome icons" def handle(self, *args, **options): FontIconModel.objects.bulk_create([ FontIconModel(sty...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 8 13:37:56 2020 @author: karliskanders Last updated on 01/04/2020 """ import leidenalg as la import pandas as pd import numpy as np from sklearn.metrics.cluster import adjusted_mutual_info_score as ami_score from sklearn.metrics import confusion_mat...
bar statsStatusBar['value'] = 0 statuslbl.config(text='Loading') # Disable stats button statsButton.config(state=tk.DISABLED) # Update window window.update() # Get status inputs segmentBy = segmentByBox.get() increment = incrementBox.get() yval = yValsBox.get() # Set height tag for col...
"concrete": False, "defaultSort": None, "model": None, "prettyName": "Admin", "toMany": False, "type": "html", }, "id": { "actions": [ { "name": "delete_selected", "prettyName": "Delete selected in admins", } ], "canPivot": True, "choices": [], "concrete": True, "defaultSort": None, "model": "number",...
must be given') if E_file is None and not isinstance(self.E, IdentityOperator): raise ValueError('E is not identity, E_file must be given') from pymor.tools.io import save_matrix A, B, C, D, E = self.to_matrices() for mat, file in [(A, A_file), (B, B_file), (C, C_file), (D, D_file), (E, E_file)]: if mat is None...
<reponame>butlertron/deployfish<filename>deployfish/aws/systems_manager.py import re from deployfish.aws import get_boto3_session WILDCARD_RE = re.compile('^(?P<prefix>.+\..+\.)\*(?P<remainder>.*)') class BaseParameter(object): """ This class represents a parameter in the AWS Systems Manager Parameter Store. """...
contains fields with a default. If 'self' is a new # line in a one2many field, 'names' also contains the one2many's inverse # field, and that field may not be in nametree. todo = list(unique(itertools.chain(names, nametree))) if first_call else list(names) done = set() # mark fields to do as modified to trigger r...
from vmaf.tools.misc import run_process __copyright__ = "Copyright 2016-2020, Netflix, Inc." __license__ = "BSD+Patent" import os import re import unittest from vmaf.config import VmafConfig from vmaf import ExternalProgram, required REMOVE_LOG = 1 # for debug, make this 0 def read_log(log_filename, type): score...
<reponame>vathes/canonical-imaging<filename>djimaging/processing.py import datajoint as dj import scanreader import numpy as np import pathlib from datetime import datetime from uuid import UUID from .imaging import schema, Scan, ScanInfo, Channel, PhysicalFile from .utils import dict_to_hash from djutils.templates i...
color=None, aggregate='count', x_annot=None, y_annot=None, width=None, height=None, title=None, legend='bottom', pan_zoom=None, use_container_width=True, ): """Calculate and draw a time histogram. Parameters ---------- data : DataFrame date: str Column name to use for the date. x_unit : str Vega-Lite...
def __init__(self, plist, blist, belse): self.plist = plist self.blist = blist self.belse = belse def visit(self, a): return a.visitIf(self) ## class TImport(object): ## def __init__(self, vec): ## self.vec = vec ## ## def visit(self, a): ## return a.visitImport(self) class TRaise(object): def __init__(self...
<reponame>PoporoDev/poporo<filename>tests/functional_tests/mining_pop.py #!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """An example functional test The mod...
black_glazed_terracotta * white_concrete * orange_concrete * magenta_concrete * light_blue_concrete * yellow_concrete * lime_concrete * pink_concrete * gray_concrete * light_gray_concrete * cyan_concrete * purple_concrete * blue_concrete * brown_concrete * green_concrete * red_concrete * black_concrete ...