input
stringlengths
2.65k
237k
output
stringclasses
1 value
# (C) Datadog, Inc. 2019 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import json import logging import re from collections import OrderedDict import mock import pytest from datadog_checks.base import AgentCheck pytestmark = pytest.mark.metadata SET_CHECK_METADATA_METHOD = 'data...
Complie the message smsg = self.read(timeout = 0.1) if smsg: msg = msg+smsg.decode("utf-8") self.touchDisable() # Turn off touch screen. self.touchLogEnd=True # Make sure this function marked as ending. self.flush() if msg: lines = msg.split('\r') # Split message into lines with CR N = len(lines) values=[tou...
version = "0.3.0", sha256 = "b4d4fc7228a5eb575ff440245269cf20e6eddd81d131151d5b1ef0d39d194ea1", ), "gogol-doubleclick-bids": struct( version = "0.3.0", sha256 = "0c985e054319520307981d3459d3a443dc01d9880fb4fd996a180ad76deb143f", ), "gogol-doubleclick-search": struct( version = "0.3.0", sha256 = "8d94967b5...
<filename>utils/pandafsm.py # Copyright (c) 2020 NVIDIA Corporation # 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, cop...
# Copyright 2002-2011 <NAME>. See LICENSE for licensing information. """mixminion.server.EventStats Classes to gather time-based server statistics""" __all__ = [ 'EventLog', 'NilEventLog' ] import os from threading import RLock from time import time from mixminion.Common import formatTime, LOG, previousMidnight, ...
: {}".format(key,kwargs[key],rlist[key])) st.log("\n") for key in common_key_list: if key in kwargs: dict1[key] = kwargs[key] del kwargs[key] if no_common_key > 0 and ret_val1 is False: st.error("DUT {} -> Match Not Found {}".format(dut,dict1)) return ret_val1 ret_val = "True" #Converting all kwargs to lis...
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
"warmness": 1.5, "flunkers": -1.6, "kindnesses": 2.3, "tout": -0.5, "disappointment": -2.3, "dwellers": -0.3, "sunnier": 2.3, "cornered": -1.1, "despaired": -2.7, "}:": -2.1, "accusation": -1.0, "grants": 0.9, "luckless": -1.3, "freebooter": -1.7, "cancel": -1.0, "disliking": -1.3, "intimidators": -1.6,...
"nsf_plan_good": { "description": "Is the plan good? Only used if agency is nsf", "required": False, "type": "list", }, "nsf_pot_to_advance_knowledge": { "description": "Answer to the question how the work will advance" "knowledge. Only used if agency is nsf", "required": False, "type": "list", }, "nsf_pot_t...
if wrap_around: bnds[np.isclose(bnds, limits[0], rtol(), atol())] = limits[1] error = RuntimeError(f"{name} dimension bounds not directed positively") if bnds.ndim > 0: space_diff = np.diff(bnds, axis=0) if wrap_around: if np.any(space_diff <= 0): # add one full rotation to first and second negative # differe...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2007 <NAME> <<EMAIL>> # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # """Classes for constructing CLY grammars.""" from builtins import map from builtins import str from past.builtins impo...
<reponame>chamisfum/ML_Service_Production """ DOCUMENTATION: config layer use to provide several helper and configuration service that needed by service layer. This layer can be used as config provider and controller for service layer to provide several function configuration. This layer would use any infrastructure ...
<reponame>iosifidisvasileios/CumulativeCostBoosting import pickle import time import warnings import matplotlib from matplotlib.colors import ListedColormap from imblearn.datasets import make_imbalance from sklearn.datasets import make_moons, make_blobs, make_circles, make_classification from sklearn.preprocessing impo...
from math import pi, cos, sin import torch from torch.autograd import Variable import shapely from shapely.geometry import Polygon, MultiPoint import numpy as np from mmdet.ops import box_iou_rotated_differentiable import matplotlib.pyplot as plt class Vector: def __init__(self, x, y): self.x = x self.y = y def _...
+ 3080*m.b168 + 8360*m.b169 + 8360*m.b170 + 8360*m.b171 + 8360*m.b172 + 8360*m.b173 + 8360*m.b174 + 8360*m.b175 + 8360*m.b176 + 760*m.b177 + 760*m.b178 + 760*m.b179 + 760*m.b180 + 760*m.b181 + 760*m.b182 + 760*m.b183 + 760*m.b184 + 1500*m.b185 + 1500*m.b186 + 1500*m.b187 + 1500*m.b188 + 1500*m.b189 + 1500*m.b190 + 1...
import arrow import calendar import copy import datetime from dateutil import parser import math import random import plotly.express as px import plotly.figure_factory as ff import plotly.graph_objs as go from plotly.subplots import make_subplots from data_handler import DataHandler from date_unit import DateUnit ...
result1), (time2, result2) self.report_4n.report(fn_name(), n, results, (net1, net2)) def test_ipv4network_hash(self): """Test the IPv4Network.__hash__ method.""" n = 10**6 net = ip.IPv4Network('1.2.3.0/24') time1, result1 = timefn(n, net.__hash__) enet = eip.IPv4Network('1.2.3.0/24') time2, result2 = timefn(n...
now.") self._schedule_now(self._EVT_CREATE) return create_id else: logger.warning("Request was rejected by scheduler.") self.issue_err(err=self.ERR_REJECTED) return None except Exception as err: logger.exception("Failed to issue create, due to error {}".format(err)) self.issue_err(err=self.ERR_CREATE) def _...
replicas[0]), JMESPathCheck('resourceGroup', resource_group), JMESPathCheck('sku.tier', result['sku']['tier']), JMESPathCheck('sku.name', result['sku']['name']), JMESPathCheck('replicationRole', 'Replica'), JMESPathCheck('sourceServerId', result['id']), JMESPathCheck('replicaCapacity', '0')]) time.sleep(20 * 60...
left=True, right=True) axs[0,1].set_ylim(-.2,.2) axs[0,1].set_xlim(1.5,22.5) axs[0,1].set_title('60$\degree$N-40$\degree$N', fontsize=14) ########################################################################################################################### axs[0,2].plot(lt_hours, ERA_5_cycles[-3] - np.nanmea...
<gh_stars>1-10 #!/usr/bin/env python """ Reference implementation of ExtrudedPolygon """ import numpy from icecube.phys_services import Surface from icecube.dataclasses import make_pair def convex_hull(points): """Computes the convex hull of a set of 2D points. Input: an iterable sequence of (x, y) pairs repres...
"""This module is meant to contain the Solscan class""" from messari.dataloader import DataLoader from messari.utils import validate_input from string import Template from typing import Union, List, Dict from .helpers import unpack_dataframe_of_dicts import pandas as pd #### Block BLOCK_LAST_URL = 'https://public-api...
import sys, os import numpy as np import nibabel as nib from scipy import ndimage as ndi from skimage.measure import label from scipy.signal import convolve from numpy.linalg import norm from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg import pyqtgraph.opengl as gl import networkx as nx from networkx.drawi...
from pymatgen.core.structure import Molecule from pymatgen.core.operations import SymmOp from pymatgen.symmetry.analyzer import PointGroupAnalyzer from pymatgen.symmetry.analyzer import generate_full_symmops import numpy as np from numpy.linalg import eigh from numpy.linalg import det from copy import deepcopy from mat...
is False." .format(self.circuit_sample_rate)) return self.circuit_sample_rate def set_nickname(self, nickname): nickname = nickname.strip() # Do some basic validation of the nickname if len(nickname) > 19: logging.warning("Bad nickname length %d: %s", len(nickname), nickname) return False if not all(c in (st...
<gh_stars>0 # Copyright The OpenTelemetry Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
<reponame>YongxinLIAO/pymodbus #!/usr/bin/env python ''' Libmodbus Protocol Wrapper ------------------------------------------------------------ What follows is an example wrapper of the libmodbus library (http://libmodbus.org/documentation/) for use with pymodbus. There are two utilities involved here: * LibmodbusLe...
self.seen_title: return if self.previous_section: self.add_menu(self.previous_section) else: self.add_menu(self.document, master=True) node_name = node['node_name'] pointers = tuple([node_name] + self.rellinks[node_name]) self.add_text('\n@node %s,%s,%s,%s\n' % pointers) if node_name != node_name.lower(): se...
<filename>gpnet_exact.py from __future__ import division import numpy as np import theano.tensor as T import theano from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import lasagne from lasagne.nonlinearities import softmax, rectify, tanh from lasagne.layers import InputLayer, DenseLayer, Conv1DLaye...
* self.sr t = pg.TextItem(utt['text'], anchor=(0.5, 0.5), color=text_color) top_point = point_min - speaker_tier_range * (speaker_ind - 1) y_mid_point = top_point - (speaker_tier_range / 2) t.setPos(mid_point, y_mid_point) font = t.textItem.font() font.setPointSize(plot_text_font) t.setFont(font) if t.textItem....
"checksum": "0x3603", "lsa-id": "0.0.0.19", "lsa-length": "44", "lsa-type": "Extern", "sequence-number": "0x8000034d" }, { "advertising-router": "10.169.14.240", "age": "2138", "checksum": "0xab95", "lsa-id": "0.0.0.22", "lsa-length": "44", "lsa-type": "Extern", "sequence-number": "0x800002b9" }, { "adv...
= (0.4117647058823529, 0.3764705882352941, 0.023529411764705882) BUFF = (0.996078431372549, 0.9647058823529412, 0.6196078431372549) YELLOWISH = (0.9803921568627451, 0.9333333333333333, 0.4) GREEN_BROWN = (0.32941176470588235, 0.3058823529411765, 0.011764705882352941) UGLY_YELLOW = (0.8156862745098039, 0.75686274509...
# coding: utf-8 """Reimplementation of HMMER binaries with the pyHMMER API. """ import abc import contextlib import collections import ctypes import itertools import io import queue import time import threading import typing import os import multiprocessing import psutil from .easel import Alphabet, DigitalSequence,...
# -*- coding: utf-8 -*- import pytest import numpy as np from skcurve import Point, Segment, Curve, GeometryAlgorithmsWarning, IntersectionType @pytest.mark.parametrize('p1, p2, ndim', [ (Point([1, 1]), Point([2, 2]), 2), (Point([1, 1, 1]), Point([2, 2, 2]), 3), ]) def test_create_segment(p1, p2, ndim): segment ...
S3Importer.define_upload_table() S3ImportJob.define_job_table() S3ImportJob.define_item_table() # ------------------------------------------------------------------------- # Resource components #-------------------------------------------------------------------------- def add_component(self, table, **links): "...
<reponame>jskinn/arvet import unittest import typing import numpy as np import transforms3d as tf3d import arvet.util.transform as tf from arvet.util.test_helpers import ExtendedTestCase import arvet.util.trajectory_helpers as th class TestZeroTrajectory(ExtendedTestCase): def test_zero_trajectory_starts_result_at_...
<filename>ansible/roles/test/files/ptftests/sad_path.py import datetime import ipaddress import re import time from arista import Arista from device_connection import DeviceConnection class SadTest(object): def __init__(self, oper_type, vm_list, portchannel_ports, vm_dut_map, test_args, vlan_ports, ports_per_vlan):...
<filename>pysigview/widgets/signal_display.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jun 21 10:09:46 2017 Ing.,Mgr. (MSc.) <NAME> Biomedical engineering International Clinical Research Center St. Anne's University Hospital in Brno Czech Republic & Mayo systems electrophysiology lab Mayo Clin...
"Methods for scraping comic book covers and metadata from htpps://www.comics.org" import datetime import random import re import urllib.request from contextlib import closing from functools import reduce from os import path from re import search from time import sleep from typing import List, Optional, Union import j...
import json import logging import re from pathlib import Path from typing import Optional, Union import pandas as pd from . import DOCSURL, DS_URL_PREFIX, readers # configure logging logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ch = logging.StreamHandler() ch.setLevel(logging.INFO) logger.addHa...
inject=False): def __init__(self, **kwargs) -> None: super().__init__() st = to_type(self) with st.enter(): for k, t in st.fields.items(): if k not in kwargs: v = default(t) else: v = kwargs.pop(k) setattr(self, k, v) if kwargs: raise TypeError('unrecognized fields: {}'.format(', '.join(kwargs))) def __...
comf.close() def setup_mgr_common(commandslist, dirmap, filesmap, machines, node, targetdir, storagedir, serverdir): mach = machines.get(node['ip']) addToDirMap(dirmap, node['ip'], "%s/%s" % (mach['basedir'], targetdir)) addToDirMap(dirmap, node['ip'], "%s/%s/util" % (mach['basedir'], targetdir)) addToDirMap(dirma...
<gh_stars>0 #!/bin/env python # Python import re import unittest from unittest.mock import Mock # ATS from pyats.topology import Device # Parser from genie.libs.parser.iosxe.show_vrf import ShowVrf, \ ShowVrfDetail # Metaparser from genie.metaparser.util.exceptions import SchemaEmptyParserError # ================...
radius = 0.0 transforms = [] for i, bone in enumerate(bones): loc, quat, scale, mat = frame[i] if bone.parent: mat *= transforms[bone.parent.index] transforms.append(mat) for i, mat in enumerate(transforms): transforms[i] = invbase[i] * mat for mesh in meshes: for v in mesh.verts: pos = Blender.Ma...
# -*- coding: utf-8 -*- """ This module defines :class:`DataObject`, the abstract base class used by all :module:`neo.core` classes that can contain data (i.e. are not container classes). It contains basic functionality that is shared among all those data objects. """ from copy import deepcopy import warnings import ...
<filename>definitions_exercises.py # -*- coding: utf-8 -*- """ Created on Sat May 04 14:20:51 2013 @author: VHOEYS """ #Load packages for calculation and making plots import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt #IMPORT NORMAL DISTRIBUTION: from scipy.stats impor...
_parser(_lexer(fmt)) self.assertEqual(result, _input(eds, rev_eds, inp)) @attr(platform='9-1_linux_intel') @attr('input') @attr(ed='G') def test_g_ed_input_754(self): inp = '''- 1.0''' fmt = '''(G3.2E5)''' result = [0.0000000000000000e+00] eds, rev_eds = _parser(_lexer(fmt)) self.assertEqual(result, _input(e...
TEMPLATE_SUBSTITUTIONS ] PATHLIB_SUBSTITUTIONS = [ field.replace("{", "").replace("}", "") for field in TEMPLATE_SUBSTITUTIONS_PATHLIB ] MULTI_VALUE_SUBSTITUTIONS = [ field.replace("{", "").replace("}", "") for field in TEMPLATE_SUBSTITUTIONS_MULTI_VALUED ] FIELD_NAMES = ( SINGLE_VALUE_SUBSTITUTIONS + MULTI_VALU...
# ============================================================================= # # Main file for CellProfiler-Analyst # # Run python setup.py py2app to build a dmg # # ============================================================================= #!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import w...
for lines in pipfunctionlines: pipelinesfile += ' ' + lines + '\n' with open(scraperpipelinefile, 'w') as f: f.write(pipelinesfile) # creating a settings.py file for scraper with open(basepath + '/scrapy_templates/settings.py.tmpl', 'r') as f: settingspy = Template(f.read()).substitute(project_name=projectname...
+ m.x291) - m.x137 + m.x138 == 0) m.c137 = Constraint(expr=-0.5*m.x460*(m.x291 + m.x292) - m.x138 + m.x139 == 0) m.c138 = Constraint(expr=-0.5*m.x460*(m.x292 + m.x293) - m.x139 + m.x140 == 0) m.c139 = Constraint(expr=-0.5*m.x460*(m.x293 + m.x294) - m.x140 + m.x141 == 0) m.c140 = Constraint(expr=-0.5*m.x460*(m.x294 ...
+ col] = (df.S * df['exi_xgta_ημ_' + col]).shift(1, fill_value=0).cumsum() * self.bs # END add_exa ================================================================================================== self.last_update = np.datetime64('now') # invalidate stored functions self._linear_quantile_function = None self.q_...
<reponame>khuyentran1401/bnlearn<gh_stars>1-10 """Bayesian techniques for structure learning, parameter learning, inference and sampling.""" # ------------------------------------ # Name : bnlearn.py # Author : E.Taskesen # Contact : <EMAIL> # Licence : See licences # ------------------------------------ # %% Librari...
<filename>waterpy/geospatial.py<gh_stars>0 from osgeo import ogr, gdal, osr, gdalconst import os import numpy as np import pandas as pd import json import pycrs import pyproj import netCDF4 import datetime as dt class Shp: """ Contains various fuctions and metadata desc in init related in SHP objects. While titled ...
<reponame>laserson/vdj<gh_stars>1-10 # Copyright 2014 <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 l...
# -*- coding: utf-8 -*- """ Created on Fri Nov 5 01:34:00 2021 @author: yrc2 """ import biosteam as bst import biorefineries.oilcane as oc from biosteam.utils import CABBI_colors, colors from thermosteam.utils import set_figure_size, set_font, roundsigfigs from thermosteam.units_of_measure import format_units from col...
shutil.copyfile(io_config, dconfig) def make_data_splits(samples, params, RESULTSDIR, num_experiments): """ Make train/validation splits from list of samples, or load in a specific list of sampleIDs if desired. """ # TODO: Switch to .mat from .pickle so that these lists are easier to read # and change. partit...
<filename>reverse_engineering/premium_4/captures/mcu_main_to_sub/decode.py import csv import gzip import struct import sys signed_char = lambda x: struct.unpack('b', x)[0] class SubMCU(object): def __init__(self): pass # cmd, pict, screen, param 0, param 1, param 2 def process(self, packet): sys.stdout.write(he...
!= 0)] stereo_m2_data = stereo_m2_data[np.where(stereo_m2_data != 0)] stereo_numbers = np.intersect1d(stereo_m1_data, stereo_m2_data) # because of IDs equal to 0, we must find indices in a slight different way # see https://stackoverflow.com/questions/8251541/numpy-for-every-element-in-one-array-find-the-index-in...
<gh_stars>0 import os from compat import iteritems def add_source_files(self, sources, filetype, lib_env=None, shared=False): import glob import string # if not lib_objects: if not lib_env: lib_env = self if type(filetype) == type(""): dir = self.Dir('.').abspath list = glob.glob(dir + "/" + filetype) for f...
# that. if instr: regex += 'instruction=%s\n' % GlobToRegex(instr) for line in stack: if line == ELLIPSIS: regex += '(.*\n)*' elif '!' in line: (mod, func) = line.split('!') if func == ELLIPSIS: # mod!ellipsis frame regex += '(%s\!.*\n)+' % GlobToRegex(mod, ignore_case=True) else: # mod!func frame # Ignore ...
-- The parent image of the image recipe. dateCreated (string) -- The date on which this image recipe was created. tags (dict) -- The tags of the image recipe. (string) -- (string) -- nextToken (string) -- The next token used for paginated responses. When this is not empty, there are additional elements that ...
or the default value if either is defined, `None` otherwise.""" return self.fixed if self.fixed is not None else self.default # Global element's exclusive properties @property def abstract(self): return self._abstract if self.ref is None else self.ref.abstract @property def final(self): if self.ref is not Non...
= spars['calculation_type'] else: ftype = 'No Data' dec = 'No Data' inc = 'No Data' mad = 'No Data' dang = 'No Data' a95 = 'No Data' sk = 'No Data' sr2 = 'No Data' else: if 'measurement_step_min' in list(pars.keys()): fmin = str(fit.tmin) else: fmin = "N/A" if 'measurement_step_max' in list(pars.keys()): fm...
pairs. Additionally, the entire unparsed log event is returned within ``@message`` . See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogRecord>`_ **Request Syntax** :: response = client.get_log_record( logRecordPointer='string' ) **Response Syntax** :: { 'logR...
self.get_transform(frames[0], frames[1]) self.bounding_box = CompoundBoundingBox.validate(transform_0, cbbox, selector_args=selector_args, order='F') else: raise NotImplementedError('Compound bounding box is not supported for your version of astropy') def _get_axes_indices(self): try: axes_ind = np.argsort(sel...
in keys = sorted(row.Events) arr, basisLength = self._trimGroups(ind, row, keys, station) if basisLength == 0: msg = (('subspace %d on %s is failing alignment and ' 'trimming, deleting it') % (ind, station)) detex.log(__name__, msg, level='warn') self._drop_subspace(station, ind) continue if normalize: arr = ...
ballotpedia_district_id_list: if one_ballotpedia_district_id not in merged_district_list: # Build up a list of ballotpedia districts that we need to retrieve races for merged_district_list.append(one_ballotpedia_district_id) if success: polling_locations_with_data += 1 else: polling_locations_without_data += 1 ...
import collections from collections import defaultdict, OrderedDict import dill import json from .abstract_test import load_test, read_pred_file from .test_types import MFT, INV, DIR from .viewer.suite_summarizer import SuiteSummarizer class TestSuite: def __init__(self, format_example_fn=None, print_fn=No...
887617, 887629, 887633, 887641, 887651, 887657, 887659, 887669, 887671, 887681, 887693, 887701, 887707, 887717, 887743, 887749, 887759, 887819, 887827, 887837, 887839, 887849, 887867, 887903, 887911, 887921, 887923, 887941, 887947, 887987, 887989, 888001, 888011, 888047, 888059, 888061, 888077, 888091, 888103, 888...
<filename>fabfile/data.py #!/usr/bin/env python """ Commands that update or process the application data. """ import app_config import csv import json import logging import math import os import re from time import sleep import copytext from fabric.api import execute, hide, local, task, settings, shell_env from fabri...
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-28 22:03 # -- with some slight modifications # flake8: noqa from django.conf import settings from django.contrib.postgres import fields from django.contrib.postgres.fields import hstore from django.db import migrations, models from django.db.models.deleti...
road in one of a set of positions''' def __init__(self, game, positions, *, no_cost = False): self.game = game self.selected = 0 self.positions = positions self.no_cost = no_cost if self.can_cancel(): self.display_message = \ '[Arrows]: Select position [Enter]: Build road [Space]: Cancel' else: self.display...
import os def qeSubparser(subparsers): # -------------------------------------------------------------------------- # Quantum ESPRESSO # -------------------------------------------------------------------------- subparser = subparsers.add_parser("qe", help="using quantum espresso as calculator") gp = sub...
def __str__(self): return f"{self.name} ({self.id})" @classmethod def get_best_available(cls): return ( cls.objects.filter(status=cls.STATUS_ONLINE).order_by("-priority").first() ) @property def sftp_storage(self) -> Union[SFTPStorage, None]: @backoff.on_exception( backoff.expo, (socket.gaierror,), max_trie...
level, already_processed, name_): if self.length is not None and 'length' not in already_processed: already_processed.append('length') showIndent(outfile, level) outfile.write('length = %d,\n' % (self.length,)) super(NetworkIntEdge, self).exportLiteralAttributes(outfile, level, already_processed, name_) def expor...
""" Constraint generator and surrounding utilities for marginal problem in block diagonal form by SZ operator. antisymm_sz name comes from the fact that the alpha-alpha and beta-beta blocks use antisymmetric basis functions as is common in the 2-RDM literature. This is the most efficient non-redundant form for the SZ s...
<gh_stars>10-100 from discord.ext import commands import itertools from views.poll import Poll # ---------------------------------------------------------------------------------------------------------------- # Bot Cog # ------------------------------------------------------------------------------------------...
""" Author: <NAME> Created: 3/11/2020 9:04 AM """ from Climate_Shocks.vcsn_pull import vcsn_pull_single_site from Climate_Shocks.note_worthy_events.simple_soil_moisture_pet import calc_sma_smd_historical, calc_smd_monthly from Climate_Shocks.get_past_record import get_restriction_record, get_vcsn_record from Pastur...
<filename>feincms/models.py """ This is the core of FeinCMS All models defined here are abstract, which means no tables are created in the feincms_ namespace. """ from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigured from django.db import models from django...
<reponame>scopatz/openmc<gh_stars>0 from collections import OrderedDict, Iterable from numbers import Integral from xml.etree import ElementTree as ET import random import sys import warnings import numpy as np import openmc import openmc.checkvalue as cv if sys.version_info[0] >= 3: basestring = str # A dictionar...
<filename>sru/sru_functional.py import os import sys import warnings import math import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable SRU_CPU_kernel = None SRU_GPU_kernel = None # load C++ implementation for CPU computation def _lazy_load_cpu_kernel(): global SRU_CPU...
<reponame>LeBlue/pyOCD # pyOCD debugger # Copyright (c) 2018-2020 Arm Limited # Copyright (c) 2021 <NAME> # SPDX-License-Identifier: Apache-2.0 # # 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...
#! usr/bin/python3.6 """ Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-07-06 14:02:20.222384 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visual basic / catscript functions work and thus hel...
38 F CAN 45 43 This still describes a binomial family, but in a more compact format than specifying each individual user. We eventually want to support this more compact format, but we do not currently! In this context, it is important to check for over-dispersion (see [GLM]), and I need to learn more first. In...
""" telemetrystation-15min.py This Python program queries the HydroBase web services for real-time (15 minute) station telemetry data. The web service results are output to stdout or a file. Run with -h to display the usage. See the main program at the end of this file. """ import argparse import dateutil.parser as...
from tkinter import * import pickle as pickle from tkinter.ttk import * from helpers import * from Anchors import Anchor from Structures import Structure import xml.etree.ElementTree as ET import matplotlib.pyplot as plt def tv_sort(display, col, root): l = [(display.set(k, 'repr'), k) for k in display.get_childre...
it's anything but 'or' #Now let's figure out the QCODE, e.g. contains, match exact etc. if term['QCODE'] == '0': newQuery = queriedForms.filter(formrecordattributevalue__record_value__contains=term['TVAL'], formrecordattributevalue__record_attribute_type__pk=rtypePK)#CONTAINS elif term['QCODE'] == '1': newQuery = q...
<gh_stars>0 """ player.py PlayerModel code. """ import copy import utils import engagement import perception import decision from packable import pack, unpack from diffable import diff class PlayerModel: """ Models a player as having a DecisionMethod, a PriorityMethod, and a collection of modes of engagement, ...
<filename>lib/usfm/__init__.py ''' The USFM parser module, provides the default sytlesheet for USFM and USFM specific textype parsers to the palaso.sfm module. These guide the palaso.sfm parser to so it can correctly parser USFM document structure. ''' __version__ = '20101011' __date__ = '11 October 2010' __author__ = ...
<reponame>udif/oscope-scpi<filename>oscope_scpi/oscilloscope.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2018,2019,2020,2021, <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the...
<gh_stars>100-1000 """ module for accessing a USB HID YubiKey """ # Copyright (c) 2010, 2011, 2012 Yubico AB # See the file COPYING for licence statement. __all__ = [ # constants # functions # classes 'YubiKeyUSBHID', 'YubiKeyUSBHIDError', 'YubiKeyUSBHIDStatus', ] from .yubico_version import __version__ from ...
from .._compat import basestring from ..adapters.mssql import ( MSSQL, MSSQLN, MSSQL3, MSSQL4, MSSQL3N, MSSQL4N, Vertica, Sybase, ) from ..helpers.methods import varquote_aux from ..objects import Expression from .base import SQLDialect from . import dialects, sqltype_for @dialects.register_for(MSSQL) class M...
self._boxes = None self._masks = None # Allows the user to pass an Image object as the first parameter and have a perfect copy, # only overriding additional metdata passed in. If this pattern is compelling, we can generalize. if isinstance(data_or_path, Image): self._initialize_from_wbimage(data_or_path) elif is...
# -*- coding: utf-8 -*- """ Mission plan parser for DEFCON28 submissions """ import re import pandas as pd import datetime as dt import pytz def parse_mission_plan(filepath,oppWindow): """ Parse text at given filepath Input Parameters ---------- filepath : str - Filepath for file to be par...
<filename>src/htsql/core/adapter.py # # Copyright (c) 2006-2013, Prometheus Research, LLC # """ :mod:`htsql.core.adapter` ========================= This module provides a mechanism for pluggable extensions. """ from .util import listof, aresubclasses, toposort from .context import context import sys import types ...
export_list = self.csv_db.keys() self.export_sub_set(p_export_file_name, export_list, p_export_delimiter) pass # end export def export_sub_set( self, p_export_file_name, p_sub_set_list, p_export_delimiter='|' ): '''Description''' export_file = open(p_export_file_name, 'w+', encoding='utf-8', errors=...
# Program by <NAME> # Based on the the 1981 board game InnerCircle, (Milton Bradley company) import random import sys import os from colored import fg, bg, attr from board1 import B1 from board2 import B2 from board3 import B3 from board4 import B4 COLORIZE_BOARD = True HARD_MODE = False def flatten(l): return [i...
obj[3]<=3: # {"feature": "Bar", "instances": 438, "metric_value": 0.9956, "depth": 6} if obj[5]>-1.0: # {"feature": "Restaurant20to50", "instances": 435, "metric_value": 0.9963, "depth": 7} if obj[6]>-1.0: # {"feature": "Occupation", "instances": 432, "metric_value": 0.997, "depth": 8}...
<filename>tests/visualization_tests/test_pareto_front.py import datetime import itertools from textwrap import dedent from typing import Callable from typing import List from typing import Optional from typing import Sequence import numpy as np import pytest import optuna from optuna.distributions import FloatDistrib...