input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
bytes in - 0 bytes out - InRaw<8,8,0>'),
('nn::ns::detail::IApplicationManagerInterface', 6, '0 bytes in - 1 bytes out - OutRaw<1,1,0>'),
('nn::ns::detail::IApplicationManagerInterface', 7, '0 bytes in - 0 bytes out'),
('nn::ns::detail::IApplicationManagerInterface', 8, ''),
('nn::ns::detail::IApplicationManagerInt... | |
All the "values" to take into account to get the storage key.
Returns
-------
str
The redis key to use
"""
args = list(args)
value = args.pop()
parts = [
self.model._name,
self.field.name,
] + args
if self.prefix:
parts.append(self.prefix)
if self.key:
parts.append(self.key)
normalized_value = se... | |
= FloatText(value='2.0', step='0.1', style=style, layout=widget_layout)
units_btn = Button(description='1/min', disabled=True, layout=name_button_layout)
units_btn.style.button_color = 'lightgreen'
row = [name_btn, self.float260, units_btn, ]
box276 = Box(children=row, layout=box_layout)
# -----------------------... | |
list()
identifiers_list = list()
keywords_list = list()
operators_list = list()
return_and_print_count = 0
return_and_print_kw_list = ['return', 'print', 'printf', 'println', 'write', 'writeln']
condition_count = 0
condition_kw_list = ['if', 'for', 'while', 'switch', '?', 'assert', ]
uncondition_count = 0
u... | |
'HTTPS', 'POST', f'/gateway.do', TeaCore.to_map(request), headers, runtime)
)
async def skip_servicegroup_ex_async(
self,
request: deps_models.SkipServicegroupRequest,
headers: Dict[str, str],
runtime: util_models.RuntimeOptions,
) -> deps_models.SkipServicegroupResponse:
"""
Description: 忽略分组
Summary: 忽略分组
... | |
not
# broken out further by year
perf_val = [sum([
x[z] * perf_convert[y][cz_int] for
y, z in enumerate(aia_list)]) if type(
x[aia_list[0]]) is not dict else {
str(yr): sum([x[z][str(yr)] * perf_convert[y][
cz_int] for y, z in enumerate(aia_list)])
for yr in years} for x in perf_val]
else:
perf_val = [x[cz_in... | |
if k not in self.name:
self.name[k] = []
# convert graph Gs to numpy arrays for speed up post processing
self.g2npy()
#
# add boundary
#
self.boundary()
# save ini file
self.save()
#
def exportosm(self):
""" export layout in osm file format
Parameters
----------
_filename : string
Notes
-----
... | |
#!/usr/bin/env python3
# coding=utf-8
"""
@author: guoyanfeng
@software: PyCharm
@time: 18-12-25 下午5:15
"""
import atexit
import secrets
import uuid
from collections import MutableMapping
from typing import Any, Dict, List, NoReturn, Union
import aelog
import redis
import ujson
from redis import RedisError
from .exc... | |
>>>
>>> thread = api.patch_conversations_message_participant(conversation_id, participant_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str conversation_id: conversationId (required)
:param str participant_id: participantId (required)
... | |
HOH B .
D 2 HOH 88 388 102 HOH HOH B .
D 2 HOH 89 389 76 HOH HOH B .
D 2 HOH 90 390 257 HOH HOH B .
D 2 HOH 91 391 64 HOH HOH B .
D 2 HOH 92 392 180 HOH HOH B .
D 2 HOH 93 393 205 HOH HOH B .
D 2 HOH 94 394 178 HOH HOH B .
D 2 HOH 95 395 71 HOH HOH B .
D 2 HOH 96 396 313 HOH HOH B .
D 2 HOH 97 397 108 HOH HOH... | |
# -*- coding: utf-8 -*-
#
# This file is part of the FspPssSubarray project
#
#
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
"""
Author: <NAME> <EMAIL>,
Herzberg Astronomy and Astrophysics, National Research Council of Canada
Copyright (c) 2019 National Research Council of Canad... | |
#! /usr/bin/env python3
import hmac
import time
import json
import logging
import requests
from hashlib import sha256
from urllib.parse import urlencode
from . import formatter
from . import custom_data_formatter
## API Object imports
from . import blvt_api
from . import bswap_api
from . import futures_api
from . im... | |
which consists in allowing the user
to ignore some deterministic variables in the trace by adding a
`# sample: ignore` comment on the line it is defined.
"""
comment = node.trailing_whitespace.comment
if comment is not None and "sample: ignore" in comment.value:
self.sample_this_op = False
def leave_SimpleStat... | |
###########################################
# Author : <NAME>, <NAME>, <NAME>, <NAME>
# Date : 26.04.2018
# Course : Applications in Object-oriented Programming and Databases
# Teachers : <NAME>, <NAME>
# Project : Bibliotek
# Goal : Book management system
# Libraries : scrapy, bibtexparser, datetime, requests
# API : ... | |
<reponame>Srivatsan-Srinivasan/am221-project<gh_stars>1-10
import os
import time
import numpy as np
import numpy.random as npr
import tensorflow as tf
import tflearn
import bundle_entropy
from replay_memory import ReplayMemory
from experience_replay import PrioritizedReplayBuffer
from schedules import LinearSchedule
... | |
from __future__ import with_statement
import time
import pygame
import numpy
import zlib
from . import googlemapindex
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
from .Resources.header import imgheader
from . import render_lib
from .loadbar import Bar
from .shared import cores
import collecti... | |
<filename>netapp/santricity/models/symbol/fibre_interface.py<gh_stars>1-10
# coding: utf-8
"""
FibreInterface.py
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations... | |
@legacy_variation_id.setter
def legacy_variation_id(self, legacy_variation_id):
"""Sets the legacy_variation_id of this LineItem.
The unique identifier of a single variation within a multiple-variation listing. This field is only returned if the line item purchased was from a multiple-variation listing. # noqa: E50... | |
'''
Functions and objects shared between other modules of Mcblend.
'''
from __future__ import annotations
from ctypes import c_int
import math
from enum import Enum
from typing import (
Deque, Dict, Iterator, NamedTuple, List, Optional, Tuple, Any, Iterable, Sequence)
from collections import deque
import numpy as np... | |
import copy
import inspect
import json
import logging
import pytest
import re
import os
import shutil
import subprocess
import time
from datetime import datetime, timedelta
from configparser import ConfigParser, ExtendedInterpolation
from typing import Dict, List, Optional
from pyhttpd.certs import CertificateSpec
f... | |
<reponame>rajkubp020/helloword
#!/usr/bin/env python
# polarizer.py - add Drude oscillators to LAMMPS data file.
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# version 2017/02/08
import sys
import argparse
import random
from copy import deepcopy
usage = """Add Drude oscillators to LAMMPS data file.
Format of file containin... | |
msg="" )\nend' ) )
assert runner.status == [ ( 0.0, 'Scope', None ) ]
with pytest.raises( Pause ):
runner.run()
assert runner.status == [ ( 50.0, 'Scope', {} ), ( 50.0, 'While', { 'doing': 'expression' } ), ( 50.0, 'Scope', {} ), ( 0.0, 'Function', { 'module': None, 'name': 'pause' } ) ]
assert not runner.done
wi... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
from shutil import rmtree
from tempfile import mkdtemp
from glob import iglob
import logging
import pytest
import astropy.io.fits as fits
import numpy as np
from astropy.tests.helper import catch_warnings
from astropy.utils import minversion
f... | |
:param name: Log unique name
:type name: str
"""
_attribute_map = {
'display_name': {'key': 'displayName', 'type': 'str'},
'blob_duration': {'key': 'blobDuration', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
}
def __init__(self, *, display_name: str=None, blob_duration: str=None, name: str=None, *... | |
video_tools.FileMetaDataLocator(self.locateFile('tests/videos/sample1_slow.mov')).getMaskSetForEntireVideo(
) # Constant FR
self._add_mask_files_to_kill(result)
self.assertEqual(0.0, video_tools.get_start_time_from_segment(result[0]))
self.assertEqual(1, video_tools.get_start_frame_from_segment(result[0]))
self.as... | |
[('ADD', 3, M6805_AddressMode.EXT), ['EXT'], lambda self, il, ext: il.set_reg(1, 'A', il.add(1, il.reg(1, 'A'), il.load(1, ext), 'NZC'))],
[('JMP', 3, M6805_AddressMode.EXT), ['EXT'], lambda self, il, ext: M6805.branch(il, ext)],
[('JSR', 3, M6805_AddressMode.EXT), ['EXT'], lambda self, il, ext: il.call(ext)],
[('LD... | |
IloResponseError:
pass
self.auxcommands['logout'].run("")
@log_decor
def smbiostesting(self):
""" smbios automatic testing """
self.rdmc.ui.printer("\n*************************************************"
"********************************\n")
self.rdmc.ui.printer("***************************SMBIOS "
"AUTOMATIC ... | |
add_to_header(self.ccd_e_proc.header, 'h', s, t_ref=_t)
# ================================================================================================== #
# * 6. CR-rejection
# ================================================================================================== #
if do_crrej:
crkw = dict(
crrej... | |
<gh_stars>1-10
import unittest
import itertools
import time
import sys
import pickle
import numpy as np
from mpinoseutils import *
import pygsti
from pygsti.modelpacks.legacy import std1Q_XYI as std
from pygsti.objects import profiler
g_maxLengths = [1,2,4,8]
g_numSubTrees = 3
def assertGatesetsInSync(mdl, comm):
i... | |
<gh_stars>1-10
""" Tiles demo
This demo is good for illustrating or testing the tile routines.
The demo displays a graph where instead of lines, there is a dot for
each x,y pair in the graph. The x,y pairs are points whose tiles match the
point we are doing tiles for. There is a separate graph entry for each
of the fol... | |
<filename>tests/integration/providers/ldap/delta_inbound_sync_tests.py
# Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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.apa... | |
<filename>aristopy/plotter.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# P L O T T E R
# ==============================================================================
"""
* File name: plotter.py
* Last edited: 2020-06-1... | |
from datetime import datetime, timedelta
import json
import unittest
import logging
from alerta.utils.format import DateTime
from alerta.app import create_app, db, plugins
from alerta.models.key import ApiKey
LOG = logging.getLogger("test.test_notification_rule")
def get_id(object: dict):
return object["id"]
c... | |
<reponame>PythonBiellaGroup/LearningPythonWithGames
# Player movement prototype program:
# - Cursor left-right: move player
# - Cursor up: player jump
# - Space: shoot a rainbow
import pgzrun
from pygame import image, Color, Surface
from shapely.geometry import Point, Polygon, LineString
from shapely.affinity import tr... | |
28736.6017845307 * self.t)
Y0 += 0.00000000045 * math.cos(2.54247709679 + 55504.18575691209 * self.t)
Y0 += 0.00000000062 * math.cos(6.05167319913 + 176954.23375935068 * self.t)
Y0 += 0.00000000043 * math.cos(4.09072234194 + 78903.8505285201 * self.t)
Y0 += 0.00000000044 * math.cos(2.10728026202 + 16703.3059509825 ... | |
def makeMappedReadsUniqueList(self, includeForward=True, includeReverse=True):
readNameSet = set()
srList = []
numReads = 0
for paftolTarget in self.paftolTargetDict.values():
for mappedRead in paftolTarget.mappedReadList:
readName = mappedRead.getReadName()
if readName not in readNameSet:
numReads = numReads +... | |
thread = api.find_document_with_http_info(applicant_id, document_id, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str applicant_id: (required)
:param str document_id: (required)
:return: Document
If the method is called asynchronously,
r... | |
import argparse
import asyncio
import grp
import logging
import os
import pwd
import random
import re
import string
import sys
import urllib
from fnmatch import fnmatch
from typing import Dict
from typing import List
from typing import Tuple
import aiohttp
import yaml
from aiohttp import ClientSession
from aiohttp imp... | |
<gh_stars>1-10
'''This module extends PTPDevice for Canon devices.
Use it in a master module that determines the vendor and automatically uses its
extension. This is why inheritance is not explicit.
'''
from ...util import _main_thread_alive
from .properties import EOSPropertiesMixin
from contextlib import contextmana... | |
<reponame>gialmisi/desdeo-emo<filename>desdeo_emo/EAs/IOPIS.py
from typing import Dict, List, Union
import numpy as np
import pandas as pd
from desdeo_emo.EAs.BaseEA import BaseDecompositionEA, BaseEA, eaError
from desdeo_emo.EAs.RVEA import RVEA
from desdeo_emo.population.Population import Population
from desdeo_emo.... | |
> dt.timedelta(seconds=refresh_interval)
if refresh_needed and refresh_interval != 0:
self.__log_dicts(dev)
dev.updateStatesOnServer([{'key': 'onOffState', 'value': True, 'uiValue': 'Processing'}])
# {key: (Item Name, Source ID, Source State)}
csv_dict_str = dev.pluginProps['columnDict']
# Convert column_dic... | |
+ m.x987**2) >= 0)
m.c1283 = Constraint(expr=m.x238**2 - (m.x988**2 + m.x989**2) >= 0)
m.c1284 = Constraint(expr=m.x239**2 - (m.x990**2 + m.x991**2) >= 0)
m.c1285 = Constraint(expr=m.x240**2 - (m.x992**2 + m.x993**2) >= 0)
m.c1286 = Constraint(expr=m.x241**2 - (m.x994**2 + m.x995**2) >= 0)
m.c1287 = Constraint(exp... | |
simPa.frame_rate_actual
Pausing = np.where(MT_length_diff < 0.1*simPa.growth_speed*1000/60)[0][0]
Pausing = (MT_length.shape[1] - Pausing)*simPa.frame_rate_actual
# Tip position output
MT_length_output = np.vstack((MT_CI_upper, MT_CI_lower))
MT_length_output = np.vstack((MT_length_mean, MT_length_output))
MT_len... | |
<reponame>S73ph4n/octavvs<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
Atmospheric and scattering correction
"""
import gc
import os.path
from time import monotonic
import numpy as np
import sklearn.linear_model
import sklearn.cluster
#import statsmodels.multivariate.pca
from scipy.i... | |
def setSelectedPanel(self, panel: Panel):
self.model.set_selected_panel(panel)
selectedPanel = property(getSelectedPanel, setSelectedPanel)
@Slot(name='pageLeft')
def pageLeft(self):
span = np.diff(self.viewRange())[0]
self.translateBy(-span)
@Slot(name='shiftRight')
def shiftRight(self):
span = np.diff(sel... | |
from __future__ import division # the result of the division will be always a float
from optparse import OptionParser
import os, gc
from copy import deepcopy
from config.latex_labels import variables_latex, measurements_latex, \
met_systematics_latex, b_tag_bins_latex, fit_variables_latex
from config.variable_binning ... | |
<filename>esmond/cassandra.py
#!/usr/bin/env python
# encoding: utf-8
"""
Cassandra DB interface calls and data encapsulation objects.
esmond schema in json-like notation:
// regular col family
"raw_data" : {
"snmp:router_a:FastPollHC:ifHCInOctets:xe-0_2_0:30000:2012" : {
"1343955624" : // long column name
"161503... | |
TextField(db_column='USERNAME', null=True)
class Meta:
db_table = 'COMMENT'
class Communications(BaseModel):
communication = FloatField(db_column='COMMUNICATION_ID', primary_key=True)
contact = FloatField(db_column='CONTACT_ID', null=True)
created_by = FloatField(db_column='CREATED_BY')
created_date = TextFiel... | |
'funded_amount', 'funded_amnt_inv': 'investor_funds', 'int_rate': 'interest_rate', 'annual_inc': 'annual_income'})
df['complete_date'] = pd.to_datetime(df['issue_d'])
return df
#=============
# Function 225
def cleaning_func_7(df):
# additional context code from user definitions
def loan_condition(status):
if (... | |
thread = api.get_aggregation_account_balance_using_get(aggregation_account_balance_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str aggregation_account_balance_id: UUID aggregation_account_balance_id (required)
:param str currency_conversion: USD
:return: AggregationAccountBalance
I... | |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# Vulkan CTS
# ----------
#
# Copyright (c) 2015 Google 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 ... | |
not None:
pulumi.set(__self__, "path", path)
if read_only is not None:
pulumi.set(__self__, "read_only", read_only)
if secret_file is not None:
pulumi.set(__self__, "secret_file", secret_file)
if secret_ref is not None:
pulumi.set(__self__, "secret_ref", secret_ref)
if user is not None:
pulumi.set(__self__, "u... | |
Click on the Browse link
self.assertIn("/browse?namespace=14&my=14",
CanonizerBrowsePage(self.driver).select_by_value_personal_reputations_only_my_topics().get_url())
# 100
def test_select_by_value_professional_services_only_my_topics(self):
print("\n" + str(test_cases(99)))
# Click on the Login Page and Create ... | |
"""Games or Adversarial Search (Chapter 5)"""
import copy
import itertools
import random
from collections import namedtuple
import numpy as np
from utils import vector_add
GameState = namedtuple('GameState', 'to_move, utility, board, moves')
StochasticGameState = namedtuple('StochasticGameState', 'to_move, utility,... | |
"""[Chemicals] Chemicals corresponing to each entry in the stoichiometry array."""
return self._chemicals
@property
def stoichiometry(self):
"""[2d array] Stoichiometry coefficients."""
return self._stoichiometry
@property
def reactants(self):
"""tuple[str] Reactants associated to conversion."""
IDs = self._... | |
<reponame>kdschlosser/nvapi
# -*- coding: utf-8 -*-
#
# ***********************************************************************************
# MIT License
#
# Copyright (c) 2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (... | |
<reponame>PolarMesosphericClouds/SkyWinder<gh_stars>0
import struct
from multiprocessing import Value
import numpy as np
from PyCRC.CRCCCITT import CRCCCITT
import logging
logger = logging.getLogger(__name__)
def get_checksum(data):
return int(np.sum(np.frombuffer(data, dtype='uint8'), dtype='uint8'))
def get_cr... | |
= None):
"""
Initialization of the environment
:param save_dir: directory to save outputs of the env
:param initial_state_path: path to the initial state (if none, use default)
:param idsgame_config: configuration of the environment (if not specified a default config is used)
"""
from gym_idsgame.agents.bot_age... | |
<reponame>stevencox/kgx<gh_stars>0
import itertools
import click, rdflib, os, uuid
import networkx as nx
from typing import Tuple, Union, Set, List, Dict, Any, Iterator, Optional
from rdflib import Namespace, URIRef, Literal
from rdflib.namespace import RDF, RDFS, OWL
from kgx.config import get_logger
from kgx.prefix... | |
return _gui.GuiResource_clear_iconrc()
GuiResource_clear_iconrc = _gui.GuiResource_clear_iconrc
def GuiResource_trash_iconrc():
return _gui.GuiResource_trash_iconrc()
GuiResource_trash_iconrc = _gui.GuiResource_trash_iconrc
def GuiResource_magnifier_iconrc():
return _gui.GuiResource_magnifier_iconrc()
GuiResource_m... | |
if delta > 0:
if core.valid(entry):
year = int(entry[0:4])
month = int(entry[4:6])
day = int(entry[6:8])
datecheck = datetime.date(year, month, day)
displayCutoff = datetime.date.today() - datetime.timedelta(days=delta)
if datecheck > displayCutoff:
feedList.append(os.path.join(entryDir, entry))
else:
feedLi... | |
= set(
state_key
for ev_type, state_key in itertools.chain(to_delete, to_insert)
if ev_type == EventTypes.Member
)
for member in members_changed:
txn.call_after(
self.get_rooms_for_user_with_stream_ordering.invalidate, (member,)
)
self._invalidate_state_caches_and_stream(txn, room_id, members_changed)
def ... | |
# -*- coding: utf-8 -*-
import os
from io import BytesIO
import oss2
import unittest
import unittests
import random
from oss2 import utils
from functools import partial
from mock import patch
import struct
import copy
from .common import *
import json
def make_get_object(content):
request_text = '''GET /sjbhlsgsb... | |
"com_github_google_btree",
importpath = "github.com/google/btree",
sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=",
version = "v1.0.0",
)
go_repository(
name = "com_github_google_go_cmp",
importpath = "github.com/google/go-cmp",
sum = "h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=",
version = "v0.5.0... | |
<reponame>Jeremiad/Flexget
import os
import re
import socket
from io import BytesIO
from time import sleep
from datetime import datetime
from urllib.parse import urljoin, urlparse, urlsplit
from xmlrpc import client as xmlrpc_client
from loguru import logger
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
fro... | |
getRuleIndex(self):
return LaTeXParser.RULE_mp
def mp(self, _p=0):
_parentctx = self._ctx
_parentState = self.state
localctx = LaTeXParser.MpContext(self, self._ctx, _parentState)
_prevctx = localctx
_startState = 10
self.enterRecursionRule(localctx, 10, self.RULE_mp, _p)
self._la = 0 # Token type
try:
se... | |
# -*- coding: utf-8 -*-
"""
Utilities for reading and writing USID datasets that are highly model-dependent (with or without N-dimensional form)
Created on Tue Nov 3 21:14:25 2015
@author: <NAME>, <NAME>
"""
from __future__ import division, print_function, absolute_import, unicode_literals
from warnings import warn
i... | |
_topology_operations_unreserve(self, unreservation):
"""
:param unreservation (list):
list of object with fields
slot (java.lang.Integer):
port (java.lang.Integer):
"""
appWrapper = self._wrapper
r = appWrapper.session.post(url='https://' + appWrapper.host + '/bps/api/v2/core/topology/operations/unreserve', hea... | |
range
auto_enable_tradeoffs = True
Enable when graph has < 50M edges
cache_path = None
Path to store graphs
Defaults either to `GRAPH_CACHE_DIR` sys var or `graphs`
cache_sys_var = "GRAPH_CACHE_DIR"
version = "2021-10-29"
Version to retrieve
The available versions are:
- 2021-11-10
- 2021-06-02
- 20... | |
'''
Created on Oct 21, 2021
@author: willg
This module helps track and store data from Wiimmfi.
'''
import asyncio
import json
import os
import time
import traceback
from collections import defaultdict
from copy import deepcopy
from itertools import chain
from typing import List, Dict, Tuple, Set
import aiosqlite
... | |
# Accelerator for pip, the Python package manager.
#
# Author: <NAME> <<EMAIL>>
# Last Change: January 10, 2016
# URL: https://github.com/paylogic/pip-accel
"""
Configuration handling for `pip-accel`.
This module defines the :class:`Config` class which is used throughout the
pip accelerator. At runtime an instance of... | |
for p in pname:
if '.' in p:
ind = pname.index(p)
del pname[ind]
idf.append({'name':'packList',
'widgetType':kbScrolledListBox,
'wcfg':{'items':pname,
#'defaultValue':pname[0],
'listbox_exportselection':0,
'labelpos':'nw',
'label_text':'Select a package:',
#'dblclickcommand':self.loadMod_cb,
'selectioncom... | |
<gh_stars>0
# -*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import atexit, inspect, time
import os.path as path
from bes.common.check import check
from bes.common.object_util import object_util
from bes.fs.file_util import file_util
from bes.fs.file_find import file_find
fr... | |
<reponame>aria-systems-group/PDDLtoSim
import os
import re
import time
import random
import datetime
import yaml
import copy
import sys
import math
import warnings
import pybullet as pb
import numpy as np
from typing import Tuple, Optional, List, Dict
from src.graph_construction.causal_graph import CausalGraph
from s... | |
# coding: utf-8
import json
class StixCyberObservable:
def __init__(self, opencti, file):
self.opencti = opencti
self.file = file
self.properties = """
id
standard_id
entity_type
parent_types
spec_version
created_at
updated_at
createdBy {
... on Identity {
id
standard_id
entity_type
parent_types
sp... | |
import numpy as np
import matplotlib.pyplot as plt
from import_explore import import_csv
from import_explore import normalise
# for performing regression
from regression_models import construct_rbf_feature_mapping
# for plotting results
from regression_plot import plot_train_test_errors
# two new functions for cross ... | |
from direct.interval.IntervalGlobal import *
from direct.gui.DirectGui import DirectLabel
from direct.gui.DirectGui import DirectButton
from direct.gui.OnscreenText import OnscreenText
from direct.interval.IntervalGlobal import *
import random, string
from direct.gui import DirectGuiGlobals
from direct.directnotify imp... | |
<reponame>TangleSpace/pytorch-widedeep<filename>pytorch_widedeep/datasets/_base.py
# dataframes are saved as parquet, pyarrow, brotli
# pd.to_parquet(path=None, engine="auto", compression="brotli", index=False)
# see related post: https://python.plainenglish.io/storing-pandas-98-faster-disk-reads-and-72-less-space-208e... | |
"""
Time module.
This is a work in progress port that I started from the time module in **Transcrypt**.
No:
- Platform specific functions
- sleep. In js currently not possible in browsers
except via busy loops, we don't do that.
- struct_time CLASS. we work only via the tuple interface of it.
- handling of weird st... | |
self.output_dropout(
decoder_outputs, deterministic=not enable_dropout)
if logit_mask is not None:
decoder_outputs = logit_mask * decoder_outputs
if self.sow_intermediates:
self.sow('intermediates', 'pre_logits_layer', decoder_outputs)
# Decoded Logits
if self.logits_dense is not None:
logits = self.logits_d... | |
transforms=True) or []))
if child_joints:
next_joint = child_joints[0]
else:
end_joint = next_joint
next_joint = None
return end_joint
def get_joint_list(start_joint, end_joint):
"""
Get list of joints between and including given start and end joint
:param start_joint: str, start joint of joint list
:param... | |
<reponame>UBC-MDS/rainfall_group22<filename>src/sklearn_helper_funcs.py
import json
import pickle
import re
import time
from pathlib import Path
from IPython.core.display import display_pdf
import numpy as np
import pandas as pd
from IPython.display import display
from matplotlib.colors import LinearSegmentedColormap,... | |
<filename>playability.py
"""
Tile Representation
F = FLOOR
B = BLOCK
M = MONSTER
P = ELEMENT (LAVA, WATER)
O = ELEMENT + FLOOR (LAVA/BLOCK, WATER/BLOCK)
I = ELEMENT + BLOCK
D = DOOR
S = STAIR
W = WALL
- = VOID
walkable: F, M, O,
obstacle: B, P, I, W, -
start/end: D, S
"""
from typing import List, Tuple... | |
#!/usr/bin/env python
# This file should be available from
# http://www.pobox.com/~asl2/software/Pinefs
# and is licensed under the X Consortium license:
# Copyright (c) 2003, <NAME>, <EMAIL>
# All rights reserved.
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and ... | |
+ plg.write2xml()
s += '</plug>' + CHANGELINE
return s
def write2xml(self):
vsUnitStr = ('<iGin>' + str(self.iGin) + '</iGin>' + CHANGELINE +
self.__write_plug__() +
'<m>' + str(self.m) + '</m>' + CHANGELINE +
'<s>' + str(self.s) + '</s>' + CHANGELINE +
'<vol>' + str(self.vol) + '</vol>' + CHANGELINE)
return ... | |
#!/usr/bin/env python
"""Performance tests for the eipaddress module."""
import sys
import time
import ipaddress as ip
import eipaddress as eip
from sizes import sizeof
# =============================================================================
class TextFx:
'''Terminal strings for text effects.'''
PLAIN = ... | |
<filename>im2mesh/common.py
from numpy.lib.twodim_base import tri
import torch
from im2mesh.utils.libkdtree import KDTree
import numpy as np
import logging
from copy import deepcopy
logger_py = logging.getLogger(__name__)
def rgb2gray(rgb):
''' rgb of size B x h x w x 3
'''
r, g, b = rgb[:, :, :, 0], rgb[:, :, :... | |
from graphcnn.helper import *
from graphcnn.network import *
from graphcnn.layers import *
from sklearn.model_selection import KFold
import numpy as np
import tensorflow as tf
import glob
import time
from tensorflow.python.training import queue_runner
# This function is used to create tf.cond compatible tf.train.batch... | |
moves = '8h8i+'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'[bs]', Wboard.w8h)and Wboard.w7i=='':
moves = '8h7i+'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'[bs]', Wboard.w8h)and Wboard.w9i=='':
moves = '8h9i+'
kaihimore(moves)
if oute.oute == 0:
dept... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
The Index class can use several implementations as its
engine. Any implementation should implement the following:
__init__(data, row_index) : initialize index based on key/row list pairs
add(key, row) -> None : add (key, row) to existing data
remove(... | |
# coding: utf-8
"""
This module provides a Renderer class to render templates.
"""
import cgi
import os
import sys
from .context import Context
from .locator import DEFAULT_EXTENSION
from .locator import Locator
from .reader import Reader
from .renderengine import RenderEngine
# The quote=True argument causes dou... | |
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog
from . import widgets as w
from . import constants as c
import os
import webbrowser
from tkinter.scrolledtext import ScrolledText
class ProjectPurposeScreen(tk.Frame):
def __init__(self):
tk.Frame.__init__(self)
self.project_goal_selec... | |
is_training=is_training)
net = tf_util.conv2d_transpose(net, 4, kernel_size=[1,1], stride=[1,1], padding='VALID', scope='upconv5', activation_fn=None)
num_point_conv = 1024
elif num_point<=1536 and num_point>896:
conv_feat = tf.expand_dims(tf.expand_dims(feat, 1),1)
net = tf_util.conv2d_transpose(conv_feat, 512, k... | |
= U.dag()*U_target
part_idx = [0, 1, 3, 4] # only computational subspace
ptrace = 0
for i in part_idx:
ptrace += inner[i, i]
dim = 4 # 2 qubits comp subspace
return np.real(((np.abs(ptrace))**2+dim*(1-L1))/(dim*(dim+1)))
elif U.type=='super':
U=qtp.to_super(Ucorrection)*U
kraus_form = qtp.to_kraus(U)
dim=4... | |
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
import dateutil.parser
import math, json, re, itertools
import collections
from datetime import datetime, date, timedelta
from multiprocessing.pool import ThreadPool as threadpool
import random
import time
import numpy as ... | |
= ValUtil.sshortpop(buf)
self.numberOfHMetrics, buf = ValUtil.ushortpop(buf)
return buf
def show(self):
print("[Table(%s)]" % (self.tag))
print(" version = 0x%08x" % (self.version))
print(" Ascender = %d" % (self.Ascender))
print(" Descender = %d" % (self.Descender))
print(" LineGap = %d" % (self.LineGap))
p... | |
<reponame>kdlucas/pyrering
#!/usr/bin/python
#
# Copyright 2008 Google 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... | |
# Currently our impl does not remove duplicate objectIds
assert object_ids.available() == 5
else:
with pytest.raises(errors.PermissionDenied):
self.session.get_composition_ids_by_repositories([self.fake_id])
def test_get_compositions_by_repositories(self):
"""Tests get_compositions_by_repositories"""
# From tes... | |
# Discord
import discord
from discord.ext import commands
from cogs.utils.dataIO import dataIO
from .utils import checks
from __main__ import send_cmd_help
# Others
import os
from copy import deepcopy, copy
import datetime
import time
import math
import random
try:
import validators
validatorsAvail = True
except:
va... | |
value <= 70.0
Args:
value (float): value for IDD Field `Dry-Bulb Temperature Range 3 Lower Limit`
Raises:
ValueError: if `value` is not a valid value
Returns:
float: the value of `drybulb_temperature_range_3_lower_limit` or None if not set
"""
return self["Dry-Bulb Temperature Range 3 Lower Limit"]
@drybul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.