input
stringlengths
2.65k
237k
output
stringclasses
1 value
from datetime import datetime, timezone from typing import List, Optional from pathlib import Path import os import configparser import getpass from sqlalchemy import create_engine, func, event, and_, inspect from sqlalchemy.orm import sessionmaker, aliased from fire.api.model import ( RegisteringTidObjekt, Fikspun...
#!/usr/bin/env python3 # # SPDX-License-Identifier: MIT # # This file is formatted with Python Black """ A Parser helper function to convert a byte array to a Python object and the other way around. The conversion is specified in a list of :class:`Spec` instances, for example: >>> data = bytes(range(16)) >>> spec =...
<filename>tests/google/appengine/api/memcache/memcache_unittest.py #!/usr/bin/env python # # Copyright 2007 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.or...
activation actv = activation == 'relu' and (lambda: LeakyReLU(0.0)) or activation == 'elu' and (lambda: ELU(1.0)) or None # vertical 1 c1_1 = Conv2D(filters=filters // 16, kernel_size=(1, 1), padding='same', activation=activation, kernel_initializer='he_normal')(inputs) if version == 'b': c1_2 = NConv2D(filters=...
from flask import Flask, request, render_template, send_file, Response import io import base64 import csv import json import time from collections import OrderedDict import numpy import pandas as pd from numpy import genfromtxt from flask import jsonify from flask_cors import CORS from LoadingNetwork import...
"sollte es" sein. Und "$so$ ist $es$" hier.', u'So "`sollte es"\' sein. Und \\@"`$so$ ist $es$\\@"\' hier.'], [u'Bitte "ACRONYME" berücksichtigen.', u'Bitte "`\\@\\acronym{ACRONYME}"\' berücksichtigen.'], [u'"Altern der DNA"', u'"`Altern der \\@\\acronym{DNA}"\''] ] abbreviation = [ [u'Von 3760 v.Chr. bis 2012 n...
<gh_stars>1-10 # -*- coding: utf-8 -*- # #################################################### # # PRISM - Pipeline for animation and VFX projects # # www.prism-pipeline.com # # contact: <EMAIL> # #################################################### # # # Copyright (C) 2016-2020 <NAME> # # Licensed under GNU GPL-3.0-or-...
<reponame>moniqklimek/training import json import pprint """ TITLE: imagine buy in bookshoop - interaktive fun with User :) ISSUE : help you choose the right item, get to know the User's preferences, i.e. - the thematic category that interests him, the results improved for him, a detailed description of the selected...
used after a database has been created.""" def __init__(self, conn): self.conn = conn def database_name(self): """Returns the name of the connected database.""" sql = ("SELECT catalog_name\n" + "FROM information_schema.information_schema_catalog_name;") with self.conn.cursor() as curs: curs.execute(sql) d...
#!/usr/bin/env python # coding: utf-8 # this code is a modification of: # notes: # todo : I canceled the randomize weights for the last layer + freezed the weights for all of the layers (some weights were trained anyway). #todo : mayb -- save to fule during evaluate function the outputs # **Outline of Steps** # + Init...
_ida_hexrays.hx_boundaries_insert hx_boundaries_erase = _ida_hexrays.hx_boundaries_erase hx_boundaries_clear = _ida_hexrays.hx_boundaries_clear hx_boundaries_size = _ida_hexrays.hx_boundaries_size hx_boundaries_free = _ida_hexrays.hx_boundaries_free hx_boundaries_new = _ida_hexrays.hx_boundaries_new hx_block_chains_beg...
<reponame>mondO/pymtl3<filename>pymtl3/dsl/test/Slicing_test.py<gh_stars>1-10 """ ======================================================================== Slicing_test.py ======================================================================== Author : <NAME> Date : Aug 23, 2018 """ from pymtl3.datatypes import Bits2,...
# coding: utf-8 """***************************************************************************** * Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries. * * Subject to your compliance with these terms, you may use Microchip software * and any derivatives exclusively with Microchip products. It is your * re...
"""Utility functions to support DU437 activities. Authors ------- <NAME> """ import copy import os from astropy.table import Table from astropy.time import Time import numpy as np import pylab as pl from .. import gaia_astrometry, pystrometry try: from helpers.table_helpers import plot_columns_simple except Im...
# -*- coding: utf-8 -*- """ *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, ...
<gh_stars>1-10 #!/usr/bin/env python """SeqAn documentation raw object representation. This is the direct representation as it can be determined from the embedded Doxygen-style comments without the interpretation of commands within clauses and cross-linking. """ import textwrap import dox_tokens import raw_doc class...
denied.'), 'error') return redirect(return_url) if export_type == 'csv' or export_type == 'tsv': return self._export_csv(return_url, export_type) else: return self._export_tablib(export_type, return_url) def _export_csv(self, return_url, export_type): """Export a CSV or tsv of records as a stream.""" delimite...
<gh_stars>0 """ This is a module holding the rule network class """ import logging import matplotlib.pyplot as plt import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.metrics import accuracy_score from sklearn.preprocessing import LabelBinarizer from sklearn.utils import shuffle fro...
<filename>application/pages/volume_profile_analysis/volume_profile_analysis.py """This example app demonstrates how to use Panel and the HoloViews ecosystem to analyze Volume Profiles as described in the [How to Analyze Volume Profiles With Python Blog Post]\ (https://medium.com/swlh/how-to-analyze-volume-profiles-wi...
<filename>robot/Link.py """ Link object. @author: <NAME> @copyright: <NAME> """ from numpy import * from .utility import * from .transform import * import copy import numpy as np import math import time class Link: """ LINK create a new LINK object A LINK object holds all information related to a robot link suc...
from __future__ import print_function from math import pi import torch import torch.nn as nn import torch.nn.parallel import torch.utils.data from torch.autograd import Variable import numpy as np import torch.nn.functional as F import sys import softpool as sp sys.path.append("../expansion_penalty/") import expansion_...
import sqlite3 from sqlite3 import Error class StoringData: __instance = None @staticmethod def getInstance(): # Static access method. if StoringData.__instance == None: StoringData() return StoringData.__instance def __init__(self): # init method or constructor # Virtually private constructor. if Stori...
<gh_stars>10-100 import os import sys import re import ast from heapq import nlargest import matplotlib import matplotlib.pyplot as plt from matplotlib.lines import Line2D from matplotlib.patches import Rectangle, Circle, PathPatch, Path import numpy as np import scipy.interpolate import tkinter as tk import cv2 import...
context): ConvertedObj = Ue4SubObj_set("SK_Socket") if len(ConvertedObj) > 0 : self.report({'INFO'}, str(len(ConvertedObj)) + " object(s) of the selection have be converted to to UE4 Socket." ) else : self.report({'WARNING'}, "Please select two objects. (Active object is the owner of the socket)") r...
w1 = {linear_regression.coef_[0]:.2f}, " f"best intercept: w0 = {linear_regression.intercept_:.2f}" ) # %% [markdown] # It is important to note that the model learnt will not be able to handle # the non-linear relationship between `x` and `y` since linear models assume # the relationship between `x` and `y` to be lin...
import numpy as np import cv2 import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions.categorical import Categorical import torch_ac class BasicFCModel(nn.Module): """ Fully connected Actor-Critic model. Set architecture that is smaller and quicker to train. Designed for defa...
") if dl == 'y' or dl == 'Y': os.system("curl -L http://lowelab.ucsc.edu/software/tRNAscan-SE.tar.gz -o trnascan.tar") os.system("tar xvf trnascan.tar") os.system("mv tRNAscan-SE-1.3.1 ./Utilities/cpp/%s%s-%s%strnascan"%(os.sep, OSTYPE, MACHINETYPE, os.sep)) os.chdir("./Utilities/cpp/%s%s-%s%strnascan"%(os.sep, OS...
= self.imgStdSize[1]//2 + width//2 #print(xlim_1, xlim_2, ylim_1, ylim_2) #print("Image shape:", image.shape) background[xlim_1 : xlim_2, ylim_1: ylim_2] = image return {'props': blobProperties, 'image': background} def getFileNumber(self, filename): return int(filename.split('.')[0].split('/')[-1]) # From...
<gh_stars>0 import torch.nn as nn import torch import os from function import adaptive_instance_normalization as adain from function import calc_mean_std # from torch.utils.serialization import load_lua import numpy as np def load_param_from_t7(model, in_layer_index, out_layer): out_layer.weight = torch.nn.Parameter...
#!/usr/bin/env python import os import sys import argparse import subprocess # nosec import re import fnmatch import json import urllib from urllib.parse import urlencode from urllib.request import Request, urlopen env = os.environ class BColors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGRE...
options. :raise: :class:`com.vmware.vapi.std.errors_client.InvalidArgument` If the given spec and/or option contains error. """ task_id = self._invoke('check$task', { 'spec': spec, 'options': options, }) task_svc = Tasks(self._config) task_instance = Task(task_id, task_svc, type.VoidType()) return task_inst...
"""defines various GUI unit tests""" import os import shutil import unittest import numpy as np try: import matplotlib.pyplot as plt IS_MATPLOTLIB = True except ImportError: IS_MATPLOTLIB = False import pyNastran from pyNastran.gui.utils.load_results import ( load_csv, load_deflection_csv, load_user_geom, create_...
字幕&加油添醋 by TY\'s Allen | 感謝heylisa00cavey1001同學熱情提供梗及翻譯', 'uploader': '孫ᄋᄅ', 'title': '[A-made] 變態妍字幕版 太妍 我就是這樣的人', }, }, { 'url': 'https://vid.plus/FlRa-iH7PGw', 'only_matching': True, }, { 'url': 'https://zwearz.com/watch/9lWxNJF-ufM/electra-woman-dyna-girl-official-trailer-grace-helbig.html', 'only_matchi...
def library_config_path(self): """ The library Config path. :return: The library config directory :rtype: str """ if self._options is not None: return self._options.config_path else: return None @property def library_user_path(self): """ The library User path. :return: The user directory to store user...
# # # A class to parse HDF5 based NeuroML files. # Calls the appropriate methods in DefaultNetworkHandler when cell locations, # network connections are found. The DefaultNetworkHandler can either print # information, or if it's a class overriding DefaultNetworkHandler can create # the appropriate network in a simulato...
# Copyright 2016 The TensorFlow Authors. 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 ...
<gh_stars>100-1000 # Copyright (c) 2014 Dell Inc. # # 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...
histogram title hist_title = stats_font.render('GUESS DISTRIBUTION', True, white, background) statsRectHist = hist_title.get_rect() statsRectHist.center = (width // 2, height - 150) # histogram labels and locations hist_font = pygame.font.Font('freesansbold.ttf', 11) # labels hist_label1 = hist_font.ren...
# -*- coding: utf-8 -*- """ Created on Sun Feb 23 18:14:28 2020 @author: zhang """ import random import requests import json import time import re import os import traceback from collections import OrderedDict from requests.adapters import HTTPAdapter from tqdm import tqdm from threading import Thread,...
frame folder loaded first if not self.frames_folder: tkMessageBox.showinfo(title = "Warning", message = "Load video frames directory first") return if self.label_number == 0: tkMessageBox.showinfo(title = "Warning", message = "Can not extract while label is 0") return # check if there is annotated model for th...
<reponame>NiclasEriksen/rpg_procgen import math import random from functions import * from spanning_tree import get_connections import gridmancer import numpy as np from collections import Counter import jsonpickle # For saving the dungeon class DungeonGenerator: def __init__(self, logger, config=None): self.logge...
# import dash IO and graph objects from dash.dependencies import Input, Output # Plotly graph objects to render graph plots import plotly.graph_objects as go import plotly.express as px from plotly.subplots import make_subplots # Import dash html, bootstrap components, and tables for datatables from dash import html ...
<gh_stars>10-100 # Copyright (c) 2020 - 2021 Open Risk (https://www.openriskmanagement.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation...
Ang.) #""" This will make that the X-axis in the resolution plots has units 1/Angstrom #""" #ResolSam=9.6 # ## {expert} Display resolution? #DisplayResolution=False # ##----------------------------------------------------------------------------- ## {section} Low-pass filtering ##---------------------------------------...
from threading import Thread import pandas import matplotlib.pyplot as plt import shutil import os import subprocess import time from django.template import loader import signal from django.http import HttpResponse from django.shortcuts import render, redirect import re threads=[] stop=False proc1 = None live_flag=0 ...
TexMobject("\\over \\,") frac_line.stretch_to_fit_width(numerator.get_width()) frac_line.next_to(numerator, DOWN) denominator = TextMobject("(Num. samples)") denominator.next_to(frac_line, DOWN) self.play(ShowCreation(v_lines, run_time = 3)) self.wait() self.play( ReplacementTransform( v_lines.copy(), summed...
function parameter or return value." "\nFunction annotations are usually used for type hints: for example, this function is \n" "expected to take two int arguments and is also expected to have an int return value:" "\ndef sum_two_numbers(a: int, b: int) -> int:\n return a + b\nFunction annotation \n" "syntax is exp...
copy.deepcopy(subnet) subnet_request["subnet"]["dns_nameservers"] = dns_nameservers subnet_request["subnet"]["gateway_ip"] = gateway_ip res = self.plugin.create_subnet(self.context, subnet_request) self.assertEqual(subnet_create.call_count, 1) self.assertEqual(dns_create.call_count, 0) self.assertEqual(route_crea...
on raster: " + self.raster_info_lf) try: max_lf = float(max(self.lifespans)) self.logger.info(" * max. lifespan: " + str(max_lf)) except: max_lf = 50.0 self.logger.info( " * using default max. lifespan (error in input.inp definitions): " + str(max_lf)) temp_ras_base = Con((IsNull(self.raster_dict_lf[sel...
<filename>hoa_chargen.py<gh_stars>0 # # Heroes of Aegypt! Character Generator # ########################################### """ HOA Chargen 0.0.1 Beta ----------------------------------------------------------------------- This program generates characters for the Expedition to Ancient Aegypt! RPG. """ from PyQt5.Qt...
<gh_stars>10-100 import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models from torchvision.ops import RoIAlign, RoIPool, nms import numpy as np from utils.config import cfg from nets.generate_anchors import generate_anchors_pre from nets.proposal_layer import proposal_la...
<filename>external/metadata/factory.py # -*- coding: iso-8859-1 -*- # ----------------------------------------------------------------------------- # factory.py # ----------------------------------------------------------------------------- # $Id$ # # --------------------------------------------------------------------...
# Licensed under a 3-clause BSD style license - see LICENSE ''' This module provides the framework for grouping sources from two photometric catalogues into distinct "islands" of sources, along with calculating whether they are within overlap for various photometric integral purposes. ''' import sys import os import n...
<reponame>LaudateCorpus1/oci-ansible-collection #!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.tx...
Worker", "Composer Or Musician": "Singer", "Computer Programming": "Technologist", "Computer Support Technician": "Technologist", "Counseling": "Counselor", "Counselor": "Counselor", "Dentist": "Health Worker", "Designer": "Artist", "Detectives": "Detective", "Doctor": "Health Worker", "Electrician": "Mechani...
# Author: SiliconSloth 18/1/2018 from threading import Thread, Timer import numpy as np import cPickle, serial, os, time, subprocess import cv2 # PyCharm seems to need this to work properly. # try: # from cv2 import cv2 # except: # pass # This script is responsible for actually driving the robot automat...
y_)) optimizer = tf.train.GradientDescentOptimizer(learning_rate=0.01) train_op = optimizer.minimize(loss, name='train') init = tf.global_variables_initializer() # Creating a tf.train.Saver adds operations to the graph to save and # restore variables from checkpoints. saver_def = tf.train.Saver().as_saver_def ...
E501 raise ApiValueError("Missing the required parameter `function_type` when calling `archive_by_function_type`") # noqa: E501 # verify the required parameter 'app_id' is set if self.api_client.client_side_validation and ("app_id" not in local_var_params or local_var_params["app_id"] is None): # noqa: E501 # noqa: ...
from application.notification import IObserver, NotificationCenter from application.python import Null from application.python.types import Singleton from datetime import timedelta from sipsimple.account import Account, AccountManager from sipsimple.application import SIPApplication from sipsimple.audio import WavePla...
<reponame>oponcea/ceph-uprev-stx-config # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2018 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # # All Rights Reserved. # """ System Inventory Kubernetes Application Operator.""" import docker import grp import os import pwd import re import...
_svalue += '-' total_seconds *= -1 else: _svalue += '+' hours = total_seconds // 3600 minutes = (total_seconds - (hours * 3600)) // 60 _svalue += '{0:02d}:{1:02d}'.format( hours, minutes) except AttributeError: pass return _svalue @classmethod def gds_parse_date(cls, input_data): tz = None if input_data[-...
is systematically present in the list of # ordering fields so we can guarantee a deterministic order across all # database backends. pk_name = self.lookup_opts.pk.name if not (set(ordering) & {'pk', '-pk', pk_name, '-' + pk_name}): # The two sets do not intersect, meaning the pk isn't present. So # we add it. or...
""" ----------------------------------------------- EE2703: Applied Programming Lab (Jan-May 2020) Assignment: Final Exam Name: <NAME> Roll no.: EE18B122 ----------------------------------------------- """ # imports import sys from scipy.linalg import lstsq import numpy as np import matplotlib.pyplot as plt import ma...
import os import time import tkinter import sqlite3 import json import smtplib import locale import requests import threading import html2text as h2t from tkinter import * from tkinter.ttk import * from tkinter import filedialog from tkinter import messagebox from email import encoders from email.mime.text import MIMET...
= mutant_to_letter_pos_idx_focus_list[mutant] mut_aa = mutant[-1] focus_seq_copy[idx_focus] = mut_aa return focus_seq_copy print("Getting mutated sequences") # First sequence is the wt sequence mutant_sequences = [list(self.focus_seq_trimmed)[:]] valid_mutants = ['wt'] # df_input.apply(lambda row: get_mutated...
"""Association testing""" from datetime import datetime from io import BytesIO import logging import os from pathlib import Path import queue import socket import sys import time import threading import pytest from pydicom import dcmread from pydicom.dataset import Dataset, FileMetaDataset from pydicom.uid import ( ...
<reponame>WithPrecedent/amos<gh_stars>0 """ mappings: extensible, flexible, lightweight dict-like classes <NAME> <<EMAIL>> Copyright 2021, <NAME> License: 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...
<reponame>Nexuscompute/inplace """ In-place file processing The ``in_place`` module provides an ``InPlace`` class for reading & writing a file "in-place": data that you write ends up at the same filepath that you read from, and ``in_place`` takes care of all the necessary mucking about with temporary files for you. V...
file containing Semi-Empirical building inventory data in an HDFContainer. (described in __init__). :param collapse_file: HDF5 file containing Semi-Empirical collapse rate data in an HDFContainer. (described in __init__). :param casualty_file: HDF5 file containing Semi-Empirical casualty rate data in an HDFContaine...
<gh_stars>0 import json import logging import pytz from typing import List from datetime import datetime from enum import Enum from fastapi import BackgroundTasks from sqlalchemy.orm import Session from dispatch.database import SessionLocal from dispatch.decorators import background_task from dispatch.messaging impor...
np.conj(Ylms[pair1]) * Ylms[pair2] term2b += F[det]*F[det]*Ylms[pair1]*Ylms[pair2]*crossTermsV[(pair1,pair2)] #((-1)**pair1[0])*crossTerms[det][((pair1[0],-pair1[1]),pair2)] term2a = -np.real(term2a) / 4. /(distMpc/distMpcRef)**2 term2b = -term2b/4./(distMpc/distMpcRef)**2 # coefficient of exp(-4ipsi) term1 = 0. ...
from . import ClientImageHandling from . import ClientParsing from . import ClientPaths from . import ClientRendering from . import ClientSearch from . import ClientServices from . import ClientThreading from . import HydrusConstants as HC from . import HydrusExceptions from . import HydrusFileHandling from . import Hy...
log1mX - self.Z) return ret def CDF(self,x): if math.isnan(x): return float("nan") elif (x <= 0.0): return 0.0 elif (x >= 1.0): return 1.0 else: return incompleteBetaFunction(x,self.alpha,self.beta) def QF(self,p): if math.isnan(p): return float("nan") elif (p > 1.0) or (p < 0.0): raise PFARuntimeExcep...
- reprojection # reproject longitude to the landsat projection and save as tiff file lon_rep, ulx_dem, lry_dem, lrx_dem, uly_dem, epsg_to = SEBAL.reproject_dataset(lon_fileName, pixel_spacing, UTM_Zone=UTM_Zone) # Get the reprojected longitude data lon_proy = lon_rep.GetRasterBand(1).ReadAsArray(0, 0, ncol, nr...
<filename>dist/weewx-4.4.0/bin/weeimport/weeimport.py # # Copyright (c) 2009-2019 <NAME> <<EMAIL>> and # <NAME> # # See the file LICENSE.txt for your full rights. # """Module providing the base classes and API for importing observational data into WeeWX. """ from __future__ import with_statement from __future__ impor...
import os import json import boto3 import time import requests import pyotp import logging import random from datetime import datetime from requests.exceptions import HTTPError from requests.exceptions import ConnectionError from ask_sdk_core.skill_builder import SkillBuilder from ask_sdk_core.dispatch_components imp...
is None: self.name = f"js-{self.filename.replace('_', '-')}" class _WebEngineScripts(QObject): def __init__(self, tab, parent=None): super().__init__(parent) self._tab = tab self._widget = cast(QWidget, None) self._greasemonkey = greasemonkey.gm_manager def connect_signals(self): """Connect signals to our p...
262.4, 265.5, 289.1], [289.5, 264.5, 275.2, 256.3, 259.8, 290.0, 260.7, 272.7], [281.6, 278.4, 266.6, 264.4, 264.6, 264.2, 281.8, 271.2], [285.1, 282.4, 289.6, 262.2, 285.0, 273.2, 257.9, 280.2], [290.3, 284.4, 299.6, 266.6, 261.0, 273.5, 274.5, 284.6], ], [ [270.8, 282.5, 290.8, 266.6, 285.0, 275.8, 290.5, 268....
Element) -> None: self.body.append(r'\sphinxoptional{') def depart_desc_optional(self, node: Element) -> None: self.body.append('}') def visit_desc_annotation(self, node: Element) -> None: self.body.append(r'\sphinxbfcode{\sphinxupquote{') def depart_desc_annotation(self, node: Element) -> None: self.body.app...
wx.stc.STC_ADA_STRING wxSTC_ADA_STRINGEOL = wx.stc.STC_ADA_STRINGEOL wxSTC_ADA_LABEL = wx.stc.STC_ADA_LABEL wxSTC_ADA_COMMENTLINE = wx.stc.STC_ADA_COMMENTLINE wxSTC_ADA_ILLEGAL = wx.stc.STC_ADA_ILLEGAL wxSTC_BAAN_DEFAULT = wx.stc.STC_BAAN_DEFAULT wxSTC_BAAN_COMMENT = wx.stc.STC_BAAN_COMMENT wxSTC_BAAN_COMMENTDOC = wx.s...
<gh_stars>1-10 # # Copyright (c) 2022 <NAME> # # MIT License - See LICENSE file accompanying this package. # """ Implementation of CloudInitDoc, a container that can render cloud-init user-data documents that are single-part or multi-part. """ from base64 import b64encode from typing import Optional, List, Union fro...
given user. Parameters ---------- conn : Connection The database connection to use. user : DBUser or int The linked user to search for. May be a `DBUser` object or an `int` referring to a user ID. """ try: user_id = user.id except AttributeError: user_id = int(user) async with conn.cursor() as cur: await...
of a certain size. For use during # CDDL parsing. def set_size_range(self, min_size, max_size): if min_size == max_size: return self.set_size(min_size) elif min_size > max_size: raise TypeError( "Invalid size range (min %d, max %d)" % (min_size, max_size)) else: self.set_size(None) self.set_min_size(min_size...
2*mckin**2*q_cut + q_cut**2)/mbkin**4)))**2)/mbkin**4 - (8640*mckin**8*((mbkin**4 - 2*mbkin**2*mckin**2 + mckin**4 - 2*mbkin**2*q_cut - 2*mckin**2*q_cut + q_cut**2)/mbkin**4)**(3/2)*(72*mckin**2*muG - (144*mckin**4*muG)/mbkin**2 - (432*mckin**6*muG)/mbkin**4 - (36*mckin**2*muG**2)/mbkin**2 + (72*mckin**4*muG*...
from abc import ABC, abstractmethod from copy import deepcopy import numpy as np import tensorflow as tf # source: http://geomalgorithms.com/a06-_intersect-2.html # source: https://www.erikrotteveel.com/python/three-dimensional-ray-tracing-in-python/ gpu_phy_devices = tf.config.list_physical_devices('GPU') try: for ...
from __future__ import print_function from itertools import chain from math import log from .utility import init_matrix, init_3d_matrix class HiddenMarkovModel: """ Notation used: HMM: Hidden Markov Model O: Observation sequence S: Hidden state sequence A: State transition probability distribution matrix B: O...
#!/usr/bin/python from krrt.utils import get_opts, write_file from krrt.planning.strips.representation import parse_problem, generate_action, Action from krrt.planning import parse_output_FF, parse_output_popf, parse_output_ipc from krrt.sat.CNF import OptimizedLevelWeightedFormula from linearizer import count_linear...
# Copyright (c) 2016 Iotic Labs Ltd. 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 # # https://github.com/Iotic-Labs/py-IoticAgent/blob/master/LICENSE # # Unless requir...
<filename>psyneulink/library/components/mechanisms/processing/objective/predictionerrormechanism.py # Princeton University licenses this file to You 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...
= angle, s_s = s_s, w_text = w_text, font = font) self.collection = [] self.changeFlag = True self.enumerator_p() self.kill() #ДАТЬ ПАРАМЕТРЫ ОБЪЕКТА def get_conf(self, obj): return get_conf.get_conf(obj, graf) def get_circle_conf(self, obj): return get_conf.get_circle_conf(obj, graf) def get_arc_conf(sel...
9 or bufsz) def fileno(self): return self.f.fileno() def _write_header(self, pkt): self.header_present=1 if self.linktype == None: if type(pkt) is list or type(pkt) is tuple: pkt = pkt[0] self.linktype = LLNumTypes.get(pkt.__class__,1) if self.append: # Even if prone to race conditions, this seems to ...
# constants.py # Copyright 2010, 2020 <NAME> # Licence: See LICENCE (BSD licence) """Constants for Portable Game Notation (PGN) parser. The defined constants are used when parsing PGN and FEN text, and when checking the PGN game score represents a legal sequence of moves and variations. """ # r'(?:([a-h])x)?(([a-h]...
__all__", "undefined-all-variable", "Used when an undefined variable name is referenced in __all__.", ), "E0604": ( "Invalid object %r in __all__, must contain only strings", "invalid-all-object", "Used when an invalid (non-string) object occurs in __all__.", ), "E0605": ( "Invalid format for __all__, must be...
to use a proxy mesh.""" mod = False m_count = len(ob.modifiers) if m_count > 0: show = np.zeros(m_count, dtype=np.bool) ren_set = np.copy(show) ob.modifiers.foreach_get('show_render', show) ob.modifiers.foreach_set('show_render', ren_set) mod = True #v_count = len(mesh.vertices) #normal = np.zeros(v_count * ...
# coding: utf-8 # 我觉得变量太多的alpha factor我暂时搁置,以及我觉得rank函数比较奇怪,因为range太大了,是否需要设置一个窗口呢? # # # ## Dropped Index: # - Alpha30(要用到fama三因子) # - Alpha75(要用到BENCHMARKINDEX) # - Alpha143(要用到SELF函数) # - Alpha149(要用到BENCHMARKINDEX) # - Alpha181(要用到BENCHMARKINDEX) # - Alpha182(要用到BENCHMARKINDEX) ### 对于:?较为复杂的表达式,我都先用一些中间变量存储中间...
import re from flaski import app from flask_login import current_user from flask_caching import Cache from flaski.routines import check_session_app import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as db...
<filename>Generate Files/template.py #template.py module import tkinter as tk from tkinter import ttk import tkinter.filedialog from tkinter import messagebox from pandas import concat, read_csv from style import window_style, LayoutManager, check_size from dragdrop import SourceDragManager, TargetDragManager import ...
'61875269':{'en': 'Meningie East'}, '61875270':{'en': 'Mypolonga'}, '61875271':{'en': 'New Well'}, '61875272':{'en': 'Parndana'}, '61875273':{'en': 'Paruna'}, '61875274':{'en': 'Peebinga'}, '61875275':{'en': 'Penneshaw'}, '61875276':{'en': 'Robertstown'}, '61875277':{'en': 'Sanderston'}, '61875278':{'en': 'San...
| B) == not A & not B # not (A & B) == not A | not B def primitive_datatypes(): # int, 32 bit 10 # long Intiger > 32bits 10L # float 10.0 # complex 1.2j # bool True, False # str "mystr" # tuple (immutable sequence) (2,4,7) # list (mutable sequence) [2,x,3.1] # dict (Mapping) {x:2, y:2} pass def math_ops()...
crc32(filename, slice = OneM): with open(filename, "rb") as f: buf = f.read(slice) crc = binascii.crc32(buf) while True: buf = f.read(slice) if buf: crc = binascii.crc32(buf, crc) else: break return crc & 0xffffffff def enable_http_logging(): httplib.HTTPConnection.debuglevel = 1 logging.b...