input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
descriptions)
# print('self.ready: %r' % self.ready)
# input('pause')
return (titles,descriptions)
def get_string_from_middle_children_1(self,node=None):
'''Combine strings of tags into one string, excluding first heading tag
and table tags.'''
string = None
if self.ready:
if node:
children = self.get_children... | |
def string_wrapping(self):
import textwrap
print(textwrap.wrap("HelloWorld", 5))
#Hello
#World
def string_stripping(self):
"00005".lstrip("0") # 5
"50000".rstrip("0") # 5
def string_numerical_values____kwds_unicode(self):
ord('a') # 97 # return unicode value. #ascii being subset of unicode.
chr(97) # 'a' in... | |
#!/usr/bin/env python3
import json
import logging
import sys
from itertools import groupby
from random import randint
from time import sleep
from typing import Dict, Iterator, List
import requests
from bs4 import BeautifulSoup, PageElement
assert sys.version_info >= (3, 6), 'Install Python 3.6 or higher'
log = logg... | |
import requests as _requests
from goldsberry._apiFunc import *
class demographics:
def __init__(self, playerid):
self._url = 'http://stats.nba.com/stats/commonplayerinfo?'
self._api_param = {'PlayerID':playerid}
self._pull = _requests.get(self._url, params=self._api_param)
def player_info(self):
_headers = self.... | |
<filename>dependencies/quex-0.34.1/quex/core_engine/generator/transition_block.py
import sys
import quex.core_engine.generator.transition as transition
from quex.input.setup import setup as Setup
LanguageDB = Setup.language_db
__DEBUG_CHECK_ACTIVE_F = False # Use this flag to double check that intervals are adjacent
... | |
or B contained in the other, keep only contained.
if a_in_b and not b_in_a:
del TSs[i]
elif b_in_a and not a_in_b:
del TSs[j]
elif a_in_b and b_in_a:
# Keep most complex
if cx_a < cx_b:
del TSs[i]
elif cx_b < cx_a:
del TSs[j]
else:
# they are equal, delete either one
del TSs[i]
if verbose:
print('>>> TW... | |
# Copyright (c) 2019 Horizon Robotics. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
ValueError("Define dictionary parameter: hierarchy")
for identifier, dictionary in hierarchy.items():
# - check:
try: dictionary["path"] = self.file_path.path + dictionary["path"]
except: raise ValueError("Invalid hierarchy item [{} : {}]. Specify the [path].".format(identifier, "?"))
try: dictionar... | |
<reponame>mw-root/rswt
"""A library to control a RobertSonics WavTrigger through a serial port
"""
from __future__ import absolute_import, division, print_function
try:
from os import errno
except ImportError:
import errno
import serial
import struct
__version__ = '0.1.2'
__author__ = '<NAME>'
__license__ = 'MIT'
... | |
= {mention_b[ID]}
try:
mention_b[self.INCOMPATIBLES].add(mention_a[ID])
except KeyError:
mention_b[self.INCOMPATIBLES] = {mention_a[ID]}
def _merge(self, entity_a, entity_b):
""" Merge two entities into new one.
:param entity_a: a entity to merge
:param entity_b: a entity to merge
"""
# Add the new mentions... | |
import numpy as np
import pandas as pd
class Scenario(object):
"""
Model scenario parameters
"""
def __init__(self, *initial_data, **kwargs):
# Set default values
# 16/4/2020 Adjust parameters so that day starts with FTE arrival
# Proportion high priority
self.high_priority = 0.25
# Work arrival
self.sa... | |
# -*- coding:utf-8 -*-
#######################################################################
# Copyright (C) 2016 <NAME> (<EMAIL>) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
#######################################################################
from utils import bar... | |
self.data_finished_fut:
try:
await self.data_finished_fut
logger.debug(
"Websocket task finished. Closing the connection."
)
except asyncio.CancelledError:
# Cancelled error is called when data phase is cancelled
# if an error occurred or the client closed the connection
logger.debug(
"Websocket handler cance... | |
# Copyright(c) 2017-2021 CloudNetEngine. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
<reponame>klokan/googlecrisismap<gh_stars>1-10
#!/usr/bin/python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at: http://www.apache.org/licen... | |
<gh_stars>0
"""
Classes that represent a collection of points/structures that will define a labelmap or similar for image analysis purposes.
Currently the parent object is GeometryTopologyData, that can contain objects of type Point and/or BoundingBox.
The structure of the object is defined in the GeometryTopologyData.... | |
target_variant = row['target_variant']
mutation_type = row['mutation_type']
is_cds = row['is_cds']
aa_name = 'N/A'
ref_state = row['ref_state']
alt_state = row['alt_state']
aa_start = row['aa_start']
aa_end = row['aa_end']
if mutation_type == 'snp':
mutation_key = "{}_{}".format(mutation_type,row['unalign_vari... | |
self.silver_name,
"typeclass": "typeclasses.dropped_silver.Dropped_Silver",
"aliases": ["money", "coins"],
"desc": "Silver sovereigns have the likeness of a mighty lion engraved upon their surface on one side and the Tower of Corinth on the other.",
"location": caller.location,
"coins_value": self.silver_amount_in... | |
import csv
import json
import pickle
from difflib import SequenceMatcher as SeqMat
import django_rq
import pandas as pd
import tablib
from django import db
from django.conf import settings
from django.core.management import call_command
from django.http import HttpResponse, JsonResponse
from django.shortcuts import re... | |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates C++ source files from a mojom.Module."""
import datetime
import mojom
import mojom_generator
import mojom_pack
import os
import re
import sys
... | |
dataset = [
{
"tweet_id": 1346604540049690624,
"text": "@LLinWood @realDonaldTrump @VP @Mike_Pence We are about to witness a legislative attempt at a coup d'etat.",
"timestamp": "2021-01-05T23:48:35.707000+00:00",
"user_id": 1241662805713059840,
"user_verified": False,
"user_name": "Chris 20",
"hash_tags": [],
... | |
m.x4547 - m.x6291 - m.x6491 - m.x6611 == 0)
m.c4080 = Constraint(expr= m.x4148 - m.x4548 - m.x6291 - m.x6491 - m.x6611 == 0)
m.c4081 = Constraint(expr= m.x4149 - m.x4549 - m.x6291 - m.x6491 - m.x6611 == 0)
m.c4082 = Constraint(expr= m.x4150 - m.x4550 - m.x6291 - m.x6491 - m.x6611 == 0)
m.c4083 = Constraint(expr= m.... | |
<filename>src/swiftpath/swiftpath.py
"""A module for interacting with **Openstack Swift** using the standard
:mod:`pathlib.Path` interface.
"""
import atexit
import base64
import contextlib
import datetime
import io
import logging
import os
import pathlib
import posix
import re
import sys
import tempfile
import urllib.... | |
#!/usr/bin/env python
#
# Copyright (c) 2018 SAP SE
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
class AbstractStemmer:
pass
class PorterStemmer(AbstractStemmer):
"""
A Stemmer class
tutorial from: https://medium.com/analytics-vidhya/building-a-stemmer-492e9a128e84
"""
consonants = "bcdfghjklmnpqrstwxz"
special_case = "y"
vowels = "aeiou"
def _divide_into_groups(self, word):
"""
Divides each word acc... | |
session tracks the reference to the TeleApi object
sess = dmon.sessions[list(dmon.sessions.keys())[0]]
self.isinstance(sess.getSessItem(None), TeleApi)
# And that data is available from the session helper API
snfo = await dmon.getSessInfo()
self.len(1, snfo)
self.eq(snfo[0].get('items'), {None: 'synapse.tests.tes... | |
<gh_stars>0
# USDA_CoA_Cropland.py (flowsa)
# !/usr/bin/env python3
# coding=utf-8
import json
import numpy as np
import pandas as pd
from flowsa.common import *
from flowsa.flowbyfunctions import assign_fips_location_system, sector_disaggregation
def CoA_Cropland_URL_helper(build_url, config, args):
"""This helper... | |
- Chapter 4.4
"""
fsim = np.zeros((ns, nsim))
fsim = fsim.astype(int)
Tpow = matrix_power(T, 100)
fprior = np.zeros((1,T.shape[1]))
fprior[0,:] = Tpow[0,:]
for j in range(nsim):
fsim[0, j] = RandDisc(fprior)
for i in range(1,ns):
fcond = np.zeros((1,T.shape[1]))
fcond[0,:] = T[fsim[i-1,j], :]
fsim[i, j] = ... | |
import csv
import glob
import math
import os
import torch
from astropy.io import fits
from six.moves import urllib
import torch
is_torchvision_installed = True
try:
import torchvision
except:
is_torchvision_installed = False
import torch.utils.data
import random
import itertools
import numpy as np
def load_GG2_im... | |
"""
@Time : 08.12.2021 22:42
@Author : Subvael
@File : DueTime_test.py
"""
import unittest
from airignis import DueTime
from datetime import datetime, time, date, timedelta
from airignis.exceptions import *
from dateutil import tz
import pytz
class DueTimeTest(unittest.TestCase):
def __init__(self, *args, **kwa... | |
<filename>regreg/atoms/cones.py
from copy import copy
import warnings
from scipy import sparse
import numpy as np
from ..problems.composite import nonsmooth, smooth_conjugate
from ..affine import linear_transform, identity as identity_transform
from ..identity_quadratic import identity_quadratic
from ..smooth import ... | |
<reponame>ilona-asa/SpamDetect<filename>tutorial.py
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.datasets import load_iris
import os
import email.parser
import re
from email.parser import Parser
# from email.Utils import parseaddr
from email.Header import decode_header
i... | |
# credits to slimakoi for amino.py base
import json
import base64
import requests
from uuid import UUID
from os import urandom
from time import timezone
from typing import BinaryIO, Union
from binascii import hexlify
from time import time as timestamp
from json_minify import json_minify
from . import client
... | |
<reponame>ezequieljsosa/sndg-bio
"""
https://ask.pathwaytools.com/question/17972/access-pathologic-via-api/
So I defined organism-params.dat and genetic-elements.dat in a folder called dir_with_files, included the annotation file test.gbk and started pathwatools: pwt -patho dir_with_files
organism-params.dat
ID test
N... | |
import os
import time
from rlib import jit
from rlib.string_stream import encode_to_bytes
from rlib.exit import Exit
from rlib.osext import path_split
from rlib import rgc
from som.vm.symbols import symbol_for, sym_false, sym_true, sym_nil
from som.vmobjects.array import Array
from som.vmobjects.block_bc import block... | |
<filename>sdk/python/pulumi_spotinst/azure/elastigroup.py
# 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 i... | |
from __future__ import print_function
import sys
sys.path.insert(0, '.')
import torch
from torch.autograd import Variable
import torch.optim as optim
from torch.nn.parallel import DataParallel
import time
import os.path as osp
from tensorboardX import SummaryWriter
import numpy as np
import argparse
... | |
"""
## In this module there is the botApi class, whose purpose is to send requests
"""
import requests
import json
from silbot import types, helper
from silbot.response import BotAPIResponse
from typing import Union
class BotApi:
"""
Class to send requests to botAPI
"""
def __init__(self, token, default_parse_mo... | |
#
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | |
execute request asynchronously
:param str owner: Owner of the namespace (required)
:param str name: Component under namesapce (required)
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout set... | |
<filename>evaluation_tools/evaluation.py<gh_stars>0
import torch
from function_tools import distribution_function, poincare_function
from function_tools import euclidean_function as ef
from clustering_tools.poincare_kmeans import PoincareKMeans
from clustering_tools.poincare_em import PoincareEM
from collections impor... | |
1) {
# cannot approx with 1 value so:
indexSplit[[sc]] = rep(g$index[1], nrow(s));
} else {
g$pos = (g$begin + g$end) / 2;
g = g[order(g$pos),];
# rule 2 means use values from extrema
i = round(approx(g$pos, 1:nrow(g), xout = s$pos, rule=2)$y);
i = pmax(1, pmin(nrow(g), i));
indexSplit[[sc]] =... | |
"admin/user_edit.html"
form_extra_fields = dict(is_superuser=BooleanField("Is Superuser"))
form_excluded_columns = (
"roles",
"created_at",
"updated_at",
"created_by",
"updated_by",
)
column_exclude_list = (
"password",
"username",
"first_name",
"last_name",
)
column_searchable_list = (
"name",
"orcid... | |
self.manager.loans.sync()
# This time, the feed contains entries.
feed = feedparser.parse(response.data)
entries = feed['entries']
overdrive_entry = [entry for entry in entries if entry['title'] == overdrive_book.title][0]
bibliotheca_entry = [entry for entry in entries if entry['title'] == bibliotheca_book.titl... | |
#!/bin/env python
# -*- coding: utf-8 -*-
""" run a batch of PDF generation
keeps an amazon simple DB with an inventory of EAD files and last
modified dates, this persists between runs
check_url is a recursive modifier function (with side effects) that is
a web crawler that adds all the new EAD to an array `files_to_... | |
<gh_stars>1-10
#!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## satr.py
##
## Created on: Jan 9, 2018
## Author: <NAME>
## E-mail: <EMAIL>
##
#
#==============================================================================
from __future__ import print_function
import collections
import itertools
from minds.rule impo... | |
"""
Run random agent to test the 3D environment
"""
import numpy as np
import gym
import gym_pcgrl
from pdb import set_trace as TT
# from utils import make_vec_envs
from gym_pcgrl.envs.helper_3D import calc_num_regions, debug_path, get_string_map,\
get_tile_locations, calc_longest_path, run_dijkstra
import matplotlib.... | |
GRAYSCALE BYTE SC IMAGE IOD': ['Image'],
'ENHANCED CT IMAGE IOD': ['Image'],
'ENHANCED PET IMAGE IOD': ['Image'],
'ENHANCED X-RAY RF IMAGE IOD': ['Image'],
'ENHANCED X-RAY ANGIOGRAPHIC IMAGE IOD': ['Image'],
'VL WHOLE SLIDE MICROSCOPY IOD': ['Image'],
'ENHANCED MR COLOR IMAGE IOD': ['Image'],
'X-RAY 3D CRANIOFAC... | |
<reponame>seiwailai/zulip<filename>zerver/lib/event_schema.py
# This module is a collection of testing helpers for validating the
# schema of "events" sent by Zulip's server-to-client push system.
#
# By policy, every event generated by Zulip's API should be validated
# by a test in test_events.py with a schema checker... | |
True)
# self.trans_fc = nn.Sequential(
# nn.Linear(512,68*2),#20
# )
# def forward(self, f_landmark, trans_input, length_mots):
# b, d, n_mel, l = trans_input.shape
# trans_input = trans_input.reshape(b, d*n_mel, l)
# # f_landmark = f_landmark.unsqueeze(-1).repeat(1, 1, l)
# trans_input = torch.cat([trans_input,f_l... | |
pymc3_random(pm.Normal, {'mu': R, 'sigma': Rplus}, ref_rand=ref_rand)
def test_truncated_normal(self):
def ref_rand(size, mu, sigma, lower, upper):
return st.truncnorm.rvs((lower-mu)/sigma, (upper-mu)/sigma, size=size, loc=mu, scale=sigma)
pymc3_random(pm.TruncatedNormal, {'mu': R, 'sigma': Rplusbig, 'lower':-Rplu... | |
fit_reg, mask_bad_pix, mask_emline, user_mask, mask_metal, cosmology, run_dir, verbose=verbose, plot=True)
# non-SDSS spectrum
elif (not sdss_spec):
lam_gal,galaxy,noise,z,ebv,velscale,fwhm_gal,fit_mask = prepare_user_spec(fits_file, spec, wave, err, fwhm, z, ebv, fit_reg, mask_emline, user_mask, mask_metal, cosmolo... | |
from __future__ import division, unicode_literals, absolute_import
import numpy as np
import signal
import tracemalloc
import os
import logging
logger = logging.getLogger(__name__)
import dynesty
from dynesty.utils import unitcheck
from ..utils import estimate_nmcmc, list_2_dict
from ...pipe import data_container, ... | |
fk, **kwargs):
"""
Find a related item by id for tags.
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.... | |
#
# Unicode Mapping generated by uni2python.xsl
#
unicode_map = {
0x00100: r"\={A}", # LATIN CAPITAL LETTER A WITH MACRON
0x00101: r"\={a}", # LATIN SMALL LETTER A WITH MACRON
0x00102: r"\u{A}", # LATIN CAPITAL LETTER A WITH BREVE
0x00103: r"\u{a}", # LATIN SMALL LETTER A WITH BREVE
0x00104: r"\k{A}", # LATIN CAPITAL L... | |
self._changed_layout = self._ui.changed_layout
self._changed_widget.hide()
conn_str = self.BLACS_connection
if self.remote_process_client is not None:
conn_str += " via %s:%d" % (self.remote_process_client.host, self.remote_process_client.port)
self._ui.device_name.setText(
"<b>%s</b> [conn: %s]" % (str(self... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
###AWG
sys.path.append('/home/pulseepr/Sources/AWG/Examples/python')
###sys.path.append('/home/anatoly/AWG/spcm_examples/python')
##sys.path.append('/home/anatoly/awg_files/python')
#sys.path.append('C:/Users/User/Desktop/Examples/python')
import nump... | |
m.x118 >= 0)
m.c220 = Constraint(expr= m.x119 >= 0)
m.c221 = Constraint(expr= m.x120 >= 0)
m.c222 = Constraint(expr= m.x121 >= 0)
m.c223 = Constraint(expr= m.x122 >= 0)
m.c224 = Constraint(expr= - 4*m.b59 + m.x123 >= 0)
m.c225 = Constraint(expr= m.x124 >= 0)
m.c226 = Constraint(expr= m.x125 >= 0)
m.c227 = Const... | |
import sys
from elegantrl.run import *
'''custom env'''
class PendulumEnv(gym.Wrapper): # [ElegantRL.2021.11.11]
def __init__(self, gym_env_id='Pendulum-v1', target_return=-200):
# Pendulum-v0 gym.__version__ == 0.17.0
# Pendulum-v1 gym.__version__ == 0.21.0
gym.logger.set_level(40) # Block warning
... | |
<reponame>mtakahiro/mirage
#! /usr/bin/env python
"""
Create a mirage-format seed image from
an input fits file. This fits file must contain a
valid WCS, and be distortion-free.
This code will extract a sub-image from the input
fits file. The subimage is centered at the input
RA and Dec (crop_center_ra, crop_center_d... | |
% 4 == 0:
elements.append(frame[i_][0])
if i % 4 == 1:
coordinates.append(frame[i_])
if i % 4 == 2:
velocities.append(frame[i_])
if i % 4 == 3:
forces.append(frame[i_])
frame_data['atom_ids'] = np.array(elements)
frame_data['coordinates'] = np.array(coordinates, dtype=float)
if velocities:
frame_data['veloci... | |
import requests
import json
import sys
import collections
import jinja2
import ipaddress
import time
import re
import urllib3
urllib3.disable_warnings()
# Global options for debugging
PRINT_PAYLOAD = True
# flag variable to avoid pushing anything to APIC
PUSH_TO_APIC = False
PRINT_RESPONSE_TEXT_ALWAYS = False
PRINT_RE... | |
device configurations of listed OSPFv3 processes with provided configurations
cisco.nxos.nxos_ospfv3:
config:
processes:
- process_id: 102
router_id: 198.51.100.1
address_family:
afi: ipv6
safi: unicast
areas:
- area_id: 0.0.0.100
filter_list:
- route_map: rmap_8
direction: in
ranges:
- not_advertise: tr... | |
else:
l_discrete[current_bin].append(l)
if len(l_discrete)==bins+1:
l_discrete[bins-1].extend(l_discrete[bins])
del l_discrete[bins]
del bin_scores[-1]
bin_scores[-1]= bin_scores[-1]-cut/2.0 + \
(predictions[-1]-(bin_scores[-1]-cut/2.0))/2.0
except EmptyBinException:
if bins>1:
bins-=1
else:
raise Exception... | |
self.functions.itervalues() }
self._node_addresses = sorted(self.nodes.keys())
self._function_addresses = sorted(self.functions.keys())
self._stale_lookup = False
#--------------------------------------------------------------------------
# Metadata Collection
#---------------------------------------------------... | |
"""
Full CI based on determinants rather than on CSFs.
The approach is the one introduced by
Olsen J Chem Phys 89 2185 (1988)
It is also described in the book
Molecular electronic structure theory,
by Helgaker, <NAME>.
There it is called 'Minimal operator count (MOC) method'
written by <NAME>
Notation:
Book of ... | |
#!/usr/bin/env python
from __future__ import print_function
r"""
Runs the Sentieon Genomics Tools workflows using Google Pipelines API
"""
import yaml
import json
import argparse
import os
import sys
import copy
import time
import ssl
import warnings
import logging
import random
import google.auth
import googleapicl... | |
SHA3_224 = 0x0000000E
SHA3_256 = 0x0000000F
SHA3_384 = 0x00000010
SHA3_512 = 0x00000011
class InteropFunction(enum.Enum):
# KMIP 2.0
BEGIN = 0x00000001
END = 0x00000002
RESET = 0x00000003
class ItemType(enum.Enum):
# KMIP 2.0
STRUCTURE = 0x00000001
INTEGER = 0x00000002
LONG_INTEGER = 0x00000003
BIG_INTE... | |
<filename>python/src/cca/ebt/sourcecode_metrics_for_survey_cpp.py
#!/usr/bin/env python3
'''
Source code metrics for C programs
Copyright 2013-2018 RIKEN
Copyright 2018-2020 Chiba Institute of Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in complian... | |
<gh_stars>10-100
"""The MIT License (MIT)
Copyright (c) 2018 EvieePy
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, mod... | |
''' Character Class
Character class for py-fighter game.
Takes input of character data, screen, x position, and y position.
Has functions to make move.
- character_data takes the form of a Python dictionary with all key
components and data for character. This is usually stored in a JSON. We
have decided to implemen... | |
<reponame>ezgimercan/SlicerMorph
import os
import unittest
import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
import fnmatch
import numpy as np
import random
import math
import re
import csv
#
# MeshDistanceMeasurement
#
class MeshDistanceMeasurement(ScriptedLoadableModule):
"""Us... | |
for field_name in fields:
field = self._fields.get(field_name)
if field is None:
continue
if field.type in ('many2many', 'one2many'):
continue
elif field.type == 'many2one':
data[field_name] = _get_first_not_null_id(field_name, self) # take the first not null
elif field.type == 'text':
data[field_name] = '\n\n... | |
i,k in enumerate(vegtype_mainlist))
inter = set(ind_dict).intersection(vegtype_str)
indices = [ ind_dict[x] for x in inter ]
return indices
# Flexibly subset time(s) and/or vegetation type(s) from an xarray Dataset or DataArray. Keyword arguments like dimension=selection. Selections can be individual values or slic... | |
logging during replication.
:type log_storage_account_id: str
"""
_validation = {
'instance_type': {'required': True},
}
_attribute_map = {
'instance_type': {'key': 'instanceType', 'type': 'str'},
'hv_host_vm_id': {'key': 'hvHostVmId', 'type': 'str'},
'vm_name': {'key': 'vmName', 'type': 'str'},
'os_type': ... | |
'''
Biblioteca para calculo de refrigeracao regenerativa em motores foguetes bi propelentes
<NAME>
https://github.com/jeffersonmsb/rocket-cooling-calculator
'''
import csv
import numpy as np
import math
import pyCEA
from scipy import optimize
import os
import subprocess
def geometry(data_in, data_out):
with open(dat... | |
it!”
“Your father doesn’t admit that——”
“He must have been.”
“<NAME>. These matters are not for you to judge. You know your
father has done all he honestly could to be fully pardoned, or to
discover the real criminal, and as he hasn’t succeeded, you must rest
content with the knowledge that there was no stone left u... | |
<reponame>eubr-bigsea/limonero
# -*- coding: utf-8 -*-
import datetime
import json
from copy import deepcopy
from marshmallow import Schema, fields, post_load, post_dump, EXCLUDE, INCLUDE
from marshmallow.validate import OneOf
from flask_babel import gettext
from limonero.models import *
def partial_schema_factory(sc... | |
detected in check special 'scene' subgroup."
# " Stray metadata files are ignored for the purpose of flagging"
# " higher-level check special groups as incomplete due to missing suffixes.")
# warnings.showwarning = script_utils.showwarning_stderr
# continue
missing_suffixes = [s for s in src_suffixes_subgroup if ... | |
- :class:`~adorn.exception.type_check_error.MissingDependencyError`:
``typing.Literal`` requested state that wasn't specified in the
local state
Args:
target_cls (Parameter): container parameter's state
literal_dict (Dict[str, str]): dependency request
args (Dict[str, Any]): local state
Returns:
Optional[Type... | |
Hello, i'm <NAME>, studying MCA 2years at M.S.Ramaiah Institute Of Technology, Bangalore <eom>
[14:30] <kushal> singh123, you spoke early
[14:30] <kushal> next
[14:30] <sayan> singh123: wait for your turn
[14:30] <kushal> next
[14:30] <fihae> Aligarh Muslim University ,Aligarh ,India
[14:30] <kushal> fihae, Thanks, see... | |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import time
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from common import constants
from co... | |
seealso::
- `ISO 18431-4 Mechanical vibration and shock — Signal processing — Part 4: Shock-response spectrum analysis`
Explicit implementations of digital filter coefficients for shock spectra.
"""
A = omega*T/(2.*Q)
B = omega*T*np.sqrt(1. - 1/(4.*(Q**2.)))
C = (T*omega)
q = (1./(2.*(Q**2.)) - 1.)/(np.sqrt(1. ... | |
<gh_stars>0
from redbot.core.bot import Red
from redbot.core import checks
from discord.ext import commands
import discord
import os, sys
import base64
import time
import asyncio
from io import BytesIO
import datetime
from PIL import Image
import json
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
import m... | |
Temp. forcing tendency
103 |gS_Forc | 50 | |SMR MR|psu/s |Salinity forcing tendency
104 |AB_gT | 50 | |SMR MR|degC/s |Potential Temp. tendency from Adams-Bashforth
105 |AB_gS | 50 | |SMR MR|psu/s |Salinity tendency from Adams-Bashforth
106 |gTinAB | 50 | |SMR MR|degC/s |Potential Temp. tendency going in Adams-Bashf... | |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA
#
# https://github.com/CNES/Pandora_pandora
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | |
<gh_stars>0
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"... | |
str
the sorting order of the ranked results. Should be either "asc" (ascending) or "desc" (descending)
Returns
-------
list
a list of the searched and matched model dictionaries containing metric and model_id, sorted by metric.
"""
ranked_models = []
matching_models = self.model_selector.find_matching_models_b... | |
#!/usr/bin/env python3
def get_bs_vs_tn(in_file_name, out_file_name, best_config_list):
'''
Note: best case for dense int8 new log is:
batch_size data_parallel model_parallel thread_num
16 4 1 8
batch size: 1 2 4 8 16 32 64 128 256 512 1024
data parallel: 1 2 4 8 16 32
model parallel: 1 2 4 8 16 32
thread num... | |
<filename>rrlfd/residual/train.py
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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
#... | |
{1}").format(name,
response.reason)
e = exception.CephFailure(reason=msg)
LOG.error(e)
raise e
# TODO(CephPoolsDecouple): remove
def create_or_resize_osd_pool(self, pool_name, pg_num, pgp_num,
size, min_size):
"""Create or resize an osd pool as needed
:param pool_name: pool name
:param pg_num: number of plac... | |
<gh_stars>1-10
import os
import sys
import glob
import argparse
import pandas as pd
import numpy as np
from astropy.wcs import WCS
from astropy.io import fits, ascii
from astropy.visualization import ImageNormalize, ZScaleInterval
import matplotlib.pyplot as plt
import time
from tqdm import tqdm
from spacekit.analyzer... | |
import shutil, atexit, os, tempfile, logging
import numpy as np
import cv2
from scipy import ndimage
import ray
from src.focus_stack.utilities import Utilities
import src.focus_stack.RayFunctions as RayFunctions
# Setup logging
log = logging.getLogger(__name__)
class ImageHandler:
image_storage = {}
image_shape =... | |
dataf_spec.destroy()
self.updateTable()
return
dataf_spec=Toplevel()
dataf_spec.title('Specify type of data field')
top=self.master.winfo_toplevel()
rootx=top.winfo_rootx()
rooty=top.winfo_rooty()
dataf_spec.geometry('+%d+%d' %(rootx+100,rooty+100))
dataf_spec.transient(self.master)
dataf_spec.grab_set() # G... | |
or when the upstream device is performing a
RSS for connection based distribution.
type: str
dnsprofilename:
description:
- >-
Name of the DNS profile to be associated with the VServer. DNS profile properties will be applied to
transactions processed by a VServer. This parameter is valid only for DNS and DNS-TC... | |
import asyncio, logging
from ..Exceptions import ClientExceptions
logger = logging.getLogger("Decorator")
class BASE_DECORATOR(object):
def __init__(self, parent:object, *args, **kwargs):
self.parent = parent
self.args = args
self.kwargs = kwargs
def __call__(self, func):
self.func = func
if se... | |
'>' + 'ALIGNMENT COVERAGE (HIT SEQ)' + '</font></td>']
html_report_lines += ['<td style="border-right:solid 2px ' + border_head_color + '; border-bottom:solid 2px ' +
border_head_color + '"><font color="' + text_color + '" size=' + text_fontsize + '>' + 'GENE ID' + '</font></td>']
html_report_lines += ['<td style="b... | |
# A utility script to clean up the tables and set annotations after running remap_vocab.py to remapping from 'data_commons' to 'ermrest_model' vocabulary tables.
#
# Example usage:
#
#
# $ python facebase_post_remap_vocab.py dev.facebase.org 11 'vocab' '.*$' -v --annotations --cleanup
# The command above would run this... | |
from backend import *
from basement import *
from pausable import *
from kittyaccesscontrol import *
from kittybase import KittyBase
from erc721 import ERC721
from erc721metadata import ERC721Metadata
# @title The facet of the CryptoKitties core contract that manages ownership, ERC-721 (draft) compliant.
# @author <N... | |
#!/usr/bin/env python
__author__ = "<EMAIL>"
import shutil
import sys
from collections import OrderedDict, defaultdict
from csv import DictReader, DictWriter
from enum import Enum
from multiprocessing import Process
from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union
import typer
from Bio i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.