input
stringlengths
2.65k
237k
output
stringclasses
1 value
= msgbox.exec_() if result ==QtWidgets.QMessageBox.Cancel: return if thread is True: self.worker_task.emit({'fcn': self.save_project, 'params': [filename]}) else: self.save_project(filename) # self.save_project(filename) self.file_opened.emit("project", filename) self.file_saved.emit("project", filename) ...
[], # Pickles, cucumber, dill, reduced sodium 11948: [], # Pickles, cucumber, sweet, low sodium (includes bread and butter pickles) 11949: [], # Catsup, low sodium 11950: ["Enoki mushroom"], # Mushrooms, enoki, raw 11951: ["Yellow pepper", "sweet"], # Peppers, sweet, yellow, raw 11952: ["Radicchio"], # Radicchio, ...
#!/usr/bin/env python # This will (hopefully) be the code to extract symmetry operations # from Hall symbols import numpy as np lattice_symbols = { 'P': [[0, 0, 0]], 'A': [[0, 0, 0], [0, 1./2, 1./2]], 'B': [[0, 0, 0], [1./2, 0, 1./2]], 'C': [[0, 0, 0], [1./2, 1./2, 0]], 'I': [[0, 0, 0], [1./2, 1./2, 1./2]], 'R...
Called from parser_thread(). """ if not self.s.serial_read(): # read all available data from serial port self.disable_receiver() return if len(self.s.rx_buff): # if rx buffer is not empty if self.__rx_state == _SDP_RX_IDLE: self.__search_for_sof() elif self.__rx_state == _SDP_RX_ACK: self.__search_for_ack() ...
import datetime as dt import json import logging import tempfile from copy import copy from pathlib import Path from typing import Callable from typing import Dict from typing import List from typing import Optional from typing import Tuple import numpy as np from osgeo import gdal from te_schemas import land_cover fr...
= None, aad_tenant_id: Optional[str] = None, super_user: Optional[str] = None, website_name: Optional[str] = None, **kwargs ): """ :keyword additional_properties: Unmatched properties from the message are deserialized to this collection. :paramtype additional_properties: dict[str, any] :keyword qna_runtime_en...
<gh_stars>0 # coding=utf-8 import calendar import csv import hashlib import httplib import json import os import time from multiprocessing import Process import datetime from openpyxl import load_workbook from scrapy import cmdline class SpiderProcess(Process): def __init__(self, cmd): Process.__init__(self) self...
range 0.0 to ' '1.0 if "relative_boundaries" are True') else: if 'p1' in mask_data: if ( isinstance(mask_data['p1'], list) and len(mask_data['p1']) == 2 and isinstance(mask_data['p1'][0], int) and isinstance(mask_data['p1'][1], int)): mask.p1 = mask_data['p1'] else: loading_warning = ( '"p1" property must b...
:raise: :class:`com.vmware.vapi.std.errors_client.ServiceUnavailable` Service Unavailable :raise: :class:`com.vmware.vapi.std.errors_client.InvalidRequest` Bad Request, Precondition Failed :raise: :class:`com.vmware.vapi.std.errors_client.InternalServerError` Internal Server Error :raise: :class:`com.vmware.va...
<reponame>dutrow/crits from crits.vocabulary.vocab import vocab class Common(vocab): READ = "read" WRITE = "write" DELETE = "delete" DOWNLOAD = "download" ALIASES_READ = "aliases_read" ALIASES_EDIT = "aliases_edit" DESCRIPTION_READ = "description_read" DESCRIPTION_EDIT = "description_edit" AC...
<gh_stars>1-10 # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause import pytest import numpy as np from scipy import sparse from scipy import linalg from sklearn.utils._testing import assert_array_almost_equal from sklearn.utils._testing import assert_array_equal from sklearn.utils....
'method': 'call', 'params': {'service': service_name, 'method': method, 'args': args}, 'id': '%04x%010x' % (os.getpid(), (int(time.time() * 1E6) % 2**40)), } resp = http_post(url, json.dumps(data).encode('ascii')) if resp.get('error'): raise ServerError(resp['error']) return resp['result'] class partial(functo...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import os import os.path import copy import spack.util.environment class Cp2k(MakefilePackage, CudaPackage): """CP2K i...
<gh_stars>0 # -*- coding: utf-8 -*- """ This project analyzes the control approach for Optima pumps, based on the competitor's algorithm It uses the data from the prototype tests, fits a curve with two different approach and plots them on a graph """ import Database as db import math import numpy as np import matplot...
<gh_stars>1-10 #!/usr/bin/python # # Copyright (C) 2010-2021 <NAME>, Maerki Informatik # License: Apache License v2 # # Siehe http://www.maerki.com/hans/orux # # History: # 2010-06-22, <NAME>, Implementiert # 2010-06-23, <NAME>, Koordinaten der Karte Massstab 1:50000 angepasst. # 2011-01-17, <NAME>, Neu koen...
------- collected : `bytes` Raises ------ ValueError If `n` is given as a negative integer. EofError Connection lost before `n` bytes were received. CancelledError If the reader task is cancelled not by receiving eof. """ if n < 1: if n < 0: raise ValueError(f'.read_exactly called with negative `n`: {n!r...
this method will get the packet, takes what does need to be taken and let the remaining go, so it returns two values. first value which belongs to this field and the second is the remaining which does need to be dissected with other "field classes". @param pkt: holds the whole packet @param s: holds only the rema...
to_gregorian(islam_year, 12, 10) if y == year: self[date(y, m, d)] = "Feast of the Sacrifice" # Last Monday of August. c = Calendar(firstweekday=MONDAY) monthcal = c.monthdatescalendar(year, 8) # all dates in August in full weeks. for i in range(1, len(monthcal) + 1): if monthcal[-i][0].month == 8: # checks if...
<gh_stars>0 import sys import random, pdb, math, pickle, glob, time, os, re import torch import numpy as np from natsort import natsorted class DataLoader: def __init__(self, fname, opt, dataset='simulator', single_shard=False, all_batches=False, randomize=True): if opt.debug: single_shard = True self.opt = opt ...
method is called asynchronously, returns the request thread. """ all_params = ['id', 'nk', 'refresh'] all_params.append('callback') all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword...
kg/m3 Args: value (float): value for IDD Field `Moisture Content 4` Raises: ValueError: if `value` is not a valid value Returns: float: the value of `moisture_content_4` or None if not set """ return self["Moisture Content 4"] @moisture_content_4.setter def moisture_content_4(self, value=None): """Corre...
a difference? """ after_b = """\ Americans live in the most severe weather-prone country on Earth. Each year, Americans cope with an average of 10,000 thunderstorms, 2,500 floods, 1,000 tornadoes, as well as an average of 6 deadly hurricanes. Potentially deadly weather impacts every American. Communities can now rel...
= start_time_msecs if self._get_tz_str_from_epoch('start_time_msecs', start_time_msecs, action_result) is None or self._get_tz_str_from_epoch( 'end_time_msecs', end_time_msecs, action_result) is None: self.debug_print("Error occurred in tz_str conversion from epoch for 'start_time_msecs' and 'end_time_msecs'. Error...
'Restall') if others: #print('here we go') co2=co.apply(lambda x:x if x in top_val else 'Restall') top_val.append('Restall') else: co2=co[co.apply(lambda x:True if x in top_val else False)] #print(co2) #top_val = [str(x) for x in top_val] top_val.sort(reverse=False) return (co2,top_val) # In[3]: ###plot ...
# coding=utf-8 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import logging import os import collections import jsonpath_ng import re from typing import List, Set import shutil from ruamel.yaml import YAML from git import Repo, InvalidGitRepositoryError, NoSuchPathError from shrike.build.core...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, division, print_function, absolute_import import os import json import types import re from functools import partial import itertools import logging import inspect import copy from socket import gethostname import cgi import io from datatypes import ( U...
condditions!' if opts == 'b2' : x0 , y0 = gr.point ( 0 ) x1 , y1 = gr.point ( 1 ) x2 , y2 = gr.point ( 2 ) elif opts == 'e2' : x0 , y0 = gr.point ( -3 ) x1 , y1 = gr.point ( -2 ) x2 , y2 = gr.point ( -1 ) dx01 = x0 - x1 dx02 = x0 - x2 dx12 = x1 - x2 return 2 * ( y0 * dx12 - y1 * dx02 + y2 * dx01...
from .microfaune_package.microfaune.detection import RNNDetector from .microfaune_package.microfaune import audio import pandas as pd import scipy.signal as scipy_signal import numpy as np import math import os def build_isolation_parameters( technique, threshold_type, threshold_const, threshold_min=0, window_si...
E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.import_config_source(file, async_req=True) >>> result = thread.get() :param async_req bool :param file file: (required) :return: object If the method is...
"""Generated message classes for gkebackup version v1alpha1. """ # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from apitools.base.protorpclite import messages as _messages from apitools.base.py import encoding from apitools.base.py import extra_types pa...
version=1) class Microsoft_Office_Word_30189_1(Etw): pattern = Struct( "tag" / WString, "xsz" / WString ) @declare(guid=guid("daf0b914-9c1c-450a-81b2-fea7244f6ffa"), event_id=30190, version=1) class Microsoft_Office_Word_30190_1(Etw): pattern = Struct( "tag" / WString, "xsz" / WString ) @declare(guid=guid("...
'vn', 'vna', 'vno', }, 'lt': { 'á', 'ákypai', 'ástriþai', 'ðájá', 'ðalia', 'ðe', 'ðiàjà', 'ðiàja', 'ðiàsias', 'ðiøjø', 'ðiøjø', 'ði', 'ðiaisiais', 'ðiajai', 'ðiajam', 'ðiajame', 'ðiapus', 'ðiedvi', 'ðieji', 'ðiesiems', 'ðioji', 'ðiojo', 'ðiojoje', 'ðiokia', 'ðioks', 'ðiosiomis', 'ðiosioms...
#!/usr/bin/env python import socket import sys import os import errno import argparse import time import datetime import signal from mps_names import MpsName from mps_config import MPSConfig, runtime, models from mps_manager_protocol import * from runtime import * from sqlalchemy import func from epics import PV fro...
colour the RGB strip has been set to." } def action__fade(self, request): """ Run when user wants to set a colour to a specified value """ fade_colour = request.get_param("fade", force=unicode) logging.info("Fade to: %s" % fade_colour) return self.led_strip.fade(fade_colour) action__fade.capability = { "par...
auth_permission_44.name = 'Can view content type' auth_permission_44.content_type = ContentType.objects.get(app_label="contenttypes", model="contenttype") auth_permission_44.codename = 'view_contenttype' auth_permission_44 = importer.save_or_locate(auth_permission_44) auth_permission_45 = Permission() auth_permis...
<gh_stars>1-10 # Copyright 2017 Battelle Energy Alliance, 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 ...
Why: #4919 in Alexa global 'http://www.carrefour.fr/', # Why: #4922 in Alexa global 'http://www.tax.gov.ir/', # Why: #4924 in Alexa global 'http://www.ruelala.com/', # Why: #4925 in Alexa global 'http://www.mainspy.ru/', # Why: #4926 in Alexa global 'http://www.phpwind.net/', # Why: #4927 in Alexa global 'ht...
DatasetType: 'DatasetDescriptionFile.DatasetTypeEnum'): self['DatasetType'] = DatasetType @property def License(self) -> 'str': return self['License'] @License.setter def License(self, License: 'str'): self['License'] = License @property def Acknowledgements(self) -> 'str': return self['Acknowledgements'...
get_d_d(self): return self.get("d{0}".format(self.data['d']), Type.int_32) def get_d_b(self): return self.get("d{0}".format(self.data['b']), Type.int_32) def get_d_a(self): return self.get("d{0}".format(self.data['a']), Type.int_32) def fetch_operands(self): return self.get_d_a(), self.get_d_b(), self.get_d_d...
None def getDirty(self): return (self.saveDirtySince is not None, self.updateDirtySince is not None) def getDirtySince(self): return (self.saveDirtySince, self.updateDirtySince) def setEditorText(self, text, dirty=True): with self.textOperationLock: if self.isReadOnlyEffect(): return super...
# calculate_ICEO.py """ Notes """ # import modules import numpy as np import matplotlib.pyplot as plt def calculate_ICEO(testSetup, testCol, plot_figs=False, savePath=None): # write script to calculate and output all of the below terms using the testSetup class """ Required Inputs: # physical constants eps_flu...
return new_offset+value, \ data_list[new_offset:new_offset+value].decode("utf-8") elif code == 21: dtime = OrderedDict() new_offset, year = get_from_list(data_list, start_offset, 15) # USHORT year = 1900 + year dtime['Y'] = year v1 = ord(data_list[new_offset:new_offset+1]) new_offset += 1 result = bin(v1)[2:]....
JavaScript code for interactivity. If the canvas contains animation, the markup will include an HTML user interface to control playback. Parameters ---------- canvas: :class:`toyplot.canvas.Canvas` The canvas to be rendered. style: dict, optional Dictionary of CSS styles that will be applied to the top-level o...
<gh_stars>1-10 # Impacket - Collection of Python classes for working with network protocols. # # SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more...
<reponame>jtemporal/auth0-python import json import time import jwt import requests from auth0.v3.exceptions import TokenValidationError class SignatureVerifier(object): DISABLE_JWT_CHECKS = { "verify_signature": True, "verify_exp": False, "verify_nbf": False, "verify_iat": False, "verify_aud": False, "verif...
# Copyright (c) 2017 Sony Corporation. 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 la...
= RobotModelArtist(self.process.robot_model, self.robot_layer) self._robot_artist.scale(1000) return self._robot_artist else: print("Error: Attempy to create new RobotModelArtist but process.robot_model is None") self._robot_artist = None return None ####################################### # Functions to handl...
<filename>edge-bootstrap/python/edgectl/utils/certutil.py<gh_stars>0 """ Module implements utility class EdgeCertUtil for generating a X.509 certificate chain""" import logging import os from datetime import datetime from shutil import copy2 from OpenSSL import crypto from edgectl.config import EdgeConstants as EC impo...
<gh_stars>0 import json import locale import os import pprint import requests import time from collections import Counter import matplotlib.pyplot as plt from tqdm import tqdm import xml.etree.ElementTree as et data_path = "../data_lab1/" # żeby możliwe było sortowanie alfabetyczne w języku polskim locale.setlocale(...
# -*- coding: utf-8 -*- from django.test import TestCase from prediction.models import Element, Prediction, PredictionLinear, PredictionLinearFunction from product_card.models import ProductCard from offer.models import Offer, ChequeOffer from company.models import Company, Employee from cheque.models import FNSCheque,...
'{}' {} :code:{}:body:{}".format( request.method, request.path, response.status_code, body) logger.info(log_base.format(NORTHBOUND, RESPONSE, log_content)) return response @app.before_request def before(): # todo with request # e.g. print request.headers pass # Topology API implementation @app.route('/chunket...
coins.{2}" .format(price, price*5, inquisition)) @commands.command(pass_context=True) @asyncio.coroutine def spell(self, ctx, *, name: str= None): """Tells you information about a certain spell.""" permissions = ctx.message.channel.permissions_for(get_member(self.bot, self.bot.user.id, ctx.message.server)) if n...
11: o0oOOo0O0Ooo if 77 - 77: o0oOOo0O0Ooo / iIii1I11I1II1 * iIii1I11I1II1 / o0oOOo0O0Ooo * iII111i ooOo00 . print_notify ( ) if 26 - 26: Ii1I if 1 - 1: OoOoOO00 . o0oOOo0O0Ooo + Oo0Ooo % Oo0Ooo * I1ii11iIi11i if 50 - 50: IiII / i1IIi . I1ii11iIi11i if 75 - 75: I11i * oO0o + OoooooooOO . iII111i + OoO0O00 if 44 -...
arr[0]) # print('arr[1]: ', arr[1]) # print('arr[0].dtype', arr[:, 0].dtype) # print('arr[1].dtype', arr[:, 1].dtype) # print('arr[:, :2]', arr[:, :2]) # for s in arr: # if isinstance(s[1], bool): # print('s: ', s) # print('is: ', [s for s in arr if isinstance(s[0], bool)) # players_set = np.unique(arr[:, :2]....
obj.Proxy.getElements(): info = e.Proxy.getInfo() if utils.isDraftObject(info.Part): continue shape = None if utils.isVertex(info.Shape) or \ utils.isLinearEdge(info.Shape): shape = info.Shape ret.append(cls.Info(Part=info.Part,Shape=shape)) return ret @classmethod def hasFixedPart(cls,obj): return len(obj...
# Copyright Notice: # Copyright 2016 DMTF. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfishtool/blob/master/LICENSE.md # redfishtool: redfishtoolTransport.py # # Contents: # 1. Class RfSessionAuth -- holds auto-created session Auth info. 'requests' calls to ...
<filename>tests/unit/protocol/transport/reliablebuffers.py<gh_stars>0 """Test the protocol.transport.reliablebuffers module.""" # Builtins # Packages from phylline.links.clocked import LinkClockRequest from phylline.links.events import LinkException from phylline.util.logging import hex_bytes from phylline.util.timi...
<reponame>mohamad-amin/neural-tangents # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
<gh_stars>0 ''' Copyright (C) 2021 CG Cookie http://cgcookie.com <EMAIL> Created by <NAME>, <NAME> 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 3 of the License, or (at your op...
""" This file contains functions related to the annual report """ import pandas as _pd # import numpy as _np # import altair as _alt ####################################################################################################################### def fields_summary_table( points, artifacts, fid_col="geo...
property_kind_list, vdb_static_properties, vdb_recurrent_properties and timestep_selection arguments can be used to filter the required properties; if both keyword_list and property_kind_list are provided, a property must match an item in both lists in order to be included; if recurrent properties are being included...
# -*- coding: utf-8 -*- """Part 3 - Personalized Diagnosis.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1XEb3sev4HFHW_lk33aAbP2RbMD9HALTw #Network and Personalized Diagnosis ## Import Packages First we import all required Python packages that ...
-> Optional[pulumi.Input['ClusterAutoscaleArgs']]: return pulumi.get(self, "autoscale") @autoscale.setter def autoscale(self, value: Optional[pulumi.Input['ClusterAutoscaleArgs']]): pulumi.set(self, "autoscale", value) @property @pulumi.getter(name="autoterminationMinutes") def autotermination_minutes(self) ->...
""" Tiny Web - pretty simple and powerful web server for tiny platforms like ESP8266 / ESP32 MIT license (C) <NAME> 2017-2018 """ import logging import uasyncio as asyncio import uasyncio.core import ujson as json import gc import uos as os import sys import uerrno as errno import usocket as socket log = logging.getL...
# Tests invocation of the interpreter przy various command line arguments # Most tests are executed przy environment variables ignored # See test_cmd_line_script.py dla testing of script execution zaimportuj test.support, unittest zaimportuj os zaimportuj shutil zaimportuj sys zaimportuj subprocess zaimportuj tempfile...
<reponame>acordonez/e3sm_diags from __future__ import print_function import os import cartopy.crs as ccrs import cdutil import matplotlib import numpy as np import numpy.ma as ma from cartopy.mpl.ticker import LatitudeFormatter, LongitudeFormatter from numpy.polynomial.polynomial import polyfit from e3sm_diags.deriv...
<filename>foundrytoencounter.py # vim: set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab : # import xml.etree.cElementTree as ET import json import re import sys import os import tempfile import shutil import argparse import uuid from slugify import slugify import zipfile import urllib.parse import urllib.req...
<gh_stars>100-1000 ########################################################################## # # Copyright (c) 2012, <NAME>. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- # File: entities.py # # Copyright 2020 <NAME>, <NAME> # # 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, inc...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2021 Beartype authors. # See "LICENSE" for further details. ''' **Beartype core validation classes.** This private submodule defines the core low-level class hierarchy driving the entire :mod:`beartype` validation ecosys...
"iso2": "NG", "admin_name": "Borno", "capital": "minor", "population": "", "population_proper": "" }, { "city": "Amagunze", "lat": "6.3306", "lng": "7.6525", "country": "Nigeria", "iso2": "NG", "admin_name": "Enugu", "capital": "minor", "population": "", "population_proper": "" }, { "c...
dipole : float, optional Dipole, [debye] Psat : float or callable, optional Vapor pressure at a given temperature, or callable for the same [Pa] eos : object, optional Equation of State object after :obj:`thermo.eos.GCEOS` Notes ----- A string holding each method's name is assigned to the following variables ...
PLAN IOD': ['Patient'], 'CR IMAGE IOD': ['Patient'], 'RAW DATA IOD': ['Patient'], 'MACULAR GRID THIICKNESS AND VOLUME REPORT IOD': ['Patient'], 'ENHANCED MR IMAGE IOD': ['Patient'], 'UNIFIED PROCEDURE STEP IOD': ['Unified Procedure Step'], 'BASIC CARDIAC EP IOD': ['Patient'], 'RT TREATMENT SUMMARY RECORD IOD': [...
<gh_stars>1-10 """ Let's do this! """ from dis import ( opmap, HAVE_ARGUMENT, hasjrel, hasjabs, haslocal, hasname, hasconst, hasfree, get_instructions ) import types CO_FLAGS = { 'OPTIMIZED': 0x1, 'NEWLOCALS': 0x2, 'VARARGS': 0x4, 'VARKEYWORDS': 0x8, 'NESTED': 0x10, 'GENERATOR': 0x20, 'NOFREE': 0x40, 'CORO...
type=desc, critical=cbit, length=clen, algorithm=_HI_ALGORITHM.get(_algo), signature=_sign, ) _plen = length - clen if _plen: self._read_fileng(_plen) return hip_signature def _read_para_echo_request_unsigned(self, code, cbit, clen, *, desc, length, version): # pylint: disable=unused-argument """Read HIP ...
<reponame>binary-bisam/LeleNet<filename>LeleNet_trn.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 17 17:56:34 2021 @author: Manuel Full implementation runfrom terminal: python ~/LeleNet/py3/LeleNet_trn.py "U-Net" 10 40 """ __author__ = "<NAME>" #### parse arguments---------------...
this is a multi-dimensional array) if is_array_like(data_point) and len(data_point) > 1: column_name = meta_data.full_name(skip_parents=True) _table = functools.partial(array_like_to_table, data_point, column_name, meta_data['data_type'], format=meta_data.get('format'), full_label=self.structure.full_label, arra...
[t["class_names"] for t in tasks] self.num_anchor_per_locs = [2 * n for n in num_classes] self.box_coder = box_coder box_code_sizes = [box_coder.code_size] * len(num_classes) self.with_cls = with_cls self.with_reg = with_reg self.in_channels = in_channels self.num_classes = num_classes self.reg_class_agnostic...
<reponame>Mazharul-Hossain/sequence-based-recommendations from __future__ import print_function import argparse import os import re import sys from shutil import copyfile import numpy as np import pandas as pd from sklearn.preprocessing import MultiLabelBinarizer def command_parser(): parser = argparse.ArgumentPar...
'3584570':{'en': 'AMT'}, '3584571':{'en': 'Tismi'}, '3584572':{'en': 'Telavox AB'}, '3584573':{'en': 'AMT'}, '3584574':{'en': 'DNA'}, '3584575':{'en': 'AMT'}, '3584576':{'en': 'DNA'}, '3584577':{'en': 'DNA'}, '3584578':{'en': 'DNA'}, '3584579':{'en': 'DNA'}, '358458':{'en': 'Elisa'}, '35846':{'en': 'Elisa'},...
""" WA module for scraping and processing text from https://leg.wa.gov # Status, as of January 1, 2022 Current Coverage (In Active Development): [X] Committee Hearings (Audio Links) (2015 - 2020) Planned Coverage: [ ] Committee Hearings (Video Links) (2000 - 2014) [ ] Floor Speeches (Video Links) # WA Work Flow...
<filename>ckanext/activity/logic/action.py # -*- coding: utf-8 -*- from __future__ import annotations import logging import datetime import json from typing import Any, Optional import ckan.plugins.toolkit as tk from ckan.logic import validate from ckan.types import Context, DataDict, ActionResult import ckanext.ac...
expressions we tell # Elasticsearch to use when normalizing fields that will be used # for searching. filters = [] for filter_name in CurrentMapping.AUTHOR_CHAR_FILTER_NAMES: configuration = CurrentMapping.CHAR_FILTERS[filter_name] find = re.compile(configuration['pattern']) replace = configuration['replacement'...
""" Returns the value of the `encrypted` property. """ return self._encrypted @encrypted.setter def encrypted(self, value): """ Sets the value of the `encrypted` property. """ Struct._check_type('encrypted', value, InheritableBoolean) self._encrypted = value @property def bandwidth(self): """ Returns th...
'within a code block. The local variables of a code block can be\n' 'determined by scanning the entire text of the block for name ' 'binding\n' 'operations.\n' '\n' 'If the global statement occurs within a block, all uses of the ' 'name\n' 'specified in the statement refer to the binding of that name in '...
<gh_stars>0 # chinascope_algotrade # # Copyright 2011-2015 <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 applica...
expr[str]""" with self.assertRaises( TypeError, msg="failed to raise expected error using string multiplier" ): expr2 = pp.Word(pp.alphas)["2"] def testParseResultsNewEdgeCases(self): """test less common paths of ParseResults.__new__()""" # create new ParseResults w/ None result1 = pp.ParseResults(None) pri...
from __future__ import absolute_import from __future__ import print_function import math import functools import ast import inspect import textwrap from collections import OrderedDict import veriloggen.core.vtypes as vtypes import veriloggen.types.fixed as fxd from veriloggen.seq.seq import make_condition from verilo...
= SortedDict() data_dict['q1'] = x return data_dict def disassemble(self,input,dim=1): state_dict, costate_dict, data_dicts = self.disassemble_tensor(input, dim=dim) return scd_utils.extract_key_from_dict_of_dicts(data_dicts,'q1') class AutoShootingIntegrandModelSimpleConv2D(shooting.ShootingLinearInParameterC...
"""Initial models. Revision ID: a2e0f8f4b344 Revises: Create Date: 2016-11-20 23:02:51.424015 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = None branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by A...
find_nearest is probably very slowly... ### Using startidx values to speed up the process at least for later data # Get start and end indicies: if debug: ti1 = datetime.utcnow() st, ls = self.findtime(startdate,mode='argmax') # st is the starttime, ls ? -- modification allow to provide key list!! if debug: ti2 ...
<reponame>martinjzhang/adafdr import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from matplotlib import mlab from scipy.stats import beta import torch import torch.nn as nn from torch.autograd import Variable import torch.optim as optim from numpy import array from scipy.clus...
CustomSchedule(tf.keras.optimizers.schedules.LearningRateSchedule): def __init__(self, d_model, warmup_steps=10): super(CustomSchedule, self).__init__() self.d_model = d_model self.d_model = tf.cast(self.d_model, tf.float32) self.warmup_steps = warmup_steps def __call__(self, step): arg1 = tf.math.rsqrt(step ...
import numpy as np import pyDOE2 import sample_generator as sg from copy import deepcopy import os import glob import pickle import sys import emcee from linna.nn import * from scipy.special import erf from scipy.stats import chi2 import io import gc import torch from torch.utils.data import Dataset, DataLoader from to...
<reponame>Epihaius/panda3dstudio from ....base import * from math import sin, cos, acos class ExtrusionInsetMixin: """ PolygonEditMixin class mix-in """ def __compute_extr_inset_data(self, main_extr_vec_only=False, poly_ids=None): """ Compute the data for previewing or creating extrusions and insets. This data ...
import json from copy import deepcopy from random import shuffle cards = ['magician', 'high priestess', 'empress', 'emperor', 'hierophant', 'lovers', 'chariot', 'justice', 'hermit', 'wheel of fortune', 'strength', 'hanged man', 'death', 'temperance', 'devil', 'tower', 'star', 'moon', 'sun', 'judgement', 'world', '...
branch eventually converges to. To create a new branch: # # - Go to your repo `hello-world` # - Click the drop down that says **branch:main**. # - Type a branch name, `readme-edits`, into the new branch text box. # - Select the blue **Create branch** box. # # Now you have two branches, `main` and `readme-edits`. Thes...
influence of last segment, if needed if self._end_infinite: # Determine displacement vector magnitudes r = r1[:,:,-1,:] r_mag = vec_norm(r) u = self._vertices[:,-1,:]-self._vertices[:,-2,:] u /= vec_norm(u)[:,np.newaxis] # Calculate influence inf += vec_cross(u[np.newaxis,:,:], r)/(r_mag*(r_mag-vec_inner(u[np...
, 'Descending' , ), 97, (97, (), [ (8, 1, None, None) , (12, 17, None, None) , ], 1 , 1 , 4 , 1 , 108 , (3, 0, None, None) , 0 , )), ] _JournalItem_vtables_dispatch_ = 1 _JournalItem_vtables_ = [ (( 'Application' , 'Application' , ), 61440, (61440, (), [ (16393, 10, None, "IID('{00063001-0000-0000-C000-0000000000...