input
stringlengths
2.65k
237k
output
stringclasses
1 value
Telha - PI', 'pt': 'Cocal de Telha - PI'}, '55863264':{'en': u('Jos\u00e9 de Freitas - PI'), 'pt': u('Jos\u00e9 de Freitas - PI')}, '55863265':{'en': u('Uni\u00e3o - PI'), 'pt': u('Uni\u00e3o - PI')}, '55863267':{'en': 'Lagoa Alegre - PI', 'pt': 'Lagoa Alegre - PI'}, '55863269':{'en': 'Beneditinos - PI', 'pt': 'Ben...
9.23844143e-01, ], [ 1.19368104e00, 1.01462773e00, 8.94331130e-01, 8.51431703e-01, 8.94331130e-01, 1.01462773e00, 1.19368104e00, ], ] ) if do_tests is True: np.testing.assert_allclose(rjb, dctx.rjb, rtol=0, atol=0.01) else: print(repr(dctx.rjb)) rrup = np.array( [ [ 4.0129619, 3.93137849, 3.8765...
""" Module for PAMPAC action classes. """ from abc import ABC, abstractmethod from gatenlp import Annotation from gatenlp.features import Features class Getter(ABC): """ Common base class of all Getter helper classes. """ @abstractmethod def __call__(self, succ, context=None, location=None): pass def _get_mat...
recursively. This method is designed to initialize each layer instance once, even if the same layer instance occurs in multiple places in the network. This enables weight sharing to be implemented as layer sharing. Args: input_shapes: A tuple representing a shape (if this layer takes one input) or a tuple of sh...
<reponame>AshKelly/PyAutoLens<filename>workspace/howtolens/chapter_4_inversions/scripts/tutorial_5_borders.py from autolens.data import ccd from autolens.data.array import mask as msk from autolens.model.profiles import light_profiles as lp from autolens.model.profiles import mass_profiles as mp from autolens.model.gal...
# -*- coding: utf-8 -*- from openerp import models,fields,api,_ import logging import base64 import io import time import commands import os import datetime from datetime import datetime from openerp.exceptions import ValidationError, except_orm from openerp.osv.osv import osv _logger = logging.getLogger(__name__) fro...
<filename>tests/retirement_constants.py FONDO_PARA_RETIRO_JSON_0 = { "reg_wdr": 2000, "num_of_years": 2, "freq": 12, "rate": 5, "wdr_when": 0, } FONDO_PARA_RETIRO_JSON_1 = { "reg_wdr": 2000, "num_of_years": 2, "freq": 12, "rate": 5, "wdr_when": 1, } # noinspection DuplicatedCode FONDO_PARA_...
#!/usr/bin/python ##------------------------------------------------------------------------------------------------------------------ ## Module: demoPPP.py ## Release Information: ## V1.0.0 (<NAME>, 06/29/2012) : Initial release ## V1.1.0 (<NAME>, 11/12/2012) : Added connection testing ## V1.1.1 (<NAME>, 11/13/2012) ...
"""Generate training input/output pairs.""" raise NotImplementedError('Subclasses must override this method.') def fidelity_test(self, *args): """Test the fidelity function using a different method.""" raise NotImplementedError('Subclasses must override fidelity_test().') def fidelity(self, *args): """Compute t...
= [] for mi, atoms1 in enumerate(g) : ress1 = atoms1[0].residue ressN = atoms1[-1].residue print " - %d/%d, %d-%d" % (mi+1, numProc, ress1.id.position, ressN.id.position) procAtomsPath = os.path.join ( tempPath, "%d_atoms.txt" % mi ) fout = open ( procAtomsPath, "w" ) for at in atoms1 : r = at.residue altLoc...
from pyflamegpu import * import sys, random, math """ FLAME GPU 2 implementation of the Boids model, using spatial3D messaging. This is based on the FLAME GPU 1 implementation, but with dynamic generation of agents. Agents are also clamped to be within the environment bounds, rather than wrapped as in FLAME GPU 1....
# 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, software # distributed under the Li...
# Copyright (c) 2021, <NAME> # May 2021. Started on May 17 for Localized Conflict Modeling. # First, read GPW population count data as GeoTIFF. # Write-up and theoretical results in late May. #------------------------------------------------------------------- # # conda activate tf36 # python # from topoflow.utils imp...
dist_reps.shape) [30, 33, 30] # print("self.opt['use_biw2v']=", self.opt['use_biw2v']) 0 word_feats = [] if not self.opt['use_biw2v']: word_embeds = self.get_xlmr_reps(combined_task_inputs) # [batch size, seq len, xlmr dim] word_embeds = self.dropout(word_embeds) else: word_embeds = self.biw2v_embedding(biw...
None), slice(2, (- 30), None))] new_data_df = pd.DataFrame(new_data) installment_amt = new_data[(slice(None, None, None), 5)] bins = np.linspace(installment_amt.min(), installment_amt.max(), 10) installment_amt = installment_amt.astype(float).reshape(installment_amt.size, 1) binned_installment_amt = pd.DataFrame(n...
<filename>use_cases/2020_12/run/dispatchers/dereg.py import os import sys from functools import partial import numpy as np import pyomo.environ as pyo from pyomo.opt import SolverStatus, TerminationCondition # 43 kWh/kgH2 = 4.3e1 kWh/kgH2 e_per_h2 = 43e-6 # GWh / kgH2 def dispatch(info): """ Dispatches the compone...
without path if not name: if not hasattr(file, 'name'): raise click.UsageError('The --file must have a name attribute, or --name must be specified') name = os.path.basename(file.name) client = build_client('object_storage', ctx) total_size = os.fstat(file.fileno()).st_size if total_size > 0: upload_manager_kw...
<reponame>armingeiser/KratosSalomePlugin<gh_stars>1-10 # _ __ _ ___ _ ___ _ _ # | |/ /_ _ __ _| |_ ___ __/ __| __ _| |___ _ __ ___| _ \ |_ _ __ _(_)_ _ # | ' <| '_/ _` | _/ _ (_-<__ \/ _` | / _ \ ' \/ -_) _/ | || / _` | | ' \ # |_|\_\_| \__,_|\__\___/__/___/\__,_|_\___/_|_|_\___|_| |_|\_,_\__, |_|_||_| # |___/ # Licens...
Returns ------- list List of envs for the given context. """ # First, get the context in data contextData = self._data.get(context, None) if contextData is None: return [] # Then, get the env in the precedently queried context dict. envData = contextData.get('envs', None) if envData is None: return [] r...
"""" STRIP Scanning Strategy Tools test module. """ import unittest import healpy as hp import numpy as np from ScanningTools import ScanningTools as st from astropy.time import Time from astropy.coordinates import SkyCoord, AltAz from ScanningTools.Quaternions import Quaternion as q angles = np.array([[-10, 45, 59...
import os, sys sys.path.append(os.getcwd()) import time import numpy as np import tensorflow as tf import tflib as lib import tflib.ops.linear import tflib.ops.conv2d import tflib.ops.batchnorm import tflib.ops.deconv2d import tflib.save_images import tflib.plot import tflib.flow_handler as fh import tflib.SINTELdata...
<filename>tests/test_cookies.py import pytest from flask import Flask from flask import jsonify from flask import request from flask_jwt_extended import create_access_token from flask_jwt_extended import create_refresh_token from flask_jwt_extended import jwt_required from flask_jwt_extended import JWTManager from fla...
<filename>src/models/new_allen_nlp/Mortality/MortalityReader.py import tempfile from typing import Dict, Iterable, List, Tuple from overrides import overrides import torch import allennlp from allennlp.data import DataLoader, DatasetReader, Instance, Vocabulary from allennlp.data.fields import LabelField, TextField,...
from __future__ import print_function import argparse from datetime import datetime import os import re import signal import ssl import subprocess import sys import tempfile import time from werkzeug.serving import make_ssl_devcert # pylint: disable=wrong-import-order try: from urllib.parse import urlsplit, splitport ...
<filename>netket/operator/_hamiltonian.py # Copyright 2021 The NetKet 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...
import pygame, pygcurse from pygame.locals import * import LED_display as LD import HC_SR04 as RS import threading import time import copy import os t=threading.Thread(target=LD.main, args=()) t.setDaemon(True) t.start() WINWIDTH = 32 WINHEIGHT = 16 FPS = 60 mode_list = ['mouse', 'keyboard', 'sensor'] mode = mode...
<gh_stars>1-10 #!/usr/bin/env python import json, os, string, sys, tempfile from contextlib import nested from distutils.core import run_setup from django.utils.importlib import import_module from fabric.context_managers import settings as fab_settings from fabric.context_managers import _setenv, cd from fabric.contr...
in slices: try: self.recover_slice(slice_obj=s) except Exception as e: self.logger.error(traceback.format_exc()) self.logger.error("Error in recoverSlice for property list {}".format(e)) if s.is_inventory(): raise e def recover_broker_slice(self, *, slice_obj: ABCSlice): """ Recover broker slice at the AM, d...
<reponame>jhill1/thetis r""" 3D advection diffusion equation for tracers. The advection-diffusion equation of tracer :math:`T` in conservative form reads .. math:: \frac{\partial T}{\partial t} + \nabla_h \cdot (\textbf{u} T) + \frac{\partial (w T)}{\partial z} = \nabla_h \cdot (\mu_h \nabla_h T) + \frac{\partia...
<reponame>twopis/twopis # -*- coding: utf-8 -*- # Code for creating many graphs import numpy as np import json import copy from scipy.stats import beta, linregress import matplotlib.patches as mpatches from matplotlib.colors import LinearSegmentedColormap import matplotlib.pyplot as plt from mpl_toolkits.mplot3d impor...
<filename>pilot_main.py #!/usr/bin/python """Parses and loads RGI questions from excel into MongoDB""" from xlrd import open_workbook from sys import argv from pilot_parser import parse from pymongo import MongoClient import json from pprint import pprint # from utils import write_json def main(args): """Main bod...
<gh_stars>1-10 from Multiple_GAN_codes.Basic_structure import * from keras.datasets import mnist import time from utils import * from scipy.misc import imsave as ims from ops import * from utils import * from Utlis2 import * import random as random from glob import glob import os,gzip import keras as keras ...
import sys, os, time import numpy as np import scipy as sci import scipy.stats as ss import scipy.sparse.linalg as slin import copy from .mytools.MinTree import MinTree from scipy.sparse import coo_matrix, csr_matrix, lil_matrix from .mytools.ioutil import loadedge2sm from .edgepropertyAnalysis import MultiEedgePropBiG...
<filename>examples/signal_processing_examples/dsp_filters.py import scipy.signal import numpy as np import sys """ This module shows how to use map_element in IoTPy to build a library of classes for filtering streams by encapsulating software from scipy.signal and other software libraries. The module consists of a bas...
[] for j in range(len(bp_shear[0])): na_std.append([ np.std(bp_shear[:, j]), np.std(bp_stretch[:, j]), np.std(bp_stagger[:, j]), np.std(bp_buckle[:j]), np.std(bp_prop[:, j]), np.std(bp_open[:, j]), np.std(bp_shift[:, j]), np.std(bp_slide[:, j]), np.std(bp_rise[:, j]), np.std(bp_tilt[:, j]), np.std(bp_roll[:, j]), ...
<gh_stars>10-100 # # Copyright (c) SAS Institute 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 a...
<reponame>brandherd/PyCosmic<gh_stars>0 from astropy.io import fits as pyfits import numpy from scipy import ndimage from scipy import stats __author__ = "<NAME>" __credit__ = ['<NAME>', '<NAME>', '<NAME>'] __copyright__ = "Copyright 2020, <NAME>" __license__ = "MIT" __url__ = 'https://github.com/brandherd/PyCosmic' _...
__all__ = [ 'get_summary_mapping', 'generate_summaryxref_files', 'merge_oed_to_mapping', 'write_exposure_summary', 'write_summary_levels', 'write_mapping_file', ] import io import json import os import warnings import pandas as pd from ..utils.coverages import SUPPORTED_COVERAGE_TYPES from ..utils.data import ...
m.b596 <= 0) m.e871 = Constraint(expr= m.b533 - m.b597 <= 0) m.e872 = Constraint(expr= -m.b533 + m.b534 - m.b598 <= 0) m.e873 = Constraint(expr= m.b535 - m.b599 <= 0) m.e874 = Constraint(expr= -m.b535 + m.b536 - m.b600 <= 0) m.e875 = Constraint(expr= m.b539 - m.b603 <= 0) m.e876 = Constraint(expr= -m.b539 + m.b540 - m....
desc limit 1", (base_id,), ) row = cur.fetchone() latest = None if row: latest = row[0] else: warnings.warn( "Failed to fetch latest version number for JASPAR motif" f" with base ID '{base_id}'. No JASPAR motif with this" " base ID appears to exist in the database.", BiopythonWarning, ) return latest ...
<gh_stars>1-10 import random import time from time import sleep from uuid import uuid4 from datetime import datetime from Jumpscale import j from Jumpscale.data.schema.tests.schema import Schema import unittest T = unittest.TestCase() def log(msg): j.core.tools.log(msg, level=20) def random_string(): return "s"...
# Copyright (c) 2015, University of Memphis, MD2K Center of Excellence # - <NAME> <<EMAIL>> # - <NAME> <<EMAIL>> # 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 cod...
<filename>pyxrf/model/load_data_from_db.py from __future__ import absolute_import, division, print_function, unicode_literals import h5py import numpy as np import os import json import multiprocessing import pandas as pd import platform import math import time as ttime import copy from distutils.version import LooseV...
Passed to `ax.plot` # """ # top, bottom = self.get_border() # color = kwargs.pop("color", "cyan") # label = kwargs.pop("label", None) # etop = self._plot_one_edge( # ax, top, smooth, sg_kwargs, color=color, label=label, **kwargs # ) # ebottom = self._plot_one_edge( # ax, bottom, smooth, sg_kwargs, color=color, **kwar...
# Copyright 2011 <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.0 # # Unless required by applicable law or agreed to in writing, software ...
""" The `ModelSerializer` and `HyperlinkedModelSerializer` classes are essentially shortcuts for automatically creating serializers based on a given model class. These tests deal with ensuring that we correctly map the model fields onto an appropriate set of serializer fields for each case. """ from __future__ import ...
<reponame>IBM/graph4nlp<gh_stars>10-100 from collections import namedtuple import dgl import numpy as np import scipy.sparse import torch from .utils import SizeMismatchException, NodeNotFoundException, EdgeNotFoundException from .utils import entail_zero_padding, slice_to_list from .views import NodeView, NodeFeatVi...
<reponame>jvazquez77/marvin #!/usr/bin/python # ------------------------------------------------------------------- # Import statements # ------------------------------------------------------------------- import math import os import re import sys from decimal import * from operator import * import marvin.db.models....
1 0 1 0 1 1 2 2 V 2 -1 0 1 0 0 0 2 1 2 0 1 0 1 1 1 1 2 W 0 -1 -1 -1 0 -1 -1 0 -1 0 -1 -1 -1 -1 0 0 -1 0 2 Y 0 -1 0 0 2 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 2 A C D E F G H I K L M N P Q R S T V W Y""", ) mat = SubsMat.SeqMat(MatrixInfo.structure) self.assertEqual(len(mat), 210) self.checkMatrix( mat, """\ A 4 C -2 11 D ...
{ 'project_id': 'path', 'location_id': 'path', 'replica_id': 'path', 'service_id': 'path', }, 'collection_format_map': { } }, headers_map={ 'accept': [ 'application/json' ], 'content_type': [], }, api_client=api_client, callable=__compute_project_replica_service_get ) def __compute_project_replica_se...
<reponame>techthiyanes/dalle-mini # coding=utf-8 # Copyright 2021-2022 The Fairseq Authors and The Google Flax Team Authors And The HuggingFace Inc. team and & DALL·E Mini team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
157 ], [ 227, 137, 158 ], [ 227, 137, 159 ], [ 227, 138, 128 ], [ 227, 138, 129 ], [ 227, 138, 130 ], [ 227, 138, 131 ], [ 227, 138, 132 ], [ 227, 138, 133 ], [ 227, 138, 134 ], [ 227, 138, 135 ], [ 227, 138, 136 ], [ 227, 138, 137 ], [ 227, 138, 177 ], [ 227, 138, 178 ], [ 227, 138, 179 ], [ 227, 138, ...
fieldidx = 0 for field in insertRow: if field == None: InsertQuery += "''" else: InsertQuery += "'" + field + "'" if fieldidx < len(insertRow)-1: InsertQuery += "," fieldidx += 1 InsertQuery += ");" SelectQuery = "select ParentID, UserContentsLocation from ProcessContentsTable where ContentsID = '...
values for dataset: {mat}'.format( mat=dataset_name, dt=dt) raise DateValidityError(message) else: cost_data = cost_data[cost_data['Metadata', 'Date'] == dt].squeeze() if cost_data.empty: raise DateValidityError('No valid cost values found for date: {dt} for dataset: {mat}'.format( mat=dataset_name, dt=dt)) ...
# imports import bpy import os from bpy.props import StringProperty, BoolProperty, IntProperty, FloatProperty from bpy_extras.io_utils import ImportHelper from bpy.types import Operator import math import mathutils from mathutils import * from math import * # BLENDER ADDON INFORMATION bl_info = { "name": "LatticeP...
"""Spectral Projection gurgle tools""" from functools import wraps, cached_property import numpy as np from scipy.spatial.distance import cdist from sklearn.preprocessing import StandardScaler from sklearn.decomposition import IncrementalPCA, PCA from sklearn.utils.validation import check_is_fitted, check_array from ...
" oooo0OOo = "" for III1Iiii1I11 in lisp . lisp_get_all_addresses ( ) : i1IIii1iiIi += "{} or " . format ( III1Iiii1I11 ) oooo0OOo += "{} or " . format ( III1Iiii1I11 ) if 72 - 72: O0 / ooOoO0o + OoooooooOO * iII111i i1IIii1iiIi = i1IIii1iiIi [ 0 : - 4 ] i1IIii1iiIi += ") and ((udp dst port 4341 or 8472 or 4789)...
# -*- coding: utf-8 -*- # Created by makepy.py version 0.5.00 # By python version 2.6.6 |EPD 6.3-2 (32-bit)| (r266:84292, Sep 20 2010, 11:26:16) [MSC v.1500 32 bit (Intel)] # From type library 'TTankInterfaces.ocx' # On Thu Dec 02 21:00:50 2010 """TTankInterfaces""" makepy_version = '0.5.00' python_version = 0x20606f0 ...
<gh_stars>10-100 # coding=utf-8 """ Module for low level OSM file retrieval. :copyright: (c) 2013 by <NAME> :license: GPLv3, see LICENSE for more details. """ import hashlib import time import os import re import sys import datetime from subprocess import call from shutil import copyfile from reporter.utilities impo...
<reponame>maulikjs/hue from __future__ import absolute_import, unicode_literals import socket import sys from collections import defaultdict from datetime import datetime, timedelta import pytest from case import Mock, call, patch from kombu import pidbox from kombu.utils.uuid import uuid from celery.five import Que...
<filename>main_pba.py<gh_stars>0 import pba from datetime import datetime from dateutil.relativedelta import relativedelta import os import matplotlib.pyplot as plt import math import pba import numpy as np #from pbox import pnt #from pbox import rng from math import pi from vf_overview import truncate from vf_overv...
name = "com_google_cloud_go_firestore", importpath = "cloud.google.com/go/firestore", sum = "h1:9x7Bx0A9R5/M9jibeJeZWqjeVEIxYW9fZYqB9a70/bY=", version = "v1.1.0", ) go_repository( name = "com_google_cloud_go_pubsub", importpath = "cloud.google.com/go/pubsub", sum = "h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMU...
between normalized log ratios of pairs of genes predicted to be in the same operon per experiment "adjcor" (float): Correlation between normalized log ratios of pairs of adjacent genes per experiment "gccor" (float): Correlation between normalized log ratios of genes and their GC percentage per experiment "maxFit"...
<filename>code/data.py """ This file defines the Hierarchy of Graph Tree class and PartNet data loader. """ import sys import os import json import torch import numpy as np from torch.utils import data from pyquaternion import Quaternion from sklearn.decomposition import PCA from collections import namedt...
function, in seconds. :type DestinationConfig: dict :param DestinationConfig: (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded records.\n\nOnSuccess (dict) --The destination configuration for successful invocations.\n\nDestination (string) --The Amazon Resource Name (ARN) of the destinatio...
self and other are equal, false otherwise.""" if not isinstance(other, self.__class__): return False return self.__dict__ == other.__dict__ def __ne__(self, other: 'ServiceRefTargetList') -> bool: """Return `true` when self and other are not equal, false otherwise.""" return not self == other class ServiceRefV...
<gh_stars>0 import numpy as np import tensorflow as tf from tensorflow.keras import regularizers from tensorflow.keras.layers import Input from tensorflow.keras.models import Model from tensorflow.keras.optimizers import Adam, SGD from tensorflow.keras.layers import Conv2D, MaxPool2D, AveragePooling2D, Flatten, Dense, ...
""" Visual demonstrations of anarchy system. viz.py """ import random import os import PIL.Image from . import rng, cohort MAX_RANDOM = rng.ID_MASK def builtin_next(): """ Returns random numbers using built-in random. """ return random.randint(0, MAX_RANDOM) def demo_prng(): """ Creates images that demon...
<filename>iso-langs/iso639_3.py # ISO 639-3 codes retrieved from https://iso639-3.sil.org/code_tables/download_tables # # Prepared as python module by <NAME> for mtdata https://github.com/thammegowda/mtdata data='''aaa Ghotuo aab Alumu-Tesu aac Ari aad Amal aae Arbëreshë Albanian aaf Aranadan aag Ambrak aah Ab...
#引入套件 import tkinter as tk import pandas as pd #建立主視窗和框架 window = tk.Tk() #創建主視窗 top_frame = tk.Frame(window) #創建Frame window.title("SLOT RTP計算機") #顯示標題 window.geometry('440x1000') #設定視窗大小 def dataimport(): #設定函數 : 取得輸入的名稱 result1_str.set("{}".format(ICON1_entry0.get())) result2_str.set("{}".format(ICON2_entry0.g...
<reponame>dasxran/seleniumMachineLearning MV_FLAG = 4096 # Multi-value flag PT_UNSPECIFIED = 0 PT_NULL = 1 PT_I2 = 2 PT_LONG = 3 PT_R4 = 4 PT_DOUBLE = 5 PT_CURRENCY = 6 PT_APPTIME = 7 PT_ERROR = 10 PT_BOOLEAN = 11 PT_OBJECT = 13 PT_I8 = 20 PT_STRING8 = 30 PT_UNICODE = 31 PT_SYSTIME = 64 PT_CLSID = 72 PT_BINARY = 258 ...
<filename>src/installer/src/tortuga/resourceAdapter/resourceAdapter.py # Copyright 2008-2018 Univa 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/licens...
from datetime import date from unittest.mock import patch, call from django.contrib.auth.models import User from django.core import mail from django.core.exceptions import ValidationError from django.urls import reverse from django.test import TestCase, Client, override_settings, RequestFactory from solenoid.people.m...
0: raise click.UsageError('Parameter --policy-assignment-id cannot be whitespace or empty string') kwargs = {} client = cli_util.build_client('blockstorage', ctx) result = client.get_volume_backup_policy_assignment( policy_assignment_id=policy_assignment_id, **kwargs ) cli_util.render_response(result, ctx) @...
<gh_stars>1-10 import os import sys import warnings import builtins import numpy as np import time import torch import utils from tqdm import tqdm import glob import random import logging import argparse import torch.nn as nn import genotypes as genotypes import torch.utils from torch.utils.tensorboard import SummaryWr...
# -*- coding: utf-8 -*- # # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights # Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or i...
event = CEventExit() self.m_event_dispatcher.fire_event(event) def send_events(self, event): pass def set_request_go_timer(self, timeout): """ Set timeout thread to release debugger from waiting for a client to attach. """ self.cancel_request_go_timer() if timeout is None: return _timeout = max(1....
# -*- coding: utf-8 -*- ## # Copyright 2018 Telefonica S.A. # # 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 l...
s3.dataTable.js and the values used. config = Storage() config.id = id config.lengthMenu = attr.get("dt_lengthMenu", [[ 25, 50, -1], [ 25, 50, str(current.T("All"))]] ) config.displayLength = attr.get("dt_displayLength", s3.ROWSPERPAGE) config.sDom = attr.get("dt_sDom", 'fril<"dataTable_table"t>pi') config.pagi...
return X.asformat("csr") return X def kronpow(a, p, **kron_opts): """Returns `a` tensored with itself `p` times Equivalent to ``reduce(lambda x, y: x & y, [a] * p)``. Parameters ---------- a : dense or sparse vector or operator Object to tensor power. p : int Tensor power. kron_opts : Supplied to :func:...
10, (39, '<'): 10, (39, '='): 10, (39, '>'): 10, (39, '?'): 10, (39, '@'): 10, (39, 'A'): 10, (39, 'B'): 10, (39, 'C'): 10, (39, 'D'): 10, (39, 'E'): 10, (39, 'F'): 10, (39, 'G'): 10, (39, 'H'): 10, (39, 'I'): 10, (39, 'J'): 10, (39, 'K'): 10, (39, 'L'): 10, (39, 'M'): 10, (39, 'N'): 10, (39, 'O'): ...
<filename>localstack/aws/api/ssm/__init__.py import sys from datetime import datetime from typing import Dict, List, Optional if sys.version_info >= (3, 8): from typing import TypedDict else: from typing_extensions import TypedDict from localstack.aws.api import RequestContext, ServiceException, ServiceRequest, han...
by Viewport. # Bounding Box. self.add_argument('-B', '--bbox', dest='viewport_bbox_in', action='store', default=None, help='the bounding box, or viewport, for a read query') # Exclusion Box. self.add_argument('-E', '--bbex', dest='viewport_bbox_ex', action='store', default=None, help='the exclusionary bounding...
<gh_stars>1-10 from datetime import datetime from contextlib import contextmanager import os import os.path import re import selectors import shlex import subprocess import sys import textwrap import types import pytest import warnings BINDIR = os.path.join(os.path.abspath(os.environ['PWD'])) class HlwmBridge: H...
firstvalid, lastvalid, votekey, selectionkey ): assert context.response["accounts"][0]["status"] == "Online" assert context.response["accounts"][0]["address"] == address assert context.response["accounts"][0]["participation"][ "vote-key-dilution" ] == int(keydilution) assert context.response["accounts"][0]["parti...
<gh_stars>0 ''' Common utilities for transient bubble calculation. ''' from numpy import ( append, arange, around, array, atleast_2d, concatenate, copy, diag, hstack, isnan, ix_, ones, prod, shape, sum, unique, where, zeros, exp, log, repeat) from numpy import int64 as my_int from scipy.sparse import csc_matrix as s...
from stanza.models.pos.hunspeller.pos import Verb, Noun, Pronoun, Adjective, Numeral, Adverb, numeralise # Decline numerals and convert other pos features into XPOS and UFeats formats def decline_num(num, rqrd_infl, rqrd_num=None, rqrd_gen=None): """Decline numerals :param num: Numeral object :param rqrd_infl: th...
3188, 3189, 260, 2574, 3293, 2695, 3293, 3294, 2805, 3293, 3294, 3295, 2904, 3293, 3294, 3295, 3296, 2992, 3293, 3294, 3295, 3296, 3297, 3069, 3293, 3294, 3295, 3296, 3297, 3298, 3135, 3293, 3294, 3295, 3296, 3297, 3298, 3299, 3190, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 272, 2575, 3293, 2696, 3293, 3294...
#! /usr/bin/env python ''' tensorflow==2.5.0+ python3 openvino2tensorflow.py \ --model_path openvino/448x448/FP32/Resnet34_3inputs_448x448_20200609.xml \ --output_saved_model \ --output_pb \ --output_weight_quant_tflite \ --output_float16_quant_tflite \ --output_no_quant_float32_tflite python3 openvino2tensorflow.py ...
GetNAFltI(self, *args): """ GetNAFltI(TNEANet self, TStr attr, int const & NId) -> TNEANet::TAFltI Parameters: attr: TStr const & NId: int const & """ return _snap.TNEANet_GetNAFltI(self, *args) def AttrNameNI(self, *args): """ AttrNameNI(TNEANet self, TInt NId, TStrV Names) Parameters: NId: TInt const ...
# Eliminando colunas adicionais X = X.drop(['ae', 'aggreg_dict'], axis=1) return X # Definindo transformador para RMS Energy class RMSEnergy(BaseEstimator, TransformerMixin): """ Classe responsável por extrair a raíz da energia média quadrática de sinais de áudio considerando agregados estatísticos pré defin...
""" SLURM batch system interface module. """ # TODO: Check if there are any bugfixes to the bash SLURM back-end scripts which has not ported to this SLURM python module. from __future__ import absolute_import import os, sys, time, re import arc from .common.cancel import cancel from .common.config import Config, con...
noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats, _request_auth=local_var_params.get('_request_auth')) def api_v1_object_device_ip_port_port_get(self, ip, port, **kwargs): # noqa: E501 """a...
self.transaction_visibility = transaction_visibility self.trust_proxy = trust_proxy self.trust_unknown_certs = trust_unknown_certs self.versions = versions @classmethod def from_dict(cls, _dict: Dict) -> 'GetPublicSettingsResponse': """Initialize a GetPublicSettingsResponse object from a json dictionary.""" arg...
#!/usr/bin/env python import collections # import itertools import numpy as np # from sklearn import linear_model as linear # for VAR # from .utils import sliding_window as window # from .utils.distance import kmeans, dists_sq # from .utils import distance as dist # from python import compress # ================...
into json. subtask_status = {subtask_id: (SubtaskStatus.create(subtask_id)).to_dict() for subtask_id in subtask_id_list} subtask_dict = { 'total': num_subtasks, 'succeeded': 0, 'failed': 0, 'status': subtask_status } entry.subtasks = json.dumps(subtask_dict) # and save the entry immediately, before any subtas...
if brokerObj.delete_queue(queue): if not silent: print("Deleted queue: {}".format(queue)) deleted_queues += 1 if not silent and deleted_queues>1: print('Deleted {} queues'.format(deleted_queues)) def publish(args=None): """ Handle the command-line sub-command publish Usage: ddmq publish [options] <root> ...
%(self.minFFWidth)) print("") def ClassifyInsts(self): self.pinNonFFInstDict = {} self.pinFFInstDict = {} self.numSkipInsts = 0 self.numFFInsts = 0 allFixedStdInsts = [l for l in self.fixedInsts if self.IsMacro(l.height) == False] self.allStdInsts = self.movableStdInsts + allFixedStdInsts # retrive mi...
<reponame>emilysturdivant/BI-geomorph-extraction # -*- coding: utf-8 -*- #! python3 ''' Barrier Island Geomorphology Extraction along transects (BI-geomorph-extraction module) Author: <NAME> email: <EMAIL>; These functions require arcpy. Designed to be imported by either prepper.ipynb or extractor.py. ''' import time ...
<filename>TranskribusDU/gcn/DU_gcn_task.py<gh_stars>10-100 # -*- coding: utf-8 -*- import numpy as np import tensorflow as tf import pickle import os.path import random import gcn.gcn_models as gcn_models from gcn.gcn_datasets import GCNDataset import time FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('tra...