input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# # convert the distance to cm
# distance_mouse = distance_mouse*(np.abs(ref_corners[0][1] -
# ref_corners[1][1])/np.abs(corners[0][0] - corners[2][0]))
# # allocate an empty array
# distance_new = np.zeros_like(distance_mouse)
# # find the first number
# first_number = distance_mouse[np.isnan(distance_mouse) == ... | |
mechanism to avoid empries up in the high hills
# This is largely tuned in China; the Alps are < 2km
if t.agricultural and t.Elevation >= 3000:
region_territories_i.append(t.t_index)
self.region_territories_i['Agr_Mountains'] = region_territories_i
# Turchin's PNAS incremental includes
# NOTE: we assume 1:1 here... | |
import _io
from bin import spl_token_lib as stl
import os
# SPL_PATH = os.getcwd()
PLUS_MINUS = {"+", "-"}
OTHER_ARITHMETIC = {"*", "/", "%"}
SELF_CONCATENATE = {0, 1, 8, 9, 10, 11, 14, 17}
CROSS_CONCATENATE = {(8, 9), (1, 0), (0, 12), (12, 0), (15, 9), (17, 9), (20, 9), (16, 9), (10, 9), (11, 9),
(9, 8), (1, 14), (... | |
<gh_stars>1-10
#==================================================================================
# BSD License
#
# Copyright (c)2020, ww3-opentools developers, all rights reserved
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following condition... | |
<gh_stars>10-100
from flask import Flask, request, abort
from linebot import (LineBotApi, WebhookHandler)
from linebot.exceptions import (InvalidSignatureError)
from linebot.models import *
import json
import os
from linebot.exceptions import LineBotApiError
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc ... | |
FormatOutput.output("action", jsonobj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
def doDescribeIPProductInfo(argv, arglist):
g_param = parse_global_arg(argv)
if "help" in argv:
show_help("DescribeIPProductInfo", g_param[OptionsDefine.Version])
return
param = {
"Business": argv.get("--Busine... | |
a Field from a document_pb.Field protocol buffer."""
name = pb.name()
value = _GetValue(pb.value())
lang = None
if pb.value().has_language():
lang = pb.value().language()
val_type = pb.value().type()
if val_type == document_pb.FieldValue.TEXT:
return TextField(name, value, lang)
elif val_type == document_pb.Fi... | |
:type orderby: list[str or ~devices_cloud_print.models.Enum32]
:param select: Select properties to be returned.
:type select: list[str or ~devices_cloud_print.models.Enum33]
:param expand: Expand related entities.
:type expand: list[str or ~devices_cloud_print.models.Enum34]
:keyword callable cls: A custom type or... | |
import json
import random
import time
from lib.Cb_constants.CBServer import CbServer
from lib.membase.api.rest_client import RestConnection
from lib.remote.remote_util import RemoteMachineShellConnection
from pytests.basetestcase import BaseTestCase
from pytests.security.ntonencryptionBase import ntonencryptionBase
fr... | |
with value
-999999999999999999.
"""
assert_bindings(
schema="nistData/atomic/integer/Schema+Instance/NISTSchema-SV-IV-atomic-integer-minExclusive-1.xsd",
instance="nistData/atomic/integer/Schema+Instance/NISTXML-SV-IV-atomic-integer-minExclusive-1-1.xml",
class_name="NistschemaSvIvAtomicIntegerMinExclusive1",
ve... | |
' ')
r3c12 = request.POST.get('r3c12').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r3c13 = request.POST.get('r3c13').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r3c14 = request.POST.get('r3c14').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r3c15 = request.POST.get('r3c15').repl... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module is part of the opsi PackageBuilder
see: https://forum.opsi.org/viewforum.php?f=22
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
... | |
<reponame>gadio/moma-django
#==========================================================================
# Copyright 2012 Lucidel, Inc., 2013 Cloudoscope Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the License.
# You may obtain a copy of ... | |
<reponame>eriknw/pygraphblas
import sys
from operator import mod
from itertools import product, repeat
import re
import pytest
from pygraphblas import *
from pygraphblas.base import ffi, lib, _check
def test_iseq():
l = Matrix.sparse(INT8, 10, 10)
l[0, 0] = 1
m = Matrix.sparse(INT8, 10, 10)
m[0, 0] = 1
n = Mat... | |
<gh_stars>0
# organization/views_admin.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from .controllers import full_domain_string_available, merge_these_two_organizations,\
move_organization_followers_to_another_organization, move_organization_membership_link_to_another_organization, \
organization... | |
"""
Make html galleries from media directories. Organize by dates, by subdirs or by
the content of a diary file. The diary file is a markdown file organized by
dates, each day described by a text and some medias (photos and movies).
The diary file can be exported to:
* an html file with the text and subset of medias a... | |
if i == 0:
ax0 = plt.subplot(3, 4, index12[i])
else:
plt.subplot(3, 4, index12[i], sharex=ax0)
plt.plot(t_range, self.wbc_feet_acc_target[:, i % 3, np.int(i/3)], color='r', linewidth=3, marker='')
plt.legend([lgd_Y[i % 3] + " " + lgd_X[np.int(i/3)]+" Ref"], prop={'size': 8})
plt.suptitle("Reference feet accelerat... | |
import flask
from flask import g
from flask import render_template
from flask import request
from flask import url_for
import uuid
import hashlib
import sys
import json
import logging
from datetime import datetime
# Mongo database
from pymongo import MongoClient
from bson.objectid import ObjectId
# Date handling
imp... | |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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 req... | |
the command returens a ramdisk id before return it
Return:
ramdisk id -- ramdisk id is the 9th element of returned command
result
'''
command_result = [x for x in
self.describe_images(image_id).split()]
if len(command_result) >= 9:
self.debug("Ramdisk ID %s" % command_result[8])
return command_r... | |
"Warning: `dataProviderArgs` will be ignored if `dataProvider = 'OSRM-online'`.\n"
return [valFlag, errorMsg, warningMsg]
def _valGeoDataProvider(dataProvider, dataProviderArgs):
valFlag = True
errorMsg = ""
warningMsg = ""
try:
dataProvider = dataProvider.lower()
except:
pass
if (dataProvider == None):... | |
'''
Custom file dialogs for whipFTP, Copyrights <NAME>,
'''
import os
from os.path import expanduser
from os import listdir
from os.path import isfile, join
import platform
import psutil
from tkinter import *
from tkinter import font
from tkinter import ttk
from tkinter import PhotoImage
from tkinter import messagebo... | |
<filename>simsg/metrics.py
#!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# 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... | |
== 2;
ASSERT(r, True, "Non-default namespace replication-factor configuration.", "OPERATIONS", INFO,
"Listed namespace[s] have non-default replication-factor configuration. Please run 'show config namespace like repl' to check value. It may be non-issue in case namespace are configured for user requirement. Ignore ... | |
app_service)
if browser_type is not None:
pulumi.set(__self__, "browser_type", browser_type)
if browser_version is not None:
pulumi.set(__self__, "browser_version", browser_version)
if case_insensitive is not None:
pulumi.set(__self__, "case_insensitive", case_insensitive)
if case_sensitive is not None:
pulumi.... | |
<reponame>cjoakim/azure-cosmos-graph<gh_stars>1-10
"""
Usage:
python wrangle.py scan_title_basics
Options:
-h --help Show this screen.
--version Show version.
"""
# <NAME>, Microsoft, 2018/03/11
import csv
import json
import os
import sys
import time
import traceback
from docopt import docopt
from pysrc.joakim i... | |
1
18 HT Pkt Hi HT 1 0
19 HT IPC Low HT 2 3
20 HT IPC Hi HT 3 2
21 CC4 Low SPI0 16 1
22 CC4 Hi SPI0 17 0
23 CC5 Low SPI0 18 1
24 CC5 Hi SPI0 19 0
'''
}
def test_golden_active_ipm(self):
self.device = Mock(**self.golden_output_active_ipm)
obj = ShowPlatformHardwareQfpBqsIpmMapping(device=self.device)... | |
<filename>tests/unit/test_typeset_default.py
import datetime
import os
import pathlib
import uuid
from ipaddress import IPv4Address, IPv6Address
from pathlib import PurePosixPath, PureWindowsPath
from urllib.parse import urlparse
import numpy as np
import pandas as pd
import pytest
# from visions.test.ser... | |
<reponame>manwithadodla/quality-assessment-protocol
base_test_dir = "/tdata/QAP/qc_test"
def anatomical_reorient_workflow(workflow, resource_pool, config, name="_"):
"""Build a Nipype workflow to deoblique and reorient an anatomical scan
from a NIFTI file.
- This is a seminal workflow that can only take an input ... | |
if self._has_problems():
self._print(self._get_field(data, "problem_msg"))
self._list_problems()
self._print(self._get_field(data, "finish_msg"))
choice = self._input(None, None, ["(q)uit", "(b)ack"])
if choice == 1:
self.current_action_idx -= 2
return
else:
self._print(self._get_field(data, "complete_msg"))... | |
<filename>Adafruit_GFX/Adafruit_GFX.py
'''******************************************************************
This is the core graphics library for all our displays, providing
basic graphics primitives (points, lines, circles, etc.). It needs
to be paired with a hardware-specific library for each display
device we c... | |
<filename>access_eval/analysis/plotting.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import altair as alt
import pandas as pd
from .constants import ComputedFields, DatasetFields
from .core import flatten_access_eval_2021_dataset, load_... | |
<gh_stars>1-10
"""The tests for the Template fan platform."""
import logging
import pytest
import voluptuous as vol
from homeassistant import setup
from homeassistant.components.fan import (
ATTR_DIRECTION,
ATTR_OSCILLATING,
ATTR_SPEED,
DIRECTION_FORWARD,
DIRECTION_REVERSE,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM... | |
""" Includes two functions which use shortest path policies
1) run_sss_curriculum - trains a PyMARL agent using experiences gathered
while following an epsilon greedy shortest path policy.
2) mean_sss_time - returns the mean time taken to complete a map while following
an epsilon greedy shortest path policy.
"""
i... | |
# MUST be defined in the styles list above.
# (Looks like Terria assumes this is the first style in the list, but this is
# not required by the standard.)
"default_style": "simple_gray",
}
]
},
{
# Name and title of the platform layer.
# Platform layers are not mappable. The name is for internal server use on... | |
<filename>hpc_acm/api/default_api.py<gh_stars>1-10
# coding: utf-8
"""
HPC Web API
Preview # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility librar... | |
<reponame>Afoucaul/cairocffi
"""
cairocffi.fonts
~~~~~~~~~~~~~~~
Bindings for font-related objects.
:copyright: Copyright 2013-2019 by <NAME>
:license: BSD, see LICENSE for details.
"""
from . import _check_status, _keepref, cairo, constants, ffi
from .matrix import Matrix
def _encode_string(string):
"""Ret... | |
COMPUTINGSITE,JOBSTATUS,GSHARE,SUM(NJOBS) FROM ATLAS_PANDA.{} " \
"WHERE workqueue_id NOT IN " \
"(SELECT queue_id FROM ATLAS_PANDA.jedi_work_queue WHERE queue_function = 'Resource') " \
"AND computingsite NOT IN " \
"(SELECT pandaqueuename FROM ATLAS_PANDA.HARVESTER_Slots) GROUP BY COMPUTINGSITE,JOBSTATUS,GSHARE "... | |
<filename>compiler/bitproto/renderer/block.py
"""
bitproto.renderer.block
~~~~~~~~~~~~~~~~~~~~~~~
Block class base.
Block
|- BlockBindDefinition
| |- BlockBindAlias
| |- BlockBindConstant
| |- BlockBindEnum
| |- BlockBindEnumField
| |- BlockBindMessage
| |- BlockBindMessageField
| |- BlockBindProto
|- Block... | |
),
WikidatedV1_0SortedEntityStreamsFile(
archive_path=dataset_dir / (prefix + "p29273049-p29300904.7z"),
page_ids=range(29273049, 29300905),
darus_id=94648,
sha1="aa87ed8a05a7ca3930726b5498a9704e5504a29c",
size=89523493,
auto_download=auto_download,
),
WikidatedV1_0SortedEntityStreamsFile(
archive_path=datase... | |
import ast
import collections
import glob
import inspect
import math
import os
import random
import shutil
import subprocess
import time
import warnings
from concurrent.futures import ThreadPoolExecutor
from contextlib import suppress
from datetime import datetime
from typing import Any, Dict, Tuple, Sequence, List, Op... | |
from __future__ import print_function
import os
import sys
import timeit
import numpy
import theano
import theano.tensor as T
from theano.tensor.signal import pool
from theano.tensor.nnet import conv2d
from fashion_mnist import load_mnist
import scipy.io
import six.moves.cPickle as pickle
class Logistic... | |
for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if ... | |
= None,
contents: Optional[Any] = None,
extension_fields: Optional[Dict[str, Any]] = None,
loadingOptions: Optional[LoadingOptions] = None,
) -> None:
if extension_fields:
self.extension_fields = extension_fields
else:
self.extension_fields = CommentedMap()
if loadingOptions:
self.loadingOptions = loadingOpt... | |
#!/usr/bin/env python
#ref: https://github.com/googleapis/python-iot
from google.cloud import storage
import paho.mqtt.client as mqtt
import jwt
import time
import ssl
import random
import os
import logging
import datetime
import argparse
import random
import time
import datetime
import json
logging.getLogger('goo... | |
# -*- coding: utf-8 -*-
import functools
import inspect
import os
import sys
from types import MethodType
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
import six
from brewtils.choices import process_choices
from brewtils.display import resolve_form, resolve_schema, resolve_tem... | |
(conv6.size())
print (len(ret['gt_bboxes']))
print (ret['gt_bboxes'][0].size())
print (ret['gt_bboxes'][1].size())
batch_size = len(ret['gt_bboxes'])
ys_list = ret["gt_bboxes"]
y_samples_list = []
q_y_samples_list = []
q_ys_list = []
for i in range(batch_size):
# (ys_list[i] has shape: (num_gt_bboxes_i, 7))... | |
<reponame>saidelike/abyss
from abyss import abyss_filter_t
import ida_lines, ida_kernwin
import sys, re
# experimental code cloned from https://github.com/pfalcon/ctopy
"""
ctopy -- a quick and dirty C-to-Python translator.
Libraries not mapped that theoretically could be: curses.panel, dbm,
md5, popen2, p... | |
import os
import pathlib
import re
from copy import deepcopy
import warnings
import numpy as np
import rasterio
import rasterio.features
import rasterio.warp
import xarray as xr
from xgeo.crs import XCRS
from xgeo.utils import (X_DIMS, Y_DIMS, Z_DIMS, T_DIMS, DEFAULT_DIMS)
@xr.register_dataset_accessor('geo')
class ... | |
<filename>tspwplib/problem.py
"""Functions and classes for datasets"""
import random
from typing import List, Optional, Union
import networkx as nx
import pandas as pd
import pydantic
import tsplib95
from .types import (
DisplayDataType,
EdgeDataFormat,
EdgeFunction,
EdgeList,
EdgeWeightFormat,
EdgeWeightType,... | |
<reponame>asb/opentitan<gh_stars>1000+
#!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
'''Generate Markdown documentation for the instructions in insns.yml'''
import argparse
import os
import sys
... | |
import pandas as pd
from lifelines import KaplanMeierFitter, CoxPHFitter
import numpy as np
from sklearn.exceptions import ConvergenceWarning
from multiprocessing import Pool
import numpy as np
import functools
from .correlation import intersection, header_list
import plotly
import plotly.offline as opy
from sklearn.pr... | |
# -*- coding: utf-8 -*-
"""
Evaluation Models
=================
"""
from __future__ import division
from copy import copy
from itertools import izip
from collections import defaultdict
import numpy as np
import pandas as pd
import tools
__all__ = (
'DummyPriorModel',
'EloModel',
'EloResponseTime',
'PFAModel... | |
<reponame>REMeyer/astropy<filename>astropy/visualization/lupton_rgb.py<gh_stars>1-10
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Combine 3 images to produce a properly-scaled RGB image following Lupton et al. (2004).
The three images must be aligned and have the same pixel scale and size.
For ... | |
import os
import math
import random
import time
from code.menu.menu import Menu
from code.tools.eventqueue import EventQueue
from code.tools.xml import XMLParser
from code.utils.common import coalesce, intersect, offset_rect, log, log2, xml_encode, xml_decode, translate_rgb_to_string
from code.constants.common i... | |
else bed_data["blocks"]
)
exons_pos = {} # contain exon_num : positions
s_sites = []
exon_flanks = {}
for num, exon in enumerate(exons_raw):
# start, end if strand == + end, start otherwise
# need to know start and end to extract from 2bit file
exons_pos[num] = (
(int(exon[0]), int(exon[1]))
if bed_data["stra... | |
<gh_stars>1-10
import time
import pkgutil
import json
import ssl
import asyncio
import websockets
import time
from web3.auto import w3
from eth_account.messages import encode_defunct
from web3 import Web3
class WsAPI:
def __init__(self, endpoint="wss://api.dex.blue/ws/v1", network="mainnet", web3Provider="https://ma... | |
wish to replace this file please first delete it.')
else:
self.ready = False
self.logger.error('Unable to init_directory_substitutions_yaml. ' +
'names: {}'.format(names))
else:
self.ready = False
self.logger.error('Unable to init_directory_substitutions_yaml. ' +
'self.filepaths: {}'.format(self.filepaths))
... | |
i, 'objective with modified lamination parameter weightings'] \
= np.NaN
# Inhomogeneity factor
table_result.loc[i, 'target inhomogeneity factor'] = \
np.linalg.norm(lampam_target[0:4] - lampam_target[8:12])
# objectives
for k in range(parameters.n_outer_step):
table_result.loc[i, f'objective iteratio... | |
<filename>sdk/python/pulumi_azure/dataprotection/backup_policy_disk.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 warnings
import pulumi
import pulumi.runtime
from typing ... | |
# -*- coding: utf-8 -*-
'''
@author: <NAME>
May 2018
'''
# import code
# code.interact(local=locals())
import os
import pickle
# from fordclassifier.classifier.classifier import Classifier
import numpy as np
import pandas as pd
from sklearn.metrics import roc_curve, auc
import json
import matplotl... | |
<gh_stars>0
# Copyright (c) 2020, 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 b... | |
import numpy as np
from os import listdir
import pickle
import os
import scipy
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
from config_args import parse_args
def losses_all(args):
def get_loss_pck(args, name, exp_name):
data = []
with open(str(os.getcwd()) + '/plotting/Losse... | |
<filename>Python_Projects/Global_Model/Working/calculation.py
#!/usr/bin/env python
# coding: utf-8
import xs
import numpy as np
from scipy.integrate import odeint
from math import isclose
from constants import *
class Global_model:
def __init__(self, p, input_power, duty, period, time_resolution=1e-8):
self.p = p... | |
"""
Filename: financial.py
Author: <NAME>
Current Status: In Development
"""
__author__ = "<NAME>"
__version__ = "1.000"
import openpyxl
import os
import time
import mysql.connector as mysql
from openpyxl.utils import column_index_from_string
from cellStyle import *
import sshtunnel
class ExcelSheet():
def __init__... | |
"""
Data Visualisation toolkit
--------------------------
data vis library mainly wrapper around common plotting libraries, plotly, seaborn
EXAMPLES
--------
histogram with color
--------------------
fig = px.histogram(df, 'value', color='variable', barmode='overlay', opacity=0.7)
plotly geo scatter
------------... | |
import logging
import os
import simplejson as json
import yaml
from deepmerge import always_merger
from .exceptions import TinConfigNotFound, TinError
# We only do JSON APIs right now
DEFAULT_CONTENT_TYPE = "application/json"
DEFAULTS = {
"scheme": "https",
"port": 443,
"use_session": True,
"ssl": {"verify": Tr... | |
# Define a class to receive the characteristics of each line detection
class Line():
def __init__(self):
# was the line detected in the last iteration?
self.detected = False
# x values of the last n fits of the line
self.recent_xfitted = []
#average x values of the fitted line over the last n iterations
self.b... | |
0, 0, 0, 0],
[1240, 283.224983, 0, 9999, -9999, 1.0, 100, 1, 339.51051, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1241, 253.35193, 0, 9999, -9999, 1.0, 100, 1, 385.361595, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1242, 2.719992, 0, 9999, -9999, 1.0, 100, 1, 27.074038, 0.0, 0, 0, 0, 0, 0... | |
<filename>jax/_src/lax/control_flow/loops.py
# Copyright 2022 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
return _ida_hexrays.lvar_locator_t___le__(self, *args)
def __ge__(self, *args):
"""
__ge__(self, r) -> bool
"""
return _ida_hexrays.lvar_locator_t___ge__(self, *args)
def compare(self, *args):
"""
compare(self, r) -> int
"""
return _ida_hexrays.lvar_locator_t_compare(self, *args)
__swig_destroy__ = _ida_h... | |
<reponame>consciencia/VizTools
# MIT License
#
# Copyright (c) 2020 Consciencia <<EMAIL>>
#
# 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 t... | |
# timestamp: 1542899030043,
# total_ask_size: 109.57065201,
# total_bid_size: 125.74430631,
# orderbook_units: [{ask_price: 0.02926679,
# bid_price: 0.02919904,
# ask_size: 4.20293961,
# bid_size: 11.65043576},
# ...,
# {ask_price: 0.02938209,
# bid_price: 0.0291231,
# ask_size: 0.05135782,
# bid_size: 13.55... | |
<filename>whatstyle.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 <NAME> ( http://krause-software.com/ ).
#
# You are free to use this code under the MIT license:
# http://opensource.org/licenses/MIT
# This program looks at source code and generates a style definition for code formatters
# li... | |
from abc import ABC, abstractmethod
import numpy as np
import matplotlib.pyplot as plt
import datetime as dt
import os
import json
import copy
import utils
OUT_PATH = './out/'
class ForecastModel(ABC):
"""
Abstract superclass of all probabilistic forecasting models.
"""
@abstractmethod
def __init__(self, y, t... | |
<reponame>shilpiprd/sympy
from sympy import I, log, apart, exp
from sympy.core.symbol import Dummy
from sympy.external import import_module
from sympy.functions import arg, Abs
from sympy.integrals.transforms import _fast_inverse_laplace
from sympy.physics.control.lti import SISOLinearTimeInvariant
from sympy.plotting.... | |
import math
from collections import namedtuple
import colorhash
import dask
import dask.dataframe
import numpy
import pandas
from matplotlib import pyplot
from scipy.stats import kstest, lognorm, multivariate_normal
from sklearn.decomposition import PCA
from sklearn.impute import SimpleImputer
class AbnormalTaskPerf... | |
CODE EXAMPLE:
matrix_y = [
[14.05],
[10.55],
[7.55],
[14.93],
[9.48],
[6.59],
[16.56],
[13.63],
[9.23],
[15.85],
[11.75],
[8.78],
[22.41],
[18.55],
[15.93],
[21.66],
[17.98],
[16.44]
]
matrix_x = [
[75, 15],
[100, 15],
[125, 15],
[75, 17.5],
[100, 17.5],
[125, 17.5],
[75, 20],
[100, 20],
... | |
# -*- coding: utf-8 -*-
"""
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1td73szujFTuIVA5lCbJcA95urAspAXvN
# Neural Style Transfer
"""
from tensorflow.python.keras import models
import IPython.display
from tensorflow.python.keras import backend as K
... | |
<filename>lib_lanmt_model.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from nmtlab.models.transformer impo... | |
in seq]),
IntVector([x.tm_sec for x in seq])]
return POSIXct._sexp_from_seq(seq, lambda elt: time.tzname[0], f)
@staticmethod
def sexp_from_datetime(seq):
""" return a POSIXct vector from a sequence of
datetime.datetime elements. """
def f(seq):
return [IntVector([x.year for x in seq]),
IntVector([x.month fo... | |
<filename>source/ftp_client.py
# imports
import argparse
import os
import sys
from socket import *
# classes
class Client:
def __init__(self):
"""
goal: define class properties
type: (self) -> ()
"""
# input variables
self.userinput = ""
self.tokens = []
# socket variables
self.ftp_socket = None
self.hos... | |
def test_only_required_fields(self):
del self.supplemental_description['assertionReferenceId']
del self.supplemental_description['assertionReferenceIdLabel']
del self.supplemental_description['system']
errors = TiesSchemaValidator().all_errors(json.dumps(self.ties))
self.assertEqual(len(errors), 0)
def test_all_... | |
= -np.ones(dim)
self.adecuaN = 0.0
nota = 1
else:
nota = -1
return nota
def ExtraeTags(self, raiz, llave):
vec = []
item = {"NombresSalidas": "A", "NombresEntradas": "N"}
i = 0
while True:
n = raiz.find(llave).find(item[llave] + str(i))
if n == None:
break
else:
vec.append(n.text)
i +=... | |
The protocol currently only
defines one value for this, "X{C{HMAC-SHA1}}".
@type assoc_type: str
@ivar session: An object that knows how to handle association
requests of a certain type.
@see: U{OpenID Specs, Mode: associate
<http://openid.net/specs.bml#mode-associate>}
"""
mode = "associate"
assoc_type = '... | |
0.3696 * self.C_wp) # + 2.38 * (self.A_BT / self.C_b)
self.S_APP = 0.05 * self.S_T # Wet area of appendages
self.S_B = self.L * self.B # Area of flat bottom
self.D_s = 0.7 * self.T # Diameter of the screw
def calculate_frictional_resistance(self, V_0, h):
"""1) Frictional resistance
- 1st resistance component... | |
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli.nice_command import NiceCommand
import tccli.error_msg as ErrorMsg
import tccli.help_template as HelpTemplate
from tccli import __version__
from tccli.utils import Utils
from ... | |
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usage:... | |
service_name: Optional[str] = None):
"""
Configure the Admission Controller
:param bool enabled: Enable the admission controller to be able to inject APM/Dogstatsd config and standard tags (env, service, version) automatically into your pods
:param bool mutate_unlabelled: MutateUnlabelled enables injecting config w... | |
"""Represents an execution of a program.
It is first created with the program parameters: executable, parameters of
execution, command-line; the function execute then allows multiple
executions of the program in different folders and with different
arguments."""
def __init__(self, executablePath, executionParams,... | |
"""
Script to collect metrics (total desired, actual and pending) from a DC
"""
from __future__ import print_function
import json
import operator
import sys
import time
from collections import defaultdict, namedtuple
from datetime import timedelta
from functools import partial
import attr
from effect import Compose... | |
<gh_stars>1-10
import gc
import networkx as nx
import numpy as np
import os
import logging
import pickle
from dca.schemes import (
DCALoggers,
DelaunayGraphVisualizer,
REData,
ExperimentDirs,
DelaunayGraphParams,
HDBSCANParams,
GeomCAParams,
QueryData,
)
from dca.delaunay_graph import DelaunayGraph
from typing ... | |
#!/usr/bin/env python
from os.path import abspath, isfile
from optparse import OptionGroup
from pydpiper.pipeline import Pipeline
from pydpiper.file_handling import createBaseName, createLogFile, removeBaseAndExtension
from pydpiper.application import AbstractApplication
from atoms_and_modules.registration_file_handli... | |
<gh_stars>10-100
# coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.4
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from nucleus_api.configuration import Configuratio... | |
import numpy as np
import math
import pandas as pd
from datetime import date, datetime, timedelta
import yfinance as yf
# from db import connect_to_db
# Create a function to round any number to the smallest multiple of 100
def round_down(x):
return int(math.floor(x / 100.0)) * 100
def rsi(data, column, window=2):
... | |
-1,
}
},
'camera_settings': {
'azimuth': 180,
'distance': 0.3,
'elevation': -50,
'lookat': np.array([0.02, 0.004, 0.09]),
},
}
SLIDE_BEADS_VISION_KWARGS = {
'pixel_wrapper_kwargs': {
'pixels_only': False,
'normalize': False,
'render_kwargs': {
'width': 32,
'height': 32,
'camera_id': -1,
},
},
'camera_... | |
from copy import deepcopy
from unittest import TestCase
from django.test import TransactionTestCase
from django.core.files.storage import default_storage
from django.test import override_settings
from botocore.exceptions import NoCredentialsError
import datetime
from dateutil.parser import parse
from djconnectwise i... | |
== 'pyneb':
#
# #Calculate density using pyneb
# den = self.density_pyneb(Ion, Temp)
#
# #Check for non physical output #WARNING: For pyneb this is too general
# den = self.check_issues(magnitude = den, parameter_type = 'density')
#
# return den
#
# def temperature_determination(self, Ion, dens = None, methodology ... | |
dtype=np.float32)
# wangpeng modify 20200601
# snow_ref_bt11um[ref_lat > 40] = ref_bt11um[ref_lat > 40] + 5.
snow_ref_bt11um[ref_lat_abs >= 40] = ref_bt11um[ref_lat_abs >= 40] + 5.
idx_ = np.logical_and(ref_lat_abs >= 20, ref_lat_abs < 40)
snow_ref_bt11um[idx_] = ref_bt11um[idx_] + 18. - ref_dem[idx_] / 800.
id... | |
a blueprint for a given node
Parameters
----------
bp_id
(str) - ID of AOS blueprint
node_id
(str) - ID of node within AOS blueprint for which to retrieve
rendered configuration
config_type
(str) - type of configuration to retrieve. Options are
"deployed" (default), "staging", "operation"
Returns
-------
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.