input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>galv/server # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this li...
<reponame>Severian-desu-ga/SDG<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[1]: #Author: <NAME> import random, os, glob, time, sys import pygame pygame.init() pygame.font.init() pygame.mixer.init() HEIGHT = 650 WIDTH = 1200 radius = 10 running = False paused = False rt_change = False x = 10 y = 10 maze ...
<filename>src/actuator/config_tasks.py # Copyright (c) 2014 <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, including without limitation the rights # to use, co...
<reponame>medismailben/llvm-project #!/usr/bin/env python """A tool for extracting a list of symbols to export When exporting symbols from a dll or exe we either need to mark the symbols in the source code as __declspec(dllexport) or supply a list of symbols to the linker. This program automates the latter by inspect...
the message, 1-4096 characters after entities parsing - `chat_id` :`Union[int,str,]` Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) - `message_id` :`int` Required if inline_message_id is not specified. Identifier...
from contextlib import contextmanager from importlib import import_module from time import time import logging import os import pygit2 from gitmodel import conf from gitmodel import exceptions from gitmodel import models from gitmodel import utils class Workspace(object): """ A workspace acts as an encapsulation ...
import functools import math import warnings import numpy as np import cupy from cupy.cuda import cufft from cupy.fft import config from cupy.fft._cache import get_plan_cache _reduce = functools.reduce _prod = cupy._core.internal.prod @cupy._util.memoize() def _output_dtype(dtype, value_type): if value_type != '...
import astropy.units as u import numpy as np from lofti_gaia.loftitools import * from lofti_gaia.cFunctions import calcOFTI_C #from loftitools import * import pickle import time import matplotlib.pyplot as plt # Astroquery throws some warnings we can ignore: import warnings warnings.filterwarnings("ignore") '''This mo...
var_by_name['/'.join(split_name)] post_init_ops.append(v.assign(copy_from.read_value())) return post_init_ops def savable_variables(self): """Return the set of variables used for saving/loading the model.""" params = [] for v in tf.global_variables(): split_name = v.name.split('/') if split_name[0] == 'v0' or ...
is an image, otherwise False""" return self._info["type"] == _PHOTO_TYPE @property def incloud(self): """Returns True if photo is cloud asset and is synched to cloud False if photo is cloud asset and not yet synched to cloud None if photo is not cloud asset """ return self._info["incloud"] @property def isc...
import datetime import os import sys import signal import time import warnings import numpy as np from pandas import DataFrame from ..utils import ( logger, check_directory_exists_and_if_not_mkdir, reflect, safe_file_dump, latex_plot_format, ) from .base_sampler import Sampler, NestedSampler from ..result import...
<reponame>therooler/pennylane # Copyright 2018-2021 Xanadu Quantum Technologies 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 # Un...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Things to know: * raw subprocess calls like .communicate expects bytes * the Command wrappers encapsulate the bytes and expose unicode """ from __future__ import ( absolute_import, division, print_function, unicode_literals, ) import json import os import re import tempf...
<reponame>maoyab/OWUS<filename>param_sm_pdf.py import numpy as np from scipy.interpolate import interp1d from scipy.stats import ks_2samp, percentileofscore from sswm import SM_C_H class Inverse_bayesian_fitting(object): def __init__(self, s_obs, unknown_params, save_params, p_ranges, epsi=None, stress_type='dynami...
# -*- coding: utf-8 -*- """ Created on Thu Mar 1 13:37:29 2018 Class for implementing the scores for the composition UI and also the display image with all the scores@author: <NAME> """ import cv2 import numpy as np import itertools from scipy.spatial import distance as dist from skimage.measure import compare_ssim as...
------ InvalidOutcome If `outcome` does not exist in the sample space. """ if not self.has_outcome(outcome, null=True): raise InvalidOutcome(outcome) idx = self._outcomes_index.get(outcome, None) if idx is None: p = self.ops.zero else: p = self.pmf[idx] return p def __setitem__(self, outcome, value): ""...
<gh_stars>0 import re import os import json from IxNetRestApi import IxNetRestApiException from ixnetwork_restpy.files import Files import datetime class FileMgmt(object): def __init__(self, ixnObj=None): """ Description Initialize default attributes. Parameter ixnObj: (Object): The parent object. """ self.i...
<reponame>cancerregulome/gidget<gh_stars>1-10 # -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# import miscIO import sys # -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# NA_VALUE = -999999 # -#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#...
"""Test the Basic ICN Layer implementation""" import multiprocessing import time import unittest from PiCN.Layers.ICNLayer import BasicICNLayer from PiCN.Layers.ICNLayer.ContentStore import ContentStoreMemoryExact from PiCN.Layers.ICNLayer.ForwardingInformationBase import ForwardingInformationBaseMemoryPrefix from Pi...
= minimum_range(pe.chars, pe.ranges) bitset = unique_range(pe.chars, pe.ranges) >> offset def match_bitset(px): if px.pos < px.epos: shift = ord(px.inputs[px.pos]) - offset if shift >= 0 and (bitset & (1 << shift)) != 0: px.pos += 1 return True return False return match_bitset def ManyRange(self, pe, step):...
<reponame>sn0b4ll/Incident-Playbook from django.contrib.auth.models import User from django.contrib.messages import get_messages from django.test import TestCase from django.utils import timezone from dfirtrack.settings import BASE_DIR from dfirtrack_main.importer.file.csv import system_cron from dfirtrack_main.tests.s...
self.label10.grid(row=12, column=0, padx=40, pady=2, sticky='w') self.entry10 = tk.Entry(master, width=13, textvariable=self.var10) self.entry10.grid(row=12, column=1, padx=5, pady=2, sticky='w', columnspan = 2) self.errtx10 = tk.Label(master, text='', fg='red' ) self.errtx10.grid(row=12, column=4, padx=5, pady=2,...
import os import random from tqdm import tqdm from sklearn.metrics import accuracy_score, matthews_corrcoef, f1_score from scipy.stats import pearsonr import numpy as np import torch import torch.nn as nn from torch_geometric.data import DataLoader as GraphDataLoader from transformers import AutoTokenizer, AdamW, ge...
if not self.items: return Type.Array(Type.Any()) item_type = Type.unify( [item.type for item in self.items], check_quant=self._check_quant, force_string=True ) if isinstance(item_type, Type.Any): raise Error.IndeterminateType(self, "unable to unify array item types") return Type.Array(item_type, optional=False, ...
this method would rebuild a new instance of DistributedOptimizer. Which has basic Optimizer function and special features for distributed training. Args: optimizer(Optimizer): The executor to run for init server. strategy(DistributedStrategy): Extra properties for distributed optimizer. It is recommended to use ...
15 %)', 'abstract': '', 'values': [43], 'color': '#95f4f0', 'alpha': 1}, {'title': 'Cultivated Aquatic Vegetated: Scattered (1 to 4 %)', 'abstract': '', 'values': [44], 'color': '#bbfffc', 'alpha': 1}, # {'title': 'Cultivated Aquatic Vegetated: Woody Closed (> 65 %)', 'abstract': '', 'values': [45], 'color': '#2bd2cb...
""" Checks if a pair of minterms differs by only one bit. If yes, returns index, else returns -1. """ index = -1 for x, (i, j) in enumerate(zip(minterm1, minterm2)): if i != j: if index == -1: index = x else: return -1 return index def _convert_to_varsSOP(minterm, variables): """ Converts a term in the ...
optional Value of the random seed used for the conditional luminosity function. This variable is set to ``1235`` default. dv : `float`, optional Value for the ``velocity bias`` parameter. It is the difference between the galaxy and matter velocity profiles. .. math:: dv = \\frac{v_{g} - v_{c}}{v_{m} - v_{c}} ...
paramflags ) libvlc_vlm_get_media_instance_seekable.errcheck = check_vlc_exception libvlc_vlm_get_media_instance_seekable.__doc__ = """Is libvlc instance seekable ? \bug will always return 0 @param p_instance a libvlc instance @param psz_name name of vlm media instance @param i_instance instance id @param p_e an init...
*args) def name(self, *args): """ name(self) -> str """ return _casadi.DM_name(self, *args) def dep(self, *args): """ dep(self, int ch) -> DM """ return _casadi.DM_dep(self, *args) def n_dep(self, *args): """ n_dep(self) -> int """ return _casadi.DM_n_dep(self, *args) def set_prec...
<filename>ppms/__init__.py from astropy.io.ascii import basic, core from astropy.table import Table, MaskedColumn from astropy import units as u, constants as c import numpy as np import dateutil.parser as dparser from scipy.ndimage import median_filter class MaglabHeader(basic.CsvHeader): comment = r'\s*;' write_c...
to the command. """ nagios_message = 'Database:%s, Time:%s, Size %s, Quantity : %%s' % \ (dbname, str(row[0]), row[1], ) result = row[2] error_code, message = nagios_eval(result, warning, critical, nagios_message, 'MB', verbosity) return error_code, message def analyze_resstat(dbname, counter, row, warning, ...
colors=["#FF0000", "#A00000"], style='number-style-var-arg', label=[_('Python'), 'f(x,y,z)', ' '], prim_name='myfunction3', default=['x+y+z', 100, 100, 100], string_or_number=True, help_string=_('a programmable block: used to add \ advanced multi-variable math equations, e.g., sin(x+y+z)')) self.tw.lc.def_prim( ...
= {} for var in dep: dep_per[var] = dep[var] / total_corr * 100 sorted_deps = dict(sorted(dep_per.items(), key=lambda item: item[1], reverse=True)) for dep in sorted_deps: name = dep if name == 'bpm': name = 'BPM' else: name = name.capitalize() dep_str += '`{:<6}:` `{:<6}%`\n'.format(name, round(sorted_de...
{{ versions: {} }}}}".format(val) else: version_policy_str = "{ all { }}" # Use a different model name for the non-batching variant model_name = tu.get_model_name( "libtorch_nobatch" if max_batch == 0 else "libtorch", input_dtype, output0_dtype, output1_dtype) config_dir = models_dir + "/" + model_name config ...
given explicitely u,v = np.atleast_2d(u,v); N=u.shape[1]; # K... number of iso-q-lines else: u,v = self.__resample_aperture_border(N)# aperture borders, shape (K,N) if vp is None: vp = (self.Npx/2,self.Npx);# set reasonable start value trapz = trafo.TrapezoidalDistortion(vp); # initialize trafo param0= list(vp)+[...
'contour'], {}, ''), ('error_bars', 'geom_errorbar', ['x', 'ymin', 'ymax'], ['alpha', 'color', 'group', 'linetype', 'size', 'width', 'position'], {'width': 0.25}, ''), ('error_barsh', 'geom_errorbarh', ['x', 'y', 'xmin', 'xmax'], ['alpha', 'color', 'group', 'linetype', 'size', 'width'], {'width': 0.25}, ''), ('freq_...
# Copyright 2018 IBM Corp. 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 law or agreed ...
<reponame>nomike/spambayes # Test sb_imapfilter script. import re import sys import time import email import types import socket import threading import imaplib import unittest import asyncore import StringIO try: IMAPError = imaplib.error except AttributeError: IMAPError = imaplib.IMAP4.error import sb_test_suppo...
<reponame>treehopper-electronics/treehopper-sdk ### This file was auto-generated by RegisterGenerator. Any changes to it will be overwritten! from treehopper.libraries.register_manager_adapter import RegisterManagerAdapter from treehopper.libraries.register_manager import RegisterManager, Register, sign_extend class ...
Nebraska', 'Banner County, Nebraska', 'Blaine County, Nebraska', 'Boone County, Nebraska', 'Box Butte County, Nebraska', 'Boyd County, Nebraska', 'Brown County, Nebraska', 'Buffalo County, Nebraska', 'Burt County, Nebraska', 'Butler County, Nebraska', 'Cass County, Nebraska', 'Cedar County, Nebraska', 'Chas...
'0X0') test(1, "-#X", '0X1') test(-1, "-#X", '-0X1') test(-1, "-#5X", ' -0X1') test(1, "+#5X", ' +0X1') test(100, "+#X", '+0X64') test(100, "#012X", '0X0000000064') test(-100, "#012X", '-0X000000064') test(123456, "#012X", '0X000001E240') test(-123456, "#012X", '-0X00001E240') test(123, ',', '123') test(-12...
instance from a saved dictionary representation. Parameters ---------- d : dict Returns ------- LargeMultinomialLogitStep """ check_choicemodels_version() from choicemodels import MultinomialLogitResults # Pass values from the dictionary to the __init__() method obj = cls(choosers=d['choosers'], alternat...
executed when the task runs. :param pulumi.Input[str] user_task_managed_initial_warehouse_size: Specifies the size of the compute resources to provision for the first run of the task, before a task history is available for Snowflake to determine an ideal size. Once a task has successfully completed a few runs, Snowfla...
import math import torch import torch.nn as nn import torchvision from . import block as B from . import spectral_norm as SN #################### # Generator #################### class SRResNet(nn.Module): def __init__(self, in_nc, out_nc, nf, nb, upscale=4, norm_type='batch', act_type='relu', \ mode='NAC', res_sc...
<filename>paddlespeech/text/speechtask/punctuation_restoration/modules/crf.py<gh_stars>0 # Copyright (c) 2021 PaddlePaddle 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 L...
self.body.default_name else names # Replace commas in xephem string with tildes to avoid clashes with main structure fields += [self.body.to_edb(edb_names).replace(',', '~')] if fluxinfo: fields += [fluxinfo] return ', '.join(fields) @classmethod def from_description(cls, description): """Construct Target obj...
if 'headers' in kwargs: headers.update(kwargs.get('headers')) sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_word') headers.update(sdk_headers) data = {'translation': translation, 'part_of_speech': part_of_speech} url = '/v1/customizations/{0}/word...
""" @Author <NAME> @Title Final Year Project @Institution - University of California, Berkeley @Date - 2015-2016 """ from __future__ import division import os import sys import constants import random from pandas import DataFrame import shutil # we need to import python modules from the $SUMO_HOME/tools directory try...
<reponame>PhilipGarnero/slack-sounds #!/usr/bin/env python # -*- coding: utf-8 -*- import time import traceback import subprocess import string from datetime import datetime from distutils.util import strtobool import os import re import json import urllib2 from slackclient import SlackClient BASE_DIR = os.path.dirna...
Pointer = 0x664E3 I3Flag.append(["Woodman", GiveI3]) elif GetI3 == "Metalman": Pointer = 0x664E5 I3Flag.append(["Metalman", GiveI3]) elif GetI3 == "Crashman": Pointer = 0x664E9 I3Flag.append(["Crashman", GiveI3]) elif GetI3 == "Sparkman": Pointer = 0x66503 I3Flag.append(["Sparkman", GiveI3]) elif ...
import argparse from bisect import bisect, bisect_left, bisect_right import contextlib import importlib import io import itertools import math import operator import pathlib import time import os import ast import random import re import sys import traceback import bisect from py2many.exceptions import AstUnsupportedO...
""" ActionBase superclass """ try: from urllib.parse import urlencode, urlparse # Python 3 from io import StringIO from builtins import str except ImportError: from urllib import urlencode # Python 2 from urlparse import urlparse from StringIO import StringIO import importlib import io import json import logging...
= c_int() dwf.FDwfAnalogInChannelEnableGet(self.hdwf, c_int(channel), byref(enabled)) return enabled.value def analog_in_channel_filter_info(self): filter = c_int() dwf.FDwfAnalogInChannelFilterInfo(self.hdwf, byref(filter)) return filter def analog_in_channel_filter_set(self, channel, filter): dwf.FDwfAnalog...
Period" (2006, Bulletin of the Seismological Society of America, Volume 96, No. 3, pages 898-913). This class implements the equations for 'Subduction Interface' (that's why the class name ends with 'SInter'). This class extends the :class:`openquake.hazardlib.gsim.zhao_2006.ZhaoEtAl2006Asc` because the equation ...
<filename>third_party/blink/renderer/bindings/scripts/web_idl/idl_type.py # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import functools from blinkbuild.name_style_converter import NameStyleConverter f...
# -*- coding: utf-8 -*- """ Tests of the neo.core.irregularlysampledsignal.IrregularySampledSignal class """ import unittest import os import pickle import warnings from copy import deepcopy import numpy as np import quantities as pq from numpy.testing import assert_array_equal from neo.core.dataobject import Array...
the nodes weren't removed _, nodes = c.catalog.nodes() nodes.remove(current) assert [x['Node'] for x in nodes] == ['n1', 'n2'] # check n2's s1 service was removed though _, nodes = c.catalog.service('s1') assert set([x['Node'] for x in nodes]) == set(['n1']) # cleanup assert c.catalog.deregister('n1') is True ...
import glob import json import logging import os import shutil import sys import re import patoolib import requests import DCSLM.Utilities as Utilities from pprint import pprint from .DCSUFParser import DCSUFParser, ArchiveExtensions from .Livery import Livery class LiveryManager: def __init__(self): self.LiveryDat...
}, "lang": "java", }, # duplicates in net.java.dev.jna:jna promoted to 4.5.1 # - com.zaxxer:nuprocess:1.2.4 wanted version 4.5.1 # - org.scala-sbt:io_2.12:1.2.0 wanted version 4.5.0 { "bind_args": { "actual": "@scala_annex_net_java_dev_jna_jna", "name": "jar/scala_annex_net/java/dev/jna/jna", }, "import_args...
is set to log(n) - ``'verbose'`` (bool, default True) Controls verbosity of debug output, including progress bars. If intermediate_sample_info is not provided, the first progress bar reports the inner execution of the bless algorithm, showing: - lam: lambda value of the current iteration - m: current size of t...
<reponame>theGreenJedi/grr #!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """Tests the access control authorization workflow.""" import re import time import urlparse from grr.gui import runtests_test from grr.lib import access_control from grr.lib import aff4 from grr.lib import email_alerts from gr...
import argparse import os import errno from parseable import ImproperXmlException from problem import Problem, Document from subprocess import call from random import randint from config import get_problem_root, get_private_types import xml.etree.ElementTree as ET from color import * from pdfbuilder import build, temp_...
save the figure or not. If not the figure and axis are return for further manipulation. Returns: If save == True, this function will return nothing and directly save the image as the output name. If save == False, the function will return the matplotlib figure and axis for further editing. (fig, ax1, ax2) """ ...
<reponame>harshendrashah/Spell-Corrector import pandas as pd import numpy as np import tensorflow as tf import os from os import listdir from os.path import isfile, join from collections import namedtuple from tensorflow.python.layers.core import Dense from tensorflow.python.ops.rnn_cell_impl import _zero_state_tensors...
[816, 946, 134, 587, 645, 751, 780, 140, 731, 208, 504, 939, 401, 724, 140, 1000, 575, 15, 966, 719], [929, 121, 255, 511, 401, 94, 7, 656, 871, 52, 589, 504, 456, 524, 492, 4, 513, 673, 536, 877], [828, 402, 44, 162, 805, 675, 391, 875, 955, 410, 385, 625, 250, 837, 153, 922, 105, 279, 91, 121]]), [491, 432, ...
############################################################################## # NATS-Bench: Benchmarking NAS Algorithms for Architecture Topology and Size # ############################################################################## # Copyright (c) <NAME> [GitHub D-X-Y], 2020.07 # ##################################...
from collections import OrderedDict from datetime import timedelta import numpy as np import pytest from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype import pandas as pd from pandas import ( Categorical, DataFrame, Series, Timedelta, Timestamp, _np_version_under1p14, concat, date_range,...
= X_target, # warm_up = warm_up, # log_gradient_current_epoch=self._gradient_logger and self._gradient_logger.log_epoch(epoch)) # else: # args, summaries_lists = self.partial_fit(X, # warm_up = warm_up, # log_gradient_current_epoch=self._gradient_logger and self._gradient_logger.log_epoch(epoch)) # # #TODO XXX ...
<gh_stars>10-100 #! /usr/bin/env python # -*- coding: utf-8 -*- import pkgutil import six from nose.tools import ( assert_equal, assert_not_equal, assert_raises, assert_is_instance, raises) import url from url.url import StringURL, UnicodeURL def test_bad_port(): def test(example): assert_raises(ValueError, ur...
in parsecs and V-band extinction, Av, for a star. Returns: G_bp - G_rp color. """ _, _, _, bands = mist.interp_mag([*mag_pars], ["BP", "RP"]) bp, rp = bands return bp - rp # def lnprior(params): # """ logarithmic prior on parameters. # The (natural log) prior on the parameters. Takes EEP, log10(age) in years,...
= """ -> MEIMask --- -> stimulus.StaticImage.Image img_activation: float # activation at the best masked image """ def make(self, key): readout_key = key['readout_key'] neuron_id = key['neuron_id'] print('Working on neuron_id={}, readout_key={}'.format(neuron_id, readout_key)) _, img_shape, bias, mu_beh, mu...
<reponame>faithcomesbyhearing/verse-timing import pandas as pd,argparse,glob,statistics as stat,matplotlib.pyplot as plt,numpy as np,operator ''' ex: python3 upload_code/compare_with_cue_info_chinanteco.py -i /Users/spanta/Desktop/jon_code_test/upload_code/chinanteco_aeneas/lang_code_epo -o /Users/spanta/Desktop/jon_c...
<reponame>Awenbocc/mvqa-system import json from PyQt5.QtWidgets import QApplication, QMainWindow import sys import mainwindow from PyQt5 import QtCore, QtGui, QtWidgets import sys import qtawesome import os from interface import VQAsignal class MainUi(QtWidgets.QMainWindow): def __init__(self): super().__init__(...
['data'] all_params.append('callback') all_params.append('_return_http_data_only') all_params.append('_preload_content') params = locals() for key, val in iteritems(params['kwargs']): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" " to method create_webhook" % key ) par...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This experiment was created using PsychoPy3 Experiment Builder (v3.1.3), on June 24, 2019, at 16:21 If you publish work using this script please cite the PsychoPy publications: <NAME> (2007) PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods...
FlightLogDetailInlineFormSet = inlineformset_factory( AircraftFlightLog, AircraftFlightLogDetail, extra=6, exclude=( 'creator', 'modifier'), can_delete=False, form=details_form) if request.method == 'POST': form = AircraftFlightLogForm(data=request.POST, instance=flightlog) formset = FlightLogDetailInli...
import numpy as np import scipy.linalg as la from matplotlib import pyplot as plt from scipy import sparse as sp from time import time import scipy.sparse.linalg as spla from math import sqrt import streaming_subclass as stsb ##################################################################### # Obtain the necessary ...
initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod # known case of __new__ def __new__(self, owner): """ __new__(cls: type, owner: MenuItem) """ pass IsHwndHost = property(lambda self: object(), lambda self, v: ...
# coding=utf-8 # Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team. # # 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...
linewidth=linewidth, color=color, zorder=12+zorder_add, linestyle=linestyle) l2 = Line2D([end-x_extent,end-x_extent],[-y_extent,y_extent], linewidth=linewidth, color=color, zorder=12+zorder_add, linestyle=linestyle) l2_top = Line2D([end,end-x_extent],[y_extent,y_extent], linewidth=linewidth, color=color, zorde...
attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them. If check is True and the exit code was non-zero, it raises a CalledProcessError. The CalledProcessError object will have th...
"""Power series manipulating functions acting on polys.ring.PolyElement()""" from sympy.polys.domains import QQ from sympy.polys.rings import ring, PolyElement from sympy.polys.monomials import monomial_min, monomial_mul from mpmath.libmp.libintmath import ifac from sympy.core.numbers import Rational from sympy.core.c...
""" Cosmology routines: A module for various cosmological calculations. The bulk of the work is within the class :py:class:`Cosmology` which stores a cosmology and can calculate quantities like distance measures. """ from dataclasses import dataclass, asdict import numpy as np # Import integration routines from scip...
== "t" : toGuess = toGuess[:3] + "t" + toGuess[4:] if word[1] != "T" and word[1] != "t" and word[2] != "T" and word[2] != "t" and word[3] != "T" and word[3] != "t" : print("\nWrong!\n") numberOfErrors = numberOfErrors + 1 wrongChars = wrongChars + "t" + ", " if guessChar == "U" or guessChar == "u" ...
#!/usr/bin/env python3 # --------------------( LICENSE )-------------------- # Copyright (c) 2014-2022 Beartype authors. # See "LICENSE" for further details. ''' Project-wide :pep:`585`-compliant type hint utilities. This private submodule is *not* intended for importation by downstream callers. ''' # .................
<filename>3.7.0/lldb-3.7.0.src/scripts/Python/finishSwigPythonLLDB.py """ Python SWIG post process script for each language -------------------------------------------------------------------------- File: finishSwigPythonLLDB.py Overview: Python script(s) to post process SWIG Python C++ Script Bridge wrapper code...
XXXXXXX XXXXXXXXXX XXXX XXXXX XXXXXXXXXXXX XX X XXXXXX XXXXXXXX XXXXXXXXX XXXX XXXXX XXXXXXX XX X XXXXXX XXXXXXXXXXX XXXXXXXXXX XXXX XXXXX XXXXXXXXXX XX X XXXXXX XXXXXXXXXXX XXXXXXX XXXX XXXXX XXXX XXXXXXXX XX X XXXXXX XXXXXXXXXX XXXXXXXXXXX XXXX XXXXX XXXXXXX XX X XXXXXX XXXXXXXXXXX XXXXXXXXXX XXXX XXXXX XXXXXXXX...
large reach sets. order: the order of the sets. Should be one of set_generator.ORDER_XXX. Returns: A list of ScenarioConfigs of scenario 4(b) with subset sets. """ scenario_config_list = [] for num_large_sets in [1, int(num_sets / 2), num_sets - 1]: scenario_config_list.append( ScenarioConfig( name='-'.join([...
""" Personal Reader Emotion Topic model, extended from TTM <EMAIL> """ import numpy as np from scipy.sparse import lil_matrix from scipy.special import gammaln from datetime import datetime from datetime import timedelta from tqdm import tqdm import cPickle from functions import probNormalize, multinomial, logfactoria...
else: calp1 = max(-1.0, x) salp1 = math.sqrt(1 - Math.sq(calp1)) else: # Estimate alp1, by solving the astroid problem. # # Could estimate alpha1 = theta + pi/2, directly, i.e., # calp1 = y/k; salp1 = -x/(1+k); for _f >= 0 # calp1 = x/(1+k); salp1 = -y/k; for _f < 0 (need to check) # # However, it's better to...
<gh_stars>10-100 # -*- coding: utf-8 -*- # # test_tatoeba.py # cjktools # from __future__ import unicode_literals import os from .._common import to_unicode_stream, to_string_stream import unittest from six import text_type from functools import partial from datetime import datetime from cjktools.resources import ...
<reponame>Chamaco326/xraylarch<filename>larch/io/athena_project.py #!/usr/bin/env python """ Code to read and write Athena Project files """ import os import sys import time import json import platform from fnmatch import fnmatch from gzip import GzipFile from collections import OrderedDict from glob import glob imp...
<gh_stars>10-100 # -*- coding: utf-8 -*- """All security in windows is handled via Security Principals. These can be a user (the most common case), a group of users, a computer, or something else. Security principals are uniquely identified by their SID: a binary code represented by a string S-a-b-cd-efg... where e...
# Copyright (c) 2009-2019 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. # Maintainer: joaander / All Developers are free to add commands for new features r""" Update particle properties. When an updater is specified, it acts on the p...
#!/usr/bin/env python import base64 import wave import json import array import math from bridges.audio_channel import AudioChannel class AudioClip(object): """ @brief This class provides support for reading, modifying, and playing, audio waveform. This class provides a way to represent an AudioClip (think of a ...
def __init__(self, share_params=True, *args, **kwargs): super().__init__(*args, **kwargs) self.share_params = share_params def __call__(self, results): """Call function. For each dict in results, call the call function of `Resize` to resize image and corresponding annotations. Args: results (list[dict]): Lis...
<reponame>Novartis/EQP-QM #!/usr/bin/env python ## Copyright 2015 Novartis Institutes for BioMedical Research ## 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...
""" input_to_store = [] print(self._prompt) list_index = 1 user_input = self._get_and_validate_user_input(prompt=f"{list_index}.") while user_input: input_to_store.append(user_input) list_index += 1 user_input = self._get_and_validate_user_input(prompt=f"{list_index}.") if not input_to_store: input_to_store =...
simulation_pipe in simulation_pipes ] collapsed_pipe = Pipe.join(simulation_source, [ForeachFilter(simulation_filters)]) written_simulations = [] try: for simulation_id, learner_id, learner, pipe, simulation in zip(simulation_ids, learner_ids, learners, simulation_pipes, collapsed_pipe.read()): batches = simula...