input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>anderzzz/fjarrsyn<filename>fjarrsyn/core/agent_ms.py<gh_stars>0 '''Agent Management System ''' from collections.abc import Iterable from collections import OrderedDict from uuid import uuid4 import numpy as np import numpy.random import itertools import networkx as nx from fjarrsyn.core.agent import Agent ...
its vertices. """ pass def setFaceVertexColor(*args, **kwargs): """ setFaceVertexColor(color, faceId, vertexId, modifier=None, rep=kRGBA) -> self Sets a face-specific normal at a vertex. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect u...
<filename>prmaya/scripts/prDeformPaint.py """ SOURCE https://github.com/parzival-roethlein/prmaya DESCRIPTION Modeling brushes, mainly for blendshape targets (similar to DPK_paintDeform.mel) Operations: - Smooth delta: average the delta (vertex vector from target to painted mesh) with its neighbors. Reasons to do so...
import string, re def processpif(file): n = 0 remembern = 0 #used for nested tags while n <> -1: piferr = '' #clear out these fields so they don't carry over. pifelse = '' n = string.find(file, "<pif ", n) if n <> -1: n2 = string.find(file, "</pif>", n) + 6 if n2 <> -1: #right here is where t...
<reponame>alex-bv/envysec import logging import os import pathlib import queue import subprocess # WARNING, POSSIBLE SECURITY ISSUE: Bandit report: 'Consider possible security implications associated with subprocess module.' import threading class ClamAV(): """ ClamAV command class. This is not a stand-alone scanner...
= [] visible_token_buffer = [] first_invis_token = None first_vis_token = None for token in page.tokens: if token.token == PAGE_BEGIN or token.token == PAGE_END: continue if token.visible: if token.whitespace_text and previous_visible: visible_token_buffer.append(' ') visible_token_buffer.append(token.token) ...
"""Common plot functions.""" import logging import os from copy import deepcopy import cartopy.crs as ccrs import iris.quickplot import matplotlib.colors as colors import matplotlib.pyplot as plt import numpy as np import yaml logger = logging.getLogger(__name__) def _process_axes_functions(axes, axes_functions): ...
<filename>py/desitarget/tychomatch.py<gh_stars>0 # Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ ===================== desitarget.tychomatch ===================== Useful Tycho catalog matching and manipulation routines. """ import os import numpy as np import fitsio import r...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. Nidium is currently supporting the following context types: * 2D Context is based on the [2DContext API](http://www.w3.org/html/wg/drafts/2dcontext/html5_canvas/). * A WebGL Context is based on the [WebGL API](ht...
attributes: attributes of dimensions, details, measures and aggregates. Use this method if you need to prepare structures for any kind of query. For attributes for more specific types of queries refer to :meth:`Cube.all_fact_attributes` and :meth:`Cube.all_aggregate_attributes`. .. versionchanged:: 1.1 Returns ...
<gh_stars>0 # The MIT License (MIT) # # Copyright (c) 2015-2017 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights...
"set_project" :param indata: data to be inserted :param kwargs: used to override the indata descriptor :param headers: http request headers :return: _id: identity of the inserted data, operation _id (None) """ try: content = BaseTopic._remove_envelop(indata) # Override descriptor with query string kwargs Base...
<reponame>IRMVLab/ASTA3DConv """ PointNet++ Layers Author: <NAME> Modified by <NAME> Date: November 2019 """ import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append(os.path.join(ROOT_DIR, 'utils')) sys.path.append(os.path.join(ROOT_DIR, 'tf_ops/s...
""" # Signal to the thread that we are reading to stop processing events. self.end_capture.set() # Call CloseTrace to cause ProcessTrace to return (unblock) et.CloseTrace(self.trace_handle) # If ProcessThread is actively parsing an event, we want to give it a chance to finish # before pulling the rug out from u...
#!/usr/bin/env python from __future__ import print_function """ oleobj.py oleobj is a Python script and module to parse OLE objects and files stored into various file formats such as RTF or MS Office documents (e.g. Word, Excel). Author: <NAME> - http://www.decalage.info License: BSD, see source code or documentation o...
import torch from torch import nn from torch.nn import Module import copy import pdb from models.stylegan2.model import EqualLinear, PixelNorm torch.autograd.set_detect_anomaly(False) STYLESPACE_DIMENSIONS = [512 for _ in range(15)] + [256, 256, 256] + [128, 128, 128] + [64, 64, 64] + [32, 32] class Mapper(Module): ...
IDs. (string) -- :type EnvironmentNames: list :param EnvironmentNames: If specified, AWS Elastic Beanstalk restricts the returned descriptions to include only those that have the specified names. (string) -- :type IncludeDeleted: boolean :param IncludeDeleted: Indicates whether to include deleted environmen...
# # python code for building a parser from a grammar # Copyright <NAME>, 1994 # # BUGS: # A bad grammar that has no derivations for # the root nonterminal may cause a name error # on the variable "GoodStartingPlace" # this needs to be modified so the RULEGRAM is loaded from a # compiled representation if available. ...
import os from datetime import datetime, timedelta import pytz import numpy as np import scipy.io as io import utm import yaml from munch import Munch, munchify from scipy.ndimage import median_filter import scipy.signal as sig def loadmat(filename, check_arrays=False, **kwargs): """ Big thanks to mergen on stacke...
""" Tools for converting Cran packages to conda recipes. """ from __future__ import absolute_import, division, print_function import requests import yaml import re import sys from os import makedirs, listdir from os.path import join, exists, isfile, basename, isdir from itertools import chain import subprocess from...
None and not update: message = ("Nodules have already been extracted. " + "Put update argument as True for refreshing") logger.warning(message) return self if nodules_records is not None: # load from record-array self.nodules = nodules_records else: # assume that nodules is supplied and load from it require...
# 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, software # distributed under the Li...
if type in self.__tagset: return self[type] elif default is None: return self.__tagset.new('', type=type) elif isinstance(default, Tag): if check_type and default.type and default.type != type: raise ValueError( f"Could not create new tag object due to type conflicting ({repr(type)} != {repr(default.type)})") e...
#!/usr/bin/env python ################################################################################ # # This file is part of ghmm # # file: HMMEd.py # author: <NAME> # # Copyright (C) 1998-2002, <NAME> # # Contact: <EMAIL> # # Information: http://ghmm.org # # This library is free software; you can redistribute it a...
de la base pour SPMF (indépendent) print('* Calcul des séquences') for niv in dbDiv.keys() : for year in dbDiv[niv].keys() : sqc = [['8888/', '0j0/', ['<0> 8888']]] # indice d'entrée, DMS nulle n = 1 # indice de rang de l'item for j in range(0, len(dbDiv[niv][year])-1) : t = dbDiv[niv][year][j][3] # duree de séj...
<filename>gui/tkgui.py #! /usr/bin/env python3 import logging import base64 import os import shutil import json import urllib.request from .icons import icon_string from tkinter import * from tkinter import filedialog, messagebox, ttk from tkinter import TclError from slib.helpers import InterfaceHelper from data.file...
self._request(query_string) #/api-de-dados/emendas/documentos/{codigo} def documentos_codigo(self, codigo: str, pagina: int): """ Consulta os documentos relacionados à emenda parlamentar pelo código da emenda Parameters ---------- codigo: str Código da emenda pagina: int Página consultada ""...
["h1esc", "hff"] elif window_radius == 128000000: models = ["h1esc_256m", "hff_256m"] else: raise ValueError( "Only window_radius 16000000 (32Mb models) or 128000000 (256Mb models) are supported" ) else: models = custom_models if target: try: if target == True: if window_radius == 16000000: target = ["h1e...
<reponame>finbourne/lusid-sdk-python-generated-preview # coding: utf-8 # flake8: noqa """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.4425 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ from __future__ import absolute_import __version__ = "0.11.44...
<reponame>sergimasot/PycQED_py3 import traceback import logging log = logging.getLogger(__name__) import re import os from copy import deepcopy from pycqed.analysis_v3 import saving as save_mod from pycqed.analysis_v3 import helper_functions as hlp_mod from numpy import array # Needed for eval. Do not remove. search_m...
# // 1 indicates the objection is being raised. # def m_propagate (self, obj, source_obj, description, count, raise_, in_top_thread): if obj is not None and obj != self.m_top: obj = self.m_get_parent(obj) if(raise_): self.m_raise(obj, source_obj, description, count) else: self.m_drop(obj, source_obj, descriptio...
raya=79*'-' archivo=open('impresion.txt','w') archivo.write(head+'\n') archivo.write('Producto:'+str(codigo_prod)+' '+str(descrip_prod)+'\n\n') archivo.write(raya+'\n') archivo.write(titulo+'\n') archivo.write(raya+'\n') for lin in lineas: try: archivo.write(lin+'\n') except: data=string.ljust(str(lin[0]),16...
# -*- coding: utf-8 -*- """ pygments.lexers.templates ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various template engines' markup. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.web import \ PhpLexer, HtmlLexer, XmlLexer,...
<filename>Code/lib/mids_pytorch_model.py import os import numpy as np import matplotlib.pyplot as plt import torch import torch.nn as nn import torchvision.transforms as T import torchaudio import librosa import timm from nnAudio import features def get_wav_for_path_pipeline(path_names, sr): x = [] signal_length = ...
cur.execute("DELETE FROM articles WHERE id = %s", [id]) mysql.connection.commit() cur.close() try: rmtree(r"C:\Users\OSAMA\Desktop\final\static\uploads\users\{}\articles\article{}".format(session['username'], id)) flash('Article Has Been Deleted Successfully', 'success') except: flash('Article Has Been Deleted S...
<gh_stars>0 b = "r n b q k b n r p p p p p p p p".split(" ") + ['.']*32 + "p p p p p p p p r n b q k b n r".upper().split(" ") def newBoard(): b = "r n b q k b n r p p p p p p p p".split(" ") + ['.']*32 + "p p p p p p p p r n b q k b n r".upper().split(" ") def display(): #white side view c , k= 1 ,0 ...
#! /usr/bin/env python # -*- coding : utf-8 -*- import os import glob import random import numpy as np import numpy.ma as ma import const import errors import options import sio from atomtype import AtomType from voronoi import dump import voronoi.numpy.ngbr as NN # import first pyvoro: try: import voronoi.pyvoro.v...
<reponame>dyllllll/tencentcloud-sdk-python # -*- coding: utf8 -*- # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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 Licen...
for the new tally's data. It is important to note that this makes the assumption that the tally data is independently distributed. In most use cases, this is *not* true and may lead to under-prediction of the uncertainty. The uncertainty propagation model is from the following source: https://en.wikipedia.org/wik...
T1 = back_circulant(5) sage: x = isotopism( (0,1,2,3,4) ) sage: y = isotopism(5) # identity sage: z = isotopism(5) # identity sage: T2 = T1.apply_isotopism(x, y, z) sage: _, t1, t2, t3 = tau123(T1, T2) sage: U1, U2 = tau_to_bitrade(t1, t2, t3) sage: assert is_bitrade(U1, U2) sage: U1 [0 1 2 3 4] [1 2 3 4 0] ...
Input tensor, shape = (N x C x H x W) :type input: torch.tensor [FloatTensor] :param out_block: Tensor for skip connection, shape = (N x C x H x W), defaults to None :type out_block: torch.tensor [FloatTensor], optional :param indices: Indices used for unpooling operation, defaults to None :type indices: torch.ten...
"default_kwarg_values": { "row_condition": None, "condition_parser": "pandas", "or_equal": None, "parse_strings_as_datetimes": None, "allow_cross_type_comparisons": None, "ignore_row_if": "both_values_are_missing", "result_format": "BASIC", "include_config": True, "catch_exceptions": False, }, }, "expect_co...
# -*- coding: utf-8 -*- from __future__ import print_function import stmpy import sys import numpy as np import os import matplotlib as mpl #import scipy.interpolate as sin #this is a stupid name for this package... from scipy.interpolate import interp1d import scipy.optimize as opt import scipy.ndimage as snd from s...
import sys import os import pickle import pathlib import argparse from paddle import nn import paddle import yaml from easydict import EasyDict from sklearn.model_selection import train_test_split import numpy as np import seaborn as sns from tqdm.auto import tqdm from termcolor import colored import time from ut...
#!/usr/bin/python # # This script generates summary statistics and raw plots for the data note # associated with the annotations of portrayed emotions in the movie # Forrest Gump. It is intended to serve as a more detailed description # of the employed analysis and aggregation procedures than what is possible # to conv...
# -*- coding: utf-8 -*- """ Authors: <NAME>, <NAME>, <NAME>, and <NAME> IHE Delft 2017 Contact: <EMAIL> Repository: https://github.com/gespinoza/hants Module: hants """ from __future__ import division import netCDF4 import pandas as pd import math from .davgis.functions import (Spatial_Reference, List_Datasets, Clip...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import re from django.db.models import Lookup from django.contrib.postgres.fields import JSONField class FilterTree(object): """ This class exposes methods for parsing a JSONB query from the Django ORM and building a corresponding SQL que...
'Status', 'NumberOfRemainingSuboperations', 'NumberOfCompletedSuboperations', 'NumberOfFailedSuboperations', 'NumberOfWarningSuboperations'] num_of_remaining_sub_ops = dimse_property((0x0000, 0x1020)) """ The number of remaining C-STORE sub-operations to be invoked for this C-GET operation. """ num_of_comple...
atts[0] return self fmt = "(%s %s ANY %s)" op = "=" def __repr__(self): return self.fmt % (self.expr, self.op, self.subq) def __call__(self, assigns, toplevel=0): cached_column = self.cached_column cachable = self.cachable expr = self.expr subq = self.subq att = self.att if cachable: if ...
<reponame>sirrice/dbwipes<filename>dbwipes/server.py import os import re import time import json import md5 import pdb import random import psycopg2 import traceback import numpy as np from functools import wraps from collections import * from datetime import datetime from sqlalchemy import * from sqlalchemy.pool impo...
<filename>books/api/ContactsApi.py #$Id$# from os.path import basename from json import dumps from books.util.ZohoHttpClient import ZohoHttpClient from books.parser.ContactParser import ContactParser from .Api import Api base_url = Api().base_url + 'contacts/' parser = ContactParser() zoho_http_client = ZohoHttpClien...
<gh_stars>0 #============================================================================ """ a library for generating OpenSCAD_ 3D models https://www.github.com/wovo/psml \(c) <NAME> (<EMAIL>) Distributed under the Boost Software License, Version 1.0. .. _OpenSCAD: https://www.openscad.org/ .. _typeguard: https://...
#!/usr/bin/env python import argparse import copy import math import pickle import time from collections import namedtuple import os import numpy as np import pandas as pd import random import ray from ray import tune from eval_model import Query, GenerateQuery, ReportEsts import datasets import torch import torch.n...
files from find_multi_mappers and outputs the uniquely mapping reads files is a list of filenames containing the output of find_multi_mappers output is a prefix you'd like prepended to the file containing the uniquely mapping reads This file will be named as <output>+"_no_multimap_"+<index_num> """ output_sa...
<gh_stars>0 # Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/) # Copyright (c) 2020-2021 <NAME> <<EMAIL>> # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal...
#coding:utf8 #authors : yqq import logging import json from utils import decimal_default,get_linenumber from base_handler import BaseHandler from .proxy import AuthServiceProxy from cashaddress import convert import traceback #设置精度 from decimal import Decimal from decimal import getcontext getcontext().prec = 8 fr...
<gh_stars>1-10 #! /usr/bin/env python # -*- coding: ASCII -*- """ Methods called by the spoca_hfc_processing and spoca_hfc_classes modules. @author: <NAME> (CNRS, LESIA) @modified by: <NAME> (Obs.Paris, LESIA) """ import os import sys import time from datetime import datetime, timedelta import csv import re import cS...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Fri Jul 17 02:02:36 2020 @author: admin """ ##Functions for replication study # Import modules. import pandas as pd import statsmodels.api as sm import numpy as np from scipy import stats from linearmodels import IV2SLS # Get significance asterix. def signific...
from __future__ import print_function import itertools import math import os import random import shutil import tempfile import unittest import uuid import numpy as np import pytest import tensorflow as tf import coremltools import coremltools.models.datatypes as datatypes from coremltools.models import _MLMODEL_FUL...
that has no id (%r)' % child) return child_id def __get__(self, instance, owner=None): # We look up the id only when the attribute is accessed. if instance is None: return self theory_id = getattr(instance, self._private_attr_name) if theory_id is None: return None document = instance.document if document is ...
import re from re import Pattern from typing import NamedTuple, Tuple __all__ = ["hand_translate"] class Rule(NamedTuple): pattern: Pattern replacement: str FLAGS = re.IGNORECASE TRANSLATIONS: Tuple[Rule, ...] = tuple( [ Rule(pattern=re.compile(r"\banak\b", FLAGS), replacement="child"), Rule...
A 24 26.593 32.649 15.425 0.69 9.83 C ATOM 115 N ASP A 25 29.282 30.981 16.182 1.00 6.26 N ATOM 116 CA ASP A 25 30.170 29.863 15.877 1.00 6.70 C ATOM 117 C ASP A 25 30.293 28.915 17.070 1.00 5.34 C ATOM 118 O ASP A 25 30.261 27.691 16.913 1.00 5.81 O ATOM 119 CB ASP A 25 31.553 30.374 15.467 1.00 9.38 C ATOM 120 N GLU ...
import os import random from pygame.locals import * from OpenGL.GLU import * from ModelLoader_UserInterface import* from ModelLoader_ObjLoader import* UI = UserInterface() class Model_main: def __init__(self): self.MDL_list = 0 self.MDL = [] self.MDLH = [] self.MDLS = [] self.app = False self.pos =...
Only 'expirationHours': 36, # time from now to expire 'retentionHours': 12 # time from now to expire } :raises: :class:`~hpe3parclient.exceptions.HTTPBadRequest` - INVALID_INPUT_VV_PATTERN - Invalid volume pattern specified :raises: :class:`~hpe3parclient.exceptions.HTTPNotFound` - NON_EXISTENT_SET - Th...
XXXXX XXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXX XXXXXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXX XXXXXX X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXX XXXXX XXXXXXXXXX XXXXXXXXXX XX XXXXXXX XXXXXXXXXXX XXXX XX XXXXX XXXX XX XXXXXXXX XXXXXXX XXXXXX XXX XXX XXXX...
<filename>boto3_type_annotations_with_docs/boto3_type_annotations/comprehend/client.py from typing import Optional from botocore.client import BaseClient from typing import Dict from botocore.paginate import Paginator from botocore.waiter import Waiter from typing import Union from typing import List class Client(Bas...
fresh-refrigerated, plain, as purchased 20094: [], # Pasta, fresh-refrigerated, plain, cooked 20095: [ "Pasta", "fresh-refrigerated spinach", ], # Pasta, fresh-refrigerated, spinach, as purchased 20096: [], # Pasta, fresh-refrigerated, spinach, cooked 20097: [], # Pasta, homemade, made with egg, cooked 20098: [...
<filename>scandeval/benchmarks/abstract/token_classification.py '''Abstract token classification benchmark''' from transformers import (DataCollatorForTokenClassification, PreTrainedTokenizerBase) from datasets import Dataset, load_metric from functools import partial from typing import Optional, Dict, List import lo...
<filename>cdp_scrapers/scraper_utils.py import json import re from copy import deepcopy from datetime import datetime, timedelta from itertools import filterfalse, groupby from logging import getLogger from pathlib import Path from typing import Any, Dict, List, NamedTuple, Optional, Set import pytz from cdp_backend.d...
L 1.364,6.52\ 3 C 1.335,6.738 \ 1.15,6.898 0.933\ ,6.896 H -0.933 \ C -1.148,6.898 -\ 1.331,6.74 -1.36\ 1,6.526 L -1.524\ ,5.403 C -1.746,\ 5.301 -1.958,5.1\ 78 -2.157,5.034 \ L -3.214,5.46 C \ -3.415,5.539 -3.\ 643,5.457 -3.748\ ,5.269 L -4.68,3\ .657 C -4.79,3.4\ 7 -4.745,3.23 -4\ .574,3.095 l 0.8\ 95,-0.7 c -0.028\ ...
of our managed networks LOG.warning("Lease for unknown network found in " "dnsmasq.leases file: {}".format(columns)) continue interface_name = self._find_local_interface_name( network_type ) self._dhcp_release(interface_name, ip_address, mac_address) except Exception as e: LOG.error("Failed to remove leases fo...
m t6 = t2 ** 2 % self.curve.p # e t7 = t6 ** 2 % self.curve.p # l t8 = t1 + t6 t8 = t8 ** 2 % self.curve.p t8 = t8 - t4 t8 = t8 - t7 t8 = 2 * t8 # s t9 = t5 ** 2 % self.curve.p t9 = (t9 - 2 * t8) % self.curve.p # x(2p) t10 = t8 - t9 t10 = t5 * t10 % self.curve.p t11 = 8 * t7 # 8l t10 = (t10 - t11) % self.c...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sentencepiece as spm import unicodedata import six import logging from malaya.text.function import transformer_textcleaning SEG_ID_A = 0 SEG_ID_B = 1 SEG_ID_P = 0 SEG_ID_Q = 1 SEG_ID_...
#!/usr/bin/env python3 # vim: ft=python:nospell:sta:et:sw=2:ts=2:sts=2 """ ## Breaking bad "I am the one who knocks." .-------. | | -=_________=- ___ ___ |___)=(___| | ### ##### # = # ### - Divide data into regions of bad and better. - Find the least you need to do to nudge things away from bad. ``` Be...
err == '' mo.assert_called() @pytest.mark.unit @pytest.mark.usefixtures("reset_globals") def test_main_ch_add_valid(capsys): """Test --ch-add with valid channel name, and that channel name does not already exist""" sys.argv = ['', '--ch-add', 'testing'] Globals.getInstance().set_args(sys.argv) mocked_channel = M...
<reponame>nikmagini/pilot # Mover.py # Used by runJob and pilot to transfer input and output files from and to the local SE import os import sys import commands import re import urllib from xml.dom import minidom from time import time, sleep from timed_command import timed_command from pUtil import createPoolFileCat...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ----------------------------------------------...
<reponame>gonzalezf/TopicVisExplorer # -*- coding: utf-8 -*- import datetime import random, threading, webbrowser import gensim, pickle, random import gensim_helpers import numpy as np import sklearn import os import pandas as pd import pickle #Descomentar segun la version de python #import pickle5 as pickle import j...
or is_cutting): def move_to(): temp_cursor = get_cursor(handle)[0] handle.insert(temp_cursor, '\n') handle.mark_set(tk.INSERT, temp_cursor) apply_function() window.after(0, move_to) # The delays are necessary to solve complications for text modified by the key after this function fires if not just_f...
#coding:utf_8 import os import json import requests import hashlib from Cryptodome.PublicKey import RSA from Cryptodome.Cipher import PKCS1_OAEP, PKCS1_v1_5 from Cryptodome.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5 from binascii import b2a_hex, a2b_hex from Cryptodome.Cipher import AES from Cryptodome import Random...
from numpy import array def scigrid_2011_01_04_03(): ppc = {"version": '2'} ppc["baseMVA"] = 100.0 ppc["bus"] = array([ [586, 3, 0, 0, 0, 0, 0, 1.0, 0, 220.0, 0, 1.1, 0.9 ], [589, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1, 0.9 ], [590, 2, 0, 0, 0, 0, 0, 1.0, 0, 380.0, 0, 1.1,...
"""Hey ACPlayGames, going through and using your comment format was a pain but I tried my best :hugging:.""" """Functions for retriving schedule and day info of a day in the semester.""" import csv from collections import namedtuple from datetime import date, timedelta from datetime import datetime as dt from datetim...
import os import time import datetime import shutil import requests import re import yaml import base64 import codecs from collections import OrderedDict import logging from flask import current_app, flash, render_template, abort from flask.templating import TemplateNotFound from sqlalchemy.orm.collections import attr...
be added to the resource and made part of this aggregation """ for fl in files_to_add: uploaded_file = UploadedFile(file=open(fl, 'rb'), name=os.path.basename(fl)) new_res_file = add_file_to_resource( resource, uploaded_file, folder=upload_folder, add_to_aggregation=False ) # make each resource file we added ...
<reponame>jingmouren/OpenHGNN import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from . import BaseModel, register_model @register_model('HGSL') class HGSL(BaseModel): r""" Description ----------- HGSL, Heterogeneous Graph Structure Learning fro...
self.fid[grp_path] if res is None: res = grp['delta_time'][0, :].astype(int) else: res = np.append(res, grp['delta_time'][0, :].astype(int)) else: grp_path = PurePosixPath(msm_path, 'OBSERVATIONS') grp = self.fid[str(grp_path)] res = grp['delta_time'][0, :].astype(int) return res def get_instrument_settings...
window_remove_all(self): """Remove all filtering windows.""" self.window_list = [] def window_print_all(self): """Print information of all filter windows to console""" for i in range(len(self.window_list)): window = self.window_list[i] for k in window.keys(): if k == "turbines": str_short = ut.convert_list_to...
nsample, nsimu): ''' Define indices to sample from posteriors. Args: * **nsample** (:py:class:`int`): Number of samples to draw from posterior. * **nsimu** (:py:class:`int`): Number of MCMC simulations. Returns: * **iisample** (:class:`~numpy.ndarray`): Array of indices in posterior set. * **nsample** (:py:cl...
value_new def categorize_vdaoprimet(value): if value == 1: value_new = "Bicuspid valve disease" elif value == 2: value_new = "Congenital (other than bicuspid)" elif value == 3: value_new = "Degenerative- Calcified" elif value == 4: value_new = "Degenerative- Leaflet prolapse with or without annular dilatation...
## CPPN functions and classes # Imports import math import numpy from evolve_soft_2d import utility ################################################################################ class cppn: """The CPPN class object """ def __init__( self, seed: int, mod_n: int, scale: float, hl_n: int, hl_s: int, thre...
from Game.player import Player from pygame import * from Game.const import * class Story: """ Story line class """ def __init__(self, message, treasure, player, screen, fade, maps, sound): self.screen = screen self.message = message self.treasure = treasure self.player = player self.fade = fade se...
# (c) Copyright 2018 SUSE LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
COLUMN_INDEX_ORDINATES or 1 if undefined'%self.get_input_value("useOrdinatesColumn") if key == 'plot': return 'Plot: all heights slopes psd_h psd_s csd_h csd_s. histo_s histo_h acf_h acf_s. Default=%s'%repr(self.get_input_value("plot")) if key == 'summary': return 'gets a summary of all DABAM profiles' return '' ...
0, "outbytes": 0}, 25: {"inbytes": 0, "outbytes": 0}, 30: {"inbytes": 0, "outbytes": 0}, }, 'nn::am::service::ISystemAppletProxy': { 0: {"inbytes": 0, "outbytes": 0, "outinterfaces": ['nn::am::service::ICommonStateGetter']}, 1: {"inbytes": 0, "outbytes": 0, "outinterfaces": ['nn::am::service::ISelfController']}, ...
<filename>setup_scripts/burn_streams.py import os from tabnanny import check import time import pickle # import pandas as pd import numpy as np # import shapely # from shapely.geometry import Polygon, Point import geopandas as gpd import xarray as xr import rioxarray as rxr import rasterio as rio from rasterio impor...
<filename>src/software/decode/ctypeAutoGen.py #!/usr/bin/python3 # -*- coding: utf-8 -*- # *****************************************************************************/ # * Authors: <NAME> # *****************************************************************************/ ''' Brief: ctypeAutoGen.py - Method and Appratus...
<filename>cand/cand.py import numpy as np import pandas as pd import warnings from sklearn import linear_model import scipy.stats, pycasso import matplotlib.pyplot as plt import glmnet, tqdm #import multiprocessing as mp from .utils import GIC, lsIC class candidate_models: def __init__(self, X, y, evaluator='PLIC'...
import mock from twisted.internet import defer from twisted.trial import unittest from oppy.cell.definitions import MAX_RPAYLOAD_LEN from oppy.cell.fixedlen import Create2Cell, DestroyCell, EncryptedCell from oppy.cell.relay import ( RelayDataCell, RelayEndCell, RelayConnectedCell, RelaySendMeCell, RelayExtended...
"""A smart hat guessing Hanabi player. A strategy for 4 or 5 players which uses "hat guessing" to convey information to all other players with a single clue. See doc_hat_player.md for a detailed description of the strategy. The following table gives the approximate percentages of this strategy reaching maximum score (...