input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
x183 * x226 + x223
A[3, 0] = -r_xx * x43 + r_yx * x46 - r_zx * x42 + x113 + x131 * x187 + x188 * x92
A[3, 1] = -r_xx * x71 + r_yx * x74 - r_zx * x67 + x131 * x195 + x196 * x92 + x203
A[3, 2] = -r_xx * x87 + r_yx * x88 - r_zx * x86 + x131 * x199 + x200 * x92 + x221
A[3, 3] = -r_xx * x132 + r_yx * x134 - r_zx * x130 ... | |
the maximum possible size of a waveform in microseconds.
...
micros = pi.wave_get_max_micros()
...
"""
return _u2i(_pigpio_command(self.sl, _PI_CMD_WVSM, 2, 0))
def wave_get_pulses(self):
"""
Returns the length in pulses of the current waveform.
...
pulses = pi.wave_get_pulses()
...
"""
return _u2i(_pig... | |
normalization to apply, if any of ['LCN'], 'LCN-',
'ZCA', or '-1:1'.
split -- tuple
The (train, valid, test) split fractions [(0.6, 0.2, 0.2)].
num_files -- int
Number of files to load for each person.
'''
ds = None
if dataset == 'olivetti':
from sklearn.datasets import fetch_olivetti_faces
ds = fetch_olive... | |
<reponame>Michal-Gagala/sympy
"""Compatibility interface between dense and sparse polys. """
from sympy.polys.densearith import dup_add_term
from sympy.polys.densearith import dmp_add_term
from sympy.polys.densearith import dup_sub_term
from sympy.polys.densearith import dmp_sub_term
from sympy.polys.densearit... | |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | |
# language-learning/src/grammar_learner/clustering.py 80925
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
from sklearn.metrics import pairwise_distances, silhouette_score
from statistics import mode
from random import randint
from operator import itemgetter
from .utl import UTC, round1, roun... | |
# coding: utf-8
"""
Rumble API
Rumble Network Discovery API # noqa: E501
OpenAPI spec version: 2.11.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Organization(object):
"""NOTE: This class is auto generated by the... | |
if hasattr(self, 'Isotropic'):
self.Isotropic = self.Isotropic[0:-1]
self.vzaDegrees = self.vzaDegrees[0:-1]
self.szaDegrees = self.szaDegrees[0:-1]
self.raaDegrees = self.raaDegrees[0:-1]
self.N = len(self.vzaDegrees)
self.vza = self.vza[0:-1]
self.sza = self.sza[0:-1]
self.raa = self.raa[0:-1]
d... | |
end_time: Optional[datetime.datetime] = None,
since_id: Optional[ID] = None,
until_id: Optional[ID] = None,
sort_by_relevancy: bool = False,
) -> List[Tweet]:
"""Searches tweet from the last seven days that match a search query.
Parameters
------------
query: :class:`str`
One query for matching Tweets.
max_r... | |
if e.params else e.message)
return self.get(request, *args, **kwargs)
for (i, v), (c, price) in selected.items():
data.append({
'addon_to': f['cartpos'].pk,
'item': i.pk,
'variation': v.pk if v else None,
'count': c,
'price': price,
})
return self.do(self.request.event.id, data, get_or_create_cart_id(self.r... | |
"site_id": "d2018f1d-82b1-422a-8ec4-4e8b3fe92a4a",
"variable": "ghi",
"interval_value_type": "interval_mean",
"interval_label": "beginning",
"interval_length": 5,
"uncertainty": 0.10,
"created_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12, 1, 55)),
"modified_at": pytz.utc.localize(dt.datetime(2019, 3, 1, 12,... | |
""" Functions to create S104 files and populate with data from other sources
"""
import logging
import sys
import datetime
import numpy
from ..s1xx import s1xx_sequence
from .api import S104File, FILLVALUE_HEIGHT, FILLVALUE_TREND, S104Exception
def _get_S104File(output_file):
""" Small helper functi... | |
npisfinite(mags) & npisfinite(errs)
ftimes, fmags, ferrs = times[find], mags[find], errs[find]
# get the center value and stdev
if meanormedian == 'median': # stddev = 1.483 x MAD
center_mag = npmedian(fmags)
stddev_mag = (npmedian(npabs(fmags - center_mag))) * 1.483
elif meanormedian == 'mean':
center_mag =... | |
""" Consolidating concepts by implementing heap creation
Originally by: Wyzzard123
Feel free to make changes."""
# Heap Array Representation Rules:
# for i starting at 1:
# for a node at i, parent node is at = i // 2
# for a node at i, left child node is at i * 2
# for a node at i, right child node is at (i * 2) + 1
... | |
#!usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: <NAME>
# @Date: 2018-07-14 14:31:36
# @Last modified by: <NAME>
# @Last Modified time: 2018-07-14 19:03:32
from __future__ import print_function, division, absolute_import
import sys
import os
import argparse
import gl... | |
8, 7, 6, 5, 4, 3, 2, 1]
if cyclic:
index = slice(start-stop-1, None, step)
roll[i] = -1 - stop
else:
index = slice(start, stop, step)
else:
start, stop, step = index.indices(size)
if (start == stop or
(start < stop and step < 0) or
(start > stop and step > 0)):
raise IndexError(
"Invalid indices dimension ... | |
:param variables: a function takes ``app`` and ``model
object`` arguments. The ``app`` argument is optional. It
can construct the variables used in the path (including any
URL parameters). If ``variables`` is omitted, variables are
retrieved from the model by using the arguments of the
decorated function.
:param ... | |
# Copyright (C) Schrodinger, LLC.
# All Rights Reserved
#
# For more information, see LICENSE in PyMOL's home directory.
#
# pymolhttpd.py
#
# web server interface for controlling PyMOL
# we make extensive use of Python's build-in in web infrastructure
import BaseHTTPServer, cgi, urlparse
import StringIO, socket
# w... | |
<reponame>sawansib/Sniper<filename>pin_kit/extras/pinplay/PinPoints/scripts/sniper_pinpoints.py
#!/usr/bin/env python
# BEGIN_LEGAL
# BSD License
#
# Copyright (c)2013 Ghent University. All rights reserved.
# Copyright (c)2014 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary form... | |
import sys
import os
import platform
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import WindowList
from idlelib import SearchDialog
from idlelib import GrepDialog
from idlelib import ReplaceDialog
fro... | |
"name": "arrow-merge-000-left"
},
{
"url": "/images/status/arrow-merge-090-left.png",
"name": "arrow-merge-090-left"
},
{
"url": "/images/status/arrow-merge-090.png",
"name": "arrow-merge-090"
},
{
"url": "/images/status/arrow-merge-180-left.png",
"name": "arrow-merge-180-left"
},
{
"url": "/ima... | |
<reponame>TechLabs-Dortmund/motion-miners
import pandas as pd
import numpy as np
import json
import pickle
import seaborn as sns
import datetime
import math
from matplotlib import pyplot as plt
import constant
""""
This py document contains all side functions that are used in main.py
"""
def create_mapped_layout(la... | |
search_terms_s, series_refs)
if series_form_result.equals("CANCEL") or self.__cancelled_b:
self.__cancelled_b = True
return BookStatus("SKIPPED") # user says 'cancel'
elif series_form_result.equals("SKIP"):
return BookStatus("SKIPPED") # user says 'skip this book'
elif series_form_result.equals("PERMSKIP... | |
# This module is the interface for creating images and video from text prompts
# This should also serve as examples of how you can use the Engine class to create images and video using your own creativity.
# Feel free to extract the contents of these methods and use them to build your own sequences.
# Change the image... | |
<reponame>tdeboer-ilmn/hail
COPY_TEST_SPECS = [{'dest_basename': None,
'dest_trailing_slash': True,
'dest_type': 'file',
'result': {'exception': 'FileNotFoundError'},
'src_trailing_slash': True,
'src_type': 'file',
'treat_dest_as': 'dest_dir'},
{'dest_basename': None,
'dest_trailing_slash': False,
'dest_type':... | |
b
def calibrate_mass(bwidth, mass_left, mass_right, true_md):
bbins = np.arange(-mass_left, mass_right, bwidth)
H1, b1 = np.histogram(true_md, bins=bbins)
b1 = b1 + bwidth
b1 = b1[:-1]
popt, pcov = curve_fit(noisygaus, b1, H1, p0=[1, np.median(true_md), 1, 1])
mass_shift, mass_sigma = popt[1], abs(popt[2])
r... | |
# -*-coding:Utf-8 -*
# Copyright (c) 2010 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of condit... | |
o.src += '_SA(0x0100|c.S++);_RD();c.P=(_GD()&~M6502_BF)|M6502_XF;'
# load return address low byte from stack
o.src += '_SA(0x0100|c.S++);_RD();l=_GD();'
# load return address high byte from stack
o.src += '_SA(0x0100|c.S);_RD();h=_GD();'
# update PC (which is already placed on the right return-to instruction)
o.s... | |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright (c) 2013, Battelle Memorial Instituate
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistri... | |
self._parent_class.tenant_id
elif not tenant_id:
# No value for tenant_id.
raise TypeError("tenant_id is required but not set or cached.")
cur_ctlr = self._parent_class.controller
url = str(cur_ctlr) + "/{}/api/tenants/{}/sites".format(api_version,
tenant_id)
api_logger.debug("URL = %s", url)
return self._par... | |
from itertools import chain
import logging
import plistlib
import random
from urllib.parse import urlencode
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.core.files.st... | |
recurrence.
:type from_property: ~datetime.datetime
:param to: The end date of recurrence.
:type to: ~datetime.datetime
"""
_validation = {
'from_property': {'required': True},
}
_attribute_map = {
'from_property': {'key': 'from', 'type': 'iso-8601'},
'to': {'key': 'to', 'type': 'iso-8601'},
}
def __init... | |
shape to use.
use_latest_image (bool): Whether to use the latest compute image
compartment_id (str): OCID of the parent compartment.
config (dict): An OCI config object or None
config_profile (str): The name of an OCI config profile
interactive (bool): Indicates whether to execute in interactive mode
raise_... | |
= (m_det_dis_desired, f_det_dis_desired, num_attenuators)
direction = _s(d.metadata.get("he3_back.direction", "UNPOLARIZED"))
if direction != "UNPOLARIZED" and (scan_id - previous_scan_id) == 1:
p = previous_transmission
#print('previous transmission: ', p)
#print(p.get("CellTimeIdentifier", None), tstart,
# p.ge... | |
posSair[1], 100, 40))
pygame.draw.rect(tela, cor["preto"], (posSair[0], posSair[1], 100, 40), 1)
tela.blit(aviso, (largura // 2 - 155, altura // 2 - 120))
tela.blit(reiniciar, (posReiniciar[0] + 5, posReiniciar[1] + 10))
tela.blit(sair, (posSair[0] + 30, posSair[1] + 10))
pygame.display.update()
return 1
def... | |
not exist since the pod is not computed.
CanNotForceNromError
if the problem comes form saved files and n_rom is not None.
Setting n_rom not supported for problem from saved files.
Returns
-------
None.
"""
if not self._is_pod_computed:
raise PodNotComputedError("Pod is not computed. Can not solve.")
if s... | |
WGS72BE_UTM_zone_49S = 32549
WGS72BE_UTM_zone_50S = 32550
WGS72BE_UTM_zone_51S = 32551
WGS72BE_UTM_zone_52S = 32552
WGS72BE_UTM_zone_53S = 32553
WGS72BE_UTM_zone_54S = 32554
WGS72BE_UTM_zone_55S = 32555
WGS72BE_UTM_zone_56S = 32556
WGS72BE_UTM_zone_57S = 32557
WGS72BE_UTM_zone_58S = 32558
WGS72BE_UT... | |
is unknown. It is never used in Blizzard scripts.'),
('if_dif','The definition of this command is unknown. It is never used in Blizzard scripts.'),
('if_towns','The definition of this command is unknown. It is never used in Blizzard scripts.'),
('implode','The definition of this command is unknown. It is never... | |
self.toolPlay.set_sensitive( can_play)
self.toolDownload.set_sensitive( can_download)
self.toolTransfer.set_sensitive( can_transfer)
self.toolCancel.set_sensitive( can_cancel)
if can_cancel:
self.item_cancel_download.show_all()
else:
self.item_cancel_download.hide_all()
if can_download:
self.itemDownloadSelec... | |
of each specificity score for each group/class
"""
if len(np.unique(y_true)) < 3:
return specificity_score(y_true, y_pred)
else:
overall_score = 0
unique_classes = np.unique(y_true)
for pos_class in unique_classes:
overall_score += specificity_score(
y_true, y_pred, problem="multiclass", positive_class=pos_cla... | |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import logging
import os
from GenericsAPI.Utils.AttributeUtils import AttributesUtil
from GenericsAPI.Utils.BIOMUtil import BiomUtil
from GenericsAPI.Utils.CorrelationUtil import CorrelationUtil
from GenericsAPI.Utils.DataUtil import DataUtil
from GenericsAPI.Utils.MatrixUtil impo... | |
<reponame>sebtelko/pulumi-azure-native
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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, Optional, Sequence, Union, ... | |
# -*- coding: utf-8 -*-
"""
Created by e-bug on 24/03/17.
"""
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter, FormatStrFormatter
from matplotlib2tikz import save as tikz_save
import numpy as np
# colorblind palette
colorblind_palette_dict = {'black': (0,0,0),
'orange': (0.9,0.6,0),
... | |
isinstance(self._cmap, dict):
# dictionary cmap
if self.constant_c() or self.array_c():
raise ValueError(
"Expected list-like `c` with dictionary cmap."
" Got {}".format(type(self._c))
)
elif not self.discrete:
raise ValueError("Cannot use dictionary cmap with " "continuous data.")
elif np.any([color not in se... | |
3 3 3 4 4 4 4 4 4 4 5 5 5 5 6\n\
Kappa -1 -1 1 -2 -1 1 -2 2 -3 -1 1 -2 2 -3 3 -4 -1 1 -2 2 -1\n\
Occup 2 2 2 4 2 2 4 4 6 2 2 4 4 6 6 3 2 2 4 1 2\n\
Valen 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1\n",
"Ho":
"Iz= 67 Norb= 21 Ion= 0 Config= 4f10_5d1_6s2\n\
n 1 2 2 2 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 6\n\
Kappa -1 -1 1 -2 ... | |
# coding: utf-8
"""
flyteidl/service/admin.proto
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: version not set
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
... | |
#!python3
"""
Find a fractionl allocation that maximizes a social welfare function (- a monotone function of the utilities),
for agents with additive valuations.
Examples are: max-sum, max-product, max-min.
See also: [leximin.py](leximin.py)
Author: <NAME>
Since: 2021-05
"""
import cvxpy
from fairpy import Valuati... | |
SN_NOWARN)
set_name(0x8005E690, "PM_DoNewLvl__FP12PlayerStruct", SN_NOWARN)
set_name(0x8005E698, "CheckNewPath__FP12PlayerStruct", SN_NOWARN)
set_name(0x8005EAD8, "PlrDeathModeOK__Fi", SN_NOWARN)
set_name(0x8005EB40, "ValidatePlayer__Fv", SN_NOWARN)
set_name(0x8005F028, "CheckCheatStats__FP12PlayerStruct", SN_NOWARN)
s... | |
<reponame>baojianzhou/sparse-auc<filename>test_simu.py
# -*- coding: utf-8 -*-
import os
import sys
import time
import numpy as np
import pickle as pkl
import multiprocessing
from itertools import product
from sklearn.model_selection import KFold
from sklearn.metrics import roc_auc_score
try:
sys.path.append(os.getcw... | |
import argparse
import csv
import datetime
import math
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pickle
import shutil
import sys
import time
import warnings
import yaml
import torch
import torch.backends.cudnn as cudnn
import torch.d... | |
2.328746E+04, 2.370391E+04, 2.412431E+04, 2.454868E+04,
2.497703E+04, 2.540938E+04, 2.584574E+04, 2.628611E+04, 2.673051E+04, 2.717896E+04,
2.763147E+04, 2.808804E+04, 2.854870E+04, 2.901346E+04, 2.948232E+04, 2.995531E+04,
3.043243E+04, 3.091370E+04, 3.139913E+04, 3.188873E+04, 3.238252E+04, 3.288051E+04,
3.338272... | |
= 'DELETE'
path_params = {}
if 'namespace' in params:
path_params['namespace'] = params['namespace']
if 'name' in params:
path_params['name'] = params['name']
if 'path2' in params:
path_params['path'] = params['path2']
query_params = {}
if 'path' in params:
query_params['path'] = params['path']
header_par... | |
from utils import *
import json
import numpy as np
import os
import matplotlib.pyplot as plt
import collections
import seaborn as sns
import pandas as pd
def histo_flows(instance, out_dir, files_ID, year, month, week_day_list):
link_min_dict = zload(out_dir + "link_min_dict" + files_ID + ".pkz")
link_id = zload(out... | |
import os
import html
import nekos
import requests
from PIL import Image
from telegram import ParseMode
from KilluaRobot import dispatcher, updater
import KilluaRobot.modules.sql.nsfw_sql as sql
from KilluaRobot.modules.log_channel import gloggable
from telegram import Message, Chat, Update, Bot, MessageEntity
from tel... | |
<filename>esociallib/v2_04/evtTabEstab.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated Tue Oct 10 00:42:26 2017 by generateDS.py version 2.28b.
# Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
#
# Command line options:
# ('--no-process-includes', '')
# ('-o', 'esociallib/v2_04/evtTa... | |
#!/usr/bin/env pytest
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: ESRIJson driver test suite.
# Author: <NAME> <even dot rouault at spatialys.com>
#
############################################################... | |
elif value is NULL:
if (property_.types is not None) and (Null not in property_.types):
error_messages.append(
"Null values are not allowed in `{}.{}`, "
"permitted types include: {}.".format(
qualified_name(type(self)),
property_name_,
", ".join(
"`{}`".format(
qualified_name(type_)
if isinstance(type_, type... | |
__init__(self):
r"""
:param DomainName: 播放域名。
:type DomainName: str
:param CertId: 证书Id。
:type CertId: int
:param Status: 状态,0:关闭 1:打开。
:type Status: int
"""
self.DomainName = None
self.CertId = None
self.Status = None
def _deserialize(self, params):
self.DomainName = params.get("DomainName")
self.CertI... | |
<gh_stars>1-10
"""
Utilities for analyzing and plotting length distributions for line data.
"""
import logging
from dataclasses import dataclass
from enum import Enum, unique
from functools import lru_cache
from itertools import chain, cycle
from textwrap import wrap
from typing import Callable, Dict, List, Optional, T... | |
# -*- test-case-name: twisted.internet.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to interact with the glib/gtk2
mainloop.
In order to use this support, simply do the following::
| from twisted.internet import gtk2reactor
| gtk2rea... | |
# -*- coding: utf-8 -*-
"""
Conditional logit
Sources: sandbox-statsmodels:runmnl.py
General References
--------------------
<NAME>. `Econometric Analysis`. Prentice Hall, 5th. edition. 2003.
<NAME>. `Discrete Choice Methods with Simulation`.
Cambridge University Press. 2003
--------------------
"""
import numpy a... | |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_... | |
ts.sequence_length
n = np.array([len(u) for u in sample_sets])
def f(x):
return x * (x < n)
# Determine output_dim of the function
for mode in ("site", "branch", "node"):
sigma1 = ts.sample_count_stat(sample_sets, f, 3, windows=windows, mode=mode)
sigma2 = ts.sample_count_stat(
sample_sets, f, 3, windows=wind... | |
# Copyright (c) 2021 Open Risk (https://www.openriskmanagement.com)
#
# 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, co... | |
On")
else:
wait["tag2"] = True
if wait["lang"] == "JP":
kr.sendText(msg.to,"Tag On")
else:
kr.sendText(msg.to,"already on")
elif msg.text in ["Tag2 off","tag2 off"]:
if msg.from_ in admin:
if wait["tag2"] == False:
if wait["lang"] == "JP":
kr.sendText(msg.to,"Already off")
else:
kr.sendText(msg.to,"Tag O... | |
<reponame>wantedly/recsys2020-challenge
from typing import List, Tuple
from google.cloud import bigquery, bigquery_storage_v1beta1
import pandas as pd
from base import BaseFeature, reduce_mem_usage
class BertSimilarityBetweenTweetAndEngagingSurfacingTweetVectorsFeature(BaseFeature):
# 使わない
def import_columns(self... | |
"""Tests for CCAPI's methods."""
import datetime
import json
import shutil
import tempfile
from decimal import Decimal
from pathlib import Path
from ccapi import CCAPI, NewOrderItem, VatRates, cc_objects, requests
from .. import test_data, test_requests
from .test_CCAPI_class import TestCCAPIMethod
class Test_get_... | |
__all__ = ['query']
import os
import time
import pandas as pd
from pathlib import Path
from datetime import datetime
from factiva.core import const
from factiva.news.bulknews import BulkNewsBase, BulkNewsJob
from .query import SnapshotQuery
class Snapshot(BulkNewsBase):
"""
Class that represents a Factiva Snapshot... | |
<filename>confluent_server/confluent/config/attributes.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 IBM Corporation
# Copyright 2015-2019 Lenovo
#
# 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 c... | |
<filename>sktime/classification/dictionary_based/_tde.py
# -*- coding: utf-8 -*-
"""TDE classifiers.
Dictionary based TDE classifiers based on SFA transform. Contains a single
IndividualTDE and TDE.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["TemporalDictionaryEnsemble", "IndividualTDE", "histogram_intersecti... | |
recursively merge members of 2 json objects
def member_wise_merge(j1, j2):
for key in j2.keys():
if key not in j1.keys():
j1[key] = j2[key]
elif type(j1[key]) is dict:
j1[key] = member_wise_merge(j1[key], j2[key])
return j1
# remove comments, taken from stub_format.py ()
def remove_comments(file_data):
lines =... | |
in parallel.
- **MaxErrors** *(string) --*
The maximum number of errors allowed before this task stops being scheduled.
- **Name** *(string) --*
The task name.
- **Description** *(string) --*
A description of the task.
:type WindowId: string
:param WindowId: **[REQUIRED]**
The ID of the Maintenance Window w... | |
have had enough contention since I came, I want no more. (Putnam crosses L. to above table, gets hat, crosses and exits.)',
'You have sent your spirit out upon this child, have you not? Are you gathering souls for the Devil? ',
'She send her spirit on me in church, she make me laugh at prayer! ',
'She have often lau... | |
# pragma: no cover
if output:
return string
else:
print(string)
return None
# Define ANSI colors
ansicolors = OD([
('black', '30'),
('red', '31'),
('green', '32'),
('yellow', '33'),
('blue', '34'),
('magenta', '35'),
('cyan', '36'),
('gray', '37'),
('bgblack', '40'),
('bgred', '41'),
('bggreen', '42'... | |
import math
import sys
import os
import io
import re
import struct
import collections
import argparse
import textwrap
import crcmod
import usb1
from . import VID_CYPRESS, PID_FX2, FX2Config, FX2Device, FX2DeviceError
from .format import input_data, output_data, diff_data
class VID_PID(collections.namedtuple("VID_PID... | |
space.parse("if 3; end") == ast.Main(ast.Block([
ast.Statement(ast.If(ast.ConstantInt(3), ast.Nil(), ast.Nil()))
]))
r = space.parse("""
if 0
puts 2
puts 3
puts 4
end
""")
assert r == ast.Main(ast.Block([
ast.Statement(ast.If(ast.ConstantInt(0), ast.Block([
ast.Statement(ast.Send(ast.Self(3), "puts", [ast.C... | |
the latest checked in version of the files that
# the user will actually be executing. Specifically, GetRevisionId()
# doesn't appear to change even if a user checks out a different version
# of the hooks repo (via git checkout) nor if a user commits their own revs.
#
# NOTE: Local (non-committed) changes will not... | |
if type_name_ is None:
type_name_ = child_.attrib.get('type')
if type_name_ is not None:
type_names_ = type_name_.split(':')
if len(type_names_) == 1:
type_name_ = type_names_[0]
else:
type_name_ = type_names_[1]
class_ = globals()[type_name_]
obj_ = class_.factory()
obj_.build(child_)
else:
raise NotImplem... | |
# -*- coding:utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Licen... | |
# coding=utf-8
# @Author : zhzhx2008
# @Time : 19-7-11
import os
import warnings
import jieba
import numpy as np
from keras import Model
from keras import backend as K
from keras.callbacks import EarlyStopping
from keras.callbacks import ModelCheckpoint
from keras.engine.topology import Layer, Input
from keras.laye... | |
row, col, ocol)
col += gap
def moveBeyond(tok):
nonlocal orow, ocol
nrow, ncol = tok[3]
if nrow > orow or (nrow == orow and ncol > ocol):
orow = nrow
ocol = ncol
def advance(skip=True):
nextToken = next(tokens)
if skip:
moveBeyond(nextToken)
else:
injectToken(nextT... | |
from __future__ import absolute_import, print_function, with_statement
import logging
import os
import shutil
import sys
import torch
from .deployer_utils import save_python_function, serialize_object
from ..clipper_admin import ClipperException
from ..version import __registry__, __version__
logger = logging.getLo... | |
"""
defines:
bdf merge (IN_BDF_FILENAMES)... [-o OUT_BDF_FILENAME]\n'
bdf equivalence IN_BDF_FILENAME EQ_TOL\n'
bdf renumber IN_BDF_FILENAME [-o OUT_BDF_FILENAME]\n'
bdf mirror IN_BDF_FILENAME [-o OUT_BDF_FILENAME] [--plane PLANE] [--tol TOL]\n'
bdf export_mcids IN_BDF_FILENAME [-o OUT_GEOM_FILENAME]\n'
bdf split... | |
return ticket
if not is_multiple_copy:
try:
os.rename(a_path, bad_file)
except:
msg = "failed to rename %s to %s"%(a_path, bad_file)
ticket = {'work': 'unmark_bad', 'bfid': bfid, 'path': bad_file};
ticket = self.send(ticket,rcv_timeout=timeout, tries=retry)
if ticket['status'][0] != e_errors.OK:
msg += '(Fail... | |
<gh_stars>1-10
import numpy as np
class Reserve:
def __init__(self, name, amount, crr, verbose=0):
assert(amount > 0)
assert(crr > 0.0 and crr <= 1.0)
self.name = name
self.amount = amount
self.crr = crr
self.verbose = verbose
def __str__(self):
if self.verbose > 0:
return '[{}'.format(self.name) \
+ ' R=... | |
print("right right")
angle = 1
green_var = True
elif contour_green is None and green_left %2 == 0:
print("left left")
angle = -1
green_var = True
else:
green_var = False
if green_left == 7:
counter_train += rc.get_delta_time()
if counter_train < 0.5:
angle = -1
print("turning left")
elif counter_train < 1... | |
import json
import SalesforceMetadataModule as smm
import dicttoxml
from xml.dom.minidom import parseString
from fulcrum import Fulcrum
import re
import collections
import time
import datetime
import requests
import base64
import string
import random
from simple_salesforce import Salesforce
from simple_salesforce impo... | |
range(minBurst, maxBurst)]
#doing adjustment before use
adjustValidWithLooks([ifg], box, numberAzimuthLooks, numberRangeLooks, edge=0, avalid='strict', rvalid=np.int(np.around(numberRangeLooks/8.0)))
mergeBurstsVirtual([ifg], [bst], box, os.path.join(outputDirname, outputFilename+suffix))
#take looks
if suffix no... | |
Cd u0 {3,D}
8 Cd u0 {4,D}
""",
thermo = u'Cs-(Cds-Cds)(Cds-Cds)(Cds-Cds)(Cds-Cds)',
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
index = 718,
label = "Cs-(Cds-Cds)(Cds-Cds)(Cds-Cdd)Ct",
group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {5,S}
2 Cd u0 {1,S} {6,D}
3 Cd u0 {1,S} {7,D}
4 Cd u0 {1,S} {8,D}
5 Ct u0 {1,S... | |
3 floats`)
"""
return _robotsim.TransformPoser_set(self, R, t)
def get(self):
"""
"""
return _robotsim.TransformPoser_get(self)
def enableTranslation(self, arg2):
"""
Args:
arg2 (bool)
"""
return _robotsim.TransformPoser_enableTranslation(self, arg2)
def enableRotation(self, arg2):
"""
Args:
arg2 ... | |
# }
# ]
#
return self.parse_markets(response)
else:
raise NotSupported(self.id + ' fetchMarketsByType does not support market type ' + type)
async def fetch_currencies(self, params={}):
# has['fetchCurrencies'] is currently set to False
# despite that their docs say these endpoints are public:
# https://www.o... | |
constraints.append(Constraint(
"Coincident",seg,EndPoint,seg2,EndPoint))
if obj.isDerivedFrom("Part::Feature"):
objs = [obj]
while objs:
obj = objs[0]
objs = objs[1:] + obj.OutList
doc.removeObject(obj.Name)
nobj.addConstraint(constraints)
recomputeObj(nobj)
return nobj
def _makeCompound(self,obj,name,lab... | |
import numpy as np
from sklearn.model_selection import RepeatedStratifiedKFold, StratifiedShuffleSplit
from sklearn.linear_model import LogisticRegression
from sklearn.isotonic import IsotonicRegression
from scipy.special import expit
import matplotlib.pyplot as plt
from sklearn.metrics import f1_score
import ti... | |
8*m.b42 + 8*m.b43 - m.x106 - m.x107 + m.x146 + m.x147 + m.x154 + m.x155 + m.x162 + m.x163
+ m.x202 + m.x203 <= 8)
m.c1826 = Constraint(expr= 8*m.b42 + 8*m.b44 - m.x106 - m.x108 + m.x146 + m.x148 + m.x154 + m.x156 + m.x162 + m.x164
+ m.x202 + m.x204 <= 8)
m.c1827 = Constraint(expr= 8*m.b42 + 8*m.b45 - m.x106 - m.x10... | |
typing.Optional[str] = None,
prices: typing.Optional[typing.List["PriceDraft"]] = None,
attributes: typing.Optional[typing.List["Attribute"]] = None,
images: typing.Optional[typing.List["Image"]] = None
):
self.id = id
self.sku = sku
self.prices = prices
self.attributes = attributes
self.images = images
super... | |
#!/usr/bin/env python2.3
#
# Copyright (C) 2004 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser Ge... | |
#!/usr/bin/env python
# Author: <NAME>
# Copyright 2014
# Unclassified
import Constants
import os, sys
import pexpect
import random
import time
import botlog
import Utils
import Data
import MetaData
import Mentat
import Strategy
from bbot import *
import botlog
import string
import State
import re
import json
from da... | |
on the session_date sort key.
"""
dialogues = self.db.query(
KeyConditionExpression=Key("sender_id").eq(sender_id),
Limit=1,
ScanIndexForward=False,
)["Items"]
if not dialogues:
return None
events = dialogues[0].get("events", [])
# `float`s are stored as `Decimal` objects - we need to convert them back
ev... | |
<gh_stars>0
"""
Definitions of standard library functions and methods, and their
conversions into Rust
"""
import sys
import ast
from var_utils import is_iterator_type, is_reference_type, \
dict_type_from_list, strip_container, detemplatise, \
extract_types, UNKNOWN_TYPE
ALLOWED_COMPARISON_OPERATORS = { "Eq", "NotE... | |
<reponame>profx5/naz<gh_stars>0
import typing
# TODO: try and turn these classes to enum
class SmppSessionState:
"""
Represensts the states in which an SMPP session can be in.
"""
# see section 2.2 of SMPP spec document v3.4
# we are ignoring the other states since we are only concerning ourselves with an ESME... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.