input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
pins for the tile
print()
print("{}: Adding pins".format(tid))
print("-"*75)
for idx, (name, (dir, _)) in enumerate(tile_type["pin_map"].items()):
add_pin(pos, name, dir, idx)
# Add the local tracks
if tile_type == "IO":
groups_local = (2, LOCAL_TRACKS_PER_GROUP)
groups_glb2local = 0
else:
groups_local = (L... | |
#!/usr/bin/env python3
"""A command-line tool used to check links in docusaurus markdown documentation
To check all of our markdown documentation, run:
python docs_link_checker.py -p docs -r docs -s docs --skip-external
The above command:
- -p docs (also --path): The path to the markdown files you want to check. For... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module defines objects storing results from cross-correlation analysis.
"""
from __future__ import print_function
import numpy as np
import os
import pandas as pd
from tunacell.io import analysis
from tunacell.stats.utils import _dtype_converter
class Bivariat... | |
+ " save -f nrrd -e gzip -o " + FinalPath + "/DiffeomorphicAtlasDTI_float.nrrd"
if not m_useGridProcess:
if os.system(AverageCommand)!=0 : DisplayErrorAndQuit('dtiaverage: Computing the final DTI average')
print("[Computing some images from the final DTI with dtiprocess] => $ " + GeneScalarMeasurementCommand)
if os... | |
"id": id_or_status
})
async with self._session.get(url, headers=headers, params=params) as r:
raw_content = await r.read()
content: dict = json.loads(raw_content.decode())
if self.handle_errors:
raise_errors_in(content)
block = Block(**content)
return block
async def get_market_candlestick(self,
market... | |
import os
import sys
from collections import namedtuple
import numpy as np
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
from matplotlib.widgets import RectangleSelector
from matplotlib.backends.backend_qt5agg import (FigureCanvasQTAgg
as FigureCanvas)
from matplotlib.figure import Figure... | |
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import json
import logging
from os.path import exists, basename, abspath, join
from time import sleep
import multiprocessing
log = multiprocessing.get_logger()
logging.getLogger('urllib3').setLevel(logging.WARN)
GOOGLE_DRIVE_SCOPE = 'h... | |
# self.buffer = [[]]
if psa > 0.25:
self.buffer = [[0.1, 0], [0.1, -1], [0.1, -1]] * 8 + [[-self.stop_speed(0.35), 0]]
else:
self.buffer = [[0.1, 0], [0.1, -1], [0.1, -1]] * 10 + [[-self.stop_speed(0.35), 0]]
return self.buffer.pop()
# between 2 lanes alr
self.middle = True
if steerer > 0:
return [self.stop_s... | |
<filename>2019/016_cielab_color_space/check_boundary_characteristic.py
# -*- coding: utf-8 -*-
"""
XYZ空間やL*a*b*空間の境界線の確認
======================================
XYZ空間やL*a*b*空間の境界線を確認する
"""
# import standard libraries
import os
import ctypes
# import third-party libraries
import numpy as np
import matplotlib.pyplot a... | |
send2trash import send2trash')
return make_func_code('send2trash', filename)
else:
self.imports.append('import os')
return make_func_code('os.remove', filename)
def visitCopyMoveFile(self, ctx):
self.imports.append('import shutil')
args = self.list_visit(ctx.specialExpr()) #args = [fromFile, toFile]
if ctx.REN... | |
<reponame>Nishant-codex/LSNN-official
"""
The Clear BSD License
Copyright (c) 2019 the LSNN team, institute for theoretical computer science, TU Graz
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below)... | |
# -*- coding: utf-8 -*-
from . static import Base_RM_Register
from . MODEM_field import *
class RM_Register_MODEM_STATUS(Base_RM_Register):
def __init__(self, rmio, label):
self.__dict__['zz_frozen'] = False
super(RM_Register_MODEM_STATUS, self).__init__(rmio, label,
0x40086000, 0x000,
'STATUS', 'MODEM.STATUS'... | |
<filename>archive/preprocess.py
"""
Preprocess the uscis I485 Adjustment of status data
1. Download the csv files from the website
2. Rename the file and omit unnecessary files
3. Extract information from csv and save it into csv file
Currently works from 2014 qtr 1 through 2019 qtr 2
"""
# standard library
from os.pa... | |
<filename>FukuML/SupportVectorMachine.py
# encoding=utf8
import os
import itertools
import numpy as np
import cvxopt
import cvxopt.solvers
import FukuML.Utility as utility
import FukuML.MLBase as ml
import FukuML.LinearRegression as linear_regression
class BinaryClassifier(ml.Learner):
def __init__(self):
"""ini... | |
= self.d2G_dpidtau()
try:
d2G_d2pi = self._d2G_d2pi
except:
d2G_d2pi = self.d2G_d2pi()
tau = self.tau
x0 = (dG_dpi - tau*d2G_dpidtau)
Cv = self.R*(-tau*tau*d2G_d2tau + x0*x0/d2G_d2pi)
def Cp(self):
try:
return self._Cp
except:
pass
if self.region == 3:
tau, delta = self.tau, self.delta # attributes se... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import subprocess
import numpy as np
import xarray as xr
from glob import glob
from pytmatrix.tmatrix import Scatterer
from pytmatrix import psd, orientation, radar
from pytmatrix import refractive, tmatrix_aux
from ... | |
ostiumDiameter = ostiumSettings['Ostium diameter']
firstNodeIdentifier = 1
firstElementIdentifier = 1
# Central path
tmpRegion = region.createRegion()
centralPath.generate(tmpRegion)
cx, cd1, cd2, cd12 = extractPathParametersFromRegion(tmpRegion,
[Node.VALUE_LABEL_VALUE, Node.VALUE_LABEL_D_DS1,
Node.VALUE_LAB... | |
<reponame>sanglee/XAI-threshold-calibration
import warnings
from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
import torch.utils.model_zoo as model_zoo
from typing import Optional, Tuple, List, Callable, Any
from modules.layers import *
__al... | |
== 3
# Now without a score, and without y
grid_search = GridSearchCV(km, param_grid=dict(n_clusters=[2, 3, 4]))
grid_search.fit(X)
assert grid_search.best_params_["n_clusters"] == 4
def test_gridsearch_no_predict():
# test grid-search with an estimator without predict.
# slight duplication of a test from KDE
... | |
zMaxLocal
if zMin[0] is not None:
zMinUse = zMin[0]
if zMax[0] is not None:
zMaxUse = zMax[0]
trace.update(zmin=zMinUse, zmax=zMaxUse, colorscale=convertCmap(cmap[0], vmin=zMinUse, vmax=zMaxUse))
dataSummary.extend(dataHeatmap)
fig.add_traces(dataSummary)
fig['layout']['annotations'] = annos
py.plot(fig, file... | |
indexed_functions.add(key)
if settings.get('ASM_JS'):
export_bindings = settings['EXPORT_BINDINGS']
for key in curr_forwarded_json['Functions']['implementedFunctions'].iterkeys():
if key in all_exported_functions or (export_bindings and key.startswith('_emscripten_bind')):
exported_implemented_functions.add(key)
... | |
35, -3, 4): (-1, 1),
(8, 35, -3, 5): (-1, 1),
(8, 35, -2, -5): (-1, 1),
(8, 35, -2, -4): (-1, 1),
(8, 35, -2, -3): (-1, 1),
(8, 35, -2, -2): (-1, 1),
(8, 35, -2, -1): (-1, 1),
(8, 35, -2, 0): (-1, 0),
(8, 35, -2, 1): (-1, -1),
(8, 35, -2, 2): (-1, 1),
(8, 35, -2, 3): (-1, 1),
(8, 35, -2, 4): (-1, 1),
(8, 35... | |
<reponame>maksim-tolo/hass-smartthinq<gh_stars>0
import logging
import threading
import voluptuous as vol
import json
from homeassistant.components import climate
from homeassistant.components.climate import (
ClimateDevice)
from custom_components.smartthinq import (
DOMAIN, LGE_DEVICES, LGEDevice)
from homeassistant... | |
[]
},
"Float": {
"__class__": "DagsterTypeSnap",
"description": null,
"display_name": "Float",
"is_builtin": true,
"key": "Float",
"kind": {
"__enum__": "DagsterTypeKind.SCALAR"
},
"loader_schema_key": "ScalarUnion.Float-Selector.d00a37e3807d37c9f69cc62997c4a5f4a176e5c3",
"materializer_schema_key": "Selecto... | |
: 65535,
}
ofp_flow_wildcards_rev_map = {
'OFPFW_IN_PORT' : 1,
'OFPFW_DL_VLAN' : 2,
'OFPFW_DL_SRC' : 4,
'OFPFW_DL_DST' : 8,
'OFPFW_DL_TYPE' : 16,
'OFPFW_NW_PROTO' : 32,
'OFPFW_TP_SRC' : 64,
'OFPFW_TP_DST' : 128,
'OFPFW_DL_VLAN_PCP' : 1048576,
'OFPFW_NW_TOS' : 1<<21,
}
OFPFW_NW_DST_BITS = 6
OFPFW_NW_SRC_BITS... | |
<filename>handlers/commands.py<gh_stars>0
import asyncio
from aiogram import types
from aiogram.types import KeyboardButton, InlineKeyboardButton, contact, reply_keyboard
from aiogram.types.message import ContentType, ParseMode, ReplyKeyboardRemove, ReplyKeyboardMarkup, InlineKeyboardMarkup
from django.db.models import... | |
curr_entry:
return True
else:
return False
else:
entries = curr_entry.getChild().getEntries()
for next_entry in entries:
if MBR.doOverlap(curr_entry.getMBR(), entry.getMBR()) == True:
result = self.findLeafHelper(entry, next_entry)
if result == True:
return result
return False
def delete(self, entry):
# pr... | |
from os import path, sep
from netCDF4 import Dataset
from datetime import datetime
import cftime
import numpy as np
from ..settings import dtype_float
class Exchanger(object):
def __init__(self, components, clock, compass,
identifier, saving_directory):
# transfers that are both inwards and outwards will exist
... | |
# Copyright 2013 dotCloud inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, softw... | |
<filename>mobmonitor/checkfile/manager.py
# Copyright 2015 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.
"""Store and manage Mob* Monitor checkfiles."""
from __future__ import print_function
import cherrypy
import c... | |
X is the dataset, Phi is the sketch feature map, w_i are weights assigned to the samples (typically 1/n).
Arguments:
- dataset : (n,d) numpy array, the dataset X: n examples in dimension d
- featureMap : the feature map Phi, given as one of the following:
-- a function, z_x_i = featureMap(x_i), where x_i and z_x_... | |
<filename>losses.py
import sys
import torch
import torch.nn as nn
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_fscore_support
from sklearn.metrics import accuracy_score, f1_score
import numpy as np
def get_normal_log_prob... | |
scores of the audio clip as determined by RNNDetector.
SIGNAL (list of ints)
- Samples from the audio clip.
SAMPLE_RATE (int)
- Sampling rate of the audio clip, usually 44100.
audio_dir (string)
- Directory of the audio clip.
filename (string)
- Name of the audio clip file.
isolation_parameters (dict)
- ... | |
0 -4 -3 -4 12 -3 -4 -3 -3 -1 -2 -4 -1 -2 -3 -2 -1 -2 -2 0 -3 5 -2
Q -1 1 0 0 -3 6 1 -2 0 -3 -3 1 -2 -3 -1 0 -1 -2 -2 -3 0 1 -1
E -1 0 0 1 -4 x 5 -2 -1 -4 -4 1 -3 -4 -1 -1 -1 -3 -3 -4 0 -1 -1
G -1 -3 -1 -1 -3 -2 -2 7 -2 -6 -5 -2 -4 -5 -2 -1 -2 -4 -4 -5 -2 -2 -2
H -2 0 0 -1 -3 0 -1 -2 9 -3 -3 -1 -2 -1 -2 -1 -1 0 0 -3 0 -... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | |
<filename>tests/test_bootstrap_abc.py
"""
Tests for the bootstrap_abc.py file.
"""
import unittest
from collections import Iterable
import numpy as np
import numpy.testing as npt
import pandas as pd
import scipy.stats
import scipy.sparse
import pylogit.bootstrap_abc as abc
class HelperFuncTests(unittest.TestCase):
... | |
show_layer_names=True)
# With data augmentation to prevent overfitting
'''
Let's apply some data augmentation.
Data augmentation is a set of techniques used to generate new training samples from the original ones
by applying jitters and perturbations such that the classes labels are not changed.
In the context of com... | |
0)],
[(0, 0), (0, -1), (0, 0)],
]
not_working_keyset = [
[(0, 0), (0, 3), (0, 0)],
[(0, 0), (0, 4), (0, 0)],
[(0, 0), (0, -4), (0, 0)],
[(0, 0), (0, -5), (0, 0)]
]
class PointSelection2(PointSelectionTestCase):
shape = (7, 3)
working_keyset = [
[(0, 0), (0, 1)],
[(0, 0), (0, -1)],
[(0, 0), (0, -2)],
]
... | |
<filename>cloudcafe/compute/common/clients/remote_instance/windows/windows_client.py
"""
Copyright 2013 Rackspace
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/LIC... | |
<filename>read_gadget.py
# <NAME> - University of Bologna
#
# Script to import header and particles position/velocity from a Gadget format = 1 or format = 2 file
#
# In the script we consider the data structure of Gadget2 format = 1 and format = 2 snapshots:
# 1. DATA STRUCTURE while using the pointer
# blocksize (4 by... | |
We keep track of the number of times a board
# is copied in class variable: board_copy_cnts
# a {} key:base board name value:# of times it is copied
bn = board_spec.name # Just make the code read easier
cp_dict = Board.board_copy_cnts
if bn in cp_dict :
cp_dict[bn] += 1
else:
cp_dict[bn] = 1 # First copy
# Ho... | |
',', mode = "a", header = False) #Write log data to "drone_attack_log.csv"
self.check_cracked_password_list_file = Path(current_path + "/data/cracked_password_list.csv")
if self.check_cracked_password_list_file.is_file(): #Check "cracked_password_list.csv" is really exist
cracked_BSSID_log = [selected_bssid]
passwo... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""RED_linear_run1.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1-WN1MY9YYluGcnigLgrndqsxcOYldbB6
"""
#@title mount your Google Drive
#@markdown Your work will be stored in a folder called `cs285_f2021` by defa... | |
e)
except Exception as e:
raise HTTP_400("Bad request provided (%s ?)" % e)
# checking input
if not isinstance(userId, int):
raise HTTP_400("Bad user id provided in request, int expected")
if not isinstance(enabled, int):
raise HTTP_400(
"Bad enabled parameter provided in request, int expected")
# update
su... | |
go to a different function that just
# eats types
if following is not None:
return self._parse_builtin(modifier)
modifiers.append(modifier)
else:
self.backout()
break
while 1:
self.skip_ws()
if (in_template and self.current_char in ',>') or \
(result and not self.skip_string('::')) or \
self.eof:
break
r... | |
!= 0 else 0
fields_dict[tag_group] = LabelField(is_tag_group, label_namespace=tag_group,
skip_indexing=True)
# For every possible tag in the column set 1 if the tag is present for
# this example, 0 otherwise.
for ix, tag in ix_to_tag_dict.items():
if ix == 0:
continue
is_present = 1 if ix in tag_arr else 0
fie... | |
import datetime
import re
import socket
from copy import deepcopy
from django.utils.translation import ugettext_lazy as _
class RuleNotFoundError(Exception):
message = _('{NAME} rule not found!')
def __init__(self, name):
self.name = name
def __str__(self):
return self.message.format(NAME=self.name)
class R... | |
number=1,
)
signed_jwt = proto.Field(
proto.STRING,
number=2,
)
class Role(proto.Message):
r"""A role in the Identity and Access Management API.
Attributes:
name (str):
The name of the role.
When Role is used in CreateRole, the role name must not be
set.
When Role is used in output and other input such... | |
None,
initial_price: int = None,
factory_time: str = None,
release_time: str = None,
):
# OAuth模式下的授权token
self.auth_token = auth_token
self.product_instance_id = product_instance_id
# 厂商名称
self.corp_name = corp_name
# 数据模型id
self.peripheral_data_model_id = peripheral_data_model_id
# 外围设备ID
self.peripheral... | |
[30]
listStringField: ["varDefault"]
}
) {
inputObjectField(param: $param)
}""",
{"param": {}},
{"data": {"inputObjectField": "SUCCESS-{}"}},
),
(
"""query (
$param: MyInput = {
booleanField: false
enumField: ENUM_4
floatField: 456.789e2
intField: 30
stringField: "varDefault"
listBooleanField: [false]
... | |
<reponame>ACTCollaboration/moby2
from __future__ import print_function
from __future__ import absolute_import
from past.builtins import basestring
import os, pickle
import moby2
from . import beam_models as beamModels
from . import util
# I need these.
from numpy import *
from pylab import *
SIGMA_TO_FWHM = sqrt(8.... | |
<reponame>flexmock/flexmock
"""Tests for flexmock mocking feature."""
# pylint: disable=missing-docstring,no-self-use,no-member,too-many-lines
import os
import random
import re
import sys
from flexmock import exceptions, flexmock
from flexmock._api import AT_LEAST, AT_MOST, EXACTLY, FlexmockContainer, Mock, flexmock_t... | |
can contain multiple encryption settings per disk or snapshot.
:type encryption_settings_collection:
~azure.mgmt.compute.v2018_09_30.models.EncryptionSettingsCollection
:param disk_iops_read_write: The number of IOPS allowed for this disk; only settable for
UltraSSD disks. One operation can transfer between 4k and ... | |
<filename>fabfile.py
from __future__ import print_function, with_statement
import os
import sys
import stat
import json
import etcd
from functools import wraps
from fabric.api import *
from fabric.colors import red, yellow, white, green
from fabric.contrib.console import confirm
from fabric.contrib.files import exists
... | |
<reponame>YevhenVieskov/ML-DL-in-production
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from hypothesis import given
import numpy as np
from caffe2.proto import caffe2_pb2
from caffe2.python impor... | |
skip_save_processed_input=skip_save_processed_input,
preprocessing_params=self.config[PREPROCESSING],
backend=self.backend,
random_seed=random_seed,
callbacks=self.callbacks
)
(proc_training_set,
proc_validation_set,
proc_test_set,
training_set_metadata) = preprocessed_data
return proc_training_set, proc_va... | |
u'ɜ'),
(0x1D4D, 'M', u'g'),
(0x1D4E, 'V'),
(0x1D4F, 'M', u'k'),
(0x1D50, 'M', u'm'),
(0x1D51, 'M', u'ŋ'),
(0x1D52, 'M', u'o'),
(0x1D53, 'M', u'ɔ'),
(0x1D54, 'M', u'ᴖ'),
(0x1D55, 'M', u'ᴗ'),
(0x1D56, 'M', u'p'),
(0x1D57, 'M', u't'),
(0x1D58, 'M', u'u'),
(0x1D59, 'M', u'ᴝ'),
(0x1D5A, 'M', u'ɯ'... | |
short 3 Close long 4 Close short
# order_type String Yes 0: Normal order(Unfilled and 0 imply normal limit order) 1: Post only 2: Fill or Kill 3: Immediate Or Cancel
# match_price String Yes 0 Limit price 1 market price
# price String No Price of each contract
#
request = {
'symbol': market['id'],
}
clientOrder... | |
<filename>tola_management/views.py<gh_stars>0
from __future__ import unicode_literals
import json
import re
from collections import OrderedDict
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist, SuspiciousOperation
from django.core.serializers.json import DjangoJSONEncoder
from django.core.mail i... | |
<filename>src/aim_trajectory_picking/util.py
import random
from networkx import algorithms
from networkx.algorithms.chordal import _max_cardinality_node
import numpy as np
from itertools import combinations
import networkx as nx
import matplotlib.pyplot as plt
import time
from itertools import permutations
import os
im... | |
except for a note attached to the condition.
# Reproduce the returned result in the maker thread context.
if task.exception: # If there was an exception,
raise task.exception # re-raise it within the current thread.
else: # otherwise,
return task.result # return the result.
#-----------------------------------... | |
<reponame>winnerNick/dash
# -*- coding: UTF-8 -*-
import time
import json
from multiprocessing import Value
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait... | |
= wholeMoleculeSystem.filter_zero_rows_columns(ttQuadrant)
#diagnolaize
Utils.printflush("Diagonalizing->", end = ' ' )
lambdasFF, eigVectorsFF = Utils.diagonalize(ffQuadrant)
lambdasTT, eigVectorsTT = Utils.diagonalize(ttQuadrant)
Utils.printflush('Done')
# since eigen values can be complex numbers but with ... | |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (c) 2018 Kalray
#
###############################################################################
# last-modified: Mar 7th, 2018
# Author(s): <NAME> <<EMAIL>>
##########################################... | |
# CSV2PO Python (csv2po.py) v1.0.0
# By <NAME> <<EMAIL>> (tomchen.org)
# MIT License
# Python 3.8+
import re
import glob
import os
import time
import random
import importlib.util
import gettext
import polib
from pathlib import Path
from pluralforms import pluralforms
import settings
__version__ = '1.0.0'
import sys... | |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# __author__ = '__MeGustas__'
from django.test import TestCase
from django.db import connection
from tutorials.create_table.models import *
from utils.functions import namedtuplefetchall, dictfetchall
# Create your tests here.
class TestSQL(TestCase):
def setUp(self):
... | |
<reponame>takanattie/osc-placement
# 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, ... | |
[25, 36], [25, 37], [25, 38], [25, 39]],
4: [[26, 30], [27, 29], [27, 30], [27, 31], [27, 32], [28, 28], [28, 29], [28, 30], [28, 31], [28, 32], [28, 33], [28, 34], [28, 35], [28, 36], [28, 37], [28, 38], [28, 39], [29, 27], [29, 28], [29, 29], [29, 30], [29, 31], [29, 32], [29, 33], [29, 34], [29, 35], [29, 36], [29... | |
success
type: str
sample: CUSTOMER
detector:
description:
- Type of detector
returned: on success
type: str
sample: IAAS_ACTIVITY_DETECTOR
detector_rules:
description:
- "List of detector rules for the detector type for recipe - user input"
returned: on success
type: complex
contains:
detector_rule_id:
... | |
<reponame>shane-kerr/yapcap<gh_stars>0
"""
Open and read Pcap-NG files.
https://pcapng.github.io/pcapng/
https://github.com/pcapng/pcapng
https://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html
TODO: MAC address formatting (70-85-C2-3B-E8-F0)
https://standards.ieee.org/develop/regauth/tut/eui48.pdf
TODO: EUI a... | |
= "F90.9"
F91 = "F91"
F91_0 = "F91.0"
F91_1 = "F91.1"
F91_2 = "F91.2"
F91_3 = "F91.3"
F91_8 = "F91.8"
F91_9 = "F91.9"
F92 = "F92"
F92_0 = "F92.0"
F92_8 = "F92.8"
F92_9 = "F92.9"
F93 = "F93"
F93_0 = "F93.0"
F93_1 = "F93.1"
F93_2 = "F93.2"
F93_3 = "F93.3"
F93_8 = "F93.8"
F93_9 = "F93.9"
F94 = "F94"
F9... | |
<reponame>FlantasticDan/mocapBoston
"""Tools for detecting and identifying markers in images."""
from statistics import mode
import os
import sys
import cv2
import numpy as np
from shapely.geometry.point import Point
from shapely.geometry.polygon import Polygon
from shapely.geometry import LineString
# File Manageme... | |
35.1030999663849*m.x1100 + 34.8196390264122*m.x1101 + 35.6315367710839*m.x1102
+ 35.9497677466959*m.x1103 + 38.8890176659163*m.x1104 + 24.455791897968*m.x1105
+ 27.9683341833676*m.x1106 + 49.9691999668231*m.x1107 + 31.1584222407071*m.x1108
+ 41.2927103117558*m.x1109 + 23.0976125541898*m.x1110 + 29.0103363839413*m.x1... | |
have the train and testing data in our hand !!
if train_tagger:
self.create_train_test_dataloader_POS()
else:
self.create_train_test_dataloader()
if load :
if compare_models:
pass
else:
self.load_model()
else:
self.create_model()
if self.train_tagger:
self.train_tagging()
el... | |
"""Make sure filters are handled correctly"""
import pytest
from optimade.server.config import CONFIG, SupportedBackend
@pytest.mark.xfail(
CONFIG.database_backend == SupportedBackend.ELASTIC,
reason="Elasticsearch does not support queries on custom fields without configuration.",
)
def test_custom_field(check_resp... | |
exp_configuration={
-6:{ # Negative Values for visualization experiments
'p':1.0, # "prob for DI and RE"
'alpha':2,
'max_iterations':40, # "max_iterations"
'num_images':1000,
'source_model_names':['ResNet50','vgg16', 'DenseNet121', 'inception_v3'],
'target_model_names':['ResNet18'],
'attack_methods': {'ODI-MI-T... | |
from torch.optim import lr_scheduler
from torch import optim
import torch.nn.functional as F
import random
import shutil, zipfile
# import matplotlib.pyplot as plt
# import seaborn as sns
# import nltk
import json
# import pandas as pd
import copy
from convlab2.dst.trade.crosswoz.utils.masked_cross_entropy import *
f... | |
name, expected):
"""Test vertex attributes."""
attrib = obj_test_geo.findVertexAttrib(name)
result = ht.inline.api.attribute_has_uninitialized_string_values(attrib)
assert result == expected
@pytest.mark.parametrize(
"name, expected",
[
("detail_attrib_fully_initialized", False),
("detail_attrib_not_initial... | |
<reponame>Ilyich2011/rp-lockbox<filename>examples/python/rp_lockbox.py
# Copyright (c) 2018, <NAME>, <NAME>
#
# All rights reserved.
#
# Copyright (c) 2015, Red Pitaya
"""Module for controlling the Red Pitaya lockbox via SCPI commands."""
import socket
import logging
LOG = logging.getLogger(__name__)
# pylint: disab... | |
= True , *args ) :
if isintance ( var , str ) :
varset = data.get()
assert var in varset, 'Invalid variable %s' % var
var = getarrt ( varset , var )
return _rad_kurtisis_ ( data , var , error , *args )
k = data._old_kurtosis_ ( var , *args )
if not error : return k
n = dat.sumEntries( *args )
if 3 > ... | |
#!/usr/bin/env python
#
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | |
<filename>hrosailing/cruising/__init__.py
"""
Functions for navigation and weather routing using polar diagrams.
"""
import itertools
from bisect import bisect_left
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import List, Optional
import numpy as np
from scipy.integrate imp... | |
Notify the job server about job completion
if job.state.status != 'canceled':
job.state.status = 'completed'
job.state.progress = 100
job.state.completed_on = datetime.utcnow()
job.update()
result_queue.put(dict(id=None, pid=self.ident))
# Close the possible data file db session
# noinspection PyBroadException... | |
<reponame>JulienKluge/pyMeComTEC
from enum import Enum
from struct import pack, unpack
class MeComError(Enum):
EER_CMD_NOT_AVAILABLE = 1 #Command not available
EER_DEVICE_BUSY = 2 #Device is busy
ERR_GENERAL_COM = 3 #General communication error
EER_FORMAT = 4 #Format error
EER_PAR_NOT_AVAILABLE = 5 #Parameter is ... | |
# -*- coding: utf-8 -*-
#protocol_desc start
Protocol_desc = {
'version':[['major ', 'int16', ''],['minor', 'int16', ''],['patch', 'int16', ''],],
'ptyperow':[['tid', 'int16', ''],['name', 'string8', ''],['subtid', 'int16', ''],],
'protocoltype':[['tid', 'int16', ''],['name', 'string8', ''],['fileds', 'list8', 'pt... | |
dataTypeRow[col].lower() == 'integer':
self.SetCellRenderer(row, col, gridlib.GridCellNumberRenderer())
self.SetCellValue(row, col, str(colValue))
elif dataTypeRow and dataTypeRow[col].lower() == 'datetime':
self.SetCellRenderer(row, col, gridlib.GridCellDateTimeRenderer())
self.SetCellValue(row, col, colValu... | |
secondary. Equivalent to SAM
flag 0x100. A secondary alignment represents an alternative to the
primary alignment for this read. Aligners may return secondary
alignments if a read can map ambiguously to multiple coordinates in the
genome. By convention, each read has one and only one alignment where
both `secondar... | |
<filename>resampling_sensor_raw_data.py
# coding: utf-8
"""Sensor raw data resampling.
Copyright (c) 2021 Hitachi,Ltd.
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
"""
import argparse
import datetime
import os
from pathlib import Path
import sys
import numpy as np
i... | |
# Copyright 2020 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 ... | |
= dest_dir
config['current'] = dest
with open(dest_dir + '/config.json', "w") as f:
dump(config, f)
write_result_to_server(name, 'create', VMDI_KIND, VMDI_PLURAL, {'current': dest, 'pool': target})
def create_disk_from_vmdi(params):
name, targetPool, source = _get_param('--name', params), _get_param('--target... | |
# Copyright 2013: Mirantis 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
#
# Unless required by applicable law or ... | |
'r+b')
except IOError:
continue
data = f.read()
f.close()
if size == 3145728 + 0x200:
data = data[0x200:]
h = md5(data).hexdigest()
if h == MD5HASH:
sourcefile = filename
break
else:
raise Exception("File not found.")
else:
raise Exception("File not found.")
print ("Success! Using valid rom file: %s\n" ... | |
import sys
#import traceback
import os
import errno
from os import linesep as newline
import time
import datetime
from multiprocessing import Process, Value
import socket
import re
import json
from enum import Enum
from agent import UCSAgentWrapper
import const
from const import (loop_iterations,
stop_on_failure,
lo... | |
items. (default 0)
int offset - How many items should be returned ahead. (default 0)
Returns List<ApiTypes.Webhook>
"""
parameters = {
'limit': limit,
'offset': offset}
return ApiClient.Request('GET', '/account/loadwebhook', parameters)
@staticmethod
def LoadWebNotificationOptions(parameters=None)... | |
from __future__ import annotations
from dataclasses import dataclass, field
from enum import Enum
from functools import wraps
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union
from retry.api import retry_call # type: ignore
from lisa import notifier, schema, ... | |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | |
= tk.Entry(master=entry_7, width=10)
entry_7_init = tk.Label(master=entry_7)
# Layout the Entry and Label in entry_7
# using the .grid() geometry manager
entry_7_value.grid(row=0, column=3, sticky="e")
entry_7_init.grid(row=0, column=4, sticky="w")
# Create the conversion Button and result display Label
entry_7_butto... | |
<reponame>williamthome/otp
CommonDataTypes DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
-- @prop dataType
-- @descr This types only purpose is to avoid OSS compiler warning : Duplicate PDU tag
-- @
CommonDataTypeWrapper ::= CHOICE
{
wrapAddAnalysisRejectReason AddAnalysisRejectReason,
wrapAddServiceToServiceProfileRejectRe... | |
Panda site IDs
def convertDQ2toPandaIDList(site):
sites = []
sitesOff = []
for tmpID,tmpSpec in PandaSites.iteritems():
# # exclude long,xrootd,local queues
if isExcudedSite(tmpID):
continue
# get list of DQ2 IDs
srmv2ddmList = []
for tmpDdmID in tmpSpec['setokens'].values():
srmv2ddmList.append(convSrmV2ID(... | |
# -*- coding: utf-8 -*-
import pytest
import sys
import time
from aerospike import predexp as predexp
from aerospike import exception as e
aerospike = pytest.importorskip('aerospike')
try:
import aerospike
except:
print('Please install aerospike python client.')
sys.exit(1)
def seconds_to_nanos(num):
'''
conve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.