input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
stores whether the interval just started "
"(>0 value) or ended (<0 value). Different interval types can be represented in "
"the same series by using multiple key values (eg, 1 for feature A, 2 for feature "
"B, 3 for feature C, etc). The field data stores an 8-bit integer. This is largely "
"an alias of a standar... | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
"""
BLIS - Balancing Load of Intermittent Solar:
A characteristic-based transient power plant model
Copyright (C) 2020. University of Virginia Licensing & Ventures Group (UVA LVG). All Rights Reserved.
Permission is hereby granted, free ... | |
<filename>generated/intermediate/ansible-module-rest/azure_rm_frontdoor.py
#!/usr/bin/python
#
# Copyright (c) 2019 <NAME>, (@zikalino)
#
# 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__ = ... | |
<gh_stars>0
"""DICOM structured reporting content item value types."""
import datetime
from typing import Any, List, Optional, Sequence, Union
import numpy as np
from pydicom.dataset import Dataset
from pydicom.sequence import Sequence as DataElementSequence
from pydicom.sr.coding import Code
from pydicom.uid import U... | |
import typesystem
import warnings
import graphviz
from collections import defaultdict
class Atom(object):
def __init__(self):
super(Atom, self).__init__()
self.sync = dict()
self.expects = set()
def get_nullable(self):
return None
def get_sync(self):
return self.sync
def __repr__(self):
return self.name
... | |
An System.EventArgs that contains the event data.
"""
pass
def PerformClick(self):
"""
PerformClick(self: ToolStripItem)
Activates the System.Windows.Forms.ToolStripItem when it is clicked with the mouse.
"""
pass
def ProcessCmdKey(self,*args):
"""
ProcessCmdKey(self: ToolStripItem,m: Message,ke... | |
# Variables
When programming in Python, you'll become very comfortable with creating variables. This is because *everything* in Python is implemented as an **object**. This means that whether you're working wither numbers, words, or booleans (we'll talk about these soon!, you're working with object.s These objects are... | |
["r",
"s",
"m",
"n",
"page_size",
"page_margin",
"cam_reso",
"cap_area",
"m5_size",
"printer",
"dpi",
"num_win",
"ia_id",
"true_pos",
"true_x",
"true_y",
"true_pos_dist",
"index",
"dbt_positions",
"dbt_pos",
"dbt_x",
"dbt_y",
"real_positions",
"real_pos",
"real_x",
"real_y",
"matching_indices"... | |
name='Z')
y = _convert_to_double(np.asarray(y, order='c'))
if y.ndim == 1:
distance.is_valid_y(y, throw=True, name='y')
[y] = _copy_arrays_if_base_present([y])
elif y.ndim == 2:
if y.shape[0] == y.shape[1] and np.allclose(np.diag(y), 0):
if np.all(y >= 0) and np.allclose(y, y.T):
_warning('The symmetric non-n... | |
__ne__(self, other):
return not (self == other)
class getAllContactIdsForChannel_result(object):
"""
Attributes:
- success
- e
"""
def __init__(self, success=None, e=None):
self.success = success
self.e = e
def read(self, iprot):
iprot.readStructBegin()
while True:
(fname, ftype, fid) = iprot.readFieldBe... | |
"""PUMA Noise simulator
Follows https://arxiv.org/abs/1810.09572.
Includes a general RadioTelescope class that defines a telescope in terms
of various dish, packing, and instrumental noise properties, as well as
instances of this class for the full and petite configurations of PUMA
(see https://arxiv.org/abs/1907.125... | |
<gh_stars>10-100
# Copyright 2014 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 agreed to ... | |
const &
e3: SimTK::Vec< 2,SimTK::Vec< 3,double,1 > >::E const &
e4: SimTK::Vec< 2,SimTK::Vec< 3,double,1 > >::E const &
e5: SimTK::Vec< 2,SimTK::Vec< 3,double,1 > >::E const &
e6: SimTK::Vec< 2,SimTK::Vec< 3,double,1 > >::E const &
e7: SimTK::Vec< 2,SimTK::Vec< 3,double,1 > >::E const &
e8: SimTK::Vec< 2,SimTK::V... | |
will use its already trained convolutional layers and
# adapt (i.e., train) the classification head.
#
# ### Load pre-trained network
# We will load the ResNet50 model. The first time, this might take a few (~5) minutes.
# Afterwards, we will [freeze its convolutional layers](https://github.com/keras-team/keras/issues... | |
edge, reverse=False):
if reverse:
return self.follow_highest_width_path(G, (edge[1], edge[0]))
u, v = edge
visited = set([u])
path = [u]
path_edges = [(u, v)]
while True:
path.append(v)
visited.add(v)
a, b = path_edges[-1]
cur_width = G[a][b]['conductivity']
nexts = sorted([(G[v][n]['conductivity'], n)... | |
<reponame>hiimmuc/Speaker-verification<filename>models/ECAPA_TDNN.py
import torch # noqa: F401
import torch.nn as nn
import torch.nn.functional as F
from models.ECAPA_utils import Conv1d as _Conv1d
from models.ECAPA_utils import BatchNorm1d as _BatchNorm1d
from utils import PreEmphasis
import torchaudio
class ... | |
"umy.kr",
"uncond.us",
"undeva.net",
"unicorntoday.com",
"unicredit.tk",
"unif8nthemsmnp.cf",
"unif8nthemsmnp.ga",
"unif8nthemsmnp.gq",
"unif8nthemsmnp.ml",
"unif8nthemsmnp.tk",
"unite.cloudns.asia",
"unixproject.ru",
"unmail.ru",
"unpastore.co",
"unseen.eu",
"uny.kr",
"uo8fylspuwh9c.cf",
"uo8fylspuwh9... | |
not found or empty in attributes and cannot be determined by any \"{}\"".format(id_key,
xid_key))
return ogit_id
@staticmethod
def get_and_check(attributes: dict, key: str, name: str = 'attributes') -> Any:
"""
Raise ValueError when key is not in attributes or the value behind the key is empty.
:param attribu... | |
self.strvReleaseEPB.set("释放电子卡钳")
self.btnReleaseEPB = ttk.Button(self.frameesc, textvariable=self.strvReleaseEPB, command=self.BtnReleaseEPB_Click)
self.btnReleaseEPB.grid(row=2, column=0, padx=3, pady=3)
self.btnReleaseEPB["state"] = tk.DISABLED
self.strvApplyEPB = tk.StringVar()
self.strvApplyEPB.set("夹紧电子卡钳")... | |
import unittest
import pandas as pd
import numpy as np
from utils import prepare_data
import models
import random
import scipy.signal
from typing import List
from analytic_types.segment import Segment
class TestDataset(unittest.TestCase):
def test_models_with_corrupted_dataframe(self):
data = [[1523889000000 + i,... | |
num_plots: number of plots
:param num_cols: number of columns to use in the subplot
:param y_scale: the height of each plot. If `None`, the size of the whole
figure equals the default `figsize`
:param sharex: unify x-axis if True
:param sharey: unify y-axis if True
:param exclude_empty: whether to exclude plots o... | |
<reponame>gargrohin/argoverse-api<filename>tests/test_eval_stereo.py<gh_stars>100-1000
# <Copyright 2021, Argo AI, LLC. Released under the MIT license.>
"""Stereo evaluation unit tests."""
import math
from pathlib import Path
from argoverse.evaluation.stereo.constants import DEFAULT_ABS_ERROR_THRESHOLDS, DEFAULT_REL_... | |
self.rect.y == 64 or self.rect.y == (HEIGHT - 256):
if self.direction == 1:
self.direction = 3
elif self.direction == 2:
self.direction = 4
elif self.direction == 3:
self.direction = 1
elif self.direction == 4:
self.direction = 2
self.timer += 1
else:
self.vx, self.vy = 0, 0
if self.wait != 50:... | |
getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def resume_audit_trail_and_wait... | |
self.assertDataSent("ProductID", self.PRODUCT_ID)
def test_passed_new_stock_level_is_sent(self):
"""Test the passed new stock level is sent."""
self.assertDataSent("newStockLevel", self.NEW_STOCK_LEVEL)
def test_passed_old_stock_level_is_sent(self):
"""Test the passed old stock level is sent."""
self.assertData... | |
from unittest import TestCase
from azure.mgmt.compute.models import OperatingSystemTypes
from mock import MagicMock
from mock import Mock
from cloudshell.cp.azure.domain.services.network_service import NetworkService
from cloudshell.cp.azure.domain.services.storage_service import StorageService
from cloudshell.cp.azu... | |
#Image Registration Functions
#<NAME>
import matplotlib.pyplot as plt
import numpy as np
import sys
import time
import os
import re
import nibabel as nib
from pathlib import Path
import pandas as pd
import shutil
import glob
import fileinput
import cv2
from joblib import Parallel, delayed
from numba import njit, prang... | |
# Copyright 2016 The Eyra Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
<reponame>semaphoreP/EXOSIMS<gh_stars>0
# -*- coding: utf-8 -*-
from EXOSIMS.util.vprint import vprint
from EXOSIMS.util.eccanom import eccanom
from EXOSIMS.util.get_dirs import get_cache_dir
from EXOSIMS.util.get_dirs import get_downloads_dir
import numpy as np
import astropy.units as u
import astropy.constants... | |
<reponame>agilescientific/welly<gh_stars>1-10
"""
Defines a multi-well 'project'.
:copyright: 2021 Agile Scientific
:license: Apache 2.0
"""
from __future__ import print_function
import glob
from collections import Counter
from urllib.parse import non_hierarchical
import warnings
import numpy as np
import pandas as ... | |
import json
import urllib
from unittest import skipIf
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry, Polygon
from django.test import TestCase
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from .models import Location
from .... | |
not seem a route: {}'.format(relation)
)
master_tags = {} if not master else master['tags']
self.city = city
self.element = relation
self.id = el_id(relation)
if 'ref' not in relation['tags'] and 'ref' not in master_tags:
city.notice('Missing ref on a route', relation)
self.ref = relation['tags'].get(
'ref', m... | |
asset information."""
return self.__strategy_description
@strategy_description.setter
def strategy_description(self, value: str):
self._property_changed('strategy_description')
self.__strategy_description = value
@property
def targeted_gross_exposure(self) -> NumberRange:
"""Value of a fund's long positions ... | |
FW_IV = [0x42,0xea,0xff,0xf7,0x7c,0xc2,0x4f,0x2b,0x9b,0xc9,0x9d,0xe0,0x5c,0xba]
# FwVersion: 1.1.18;p:HillstarV01;DSP:ID9000r2151;i:B;f:22500;nMsg;s:Rel_1r1223:MO;c:JKS;t:2014/05/20 15:37:05;
FW_VERSION = [0x31,0x2e,0x31,0x2e,0x31,0x38,0x3b,0x70,0x3a,0x48,0x69,0x6c,0x6c,0x73,0x74,0x61,
0x72,0x56,0x30,0x31,0x3b,0... | |
= "normal")
self.info_label.config(text = "Transmission fake GPS signal.")
try:
self.attack_button.config(text = "Stop attack", image = self.attack_button_stop_icon, command = lambda: self.stop_attack())
except: #If icon not found
self.attack_button.config(text = "Stop attack", command = lambda: self.stop_attack()... | |
___ ___ _____ ___ _____ ___ __ __ ___ _____ _ _ ___ ___ ___
# | _ \ _ \_ _\ \ / /_\_ _| __| | \/ | __|_ _| || |/ _ \| \/ __|
# | _/ /| | \ V / _ \| | | _| | |\/| | _| | | | __ | (_) | |) \__ \
# |_| |_|_\___| \_/_/ \_\_| |___| |_| |_|___| |_| |_||_|\___/|___/|___/
#
# -----------------------------------------... | |
np.prod([N.ten.shape[i] for i in N.legs[2]])
n4 = np.prod([N.ten.shape[i] for i in N.legs[3]])
Nmat = N.backend.reshape(N.ten,(n1*n2,n3*n4))
u,v = N.backend.eigh(Nmat)
u = pos_sqrt_vec(u)
Nmat = N.backend.einsum('ij,j,kj->ik',v,u,v)
N.ten = Nmat.reshape(N.shape)
N = N.transpose([0,2,1,3])
else:
N = N.copy().tr... | |
rules with that table in head
self.contents = {}
if rules is not None:
for rule in rules:
self.insert(rule)
############### External Interface ###############
# SELECT implemented by TopDownTheory
def insert(self, rule):
changes = self.update([Event(formula=rule, insert=True)])
return [event.formula for eve... | |
"name": "lcmp",
"description": "Compare two longs",
"inputs": [OperandType.Long, OperandType.Long],
"outputs": [OperandType.Integer],
},
0x95: {
"name": "fcmpl",
"description": "Compare two floats",
"inputs": [OperandType.Float, OperandType.Float],
"outputs": [OperandType.Integer],
},
0x96: {
"name": "fcmpg... | |
ConstSpiceChar * str2, ConstSpiceChar * str3, ConstSpiceChar * str4)"""
return _cspyce0.spkezr_vector(str1, in11, str2, str3, str4)
def spkgeo(targ, et, CONST_STRING, obs):
"""spkgeo(SpiceInt targ, SpiceDouble et, ConstSpiceChar * CONST_STRING, SpiceInt obs)"""
return _cspyce0.spkgeo(targ, et, CONST_STRING, obs)
d... | |
to the master mix manually, i.e.,
self.master_mix.append(material)
after whatever check is required to avoid duplications.
Returns 0 if the material was added successfully; returns 1 if an
identical material was already in this EchoRun object's material list,
so the new material was not added.
'''
if material... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 25 17:36:52 2020
@author: bankslabHP
"""
"""
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2020 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License ... | |
<gh_stars>10-100
del_items(0x801384E4)
SetType(0x801384E4, "void GameOnlyTestRoutine__Fv()")
del_items(0x801384EC)
SetType(0x801384EC, "int vecleny__Fii(int a, int b)")
del_items(0x80138510)
SetType(0x80138510, "int veclenx__Fii(int a, int b)")
del_items(0x8013853C)
SetType(0x8013853C, "void GetDamageAmt__FiPiT1(int i,... | |
in output file.
0 - empty file, -1 - write error
"""
r1 = qfile.write("Line 1\n")
r2 = qfile.write("Line 2\n!")
return 2 # two lines
def create_func_frame(self, func_ea):
"""
Create a function frame for a newly created function.
Set up frame size, its attributes etc.
"""
return False
def is_far_jump(self,... | |
# Databricks notebook source
# MAGIC %md
# MAGIC # Finding similar items + HPO
# COMMAND ----------
# MAGIC %md
# MAGIC This notebook follows a similar structure to the temporal holdout one, but uses aws-sims instead of HRNN. We look at the similar items found, and see if HPO helps improve things.
# COMMAND --------... | |
<filename>assignment/assignment1/main/mc/parser/.antlr/MCParser.py
# Generated from /home/kraken/ppl-course/assignment/assignment1/main/mc/parser/MC.g4 by ANTLR 4.7.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
bu... | |
context.full_backup_timestamp
dir = "%s/db_dumps/%s" % (path, context.backup_subdir)
cleanup_cmd = "rm -f %s/%s" % (dir, file_pattern)
run_command(context, cleanup_cmd)
if context.exception:
raise context.exception
@given('there are no backup files')
@then('there are no backup files')
@when('there are no backup ... | |
tags:
comment = ', '.join(map(str, value[1]))
if comment > 0:
comment = "#" + comment
file_contents.append(tags + ":" + manifest_hash + comment + "\n")
file_contents.sort()
with open(image_tag_to_hash, 'w') as file_pointer:
for val in file_contents:
file_pointer.write(val)
def update_dicts_for_multiple_tags(h... | |
the top.
'olympia.amo.middleware.NonAtomicRequestsForSafeHttpMethodsMiddleware',
# Test if it's an API request first so later middlewares don't need to.
'olympia.api.middleware.IdentifyAPIRequestMiddleware',
# Gzip (for API only) middleware needs to be executed after every
# modification to the response, so it's p... | |
<gh_stars>1-10
import sys
import typing
import bpy_types
import bl_ui.space_toolsystem_common
import bl_ui.properties_grease_pencil_common
import rna_prop_ui
class SEQUENCER_HT_header(bpy_types.Header, bpy_types._GenericUI):
bl_rna = None
''' '''
bl_space_type = None
''' '''
id_data = None
''' '''
def appen... | |
self.chi0_ratio = self.chi0_ratio * np.ones(ndm)
else:
self.chi0_ratio = self.dmisfit.multipliers
m = self.invProb.model
dm_eigenvalue_list = []
for j, dm in enumerate(self.dmisfit.objfcts):
dm_eigenvalue_list += [eigenvalue_by_power_iteration(dm, m)]
self.chi0 = self.chi0_ratio / np.r_[dm_eigenvalue_list]
s... | |
be sampled several times).
Returns:
list of Kabsch RMSDs
"""
distances = self._randomized_rmsd(
self.structure_list, self.structure_list, iterations, self.njobs
)
return distances
@staticmethod
def _properties_test_statistics(property_list):
"""
Returns various descriptive statistics for an array.
Inspire... | |
1.0 5.0
.. ... ... ... ... ... ...
69 VPGS5 0 5.0 3.0 0.0 49.0
70 VPGS6 0 5.0 3.0 0.0 49.0
71 W/HOE#1 0 5.0 0.0 0.0 160.0
72 W/HOE#2 0 5.0 0.0 0.0 160.0
73 YABULU 0 5.0 6.0 6.0 83.0
<BLANKLINE>
[74 rows x 6 columns]
Returns
-------
pd.DataFrame
================ ========================================
Co... | |
if created:
return None
if parent.id == sub.id:
return {"Error": _("Cycle detected.")}
'''
Look for parent->child connection in all relationships except the relationship that is
attempting to be added; because it's ok to re-add the relationship
'''
relationships = ['success_nodes', 'failure_nodes', 'always_no... | |
import types
import types
import hashlib
import json
import os
import shutil
import tempfile
import subprocess
from cairio import client as ca
import inspect
from subprocess import Popen, PIPE
import shlex
import time
import sys
import multiprocessing
import random
import fnmatch
def sha1(str):
hash_object = hashlib... | |
<reponame>rswgnu/rsw_interface
# FILE: interface.py
#
# SUMMARY: Inheritable class interface/protocol support for Python; implements class `Interface' and conformance functions
# USAGE: from interface import *; inherit from `Interface'; call one of the conformance functions described below
# KEYWORDS: interface, utilit... | |
<reponame>penglecn/ChiaTools
import psutil
from PyQt5.QtWidgets import QWidget, QTreeWidgetItem, QHeaderView, QProgressBar, QMessageBox, QMenu, QFileDialog
from PyQt5.Qt import QBrush, QColor, QModelIndex, QTimerEvent, QCursor
from PyQt5.QtCore import Qt
from ui.PlotWidget import Ui_PlotWidget
from config import save_c... | |
<reponame>pyansys/openapi-common
import datetime
import mimetypes
import json
import os
import re
import tempfile
from types import ModuleType
from dateutil.parser import parse
from typing import Dict, Union, List, Tuple, Type, Optional, Any, Callable
from urllib.parse import quote
import requests
from requests.struc... | |
# -*- encoding: utf-8 -*-
"""
tests.help.test_ogling module
"""
import pytest
import os
import logging
from hio import hioing
from hio import help
from hio.help import ogling
def test_openogler():
"""
Test context manager openOgler
"""
# used context manager to directly open an ogler Because loggers are singl... | |
<gh_stars>1-10
"""
Perform standard denoising (not TE-dependent denoising).
Methods:
- Global signal regression with custom code
(integrated in tedana, but we do it separately here because the approach is very different)
- Dynamic global signal regression with rapidtide
- aCompCor with custom code
- GODEC with the ME... | |
odometry set, seq. 8 is not available in the raw data
frame_min_max_sequence = [[0, 270],
[0, 2760],
[0, 1100],
[0, 1100],
[1100, 5170],
[0, 1590],
[0, 1200],
[0, 4540],
[0, 4660],
[0, 1100]]
# get the poses from file
for min_max, file in zip(frame_min_max_sequence, files):
for i in range(min_max[0], min_m... | |
the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
type(client.transport.create_consumer_override),
'__call__') as call:
# Designate an appropriate return value for the call.
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
operations_pb2.Operation(name='operations/spam'... | |
"Unusual workflows or design decisions for others to watch out for."
),
)
training_materials = CharField(
label="Training materials",
required=False,
help_text=(
"Where to find training materials or other relevant resources."
),
)
partner_comments = CharField(
label="Partner Comments",
widget=forms.Textarea... | |
<reponame>tgbugs/mlab
#TODO FIXME there are three things that are trying to go on here
#1) easy way to create the steps of an experiment
#2) easy way to create the datasources for an experiment
#3) bind the result to an object
#compatability between the three breaks down when:
#the datasource specified by 2 is not 1:1 ... | |
<gh_stars>10-100
import math
import numpy as np
import torch
from torch import nn as nn
from torch.nn import functional as F
from lib.mutables.spaces import OperationSpace
from .base_mutator import BaseMutator
from .default_mutator import Mutator
__all__ = [
'ProxylessMutator',
]
def detach_variable(inputs):
"... | |
<reponame>hopelife/mstb
import os, sys
import configparser
import win32com.client
import pythoncom
from datetime import datetime
import time
class XASession:
#로그인 상태를 확인하기 위한 클래스변수
login_state = 0
def OnLogin(self, code, msg):
"""
로그인 시도 후 호출되는 이벤트.
code가 0000이면 로그인 성공
"""
if code == "0000":
print(code, msg)... | |
#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
##
# 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 yo... | |
0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, -2, 2, 0, 2, 0, 0, 0, 0,
0, 0, -2, 0, 0, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, 0, -2]
cosine_coefficients = \
[-20905355, -3699111, -2955968, -569925, 48888, -3149,
246158, -152138, -170733, -204586, -129620, 108743,
104755, 10321, 0, 79661, -34782, -23210, -2163... | |
params += ['--no-install-server-wide-first']
if no_update_module_list:
params += ['--no-update-modulelist']
if no_dangling_check:
params += ['--no-dangling-check']
if i18n:
params += ['--i18n']
if not tests:
params += ['--no-tests']
if server_wide_modules:
params += ['--server-wide-modules', server_wide_modul... | |
<ydk.models.cisco_ios_xr.Cisco_IOS_XR_ipv4_acl_datatypes.Ipv4AclPortNumberEnum>`
----
**type**\: int
**range:** 0..65535
----
.. attribute:: source_operator
Source comparison operator . Leave unspecified if no source port comparison is to be done
**type**\: :py:class:`Ipv4AclOperatorEnumEnum <ydk... | |
<gh_stars>1-10
"""
Computes the necessary conditions of optimality using Bryson & Ho's method
[1] Bryson, <NAME>. Applied optimal control: optimization, estimation and control. CRC Press, 1975.
"""
import functools as ft
import itertools as it
import simplepipe as sp
import sympy
import re as _re
import numpy
np = nu... | |
from ..parser import ast
from .definitions import GenericType
from .generics import TypeVisitor
from .generics import add_generic_class
from .generics import fix_chosen_types
from .generics import replace_generic_types
from .utils import BUILTIN_CALLS
from .utils import BUILTIN_ERRORS
from .utils import BYTES_METHODS
f... | |
in prisms:
if prism is None or ('density' not in prism.props and dens is None):
continue
if dens is None:
density = prism.props['density']
else:
density = dens
x1, x2 = prism.x1, prism.x2
y1, y2 = prism.y1, prism.y2
z1, z2 = prism.z1, prism.z2
_prism.gyz(xp, yp, zp, x1, x2, y1, y2, z1, z2, density, res)
res ... | |
import pandas as pd
import numpy as np
# makes multiple instances of the object available.
from logistics.plugins.metaclass import Meta
# imports all data types.
from logistics.plugins.types import *
# stores menu options over functions and class methods for listing.
class Record(metaclass = Meta):
# initializes ... | |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
<filename>indi_mr/i_to_m.py
"""Defines blocking function inditomqtt:
Receives XML data from indiserver on port 7624 and publishes via MQTT.
Receives data from MQTT, and outputs to port 7624 and indiserver.
"""
import sys, collections, threading, asyncio
from time import sleep
from datetime import datetime
imp... | |
# -*- coding: utf-8 -*-
# -*- coding: utf8 -*-
"""Autogenerated file - DO NOT EDIT
If you spot a bug, please report it on the mailing list and/or change the generator."""
from nipype.interfaces.base import (
CommandLine,
CommandLineInputSpec,
SEMLikeCommandLine,
TraitedSpec,
File,
Directory,
traits,
isdefined,... | |
will be traversed in
row-major order in order to bound the size of the output buffer to the tile
size. The tile size on y must be larger than the latency of addition for
the given data type.
This expansion supports both transposed A and non-transposed A, but
vectorization is only implemented for transposed A.
""... | |
op1 = operands[0].dec
op2 = operands[1].dec
exact = getattr(op1, funcname)(op2, context=self.maxctx)
# cdecimal's rounded result
s = str(result.mpd)
rounded = decimal.Decimal(s)
self.ulpdiff += 1
return self.check_ulpdiff(exact, rounded)
def resolve_underflow(self, result):
"""In extremely rare cases where ... | |
"stepping": "3",
"mhz": "3419.000",
"cache_size": "6144 KB",
"physical_id": "0",
"core_id": "2",
"cores": "4",
"flags": [
"fpu",
"vme",
"de",
"pse",
"tsc",
"msr",
"pae",
"mce",
"cx8",
"apic",
"sep",
"mtrr",
"pge",
"mca",
"cmov",
"pat",
"pse36",
"clflush",
"dts",
"acpi",
"mmx",
"fxsr",
"sse"... | |
= okey = None
for line in result.replace("\r\n", "\n").split("\n"):
# Found new item
if "--------" in line:
if keychain_data:
keychain_data[key] = self._translate_keychain_value(
"\n".join(value.split("\n")[:-2]))
keychain += [keychain_data]
keychain_data = {}
key = value = okey = None
# Look for new key
f... | |
self.job_type2.name,
'job_type_version': self.job_type2.version,
'job_type_revision': self.job_type2.revision_num}}}}
json_data = {
'name': 'not-a-name',
'definition': new_definition
}
url = '/%s/recipe-types/validation/' % self.api
response = self.client.generic('POST', url, json.dumps(json_data), 'applicati... | |
the rest of the pipelines
ids: dict Dictionary of fileStore IDS
input_args: dict Dictionary of input arguments
sample: tuple Contains uuid and sample_url
"""
if len(sample) == 2:
uuid, sample_location = sample
url1, url2 = None, None
else:
uuid, url1, url2 = sample
sample_location = None
# Update values uni... | |
<gh_stars>1-10
# Deep Sparse Representation-based Classification
# https://arxiv.org/abs/1904.11093
# <NAME>
# <EMAIL>
# Built upon https://github.com/panji1990/Deep-subspace-clustering-networks
# and https://github.com/mahdiabavisani/Deep-multimodal-subspace-clustering-networks
#
# Citation: <NAME> and <NAME>, "Deep s... | |
value=0.0, tags=tags101 + ['port:eth101/1/22'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth101/1/23'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, tags=tags101 + ['port:eth101/1/24'], hostname=hn101)
aggregator.assert_metric(metric_name, value=0.0, ... | |
for atom in [atom1, atom2]:
if atom not in self._atomset:
raise ValueError("No such atom in contact map: {0}".format(atom))
self._connect(atom1, atom2)
def _connect(self, atom1, atom2):
if atom1 not in self._map:
self._map[atom1] = set()
self._map[atom1].add(atom2)
if atom2 not in self._map:
self._ma... | |
"""Copyright (c) 2020 <NAME>"""
import os
import math
import copy
import torch
from torch import nn, einsum
import torch.nn.functional as F
from inspect import isfunction
from functools import partial
from torch.utils import data
from pathlib import Path
from torch.optim import Adam
from torchvision import transforms... | |
<reponame>makinacorpus/makina-states
# -*- coding: utf-8 -*-
'''
.. _module_mc_utils:
mc_utils / Some usefull small tools
====================================
'''
# Import salt libs
from pprint import pformat
import copy
import cProfile
import crypt
import collections
import datetime
import traceback
import socket... | |
import torch
import torch.nn.functional as F
from einops import rearrange
def time_to_frames(time, frame_hz):
if isinstance(time, list):
time = torch.tensor(time)
frame = time * frame_hz
if isinstance(frame, torch.Tensor):
frame = frame.long().tolist()
else:
frame = int(frame)
return frame
def frame2time... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import xdo
import time
import pyspiel
import argparse
import datetime
import numpy as np
from tqdm import tqdm
from dependencies.open_spiel.python import policy
from dependencies.open_spie... | |
while (ser.inWaiting()): bgapi_parse_csv(ord(ser.read()));
# else:
# if options.quiet and options.friendly and options.csv :
# while (ser.inWaiting()): bgapi_parse_csv(ord(ser.read()));
# else:
# while (ser.inWaiting()): bgapi_parse(ord(ser.read()));
while (ser.inWaiting()): bgapi_parse_plot(ord(ser.read()));
... | |
two symmetries, test that both do not exist in the
# subgroup of the other
sym1 = all_symmetries
# identify place in list by name, cannot test symmetry directy as D3
# and D3x are the same and causes an index issue
i = [s.name for s in _groups].index(sym1.name)
if i + 1 < len(_groups):
values = []
# only test s... | |
<filename>ingestion/tasks.py
import concurrent.futures
import datetime
import pymongo
import urllib.request
from common import database as db, util
from ingestion import config, manager as mgr
from ingestion.datasources import reddit, twitter, cryptocompare as cc, coinmarketcap as cmc, stocktwits as st
from ingestion ... | |
q/(1.+q)
mB = 1./(1.+q)
# Get mesh grid on bottom plane to generate waveform
sph_gridX, gridX, sph_gridY, gridY, sph_gridZ, gridZ \
= get_grids_on_planes(11, max_range)
# evaluate remnant fit
fit_name = 'surfinBH7dq2'
fit = surfinBH.LoadFits(fit_name)
# If omega_ref is None, will assume the spins are given i... | |
from rif to lag member
total_changing_ports = 15
#the first port that will start as rif, that means that the first iteratio will only have port #1
first_changing_port = 2
total_dst_port = 16
v4_enabled = 1
v6_enabled = 1
ip_mask = '255.255.0.0'
addr_family = SAI_IP_ADDR_FAMILY_IPV4
lag_members = []
nhop_group... | |
self.sl_mid.grid(column=0, row=3)
self.slider_mid.set((self.slider_max.get() - self.slider_min.get()) / 2)
else:
norm = None
self.sl_mid.grid_forget()
cmapa = cm.get_cmap(self.colormap.get())
cmapa.set_bad(color="0.75")
cmapa.set_over(color="black")
cmapa.set_under(color="white")
heatmap = self.aplot.pcolorfas... | |
# -*- coding: utf-8 -*-
# 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 agr... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 19 11:23:03 2021
Authors: <NAME>, <NAME>, and <NAME>
E-Mails: {aand17, mvejli17, <EMAIL>
In this module the main functionality supporting the use of seasonal
autoregressive integrated moving average models as described in the report
Forecasting Wind Power Production
-... | |
import abc
import inspect
import itertools
import functools
import os
import uuid
import warnings
from abc import abstractmethod
from contextlib import contextmanager
import mlflow
from mlflow.entities.run_status import RunStatus
from mlflow.tracking.client import MlflowClient
from mlflow.utils import gorilla
from mlf... | |
#################################################################################
#-------------------------------------------------------------------------------#
# LAVAKA VOLUME DETERMINATION
#-------------------------------------------------------------------------------#
##################################... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.