input
stringlengths
2.65k
237k
output
stringclasses
1 value
0.0439, 1.6589, 0.0350, 1.5733, 0.0370, 1.67e-16, 1.67e-16, 1.67e-16, nan ], [ 180, 1.3332, 0.0489, 1.4460, 0.0451, 1.9247, 0.0339, 1.7632, 0.0370, 1.58e-16, 1.58e-16, 1.58e-16, nan ], [ 190, 1.4496, 0.0501, 1.5773, 0.0460, 2.0851, 0.0348, 1.8676, 0.0389, 2.24e-16, 1.50e-16, 1.50e-16, nan ], [ 200, 1.4350, 0.0560, 1...
<gh_stars>0 ################################################################################ # Copyright (c) 2015-2019, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a c...
""" This code implements a support vector classifier using the sklearn package to learn a classification model for a chessboard-like dataset. Written using Python 3.7 """ # builtin modules import os import psutil import requests import sys import math # 3rd party modules import pandas as pd import numpy as np impo...
<filename>src/UserInput/InputDef.py # ============================================ # # Classes of User Input # # <NAME>, June 3, 2016 # # ============================================ from math import pi, cos, sin, tan, pow import gc import json import copy import os class Frozen(object): # A metaclass that prevents ...
<gh_stars>0 #script to process cumulative attenuation DataSet from FO_diff_attenuation.py #<NAME>, Scott Polar Research Institute, University of Cambridge, 2020. <EMAIL> import os import sys import glob import pickle import datetime import matplotlib import numpy as np import pandas as pd import xarray as xr import m...
<filename>advanced_lane_detection_main.py import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import glob from moviepy.editor import VideoFileClip left_fit_poly = [] right_fit_poly = [] objpoints = [] # 3D points imgpoints = [] # 2D points # nx and ny define the number of ...
""" Define a base command class that: 1) provides a consistent interface with `git`, 2) implements common git operations in one place, and 3) tracks file- and repo- specific data the is necessary for Git operations. """ from collections import deque, ChainMap import io from itertools import chain, repeat from func...
<reponame>11Tuvork28/M3E5 from sqlalchemy.dialects.mysql import CHAR from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, FLOAT, BIGINT, DATETIME, ForeignKey, VARCHAR, TEXT, BOOLEAN from sqlalchemy.orm import relationship from base_folder.config import Session ''' Th...
4 """ if axis is None: axis = 0 if not (axis == 0 or axis == "index"): raise NotImplementedError("fillna currently only works for axis=0 or axis='index'") if value is None: raise ValueError('Currently must specify value') if not isinstance(value, (float, int, str, bool, dict, pd.Series)): raise TypeError("Uns...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Define the MuJoCo parser/generator. Notes: - MuJoCo only accepts STL meshes - MuJoCo can load PNG files for textures and heightmap. References: - MuJoCo overview: http://www.mujoco.org/book/index.html - MuJoCo XML format: http://www.mujoco.org/book/XMLreference.htm...
""" Copyright 2018, Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE file in project root for terms. """ import time import unittest import json import os from mock import * from yahoo_panoptes.framework.enrichment import PanoptesEnrichmentSet, PanoptesEnrichmentGroup, \ PanoptesEnrichmentG...
the next chunk srchdat = self.FID.read(min(20, (start_ptr + file_length) - cur_ptr)) stx_idx = srchdat.find(b'#') if stx_idx >= 0: possible_start = cur_ptr + stx_idx self.FID.seek(possible_start) datchk = self.FID.read(4) m = self.datagram_ident_search.search(datchk, 0) if m: self.FID.seek(possible_start - 4) ...
the JS snippet that is to be plugged into the decodeUris # function in the loader. def loaderDecodeUrisPlug(script, compConf): plugCodeFile = compConf.get("code/decode-uris-plug", False) plugCode = "" if plugCodeFile: plugCode = filetool.read(self._config.absPath(plugCodeFile)) # let it bomb if file can't be read...
# -*- coding: utf-8 -*- import json import re import os import time import dicttoxml from scalrctl import click, request, settings, utils, view, examples, defaults __author__ = '<NAME>' class MultipleClickException(click.ClickException): def format_message(self): return '\x1b[31m%s\x1b[39m' % self.message if se...
import numpy as np from gmmmc.gmm import GMM from gmmmc.proposals.proposals import Proposal import pdb import logging class GaussianStepMeansProposal(Proposal): """Gaussian Proposal distribution for means of a GMM""" def __init__(self, step_sizes=(0.001,)): """ Gaussian proposal distribution for the means. The mu...
body of a backup plan. Includes a ``BackupPlanName`` and one or more sets of ``Rules`` . - **BackupPlanName** *(string) --* The display name of a backup plan. - **Rules** *(list) --* An array of ``BackupRule`` objects, each of which specifies a scheduled task that is used to back up a selection of resources. - *...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Object oriented interface to NIVA Thing universe """ __all__ = ["Thing", "Platform", "Vessel", "Sensor", "TimeSeries", "FlagTimeSeries", "GPSTrack", "ThingError"] from dateutil.parser import parse from .metaflow import get_thing as meta_get_thing from .metaflow imp...
a computed uniform distribution of points, 'npoints', on that sphere(s). It can return the 'theta,phi' (mollweide) coordinates of the 'varloc' values as well. Parameters ---------- varloc: str, int, np.ndarray String: for the variable you want if defined on instantiation Int: index location of the variable you ...
prob][0] for prob in solved_by_md: md_mapping[prob] = [x for x in filter_settings(good_data, MIN_DEORDERING) if "%s/%s" % (x[0], x[1]) == prob][0] for prob in solved_by_mr: mr_mapping[prob] = [x for x in filter_settings(good_data, MIN_REORDERING) if "%s/%s" % (x[0], x[1]) == prob][0] for prob in solved_by_md: ...
image. Returns: masks: A bool array of shape [height, width, instance count] with one mask per instance. class_ids: a 1D array of class IDs of the instance masks. """ # If not a balloon dataset image, delegate to parent class. image_info = self.image_info[image_id] if image_info["source"] != "PLC": return supe...
0x79, 0x39, 0x46, 0xd1, 0x6c, 0xa8, 0xa8, 0x30, 0x2e, 0x82, 0x99, 0x50, 0x46, 0x7d, 0x93, 0x35, 0xe5, 0xc9, 0x9f, 0x53, 0x92, 0x8d, 0x9d, 0x52, 0x18, 0x6c, 0x87, 0x2e, 0x84, 0xd1, 0xfe, 0xb5, 0x91, 0x37, 0xed, 0xc2, 0x10, 0x65, 0xd2, 0x26, 0x74, 0xbb, 0xf2, 0x32, 0xda, 0x02, 0x8d, 0x15, 0xef, 0x61, 0x0c, 0xf9, 0xc0...
<reponame>haggispinball/mpf_fathom_fast """Contains show related classes.""" import re from collections import namedtuple from typing import List, Dict, Any, Optional from mpf.core.assets import AssetPool from mpf.core.config_validator import RuntimeToken from mpf.core.utility_functions import Util from mpf.exception...
<reponame>dowlinglab/dmd-energy-markets import numpy as np from scipy import linalg as la from cmath import exp import matplotlib.pyplot as plt def split(Xf, verbose=False): ''' This function will perform a crutical manipulation for DMD which is the splitting of a spacial-temporal matrix (Xf) into two matrices (X...
<reponame>dprojects/Woodworking # This file has been automatically generated by the loadToolsAuto.py script. Don't change it here. import FreeCADGui import os, sys import fakemodule path = os.path.dirname(fakemodule.__file__) iconPath = os.path.join(path, "Icons") # ################################################...
<reponame>makquel/object_detection_BGE<gh_stars>1-10 # Object detection using CNN based classifier versão 1.0 # # ----------------------------------- # Author: <NAME> # Date: 10/04/19 # Description: Este script utiliza um classificador treinado em tensorflow para detectar marcadores do tipo ASARP # utéis na detec...
import time import random import math from collections import OrderedDict from simulator import Simulator class TrafficLight(object): """A traffic light that switches periodically.""" valid_states = [True, False] # True = NS open; False = EW open def __init__(self, state=None, period=None): self.state = state i...
in aliases['add']): print( "PARAMETERS list of local paths to Git repositories. No effect if" " no path is given." ) print( "EFFECT updates the description file to include each path so that" " it matches their current state." ) print( "EXAMPLE 'add ./my/src/local_clone' adds a description of the" " repositor...
`INPUT` Node is used as its input on `TRIAL <TimeScale.TRIAL>` num_trials : int : default 1 typically, the composition will infer the number of trials from the length of its input specification. To reuse the same inputs across many trials, you may specify an input dictionary with lists of length 1, or use default ...
np.array([p0[0], p0[1], 0.0, 1.0]) p0 = np.matmul(image_to_points_mat, p0)[:2] p1 = np.array([p1[0], p1[1], 0.0, 1.0]) p1 = np.matmul(image_to_points_mat, p1)[:2] normal = np.array([normal[0], normal[1], 0.0, 0.0]) normal = np.matmul(image_to_points_mat, normal)[:2] return p0, p1, normal def update(self, poi...
None delta_abbr = None if name is not None: db_name = name + "Database" delta_name = name + "Delta" if abbr is not None: db_abbr = abbr + "DB" delta_abbr = abbr + "Dlta" self.database = Database(name=db_name, abbr=db_abbr) # rules that dictate how database changes in response to events self.delta_rules = Delt...
output, totalsize, "Table") self.totalTableSize = strout (output, totalsize, strout) = self.__printSize(int(ucscUtils.makeFileSizes(pushFiles, self.releasePath)), output, totalsize, "Files") self.totalFilesSize = strout (output, totalsize, strout) = self.__printSize(int(ucscUtils.makeFileSizes(pushGbdbs, self.relea...
If the [subnetwork is located in a Shared VPC network](https://cloud.google.com/dataflow/docs/guides/specifying-networks#shared), you must use the complete URL. For example `"googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/subnetworks/SUBNET_NAME"` """ return pulumi.get(self, "subnetwork") @subnetwork....
<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- # # This file is part of pyunicorn. # Copyright (C) 2008--2017 <NAME> and pyunicorn authors # URL: <http://www.pik-potsdam.de/members/donges/software> # License: BSD (3-clause) """ Provides classes for analyzing spatially embedded complex networks, handling multiva...
self._nodeset_t(["--fold", "-i", "bar[0-5]"], "foo[6-10]\n", "\n") self._nodeset_t(["--fold", "-i", "foo[5-10,15]"], "foo[0-10]\nfoo[13-18]\n", "foo[5-10,15]\n") # using stdin for -i self._nodeset_t(["-f","foo[1-6]","-i","-"], "foo4 foo5 foo6\n", "foo[4-6]\n") self._nodeset_t(["-f","-i","-","foo[1-6]"], "foo4 foo5 ...
import re import os import sys import gtk import time import pango import gobject import gtk.glade import threading import commands import Queue import GlobalConfig import PLogger import LocalJobSpec gobject.threads_init() gtk.gdk.threads_init() # thread to synchronize database in background class Synchronizer(thr...
(self, child, row, update_list): item = self.win_to_item_[child] r, c = self._get_item_row_col(item) if c is None: # position not yet computed return ul = [] for u in update_list: if isinstance(u, strip): ul.append(strip(u.text, u.style_name, u.col + c)) elif isinstance(u, cursor_update): ul.append(cursor_up...
== None: if not packet.is_default_src_mac(): int_mac_src_override_by_pkt = 1 else: int_mac_src_override_by_pkt = int(mac_src_override_by_pkt); if mac_dst_override_mode == None: if not packet.is_default_dst_mac(): int_mac_dst_override_mode = STLStreamDstMAC_PKT else: int_mac_dst_override_mode = int(mac_dst_ove...
<filename>Diagnostic/lad_config_all.py #!/usr/bin/env python # # Azure Linux extension # # Linux Azure Diagnostic Extension (Current version is specified in manifest.xml) # Copyright (c) Microsoft Corporation # All rights reserved. # MIT License # Permission is hereby granted, free of charge, to any person obtaining a ...
maximum_number_of_outputs if len(args_copy.output_description) == 1: args_copy.output_description = args_copy.output_description * maximum_number_of_outputs if not ( len(args_copy.output_id) == len(args_copy.output_seq) == len(args_copy.output_filter) == len(args_copy.output_description) ): raise ValueError("The ...
[-0.79546369024868, 0.05991487568396, -0.57235298198835], [-0.69209820344694, 0.05991487568396, -0.57235298198835], [-0.58120945840524, 0.05712058778268, -0.58120945840524], [-0.45548262743559, 0.05474066986092, -0.59925804242534], [-1.00000000000000, 0.22034867784306, -0.61017433892153], [-0.89849390365871, 0.213...
<filename>IRIS_data_download/IRIS_download_support/obspy/io/cmtsolution/core.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ CMTSOLUTION file format support for ObsPy. :copyright: The ObsPy Development Team (<EMAIL>) :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.ht...
= node_failure_timer.start_time def _disable_firewall(self, node): shell = RemoteMachineShellConnection(node) shell.disable_firewall() shell.disconnect() def _restart_couchbase_server(self, node): node_failure_timer = self.failure_timers[self.itr] self.task_manager.add_new_task(node_failure_timer) time.sleep(...
from .cassiemujoco import pd_in_t, state_out_t, CassieSim, CassieVis from .trajectory import CassieTrajectory from math import floor import numpy as np import os import random import pickle class CassieEnv_rand_dyn: def __init__(self, traj, simrate=60, clock_based=False, state_est=False): self.sim = CassieSim("...
<filename>janitor/timeseries.py """ Time series-specific data cleaning functions. """ import itertools from typing import Dict, Union import pandas as pd import pandas_flavor as pf from janitor import check from .errors import JanitorError @pf.register_dataframe_method def fill_missing_timestamps( df: pd.DataFra...
<gh_stars>0 """ Open Test Arbatrage System USE AT YOUR OWN RISK! MULTIPLE EXCHANGE ACCEPTANCE ALLOWS 'USERS' TO CHOOSE THEIR OWN STRATEGY AS WELL AS TRADING COINS PROVIDES DETAILED INFORMATION ABOUT EXCHANGES & PLATFORMS ALLOWS USERS TO CONNECT IN A FRIENDLY ENVIRONMENT Author: ~Skrypt~ """ import sys import ...
from operator import attrgetter, itemgetter from typing import ( Any, Collection, Dict, List, Optional, Set, Tuple, Union, cast, ) from ..error import GraphQLError, located_error from ..pyutils import inspect from ..language import ( DirectiveNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, In...
proper Response object is the job of the real # _crawlable_feed. eq_("An OPDS feed.", response) # Verify that _crawlable_feed was called with the right arguments. kwargs = self._crawlable_feed_called_with eq_(expect_url, kwargs.pop('url')) eq_(customlist.name, kwargs.pop('title')) eq_(None, kwargs.pop('annotato...
import glob import os import sys import tkinter as tk from tkinter import messagebox from xml.etree import ElementTree import cv2 import numpy as np import pandas as pd from PIL import Image, ImageTk from utils import annotator FOLDER_PATH = 'purifier/folders.pkl' def get_folders(): """ read a...
<gh_stars>0 import os import logging import numpy as np import tensorflow as tf import pickle import time import random import math import matplotlib.pyplot as plt from datetime import datetime from random import shuffle os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" logging.getLogger("tensorflow").setLevel(logging.CRITICA...
import unittest from nalaf.structures.data import Dataset, Document, Part, Entity, Relation from nalaf.learning.evaluators import Evaluator, MentionLevelEvaluator, DocumentLevelRelationEvaluator from nalaf.preprocessing.spliters import NLTKSplitter from nalaf.preprocessing.tokenizers import NLTK_TOKENIZER STUB_E_ID_1...
'type': 'OperationDisplay'}, } def __init__( self, *, name: Optional[str] = None, display: Optional["OperationDisplay"] = None, **kwargs ): super(Operation, self).__init__(**kwargs) self.name = name self.display = display class OperationDisplay(msrest.serialization.Model): """Display name of operation. ...
necessary if f_loc is None: if n_samples is None: f_loc = np.zeros(n_dofs_test) else: f_loc = np.zeros((n_dofs_test,n_samples)) # Update form f_loc += np.dot(test.T, wKer) elif self.type=='bilinear': # # Bilinear form # # Test functions evaluated at Gauss nodes n_dofs_test = self.test.dofhandler().eleme...
value can be null. """ pass def InsertRange(self,index,c): """ InsertRange(self: ArrayList,index: int,c: ICollection) Inserts the elements of a collection into the System.Collections.ArrayList at the specified index. index: The zero-based index at which the new elements should be inserted. c: The...
[out] Indicates if ::zes_pci_stats_t.packetCounter will have valid ## values ("haveReplayCounters", ze_bool_t) ## [out] Indicates if ::zes_pci_stats_t.replayCounter will have valid ## values ] ############################################################################### ## @brief PCI link status class zes_pci_li...
import argparse import math import numpy as np import scipy.interpolate as interpolate import torch import torch.nn as nn import torch.nn.functional as F import lib.layers as layers from .regularization import create_regularization_fns from .layers.elemwise import _logit as logit from .layers.elemwise import _sigmoid...
(0 <= t2 and t2 <= 1): if p1[1] + t1 * dy == q1[1] or p1[1] + t2 * dy == q2[1]: return False else: t1 = Rational(q1[1] - p1[1]) / dy t2 = Rational(q2[1] - p1[1]) / dy if (0 <= t1 and t1 <= 1) or (0 <= t2 and t2 <= 1): if p1[0] + t1 * dx == q1[0] or p1[0] + t2 * dx == q2[0]: return False else: s = (dx * Ration...
'spectrum': if args.clkPrior == 'uniform': priorfac_clk = np.sum(np.log(10.0**clk_spec * np.log(10.0))) elif args.clkPrior == 'loguniform': priorfac_clk = 0.0 elif not args.incClk: priorfac_clk = 0.0 if args.incDip: ### powerlaw spectral model ### if args.dipSpecModel == 'powerlaw': if args.dipPrior == 'uni...
<reponame>yuweiliandrew/openrtist import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init import functools from torch.optim import lr_scheduler import numpy as np from .stylegan_networks import StyleGAN2Discriminator, StyleGAN2Generator, TileStyleGAN2Discriminator #################...
<gh_stars>1000+ #!/usr/bin/env python # -*- coding: utf-8 -*- #** # ######### # trape # ######### # # trape depends of this file # For full copyright information this visit: https://github.com/jofpin/trape # # Copyright 2018 by <NAME> (@jofpin) / <<EMAIL>> #** import time import json import urllib from core.dependence ...
from tkinter import * from tkinter import filedialog, messagebox import os, shutil, subprocess from os import listdir from os import path from os.path import isfile, join, splitext import platform root = Tk() root.minsize(640, 640) root.resizable(0, 0) root.title("MXSkinNamer") root.directory = None dynosList = {"Hon...
# uncompyle6 version 3.2.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] # Embedded file name: httplib from array import array import os, socket from sys import py3kwarning from urlparse import urlsplit import warnings with warning...
== 'RecoveredHost': uframe_dataset_name = 'CE01ISSM/SBD17/01-MOPAK0000/recovered_host/mopak_o_dcl_accel_recovered' var_list[0].name = 'time' var_list[0].data = np.array([]) var_list[0].units = 'seconds since 1900-01-01' elif platform_name == 'CE02SHSM' and node == 'BUOY' and instrument_class == 'MOPAK' and met...
<reponame>SpartanByte/nuwebsite2 <!DOCTYPE html> <html lang="en" class=""> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#"> <meta charset='utf-8'> <link crossorigin="anonymous" href="https://as...
#!/usr/bin/env python # # Copyright (C) <NAME> 2020 <<EMAIL>> # import datetime import os import re import sqlite3 import subprocess import sys import tempfile import xlrd import xlwt import base64 import locale import gi from . import browserWebkit2 from .browserWebkit2 import Browser from . import config from .conf...
(likely most common case) elif len(v) == 1: tocomids[k] = v.pop() # comid is an outlet elif len(v) == 0: tocomids[k] = 0 # comid routes to multiple comids (diversion) else: # downstream elevations tocomids_c = list(v) dnelevs = [div_elevs.get(toid, 99999) for toid in tocomids_c] # downstream elevations uniqu...
rs2=0, imm=14, pc=0, f3=0b101, f7=0) assert res == 0x00008484 # SRAI res = ex.alu(opcode=0b00100, rs1=0x7fffffff, rs2=0, imm=0, pc=0, f3=0b101, f7=0b0100000) assert res == 0x7fffffff res = ex.alu(opcode=0b00100, rs1=0x7fffffff, rs2=0, imm=1, pc=0, f3=0b101, f7=0b0100000) assert res == 0x3fffffff res = ex.alu(...
""" Helium's API is contained in module ``helium``. It is a simple Python API that makes specifying web automation cases as simple as describing them to someone looking over their shoulder at a screen. The public functions and classes of Helium are listed below. If you wish to use Helium functions in your Python scrip...
measures]) peaks = sum(['hp' in i or 'ph' in i for i in measures])+inte adict_[layer][synset] = ((per, inte, hubs), peaks) measures = adict[layer][synset] per = sum([i[0]=='p' for i in measures]) inte = sum([i[0]=='i' for i in measures]) hubs = sum([i[0]=='h' for i in measures]) peaks = sum(['hp' in i or 'ph' i...
<reponame>leonardt/veriloggen from __future__ import absolute_import from __future__ import print_function from __future__ import division import functools import math import veriloggen.core.vtypes as vtypes from veriloggen.seq.seq import Seq from veriloggen.fsm.fsm import FSM import veriloggen.dataflow as _df from ...
InterceptionMouseFlag.INTERCEPTION_MOUSE_MOVE_RELATIVE stroke.rolling = 0 stroke.x = 1 stroke.y = 0 stroke.information = 0 autohotpy.sendToDefaultMouse(stroke) autohotpy.sleep(0.0010008811950683594) stroke = InterceptionMouseStroke() stroke.state = InterceptionMouseState.INTERCEPTION_MOUSE_MOVE stroke.flags = ...
'Możecie odejść', 'GUaohE7xwoZwz2vStmlqvsW1quyPE9Ct': 'Ten z wąsami jest słodki', 'ShLTVqsT6t223wUj801vesxTe4o5TmkZ': 'Ale troche stary', 'b1B53u7uknKUlVxQHpvzotIh6QHBplri': '"troche stary jakby, nie?"', 'Wd1MnI0dhEddVmKD7Pvp2LmnCwh6GN3K': 'Nie ten, tamten', 'LSYpFmp0LSq8GgWwimBJu6HM282Vaxca': 'Dla mnie za gruby (...
ex.response.text) except requests.exceptions.RequestException as e: print("Request exception: ", e) def get_imports(self, expand=None, filter=None, skip=None, top=None): """Returns a list of imports for the organization. ### Parameters ---- expand: string Expands related entities inline, receives a comma-sep...
mv = mv_df.reset_index().loc[:n_rows, [LATITUDE, LONGITUDE]] folium.Marker( location=[mv.iloc[0][LATITUDE], mv.iloc[0][LONGITUDE]], color="green", clustered_marker=True, popup="Início", icon=folium.Icon(color="green", icon="info-sign"), ).add_to(base_map) folium.Marker( location=[mv.iloc[-1][LATITUDE], mv.ilo...
<filename>smartversion/foo.py def test_usage(): l = [] for i in range(20): l.append(Version(i, i)) for i in range(20): assert(l[i] == Version(i, i)) v1 = Version(0) v2 = Version(0) assert(v1 == v2) assert(hash(v1) == hash(v2)) v1 = Version(1, 2, '3-rc6') v2 = Version(1, 2, 4) assert(v1 != v2) assert(ha...
<gh_stars>1-10 #!/usr/bin/env python #import gmetaddata as gmetad #import gmonddata as gmond import optparse import pywbem from lib import wbem_connection #import telnetlib as telnet #import elementtree.ElementTree as ET #import socket import unittest import os import shutil import random import sys real_tolerance = ...
exon_ranges: exon_ranges[chrom] = Intersecter() exon_ranges[chrom].add_interval( Interval( st, end ) ) #read SAM print >>sys.stderr, "reading "+ self.fileName + '...', for line in self.f: if line.startswith("@"):continue fields=line.rstrip('\n ').split() flagCode=string.atoi(fields[1]) if...
0)) installationFile.write(self.get('Payload', 'tempPayload', 0)) installationFile.write(" 2>/dev/null\n") installationFile.write('\n') installationFile.write("#Reset History.\n") installationFile.write("HISTSIZE=$OLDHISTSIZE\n") installationFile.write("export HISTSIZE\n") installationFile.write("set HIS...
temp_model.from_map(m['body']) return self class QueryCityCarApplyHeaders(TeaModel): def __init__( self, common_headers: Dict[str, str] = None, x_acs_dingtalk_access_token: str = None, ): self.common_headers = common_headers self.x_acs_dingtalk_access_token = x_acs_dingtalk_access_token def validate(self): ...
import copy import warnings import weakref import pandas as pd from woodwork.accessor_utils import ( _check_column_schema, _is_dataframe, _is_series, init_series, ) from woodwork.column_schema import ColumnSchema from woodwork.exceptions import ParametersIgnoredWarning, TypingInfoMismatchWarning from woodwork.ind...
% i1IIi / IiII if 6 - 6: iII111i / I1IiiI % OOooOOo - I1IiiI if 31 - 31: OOooOOo if 23 - 23: I1Ii111 . IiII if 92 - 92: OoOoOO00 + I1Ii111 * Ii1I % I1IiiI if 42 - 42: Oo0Ooo if 76 - 76: I1IiiI * iII111i % I1Ii111 if 57 - 57: iIii1I11I1II1 - i1IIi / I1Ii111 - O0 * OoooooooOO % II111iiii if 68 - 68: OoooooooOO * I11i % O...
hips bone is not below the legs bone # hip_bone_length = abs(hips.tail[z_cord] - hips.head[z_cord]) # hips.head[z_cord] = right_leg.head[z_cord] # hips.tail[z_cord] = hips.head[z_cord] + hip_bone_length # hips.head[z_cord] = right_leg.head[z_cord] # hips.tail[z_cord] = spine.head[z_cord] # if hips.tail[z_cord] ...
<filename>SparseAMsWithInteractions/src/AMsWithInteractionsL0/optimizer.py from copy import deepcopy from IPython.display import Math from ipywidgets import * import numpy as np import scipy.sparse as sp from scipy.special import comb from sklearn.metrics import mean_squared_error from tqdm import notebook import warni...
completion_callback=writer.get_callback()) assert writer.succeeded() # Ensure that a unset bytedata flag requires bytedata to not be included. with pytest.raises(AssertionError): self.store.update([(tx_hash, tx_data, tx_bytes, TxFlags.Unset)]) @pytest.mark.timeout(8) def test_update__entry_with_magic_bytedata_a...
source = [ TimeSeries('collectd.test-db1.load.value',0,1,1,[range(18)] + [None, None]), ] delay = 2 expectedList = [ TimeSeries('delay(collectd.test-db1.load.value,2)',0,1,1,[None, None] + [range(18)]), ] gotList = functions.delay({}, source, delay) self.assertEqual(len(gotList), len(expectedList)) for got, ex...
totalLinks = 0 externalLinks = 0 m = [] for p in self.soup.find_all("img"): if p.has_attr("src") and "http" in p.get("src")[:4]: m.append(p.get('src')) for p in self.soup.find_all("video"): for q in p.find_all("source"): if q.has_attr("src") and "http" in q.get("src")[:4]: m.append(q.get('src')) for p in ...
<gh_stars>1-10 from flask import Flask, render_template, request, redirect, url_for, jsonify from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user from werkzeug.utils import secure_filename import os import json import mining wi...
self.avatarType == AVATAR_PIRATE: if self.shop == BODYSHOP: self.makeRandomBody() elif self.shop == HEADSHOP: self.makeRandomHead() elif self.shop == MOUTHSHOP: self.makeRandomMouth() elif self.shop == EYESSHOP: self.makeRandomEyes() elif self.shop == NOSESHOP: self.makeRandomNose() elif self.shop == EARSHOP...
super(HyperRangerMod, self).__init__(params, defaults) def __setstate__(self, state): super(HyperRangerMod, self).__setstate__(state) def step(self, display=False, activate_IA=False, closure=None): loss = None if closure is not None: loss = closure() for group in self.param_groups: for p in group['params']...
0.4); }") # / Summary # Action Buttons _AR_action_btns = QtWidgets.QWidget() _AR_action_btns_layout = QtWidgets.QGridLayout() # https://stackoverflow.com/a/33793752/3211506 _AR_action_btns_spacer = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self._AR_retToOri = Q...
not present at the end of name filename = name + (not name.endswith('_')) * '_' + 'data' # prepare arguments for after file open after_file_open_args = {'phase':phase} # call SampleData constructor SampleData.__init__(self, filename=filename, sample_name=name, sample_description=description, verbose=verbose, ove...
# -*- coding:utf-8 -*- """ Copyright 2021 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
# from tff import NUM_EPOCHS from matplotlib import pyplot as plt import json, ast import math import numpy as np import pickle import argparse import pandas as pd import seaborn as sns import collections import tensorflow_federated as tff from tensorflow.python.framework.constant_op import constant NUM_CLIENTS = [5...
<reponame>breakpad/aamo #! /usr/bin/env python import logging import sys import os from datetime import datetime import subprocess as sub import util as u import exception as e import obfuscator_rebuild import obfuscator_defunct import obfuscator_renaming import obfuscator_goto import obfuscator_strin...
x: position measurements (N x 1), could have NaN N: int number of measurements dt: float delta T notNan: bool array indicating timestamps that have measurements lam: given parameter Return: float """ # unpack decision variables xhat = X[:N] offset1 = int((1+order-1)*(order-1)/2) highest_order_dynamics = X[...
<gh_stars>10-100 import argparse import os import sys import shutil import time import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.nn.functional as F import torch.optim import torch.utils.data import torchvision.transforms as transforms import torchvision.da...
mac_address = existing_host.mgmt_mac else: mac_address = None line = self._dnsmasq_host_entry_to_string(address.address, hostname, mac_address) f_out.write(line) # Update host files atomically and reload dnsmasq if (not os.path.isfile(dnsmasq_hosts_file) or not filecmp.cmp(temp_dnsmasq_hosts_file, dnsmasq_hos...
functions.perSecond({}, seriesList) self.assertEqual(expected, result, 'perSecond result incorrect') def test_perSecond_nones(self): seriesList = [TimeSeries('test', 0, 600, 60, [0, 60, None, 180, None, 300, None, 420, None, 540])] expected = [TimeSeries('perSecond(test)', 0, 600, 60, [None, 1, None, 1, None, 1, N...
options for keys: id - The ID of the virtual machine ''' if 'id' not in args: raise RuntimeError("Missing required argument 'id'") return self.request('destroyVirtualMachine', args) def rebootVirtualMachine(self, args={}): ''' Reboots a virtual machine. args - A dictionary. The following are options for key...
) args = ( managed_object, ('Digest', [name_a.attribute_value, name_b.attribute_value]) ) regex = "The Digest attribute is unsupported." six.assertRaisesRegex( self, exceptions.InvalidField, regex, e._set_attribute_on_managed_object, *args ) # Test that a set attribute cannot be overwritten. length = at...
then will load the analyze table. """ return_type = None if type(source_tables) == list: return_type = 'list' elif type(source_tables) == str: # single table (as string) passed... expecting to return full table source_tables = [source_tables] return_type = 'dataframe' elif type(source_tables) == dict: # singl...