input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
'
options += 'rounded corners=%s' % polygon["curve"]["corner_radius"]
bend_options = 'bend left=%s' % polygon["curve"]["bend_angle"]
points = "%s" % ((f') to [{bend_options}] (').join(polygon["points"]))
return_string += "\\draw[%s] (%s) to[%s] cycle;\n" % (options, points, bend_options)
elif polygon["curve"]["str... | |
import datetime
from datetime import timedelta
from decimal import Decimal
from bs4 import BeautifulSoup
from django.conf import settings
from django.test import TestCase
from django.utils.timezone import now
from pretix.base.models import (
CartPosition, Event, Item, ItemCategory, ItemVariation, Organizer,
Questio... | |
1), 2), 2)
sol = np.array([[5, 5], [5, 5]], dtype='i4')
out = xr.DataArray(sol, coords=[lincoords, logcoords],
dims=['y', 'log_x'])
assert_eq_xr(c_logx.points(ddf, 'log_x', 'y', ds.count('i32')), out)
out = xr.DataArray(sol, coords=[logcoords, lincoords],
dims=['log_y', 'x'])
assert_eq_xr(c_logy.points(ddf, 'x'... | |
<reponame>mdop-wh/pulumi-aws<gh_stars>0
# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping... | |
while cacheStatus != Results.CacheStatus.VALID and time_now < timeout:
gevent.sleep()
time_now = monotonic()
if cacheStatus == Results.CacheStatus.VALID:
if win_condition == WinCondition.NONE:
leaderboard = random.sample(results['by_race_time'], len(results['by_race_time']))
else:
leaderboard = results[results... | |
import py_trees
import random
import carla
from srunner.scenariomanager.carla_data_provider import CarlaDataProvider
from srunner.scenariomanager.scenarioatomics.atomic_behaviors import \
ActorDestroy, ActorTransformSetter, ActorRotationSetter, KeepVelocity
from srunner.scenariomanager.scenarioatomics.atomic_criteria... | |
242172 * uk_98
+ 25200 * uk_99,
uk_0
+ 47353 * uk_1
+ 2983239 * uk_10
+ 204120 * uk_100
+ 328104 * uk_101
+ 7560 * uk_102
+ 1148175 * uk_103
+ 1845585 * uk_104
+ 42525 * uk_105
+ 2966607 * uk_106
+ 68355 * uk_107
+ 1575 * uk_108
+ 1092727 * uk_109
+ 4877359 * uk_11
+ 53045 * uk_110
+ 254616 * uk_111
+... | |
credentials are compromised, they can be used from outside of the AWS account they give access to. In contrast, in order to leverage role permissions an attacker would need to gain and maintain access to a specific instance to use the privileges associated with it.',
'vulnerability' : 'AWS access from within AWS insta... | |
you are interested in the samples 10, 80, and 140, and want to
know their class name.
>>> from sklearn.datasets import load_wine
>>> data = load_wine()
>>> data.target[[10, 80, 140]]
array([0, 1, 2])
>>> list(data.target_names)
['class_0', 'class_1', 'class_2']
"""
module_path = dirname(__file__)
... | |
None), 3: ('C', 1, None)},
{frozenset({1, 3}): (1, None)}),
2: ({0: ('C', 3, None), 2: ('C', 1, None), 4: ('C', 1, None)},
{frozenset({0, 2}): (1, None), frozenset({2, 4}): (1, None)}),
3: ({1: ('C', 3, None), 3: ('C', 1, None), 5: ('C', 1, None)},
{frozenset({1, 3}): (1, None), frozenset({3, 5}): (1, None)}),
4:... | |
"""Audio queue management."""
import asyncio
import atexit
import collections
import copy
import discord
import enum
import json
import os
import queue
import subprocess
import threading
import time
import uuid
from typing import cast, Any, Awaitable, Callable, Deque, List, Optional
import uita.exceptions
import uita.... | |
# @classmethod
# def _validate_step_and_value(cls, values) -> Numeric:
# value, min, max, step = values["value"], values["min"], values["max"], values["step"]
# if value is not None:
# if value != max and value + step > max:
# raise ValueError(
# f"invalid range: adding step to value is greater than max ({cls.hu... | |
# -*- coding: utf-8 -*-
## Copyright 2009-2021 NTESS. Under the terms
## of Contract DE-NA0003525 with NTESS, the U.S.
## Government retains certain rights in this software.
##
## Copyright (c) 2009-2021, NTESS
## All rights reserved.
##
## This file is part of the SST software package. For license
## information, see... | |
#encoding=utf-8
from nltk.corpus import stopwords
from sklearn.preprocessing import LabelEncoder
from sklearn.pipeline import FeatureUnion
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.linear_model import Ridge
from scipy.sparse import hstack, csr_matrix
import pandas as pd
i... | |
"""
A Vocabulary maps strings to integers, allowing for strings to be mapped to an
out-of-vocabulary token.
"""
import codecs
import logging
import os
from collections import defaultdict
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Union
from typing import TextIO # pylint: disable=unused-impo... | |
<reponame>pandas9/txt2dream
from pathlib import Path
import io
import sys
import os
import math
import numpy as np
import requests
import json
import kornia.augmentation as K
from base64 import b64encode
from omegaconf import OmegaConf
import imageio
from PIL import ImageFile, Image
ImageFile.LOAD_TRUNCATED_IMAGES ... | |
import os
from typing import Dict, Optional
import numpy as np
import pandas as pd
from scipy.signal import correlate
from . import ShakeExtractor, helpers
from .abstract_extractor import AbstractExtractor
from .helpers import normalize, get_equidistant_signals
from .log import logger
from .synchronization_errors imp... | |
<filename>tap/utils.py
from argparse import ArgumentParser, ArgumentTypeError
from base64 import b64encode, b64decode
from collections import OrderedDict
import copy
from functools import wraps
import inspect
from io import StringIO
from json import JSONEncoder
import os
import pickle
import re
import subprocess
import... | |
from enum import Enum
from typing import (List, Mapping, Sequence, Optional, MutableSequence,
TypeVar, Any, FrozenSet, MutableSet, Set, MutableMapping,
Dict, Tuple, _Union)
from ._compat import lru_cache, unicode, bytes, is_py2
from .disambiguators import create_uniq_field_dis_func
from .multistrategy_dispatch import... | |
<gh_stars>1-10
"""camera_module.py: Cobblr module that uses PiTFT and RPi camera to take pictures."""
__author__ = '<NAME>'
__credit__ = ['<NAME>', '<name of persons>']
__license__ = "GPL"
__version__ = "1.0.1"
__email__ = "<EMAIL>"
from engine import Screen
from engine import Utilities
from engine import TextWriter
f... | |
pulumi.Input[str] ttl_as_iso8601: The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
"""
if lock_duration_as_iso8601 is not None:
pulumi.set(__self__, "lock_duration_as_... | |
<reponame>evenmarbles/rlpy<gh_stars>1-10
from __future__ import division, print_function, absolute_import
# noinspection PyUnresolvedReferences
from six.moves import range
from abc import ABCMeta, abstractmethod
import numpy as np
from ...optimize.algorithms import EM
from ...auxiliary.array import normalize
from ...... | |
from __future__ import annotations
import os
from tkinter import Variable
from typing import Union
import numpy as np
from survey_stats.functions import *
class Data_Types:
cross = 'cross'
time = 'time'
panel = 'panel'
class Data:
"""
type: 'cross', 'time', 'panel'
"""
def __init__(self, type:str='cross', val... | |
<gh_stars>0
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2004-2005 <NAME> and <NAME>
# Copyright (C) 2012-2014 <NAME>
from re import compile, escape, IGNORECASE, sub
from os.path import splitext
from ..scraper import _BasicScraper
from ..helpers import indirectStarter, bounceStarter
from ..util import tagre, getPageCo... | |
from __future__ import print_function, division
import json
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import initializers
from einops.layers.tensorflow import Rearrange
import os
class WGAN_GP(keras.Model):
def __init__(self, ro... | |
or points.
SET3 entries are referenced by:
- NX
- ACMODL
- PANEL
- MSC
- PBMSECT
- PBRSECT
- RFORCE
- ELEM only (SOL 600)
- DEACTEL
- ELEM only (SOL 400)
- RBAR, RBAR1, RBE1, RBE2, RBE2GS, RBE3, RROD,
RSPLINE, RSSCON, RTRPLT and RTRPLT1
- RBEin / RBEex only
- ELSIDi / XELSIDi
- ELEM only
- NDSIDi
- G... | |
# Copyright (c) 2014-2019, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | |
<filename>strangefish/strangefish.py
import multiprocessing as mp
import os
from collections import defaultdict
from functools import partial
from time import time
from tqdm import tqdm
from typing import Optional, List, Tuple, Set, Callable
import chess.engine
from reconchess import Player, Color, GameHistory, WinRea... | |
invoice.
Note that when a readonly action actually *does* modify the
object, Lino won't "notice" it.
Discussion
Maybe we should change the name `readonly` to `modifying` or
`writing` (and set the default value `False`). Because for the
application developer that looks more natural. Or --maybe better
but proba... | |
<reponame>AMANKANOJIYA/Numerical_Analysis<filename>Numerical_Analysis_Aman/Numerical_Analysis.py
"""
Auther : <NAME>
--------------------------------------------------------------------------
| Numerical-ANALYSIS (Nuerical Methods) |
--------------------------------------------------------------------------
* Creater ... | |
import datetime
import os
import struct
from sys import version_info
import spats_shape_seq
from spats_shape_seq.mask import match_mask_optimized, Mask
# not currently used in spats, but potentially useful for tools
class FastqRecord(object):
def __init__(self):
self.recordNumber = 0
self.reset()
def reset(se... | |
is None or len(points)<1 :
self._cpoints = zeros((0,2))
else :
self._cpoints = points
self._update()
@property
def dpoints(self):
u"""
Les points discretises, sont recalculés
- si _update() a été appelé (_dpoints a été supprimé) ou bien
- si self.precision a changé
Si on veut des dpoints aux abscisses T=(t1... | |
& 7, self.pmm[5] >> 3 & 7, self.pmm[5] >> 6
timeout = 302.1E-6 * ((b + 1) * len(block_list) + a + 1) * 4**e
data = bytearray([
len(service_list)]) \
+ b''.join([sc.pack() for sc in service_list]) \
+ bytearray([len(block_list)]) \
+ b''.join([bc.pack() for bc in block_list])
log.debug("read w/o encryption serv... | |
{
"109132": ("Joint position method", []),
},
"JointVarianceOfGLCM": {
"128783": ("Joint Variance of GLCM", []),
},
"JuvenilePapillomatosis": {
"111277": ("Juvenile papillomatosis", [6030, 6031]),
},
"KVP": {
"113733": ("KVP", []),
},
"KeepVeinOpenEnded": {
"130162": ("Keep vein open ended", [71]),
},
"K... | |
following meaning: -1 = Couldn't retrieve data in
PostArrayTraceMessage, -999 = Couldn't communicate with Zemax,
-998 = timeout reached
Examples
--------
>>> n = 9**2
>>> nx = np.linspace(-1, 1, np.sqrt(n))
>>> hx, hy = np.meshgrid(nx, nx)
>>> hx, hy = hx.flatten().tolist(), hy.flatten().tolist()
>>> rayData... | |
import numpy as np
import warnings
from collections import defaultdict
from scipy.spatial.distance import cdist as sp_cdist
from typing import Callable
from .base_viewer import BaseViewer
from ..cooking_machine import BaseDataset
# If change, also modify docstring for view()
METRICS_NAMES = [
'jensenshannon', 'euc... | |
<filename>studies/budget_components_coupling/plot_tendencies_MMC_speed.py
# -*- coding: utf-8 -*-
"""
Mesoscale Tendencies: Sensitivity to spatial and temporal averaging
Created on Tue Apr 19 04:53:49 2016
@author: cener
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import ... | |
may be
the ``Type`` returned in ``get_record_types()`` or any of its
parents in a ``Type`` hierarchy where
``has_record_type(gradebook_column_record_type)`` is ``true`` .
:param gradebook_column_record_type: the type of the record to retrieve
:type gradebook_column_record_type: ``osid.type.Type``
:return: the gr... | |
'''
Created on Jan 15, 2020
@author: bsana
'''
from os.path import join
import sys,datetime
import pandas as pd
OUT_SEP = ' '
COUNTY_FIPS = [37,59]
if __name__ == '__main__':
if len(sys.argv)<2:
print('Please provide a control file which contains all the required input parameters as an argument!')
else:
print(... | |
size
:param str sort: Sorting RSQL
:param str q: RSQL Query
:return: ProductVersionPage
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.get_product_versions_with_http_info(id, **kwargs)
else:
(data) = self.... | |
# !/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import numpy as np
import tensorflow as tf
import time
import os
from sys import path
import tf_util as U
from maddpg import MADDPGAgentTrainer
# from maddpg import MADDPGEnsembleAgentTrainer
import tensorflow.contrib.layers as layers
# from tf_slim import laye... | |
<filename>5-Filtri/ukazi.py<gh_stars>1-10
# Autogenerated with SMOP 0.32-7-gcce8558
from smop.core import *
from matplotlib.pyplot import *
from numpy import *
#
' <NAME>'
'-------------------------------------------------------------------'
# filtriranje v frekvennem prostoru
close_('all')
clc
Fsamp=1024
# /media/m... | |
<reponame>gony0/buffalo
# -*- coding: utf-8 -*-
from buffalo.misc.aux import InputOptions, Option
class AlgoOption(InputOptions):
def __init__(self, *args, **kwargs):
super(AlgoOption, self).__init__(*args, **kwargs)
def get_default_option(self):
"""Default options for Algo classes.
:ivar bool evaluation_on_le... | |
<gh_stars>0
# This comoponent contains an object-oriented adaptation of the RC model referred to as the 'Simple Hourly Method' in ISO 13790, (superceded by EN ISO 52016-1).
#
# Hive: An educational plugin developed by the A/S chair at ETH Zurich
# This component is based on building_physics.py in the RC_BuildingSimulat... | |
@ x_
assert np.allclose(rom.f_(x_), y_)
assert np.allclose(rom.f_(x_, -1), y_)
kron2c, kron3c = opinf.utils.kron2c, opinf.utils.kron3c
rom = opinf._core._base._DiscreteROM("HGB")
rom.r, rom.m = r, m
rom.H_, rom.G_, rom.B_ = H_, G_, B_
u = np.random.random(m)
x_ = np.random.random(r)
y_ = H_ @ kron2c(x_) + G_ ... | |
<reponame>sandertyu/Simple-Geometry-Plot<filename>bicycleparameters/period.py
#!/usr/bin/env/ python
import os
from math import pi
import numpy as np
from numpy import ma
from scipy.optimize import leastsq
import matplotlib.pyplot as plt
from uncertainties import ufloat
# local modules
from .io import load_pendulum_... | |
'data/_components.tsv')
del os
new = cls.load_from_file(path, index_col=None,
use_default_data=use_default_data, store_data=store_data)
H2O = Component.from_chemical('H2O', Chemical('H2O'),
i_charge=0, f_BOD5_COD=0, f_uBOD_COD=0,
f_Vmass_Totmass=0, description="Water",
particle_size='Soluble',
degradability='U... | |
return "success"
else:
return "redirect"
def browse_books(request):
def get_context():
context = {
'cartCount': getCartCount(request),
'books': Book.objects.all()
}
return context
context = get_context()
if request.method == "POST":
if request.POST.get("search_button"):
save_search(request, query=request... | |
ActionType protobuf.
path_prefix: Prefix to add to the path when reporting errors.
check_spec_class: Whether this method should check the spec proto class.
Raises:
TypingError: If the data doesn't have the expected type.
"""
if check_spec_class:
ProtobufValidator._check_spec_proto_class(
data, spec, action_pb2... | |
import gzip
import importlib
import json
import logging
import sys
import time
import unittest
import zlib
import six
if six.PY3:
from unittest import mock
else:
import mock
from engineio import exceptions
from engineio import packet
from engineio import payload
from engineio import server
import pytest
original... | |
ttimer('calculate new solution',timeit) as t2:
for row in self.stackrows:
self.pronew2d(values, outvalues, row , alfa )
self.solvenew2d(values, outvalues, row , alfa )
self.epinew2d(values, outvalues, row , alfa )
ittotal += 1
with ttimer('extract new solution',timeit) as t2:
now = outvalues[self.stackr... | |
events notifications.
:param pulumi.Input[bool] confidential_issues_events: Enable notifications for confidential issues events.
:param pulumi.Input[bool] confidential_note_events: Enable notifications for confidential note events.
:param pulumi.Input[str] issue_channel: The name of the channel to receive issue even... | |
assert data[0]['file_type'] == 'operator'
assert data[0]['compressed_size_bytes'] == 46445454332
assert data[0]['is_valid_zip']
assert data[0]['is_valid_format']
assert data[0]['md5'] == 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'
else: # api version 2.0
rv = flask_app.get(url_for('{0}.catalog_get_api'.format(api_vers... | |
Optional[str], # pylint: disable=unused-argument
data: Optional[Mapping[str, Any]], # pylint: disable=unused-argument
**_kwargs: Any,
) -> Path:
path = Path(value)
if not path.exists():
raise ValidationError(f'Given path {value} does not exist')
if not path.is_dir():
raise ValidationError(f'Given path {value} ... | |
Objects are equal when all are requested
self.assertEqual(n_random_seqs(aln1, 4), aln1)
# Objects are not equal when subset are requested
self.assertNotEqual(n_random_seqs(aln1, 3), aln1)
# In 1000 iterations, we get at least one different alignment --
# this tests the random selection
different = False
new_al... | |
#! /usr/bin/env python
import os
import string
import remi.gui as gui
from remi_plus import TabView, append_with_label, OKDialog, OKCancelDialog,AdaptableDialog,FileSelectionDialog
from pprint import pprint
from pp_utils import calculate_relative_path
# !!! do not use self.container in dialog sub-classes
# ********... | |
# Generated from Documents\THESE\pycropml_pheno\src\pycropml\antlr_grammarV4\java\java8\Java8Parser.g4 by ANTLR 4.8
from antlr4 import *
if __name__ is not None and "." in __name__:
from .Java8Parser import Java8Parser
else:
from Java8Parser import Java8Parser
# This class defines a complete generic visitor for a pa... | |
<reponame>zhuyongyong/crosswalk-test-suite
#!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyrigh... | |
sigma_x = np.sqrt(self.random_walk * (x_range - 1) + 1) * sigma
sigma_x2 = sigma_x ** 2
a_x = 1 / np.sqrt(2 * np.pi * sigma_x2)
for i in range(len(mu_x)):
conf_ = np.ceil(3 * sigma_x[i]) # multiplication with 3 ensures covering of 99% of the gauss pdf.
x = np.arange(int(max(1, mu_x[i] - conf_)), int(mu_x[i] + conf... | |
exception
def test_guess_nonlinear_feature(self):
import openmdao.api as om
class Discipline(om.Group):
def setup(self):
self.add_subsystem('comp0', om.ExecComp('y=x**2'))
self.add_subsystem('comp1', om.ExecComp('z=2*external_input'),
promotes_inputs=['external_input'])
self.add_subsystem('balance', om.Bala... | |
t_cycles, post, name)
def test_sra(self):
tests = []
for (X,f) in [(0x00, 0x00),
(0x01, 0x01),
(0x80, 0x00),
(0xF0, 0x28),
(0xFF, 0x29),
(0x7F, 0x29) ]:
for (r,i) in [ ('B', 0x28),
('C', 0x29),
('D', 0x2A),
('E', 0x2B),
('H', 0x2C),
('L', 0x2D),
('A', 0x2F) ]:
tests += [
[ [ set_register_to(r,X) ], [ ... | |
INPUT:
- ``v`` -- a label of the standard part of the tableau
OUTPUT:
- an integer value representing the spin of the ribbon with label ``v``.
EXAMPLES::
sage: T = StrongTableau([[-1,-2,5,6],[-3,-4,-7,8],[-5,-6],[7,-8]], 3)
sage: [T.spin_of_ribbon(v) for v in range(1,9)]
[0, 0, 0, 0, 0, 0, 1, 0]
sage: T = ... | |
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long
import logger
import testutil
import test_engine
log = logger.Logger(__name__, logger.INFO)
class TestTypes(test_engine.EngineTestCase):
sample = testutil.parse_test_sample({
"SCHEMA": [
[1, "Types", [
[21, "text", "Text", False, "", "", ""],
[22, "numeric... | |
# Lint as: python2, python3
# Copyright 2018 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
#
# Un... | |
'/'
self._get_file()
self._read_file()
self.distance = distance
self.accr = accr
if not accr:
self.mmdot = 0
elif mmdot is not None:
self.mmdot = mmdot
elif mdot is not None:
self.mmdot = self.mass * mdot # MJup^2/yr
else:
mdot = self.mass / (1e6 * self.age) # Assumed MJup/yr
self.mmdot = self.mass * mdo... | |
rename_replace option, job creation will be
determined as follows. If the job name is already used, a new job name with
the suffix ".DataStage job" will be used. If the new job name is not
currently used, the job will be created with this name. In case the new job
name is already used, the job creation will not hap... | |
<gh_stars>1-10
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 applica... | |
see this path.",
parent=ui_)
return
if S_ISDIR(inf.permissions) != 0:
self.cwd = normpath(path_).replace("\\", "/")
donefunc(refresh=True, path=self.cwd, selected=last)
else:
if S_ISLNK(conn.lstat(path_).permissions) != 0:
messagebox.showerror("Not supported",
"Can't download links yet.",
parent=ui_)
return... | |
"""
.. module:: Katna.image
:platform: OS X
:synopsis: This module has functions related to smart cropping
"""
import os
import cv2
import numpy as np
from Katna.decorators import FileDecorators
from Katna.feature_list import FeatureList
from Katna.filter_list import FilterList
from Katna.crop_extractor import CropEx... | |
# -*- coding: utf-8 -*-
'''
<NAME>, Ph.D.
<EMAIL>
www.reubotics.com
Apache 2 License
Software Revision E, 09/03/2021
Verified working on: Python 2.7 and 3.7 for Windows 8.1 64-bit and Raspberry Pi Buster (no Mac testing yet).
'''
__author__ = 'reuben.brewer'
import os, sys, platform
import time, da... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
from requests import HTTPError
from typing import Dict, Any
from json.decoder import JSONDecodeError
import json
import traceback
import requests
import math
# Disable insecure warnings
requests.packag... | |
u'datetime': attribDatetime_512717149655375401,
u'onkeypress': attribOnkeypress_532917457362969849,
u'onkeydown': attribOnkeydown_1257884844152169025,
u'class': attribClass_1166814720137472289,
u'xml:lang': attribXml_lang_1645670971257252241,
u'onmousemove': attribOnmousemove_1463303904047580100,
u'onmouseo... | |
from __future__ import print_function
import gc, os, sys
import numpy as np
import scipy as sp
import numpy.linalg as la
import scipy.linalg as sla
from numpy.linalg import norm
from time import time
from copy import deepcopy
from warnings import warn
from time import time
from Kuru.FiniteElements.Assembly import Asse... | |
self.submodel
if self.init_state_model:
self.specs['init_state_obs_mean'] = \
self.init_state_model.scaler_X._mean
self.specs['init_state_obs_var'] = \
self.init_state_model.scaler_X._var
if self.difftraj:
if self.validation:
self.specs['nb_difftraj_train'] = len(train_split)
self.specs['nb_difftraj_val'] = le... | |
position
break
if restricted_position is None:
restricted_position = agent_path[1]
amt_positions -= 1
return restricted_position, amt_positions
def get_restricted_area_constraints(graph,
fst_handle,
fst_agent_path,
snd_handle,
snd_agent_path,
time_step):
"""Computes the constraints for two agents, given ... | |
""", 'x', [True, 3, 4, 6]
def test_type_of_constants(self):
yield self.simple_test, "x=[0, 0L]", 'type(x[1])', long
yield self.simple_test, "x=[(1,0), (1,0L)]", 'type(x[1][1])', long
yield self.simple_test, "x=['2?-', '2?-']", 'id(x[0])==id(x[1])', True
def test_pprint(self):
# a larger example that showed a bu... | |
import numpy as np
import torch
import copy, os
from collections import OrderedDict
from util.util import util
from util.image_pool import ImagePool
from .base_model import BaseModel
from . import networks
import glob
import torch.nn.functional as F
import cv2
from skimage import io
def norm_image(image):
"""
:para... | |
<filename>client_server_test INHERIT/LocalModel.py<gh_stars>0
# Import all the useful libraries
import numpy as np
import pandas as pd
import fancyimpute
from sklearn import model_selection
from sklearn.model_selection import StratifiedKFold
from sklearn.ensemble import AdaBoostClassifier # PROBABILITY
from sklearn.... | |
import numpy as np
from numpy.linalg import slogdet, solve
from numpy import log, pi
import pandas as pd
from scipy.special import expit
from .constants import mass_pion
from .kinematics import momentum_transfer_cm, cos0_cm_from_lab, omega_cm_from_lab
from .constants import omega_lab_cusp, dsg_label, DesignLabels
from ... | |
<reponame>INM-6/swan
"""
Created on Feb 23, 2018
@author: <NAME>
In this module you can find the :class:`pgWidget2d` which inherits
from :class:`src.mypgwidget.PyQtWidget2d`.
It is extended by a 2d plot and the plotting methods.
"""
# system imports
import numpy as np
import quantities as pq
from neo import SpikeTra... | |
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.data import DataLoader
from typing import Optional, Tuple, Dict, Any
import numpy as np
from collections import defaultdict
from mdlearn.utils import PathLike
from mdlearn.nn.utils import Trainer
class LSTM(nn.Module):
"""LSTM mo... | |
"""
DC2 Object Catalog Reader
"""
import os
import re
import warnings
import itertools
import shutil
import numpy as np
import pandas as pd
import yaml
from GCR import BaseGenericCatalog
from .dc2_dm_catalog import DC2DMTractCatalog
from .dc2_dm_catalog import convert_flux_to_mag, convert_flux_to_nanoJansky, convert... | |
locations along the network. Default is ``False``.
routes : dict
See ``paths`` from ``spaghetti.Network.shortest_paths``.
Default is ``None``.
id_col : str
``geopandas.GeoDataFrame`` column name for IDs. Default is ``"id"``.
When extracting routes this creates an (origin, destination) tuple.
geom_col : str
``ge... | |
yara
from cli import check_paths, validate_parsers, Parser
parser_entries = get_parser_entries()
parser_objs = {}
for parser_name, parser_details in parser_entries.items():
rule_source_paths = []
# if tags are present then get tag rule paths
if tags and 'tag' in parser_details['selector']:
rule_source_paths =... | |
import numpy
import pytest
import cupy
from cupy import testing
from cupy import cuda
class TestJoin:
@testing.for_all_dtypes(name='dtype1')
@testing.for_all_dtypes(name='dtype2')
@testing.numpy_cupy_array_equal()
def test_column_stack(self, xp, dtype1, dtype2):
a = testing.shaped_arange((4, 3), xp, dtype1)
b... | |
<gh_stars>0
#!/usr/bin/ebv python
# coding=utf-8
"""
Author = <NAME>
License = MIT
Version = 1.0.1
Email = <EMAIL>
Status = Development
"""
import os
import sys
#import logging
import unittest
sys.path.insert(0, os.path.abspath(".."))
from pyredemet.src.pyredemet import pyredemet
class test_pyredemet(unittest.Te... | |
<filename>idfx/dao/mysql.py
# -*- coding: UTF-8 -*-
__author__ = "d01"
__copyright__ = "Copyright (C) 2015-21, <NAME>"
__license__ = "All rights reserved"
__version__ = "0.3.0"
__date__ = "2021-05-06"
# Created: 2015-03-13 12:34
import datetime
import uuid
from typing import Optional, Dict, Tuple, Any
from flotils i... | |
26.5463136066661*m.x4615 + 41.2793113138707*m.x4616
+ 25.717262459619*m.x4617 + 25.4358707320878*m.x4618 + 34.0780323212046*m.x4619
+ 12.3258497900304*m.x4620 + 14.3091636014199*m.x4621 + 20.880064760763*m.x4622
+ 18.0234150979267*m.x4623 + 32.9894366470756*m.x4624 + 2.7817886900528*m.x4625
+ 28.0933612998658*m.x46... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014 <NAME>
#
# Licensed under the terms of the BSD2 License
# See LICENSE.txt for details
# -----------------------------------------------------------------------------
"""Links modul... | |
str) else str(v) for v in self.todos]
if not isinstance(self.notes, list):
self.notes = [self.notes] if self.notes is not None else []
self.notes = [v if isinstance(v, str) else str(v) for v in self.notes]
if not isinstance(self.comments, list):
self.comments = [self.comments] if self.comments is not None else [... | |
of the cluster's default database.
"""
return pulumi.get(self, "database")
@database.setter
def database(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "database", value)
@property
@pulumi.getter
def engine(self) -> Optional[pulumi.Input[str]]:
"""
Database engine used by the cluster (ex. `pg` ... | |
nhg_index = gen_nhg_index(self.nhg_count)
self.nhg_ps.set(nhg_index, fvs)
self.nhg_count += 1
# A temporary next hop should be elected to represent the group and
# thus a new labeled next hop should be created
self.asic_db.wait_for_n_keys(self.ASIC_NHS_STR, self.asic_nhs_count + 1)
# Delete a next hop group
de... | |
action(self):
return self.getTypedRuleContext(ANTLRv4Parser.ActionContext,0)
def getRuleIndex(self):
return ANTLRv4Parser.RULE_prequelConstruct
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterPrequelConstruct" ):
listener.enterPrequelConstruct(self)
def exitRule(self, listener:Pa... | |
is_filled else -1
)
new_lidx += 1
# Create new state
new_state = ProcessOrderState(
cash=exec_state.cash,
position=exec_state.position,
debt=exec_state.debt,
free_cash=exec_state.free_cash,
val_price=new_val_price,
value=new_value,
oidx=new_oidx,
lidx=new_lidx
)
return order_result, new_state
@njit(ca... | |
times are 'relvant', and will be added
to the environment's 'times' attribute.
exclude:
A list of asset types to exclude in the determination of the
relevant times. Asset types included in this list are only
used to determine what to exlude if the 'include' parameter
has not been specified.
manual:
Automatica... | |
import os
import sys
import subprocess
import pickle
from .utils import format_return, insert_list, docker_error, get_mdi_standard, get_compose_path, get_package_path, get_mdimechanic_yaml
# Paths to enter each identified node
node_paths = { "@DEFAULT": "" }
# Paths associated with the edges for the node graph
node_e... | |
if 'x_path_expression' in params:
header_params['XPathExpression'] = params['x_path_expression'] # noqa: E501
if 'xml_value' in params:
header_params['XmlValue'] = params['xml_value'] # noqa: E501
form_params = []
local_var_files = {}
if 'input_file' in params:
local_var_files['inputFile'] = params['input_file'... | |
is the number of samples and n_features
is the number of features.
y : None, default=None
Not used but kept for compatibility.
Returns
-------
log_likelihood : array, shape (n_samples,)
Log likelihood of each data point in X.
"""
return self._get_destructor().score_samples(X, y)
def get_support(self):
""... | |
from tkinter import ttk, filedialog, Label, Frame, W, Entry, E, Canvas, NW
from PIL import Image as PILImage,ImageTk
import tkinter as tk
import yaml
import copy
class GUI(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
#variable for file path
self.yamlPath = ""
self.mapPath = "... | |
_id in closure]
def test_combine_all_parents_w_no_parents():
term = {'term_id': 'id1'}
term = go._combine_all_parents(term)
assert not term['all_parents'] # both should be empty lists
assert not term['development']
def test_combine_all_parents_w_empty_parents():
term = {'term_id': 'id1', 'parents': [], 'relati... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.