input
stringlengths
2.65k
237k
output
stringclasses
1 value
<filename>python/envs/hackathon/lib/python3.7/site-packages/mkl_fft/tests/test_fft1d.py #!/usr/bin/env python # Copyright (c) 2017-2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistribu...
import items_setup as item_s import shops_setup as shop_s ARMOR = { 1000: "Shaved", 1100: "Receding", 1200: "Short", 1300: "Swept Back", 1400: "Ponytail", 1500: "Wild", 1600: "Parted Center", 1700: "Semi-Long", 1800: "Curly", 1900: "Bobbed", 2000: "Male 11", 2100: "Male 12", 2200: "Male 13", ...
<reponame>yxia-fb/shaDow-GNN import numpy as np import scipy.sparse from typing import Union, List from dataclasses import dataclass, field, fields, InitVar import scipy.sparse as sp @dataclass class Subgraph: """ Represents the meta information of sampled subgraphs. """ # data fields indptr : np.ndarray indic...
import math from datetime import datetime import psutil from cartmigration.libs.utils import * import sendgrid from sendgrid.helpers.mail import * class BaseController: NEW = 1 RUN = 2 STOP = 3 FINISH = 4 DEV_MODE = True LIMIT_LINE_ERROR = 200 ACTION_STOP = 1 ACTION_COMPLETED = 2 ACTION_APP_MODE = 3 ACTION_D...
# plot fits frame.scatter(fp_m, fp_dopd, label='Measured') frame.plot(np.sort(fp_m), fp_dopd_fit, label='fit', color='red') # set title labels limits title = 'FP cavity width offset' frame.set(xlabel='FP peak number', ylabel='Local cavity width offset [micron]', title=title) # Add legend frame.legend(loc=0) #...
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import ipaddress import threading import sys import signal import os import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn from sqlalchemy.exc ...
<filename>python/SDTransferUtility.pyw # -*- coding: utf-8 -*- """ Created on Mon Dec 09 14:57:26 2013 @author: pokeeffe """ import os import os.path as osp import logging from sys import argv from datetime import datetime from glob import glob from Tkinter import * from tkFileDialog import askdirectory, asksaveasf...
logs = self._run_benchmark_cnn_with_fake_images(params, images, labels) training_outputs = test_util.get_training_outputs_from_logs( logs, params.print_training_accuracy) last_output = training_outputs[-1] # TODO(reedwm): These should be assertEqual but for some reason, # occasionally the accuracies are lower (Run...
"outputBinding" in _doc: try: outputBinding = load_field( _doc.get("outputBinding"), union_of_None_type_or_CommandOutputBindingLoader, baseuri, loadingOptions, ) except ValidationException as e: _errors__.append( ValidationException( "the `outputBinding` field is not valid because:", SourceLine(_doc, "outpu...
values['name'] = unicode(self.address) values['network'] = unicode(self.address) return values class Range(object): def __init__(self, start, end): self.start = start self.end = end def clone(self): return Range(self.start, self.end) def __repr__(self): return '<IPV4.Range(%s, %s)>' % (self.start, self.end)...
from cuxfilter.layouts.chart_views import chart_view from ..core import BaseWidget from ..core.aggregate import BaseNumberChart from ..constants import ( CUDF_DATETIME_TYPES, DATATILE_ACTIVE_COLOR, DATATILE_INACTIVE_COLOR, ) from ...assets.cudf_utils import get_min_max from bokeh.models import ColumnDataSource impor...
(eq, ":i_team", 0), (assign, ":old_cur_y", ":cur_y"), (try_end), (try_end), (try_begin), (le, ":old_cur_y", ":cur_y"), (assign, ":cur_y", ":old_cur_y"), (try_end), (assign, ":cur_x", 42), #white line between playing players and spectators (create_mesh_overlay, reg0, "mesh_white_plane"), (ove...
presence.org.id Id of organization * @apiSuccess {Integer} presence.org.name Name of organization * @apiSuccess {Object} tfidf * @apiSuccess {date} tfidf.created_at When was this data created? * @apiSuccess {date} tfidf.created_for For when was this data created? * @apiSuccess {Object} tfidf.session object * @api...
14], 282: [102, 24, 0, 254, 240, 192, 254, 0], 283: [102, 24, 0, 60, 126, 96, 60, 0], 284: [24, 102, 0, 62, 96, 102, 62, 0], 285: [24, 102, 0, 62, 102, 62, 6, 124], 286: [198, 124, 0, 62, 96, 102, 62, 0], 287: [198, 124, 0, 62, 102, 62, 6, 124], 288: [24, 0, 62, 96, 110, 102, 62, 0], 289: [24, 0, 62, 102, 102, ...
parameter=None): """Construct all the necessary attributes for the IDBPacketTree object. Parameters ---------- children : `list`, optional list of IDBPacketTree, by default None: will be transformed to [] counter : `int`, optional how often this parameter is repeated, by default 1 name : `str`, optional uniqu...
Break: %s" % (tid, repr(bp))) cmdstr = self.bpcmds.get(bp.id, None) if cmdstr != None: self.onecmd(cmdstr) else: self.vprint("Thread: %d NOTIFY_BREAK" % tid) if self.runagain: # One-time run-again behavior (for cli option) if self.config.vdb.BreakOnEntry: setupBreakOnEntry(trace) trace.runAgain() self.runa...
CPU utilization. Please check top output. Possible system overload.", "CPU utilization check."); r1 = group by CLUSTER, KEY do SD_ANOMALY(s, ==, 3); ASSERT(r1, False, "Skewed cluster CPU utilization.", "ANOMALY", WARNING, "Listed node[s] show different CPU utilization characteristic compared to other node[s]. P...
if isData: add_dref(xrefFrom, xrefTo, flag) else: add_cref(xrefFrom, xrefTo, flag) except Exception as e: None def keepCon_VFuncAndVTSMember(funcEA, vtableStructId, offset, keepNameCon=True, keepTypeCon=True, isFromFuncToMember = True): #print "keepCon_VFuncAndVTSMember", offset, funcEA memberId = GetMemberId(v...
list(slice_steps.keys()) self.progress_message_update(0,len(slices)+2) req = TRequest.objects.get(reqid=reqid) fail_slice_save = save_slice_changes(reqid, slice_steps) error_slices = [] if (req.request_type == 'MC') and not fail_slice_save: error_slices=check_slice_jos(reqid,slice_steps) try: fill_request_prio...
@classmethod def _getUniqueId(cls): return str(cls.MOD_uuid.uuid1()).upper() @classmethod def _stringToUniqueId(cls, string=None): if string is not None: basicUuid = cls._basicUniqueId() return str(cls.MOD_uuid.uuid3(cls.MOD_uuid.UUID(basicUuid), str(string))).upper() return cls._getUniqueId() @classmethod ...
each :py:meth:`dispense`, but only if the pipette has no liquid left in it. If set to `False` (default), no :py:meth:`blow_out` will occur. * *mix_before* (``tuple``) -- The tuple, if specified, gives the amount of volume to :py:meth:`mix` preceding each :py:meth:`aspirate` during the transfer. The tuple is int...
<reponame>leegoonz/Maya-devkit from PySide.QtGui import QGraphicsView as _QGraphicsView from PySide.QtCore import QObject as _QObject from PySide.QtGui import QGraphicsObject as _QGraphicsObject class _Property(object): def __call__(*args, **kwargs): """ x.__call__(...) <==> x(...) """ pass def __init__(*a...
''' Computes the magnetic field components from Langlais' spherical harmonic model at a certain altitude. References: <NAME>.; <NAME>., 1981. Spherical harmonic analysis of the geomagnetic field: an example of a linear inverse problem, Geophysical Journal of the Royal Astronomical Society, 65, 645-693. DOI:...
self.query, 'Namespace has ambiguous uniqueness state', result=result[n]) n += 1 # check we processed everything... if n != len(result): raise MQLInternalError( self.query, 'Got %(count)d results, expecting %(expected_count)d', count=len(result), expected_count=n) def add_order_results(self, results): se...
<filename>src/Pyro4/utils/httpgateway.py """ HTTP gateway: connects the web browser's world of javascript+http and Pyro. Creates a stateless HTTP server that essentially is a proxy for the Pyro objects behind it. It exposes the Pyro objects through a HTTP interface and uses the JSON serializer, so that you can immediat...
<filename>model_natasha/unet_model.py # full assembly of the sub-parts to form the complete net import pretrainedmodels import torchvision from .unet_parts import * class CSE(nn.Module): def __init__(self, in_ch, r): super(CSE, self).__init__() self.linear_1 = nn.Linear(in_ch, in_ch // r) self.linear_2 = nn.Lin...
<reponame>Haiiliin/PyAbaqus from abaqusConstants import * from ..BasicGeometry.Face import Face from ..Feature.Feature import Feature as FeatureBase from ..Mesh.MeshFace import MeshFace class Feature(FeatureBase): """The following commands operate on Feature objects. For more information about the Feature object, ...
8], [7, 0, 5, 6, 9, 4, 1, 3, 2], [2, 1, 9, 3, 8, 5, 4, 6, 7], [4, 6, 2, 5, 3, 1, 8, 7, 9], [9, 3, 1, 2, 7, 8, 6, 4, 5], [8, 5, 7, 9, 4, 6, 2, 1, 3], [5, 9, 8, 4, 1, 3, 7, 2, 6], [6, 2, 4, 7, 5, 9, 3, 8, 1], [1, 7, 3, 8, 6, 2, 5, 9, 4]] partial_spec_str = ''' 0 4 6 1 2 7 9 5 8 7 0 5 6 9 4 1 3 2 2 1...
<reponame>knaveofdiamonds/be-schedule<filename>schedule.py from argparse import ArgumentParser from itertools import islice import json import math import sys import pulp def window(seq, n=2): "Returns a sliding window (of width n) over data from the iterable" " s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... " it = ...
<filename>main.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import random import asyncio import ssl import websockets from math import floor # ###### CONFIG ###### serverIP = "localhost" secure = False SSLchain = "/home/pi/ssl/fullchain.pem" SSLkey = "/home/pi/ssl/key.pem" # ###### ###### ###### ...
<filename>dataset/dataset/dataset.py import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import statsmodels.api as sm import warnings from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler, PowerTransformer, \ OneHotEncoder from s...
<gh_stars>0 import sys,time import numpy as np import os from datetime import datetime import psutil import torch from copy import deepcopy import utils from sklearn import metrics from torch.autograd import Variable import re ############################################################################################...
or " "--predict-cas13a-activity-model must be specified if " "--obj is 'maximize-activity' (unless " "--use-simple-binary-activity-prediction is set)")) if args.predict_activity_degradation: raise Exception(("--predict-activity-model-path must be " "specified if --predict-activity-degradation is set " "(unless -...
<reponame>cla7aye15I4nd/awesome-mcu<filename>utils/stm32parser/bes2300.py import ctypes class BES2300Spi: class Type(ctypes.Structure): _fields_ = [ ("SSPCR0" , ctypes.c_uint32), # 0x00000000 ("SSPCR1" , ctypes.c_uint32), # 0x00000004 ("SSPDR" , ctypes.c_uint32), # 0x00000008 ("SSPSR" , ctypes.c_uint32), # 0x000...
*restrict pathname a1 = self.get_arg_val(iaddr, simstate, "a1") # const char *restrict mode a0str = self.get_arg_string(iaddr, simstate, "a0") a1str = self.get_arg_string(iaddr, simstate, "a1") pargs = ( ",".join(str(a) + ':' + str(s) for (a, s) in [(a0, a0str), (a1, a1str)])) if simstate.simsupport.file_operat...
group_name self.is_dirty = True db_group_name = property(__get_db_group_name, __set_db_group_name) def db_add_group_name(self, group_name): self._db_group_name = group_name def db_change_group_name(self, group_name): self._db_group_name = group_name def db_delete_group_name(self, group_name): self._db_group_nam...
of the tree (gray/black/buffer) # Post-condition: returns the y-1 neighbor (P/G logic if already at the top) def top(self,n): if n is None or n.y==0: return None return self[n.x,n.y-1] # Pre-condition: n is a valid node in the main part of the tree (gray/black/buffer) # Post-condition: returns the next-highest ...
(int, optional): Scale of the output gaussians. shuffle (bool, optional): If True, shuffle the samples. camnames (List, optional): List of camera names. crop_width (Tuple, optional): (first, last) pixels in image width crop_height (Tuple, optional): (first, last) pixels in image height vmin (int, optional): Minimu...
= phash.hexdigest() config = self._makeOne(autocommit=True) config.registry.registerAdapter( view, (IExceptionViewClassifier, IRequest, implementedBy(RuntimeError)), IView, name='') def newview(context, request): return 'OK' config.add_view(view=newview, xhr=True, context=RuntimeError, renderer=null_renderer) ...
R environment Only checked if a new R environment is created Default: False _r_object : Optional[RObject] An R environment to use Default: new RObject _mat_object : Optional[MatlabObject] A Matlab environment to use Default: new MatlabObject _environ : dict[str: str,int,float] Variables to be used i...
new displacements after integration. :rtype: :class:`numpy.ndarray` """ def runtime(self, model): # Calc bond forces k1dn self.cl_kernel_calc_bond_force(self.queue, (model.nnodes, model.max_horizon_length), None, self.d_forces, self.d_un5, self.d_vols, self.d_horizons, self.d_coords, self.d_bond_stiffness, self....
<filename>habitat_extensions/measures.py import gzip import json import pickle from typing import Any, List, Union import numpy as np from dtw import dtw from fastdtw import fastdtw from habitat.config import Config from habitat.core.dataset import Episode from habitat.core.embodied_task import Action, EmbodiedTask, M...
testnode_dict is None and candidate_domain.depth >= 4) else: get_testnode = (use_auto_iters and testnode_dict is None and (not next_net_buffer)) if get_testnode: # Use as test node the first picked node with a depth of 4 (this way split constraints are represented) # If stratifying, it's applied only to the tighte...
curses.KEY_HOME: {'name': 'scroll home', 'func': self.__first_page}, curses.KEY_UP: {'name': 'prev creature', 'func': self.__view_prev}, curses.KEY_DOWN: {'name': 'next creature', 'func': self.__view_next}, curses.KEY_NPAGE: {'name': 'scroll down', 'func': self.__next_page, 'help': 'Scroll DOWN on the current p...
<filename>tensorlayerx/backend/ops/torch_nn.py #! /usr/bin/python # -*- coding: utf-8 -*- import torch import torch.nn.functional as F from torch import _VF from torch.nn import Module def padding_format(padding): """ Checks that the padding format correspond format. Parameters ---------- padding : str Must b...
self.posterior_logp + 2*multivariate_normal.logpdf(self.nf_samples, self.mu_map, self.hess_inv, allow_singular=True) self.log_weight_pq_den = 3*multivariate_normal.logpdf(self.nf_samples, self.mu_map, self.hess_inv, allow_singular=True) self.log_evidence_pq = logsumexp(self.log_weight_pq_num) - logsumexp(self.log_wei...
# coding=UTF-8 import numpy as np import math from .utils import * from .OrthoMaterial import * from .IsoMaterial import * ## Class interfacing the solver with 3D FEM calculix computation to obtain the cross section parameter from a composite box class CompositeBox: ## Composite box constructor; It contains 4 Composi...
import operator import numba from numba import types, typing from numba.typing.templates import (signature, AbstractTemplate, infer, ConcreteTemplate, AttributeTemplate, bound_function, infer_global) from numba.extending import typeof_impl, lower_cast from numba.extending import type_callable, box, unbox, NativeValue ...
import os import time import client.api import client.models import psutil from mamba import description, before, after, it from expects import * from expects.matchers import Matcher from common import Config, Service from common.helper import (make_dynamic_results_config, check_modules_exists, get_network_dynamic_r...
from __future__ import print_function import os import json import shutil import textwrap import jinja2 from lxml import etree as ET from collections import defaultdict from iatirulesets.text import rules_text languages = ['en'] # Define the namespaces necessary for opening schema files namespaces = { 'xsd': 'http:/...
<reponame>nwfsc-fram/pyFieldSoftware<gh_stars>0 # ----------------------------------------------------------------------------- # Name: ObserverSOAP.py # Purpose: OPTECS SOAP support for db syncing, using zeep # http://docs.python-zeep.org/en/master/ # # Author: <NAME> <<EMAIL>> # # Created: Dec 20, 2016 # License: MIT...
#!/usr/bin/env python # -*- coding: utf-8 -*- import curses import curses.panel import curses.textpad import re import urlparse import os # Minimal terminal size MIN_LINES = 48 MIN_COLS = 150 class tui: """The Terminal User Interface for Vindimium bot""" def __init__(self): self.running = True self.paused = Fal...
+ str(self.write_log_update)+ '\n') fw.write('random init: ' + str(self.random_init)+ '\n') fw.write('seed: ' + str(self.seed)+ '\n') fw.write('\n\n\n') fw.write('Force config: ' + '\n') for item in self.adv_forces: fw.write(" ".join(map(str, item))) fw.write('\n') fw.write('\n') for key,val in self.idx_to_ac...
<reponame>hhugo/General import itertools import functools import os import sys import textwrap max_arity = 6 def generate(*element, **kwds): p = functools.partial(print, file=kwds.get("file")) previous_line_was_end = False for line in indent(element, kwds.get("indent", 0)): line_is_end = line.strip() == "end" ...
<reponame>TrucHLe/python-contact-center-insights<gh_stars>0 # -*- coding: utf-8 -*- # Copyright 2020 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/licen...
<gh_stars>0 '''' This script generates all figures in the paper. One can make a distinction between forecasting 7 or 14 days ahead via the variable num_days. ''' import matplotlib.colors as mplc import matplotlib.pyplot as plt import numpy as np import math import datetime as dt import pandas as pd import seaborn as s...
errors # If refreshing, all stocks are initialzed via newly downloaded # online data if refresh: errors = get_online_mp(all_tickers) else: if local: get_local(local) else: self.print( f"[3]: no local data detected, moving on to online initialization" ) if online: errors = get_online_mp(online) else: er...
order on the first day expected_orders = [ [{ 'amount': contracts, 'commission': 0.0, 'created': T('2014-01-06 14:31'), 'dt': T('2014-01-06 14:32'), 'filled': contracts, 'id': wildcard, 'limit': None, 'limit_reached': False, 'reason': None, 'sid': self.future, 'status': 1, 'stop': None, 'stop_reached': F...
self.ap.roll_deg = targets_node.getFloat("roll_deg") target_agl_ft = targets_node.getFloat("altitude_agl_ft") ground_m = pos_node.getFloat("altitude_ground_m") # if pressure based: # error_m = pos_pressure_node.getFloat("pressure_error_m") # target_msl_ft = (ground_m + error_m) * m2ft + target_agl_ft # else: ... ...
#!/usr/bin/python #Copyright IBM Corp. 2018. #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at #http://www.apache.org/licenses/LICENSE-2.0 #Unless required by applicable law or agreed to in writing,...
"""A module for handling potentials. This module contains several different classes representing potentials, each having methods to compute relevant nondimensional quantities as functions of nondimensional force or stretch. This module also contains the parent class ``Potential`` that is used to assign a potenti...
= staticmethod(_libsumo.vehicletype_setTau) __swig_getmethods__["setColor"] = lambda x: _libsumo.vehicletype_setColor if _newclass: setColor = staticmethod(_libsumo.vehicletype_setColor) __swig_getmethods__["setMinGapLat"] = lambda x: _libsumo.vehicletype_setMinGapLat if _newclass: setMinGapLat = staticmethod(_li...
<filename>eelbrain/_result_plots.py # Author: <NAME> <<EMAIL>> from math import floor, log10 from os import makedirs from os.path import basename, dirname, exists, expanduser, isdir, join import matplotlib as mpl import numpy as np from . import fmtxt, plot, testnd from .plot._base import POINT from ._data_obj import...
** 0.5) self.q = nn.Parameter(torch.FloatTensor(config.d_model, self.n_head, self.d_head)) self.k = nn.Parameter(torch.FloatTensor(config.d_model, self.n_head, self.d_head)) self.v = nn.Parameter(torch.FloatTensor(config.d_model, self.n_head, self.d_head)) self.o = nn.Parameter(torch.FloatTensor(config.d_mode...
"Don't Fragment", 1: "More Fragments", })] # noqa: E501 class AVP_0_538 (AVP_FL_NV): name = 'IP-Option-Type' avpLen = 12 fields_desc = [ AVP_FL_NV, Enumerated( 'val', None, { 0: "end_of_list", 1: "nop", 2: "security", 3: "loose_source_route", 4: "timestamp", 5: "extended_security", 6: "commercial_secur...
var, axes='per-activation', epsilon=1e-4): """ Performs batch normalization of the given inputs, using the given mean and variance. Parameters ---------- axes : 'per-activation', 'spatial' or a tuple of ints The axes along which the input should be normalized. ``'per-activation'`` normalizes per activation an...
<filename>src/rayoptics/parax/paraxialdesign.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2018 <NAME> """ First order paraxial design space .. Created on Sat Mar 31 21:14:42 2018 .. codeauthor: <NAME> """ import numpy as np from rayoptics.optical.model_constants import ht, slp, aoi from rayoptics...
<reponame>insignification/python-goto import dis import struct import array import types import functools import weakref import warnings try: _array_to_bytes = array.array.tobytes except AttributeError: _array_to_bytes = array.array.tostring try: _range = xrange except NameError: _range = range class _Bytecode: ...
"freturn" raise Return(self.stack.pop()) def opcode_0xaf(self): "dreturn" raise Return(self.stack.pop()) def opcode_0xb0(self): "areturn" raise Return(self.stack.pop()) def opcode_0xb1(self): "return" raise Return(None) def opcode_0xb2(self): "getstatic" index = self.nextword() fieldref = self.const[i...
<reponame>nbonaker/ticker import sys, copy, os sys.path.append("../../") sys.path.append("../") from utils import Utils, PhraseUtils from min_edit_distance import MinEditDistance from click_distr import ClickDistribution from channel_config import ChannelConfig class TickerAudioResults(object): def __init__(self...
<gh_stars>0 # -*- coding: utf-8 -*- ''' Semiparametric Support Vector Machine model under POM3. ''' __author__ = "<NAME>" __date__ = "January 2021" import numpy as np from scipy.spatial.distance import cdist from sklearn.metrics import accuracy_score from MMLL.models.POM3.CommonML.POM3_CommonML import ...
== "c890": prodname = "ROUTERS/ISRG1/890" elif prodcode == "ISRG1GENERIC": prodname = "ROUTERS/ISRG1/MODULES" elif prodcode == "c1900": prodname = "ROUTERS/ISRG2/1900" elif prodcode == "c1900-2900": prodname = "ROUTERS/ISRG2/1900-2900" elif prodcode == "c1900c": prodname = "ROUTERS/ISRG2/1900-CHINA" elif...
import json import os import re import sqlite3 import tempfile import urllib.request from .Base import Base from .Lib import Defaults, SQLiteContext class M365Digester(Base): """App object""" __db = None __db_context_handle = None __rule_list = dict() __wildcard_adjustments = 0 __duplicate_count = 0 __domain...
<reponame>bopopescu/TSAR-AI<gh_stars>0 import os from pprint import pprint import numpy as np import click import geopandas as gpd import logging import spectral.io.envi as s_envi import yaml from ocli.ai.Envi import Envi, header_transform_map_for_zone from pathlib import Path from spectral.io.spyfile import FileNotF...
<filename>ldt/dicts/semantics/lex_dictionary.py<gh_stars>10-100 # -*- coding: utf-8 -*- """ Lexicographic Dictionary classes This module implements the base Lexicographic dictionary class that is inherited by classes for resources from which semantic relations can be obtained. There is also a separate DictionaryWithDe...
import logging import numpy as np from astropy import units as u from astropy.io import fits from astropy import wcs from astropy import coordinates import katbeam _cosine_taper = katbeam.jimbeam._cosine_taper # Mapping from 'BANDCODE' to katbeam model name BAND_MAP = {'L': 'MKAT-AA-L-JIM-2020', 'UHF': 'MKAT-AA-U...
<reponame>mbr4477/astroflux<filename>python/astrofluxlib.py import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from astropy.visualization.wcsaxes.frame import EllipticalFrame from astropy.coordinates import SkyCoord, AltAz, EarthLocation, ICRS from astropy import units as u from astropy.time...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
""" Parser classes for Cheetah's Compiler Classes: ParseError( Exception ) _LowLevelParser( Cheetah.SourceReader.SourceReader ), basically a lexer _HighLevelParser( _LowLevelParser ) Parser === _HighLevelParser (an alias) """ import os import sys import re from re import DOTALL, MULTILINE from types import String...
<gh_stars>0 from rainbow_ddpg.ddpg import DDPG import baselines.common.tf_util as tfutil import itertools from baselines import logger import numpy as np import tensorflow as tf import cv2 import gym from baselines.common.schedules import LinearSchedule import sys import os from threading import Thread from main import...
if len(params) > 1: event_description = clean_string(ctx, params[1]) c = userDatabase.cursor() try: c.execute("SELECT creator FROM events WHERE creator = ? AND active = 1 AND start > ?", (creator, now,)) result = c.fetchall() if len(result) > 1 and creator not in owner_ids+mod_ids: yield from bot.say("Y...
for d in range(1, 32)} assert rule.apply_to_date_range(start_date, end_date) == days_in_march @pytest.mark.django_db def test_rule_filter_dates7( resource, date_period_factory, time_span_group_factory, rule_factory ): date_period = date_period_factory( resource=resource, resource_state=State.OPEN, start_date=d...
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # 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': ['preview'], 'supported_b...
rewrite some commands as necessary if not vs.argument_supplied: return None if cmd in repeatable_cmds: count = vs.get_count() args.update({ 'cmd': cmd, '_times': abs(count), }) if count < 0 and 'forward' in args: args['forward'] = not args['forward'] return ("sbp_do_times", args) elif cmd == 'scroll_lines'...
"clincher", "ascender", "triticum", "pedaling", "trickier", "radishes", "surmised", "scolding", "leathery", "snorkels", "packings", "dejected", "zeolites", "chiseled", "empathic", "iterates", "squander", "bonefish", "dragoons", "gazpacho", "spurring", "calfskin", "campings", "moderato", "deceive...
<reponame>viralpoetry/hvac import logging from unittest import TestCase from unittest import skipIf from parameterized import parameterized, param from hvac import exceptions from tests import utils from tests.utils.hvac_integration_test_case import HvacIntegrationTestCase @skipIf(utils.vault_version_lt('0.9.0'), "...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: <NAME> import json from ares.Lib.html import AresHtml class Editor(AresHtml.Html): name, category, callFnc, docCategory = 'Code Editor', 'Text', 'editor', 'Preformatted' __pyStyle = ['CssDivEditor'] __reqCss, __reqJs = ['codemirror'], ['codemirr...
<filename>ip2geotools/databases/commercial.py<gh_stars>10-100 # -*- coding: utf-8 -*- """ Commercial geolocation databases =================================== These classes access many different commercial geolocation databases. """ # pylint: disable=line-too-long,invalid-name,W0702 from __future__ import absolute_im...
<filename>Cogs/Bot.py<gh_stars>0 import asyncio, discord, os, re, psutil, platform, time, sys, fnmatch, subprocess, speedtest, json, struct, shutil, tempfile from PIL import Image from discord.ext import commands from Cogs import Utils, Settings, DisplayName, ReadableTime, GetImage, ProgressBar, UserTime, Message, D...
<gh_stars>1-10 #!/usr/bin/env python import os import argparse import sys import pandas as pd import numpy as np from collections import defaultdict from collections import Counter import bin.round1_annotation as round1_annotation import bin.round2_annotation as round2_annotation import bin.genome_locations as genome_...
""" Module: LMR_verify_gridRNL.py Purpose: Generates spatial verification statistics of various LMR gridded fields against 20th century reanalyses. Originator: <NAME>, U. of Washington, March 2016 Revisions: """ import matplotlib # need to do this backend when running remotely or to suppress figures interactive...
<reponame>rome2rio/TokyoGTFS<filename>src/handlers.py<gh_stars>1-10 try: import ijson.backends.yajl2_c as ijson except: import ijson from datetime import datetime, timedelta, date from warnings import warn from bs4 import BeautifulSoup from copy import copy from tempfile import TemporaryDirectory import pykakasi impor...
+ ' Mbytes' else: imageSize = imageSize / 1000 logging.debug('\u001B[1m ' + image + ' size is ' + ('%.3f' % imageSize) + ' Gbytes\u001B[0m') self.allImagesSize[image] = str(round(imageSize,1)) + ' Gbytes' else: logging.debug('ran-build size is unknown') self.allImagesSize[image]...
<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright 2019 Google LLC. 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 # # Unle...
<filename>vlcgan/miscc/utils.py<gh_stars>1-10 import os import errno import numpy as np import PIL from copy import deepcopy from .config import cfg import pdb from torch.nn import init import torch import torch.nn as nn import torch.nn.functional as F import torchvision.utils as vutils import torchvision.transforms as...
# # create.py # # Python interface for the iRobot Create # Licensed as Artistic License # # <NAME> <EMAIL> # updated for SIGCSE 3/9/07 # # modified by <NAME> Oct 20 2007 # # modified by <NAME> Dec 9 2009 # 1. Two new functions (senseFunc and sleepTill). # 2. getPose fixed (call to r.sensors([POSE]) added to stop()). # ...
1, } self.assertEqual(expect, ctxt()) def test_zeromq_context_unrelated(self): self.is_relation_made.return_value = False self.assertEquals(context.ZeroMQContext()(), {}) def test_zeromq_context_related(self): self.is_relation_made.return_value = True self.relation_ids.return_value = ['zeromq-configuration:1'...
""" ET Correction Tool: This script creates evapotranspiration Dfs2 from single/multiple reference ET time-series, and applies spatially, monthly varying solar radiation correction factors to the reference ET data and creates the MIKE SHE input ET Dfs2 file. Created on Wed Apr 28 15:50:07 2021 @author: <NA...
<reponame>jjiege/odoo<gh_stars>0 # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import datetime from datetime import datetime, timedelta, time from odoo import fields from odoo.tests.common import TransactionCase import pytz import re class TestCalendar(Transactio...
metadata: if 'readme_files' in metadata: readme_files_dict = readme_util.build_readme_files_dict( metadata ) folder_id, readme_files_root_folder = build_readme_files_folder( trans, folder_id, readme_files_dict ) containers_dict[ 'readme_files' ] = readme_files_root_folder # Repository dependencies container. fold...