input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""
Defines the basic objects for CORE emulation: the PyCoreObj base class, along with PyCoreNode,
PyCoreNet, and PyCoreNetIf.
"""
import os
import shutil
import socket
import threading
from socket import AF_INET
from socket import AF_INET6
from core.data import NodeData, LinkData
from core.enumerations import LinkTy... | |
import asyncio
import logging
import time
from pathlib import Path
from typing import List, Optional, Tuple, Dict, Callable
from src.util.byte_types import hexstr_to_bytes
from src.util.keychain import (
generate_mnemonic,
bytes_to_mnemonic,
)
from src.util.path import path_from_root
from src.util.ws_message import... | |
"""Library implementing various Lasagne layers.
"""
import lasagne
import numpy as np
import theano
import theano.tensor as T
from lasagne.layers import Conv1DLayer
from lasagne.layers.dnn import Conv2DDNNLayer
from theano.sandbox.cuda import dnn
import theano_printer
import utils
class MuLogSigmaE... | |
<reponame>rixx/twitter-to-sqlite<gh_stars>100-1000
import datetime
import hashlib
import json
import os
import pathlib
import time
import click
from twitter_to_sqlite import archive
from twitter_to_sqlite import utils
def add_identifier_options(subcommand):
for decorator in reversed(
(
click.argument("identifier... | |
None, 4, None, None, "SenderFlags"),
0x401b: (0x0003, None, None, 4, None, None, "ReceivedByFlags"),
0x401c: (0x0003, None, None, 4, None, None, "ReceivedRepresentingFlags"),
0x401d: (0x0003, None, None, 4, None, None, "OriginalSenderFlags"),
0x401e: (0x0003, None, None, 4, None, None, "OriginalSentRepresentingFlag... | |
+ " [extra note in the script]")
for s, w in symsname[c]:
if w: continue # Weak symbols never conflict with others in different libraries
if s in (
'_init', '_fini',
'__bss_start', '__bss_start__', '__bss_end__', '_bss_end__',
'__data_start', '_edata',
'_end', '__end_... | |
<reponame>c64cryptoboy/ChiptuneSAK<filename>tests/emulatorTests/tests.py
# This program runs <NAME>' C64 test suite (2002, public domain)
# This standard set of tests for C64 emulators can take a LONG time to run
# For now, I'm mostly ignoring C64-specific tests, and focusing on 6502
# instruction tests
#
# Also runs <... | |
import glob
import json
import os
import queue
import random
import threading
import time
from ctypes import *
import cv2
import matplotlib as mpl
import matplotlib.cm as cm
import numpy as np
import PIL.Image as pil
import torch
from torchvision import transforms
import camera_parameters as params
import darknet.dar... | |
natural. The value of logawidth sets the width
of the Gauss in ln(agrain), so for logawidth<<1 this
give a real width of logawidth*agraincm.
wfact : float
Grid width of na sampling points in units
of logawidth. The Gauss distribution of grain sizes is
cut off at agrain * exp(wfact*logawidth) and
agrain * exp(-w... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2011, <NAME>, <NAME>, JRL, CNRS/AIST
from __future__ import print_function
import sys
import pinocchio
from dynamic_graph import plug
from dynamic_graph.sot.core.derivator import Derivator_of_Vector
from dynamic_graph.sot.core.op_point_modifier import OpPointModifier
f... | |
'health_at_a_glance':
health = {}
for key, val in data[category]:
if key not in health:
health[key] = val
else:
health[key].update(val)
data[category] = health
continue
elif isinstance(data[category], list) and data[category]:
for tag in ('label', 'location'):
if tag in data[category][0]:
data[category] = d... | |
# -*- coding: utf-8 -*- {}
import matplotlib.pyplot as plt
import numpy as np
import scipy
import os
import math
from mpmath import *
mp.dps = 25
mp.pretty = True
# part 1:gif_splitfile to txt
# 新建文件夹txt,用于存储原文件的分解文件集。
os.mkdir("C://george//PhD//papers//BHE_sc//result//txt")
# os.chdir(path) 方法用于改变当前工作目录到指定的路径。此处创建路... | |
118800),
(255, 90, 3, 1, 55440),
(256, 91, 3, 1, 332640),
(257, 42, 4, 13, 6652800),
(258, 43, 4, 67, 5702400),
(259, 44, 4, 163, 6652800),
(260, 45, 4, 37, 1774080),
(261, 46, 4, 19, 2851200),
(262, 47, 4, 1, 1900800),
(263, 48, 4, 1, 2217600),
(264, 49, 4, 7, 237600),
(265, 50, 4, 47, 443520),
(266, 51, 4... | |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 24 16:42:34 2020
@author: <NAME>
Additional credit to <NAME> for help with delay & midi, and <NAME> for wavetable positions!
"""
# MySQL connection
from sql_kit import SQL_Kit
import mysql.connector
# import libraries
import numpy as np
import pandas as pd
import matpl... | |
np.array([-1])
else:
return np.ones(shape=(n_clusters, 1)) * -1, np.ones(shape=(n_clusters, 1)) * -1
def random_sample_pixels(image, sample_ratio=0, mode="row-col"):
"""
Randomly sample an amount of pixels from an image based on the given sampled ratio.
Two sampling mode are available.
row-col: sampling first a... | |
{"store_history": True,
"title": "Reconstructed Augmented iSEG After Normalization"}},
every=10), Event.ON_TEST_EPOCH_END) \
.with_event_handler(
PlotCustomVariables(visdom_logger, "Reconstructed Augmented Input iSEG Image", PlotType.IMAGE_PLOT,
params={"opts": {"store_history": True,
"title": "Reconstructed Augm... | |
"dog"]
res << a.delete_at(99) #=> nil
return res
""")
assert self.unwrap(space, w_res) == ["cat", ["ant", "bat", "dog"], None]
def test_first(self, space):
assert space.int_w(space.execute("return [1, 2, 3].first")) == 1
assert space.execute("return [].first") == space.w_nil
def test_last(self, space):
asser... | |
if line.lstrip().find('!') == 0 and tokens[0] != '!Ver':
continue
if line.lstrip(' ').find('#') == 0:
#sys.stderr.write('allowed_section_names = ' +
# str(allowed_section_names) + '\n')
if (tokens[0] in allowed_section_names):
section_name = tokens[0]
section_is_auto = tokens[-1].endswith('_auto')
tokens_afte... | |
"""
Support mudule for EPICS Input/Output Controllers (IOCs)
Implements the server side of the Channel Access (CA) protocol, version 4.11.
Author: <NAME>
Date created: 2009-10-31
Date last modified: 2019-11-08
based on: 'Channel Access Protocol Specification', version 4.11
http://epics.cosylab.com/cosyjava/JCA-Common... | |
# -*- coding: UTF-8 -*-
"""
1. Category words
Input : {"tea", "eat", "ate", "run","urn","cool","school"}
Output : {{"tea", "eat", "ate"},{"run","urn"}}
"""
# set and list are unhashable
def category(words):
table = {}
result = []
for word in words:
# Sort the string as list, and use string as hash key
chars = str(... | |
['--segmentation-id', '--segmentation_id']:
self.run_command('share-network-list %s 1234' % command)
self.assert_called(
'GET',
'/share-networks/detail?segmentation_id=1234',
)
cliutils.print_list.assert_called_with(
mock.ANY,
fields=['id', 'name'])
@mock.patch.object(cliutils, 'print_list', mock.Mock())
def... | |
"""
Module with function for running in parallel and doing cleanups after runs etc.
BE AWARE: This module is not completely safe for use on multiple computers
with shared file system. In particular, it's not safe to start init or
cleanup at the same time as anything else.
@author = Joel
"""
import numpy as np
import ... | |
# Tests of the quasiisothermaldf module
from __future__ import print_function, division
import numpy
#fiducial setup uses these
from galpy.potential import MWPotential, vcirc, omegac, epifreq, verticalfreq
from galpy.actionAngle import actionAngleAdiabatic, actionAngleStaeckel
from galpy.df import quasiisothermaldf
aAA... | |
<reponame>jpazdera/PazdKaha22<filename>Experiment/ltpFR3_MTurk/ListGen/ltpFR3_listgen.py<gh_stars>0
#!/usr/bin/env python2
import random
import itertools
import numpy
import sys
import json
import copy
def make_bins_ltpFR3(semArray):
"""
Creates four equal-width bins of WAS scores, identical to those used in ltpFR2... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2019/5/15
@Author : AnNing
"""
from __future__ import print_function
import os
import sys
import numpy as np
from initialize import load_yaml_file
from load import ReadAhiL1
TEST = True
def ndsi(in_file_l1, in_file_geo, in_file_cloud):
# -----------------... | |
@pulumi.getter
def requested(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "requested")
@requested.setter
def requested(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "requested", value)
@property
@pulumi.getter(name="resourceId")
def resource_id(self) -> Optional[pulumi.Input[str... | |
else:
ws_conn_string = "wss://%s/bokeh/sub" % split.netloc
f_dict = dict(
docid = sess.docid,
ws_conn_string = ws_conn_string,
docapikey = sess.apikey,
root_url = base_url,
modelid = modelid,
modeltype = typename,
script_url = base_url + "/bokeh/embed.js")
e_str = '''<script src="%(script_url)s" bokeh_plotty... | |
params[0]
return np.array([[1, 0], [0, cmath.exp(1j * phi)]])
@staticmethod
def decomposition(phi, wires):
return [PhaseShift(phi, wires=wires)]
def adjoint(self):
return U1(-self.data[0], wires=self.wires)
class U2(Operation):
r"""U2(phi, lambda, wires)
U2 gate.
.. math::
U_2(\phi, \lambda) = \frac{1}{... | |
<filename>libdarknet/Bridge.py
'''Darknet_zed auxillary code developed for 3D object detection by Reachy.
Developed by :- <NAME>
Supervisors :- <NAME>, <NAME>
This package contains code developed for the ZED Camera 2 running on Jetson tx2.'''
import io
import math
import random
import socket
import statistics
import... | |
use_only=False)
model.set_all_beta(2, use_only=False)
elif args.init_to_smallest:
model.set_all_alpha(er=3, k=3, se=0.25 if args.force_se else 0, use_only=False)
model.set_all_beta(2, use_only=False)
elif args.init_to_biggest:
model.set_last_alpha(use_only=False)
model.set_last_beta(use_only=False)
elif arg... | |
<reponame>fruch/pbs
#===============================================================================
# Copyright (C) 2011-2012 by <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software wit... | |
(source and os.path.exists(source)):
logger.error("Source file or directory does not exist: {}".format(source))
sys.exit(-1)
if source.endswith("/") or source.endswith("\\"):
suite_name = get_file_name(get_file_path(source))
else:
suite_name = get_file_name(source)
if os.path.isdir(source):
files = get_dir_fi... | |
<filename>tefla/core/eval_metrices.py<gh_stars>10-100
"""
Evaluation API for evaluation matrices and plots, supports classification and regression both.
"""
import math
from ast import literal_eval
from collections import defaultdict, Counter
from statistics import mean
import numpy as np
import pandas as pd
from skl... | |
# coding: utf-8
"""
cloudFPGA Resource Manager API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re... | |
<filename>workflows/segmine/library.py
'''
Segmine library.
@author: <NAME> <<EMAIL>>
'''
from biomine import BiomineSearch
from segs import Segs
import logging
#
# Visualization widgets:
#
def segmine_rank_plotter(input_dict):
return {}
def segmine_biomine_visualizer(input_dict):
return {'graph' : input_dict.get... | |
for distance, meters/second for speed etc
if not isinstance(reference_speed, speed_type):
reference_speed = reference_speed * speed
if not isinstance(reference_height, distance_type):
reference_height = reference_height * distance
if not isinstance(aerodynamic_roughness, distance_type):
aerodynamic_roughness = ... | |
<reponame>zhafen/linefinder
#!/usr/bin/env python
'''Testing for classify.py
@author: <NAME>
@contact: <EMAIL>
@status: Development
'''
import h5py
from mock import patch, PropertyMock
import numpy as np
import numpy.testing as npt
import os
import pandas as pd
import pdb
import unittest
import galaxy_dive.read_data... | |
not in biom_types:
raise ValueError(
'The observable could not be found in the observable column.')
# Get dose information
mask = data[dose_key].notnull()
dose_data = data[mask][[time_key, dose_key, dose_duration_key]]
# Mask data for observable
mask = data[obs_key] == observable
data = data[mask][[time_key, ... | |
"""Text transitions used for segment displays."""
import abc
from typing import Optional, List
from mpf.core.placeholder_manager import TextTemplate
from mpf.core.rgb_color import RGBColor
from mpf.devices.segment_display.segment_display_text import SegmentDisplayText, UncoloredSegmentDisplayText
STEP_OUT_OF_RANGE_ER... | |
<reponame>shivgarg/ai_game<gh_stars>0
import socket, sys, time
from Tkinter import *
from math import floor
from GameStack import GameStack
import Helpers as h
from sys import argv
from time import sleep
from threading import Thread
from threading import Timer
import time
import select
# TODO - print graph
socket_lis... | |
from __future__ import division
import collections
import re
import time
R_C_thres = 0.999
# file = codecs.open('out2.txt', 'r','utf-8') # for original utf with diacritics, does not help much
file = open('out2.txt', 'r')
texts = file.readlines()
file.close()
# taken from winLen.xls -- the numbers of documents for t... | |
per_split is False, num_splits=1 for the 'sqrt_covariance' only.
"""
assert imap.ndim in range(2, 6)
imap = atleast_nd(imap, 5)
num_arrays, num_splits, num_pol = imap.shape[:-2]
if mode == 'fft':
# get the power -- since filtering maps by their own power, only need diagonal.
# also apply mask correction
kmap ... | |
features
# MACCS feature: 130
atomic_mapping = MACCSFeaturizer.maccs_count_features_mapping(maccs_idx, substructures, num_atoms,
atomic_mapping, feature_idx1=124,
feature_idx2=130)
# MACCS feature: 127
atomic_mapping = MACCSFeaturizer.maccs_count_features_mapping(maccs_idx, substructures, num_atoms,
atomic_mapp... | |
<reponame>GruDev325/graphql-python-api
from typing import List, Optional
from ..error import GraphQLSyntaxError
from .ast import Token
from .block_string import dedent_block_string_value
from .source import Source
from .token_kind import TokenKind
__all__ = ["Lexer", "is_punctuator_token_kind"]
_punctuator_token_ki... | |
i2] = [alti1, alti2]
w[i2, i1] = [0, 1]
other[i2, i1] = [alti2, alti1]
elif symetrize:
w[i1, i2] = [0.5, 0.5]
other[i1, i2] = [i1 + mp, i2 - mp]
w[i2, i1] = [0.5, 0.5]
other[i2, i1] = [i2 - mp, i1 + mp]
elif i1 >= mt + me:
# BB
if P_track_T:
w[i1, i2] = [0, 1]
other[i1, i2] = [alti1, alti2]
w[i2, i1] = [0,... | |
<filename>pyfda/tree_builder.py<gh_stars>1-10
# -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Create the tree d... | |
item by id for imageFolders.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.portals_id_image_folders_fk_... | |
<filename>cogs/verify.py
"""
MIT License
Copyright (c) 2020 BobDotCom
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mo... | |
UnequipItemsSetMacro():
_unequip_itemsset_macro()
def Undress():
tmp = []
client_version_int = GetClientVersionInt()
if client_version_int < 7007400:
delay = GetDressSpeed()
char = Self()
backpack = Backpack()
for layer in _wearable_layers:
item = ObjAtLayerEx(layer, char)
if item:
tmp.append(MoveItem(item... | |
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.db import connection
from django.db import IntegrityError
from django.utils.text import slugify
from build.management.commands.base_build import Command as BaseBuild
from mutation.models import *
from common... | |
was the last accessed date.
"""
print("= Method 2g: Get substring with ...")
print(" re.findall(r'[\"](.*?)[\"]', string).")
# Enumerate all the test strings.
for current_test_string in my_strings:
for values in re.findall(r'["](.*?)["]', current_test_string):
my_substrings.append(values)
#print("values are:",valu... | |
<reponame>marses/tiltx
"""
Created on Thu May 16 18:53:46 2019
@author: seslija
"""
import numpy
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from scipy import integrate
def detect_cusum(x, threshold=1, drift=0, ending=False):
"""Cumulative sum algorithm (CUSUM) to detect abrupt changes i... | |
<reponame>23doors/pulumi-gcp
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import ut... | |
"""
Basic linear algebra operations as defined on the parameter sets of entire models.
We can think of these list as a single vectors consisting of all the individual
parameter values. The functions in this module implement basic linear algebra
operations on such lists.
The operations defined in the module follow the... | |
:return: AmendmentPagedMetadata
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['lower_threshold', 'upper_threshold', 'organizations', 'offset', 'records', 'order_by', 'order']
all_params.append('callback')
all_params.append('_return_http_data_only')
params = locals()
for... | |
import json
import os
from nose.tools import *
from lxml import etree as ET
from mets_dnx import factory as mdf
CURRENT_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)))
mets_dnx_nsmap = {
'mets': 'http://www.loc.gov/METS/',
'dnx': 'http://www.exlibrisgroup.com/dps/dnx'
}
def test_mets_dnx():
"""... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 15:02:49 2018
@author: <NAME>
"""
# Last modified: 03.07.2018 00:08:28 Yuanyuan Wang
# Improved logging and exit code
# Last modified: 09.07.2018 12:01:00 Jingliang Hu
# update function 'getTiffExtent' to get EPSG code from tiff ROI
# Last modified: 10.07.2018 14:0... | |
<reponame>asabyr/LensTools<filename>lenstools/image/shear.py
"""
.. module:: shear
:platform: Unix
:synopsis: This module implements a set of operations which are usually performed on weak lensing shear maps
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from __future__ import division
from ..extern import _topology
... | |
file for a custom model is limited to 10 MB.
* Use a *parallel corpus* when you want your custom model to learn from general
translation patterns in parallel sentences in your samples. What your model learns
from a parallel corpus can improve translation results for input text that the
model has not been trained on... | |
import logging
import copy
import re
import avi.migrationtools.f5_converter.converter_constants as conv_const
from avi.migrationtools.f5_converter.conversion_util import F5Util
from avi.migrationtools.avi_migration_utils import update_count
LOG = logging.getLogger(__name__)
# Creating f5 object for util library.
conv_u... | |
<filename>lib/rucio/tests/temp_factories.py
# -*- coding: utf-8 -*-
# Copyright 2021-2022 CERN
#
# 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
#... | |
"sgn-CH-DE"
regular = "art-lojban" ; these tags match the 'langtag'
/ "cel-gaulish" ; production, but their subtags
/ "no-bok" ; are not extended language
/ "no-nyn" ; or variant subtags: their meaning
/ "zh-guoyu" ; is defined by their registration
/ "zh-hakka" ; and all of these are deprecated
/ "zh-min" ; in ... | |
options = dict(
verbose=True,
model_extensions=[
'h2o.model.extensions.ScoringHistoryTrees',
'h2o.model.extensions.VariableImportance',
'h2o.model.extensions.FeatureInteraction',
'h2o.model.extensions.Trees',
'h2o.model.extensions.HStatistic',
],
)
def update_param(name, param):
if name == 'distribution':
p... | |
= self.elements["_eteam"]
if len(myteam.get_active_members(camp)) < 1:
self.obj.win(camp, 100)
class BAM_DefeatTheBandits(Plot):
LABEL = BAMO_DEFEAT_THE_BANDITS
active = True
scope = "LOCALE"
def custom_init(self, nart):
myscene = self.elements["LOCALE"]
myfac = self.elements.get("ENEMY_FACTION")
roomtype ... | |
<reponame>rajeevratan84/siamese_network_laser<filename>db.py
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from os import listdir
from pathlib import Path
from os.path import isfile, join
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.model_selection impor... | |
#
# Contains the OpenCL transformation module
#
import json
from functools import reduce
import orio.main.util.globals as g
import orio.module.loop.ast_lib.common_lib
import orio.module.loop.ast_lib.forloop_lib
from orio.module.loop.ast import *
INCLUDES = r'''
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#incl... | |
:param value: Required. The parameter value of fabric setting.
:type value: str
"""
_validation = {
'name': {'required': True},
'value': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}
def __init__(
self,
*,
name: str,
value:... | |
<filename>python-code/robot.py
import numpy as np
import scipy
from scipy.linalg import block_diag
import math
import quaternion
class rJoint:
def __init__(self, alpha, a, theta, offset, d, type, inertia, m, r):
self.alpha = alpha
self.a = a
self.offset = offset
self.theta = theta
self.d = d
self.type = type
... | |
<reponame>xiaoxiaoxh/OMAD
import argparse
import numpy as np
import os.path as osp
import open3d as o3d
import tqdm
import copy
import time
import os
import psutil
import mmcv
import torch.utils.data
from matplotlib import cm
import torch.multiprocessing as mp
from scipy.spatial.transform import Rotation as R
from data... | |
# The 6.00 Word Game
import random
import string
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HAND_SIZE = 7
SCRABBLE_LETTER_VALUES = {
'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, 'v'... | |
import discord
import random
from helpcommands import *
from elo import *
from datetime import datetime
from random import shuffle,randint
client = discord.Client()
busyChannels = []
game = discord.Game(name="Perudo")
diefaces = 6 #Number of faces on a die
startingdice = 5 #How many dice each player starts with
maxpl... | |
from datetime import date, datetime, timedelta
from markdown import markdown
import json
import time
from django.core.cache import cache
from django.core.mail import EmailMessage, send_mail
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Max, Min, Q
from django.ut... | |
<filename>swift/internal/providers.bzl
# Copyright 2018 The Bazel 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
... | |
each layer of the GraphSAGE model.
The supplied graph should be a StellarGraph object with node features for all node types.
Use the :meth:`flow` method supplying the nodes and (optionally) targets
to get an object that can be used as a Keras data generator.
The generator should be given the ``(src,dst)`` node t... | |
--------------
3
References
==========
- http://en.wikipedia.org/wiki/Homogeneous_differential_equation
- <NAME> & <NAME>, "Ordinary Differential Equations",
Dover 1963, pp. 59
# indirect doctest
"""
x = func.args[0]
f = func.func
u = Dummy('u')
u2 = Dummy('u2') # u2 == x/f(x)
r = match # d+e*diff(f(x)... | |
<filename>canopygrid.py
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 24 11:01:50 2017
@author: slauniai
******************************************************************************
CanopyGrid:
Gridded canopy and snow hydrology model for SpaFHy -integration
Based on simple schemes for computing water flows and st... | |
'owner' ]
name = repository_info_dict[ 'name' ]
changeset_revision = repository_to_install_dict[ 'changeset_revision' ]
repository_id = repository_to_install_dict[ 'repository_id' ]
# We are testing deprecated repositories, because it is possible that a deprecated repository contains valid
# and functionally corr... | |
#!/usr/bin/env python
"""
Extracts data from XNAT archive folders into a few well-known formats.
Usage:
dm_xnat_extract.py [options] <study> [-t <tag>]...
dm_xnat_extract.py [options] <study> <session> [-t <tag>]...
Arguments:
<study> Nickname of the study to process
<session> Fullname of the session to process
... | |
"EEB59D"
},
"776" : {
"number" : "776",
"name" : "greenapple",
"title" : u"\u9752\u308a\u3093\u3054",
"sjis" : "F45E",
"unicode" : "EB5A",
"jis-email" : "7B3F",
"sjis-email" : "EE5E",
"utf-8" : "EEB59E"
},
"777" : {
"number" : "777",
"name" : "bill",
"title" : u"\u7fbd\u306e\u306f\u3048\u305f\u304a\u672d... | |
<reponame>hkotaro1215/invest<filename>src/natcap/invest/coastal_blue_carbon/coastal_blue_carbon.py
# -*- coding: utf-8 -*-
"""Coastal Blue Carbon Model."""
from __future__ import absolute_import
import os
import logging
import math
import itertools
import time
import re
import csv
import numpy
from osgeo import gdal
... | |
"""
Get whether this task has been completed.
:return: Whether this task has been completed.
"""
return self.get_complete_date() is not None
def get_short_repr(self) -> typing.Optional[str]:
"""
Get the short representation of this task.
This is can be used to reference this task across Ryver.
It has the f... | |
from functools import partial
from os.path import join, dirname
import pandas as pd
import talib
from Query import Query
from bokeh.io import curdoc
from bokeh.layouts import column, layout, row
from bokeh.models import Button, Select, TextInput, ColumnDataSource, DataTable, TableColumn, Div, Tabs, Panel, \
... | |
' % vm_str
if 'msg_cat' in self._log_prefixes :
line += '%s' % line_data.msg_cat
missing_spaces = 8 - len( line_data.msg_cat )
line += ' ' * missing_spaces
if self._log_prefixes :
line += '|'
line += line_data.msg_rest
else :
# remove the first char (a space)
line += line_data.msg_rest[1:]
current_item = ... | |
pending messages
in the queue have been processed.
"""
while self.messages_pending():
await self.do_work_async()
async def send_message_async(self, messages, close_on_done=False):
"""Send a single message or batched message asynchronously.
:param messages: A message to send. This can either be a single instanc... | |
in arrayName:
fctName, params = str2FctParams(arrayName)
#print("Function : %s(%s)"%(fctName, ",".join(params)))
fct = getSubAttr(obj, fctName)
paramsNameFirstIdxNbFloats = list()
for param in params:
#print("param :", param)
nameFirstIdxNbFloats = infoArray(objName, param, arrayNames2Info)
if nameFirstIdxNbFlo... | |
<filename>TopQuarkAnalysis/Configuration/test/patRefSel_muJets_cfg.py
from __future__ import print_function
# As of 1 Feb 2017:
# This configuration appears to be already broken in more
# than one way. It fails to even run only under python.
# For this reason, it was not converted to use Tasks.
# If it is ever fixed, i... | |
<filename>det3d/models/bbox_heads/clear_mg_ohs_head.py
# Copyright (c) Gorilla-Lab. All rights reserved.
import logging
from functools import partial
from collections import defaultdict
from typing import Dict, List, Optional, Sequence
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as... | |
""" gameEngine.py
high-level tools to simplify pygame programming
for Game Programming - The L-Line
by <NAME>, 2006
Version 1.1 - incorporates drawTrace() method and
replaces all default fonts with direct call to
freesansbold.ttf (pygame's standard font.) This is done
because py2exe doesn't seem to like system... | |
'x_iam_token'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected ke... | |
contribution scalar multiple.
avg_price_length: determines length of average of price series.
avg_research_length: determines length of average of research series.
"""
# Splits out the price/research df to individual pandas Series.
price = dataframe[PandasEnum.MID.value]
research = dataframe["research"]
# Calc... | |
from NER.utils import *
from NER.embedding import embed
import torch
import matplotlib.pyplot as plt
# single Task
class rnn_single_crf(nn.Module):
def __init__(self, cti_size, wti_size, num_tags , params):
super().__init__()
self.rnn = rnn(cti_size, wti_size, num_tags , params)
self.crf = crf(num_tags , params)
... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
<filename>SeisSrcInv/plot.py
#!python
#-----------------------------------------------------------------------------------------------------------------------------------------
# Script Description:
# Script to take unconstrained moment tensor or DC or single force inversion result (from full waveform inversion) and ... | |
some well-defined way of referencing a part of an object.'
aliases:
- storageos_secret_ref_field_path
spec_storageos_secret_ref_kind:
description:
- Kind of the referent.
aliases:
- storageos_secret_ref_kind
spec_storageos_secret_ref_name:
description:
- Name of the referent.
aliases:
- storageos_secret_ref... | |
"""Collection of classes for display styling."""
# pylint: disable=C0302
# pylint: disable=too-many-instance-attributes
import numpy as np
from magpylib._src.defaults.defaults_utility import color_validator
from magpylib._src.defaults.defaults_utility import get_defaults_dict
from magpylib._src.defaults.defaults_utili... | |
tpimport_lines += f'{line}\n'
if part == 'sender':
import_lines += ('from efro.message import MessageSender,'
' BoundMessageSender')
tpimport_typing_extras = ''
else:
if single_message_type:
import_lines += ('from efro.message import (MessageReceiver,'
' BoundMessageReceiver, Message, Response)')
else:
impor... | |
* uk_33
+ 25 * uk_34
+ 2304 * uk_35
+ 4368 * uk_36
+ 10416 * uk_37
+ 240 * uk_38
+ 8281 * uk_39
+ 5 * uk_4
+ 19747 * uk_40
+ 455 * uk_41
+ 47089 * uk_42
+ 1085 * uk_43
+ 25 * uk_44
+ 106179944855977 * uk_45
+ 141265316367 * uk_46
+ 73996118097 * uk_47
+ 11211533045 * uk_48
+ 107630717232 * uk_49
+ 48 ... | |
%(DFMapping__columns)s
:param kwargs: passed to transform
:param kwargs_fit: passed to fit
:return: see transform
"""
if kwargs_fit is None:
kwargs_fit = {}
self.fit(df=df, col_names=col_names, values=values, columns=columns, **kwargs_fit)
return self.transform(df=df, col_names=col_names, values=values, columns... | |
using :func:`torch.linalg.norm`.
For example, `torch.linalg.norm(A, ord=1, dim=(0, 1))` always
computes a matrix norm, but with `torch.linalg.vector_norm(A, ord=1, dim=(0, 1))` it is possible
to compute a vector norm over the two dimensions.
Args:
A (Tensor): tensor of shape `(*, n)` or `(*, m, n)` where `*` is ze... | |
")
return(4,None,False,None)
rft.sessionLink=r.headers["Location"]
rft.cleanupOnExit=cleanupOnExit
rft.printStatus(3,r=r,addSessionLoginInfo=True)
return(rc,r,j,d)
def rfSessionDelete(self,rft,cmdTop=False,sessionLink=None):
rft.printVerbose(4,"Transport: in Session Delete (Logout)")
#if session link w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.