input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
if self . smr_invoked_bit else False )
if 87 - 87: i11iIiiIii
if 34 - 34: i1IIi
def is_ddt ( self ) :
return ( True if self . ddt_bit else False )
if 64 - 64: iIii1I11I1II1 / IiII / Oo0Ooo - I1ii11iIi11i
if 100 - 100: IiII + i1IIi * OoO0O00
def is_to_etr ( self ) :
return ( True if self . to_etr else False )
i... | |
643: b'NtWow64CsrAllocateMessagePointer',
644: b'NtWow64CsrCaptureMessageBuffer',
645: b'NtWow64CsrCaptureMessageString',
646: b'NtWow64CsrClientCallServer',
647: b'NtWow64CsrClientConnectToServer',
648: b'NtWow64CsrFreeCaptureBuffer',
649: b'NtWow64CsrGetProcessId',
650: b'NtWow64CsrIdentifyAlertableThread',
6... | |
+ pod._translation_hh0 + pod._translation_qqq #440
_matrix_2_00z_3q3qq_miss = pod.matrices_dict["2_00z"] + pod._translation_hh0 + pod._translation_qqq #441
_matrix_2_xx0_3q3qq_miss = pod.matrices_dict["2_xx0"] + pod._translation_hh0 + pod._translation_qqq #442
_matrix_2_x0x_3q3qq_miss = pod.matrices_dict["2_x0x"] + pod... | |
<gh_stars>0
# -*- test-case-name: twisted.test.test_paths -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Object-oriented filesystem path representation.
"""
import os
import sys
import errno
import base64
from os.path import isabs, exists, normpath, abspath, splitext
from os.path im... | |
# -*- coding: utf-8 -*-
# This file is part of the Ingram Micro Cloud Blue Connect connect-cli.
# Copyright (c) 2019-2021 Ingram Micro. All Rights Reserved.
import os
import json
from datetime import datetime
from urllib import parse
import requests
from click import ClickException
from openpyxl import Workbook
from... | |
types
plot_type = type
if name is None:
name = self._make_new_plot_name()
if origin is None:
origin = self.default_origin
if plot_type in ("line", "scatter", "polygon", "bar", "filled_line",
"segment"):
# Tie data to the index range
if len(data) == 1:
if self.default_index is None:
# Create the default inde... | |
<reponame>supriyasingh01/github_basics<filename>Internetworking Distributed Project/finalProject/ovs/pox-master/pox/lib/recoco/recoco.py
# Copyright 2011 <NAME>
#
# This file is part of POX.
#
# POX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | |
import os
import time
import numpy as np
import pandas as pd
import torch
import torch.optim as optim
import umap
from matplotlib import pyplot as plt
from sklearn.manifold import TSNE
from data.data_loader import get_data_ts_onh_mac
from losses import elbo_general_timeseries
from losses import mae_globalmean, mae_lo... | |
<reponame>civicboom/civicboom<filename>src/civicboom/controllers/settings.py
"""
REST Settings controler
Settings are broken into named groups
These groups of settings can be view/editied using standard REST calls
The principle is that each settings has a validator associated with it
Only the form fields that are sen... | |
the hash values for those files. If the
build source came in a single package such as a gzipped tarfile
(`.tar.gz`), the `FileHash` will be for the single path to that file.
Messages:
AdditionalProperty: An additional property for a FileHashesValue object.
Fields:
additionalProperties: Additional properties of ... | |
<gh_stars>100-1000
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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
#
# U... | |
import rlkit.torch.pytorch_util as ptu
from rlkit.envs.blocks.mujoco.block_pick_and_place_v2_retry import BlockPickAndPlaceEnv
from rlkit.launchers.launcher_util import run_experiment
import numpy as np
from torch.distributions import Normal
import pickle
import torch
import torch.nn as nn
from argparse import Argument... | |
# Copyright (c) 2017 The Khronos Group Inc.
# Modifications Copyright (c) 2017-2019 Soft8Soft LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... | |
<filename>plonetheme/zopeorg/setuphandlers.py
# -*- coding: utf-8 -*-
import collective.setuphandlertools as sht
import logging
logger = logging.getLogger("plonetheme.zopeorg")
def setup_content(context):
if sht.isNotThisProfile(context, 'plonetheme.zopeorg_setup_content.txt'):
return
site = context.getSite()
sht... | |
= Constraint(expr= - m.b250 + m.b726 <= 0)
m.c1567 = Constraint(expr= - m.b251 + m.b727 <= 0)
m.c1568 = Constraint(expr= - m.b252 + m.b728 <= 0)
m.c1569 = Constraint(expr= - m.b253 + m.b729 <= 0)
m.c1570 = Constraint(expr= - m.b254 + m.b730 <= 0)
m.c1571 = Constraint(expr= - m.b255 + m.b731 <= 0)
m.c1572 = Constr... | |
d3, d2, d1 = sorted([d12, d23, d31])
rindex = np.floor(np.log(d2/min_sep) / bin_size).astype(int)
if rindex < 0 or rindex >= nrbins: continue
if [d1, d2, d3] == [d23, d31, d12]: ii,jj,kk = i,j,k
elif [d1, d2, d3] == [d23, d12, d31]: ii,jj,kk = i,k,j
elif [d1, d2, d3] == [d31, d12, d23]: ii,jj,kk = j,k,i
elif [d1... | |
self.params.forward_only:
# TODO(laigd): use the actual accuracy op names of the model.
header_str += '\ttop_1_accuracy\ttop_5_accuracy'
log_fn(header_str)
assert len(step_train_times) == self.num_warmup_batches
# reset times to ignore warm up batch
step_train_times = []
loop_start_time = time.time()
if (summar... | |
<reponame>sjanzou/pvlib-python<filename>pvlib/atmosphere.py
"""
The ``atmosphere`` module contains methods to calculate relative and
absolute airmass and to determine pressure from altitude or vice versa.
"""
from __future__ import division
from warnings import warn
import numpy as np
import pandas as pd
from pvlib... | |
<reponame>boshuda/comic-rack-scraper
'''
This module contains the ComicBook class, which represents a comic book
from ComicRack that we are scraping data into.
@author: <NAME>
'''
from dbmodels import IssueRef, SeriesRef
from pluginbookdata import PluginBookData
from time import strftime
from utils import s... | |
<reponame>Jeansding/Malaya<filename>malaya/summarize.py<gh_stars>1-10
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter('ignore')
import numpy as np
import re
import random
from scipy.linalg import svd
from operator import itemgetter
from sklearn.feature_extraction.text import TfidfVectorizer
... | |
<reponame>SamPaskewitz/statsrat
import numpy as np
import pandas as pd
import xarray as xr
from scipy import stats
from plotnine import *
import nlopt
def multi_sim(model, trials_list, par_val, random_resp = False, sim_type = None):
"""
Simulate one or more trial sequences from the same schedule with known parameter... | |
# coding: utf-8
# Copyright (c) 2016, 2022, 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. You may ch... | |
<reponame>domielias/PyQuery
from .settings import (
WHERE_SPECIAL_ARGUMENTS, AUTOMATIC_JOINS_PLACEHOLDER,
FIELD_FORMAT, SELECT_FORMAT, JOIN_CLAUSE_FORMAT, WHERE_CLAUSE_FORMAT, WHERE_AND_CONNECTOR_FORMAT,
WHERE_EQUAL_OPERATION_FORMAT, ORDER_BY_CLAUSE_FORMAT, ORDER_BY_ASC_FORMAT, ORDER_BY_DESC_FORMAT,
LIMIT_FORMAT,V... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import shutil
import os
import glob
import numpy as np
from astropy import log
from astropy.logger import AstropyUserWarning
from astropy.tests.helper import remote_data
import pytest
from stingray.lightcurve import Lightcurve
import hendrics as hen
from... | |
<reponame>nirvik/iWant<filename>iwant/core/protocols.py
from twisted.internet import reactor, defer
from twisted.internet.protocol import Protocol, ClientFactory, DatagramProtocol
import os
import progressbar
import math
import hashlib
import time
from struct import unpack, calcsize
from engine.fileindexer.piece import... | |
distribution on counts[i] trials with probability of
success probs[i].
"""
with ops.name_scope(name, "stateless_random_binomial",
[shape, seed, counts, probs]) as name:
shape = tensor_util.shape_tensor(shape)
probs = ops.convert_to_tensor(
probs, dtype_hint=dtypes.float32, name="probs")
counts = ops.convert_to... | |
#! /usr/bin/env python
#All Functions
import cv2
import numpy as np
import matplotlib.pyplot as plt
import math
#Select the Image Filename
#FILENAME = 'chessboard.png'
#FILENAME = 'chessboard.jpg'
#FILENAME = 'chessboard_skew.jpg'
#FILENAME = 'checkerboard2.png'
#FILENAME ='image.jpg'
#FILENAME = "lena1.png"
class ... | |
<filename>anhima/tree.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
This module provides some facilities for constructing and plotting trees. It
is mostly a wrapper around a very limited subset of functions from the R
`ape` package (Analyses of Phylogenetics and Evolution).
R must be installed, the `ape` R package must... | |
<reponame>lucasondel/amdtk
"""Implementation of the training agorithms for the phone loop."""
import os
import time
import pickle
import shutil
import random
from ipyparallel.util import interactive
import numpy as np
def acc_stats(stats_list):
"""Accumulate a list of sufficient statistics.
Parameters
---------... | |
return_list:
continue
for provide in package.provides:
provide_name, provide_cmp, provide_version = split_name_with_versioning(provide)
if provide_name != dep_name:
continue
if dep_cmp == "":
return_list.append(package)
elif (provide_cmp == "=" or provide_cmp == "==") and version_comparison(provide_version, ... | |
1),
(9, 19, 2, -3): (0, 1),
(9, 19, 2, -2): (0, 1),
(9, 19, 2, -1): (0, 0),
(9, 19, 2, 0): (0, 1),
(9, 19, 2, 1): (0, 1),
(9, 19, 2, 2): (0, 1),
(9, 19, 2, 3): (0, 1),
(9, 19, 2, 4): (0, 1),
(9, 19, 2, 5): (0, 1),
(9, 19, 3, -5): (0, 1),
(9, 19, 3, -4): (0, 1),
(9, 19, 3, -3): (0, 1),
(9, 19, 3, -2): (0, 1... | |
path["Games"].values():
if "Access Level" not in x:
x["Access Level"] = 0
if "Min" in path["Games"]["Allin"]:
path["Games"]["Allin"].pop("Min")
if "Max" in path["Games"]["Allin"]:
path["Games"]["Allin"].pop("Max")
for x in trash:
if x in path["System Config"]:
path["System Config"].pop(x)
fo... | |
"""
This module calculates corrections for the species listed below, fitted to the experimental and computed
entries given to the CorrectionCalculator constructor.
"""
import warnings
from collections import OrderedDict
from typing import Dict, List, Tuple, Union, Sequence
try:
import ruamel.yaml as yaml
except Impo... | |
<filename>projectFile.py
from flask_website import app
app.run(debug=True)
#!/usr/bin/env python
from flask_website import app
from flask_website.search import update_documentation_index
with app.test_request_context():
update_documentation_index()
import os
_basedir = os.path.abspath(os.path.dirname(__file__))
DE... | |
E501
if self.local_vars_configuration.client_side_validation and current_state not in allowed_values: # noqa: E501
raise ValueError("Invalid value for `current_state` ({0}), must be one of {1}".format(current_state, allowed_values)) # noqa: E501
self._current_state = current_state
@property
def link_rel_canonica... | |
nodeID:
logger.warning("Failed to generate stable node ID, returning empty string. If you see this message with a "
"work dir on a shared file system when using workers running on multiple nodes, you might "
"experience cryptic job failures")
if len(nodeID.replace('-', '')) < UUID_LENGTH:
# Some platforms (Mac) gi... | |
_execute_without_auto_scaling(
parallel_path,
function,
'parallel',
)
logger.info(
'*************** Finished parallel test cases ***************\n'
)
def _execute_function(function, result_dir, func_dep=None):
if func_dep:
func_dep = _get_dependency_function(func_dep)
# Deploy function
_deploy_function(
f... | |
import copy
import itertools
import logging
import os
import tempfile
import gzip
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
from kipoi_veff import BedOverlappingRg, SnvCenteredRg, ensure_tabixed_vcf
from kipoi_veff.scores import Logit, get_scoring_fns
from kipoi_veff.utils import select_from_d... | |
#!/usr/bin/env python
import re
from collections import namedtuple
from collections import OrderedDict
import json
Point = namedtuple('Point', ['x', 'y'])
Rect = namedtuple('Rect', ['ll', 'ur'])
Port = namedtuple('Port', ['port_nm', 'layer', 'rect'])
Blockage = namedtuple('Blockage', ['layer', 'rect'])
Terminal = nam... | |
import sys
sys.path.append('../')
import argparse
import datetime
import json
import os
import keras
import keras.backend as K
import tensorflow as tf
import numpy as np
import pandas as pd
import csv
import globals
from globals import BATCH_SIZE, IMG_HEIGHT, IMG_WIDTH, \
NUM_CHANNELS, NUM_CLASSES, EPOCHS, INPUT_SHAPE... | |
the possibilities:
# {mod, func, method, static_method, cls_method}
# -> {func, method, static_method, cls_method}
#
###############################################################################
# func 0
###############################################################################
def test_func_get_caller_info_0(ca... | |
already-present sequences are in the new segment
lmapping = [None] * len(conc)
rnew = []
for i in range(len(conc)):
j = align.find(conc.name(i), strict)
if j!=-1:
lmapping[i] = j
# checks the reverse (to find reciprocal matches when strict is false)
for i in range(len(align)):
j = conc.find(align.name(i), st... | |
town, Florida",1359),
("North River Shores CDP, Florida",3663),
("North Sarasota CDP, Florida",8997),
("North Weeki Wachee CDP, Florida",7853),
("Oak Hill city, Florida",1775),
("Oakland town, Florida",2953),
("Oakland Park city, Florida",44339),
("Oakleaf Plantation CDP, Florida",27252),
("Oak Ridge CDP, Florida",2371... | |
<reponame>ekkipermana/robotframework-test
"""PyAlaCarte and PyAlaMode editors."""
__author__ = "<NAME> <<EMAIL>>"
__cvsid__ = "$Id: editor.py 63478 2010-02-13 22:59:44Z RD $"
__revision__ = "$Revision: 63478 $"[11:-2]
import wx
from buffer import Buffer
import crust
import dispatcher
import editwindow
import frame
f... | |
<filename>typings/bl_ui/space_view3d.py
import sys
import typing
import bpy_types
import bl_ui.properties_grease_pencil_common
import bl_ui.space_toolsystem_common
class BoneOptions:
def draw(self, context):
'''
'''
pass
class ShowHideMenu:
bl_label = None
''' '''
def draw(self, _context):
'''
'''
pa... | |
model.with_bagua([optimizer], ...)
.. note::
Each process should be associated to a CUDA device using `torch.cuda.set_device()`,
before calling :meth:`init_process_group`. Otherwise you may encounter the
`fatal runtime error: Rust cannot catch foreign exceptions` error.
"""
global _default_pg
global _default_... | |
sym(str name, Sparsity sp, int p) -> [DM]
Create a vector of length p with with matrices with symbolic primitives of
sym(str name, int nrow, int ncol, int p) -> [DM]
Create a vector of length p with nrow-by-ncol symbolic primitives.
sym(str name, Sparsity sp, int p, int r) -> [[DM]]
Create a vector of length r of ... | |
"cash_book": self.cash_book.pk,
"type": "pp",
"supplier": self.supplier.pk,
"period": self.period.pk,
"ref": "payment",
"date": payment.date.strftime(DATE_INPUT_FORMAT),
"total": 500
}
)
data.update(header_data)
invoices_to_match_against_orig = invoices
invoices_as_dicts = [ to_dict(invoice) for invoice ... | |
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class indEntEd
class indEtt(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self):
self.original_tagname_ = None
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclas... | |
import discord
from discord.ext import commands
from . import utils
from .utils import data_type, wiki, checks, config, modding, token
import json
from bs4 import BeautifulSoup as BS
import re
import json
import traceback
from urllib.parse import quote
import hashlib
#==================================================... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
# | - Import Modules
import os
import re
import numpy as np
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
# __|
class PDOS_Plotting():
"""
"""
# | - PDOS_Plotting ***********************************
def __init__(self,
d... | |
'\U0001f50e',
'lock_with_ink_pen': '\U0001f50f',
'closed_lock_with_key': '\U0001f510',
'lock': '\U0001f512',
'unlock': '\U0001f513',
'heart': '\U00002764\U0000fe0f',
'orange_heart': '\U0001f9e1',
'money_with_wings': '\U0001f4b8',
'dollar': '\U0001f4b5',
'yen': '\U0001f4b4',
'euro': '\U0001f4b6',
'pound': '\U... | |
T_{f,in}
+ \\mathbf{a_{b}} \\mathbf{T_b}
Parameters
----------
m_flow_borehole : float or (nInlets,) array
Inlet mass flow rate (in kg/s) into the borehole.
cp_f : float or (nInlets,) array
Fluid specific isobaric heat capacity (in J/kg.degC).
nSegments : int
Number of borehole segments.
Returns
-------
a... | |
# -*- coding: utf-8 -*-
"""
Created on 2017/6/9
@author: MG
"""
import logging
import threading
import inspect
from ctp import ApiStruct, MdApi, TraderApi
import hashlib, os, sys, tempfile, time, re
from config import Config, PeriodType, PositionDateType
from backend.fh_utils import str_2_bytes, bytes_2_str
from dateti... | |
#!/usr/bin/python
#
# Copyright 2018, <NAME>
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaim... | |
"""
Group Configuration Tests.
"""
import json
from operator import itemgetter
from unittest.mock import patch
import ddt
from cms.djangoapps.contentstore.course_group_config import (
CONTENT_GROUP_CONFIGURATION_NAME,
ENROLLMENT_SCHEME,
GroupConfiguration
)
from cms.djangoapps.contentstore.tests.utils import Cou... | |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# import tensorflow as tf
# from tensorflow.keras import layers, optimizers
from matplotlib.pyplot import MultipleLocator
import os
from collections import defaultdict
# import __main__
# __main__.pymol_argv = ['pymol', '-qc']
# import pymol as pm
i... | |
# -- coding: utf-8 --
# Copyright 2018 <NAME> <<EMAIL>>
"""
Library to handle SPM data.
This is the core module of all images retrieved by SPM and ToF-SIMS.
"""
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.ndimage
import scipy.optimize
import skimage
import skimage.exposure
import ski... | |
array of all the missing fields')
errors_mapping[('MISSING_INFO', None)] = MissingInfo('User information is missing from the hash')
errors_mapping[('NOT_HASH', None)] = NotHash('The v parameter is not a JSON hash')
query_data = {
'api': self._api,
'url': '/link/sso',
'request_data': request_data,
'errors_mapping... | |
files found', file_pat
raise Exception("get_files: no image files found!")
db2.close()
#print "get_files| DONE with func"
return dict_files
def combine_cats(cats,outfile,search_params): #step2_sextract
'''inputs: cats,outfile,search_params
returns:
calls:
called_by: sextract'''
#cats = [{'im_type': 'DOMEFLAT... | |
value: `Distance`(metric=max_abs_diff)
:type: `Function`
termination_measure_value
see `termination_measure_value <TransferMechanism.termination_measure_value>`
:default value: 0.0
:type: ``float``
:read only: True
termination_threshold
see `termination_threshold <TransferMechanism.termination_threshold>`
... | |
# -*- coding: utf-8 -*-
from __future__ import print_function as _
from __future__ import division as _
from __future__ import absolute_import as _
import numpy as np
from ...commons import builtins
from ...commons.basic_graph_ops import disconnect_edge, connect_edge, \
delete_node, replace_node, connect_dests, topso... | |
<filename>ev3sim/attach_bot.py
import multiprocessing
import importlib
from os import getcwd
from queue import Empty, Queue as NonMultiQueue
import sys
from time import sleep
from unittest import mock
from ev3sim.constants import *
from ev3dev2 import Device, DeviceNotFound
cur_events = NonMultiQueue()
tick = 0
tick_r... | |
import docx
from docx.shared import Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH, WD_BREAK
from docx.shared import Cm
import os
import math
import pandas as pd
import numpy as np
import re
from datetime import date
import streamlit as st
import json
import glob
from PIL import Image
import smtplib
import docx2pdf
... | |
might thus contain extra 0s to make it
to the wanted length.
Remark: The cardinal is put to its real value with this constructor.
WARNING: This does not check the validity of the provided string. This might
create unexpected behaviour.
Args:
bstr (str): The binary string used to encode an element, must be mad... | |
<gh_stars>0
# MIT License
#
# Copyright (c) 2019 oval-group
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... | |
aug.augment_image(np.ones((100, 100, 3), dtype=np.uint8))
sums = np.sum(observed, axis=2)
values = np.unique(sums)
assert all([(value in values) for value in [0, 1, 2, 3]])
assert observed.shape == (100, 100, 3)
def test_per_channel_with_probability(self):
# test channelwise with probability
aug = iaa.MultiplyE... | |
# ******************************************************************************
# Copyright 2017-2018 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.... | |
48790: "4360 4450 4545",
48791: "4360 4450 4546",
48792: "4360 4451",
48793: "4360 4451 4520",
48794: "4360 4451 4521",
48795: "4360 4451 4522",
48796: "4360 4451 4523",
48797: "4360 4451 4524",
48798: "4360 4451 4525",
48799: "4360 4451 4526",
48800: "4360 4451 4527",
48801: "4360 4451 4528",
48802: "4360 ... | |
<reponame>arccode/factory
# Copyright 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests keyboard functionality.
Description
-----------
This test check basic keyboard functionality by asking operator to pre... | |
uint8_t ns3::Socket::GetIpv6HopLimit() const [member function]
cls.add_method('GetIpv6HopLimit',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6Tclass() const [member function]
cls.add_method('GetIpv6Tclass',
'uint8_t',
[],
is_const=True)
## so... | |
<gh_stars>10-100
import unittest
import numpy as np
from arrus.devices.device import Device
from arrus.tests.tools import mock_import
# Module mocks.
class Us4OEMMock:
pass
mock_import(
"arrus.devices.ius4oem",
IUs4OEM=Us4OEMMock
)
mock_import(
"arrus.devices.idbarLite",
DBARLite=None
)
mock_import(
"arrus.d... | |
#!/usr/bin/env python
"""A widget to display changing values in real time as a strip chart
Known issues:
Matplotlib's defaults present a number of challenges for making a nice strip chart display.
Here are manual workarounds for some common problems:
- Memory Leak:
Matplotlib 1.0.0 has a memory leak in canvas.draw(... | |
<reponame>abagusetty/Uintah
#!/usr/bin/env python3
import subprocess
import sys
import re
'''
upsDiff version 1.0 written by <NAME> on 2/15/19
This script compares two .ups files for differences based on XML paths. Input files are assumed to have valid XML syntax.
The XML paths of unique leaf nodes not found in ... | |
from itertools import product as it_product
from typing import List, Dict
import numpy as np
import os
import pandas as pd
from scipy.stats import spearmanr, wilcoxon
from provided_code.constants_class import ModelParameters
from provided_code.data_loader import DataLoader
from provided_code.dose_evaluation_class imp... | |
None], None, ), # 1
)
class ExecuteStatement_result(object):
"""
Attributes:
- success
"""
def __init__(self, success=None,):
self.success = success
def read(self, iprot):
if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
iprot.... | |
# -*- coding: utf-8 -*-
# vim:set et tabstop=4 shiftwidth=4 nu nowrap fileencoding=utf-8:
import unittest
from twisted.test.proto_helpers import StringTransport
from devicehive.gateway.binary import *
class PacketTests(unittest.TestCase):
def setUp(self):
self.pkt = Packet(PACKET_SIGNATURE, 2, 3, 4, '123')
de... | |
another factor of two?
i = es.countiter % N
try:
self._addstop('noeffectaxis',
np.sum(es.mean == es.mean + 0.1 * es.sigma *
es.sm.D[i] * es.sigma_vec.scaling *
(es.sm.B[:, i] if len(es.sm.B.shape) > 1 else es.sm.B[0])) == N)
except AttributeError:
pass
self._addstop('tolconditioncov',
opts['tolconditioncov'] ... | |
self.TXUF
self.RXDONE = RM_Field_FRC_SEQIEN_RXDONE(self)
self.zz_fdict['RXDONE'] = self.RXDONE
self.RXABORTED = RM_Field_FRC_SEQIEN_RXABORTED(self)
self.zz_fdict['RXABORTED'] = self.RXABORTED
self.FRAMEERROR = RM_Field_FRC_SEQIEN_FRAMEERROR(self)
self.zz_fdict['FRAMEERROR'] = self.FRAMEERROR
self.BLOCKERROR = RM... | |
str(iend)
end_seq = pysam.faidx(genome, end_coord)
if start_seq.split('\n')[1].upper() == 'CT': # 3' splice site AG on minus strand
count_minus += 1
intron_label_list.append('-')
elif start_seq.split('\n')[1].upper() == 'GT': # 5' splice site GT on plus strand
count_plus += 1
intron_label_list.appe... | |
import numpy as np
from scipy.interpolate import lagrange
import matplotlib.pyplot as plt
import random as rd
import tqdm.auto as tqn
from numba import njit
##pylint
@njit
def solve_hydro(K, n, h, dH, len_t_mesure, t_mesure, dz, nb_cel, alpha=0.7):
Ss = n / h
H_array = np.zeros((len_t_mesure, nb_cel), dtype=np.fl... | |
"""
Topology Graph
==============
"""
from functools import partial
import numpy as np
from stk.utilities import flatten
from ..construction_result import ConstructionResult
from ..construction_state import ConstructionState
from ..edge_group import EdgeGroup
from .implementations import _Parallel, _Serial
class T... | |
: float > 0
Precision of detecting whether frames belong in the same cluster
recall : float > 0
Recall of detecting whether frames belong in the same cluster
f : float > 0
F-measure of detecting whether frames belong in the same cluster
"""
validate_structure(reference_intervals, reference_labels,
estimated_in... | |
Number of classification classes.
pretrained : bool, default False
Whether to load the pretrained weights for model.
ctx : Context, default CPU
The context in which to load the pretrained weights.
root : str, default '~/.mxnet/models'
Location for keeping the model parameters.
"""
return get_densenet_cifar(clas... | |
(flow_out['var_value'] - flow_in['var_value'])
losses = losses.reset_index()
return losses
def aggregate_storage_capacities(oemoflex_scalars):
storage = oemoflex_scalars.loc[
oemoflex_scalars['var_name'].isin(['storage_capacity', 'storage_capacity_invest'])].copy()
# Make sure that values in columns used to gr... | |
<filename>kdcovid/search_tool.py
import csv
import pickle
import time
from string import punctuation
import re
import numpy as np
import sent2vec
import torch
from absl import logging
from nltk import word_tokenize
from nltk.corpus import stopwords
from spacy import displacy
from dateutil import parser as dateparser
... | |
<reponame>morales-gregorio/elephant
"""
Gaussian-process factor analysis (GPFA) is a dimensionality reduction method
[#f1]_ for neural trajectory visualization of parallel spike trains. GPFA
applies factor analysis (FA) to time-binned spike count data to reduce the
dimensionality and at the same time smoothes the resul... | |
<reponame>ryanhope2/scormcloud-api-v2-client-python
# coding: utf-8
"""
SCORM Cloud Rest API
REST API used for SCORM Cloud integrations.
OpenAPI spec version: 2.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
... | |
<gh_stars>1-10
__name__ = "ammolite"
__author__ = "<NAME>"
__all__ = ["PyMOLObject", "NonexistentObjectError", "ModifiedObjectError"]
import numbers
from functools import wraps
import numpy as np
import biotite.structure as struc
from .convert import convert_to_atom_array, convert_to_chempy_model
from .startup import ... | |
operation code
if len(writeByteList) == 0:
return self.Permute6309WriteLayouts(startAsm, layoutDict, writeByteList, 1)
# try out all possible permutations of byte writes
bFoundCandidates = False
for writeIdx in range(writeListLen):
writeByteCmd = writeByteList[writeIdx]
layoutDict[1].append(writeByteCmd)
newWri... | |
<filename>tests/tests/test_filetransfer.py
# Copyright 2021 Northern.tech AS
#
# 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... | |
ACUTE
'\u0152': b'\xea', # LATIN CAPITAL LIGATURE OE
'\u0153': b'\xfa', # LATIN SMALL LIGATURE OE
'\u0154': b'\xc2R', # LATIN CAPITAL LETTER R WITH ACUTE
'\u0155': b'\xc2r', # LATIN SMALL LETTER R WITH ACUTE
'\u0156': b'\xd0R', # LATIN CAPITAL LETTER R WITH CEDILLA
'\u0157': b'\xd0r', # LATIN SMALL LETTER R WITH ... | |
a = self.RPythonAnnotator()
s = a.build_types(f, [int])
assert s.knowntype == float
def test_r_uint(self):
def f(n):
return n + constant_unsigned_five
a = self.RPythonAnnotator()
s = a.build_types(f, [r_uint])
assert s == annmodel.SomeInteger(nonneg = True, unsigned = True)
def test_large_unsigned(self):
la... | |
the slugging
percentage. Percentage ranges from 0-1.
"""
return self._home_on_base_plus
@int_property_decorator
def home_pitches(self):
"""
Returns an ``int`` of the number of pitches the home team faced.
"""
return self._home_pitches
@int_property_decorator
def home_strikes(self):
"""
Returns an ``int``... | |
returned a token or ``None``
if no token was returned
"""
# hostname and username are not required for GSSAPI, but for SSPI
self._gss_host = hostname
self._username = username
if self._gss_srv_ctxt is None:
self._gss_srv_ctxt = gssapi.AcceptContext()
token = self._gss_srv_ctxt.step(recv_token)
self._gss_srv_ct... | |
args
reach_point_args = inspect.getfullargspec(ReachPoint).args
# create a list of input arguments from the columns in the row
input_args = []
for arg in reach_point_args[1:]:
if arg in row_dict.keys():
input_args.append(row_dict[arg])
else:
input_args.append(None)
# use the input args to create a new reach ... | |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 t... | |
mem[155] = 32'h5780;
mem[156] = 32'h5800;
mem[157] = 32'h5880;
mem[158] = 32'h5900;
mem[159] = 32'h5980;
mem[160] = 32'h5a00;
mem[161] = 32'h5a80;
mem[162] = 32'h5b00;
mem[163] = 32'h5b80;
mem[164] = 32'h5c00;
mem[165] = 32'h5c80;
mem[166] = 32'h5d00;
mem[167] = 32'h5d80;
mem[168] = 32'h5e00;
mem[169] = 3... | |
* d + b * c),
Int(S(1) / ((c + d * x ** S(2)) * sqrt(e + f * x ** S(2))), x),
x,
)
def replacement1005(c, d, e, f, x):
return Dist(
S(1) / c, Int(S(1) / (x ** S(2) * sqrt(e + f * x ** S(2))), x), x
) - Dist(d / c, Int(S(1) / ((c + d * x ** S(2)) * sqrt(e + f * x ** S(2))), x), x)
def replacement1006(a, b, c, ... | |
Ptr64 Void
# +0x1680 TlsLinks : _LIST_ENTRY
# +0x1690 Vdm : Ptr64 Void
# +0x1698 ReservedForNtRpc : Ptr64 Void
# +0x16a0 DbgSsReserved : [2] Ptr64 Void
# +0x16b0 HardErrorMode : Uint4B
# +0x16b8 Instrumentation : [14] Ptr64 Void
# +0x1728 SubProcessTag : Ptr64 Void
# +0x1730 EtwTraceData : Ptr64 Void
# +0x1738... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.