input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>astropy/wcs/wcs.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Under the hood, there are 3 separate classes that perform different
parts of the transformation:
- `~astropy.wcs.Wcsprm`: Is a direct wrapper of the core WCS
functionality in `wcslib`_. (This includes TPV and TPD
polyno... | |
= 0
self.salt = b"<PASSWORD>"
self.no_compatible_method = 'auth_sha1_v2'
def init_data(self):
return obfs_auth_v2_data()
def set_server_info(self, server_info):
self.server_info = server_info
try:
max_client = int(server_info.protocol_param)
except:
max_client = 64
self.server_info.data.set_ma... | |
from typing import Optional, List, Union
from thinc.types import Floats2d
from thinc.api import chain, clone, concatenate, with_array, with_padded
from thinc.api import Model, noop, list2ragged, ragged2list, HashEmbed
from thinc.api import expand_window, residual, Maxout, Mish, PyTorchLSTM
from ...tokens import Doc
fr... | |
from datetime import datetime
from dateutil.relativedelta import relativedelta
from flask import request, jsonify, abort
from flask.views import MethodView
from numpy import around
# Activate Agg, must be done before imports below
from odinapi.utils import use_agg
from odinapi.utils.time_util import datetime2mjd, mj... | |
= self.get_column_specification(column, first_pk=first_pk)
const = " ".join(
self.process(constraint) for constraint in column.constraints
)
if const:
text += " " + const
return text
def create_table_constraints(
self, table, _include_foreign_key_constraints=None
):
# On some DB order is significant: visit... | |
get)
(VP (VBN noticed)
(PP (IN by)
(NP (NNP Steven) (NNP Spielberg) (PRP himself))`
)
(S (VP (TO to) (VP (VB nab)
(NP (NP (DT a) (JJ tiny) (NN role))
(PP (IN in)
(NP (NP (NNS 1998s)) (VP (VBG Saving) (NP (JJ Private) (NNP Ryan))
))))))))))))))
(. .)))
</Parse>
</Sentence>
"""
code = None
try:... | |
from header_common import *
from header_operations import *
from header_mission_templates import *
from header_animations import *
from header_sounds import *
from header_music import *
from header_items import *
from module_constants import *
from module_animations import *
import header_debug as dbg
import header_laz... | |
import copy
import platform
from abc import abstractmethod
from typing import Optional, List, Sequence, Dict, Any
from allenact.utils.misc_utils import md5_hash_str_as_int, partition_sequence
import gym.spaces
import stringcase
import torch
import torchvision.models
from torch import cuda, optim, nn
from torch.optim.l... | |
<gh_stars>10-100
#!/usr/bin/env python
from __future__ import division
from unittest import TestCase, main
from StringIO import StringIO
from numpy import array
from numpy.testing import assert_almost_equal
from biom import Table
from matplotlib.transforms import Bbox
from americangut.make_phyla_plots import (map_t... | |
<filename>models_dev/pct_utils.py
import torch
import torch.nn as nn
import torch.nn.functional as F
from pointnet2_utils import furthest_point_sample as farthest_point_sample_cuda
from pointnet2_utils import gather_operation as index_points_cuda_transpose
from pointnet2_utils import grouping_operation as grouping_ope... | |
tunnels using dx ssh, and exit the ssh command with the tunnel still
# in place, and not be prompted to terminate the instance (which would close
# the tunnel).
parser_ssh.add_argument('--suppress-running-check', action='store_false', help=argparse.SUPPRESS, dest='check_running')
parser_ssh.set_defaults(func=ssh)
regis... | |
import tensorflow as tf
from tensorflow.python.ops.image_ops_impl import _ImageDimensions
__all__ = ['read_image', 'RandomBrightness', 'RandomContrast', 'RandomHue',
'RandomSaturation', 'RandomGamma', 'RandomFlipLeftRight', 'RandomFlipTopBottom',
'RandomTranspose', 'RandomRotation', 'RandomCropCentralResize', 'Rando... | |
network's shapes & geometry. A useful check
for determinism. Moreover, if this matches for two tensor networks then
they can be contracted using the same tree for the same cost. Order of
tensors matters for this - two isomorphic tensor networks with shuffled
tensor order will not have the same hash value. Permuting... | |
<gh_stars>100-1000
from itertools import product
import h5py
import glob
import os
import random
import tensorflow as tf
import numpy as np
class Dataset:
def __init__(self, config):
"""
Args:
config: The configuration config.
"""
self.config = config.data
self.data_size = self.config.get_int("data_size")
se... | |
port = ET.SubElement(pvstp, "port")
interface_id = ET.SubElement(port, "interface-id")
interface_id.text = kwargs.pop('interface_id')
callback = kwargs.pop('callback', self._callback)
return callback(config)
def get_stp_brief_info_output_spanning_tree_info_spanning_tree_mode_pvstp_pvstp_port_if_role(self, **kwa... | |
"""
Based on PointsformerE, change the configure of pre/pos_blocks
Bsed on PointsformerB, add more layers and the global context
Based on PointsformerA, changed GELU to RELU
Model21+Pointnet part segment
"""
"""
Instance 2
Best accuracy is: 0.94441
Best class avg mIOU is: 0.82887
Best inctance avg mIOU is: 0.85721
Epo... | |
<filename>snsim/sample.py<gh_stars>1-10
"""SimSample class used to store simulations."""
import os
import copy
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from . import utils as ut
from . import scatter as sct
from . import plot_utils as plot_ut
from . import dust_utils as dst_ut
from . impo... | |
from atm import reference
import numpy as np
from utils import geo
def calc_atm_loss(freq_hz, gas_path_len_m=0, rain_path_len_m=0, cloud_path_len_m=0, atmosphere=None, pol_angle=0,
el_angle=0):
"""
Ref:
ITU-R P.676-11(09/2016) Attenuation by atmospheric gases
ITU-R P.840-6 (09/2013) Attenuation due to clouds and... | |
bg="white", fg="red")
msgFrame.pack(fill=BOTH, expand=YES)
win.transient(root)
else:
self.warningNoImage()
def autoLevel(self):
if self.image:
range = self.image.GetScalarRange()
self.window.set(range[1]-range[0])
self.level.set((range[1]+range[0])/2)
else:
self.warningNoImage()
# -------------------------... | |
# Generate new token if not available
if not self._token:
ret_code = self._generate_api_token(action_result)
if phantom.is_fail(ret_code):
return action_result.get_status(), response_data
# Prepare request headers
if files:
headers = {"Authorization": "AR-JWT {}".format(self._token)}
else:
headers = {'Content... | |
err = exectools.cmd_gather(["git", "rev-parse", "HEAD"])
assertion.success(rc, "Failure fetching commit SHA for {}".format(self.distgit_dir))
self.sha = sha.strip()
return self.sha
def cgit_file_available(self, filename: str = ".oit/signed.repo") -> Tuple[bool, str]:
""" Check if the specified file associated wit... | |
<reponame>Timokleia/QCANet<filename>src/lib/trainer.py
# -*- coding: utf-8 -*-
import numpy as np
import copy
import csv
import time
import sys
import skimage.io as io
from skimage import morphology
import chainer
from chainer import Variable, optimizers, cuda, serializers
from src.lib.utils import mirror_extension_... | |
is a selector that contains values, a key, and an operator that relates the key and values.
:param str key: The label key that the selector applies to.
:param str operator: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
:param Sequence[str] values... | |
<reponame>xiaomengbai/NestGPU
# Description
#-------------------------------
#
# Author : <NAME> (<EMAIL>)
# Date : 04/03/2020
# Version : 4.0v
#
# Class that captures the database query to be used for the estimation.
#-------------------------------
#Class for materialize (i.e. time to convert col -> mem block)
c... | |
# code for building PlaqueGAN generator and discriminator.
# Adapted from code of official FastGAN implementation:
# https://github.com/odegeasslbc/FastGAN-pytorch
# with additional adaptations from:
# https://github.com/lucidrains/lightweight-gan
import torch
import torch.nn as nn
from torch.nn.utils import s... | |
specifies '
'`zca_whitening`, but it hasn\'t'
'been fit on any training data. Fit it '
'first by calling `.fit(numpy_data)`.')
return x
def random_transform(self, x):
# x is a single image, so it doesn't have image number at index 0
img_row_index = self.row_index - 1
img_col_index = self.col_index - 1
img_cha... | |
# coding=utf-8
import ast
import os
import subprocess
import sys
import unittest
from plyara import Plyara
UNHANDLED_RULE_MSG = "Unhandled Test Rule: {}"
class TestStaticMethods(unittest.TestCase):
def test_logic_hash_generator(self):
with open('tests/data/logic_collision_ruleset.yar', 'r') as f:
inputString = f... | |
# -*- coding: utf-8 -*-
"""terminal client to the IPython kernel
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of thi... | |
import functools
import itertools
import numbers
from ..backend_object import BackendObject
from ..annotation import Annotation
def normalize_types_two_args(f):
@functools.wraps(f)
def normalizer(self, region, o):
"""
Convert any object to an object that we can process.
"""
if isinstance(o, Base):
raise Clarip... | |
<filename>TMOTYB.py
!pip install weasyprint==52.5
import markdown
from weasyprint import HTML, CSS
from weasyprint.fonts import FontConfiguration
!pip install markovify
html = markdown.markdown(new_text)
font_config = FontConfiguration()
rendered_html = HTML(string=html)
css = CSS(string='''
@import url('https://... | |
rate = float(edit_rate)
return otio.opentime.RationalTime(
value=int(start),
rate=rate,
)
def _find_mastermob_for_sourceclip(aaf_sourceclip):
"""
For a given soure clip, find the related masterMob.
Returns a tuple of (MasterMob, compositionMetadata), where
MasterMob is an AAF MOB object and compositionMetada... | |
result from multiple correlation
If true the 'method' must be a length equal to 1
Return:
bo -> (pd.DataFrame) Oil Volumetric Factor indexed by pressure
Source: Correlaciones Numericas PVT - <NAME>
"""
p = np.atleast_1d(pressure.convert_to('psi').value)
rs = np.atleast_1d(rs)
pb = np.atleast_1d(pb.convert_to... | |
'''
from ..utils import gislib, utils, constants
from ..core.trajectorydataframe import *
import numpy as np
import pandas as pd
def stops(tdf, stop_radius_meters=20, minutes_for_a_stop=10):
""" Stops detection
Detect the stops for each individual in a TrajDataFrame. A stop is
detected when the individual sp... | |
<filename>astropy/modeling/tests/test_compound.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# pylint: disable=invalid-name, pointless-statement
import pickle
import pytest
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from astropy.utils import minversion
from... | |
"""
The aws module is intended to provide an interface to aws
It tightly interfaces with boto. Indeed, many functions require a boto connection object parameter
While it exposes boto objects (espcially instances) to callees, it provides the following ease of use ability:
* Unpacking reservations into reservations
* Fu... | |
<reponame>satr-cowi/DynSys<gh_stars>0
# -*- coding: utf-8 -*-
"""
Classes used to implement pedestrian dynamics analyses
@author: rihy
"""
from __init__ import __version__ as currentVersion
# Std imports
import numpy
import os
import scipy
import pandas
import matplotlib.pyplot as plt
import matplotlib.gridspec as g... | |
]) < 1e-6)
assert(np.linalg.norm(vhp_serial[ lookup[i] ] -
vhp_serial2[ split_lookup[i] ]) < 1e-6)
#Get parallel results - with and without split tree
vhp_parallel = np.empty( (nEls,nDerivCols,nDerivCols),'d')
vdp_parallel = np.empty( (nEls,nDerivCols), 'd' )
vp_parallel = np.empty( nEls, 'd' )
for tstTree,tst... | |
# To import required modules:
import numpy as np
import os
import src.functions_general as gen
from src.functions_load_sims import N_Kep
path_data = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'data')
# Functions to load and analyze the Kepler observed catalog:
def load_Kepler_pla... | |
from collections import OrderedDict
import numpy as np
from matplotlib.patches import Rectangle
from sklearn.cluster import KMeans
from sklearn.decomposition import PCA
from sklearn.preprocessing import normalize
from tensorflow.python import keras
from tensorflow.python.keras import backend as K
from PIL import Imag... | |
<filename>tti/tti_explorer/config.py
"""
Notes:
- the nppl entry in infection_proportions is measured in thousands
"""
from collections import namedtuple
from functools import partial
import numpy as np
from .contacts import he_infection_profile
PROP_COVID_SYMPTOMATIC = 0.6
# used in run sensitivity
STATISTIC_COL... | |
has four nodes.
node1 = sync.node(id="1", url="https://www.example.com/1", title="node 1")
node2 = sync.node(id="2", url="https://www.example.com/2", title="node 2")
node3 = sync.node(id="3", url="https://www.example.com/3", title="node 3", content="card content")
node4 = sync.node(id="4", url="https://www.example.... | |
# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 <NAME> <yamahata at valinux co jp>
#
# 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:/... | |
factors
! CUT= 2.0 ! defines the integration region for profile fitting
! MINPK= 75.0 ! minimum required percentage of observed reflection intensity
!===================================================
!======= PARAMETERS CONTROLLING CORRECTION FACTORS (used by CORRECT)
! MINIMUM_I/SIGMA= 3.0 ! minimum intensity/sigm... | |
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
from . import base
from xData.ancestry import ancestry
from xData import link as linkModule
from pqu import PQU
__metaclass_... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module contains scripts for image manipulation including denoising, enhancement and cropping functions
"""
import numpy as np
def uint16_2_uint8(vidstack):
""" Casts any input image to be of uint8 type.
Note: Though named uint16, converts any input to uint8... | |
import tensorflow as tf
from tensorflow.keras.layers import Conv2D, BatchNormalization, MaxPooling2D, Flatten, Dropout, Dense
import tensorflow_addons as tfa
import tensorflow_datasets as tfds
import pickle, urllib
from datetime import datetime
import os
import sys
import shutil
class Preprocessing:
@staticmethod
de... | |
<filename>adafilt/__init__.py
"""Adaptive filtering classes."""
import numpy as np
from adafilt.utils import (atleast_2d, atleast_4d, fifo_append_left,
fifo_extend, einsum_outshape)
def olafilt(b, x, subscripts=None, zi=None):
"""Efficiently filter a long signal with a FIR filter using overlap-add.
Filter a dat... | |
The figure object being created or being passed into this function.
ax : matplotlib.axes._subplots.AxesSubplot
The axes object being created or being passed into this function.
"""
fig = plt.figure()
ax = plt.axes()
for curve in self.curves:
curve.plot(
plot_interpolated=plot_interpolated, fig=fig, ax=ax,
figs... | |
= {key: imagedata}
def recon_hoshim(self, filepath, tempdir=None):
log.debug('HOSHIM recon not implemented')
self.is_non_image = True
def recon_basic(self, filepath, tempdir=None):
log.debug('BASIC recon not implemented')
self.is_non_image = True
def recon_spirec(self, filepath, tempdir=None):
"""
Run spire... | |
<filename>doc/dustfm.py
#!/bin/python
'''
script for generating plots for the paper
'''
import os
import sys
import h5py
import numpy as np
import corner as DFM
from astrologs.astrologs import Astrologs
# -- galpopfm --
from galpopfm.catalogs import Catalog
from galpopfm import dustfm as dustFM
from galpopfm i... | |
<reponame>kiensamsk/Fantasy-Premier-League<filename>venv/Lib/site-packages/pure_eval/core.py
import ast
import builtins
import operator
from collections import ChainMap, OrderedDict, deque
from contextlib import suppress
from types import FrameType
from typing import Any, Tuple, Iterable, List, Mapping, Dict, Union, Se... | |
#!/usr/bin/env python
#! -*- coding: utf-8 -*-
"""Link-history-retrieval for the goo.gl client."""
from __future__ import unicode_literals
import apiclient.discovery
import click
import ecstasy
import warnings
from collections import namedtuple
from datetime import datetime, timedelta
import lnk.beauty
import lnk.... | |
q: RSQL Query
:return: BuildConfigurationPage
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page_index', 'page_size', 'sort', 'q']
all_params.append('callback')
params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
... | |
m.x1304) + m.x1205 == 0)
m.c1053 = Constraint(expr=m.x807**2*(m.x1302 + m.x1304) + m.x1207 == 0)
m.c1054 = Constraint(expr=m.x809**2*(m.x1302 + m.x1304) + m.x1209 == 0)
m.c1055 = Constraint(expr=m.x811**2*(m.x1302 + m.x1304) + m.x1211 == 0)
m.c1056 = Constraint(expr=m.x813**2*(m.x1302 + m.x1304) + m.x1213 == 0)
m.... | |
import numpy as np
from surfinBH import surfinBH
from surfinBH._lal_spin_evolution import evolve_pn_spins
import surfinBH._utils as utils
import warnings
#=============================================================================
class Fit7dq2(surfinBH.SurFinBH):
""" A class for the surfinBH7dq2 model presented in... | |
return int(float(value) * self.slope + self.zerosteps + 0.5)
def _fromsteps(self, value):
return float(value - self.zerosteps) / self.slope
@lazy_property
def _hwtype(self):
"""Returns 'single', 'triple', or 'sixfold', used for features that
only one of the card types supports.
"""
if self._mode == SIMULATION... | |
<filename>bitshares/market.py
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from bitsharesbase import operations
from .account import Account
from .amount import Amount
from .asset import Asset
from .instance import BlockchainInstance
from .price import FilledOrder, Order, Price
from .utils import ... | |
<filename>morepath/request.py
"""Morepath request implementation.
Entirely documented in :class:`morepath.Request` and
:class:`morepath.Response` in the public API.
"""
from webob import BaseRequest, Response as BaseResponse
from dectate import Sentinel
from .reify import reify
from .traject import create_path, pars... | |
make_dict(group):
# since the values in 'group' argument are
# (columns, compliment columns, value)
# here we group by 'compliment columns' and sum
# the values.
return {
k: sum([item[2] for item in g2])
for k, g2 in groupby(group, key=itemgetter(1))
}
# For each group (belongs a unique values), we create
# ... | |
<reponame>EladGabay/pulumi-oci<gh_stars>1-10
# 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, Mapping, Optio... | |
The old version as a list of strings. One
element for each part of the version.
"""
import dateutil
date = datetime.now(dateutil.tz.UTC)
oldmonth = int(oldversion[self.VER_MONTH])
oldpatch = int(oldversion[self.VER_PATCH])
newmonth = date.month
patch = oldpatch + 1 if oldmonth == newmonth else 0
self.version ... | |
<reponame>3sigma/Geeros-RaspberryPi-C-Python<filename>programmes_python/GeerosAvecBoules.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
##################################################################################
# Programme de pilotage du robot Geeros (avec boules stabilisatrices),
# disponible à l'adresse:
# htt... | |
check_interval, max_ingestion_time
)
billable_time = \
(describe_response['TrainingEndTime'] - describe_response['TrainingStartTime']) * \
describe_response['ResourceConfig']['InstanceCount']
self.log.info('Billable seconds:{}'.format(int(billable_time.total_seconds()) + 1))
return response
def create_tuning_... | |
120')])
qualylaps = IntegerField('Voltas de qualify', default='255',validators=[NumberRange(min=2, max=255, message='Voltas de qualy devem ser entre 2 e 255')])
warmuptime = IntegerField('Tempo de Warmup', default='5',validators=[NumberRange(min=4, max=25, message='Tempo de warmup deve ser entre 5 e 120')])
racetime... | |
items will be replaced with the provided ones. Otherwise only the provided configuration items will be updated or added",
"type": "boolean",
},
"task": {"description": "Task ID", "type": "string"},
},
"required": ["task", "configuration"],
"type": "object",
}
def __init__(
self, task, configuration, replace_c... | |
self._edge_uniq_dst, init = paddle_helper.constant(
name=self._data_name_prefix + "/uniq_dst",
dtype="int64",
value=uniq_dst)
self._initializers.append(init)
self._edge_uniq_dst_count, init = paddle_helper.constant(
name=self._data_name_prefix + "/uniq_dst_count",
dtype="int32",
value=uniq_dst_count)
self._in... | |
671000, pytz.utc))
def test_get_groups(self, mock_request):
# check no params
mock_request.return_value = MockResponse(200, self.read_json("groups"))
# check with no params
results = self.client.get_groups().all()
self.assertRequest(mock_request, "get", "groups")
self.assertEqual(len(results), 2)
self.asser... | |
<gh_stars>100-1000
from base64 import b64encode, b64decode
import datetime
import binascii
import time
import os
import re
import urllib.request
import lightnion as lnn
from tools.keys import get_signing_keys_info
# TODO: remove extra (useless) checks/exceptions within this file
def scrap(consensus, end_of_field):... | |
# Lint as: python2, python3
# Copyright 2019 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... | |
import gc
import time
import image
import sensor
import binascii
from pyb import UART
from pyb import Pin
from pyb import LED
from utime import sleep_ms
sensor.reset()
# sensor.set_pixformat(sensor.GRAYSCALE) # RGB565
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.B128X128)
sensor.skip_frames(time=20... | |
AMI id
self.worker_instance_profile = self.aws.get_worker_instance_profile_name(
stack_name
)
self.worker_ignition_location = self.aws.get_worker_ignition_location(
stack_name
)
del self.worker_iam_role["Id"]
def get_kube_tag(self, tags):
"""
Fetch kubernets.io tag from worker instance
Args:
tags (dict): ... | |
<filename>CTFd/aio_dict.py<gh_stars>0
# -*- coding: utf-8 -*-
aio_dict = {
'djbKcIn9cz7UywHGW72sGeXSSrNrAl8r': 'Starożytny egipski poeta mówi:',
'OjRM6zUEdZkhIWzQNZ4DbKzabS5dpG5g':
'Nilu, Nilu, Nilu... władcza nieujarzmiona rzeko...Ty nam życie dajesz!',
'FFUwDwtW8HrnyJYrMhr7oD3dIPvMEpoA':
'*tuu tu tu tu tu... Tu ... | |
from math import ceil
from time import sleep
import os
import re
from database import User, Item
from . import data_manipulation
from . import gtk_element_editor
from . import window_creator
from .decorators import use_threading, use_spinner
class WindowHandler:
spinner = None
task_count = 0
user_list = None
foo... | |
import tempfile
import random
import string
import base64
import json
import anymarkup
import logging
import re
import utils.gql as gql
import utils.threaded as threaded
import utils.secret_reader as secret_reader
from utils.oc import StatusCodeError
from utils.gpg import gpg_key_valid
from reconcile.exceptions impor... | |
lb, size, value):
"""set_block(FloatsDataSet2D self, DataSetIndex2D lb, DataSetIndex2D size, FloatsList value)"""
return _RMF_HDF5.FloatsDataSet2D_set_block(self, lb, size, value)
def set_size(self, ijk):
"""set_size(FloatsDataSet2D self, DataSetIndex2D ijk)"""
return _RMF_HDF5.FloatsDataSet2D_set_size(se... | |
= cubes_gt_np['rgb']
n[cubes_gt_np['ijk_id'], :] = cubes_gt_np['normals']
q[cubes_gt_np['ijk_id'], :] = True
XYZ_big_num = int(XYZ.shape[0] // 8)
xyz_global_new = xyz_global.reshape((XYZ_big_num, 8, 3))
xyz_new = xyz.reshape((XYZ_big_num, 8, 3))
rgb_new = rgb.reshape((XYZ_big_num, 8, 3))
n_new = n.reshape((XYZ_... | |
to be too slow.
The optional ``maxterms`` (limiting the number of series terms) and ``maxprec``
(limiting the internal precision) keyword arguments can be used
to control evaluation::
>>> hyper([1,2,3], [4,5,6], 10000)
Traceback (most recent call last):
...
NoConvergence: Hypergeometric series converges too slowly... | |
: [u'b', u'f'] ,
u'䓇' : [u'x'] ,
u'菉' : [u'l'] ,
u'慊' : [u'q'] ,
u'㙐' : [u'd'] ,
u'泗' : [u's'] ,
u'轖' : [u's'] ,
u'塤' : [u'x'] ,
u'靦' : [u'm', u't'] ,
u'苳' : [u'd'] ,
u'恴' : [u'd'] ,
u'㥺' : [u'h'] ,
u'躀' : [u'k'] ,
u'椅' : [u'y'] ,
u'㸋' : [u'f'] ,
u'宎' : [u'y'] ,
u'隐' : [u'y'] ,
u'焕' : [u'h'] ,
u'䀟' : [u'f'] ,
u'掞' : [u... | |
##################################################################
## (c) Copyright 2015- by <NAME> ##
##################################################################
#====================================================================#
# qmcpack_analyzer_base.py #
# Data object and analyzer base classes for Qmcp... | |
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
class ping_result:
thrif... | |
import io
import logging
import os
import platform
import queue
import re
import subprocess
import sys
import textwrap
import threading
import time
import traceback
from queue import Queue
from textwrap import dedent
from time import sleep
from tkinter import messagebox, ttk
from typing import Optional
from thonny imp... | |
<reponame>Deltares/HYDROLIB-core<filename>hydrolib/core/io/net/writer.py
from __future__ import annotations
from datetime import datetime
from pathlib import Path
from typing import TYPE_CHECKING, List
import netCDF4 as nc
import numpy as np
from hydrolib.core import __version__
if TYPE_CHECKING:
from .models impo... | |
"""
Script for MCS+
Reliable Query Response
"""
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import sys
import os
from my_community import mycommunity
from multi_arm_bandit import bandit
import networkx as nx
import community
import csv
import numpy as np
import random
import pickle... | |
# coding: utf-8
"""
Fates List
Current API: v2 beta 3 Default API: v2 API Docs: https://apidocs.fateslist.xyz Enum Reference: https://apidocs.fateslist.xyz/structures/enums.autogen # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ imp... | |
that allow a comparison with all five depths or just with
# 30 cm
# todo - make another plotting function that plots all the associated jornada and etrm pixels together
# cumulatively on the same figure..
# todo - make a script that does all the TAWs plotted cummulatively...
# ===================================... | |
<gh_stars>0
# -*- coding: utf-8 -*-
import os
import sys
import re
from collections import namedtuple
import subprocess
from typing import NewType
class p1parser:
def __init__(self):
self.rule = namedtuple("Rule" , ["Text" , "SubExp"])
self.directive = namedtuple("Directive" , ["UName" , "NName"])
self.eq_pos = 0
... | |
<reponame>miqwit/claraprint
import math
import re
import os
# The scale of all possible pitches returned from chords or melody.
# Pitches are simplified to sharps (#) only, and no flats (b)
scale = ["A", "A#", "B", "B#", "C", "C#", "D", "D#", "E", "E#", "F", "F#", "G", "G#"]
# This is one letter set, arbitrarily used... | |
<reponame>NicolaRorato/AsciiToHex
# import numpy as np
import binascii
import string
import re
import sys
import os
import time
import datetime
# from operator import xor
import tkinter
from tkinter import filedialog
from tkinter import *
top = tkinter.Tk()
frame = tkinter.Frame(top)
frame.grid()
if os.path.exists('e... | |
'screenos': r'set admin (name|user|password) "?.+"?',
'screenos2': r'set snmp (community|host) "?.+"?',
'screenos3': r' md5 "?.+"?',
'screenos4': r' key [^\s]+ (?:!enable)',
'screenos5': r'set nsmgmt init id [^\s]+',
'screenos6': r'preshare .+? ',
'junos': r'pre-shared-key\s.*',
'junos2': r'\shome\s+.*',
'netwo... | |
"""!stack, a pmxbot command for managing short lists.
Example
-------
!stack
(empty)
!stack add drop partitions
!stack
1: drop partitions
!stack add fix up join diagrams
!stack
1: fix up join diagrams | 2: drop partitions
!stack add [-1] review frank's ticket
!stack
1: fix up join diagrams | 2: drop partitions | ... | |
array which the data is added to its copy.
indices(~nnabla.Variable): N-D array scatter indices.
The size of each dimension must be equal or smaller than that of x0 except for the specified axis.
The value of indices must be smaller than the size of specified axis' dimension of x0.
The size of each dimension mus... | |
<filename>etsin_finder_search/rabbitmq/rabbitmq_client.py
# This file is part of the Etsin service
#
# Copyright 2017-2018 Ministry of Education and Culture, Finland
#
# :author: CSC - IT Center for Science Ltd., Espoo Finland <<EMAIL>>
# :license: MIT
"""
Consumer connects to Metax RabbitMQ and listens for changes in... | |
self.current_switch_agreement = {}
self.startgen_hash = None
self.proposals_vote_choice = {}
self.proposal_voted_player_ids = set()
@classmethod
def generate_startgen_hash(cls, players):
"""
Fully deterministic value that makes it possible to do cheap equality checks to see if teams have changed.
"""
players... | |
<reponame>lemontheme/trefwurd<gh_stars>1-10
import itertools as it
import logging
import operator as op
import re
from difflib import SequenceMatcher
from typing import (
NewType,
Tuple,
Iterable,
Sequence,
Pattern as RePattern,
Optional,
Match as ReMatch,
Set,
NamedTuple,
List,
Dict,
Callable,
)
logger = ... | |
indices with which targets were
shuffled
"""
sc_dim = "last" if scale else "none"
if np.unique(seq_classes[0]).tolist() != [0, 1]:
raise NotImplementedError("This Pytorch logreg function is "
"implemented only for classes 0 and 1.")
if len(roi_seqs) > 2:
raise ValueError("Must pass no more than 2 sets of d... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Owlready2
# Copyright (C) 2013-2019 <NAME>
# LIMICS (Laboratoire d'informatique médicale et d'ingénierie des connaissances en santé), UMR_S 1142
# University Paris 13, Sorbonne paris-Cité, Bobigny, France
# This program is free software: you can redistribute it and/or modify
# it ... | |
<filename>unpythonic/amb.py<gh_stars>0
# -*- coding: utf-8 -*-
"""A simple variant of nondeterministic evaluation for Python.
This is essentially a toy that has no more power than list comprehensions
or nested for loops. An important feature of McCarthy's amb operator is its
nonlocality - being able to jump back to a ... | |
automatically to be less than or equal to
`nticks`. Has an effect only if `tickmode` is set to
"auto".
range
Sets the range of this axis. If the axis `type` is
"log", then you must take the log of your desired range
(e.g. to set the range from 1 to 100, set the range
from 0 to 2). If the axis `type` is "date", i... | |
kept at the current values from grid to grid
if not self.magc_mode:
self.set_default_wd_stig()
self.lock_wd_stig()
theta = self.gm[grid_index].rotation
# TODO: Whether theta or (360 - theta) must be used here may be
# device-specific. Look into that!
if not self.magc_mode:
theta = 360 - theta
if theta > 0:
#... | |
"""Various functions and classes used to analyze and manipulate ast.
- flatten, apply_hooks and restore_hooks are used to compare sets of
ast.
- get_default_nbits returns the default bitsize of an ast if it is
different from zero, returns 8 otherwise.
- GetIdentifiers collects every identifiers of an ast.
- GetNums ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.