input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
= "extpolControllerCont"
EXTPOL_EP = "extpolEp"
EXTPOL_EP_FSM = "extpolEpFsm"
EXTPOL_EP_FSM_STAGE = "extpolEpFsmStage"
EXTPOL_EP_FSM_TASK = "extpolEpFsmTask"
EXTPOL_PROVIDER = "extpolProvider"
EXTPOL_PROVIDER_CONT = "extpolProviderCont"
EXTPOL_PROVIDER_FSM = "extpolProviderFsm"
EXTPOL_PROVIDER_FSM_STAGE = "extp... | |
Gs_bi,Ls_bi,pi,(tchans,rchans),di in zip(Gs, Ls, boneParents, boneDofs, dofSplits):
nt,nr = len(tchans),len(rchans)
if pi == -1: Gs_pi = np.array([[1,0,0,0],[0,1,0,0],[0,0,1,0]],dtype=np.float32)
else : Gs_pi = Gs[pi]
#Gs_bi = Gs_pi * Ls[bi] * Dof0 * Dof1 * ...
np.dot(Gs_pi[:,:3], Ls_bi, out=Gs_bi)
Gs_bi[:,... | |
ASSET_LOG_LOST : T("Lost"),
ASSET_LOG_STOLEN : T("Stolen"),
ASSET_LOG_DESTROY : T("Destroyed"),
}
asset_condition_opts = {1:T("Good Condition"),
2:T("Minor Damage"),
3:T("Major Damage"),
4:T("Un-Repairable"),
5:T("Needs Maintenance"),
}
if auth.permission.format == "html":
# T isn't JSON serializable
site... | |
stt
# get rid of padding
slopes = slopes[2*half_window:]
return slopes
#**********************************************************************
#.. EVENT NOTIFICATION: tsunami detection
#**********************************************************************
def prs_tsunami_detection(botsflu_5minrate, tsunami_detec... | |
# ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# File Author: <NAME> (c) #
# Date: 1/13/2020 #
# MIT Licence #
# ##########################################################
from PyQt5 import QtWidgets, QtCore, QtGui
from appTool import AppTool
from appGUI... | |
cls_head=cls_head,
average=average, return_result=True, split_names=['Train', 'Validataion', 'Test'],
forward_kwargs=forward_kwargs, predict_func=predict_func, pred_kwargs=pred_kwargs,
verbose=True)
if show_results_in_notebook:
print('\nModel after the last training epoch:')
eval_classification_multi_splits(mo... | |
<gh_stars>1-10
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | |
# Copyright 1999-2021 Alibaba Group Holding 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 applicable law or agreed... | |
0.434294481903252*log(1 + 2007.75081369119*m.b495) + 0.434294481903252*log(1 + 5431.16998851643*
m.b496) + 0.434294481903252*log(1 + 342.359410695155*m.b497) + 0.434294481903252*log(1 +
72.0734036305427*m.b498) + 0.434294481903252*log(1 + 1261.07680796947*m.b499) +
0.434294481903252*log(1 + 4720.72303655132*m.b500... | |
<reponame>FcoJavT/rantanplan<filename>tests/test_core.py
import json
from pathlib import Path
from unittest import mock
import pytest
import spacy
import rantanplan.core
from rantanplan.core import apply_exception_rules
from rantanplan.core import apply_exception_rules_post
from rantanplan.core import clean_phonologi... | |
<reponame>cjohnson-ctl/platform-client-sdk-python<filename>build/PureCloudPlatformClientV2/models/create_work_plan.py
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
PROYECTO FINAL
<NAME> y <NAME>
"""
import cv2
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.preproces... | |
resultado = "0" + resultado
elif num == 1:
resultado = "1" + resultado
decimal += 1
decimal /= 2
tamanho = len(resultado)
while tamanho < 8:
resultado = '0' + resultado
tamanho += 1
tamanho = len(resultado)
nume = list(resultado)
while i < tamanho:
if resultado[i] == '1':
nume[i] = '0'
elif resultado[i] =... | |
"div",
"rem",
"eqeq",
"neq",
"lt",
"lte",
"gt",
"gte",
]:
def fn(self, items, meta, op=op):
assert len(items) == 2
return E.Apply(sp(self.filename, meta), "_" + op, items)
setattr(_ExprTransformer, op, lark.v_args(meta=True)(classmethod(fn))) # pyre-fixme
class _TypeTransformer(lark.Transformer):
# pyli... | |
not UtilClient.is_unset(headers.common_headers):
real_headers = headers.common_headers
if not UtilClient.is_unset(headers.service_group):
real_headers['serviceGroup'] = headers.service_group
if not UtilClient.is_unset(headers.x_acs_dingtalk_access_token):
real_headers['x-acs-dingtalk-access-token'] = headers.x_acs... | |
<reponame>peterlynch/MoneydancePythonScripts
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# stockglance2020.py build:1016 - October 2020 - <NAME>
# Original code StockGlance.java Moneydance Extension Copyright <NAME> - https://github.com/jameslarus/stockglance
#
# Copyright (c) 2020, <NAME> StuWareSoftSystems
# All ... | |
legend=False,
linewidth=linewidth,
band_color=band_color,
)
band_up.plot_plain(
ax=ax_band_down,
color=unprojected_band_color,
linewidth=unprojected_linewidth,
)
dos_down.plot_elements(
ax=ax_dos_down,
elements=elements,
fill=fill,
alpha=alpha,
linewidth=linewidth,
sigma=sigma,
energyaxis='y',
color_... | |
or sourceval_id or sourceval:
self.addImportedFrom(repo=repo, claim=new_prop, lang=lang, source_id=source_id, sourceval_id=sourceval_id, sourceval=sourceval, status=1)
# print("Reference added.")
if qualifier_id and qualval_id:
self.addQualifiers(repo=repo, claim=new_prop, qualifier_id=qualif... | |
<filename>libraryfree/venv/lib/python3.6/site-packages/pymongo/connection.py
# Copyright 2009-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.apache.org/lice... | |
#
# peepdf is a tool to analyse and modify PDF files
# http://peepdf.eternal-todo.com
# By <NAME> <jesparza AT eternal-todo.com>
#
# Copyright (C) 2011-2017 <NAME>
#
# This file is part of peepdf.
#
# peepdf is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | |
import os
import logging
import requests
import json
class NewsArticle(object):
def __init__(self):
self.title = None
self.description = None
self.publishedAt = None
self.author = None
self.url = None
self.urlToImage = None
def _get_json_attribute(self, data, name, def_value=None):
if name in data:
return... | |
is not None and '_subtype' not in already_processed:
already_processed.add('_subtype')
if value in ('true', '1'):
self._subtype = True
elif value in ('false', '0'):
self._subtype = False
else:
raise_parse_error(node, 'Bad boolean attribute')
value = find_attr_value_('Source', node)
if value is not Non... | |
import shutil
import os
import time
import multiprocessing
import pdb
import torch
from torch.nn.utils import clip_grad_norm_
import torch.distributed as dist
import torch.nn.functional as F
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transf... | |
<filename>src/googletranslate.py<gh_stars>0
# Keypirinha: a fast launcher for Windows (keypirinha.com)
import keypirinha as kp
import keypirinha_util as kpu
import keypirinha_net as kpnet
import re
import json
import traceback
import urllib.error
import urllib.parse
import os
class GoogleTranslate(kp.Plugin):
"""Sugg... | |
# %%
import os
import logging
import random
from enum import Enum, auto
import re
import sentry_sdk
from dff import dialogflow_extension
import common.dialogflow_framework.utils.state as state_utils
import common.dialogflow_framework.utils.condition as condition_utils
import common.utils as common_utils
import common... | |
= DeferredForeignKey("Image", null=True, backref="children")
class Meta:
database = db
read_only_config = read_only_config
indexes = (
# we don't really want duplicates
(("repository", "docker_image_id"), True),
(("security_indexed_engine", "security_indexed"), False),
)
def ancestor_id_list(self):
""" Retu... | |
Primary: 是否是主网卡。
:type Primary: bool
:param MacAddress: MAC地址。
:type MacAddress: str
:param State: 取值范围:PENDING|AVAILABLE|ATTACHING|DETACHING|DELETING。
:type State: str
:param PrivateIpAddressSet: 内网IP信息。
:type PrivateIpAddressSet: list of PrivateIpAddressSpecification
:param Attachment: 绑定的云服务器对象。
:type Attac... | |
from params dictionary.
If the parameter is not in params look in self.parameters.
"""
if params and name in params:
return params[name]
elif name in self.parameters:
return self.parameters[name]
else:
return None
def get_subs(self,params=None):
"""
Return (presubs,postsubs) tuple.
"""
presubs = self.get_p... | |
#!/usr/bin/env python
# Copyright 2015 Check Point Software Technologies 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 require... | |
<gh_stars>0
import time
import os
import glob
import datetime
import numpy
import threading
import subprocess
#import scipy.stats
from PyQt4 import QtCore, QtGui
import matplotlib
matplotlib.use('TkAgg')
matplotlib.rcParams['backend'] = 'TkAgg'
import pylab
def shortenTo(s,maxsize=100):
if len(s)<=maxsize: return ... | |
in role.property_names:
try:
entity_type = self.entity_type(entity_type_name, namespace)
except KeyError:
raise PyODataModelError('EntityType {} does not exist in Schema Namespace {}'
.format(entity_type_name, namespace))
try:
entity_type.proprty(proprty)
except KeyError:
raise PyODataModelError('Property {} d... | |
<filename>tests/test_handlers.py<gh_stars>0
"""Test API endpoints from handlers module."""
from pathlib import Path
from unittest.mock import patch
from aiohttp import FormData
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
from aiounittest import futurized
from metadata_backend.server import init... | |
from ClassesDAO.ClienteDAO import ClienteDAO
from ClassesDAO.FuncionarioDAO import FuncionarioDAO
from ClassesDAO.LivroDAO import LivroDAO
from ClassesDAO.CategoriaDAO import CategoriaDAO
# Classe que implementa as telas da aplicação e também é classe que inicia a aplicação
class AluguelPython(object):
# Menu princi... | |
retry_strategy:
return retry_strategy.make_retrying_call(
self.base_client.call_api,
resource_path=resource_path,
method=method,
query_params=query_params,
header_params=header_params,
response_type="list[User]")
else:
return self.base_client.call_api(
resource_path=resource_path,
method=method,
query_param... | |
#
# Copyright (c) 2021, NVIDIA CORPORATION. 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 applicab... | |
<reponame>kaldan007/openpecha-toolkit<filename>openpecha/formatters/hfml.py
from copy import deepcopy
from pathlib import Path
import re
from openpecha.formatters.formatter import BaseFormatter
from openpecha.formatters.format import *
class HFMLFormatter(BaseFormatter):
'''
OpenPecha Formatter for digitized wooden... | |
if isinstance(event, DeviceStateChangedEvent):
# change device state
if self.__devices[event.device_url] is None:
raise Exception(
"Received device change "
+ "state for unknown device '"
+ event.device_url
+ "'"
)
self.__devices[event.device_url].set_active_states(event.states)
return events
def get_curr... | |
self.train_images = train_images
self.test_images = test_images
self.train_labels = one_hot(train_labels, self.n_classes)
self.test_labels = one_hot(test_labels, self.n_classes)
def cifar_100(self):
self.n_classes = 100 # labels
# training data & label
train_batch = self.unpickle("{0}/train".format(self.ds_pa... | |
<reponame>blackdaemon/enso-launcher-continued
# vim:set tabstop=4 shiftwidth=4 expandtab:
#
# This code has been borrowed from Kupfer
#
# Homepage: http://kaizer.se/wiki/kupfer/
# Credits: Copyright 2007-2011 <NAME> <<EMAIL>>
# Licence: GNU General Public License v3 (or any later version)
__updated__ = "2017-03-01"
i... | |
<gh_stars>10-100
import math, copy
from functools import reduce
from tensorflow.keras import layers
from pyradox.modules import *
from tensorflow.keras.activations import swish
from tensorflow.nn import relu6
def relu(x):
return layers.ReLU()(x)
def hard_sigmoid(x):
return layers.ReLU(6.0)(x + 3.0) * (1.0 / 6.0)
... | |
#!/usr/bin/python
"""
HBC by FinlayDaG33k under the MIT License
"""
import wx
import wx.grid
import wx.lib.agw.aui as aui
import Pyro4
import os
import threading
from encoder_cfg import pyro_host, pyro_port, ftp_host, ftp_port, ftp_user, ftp_pass
from ftplib import FTP
import textwrap
statusMapping = {
'Encoding':'a'... | |
<gh_stars>1-10
from __future__ import print_function
from collections import defaultdict, OrderedDict, namedtuple
import networkx as nx
import igraph as ig
import numpy as np
import pandas as pd
from scipy.sparse import coo_matrix,csc_matrix
from scipy.stats import hypergeom
import time
import warnings
from .network ... | |
define a `callback` function
to be invoked when receiving the response.
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.post_conversations_messages_inbound_open(body, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
... | |
from __future__ import annotations
import socket
import logging
import re
import threading
import pyaudio
import array
from typing import List, Optional, Tuple, Union
logging.basicConfig(filename='audiostream_logs.log', level=logging.INFO)
_MSG_PREFIX = b'PRE'
_MSG_SUFIX = b'SUF'
def _compose_message(message: byt... | |
"phoneNumber"
PHONE_NUMBER_DESC = "phoneNumber desc"
SHIPMENT_METHOD_ID = "shipmentMethodId"
SHIPMENT_METHOD_ID_DESC = "shipmentMethodId desc"
TAX_AREA_DISPLAY_NAME = "taxAreaDisplayName"
TAX_AREA_DISPLAY_NAME_DESC = "taxAreaDisplayName desc"
TAX_AREA_ID = "taxAreaId"
TAX_AREA_ID_DESC = "taxAreaId desc"
TAX_LIA... | |
# Enter a parse tree produced by PlSqlParser#container_data_clause.
def enterContainer_data_clause(self, ctx:PlSqlParser.Container_data_clauseContext):
pass
# Exit a parse tree produced by PlSqlParser#container_data_clause.
def exitContainer_data_clause(self, ctx:PlSqlParser.Container_data_clauseContext):
pass
... | |
{
'command': 'no ipv6 address {ipv6}',
'doc': 'Unset IPv6 address',
'arguments': [
{
'name': 'ipv6',
'doc': 'X:X::X:X/M Interface IPv6 address',
},
],
},
{
'command': 'ipv6 address {ipv6} secondary',
'doc': 'Set secondary IPv6 address',
'arguments': [
{
'name': 'ipv6',
'doc': 'X:X::X:X/M Interface IPv6 ... | |
import numpy as np
import matplotlib
matplotlib.use('Agg')
import networkx as nx
import csv
from numpy import ma
import dynesty
import corner
import copy
import matplotlib.pyplot as plt
import random as rnd
from multiprocessing import Pool, cpu_count
import INoDS_convenience_functions as nf
import warnings
import scipy... | |
handler.sync_with_handlers(logging.root.handlers)
handler.close()
break
# Redefine the handler to None so it can be garbage collected
setup_temp_handler.__handler__ = None
# Override the python's logging logger class as soon as this module is imported
if logging.getLoggerClass() is not SaltLoggingClass:
# Impor... | |
<gh_stars>0
import functools
import os
import ssl
import uuid
from typing import Any, Dict, List, Literal, Optional, Tuple
import jinja2
import pydantic
import yaml
from .exceptions import TplBuildException, TplBuildTemplateException
RESERVED_PROFILE_KEYS = {
"begin_stage",
"platform",
}
def _normalize_rel_path(... | |
<filename>pyannote/audio/applications/pyannote_audio.py
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2019-2020 CNRS
# 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 th... | |
<reponame>SkyLined/mDateTime<filename>cDate.py
import calendar, datetime, math, re;
gbDebugOutput = False;
rDate = re.compile(
r"^\s*" +
r"(\d{4})" +
r"[\-\/]" +
r"(\d{1,2})" +
r"[\-\/]" +
r"(\d{1,2})" +
r"\s*$"
);
asMonths = [
"January", "February", "March", "April", "May", "June",
"July", "August", "Septe... | |
may be ignored with non-default options for the next two
inputs).
op_exclusions : None or list of gates, optional (default is None)
If not None, all Circuits containing *any* of the gates in this list are discarded,
and no comparison will be made for those strings.
op_exclusions : None or list of gates, optional... | |
from math import tanh
import random
import time
import Assembly.AVX as AVX
import Assembly.CodeBlocks as CodeBlocks
import Assembly.TypeSizes as TypeSizes
import Classes.ExpressionComponent as EC
import Classes.Optimizer
import config
from Assembly.AVX import (avx_correctSize, avx_doToReg, avx_dropToAddress,
avx_load... | |
params:
body_params = params['registration']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json'])
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/json'])
# Authentication setting
a... | |
there
if 'id' not in atoms.columns : atoms['id'] = atoms.index.values
mobile_ions = atoms.query('atom==@mobile').sort_values(by='z')
num_planes = round(cell[2,2] / mobile_ions.z.diff().dropna().max())
## it would be simple to extend the plane detection to unequal #s of atoms
st = len(atoms.query('atom==@mobile... | |
if len(data.get("spans", [])) > 0
else [],
confidence=data.get("confidence", None),
)
class DocumentField(object):
"""An object representing the content and location of a document field value.
:ivar str value_type: The type of `value` found on DocumentField. Possible types include:
"string", "date", "time", "p... | |
#!/usr/bin/python
# Copyright 2014-2015 Canonical Limited.
#
# This file is part of charm-helpers.
#
# charm-helpers is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3 as
# published by the Free Software Foundation.
#
# charm-helpers is distr... | |
<reponame>arokem/AFQ-Insight<filename>afqinsight/cnn.py
"""Build, fit, and predict with 1-D convolutional neural networks."""
import functools
import numpy as np
import os.path as op
import tempfile
from dipy.utils.optpkg import optional_package
from sklearn.impute import SimpleImputer
from sklearn.metrics import r2_... | |
Token"
},
"token1": {
"id": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"name": "Wrapped Ether"
}
},
{
"id": "0x3e18ce4f283576d54e88f550ee2199df6a03ff22",
"token0": {
"id": "0x2c88c64a9b01ad99af0c19895645e211e21efd16",
"name": "HOURS"
},
"token1": {
"id": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"... | |
in self.extensions:
subtags.append(ext)
if self.private:
subtags.append(self.private)
self._str_tag = '-'.join(subtags)
return self._str_tag
def simplify_script(self) -> 'Language':
"""
Remove the script from some parsed language data, if the script is
redundant with the language.
>>> Language.make(language... | |
# Authors:
# <NAME>
#
# See the LICENSE file for legal information regarding use of this file.
import unittest
from tack.compat import a2b_hex
from tack.crypto.python.Python_AES import Python_AES
from tack.crypto.python.Python_ECGenerator import Python_ECGenerator
from tack.crypto.python.numbertheory import *
from t... | |
file_based_convert_examples_to_features(
examples, label_map, max_seq_length, tokenizer, output_file):
"""Convert a set of `InputExample`s to a TFRecord file."""
writer = tf.python_io.TFRecordWriter(output_file)
for (ex_index, example) in enumerate(examples):
if ex_index % 10000 == 0:
tf.logging.info("Writing e... | |
"bien",
"honk",
"doughnut",
"tags",
"wrapping",
"tar",
"om",
"dinozzo",
"ducky",
"unfaithful",
"delia",
"rae",
"jojo",
"stance",
"barker",
"financially",
"clam",
"clanking",
"sarcastic",
"blur",
"organizing",
"nosy",
"boyle",
"pasha",
"my-",
"attacker",
"horribly",
"inject",
"descend",
"wi"... | |
"""Download and install structured genome data and aligner index files.
Downloads prepared FASTA, indexes for aligners like BWA, Bowtie and novoalign
and other genome data in automated pipelines. Specify the genomes and aligners
to use in an input biodata.yaml configuration file.
The main targets are fabric functions... | |
<gh_stars>0
# Copyright (C) 2015 UCSC Computational Genomics Lab
#
# 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 applicab... | |
data
x = test_set_x[index * batch_size: (index + 1) * batch_size]
y_kpt_norm = test_set_y['kpt_norm'][index * batch_size: (index + 1) * batch_size]
y_kpt_ocular_dist = test_set_y['ocular_dist'][index * batch_size: (index + 1) * batch_size]
y_bound_mask = test_set_y['bound_mask'][index * batch_size: (index + 1) * ba... | |
<filename>lib/matplotlib/table.py
"""
Place a table below the x-axis at location loc.
The table consists of a grid of cells.
The grid need not be rectangular and can have holes.
Cells are added by specifying their row and column.
For the purposes of positioning the cell at (0, 0) is
assumed to be at the top left an... | |
US_origin_destination = oil_attrs["categories"]["US_origin_destination"]
# Get cargo oil type attribution information from oil-type yaml files
yaml_file = transport_data_dir / Path(oil_attrs["files"]["CAD_origin"]).name
with yaml_file.open("rt") as f:
CAD_yaml = yaml.safe_load(f)
yaml_file = transport_data_dir / ... | |
possaliency
def convertToNegativeSaliency(self, saliency):
negsaliency = F.threshold(-1 * saliency, 0.0, 0.0)
negsaliency = negsaliency / torch.max(negsaliency)
return negsaliency
def convertToAbsoluteSaliency(self, saliency):
return torch.abs(saliency)
def getAbsoluteSaliencyImage(self, state, atariimg, mode... | |
m:
group = m.groupdict()
label_withdraw = peer_dict.setdefault('in_label_withdraw_records', {})
label_withdraw.update({'created': int(group['created'])})
label_withdraw.update({'freed': int(group['freed'])})
continue
# Local Address Withdraw Set: 0, Cleared: 0
m = p4.match(line)
if m:
group = m.groupdict()
l... | |
"""
Regex notes:
Get recipe title
(?:^# (.*)\s+)
Get the img tag or whatever is between the title line and the next section
(?:^# .*\s*)(^(?:<.+>\s*?)*?)\s*(?:##[^#])
Get the overview section rows in a single group
(?:^## Overview\s+)(^(?:.*\s*?)*?)\s*(?:##[^#])
Get the entire ingredients sections, including blank... | |
active dashboards': ['netcool realtime'],
'netcool service': ['netcool'],
'netcool service monitor': ['netcool service', 'service monitor'],
'netcool system': ['netcool'],
'netcool system service monitor': ['netcool system'],
'netcool/service monitor for network usage': ['netcool service monitor'],
'netcool/servi... | |
# 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 or agreed to in writing, software
# distributed under the Li... | |
# Copyright 2021 <NAME>
#
# 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 or agreed to in writing, software
... | |
_snap.TChA_SearchChBack(self, *args)
def SearchStr(self, *args):
"""
SearchStr(TChA self, TChA Str, int const & BChN=0) -> int
Parameters:
Str: TChA const &
BChN: int const &
SearchStr(TChA self, TChA Str) -> int
Parameters:
Str: TChA const &
SearchStr(TChA self, TStr Str, int const & BChN=0) -> int
Pa... | |
point
set_default_creator(new_dict, sub_name, sub_email)
new_dict['extras'] = reduced_extras
except KeyError as ex:
log.debug('''Expected key ['%s'] not found, attempting to move common core keys to subdictionary''',
ex.message)
#this can happen when a form fails validation, as all the data will now be as key,v... | |
}
return result
@ignore_warnings(category=ConvergenceWarning)
def find_seasonality_changepoints(
self,
df,
time_col,
value_col,
seasonality_components_df=pd.DataFrame({
"name": ["tod", "tow", "conti_year"],
"period": [24.0, 7.0, 1.0],
"order": [3, 3, 5],
"seas_names": ["daily", "weekly", "yearly"]}),
resa... | |
import numpy as np
from PIL import Image, ImageDraw, ImageFont, ImageMath
from pyray.shapes.solid.polyhedron import *
from pyray.axes import *
from pyray.rotation import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
##########################################################################... | |
<filename>torch/fft/__init__.py
import sys
import torch
from torch._C import _add_docstr, _fft # type: ignore
Tensor = torch.Tensor
# Note: This not only adds the doc strings for the spectral ops, but
# connects the torch.fft Python namespace to the torch._C._fft builtins.
fft = _add_docstr(_fft.fft_fft, r"""
fft(i... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: ISO-8859-15 -*-
#
# generated by wxGlade 0.6.8 (standalone edition) on Sun Oct 02 12:29:06 2016
#
import wx
# begin wxGlade: dependencies
import gettext
from gettext import gettext as _
# end wxGlade
class chronoFrame(wx.Frame):
def __init__(self, *args, **kwds):
# ... | |
**kwargs: object) -> None:
"""
Log 'msg % args' with severity 'DEBUG'.
To pass exception information, use the keyword argument exc_info with
a true value, e.g.
Keyword arguments should be JSON serializable.
``logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)``
"""
self.log_msg(logging.DEBUG... | |
# encoding=utf-8
import sys
#
import math
# noinspection PyUnresolvedReferences
import maya.cmds as cmds
# noinspection PyUnresolvedReferences
import maya.api.OpenMaya as OpenMaya
# noinspection PyUnresolvedReferences
import maya.api.OpenMayaUI as OpenMayaUI
# Use 2.0 API
def maya_useNewAPI():
pass
# Command
class... | |
intrinsics
# because we cannot resolve runtime values like Arn of a resource. For purposes of detecting changes, this
# is good enough. Here is why:
#
# When using intrinsic functions there are two cases when has must change:
# - Value of the template parameter changes
# - (or) LogicalId of a referenced resource ... | |
is invalid. Cannot add.')
if delete_prev:
cm.delete_computed_cid(cid)
cm.cx2_cid[cx] = cid
cm.cx2_nx [cx] = nx
cm.cx2_gx [cx] = gx
cm.cx2_roi[cx] = roi
cm.cx2_theta[cx] = theta
cm.max_roi = map(lambda (a,b): max(a,b), zip(cm.max_roi, roi))
# Add This Chip To Reverse Indexing
if cid >= len(cm.cid2_cx):
idAll... | |
"""
- EMOS 'operatingsystem.py' Source Code -
(C) Cubeflix 2021 (EMOS)
"""
# Imports
from .misc import *
from .memory import *
from .cpu import *
from .computer import *
class OperatingSystem:
"""The main operating system or OS the computer uses. System calls through interrupts can allow for memory and process... | |
<filename>deep_qa-master/deep_qa/contrib/models/multiple_choice_bidaf.py
from copy import deepcopy
from typing import Any, Dict, List
from keras import backend as K
from keras.layers import Input
from overrides import overrides
from ...models.reading_comprehension.bidirectional_attention import BidirectionalAttention... | |
'a6_02_8': [0, 1, 8, 9],
'a6_02_9': [0, 1, 8, 9],
'a6_02_10': [0, 1, 8, 9],
'a6_02_11': [0, 1, 8, 9],
'a6_02_12a': [0, 1, 8, 9],
'a6_02_13': [0, 1, 8, 9],
'a6_02_14': [0, 1, 8, 9],
'a6_02_15': [0, 1, 8, 9],
'a6_04': [0, 1, 8, 9],
'a6_05': [0, 1, 8, 9],
'a6_06_1d': range(1, 31 + 1) + [99],
'a6_06_1m': range(1... | |
"""module to deal with gaussian cube type data
NB: for all transformations, the cubes coordinate system is understood to be
A = np.array([
[['(x0,y0,z0)', '(x0,y0,z1)'],
['(x0,y1,z0)', '(x0,y1,z1)']],
[['(x1,y0,z0)', '(x1,y0,z1)'],
['(x1,y1,z0)', '(x1,y1,z1)']]
])
which leads to;
A.shape -> (x length, y length... | |
<gh_stars>1-10
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import docker
from docker.errors import DockerException, NotFound, BuildError, ImageNotFound
from docker.models.containers ... | |
import pygame as pg
from pygame import mixer
import random
from math import sqrt
# initialize the pygame
pg.init()
# clock = pg.time.Clock()
screen = pg.display.set_mode((800, 600))
# background jogo
background = pg.image.load('imagens/brasilia2.jpg')
# menu do jogo
menu_image = pg.image.load('imagens/menu.jpeg')
m... | |
<filename>console/scan_scheduler.py
#!/usr/bin/env python
# Standard Python libraries.
import datetime
import ipaddress
import itertools
import logging
import sys
# Third party Python libraries.
from django.utils.timezone import localtime
# Custom Python libraries.
import django_connector
# Setup logging.
LOG_FORM... | |
<filename>src/napari_lf/lfa/lflib/calibration/models.py
import numpy as np
import cv2
# ------------------------------------------------------------------
# ISOMETRY TRANSFORM
#
# Allows for translation & rotation only. Computed by solving the
# orthogonal Procrustes problem:
#
# http://en.wikipedia.org/wiki/Orthogona... | |
the app having
special entitlements with an explicit
application-identifier. Currently supports
testing aps-environment entitlement.
"""
tests_zip = proto.Field(
proto.MESSAGE,
number=1,
message='FileReference',
)
xctestrun = proto.Field(
proto.MESSAGE,
number=2,
message='FileReference',
)
xcode_version... | |
<reponame>someengineering/resoto<gh_stars>100-1000
from __future__ import annotations
import hashlib
import json
import logging
import re
from collections import namedtuple, defaultdict
from functools import reduce
from typing import Optional, Generator, Any, Dict, List, Set, Tuple
from networkx import DiGraph, Multi... | |
elif nodeName_ == 'CutOffTime':
value_ = child_.text
value_ = self.gds_parse_string(value_, node, 'CutOffTime')
value_ = self.gds_validate_string(value_, node, 'CutOffTime')
self.CutOffTime = value_
self.CutOffTime_nsprefix_ = child_.prefix
elif nodeName_ == 'CutOffWindow' and child_.text:
sval_ = child_.text
i... | |
<gh_stars>0
"""
Utilities
"""
import os, sys, re, signal, subprocess, site
from importlib import import_module
###############################################################################
def expect(condition, error_msg, exc_type=SystemExit, error_prefix="ERROR:"):
#################################################... | |
flag')
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(TForestFire self) -> TForestFire
__init__(TForestFire self, PNGraph const & GraphPt, double const & ForwBurnProb, double const & BackBurnProb,
double const & DecayProb=1.0, int const & RndSeed=1) -> TForestFire
Parameters:
GraphPt: PNGraph ... | |
from __future__ import print_function, division
from cProfile import label
from logging import raiseExceptions
from typing import Mapping, Union, Optional, Callable, Dict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
from tqdm import tqdm, t... | |
#!python3
import os
import logging
import pandas as pd
import numpy as np
import json
import time
from BarSeqPy.translate_R_to_pandas import *
"""
All functions and subroutines:
analysis_2:
initialize_gene_fit_d
FitReadMetrics
FitQuality
CrudeOp
AdjacentPairs
paircor
FEBA_Exp_Status
normalize_per_strain_val... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.