input
stringlengths
2.65k
237k
output
stringclasses
1 value
<filename>Model.py import tensorflow as tf import time import numpy as np from sklearn.metrics import precision_score, recall_score, f1_score class TextClassifier(object): """模型超参数""" def __init__(self, n_hidden=128, num_classes=2, epoch=20, max_seq_len=300, embedding_size=50, learning_rate=0....
<filename>lib/galaxy/visualization/plugins/config_parser.py from six import string_types import galaxy.model from galaxy import util import logging log = logging.getLogger(__name__) class ParsingException(ValueError): """ An exception class for errors that occur during parsing of the visualizations framework con...
ssl.wrap_socket(self.socket, ssl_version=self.ssl_version, do_handshake_on_connect=False, ca_certs=self.ca_certs, cert_reqs=cert_policy) if hasattr(self.socket, 'socket'): # We are using a testing socket, so preserve the top # layer of wrapping. self.socket.socket = ssl_socket else: self.socket = ssl_socket ...
import sys import asyncio from uuid import uuid4 from datetime import datetime from preggy import expect from jetengine import ( Document, StringField, BooleanField, ListField, EmbeddedDocumentField, ReferenceField, DESCENDING, URLField, DateTimeField, UUIDField, IntField, JsonField, ) from jetengine.erro...
# -*- coding: utf-8 -*- # File generated according to Generator/ClassesRef/Simulation/EEC.csv # WARNING! All changes made in this file will be lost! """Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/EEC """ from os import linesep from sys import getsizeof fro...
m.get('zjbzxbm') is not None: self.zjbzxbm = m.get('zjbzxbm') if m.get('xingming') is not None: self.xingming = m.get('xingming') if m.get('zjhm') is not None: self.zjhm = m.get('zjhm') if m.get('dkhtbh') is not None: self.dkhtbh = m.get('dkhtbh') return self class CpfDataUsageLogVO(TeaModel): def __init__( ...
import numpy as np import pandas as pd import theano.tensor as T from random import shuffle from theano import shared, function from patsy import dmatrix from collections import defaultdict class MainClauseModel(object): def __init__(self, nlatfeats=8, alpha=1., discount=None, beta=0.5, gamma=0.9, delta=2., orthog...
import unittest from unittest.mock import Mock from pyats.topology import loader, Device from genie.metaparser.util.exceptions import SchemaEmptyParserError from genie.libs.parser.junos.show_ospf3 import ShowOspf3Interface, \ ShowOspf3Overview, \ ShowOspf3OverviewExtensive, \ ShowOspf3NeighborExtensive, \ ShowOspf...
<gh_stars>1-10 #!/usr/bin/env python # stdlib imports from xml.dom import minidom from collections import OrderedDict import os.path # third party imports import numpy as np from scipy.special import erfc import shapely from mapio.grid2d import Grid2D # local imports from losspager.utils.country import Country from ...
<filename>mql/qprim.py # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
(667760* mckin**8*q_cut**3*sE)/mbkin**14 - (1415408*mckin**10*q_cut**3*sE)/ mbkin**16 - (2723568*mckin**12*q_cut**3*sE)/mbkin**18 - (698608*mckin**14*q_cut**3*sE)/mbkin**20 - (7168*mckin**16*q_cut**3*sE)/ mbkin**22 + (78384*q_cut**4*sE)/mbkin**8 + (1397952*mckin**2*q_cut**4* sE)/mbkin**10 + (4097136*mckin**4*q_cu...
<reponame>dearpatrickzhao/pydataclasses from __future__ import absolute_import import inspect import functools import itertools from collections import OrderedDict import six import six.moves as sm class _DataNone(object): def __setattr__(self, _k, _v): raise AttributeError('nothing is wrong') def __getattri...
-64766, 50336338, 92693, -1, 50398476, 92727, 50594572, 49945380, -1, 50660103, 50532192, -1, -64762, 50606159, 92695, -1, 50667893, 92710, -64760, 50608512, 92694, -64759, 50803572, 92677, -64758, 50865891, 92726, -64757, 50930506, 92719, -1, 50987846, 92675, 51184405, 50538842, -1, ...
if __name__ == "__main__" or __name__ == "test_web_default": __package__ = 'cloudscheduler.unit_tests.web_tests' import unittest import sys from . import web_test_setup_cleanup as wtsc from . import web_test_assertions_v2 as wta from . import web_test_page_objects as pages from . import web_test_helpers as helpers c...
indicatorOfTypeOfLevel == 105 and level == 10: return 'v10' if table2Version == 2 and indicatorOfParameter == 33 and indicatorOfTypeOfLevel == 105 and level == 10: return 'u10' if table2Version == 2 and indicatorOfParameter == 52: return 'r' if table2Version == 2 and indicatorOfParameter == 7: return 'gh' i...
""" Generate CoAs | Cannlytics Author: <NAME> <<EMAIL>> Created: 7/22/2021 Updated: 7/23/2021 License: MIT License <https://opensource.org/licenses/MIT> """ # Standard packages import argparse from ast import literal_eval import os from pathlib import Path from re import sub, findall from shutil import copyfile # Ext...
<gh_stars>10-100 """ Module to provide processing for the block quotes. """ import logging from pymarkdown.container_markdown_token import BlockQuoteMarkdownToken from pymarkdown.leaf_block_processor import LeafBlockProcessor from pymarkdown.parser_helper import ParserHelper, PositionMarker from pymarkdown.parser_logg...
channel_index, "ksize") strides = _get_sequence(strides, 3, channel_index, "strides") return gen_nn_ops.max_pool3d( input, ksize=ksize, strides=strides, padding=padding, data_format=data_format, name=name) # pylint: enable=redefined-builtin @tf_export("nn.max_pool_with_argmax", v1=[]) @dispatch.add_dispatch_...
cause the engine to skip any further analysis by this module for this target.""" raise NotImplemented() def execute_final_analysis(self, analysis): """Called to analyze Analysis or Observable objects after all other analysis has completed.""" return False def execute_pre_analysis(self): """This is called once a...
self.visibleChildren = [] self.visibleExits = [] self.visibleSigns = [] self.visibleObstacles = [] self.visibleFires = [] self.visibleHeat = [] self.visibleAgents = [] self.visibleCells = [] self.selected = False self.nearestSign = None self.routeHistory = [] self.path = [] self.explorationD...
P_dev.max(), np.array(devs).max(), measure ) ## write to file Write2h5( likelihood_file_Full, P, [ KeyFull( measure=measure, redshift=redshift, axis=axis, N_inter=N_inter, L0=L0, **scenario ) for axis in ['P', 'x', 'dev']] ) if not dev: P = P[:-1] return P def FlatPrior( measure='', x=[] ): """ return flat ...
0) m.c3445 = Constraint(expr= - 0.5*m.x1564 - 0.5*m.x1565 + m.x3491 == 0) m.c3446 = Constraint(expr= - 0.5*m.x1565 - 0.5*m.x1566 + m.x3492 == 0) m.c3447 = Constraint(expr= - 0.5*m.x1566 - 0.5*m.x1567 + m.x3493 == 0) m.c3448 = Constraint(expr= - 0.5*m.x1567 - 0.5*m.x1568 + m.x3494 == 0) m.c3449 = Constraint(expr= -...
* bufsz)() driver.cuDeviceGetName(buf, bufsz, self.id) self.name = buf.value self.primary_context = None def get_device_identity(self): return { 'pci_domain_id': self.PCI_DOMAIN_ID, 'pci_bus_id': self.PCI_BUS_ID, 'pci_device_id': self.PCI_DEVICE_ID, } @property def COMPUTE_CAPABILITY(self): """ For backw...
<filename>fhir/resources/DSTU2/observation.py # -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Observation Release: DSTU2 Version: 1.0.2 Revision: 7202 """ from typing import Any, Dict from typing import List as ListType from pydantic import Field, root_validator from . import fhirtypes fr...
<filename>brainex/experiments/harvest_setup.py import math import os import random import shutil import time from datetime import datetime from logging import warning import numpy as np import pandas as pd # spark_location = '/Users/Leo/spark-2.4.3-bin-hadoop2.7' # Set your own # java8_location = '/Library/Java/JavaV...
#!/usr/bin/env python """ Tools to work with data from different spectrographs: CARMENES, HARPS, HARPN. Uses functions from `harpsutils` and `carmenesutils`. """ from __future__ import division from __future__ import print_function import os import sys import numpy as np import pandas as pd from . import carmenesuti...
import os import time import csv import pickle import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data.dataloader import DataLoader from torch.nn.utils import clip_grad_norm_ as clip_grad_norm from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt...
<reponame>gideonbros/polyaxon #!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 # # Unles...
# -*- coding: utf-8 -*- from .database import BaseDbManager from . import models from sqlalchemy import distinct from pandas import read_sql from collections import Iterable class QueryManager(BaseDbManager): """Query interface to database.""" def _limit_and_df(self, query, limit, as_df=False): """adds a limit (...
<filename>myhabitatagent.py import argparse import habitat import random import numpy as np import scipy import os import cv2 import time from habitat.tasks.nav.shortest_path_follower import ShortestPathFollower from habitat.utils.visualizations import maps from gibsonagents.expert import Expert from gibsonagents.pathp...
== 'gaussProc': pct += 1 + gwb_popparam_ndims elif args.gwbSpecModel == 'turnover': if args.gwb_fb2env is not None: pct += 2 elif args.gwb_fb2env is None: pct += 3 elif args.gwbSpecModel == 'gpEnvInterp': pct += 2 if args.incCorr: pct += num_corr_params if args.gwbModelSelect: pct += 1 if args.incGWline:...
<reponame>thisch/mypy """Generate C code for a Python C extension module from Python source code.""" # FIXME: Basically nothing in this file operates on the level of a # single module and it should be renamed. from collections import OrderedDict from typing import List, Tuple, Dict, Iterable, Set, TypeVar, Optional ...
import bz2 as zmodule import collections import datetime import enum import functools import glob # import gzip as zmodule import itertools import json import logging import os import sys import time from concurrent.futures import ProcessPoolExecutor try: import ujson except ImportError: ujson = json import sqlalc...
over=True) if ps_t >= 1500: game.game_instance.player.close_dialogue() return True return False def is_priority(self) -> bool: return False class LaunchPokemonAnimation(Animation): def __init__(self, mem: BattlePlayer, case: int, team_n: int, enemy: bool): self.mem = mem self.start_time = utils.current_mil...
k-point and band for reconstructing the wavefunction. For non-spin-polarized, the first index corresponds to the kpoint and the second corresponds to the band (e.g. self.coeffs[kp][b] corresponds to k-point kp and band b). For spin-polarized calculations, the first index is for the spin. If the calculation was non...
4.58780657862546*(m.x793*m.x791 + m.x911*m.x909) - 1.37932553964677*(m.x793*m.x909 - m.x791*m.x911))*m.b967 + m.x388 == 0) m.c390 = Constraint(expr=-(9.96252401138967*(m.x744**2 + m.x862**2) - 9.97442401138967*(m.x744*m.x745 + m.x862*m.x863) - 2.50682766776177*(m.x744*m.x863 - m.x745*m.x862))*m.b968 + m.x389 == 0) ...
#!/usr/bin/python3 from bcc import BPF intrucode=""" BPF_PERF_OUTPUT(events); //#undef DEBUG //#define DEBUG #define DDS_RECORD 1 #define SOCK_RECORD 2 #define FID_CREATE_TOPIC 40 #define FID_CREATE_DDSWRITER 41 #define FID_CREATE_DDSREADER 42 #define FID_VWRITER_NEW 43 #define FID_DDSWRITER_WRITE 1 #define FID...
<gh_stars>0 from sysdfiles import IniFile, NetworkFile, ServiceFile from tests import * class TestIniFiles: def __init__(self): self.is_setup = False # ========================================================================= # setUp # ========================================================================= d...
######################################################################################### ######################################################################################### ######################################################################################### import numpy as np from math import pi, sin, cos ...
AWS provider credential options to scope the cluster's kubeconfig authentication when using a non-default credential chain. This is required for certain auth scenarios. For example: - Creating and using a new AWS provider instance, or - Setting the AWS_PROFILE environment variable, or - Using a named profile confi...
#!/usr/bin/python # # Copyright (c) 2016 <NAME>, <<EMAIL>> # <NAME>, <<EMAIL>> # Copyright (c) 2018 <NAME>, III (@jeking3) <<EMAIL>> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANS...
"""Embedded DSL for assembling logic circuits. Embedded domain-specific combinator library for assembling abstract definitions of logic circuits and synthesizing circuits from those definitions. """ from __future__ import annotations from typing import Sequence import doctest from parts import parts from circuit impo...
import os.path import numpy as np import pandas as pd from sklearn import linear_model, metrics import matplotlib.pyplot as plt import matplotlib.mlab as mlab from matplotlib.backends.backend_pdf import PdfPages class DataLoader: MRI_FOLDER = 'MRI' # MRI folder name MRI_DATASET = 'img_array_train_6k_' # MRI datase...
self.make_behavior(UnloadInvetoryToChest) yield self.make_behavior(CollectLayingAround, itemstack=self.itemstack) for recipe in self.item_recipes: log.msg('collect with recipe %s' % recipe) if not recipe.is_obtainable: continue if recipe.mine_recipe: yield self.make_behavior(CollectMine, itemstack=self.itemstack...
}, 'muon-electron mass ratio': { 'quantity': 'muon-electron mass ratio', 'unit': '', 'value': '206.7682826', 'uncertainty': '0.000 0046' }, 'muon g factor': { 'quantity': 'muon g factor', 'unit': '', 'value': '-2.0023318418', 'uncertainty': '0.000 000 0013' }, 'muon mag. mom.': { 'quantity': 'muon mag. mo...
# -*- coding: utf-8 -*- r'''This module contains implementations of common regularizers. In ``theanets`` regularizers are thought of as additional terms that get combined with the :class:`Loss <theanets.losses.Loss>` for a model at optimization time. Regularizer terms in the loss are usually used to "encourage" a mod...
from .mixins import GroupRequiredMixin from rest_framework.response import Response from rest_framework.views import APIView import datetime, time import pandas as pd import sys, os import numpy as np import re from pandas.tseries.offsets import BDay import scipy.stats import igraph try: from .semutils.analytics.por...
0xFC, 0x3F, 0xEF, 0xFF, 0xFF, 0x81, 0xF0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x01, 0xF8, 0x00, 0x80, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFC, 0x7F, 0xFC, 0x3F, 0xFE, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00...
: "namednumber", "number" : "1" }, "v2m" : { "nodetype" : "namednumber", "number" : "2" }, }, }, "access" : "readwrite", "description" : """""", }, # column "routerDomainIpIgmpVersion" : { "nodetype" : "column", "moduleName" : "ZYXEL-GS4012F-MIB", "oid" : "1.3.6.1.4.1.890.172.16.31.10.33.2.1.3", "statu...
<reponame>codebyravi/otter<filename>otter/worker/launch_server_v1.py """ Initial implementation of a version one launch_server_v1 config. This launch config worker is responsible for: 0) Generating server name and injecting our AS metadata 1) Starting a server 2) Adding the server to a load balancer. On delete, this ...
""" This file contains the main functionality of the software and is used to achieve two primary goals and is divided into two sections 1. Approximate the walker density as a function of time using Monte Carlo simulations 2. Determine the steady state solution of a random walk on a network using the methodology de...
is assumed .. WARNING:: If the scalar field has already expressions in other charts, it is the user's responsibility to make sure that the expression to be added is consistent with them. EXAMPLES: Adding scalar field expressions on a 2-dimensional manifold:: sage: M = Manifold(2, 'M', structure='topological...
Orphaned. raise return file def from_url( url:str , file_index:int , dataset_id:int , pillow_save:dict = {} ): # URL format is validated in `from_urls`. try: img = Imaje.open( requests.get(url, stream=True).raw ) except: raise ValueError(f"\nYikes - Could not open file...
<filename>c2cgeoportal/tests/functional/test_mapserverproxy.py # -*- coding: utf-8 -*- # Copyright (c) 2013, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of ...
dictionary. # It takes one parameter: # File pointer: A file pointer that points to a JSON file. import json # Opening JSON file with open('sample.json', 'r') as openfile: # Reading from json file json_object = json.load(openfile) print(json_object) print(type(json_object)) # XLSX file format # XLSX is ...
numexamples = 800, startdate = 1780, enddate = 2010) gridsearch_a_model(generalmetapath, sourcefolder, c_range, featurestart, featureend, featurestep) if command == 'optimize_fifty_years': # this option creates a model that can be used for comparison to # the model of fictional prestige, which spans only 1850-1...
raise NotImplementedError('Method not implemented!') def OrderByReference(self, request, context): """Get an Order by Pending Order reference (UUID) """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def Orders...
<filename>geos/kml.py """ This module serves for generating Google Earth KML files which create an overlay of tiled web maps. This module comes with three major classes: * KMLMaster: Creates a KML that contains network links to multiple KMLMapRoots (-> overview over available maps) * KMLMapRoot: Root document of ...
<reponame>aaronvincent/gambit_aaron #!/usr/bin/env python # # GAMBIT: Global and Modular BSM Inference Tool #********************************************* # \file # # The GAMBIT Colouring-in Book # # A script for priming pippi runs and patching # together their outputs. Designed to allow # one to highlight specific reg...
= 0 mock_isfile.return_value = True mock_call.return_value = 0 status = udocker.FileUtil("tarball.tar").verify_tar() self.assertTrue(status) # check tar file True call 1 mock_msg.level = 0 mock_isfile.return_value = True mock_call.return_value = 1 status = udocker.FileUtil("tarball.tar").verify_tar() self.as...
from visualizerItem import * from visualizerGraphicItem import * from modelView import ModelView class Model(object): def __init__(self): self._windows = [] self._sockets = [] self._items = {} self._graphic_items = {} self._new_items = {} self._editable = True self._grid_size = (1, 1) self._nodes = [] #pair...
<reponame>khilawar4/airflow<gh_stars>1-10 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Ve...
# -*- coding: utf-8 -*- # # computeFunctions and -Routines for parallel calculation # of single trial measures needed for the averaged # measures like cross spectral densities # # Builtin/3rd party package imports import numpy as np from scipy.signal import fftconvolve, detrend from inspect import signature # backend...
<filename>Incrementor.py import re import os import time import numpy as np import nltk from tqdm import tqdm import utils import Fruitfly from Fruitfly import Fruitfly class Incrementor: def __init__(self, corpus_dir, matrix_file, corpus_tokenize=False, corpus_linewise=False, corpus_checkvoc=None, matrix_incre...
<gh_stars>100-1000 # _*_ coding: utf-8 _*_ import importlib import typing from collections import OrderedDict, deque from copy import copy from pathlib import Path from lxml import etree # type: ignore from lxml.etree import QName # type: ignore from pydantic.fields import SHAPE_LIST, SHAPE_SINGLETON if typing.TYPE_C...
<gh_stars>1-10 import functools import sqlite3 import threading import typing import click name_id = typing.Union[str, int] class Database(threading.local): INIT = """ CREATE TABLE IF NOT EXISTS tags(id INTEGER PRIMARY KEY, name TEXT UNIQUE); CREATE TABLE IF NOT EXISTS tag_files(tag_id INTEGER, file_id INTEGER);...
realtime_start is not None and realtime_start < date(1776, 7, 4): raise ValueError('Variable realtime_start ("{}") is before min date 1776-07-04.'.format(realtime_start)) if realtime_start > realtime_end: raise ValueError('The date set by variable realtime_start ("{}") can not be after the date set by variable real...
<gh_stars>0 #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test some ESRI specific translation issues. # Author: <NAME> <<EMAIL>> # ##########################################################...
+ t[5].code + ' ' + str(t[6]) + ' ' + str(t[7]) + ' ' + str(t[8]) + ' ' + t[9].code + ' ' + str(t[10]) + ' ' + str(t[11]) def p_list_id(t): '''list_id : list_id COMA ID | ID''' if len(t) == 4: t[0] = GenerarC3D() t[0].code += t[1].code + ' ' + str(t[2]) + ' ' + str(t[3]) else: t[0] = GenerarC3D() t[0].code += ...
= parameters.relationshipType() charName = parameters.characteristic() qualName = parameters.qualifier() lhsCodes = parameters.lhsCodes() rhsCodes = parameters.rhsCodes() charType = parameters.characteristicType() intName = parameters.intention() intType = parameters.intentionType() self.updateDatabase('call ...
import os import torch import torch.nn as nn from utils import exact_interpolate, np_image_to_normed_tensor, normed_tensor_to_np_image, create_scale_pyramid class Conv2DBlock(nn.Module): """ Combine Conv2d-BN-LReLU into a single block """ # the 0.2 negative slope is given in the supplementary materials def __in...
# Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
X1 in view user units :param min_y: Y1 :param max_x: X2 :param max_y: Y2 :type str_val: str :type min_x: float_ref :type min_y: float_ref :type max_x: float_ref :type max_y: float_ref :returns: 0 if line returned. 1 - Right Mouse 2 - Escape/Cancel :rtype: int .. versionadded:: 5.0 **License:** `Geosoft...
2010/12/01. .. seealso:: |MANUAL| page 228 """ if __sofa_version < (2010, 12, 1): raise NotImplementedError tt1 = _ct.c_double() tt2 = _ct.c_double() s = _sofa.iauTcgtt(tcg1, tcg2, _ct.byref(tt1), _ct.byref(tt2)) return tt1.value, tt2.value # iauTdbtcb # this routine was added in release 2010-12-01 of SOFA t...
#!/usr/bin/env python3 import logging import os import sys import time import traceback from collections import namedtuple from pathlib import Path from screenshots import Client, Screenshooter def env(name, default): return os.environ.get(name, default) Spec = namedtuple( "Spec", "commands before after geomet...
0xC5 Aring 0x60, 0xC0, 0xE0, 0xC0, 0xE0, # 0xC6 AE 0x60, 0x80, 0x80, 0x60, 0x20, 0x40, # 0xC7 Ccedilla 0x40, 0x20, 0xE0, 0xC0, 0xE0, # 0xC8 Egrave 0x40, 0x80, 0xE0, 0xC0, 0xE0, # 0xC9 Eacute 0xE0, 0x00, 0xE0, 0xC0, 0xE0, # 0xCA Ecircumflex 0xA0, 0x00, 0xE0, 0xC0, 0xE0, # 0xCB Edieresis 0x40, 0x20, 0xE0, 0x40, 0x...
= None, **kwargs ): super(EndpointProperties, self).__init__(origin_path=origin_path, content_types_to_compress=content_types_to_compress, origin_host_header=origin_host_header, is_compression_enabled=is_compression_enabled, is_http_allowed=is_http_allowed, is_https_allowed=is_https_allowed, query_string_caching_beh...
<gh_stars>10-100 # -*- coding: utf-8 -*- """ Base class to handle collection of profiles and means across multiple .h5 files """ import logging import numpy as np import os import sys import psutil import pandas as pd import time import shutil from warnings import warn from reV.handlers.outputs import Outputs from reV...
for displaying the planform (it displays the `data` field). .. rubric:: Developer Notes All subclassing objects must implement: * a property named `data` that points to some field (i.e., an attribute of the planform) that best characterizes the Planform. For example, the OAP planform `data` property points to t...
<reponame>Donnyvdm/gdsctools # -*- python -*- # -*- coding utf-8 -*- # # This file is part of GDSCTools software # # Copyright (c) 2015 - Wellcome Trust Sanger Institute # All rights reserved # # File author(s): <NAME> <<EMAIL>WE HERE> # # Distributed under the BSD 3-Clause License. # See accompanying file LICENSE.txt ...
mem = [0x2e, 0xbb, 0xaa] inst = disassemble(mem, pc=0) self.assertEqual(str(inst), "rol 0xaabb") self.assertEqual(len(inst), len(mem)) self.assertEqual(inst.addr_mode, AddressModes.Absolute) self.assertEqual(inst.data_ref_address, 0xaabb) self.assertEqual(inst.code_ref_address, None) # seb 1,0xaa ;2f aa Zero Pa...
newline, skip them if type(member) != Tag: continue aux[s].append(member.text) #Special iteration for profile setting if not entry.find('profile-setting'): aux['profile-setting'] = None elif entry.find('profile-setting').group: aux['profile-setting'] = {'type' : 'group', 'name' ...
<gh_stars>1-10 # -*- coding: utf-8 -*- ############################################################################### # Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. # # All rights reserved. # # This file is part of the aiida-jutools package. # # (AiiDA JuDFT tools) # # # # The code is hosted on ...
this interface is connected to an IPv6 stack, and the interface can send and receive IPv6 packets. ''', 'enabled', 'openconfig-if-ip', False), _MetaInfoClassMember('mtu', ATTRIBUTE, 'int' , None, None, [('1280', '4294967295')], [], ''' [adapted from IETF IP model RFC 7277] The size, in octets, of the large...
<filename>bip/base/block.py import ida_gdl import idc import idautils import ida_bytes import ida_kernwin import ida_graph from bip.py3compat.py3compat import * import bip.base.bipelt import bip.base.func import bip.base.instr class BipBlockType(object): """ Enum for the type of basic block. This come from the ``...
or the VM creations triggered " _msg += "by the AIs instantiated by the AS attachment operation " _msg += "will fail." raise self.osci.ObjectStoreMgdConnException(_msg, _status) _aidrs_templates = self.osci.get_object(obj_attr_list["cloud_name"], "GLOBAL", False, \ "aidrs_templates", False) _aidrs_templates["pa...
# Copyright (c) 2017 <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, softw...
"""The tests for the DirecTV Media player platform.""" from unittest.mock import call, patch from datetime import datetime, timedelta import requests import pytest from homeassistant.components.media_player.const import ( ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, MEDIA_TYPE_TVSHOW, ATTR_MEDIA_ENQUEUE, ATTR_ME...
#Pyjsdl - Copyright (C) 2021 <NAME> <https://gatc.ca/> #Released under the MIT License <https://opensource.org/licenses/MIT> class Element: def __init__(self, element=None): if element is not None: self._element = element else: self._element = None @property def style(self, attr): return self._element.style...
b * acoth(c * x)) ** n * PolyLog(p + S(1), u) / (S(2) * c * d), x) def replacement6497(a, b, c, d, e, n, p, u, x): return -Dist( b * n / S(2), Int( (a + b * atanh(c * x)) ** (n + S(-1)) * PolyLog(p + S(1), u) / (d + e * x ** S(2)), x, ), x, ) + Simp((a + b * atanh(c * x)) ** n * PolyLog(p + S(1), u) / (S(2)...
<reponame>chrishales/polcalsims # <NAME> # 22 June 2017 # Version 1.0 # # # This code is released under a BSD 3-Clause License # See LICENSE for details # # This code was used to obtain the results shown in arXiv:1706.06612 # and EVLA Memo 201 / ALMA Memo 603. # # # This code will plot spurious full-array on-axis linea...
<reponame>odb9402/MAT<gh_stars>0 """ Code based on: Shang et al "Edge Attention-based Multi-Relational Graph Convolutional Networks" -> https://github.com/Luckick/EAGCN Coley et al "Convolutional Embedding of Attributed Molecular Graphs for Physical Property Prediction" -> https://github.com/connorcoley/conv_qsar_fast ...
<filename>energyPATHWAYS/util.py # -*- coding: utf-8 -*- """ Created on Wed Apr 08 10:12:52 2015 @author: <NAME> & <NAME> Contains unclassified global functions """ import config as cfg import pint import pandas as pd import os import numpy as np from time_series import TimeSeries from collections import defaultdic...
""" Soft Actor-Critic Based on SAC implementation from https://github.com/denisyarats/pytorch_sac License: MIT License Copyright (c) 2019 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software ...
depth = 1 while True: try: sys.setrecursionlimit(depth) except RecursionError: depth += 1 else: break sys.setrecursionlimit(depth+n) def recurse_in_except(): try: 1/0 except: recurse_in_except() def recurse_after_except(): try: 1/0 except: pass recurse_after_except() def recurse_in_body_and_excep...
1 (2, TType.I64, 'supplier_id', None, None, ), # 2 ) class del_supplier_result(object): """ Attributes: - success - e """ def __init__(self, success=None, e=None,): self.success = success self.e = e def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadabl...
of filename using the basename and the list of provided extensions """ def __init__(self, name='FilenameOps', **kw): kw['name'] = name apply( NetworkNode.__init__, (self,), kw ) self.inNodeWidgetsVisibleByDefault = True ip = self.inputPortsDescr ip.append(datatype='string', name='filename', balloon='filename t...
import logging import utils from flask import Flask, Response, session, render_template, request, url_for, redirect, abort import datetime import json import urllib from markupsafe import Markup import time from flask import send_from_directory import os from flask_login import LoginManager, login_required, login_user,...
from __future__ import print_function import collections import csv import logging import pickle import re from cStringIO import StringIO import swalign from transgene.common import read_fasta, trans, BEDPE, translate def get_transcriptome_data(infile, drop_transcript_version=False): """ Parses Gencode transcript...
Leakage': 0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.635388, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime ...