filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_0_15697
#!/usr/bin/env python import sys sys.path.append('../') from logparser import LogMine input_dir = '../logs/HDFS/' # The input directory of log file output_dir = 'LogMine_result/' # The output directory of parsing results log_file = 'HDFS_2k.log' # The input log file name log_format = '<Date> <Time> <Pid> <...
the-stack_0_15698
import tensorflow as tf import numpy as np import models import matplotlib.pyplot as plt # Number of bootstrap heads HEADS_N = 10 x_data = np.linspace(0,10,100) y_data = np.sin(x_data) + np.random.normal(0, .2, x_data.shape) x_data = x_data.reshape(-1, 1) y_data = y_data.reshape(-1, 1) # bootstrap mask - generate on...
the-stack_0_15699
import logging import os from typing import Dict, List, Optional from airflow.operators.bash import BashOperator from airflow.models import DAG, DagRun from sciencebeam_airflow.utils.container import escape_helm_set_value from sciencebeam_airflow.utils.airflow import add_dag_macros from sciencebeam_airflow.utils.con...
the-stack_0_15700
# # 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"); you may not...
the-stack_0_15701
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from indico.modules.events.tracks.controllers import (RHCreateTrack, RHCreateTrackGroup, RHDeleteTrack, ...
the-stack_0_15702
import os import sys import subprocess import random class Plopper: def __init__(self,sourcefile,outputdir): # Initilizing global variables self.sourcefile = sourcefile self.outputdir = outputdir+"/tmp_files" if not os.path.exists(self.outputdir): os.makedirs(self.outp...
the-stack_0_15703
import commands import os import sys class EnvFileReader: def read_file(self, filename, env_var = os.environ): file_lines = open(filename,'r').readlines() line_num = 1 for line in file_lines: # get rid of comments line = line.split("#")[0] # strip whitespace from ends line = line.strip() # check ...
the-stack_0_15704
"""Utilities for with-statement contexts. See PEP 343.""" import abc import sys import _collections_abc from collections import deque from functools import wraps from types import MethodType __all__ = ["asynccontextmanager", "contextmanager", "closing", "nullcontext", "AbstractContextManager", "AbstractAsy...
the-stack_0_15705
from tkinter import * root=Tk() root.title("CAR RENTAL RECEIPT") root.geometry('700x800') #Labels g1=Label(root, text="CAR RENTAL RECEIPT", font="Calibri 18 bold") l1=Label(root, text="Date: ") e1=Entry(root,width=30, borderwidth=2) l2=Label(root, text="Receipt #: ") e2=Entry(root,width=30, borderwidth=2) l3=Label(...
the-stack_0_15706
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
the-stack_0_15709
# -*- coding: utf-8 -*- from distutils.core import setup from setuptools import find_packages with open('.meta/packages') as reqs: install_requires = reqs.read().split('\n') setup( name='rpihelper', version='0.0.3', author='Nikita Grishko', author_email='grin.minsk@gmail.com', url='https://...
the-stack_0_15710
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path...
the-stack_0_15711
# coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # --------------------------------------------------------------------...
the-stack_0_15714
import numpy as np from torch import nn import torch from encoder.params_model import * from encoder.params_data import * from encoder.data_objects.iemocap_dataset import emo_categories class EmoEncoder(nn.Module): def __init__(self, device): super().__init__() self.device = device self....
the-stack_0_15716
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from torch.nn import functional as F from fcos_core.layers import smooth_l1_loss from fcos_core.modeling.box_coder import BoxCoder from fcos_core.modeling.matcher import Matcher from fcos_core.structures.boxlist_ops import boxlist_iou...
the-stack_0_15717
import unittest import sys try: import aula1_resp as aula1 except ImportError: print('Erro: o arquivo aula1.py não foi encontrado') sys.exit(1) MAX_PRIMES = 10000 def primes_sieve(limit): limitn = limit+1 not_prime = [False] * limitn primes = [] for i in range(2, limitn): if not_prime[i]: continue for...
the-stack_0_15718
# encoding: utf-8 from __future__ import unicode_literals, absolute_import import os import sys import locale from itertools import chain from six import iterkeys, iteritems from six.moves.configparser import ConfigParser from .autocomplete import SIMPLE as default_completion, ALL_MODES class Struct(object): "...
the-stack_0_15719
#!/usr/bin/env python # This will try to import setuptools. If not here, it will reach for the embedded # ez_setup (or the ez_setup package). If none, it fails with a message import sys from codecs import open try: from setuptools import find_packages, setup from setuptools.command.test import test as TestCom...
the-stack_0_15720
import os import random from collections import namedtuple import numpy as np import torch import torch.utils.data as data from PIL import Image import h5py from lilanet.datasets.transforms import Compose, RandomHorizontalFlip, Normalize class DENSE(data.Dataset): """`DENSE LiDAR`_ Dataset. Args: r...
the-stack_0_15726
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
the-stack_0_15727
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
the-stack_0_15728
import numpy as np import cv2 from os.path import * import math # trs, let's assume width is always wider than height def video_to_npy(infile, outfile=None, width=None, height=None, squarecrop=None, fps=None, mode='rgb', maxlength=None, use_cache=False): global vcache if use_cache and outfile is not None an...
the-stack_0_15729
#!/usr/bin/env python # Fit proper motion and parallax using ra/dec/mjd data # Most of this code was taken from here: # https://github.com/ctheissen/WISE_Parallaxes/blob/master/WISE_Parallax.py import numpy as np from astropy.table import Table, vstack, join import matplotlib.pyplot as plt from astropy import units ...
the-stack_0_15730
# Time: O(n) # Space: O(1) class ListNode(object): def __init__(self, x): self.val = x self.next = None def __str__(self): if self: return "{}".format(self.val) else: return None class Solution(object): # @param head, a ListNode # @return a lis...
the-stack_0_15731
from sqlbag import S from schemainspect import get_inspector CREATE = """ DROP SCHEMA IF EXISTS it CASCADE; CREATE SCHEMA it; CREATE FUNCTION it.key_func(jsonb) RETURNS int AS $$ SELECT jsonb_array_length($1); $$ LANGUAGE SQL IMMUTABLE; CREATE FUNCTION it.part_func(jsonb) RETURNS boolean AS $$ SELECT jsonb_typeof($...
the-stack_0_15733
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mining RPCs - getmininginfo - getblocktemplate proposal mode - submitblock""" import copy from b...
the-stack_0_15736
from netatmobeat import BaseTest import os class Test(BaseTest): def test_base(self): """ Basic test with exiting Netatmobeat normally """ self.render_config_template( path=os.path.abspath(self.working_dir) + "/log/*" ) netatmobeat_proc = self.start_b...
the-stack_0_15737
#!/usr/bin/env python3 from dataclasses import dataclass, field from typing import List, Type from ml.rl.models.actor import GaussianFullyConnectedActor from ml.rl.models.base import ModelBase from ml.rl.net_builder.continuous_actor_net_builder import ContinuousActorNetBuilder from ml.rl.parameters import Normalizati...
the-stack_0_15740
""" power_meter_hardware.py "__" """ __author__ = "Prakash Manandhar, and Sophie Yang" __copyright__ = "Copyright 2021, Hydration Team" __credits__ = ["Prakash Manandhar, and Sophie Yang"] __license__ = "Internal" __version__ = "1.0.0" __maintainer__ = "Sophie Yang" __email__ = "scyang@mit.edu" __status__ = "Pro...
the-stack_0_15745
from django.core.exceptions import ValidationError from django.core.validators import RegexValidator, URLValidator from django.utils.encoding import force_text from django.utils.safestring import mark_safe from django.utils.translation import gettext from cms.utils.page import get_all_pages_from_path from cms.utils.ur...
the-stack_0_15746
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Any, Callable, Dict, List, Optional, Tuple import numpy as np import torch from ax.models.base im...
the-stack_0_15750
# Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. """ hbmqtt_pub - MQTT 3.1.1 publisher Usage: hbmqtt_pub --version hbmqtt_pub (-h | --help) hbmqtt_pub --url BROKER_URL -t TOPIC (-f FILE | -l | -m MESSAGE | -n | -s) [-c CONFIG_FILE] [-i CLIENT_ID] [-q | --qos QOS] [-...
the-stack_0_15751
# Caeser Encryption import sys if (__name__ == "__main__"): def readFile (path): file = open(path, "r") lineList = [] for line in file: lineList.append(line) #print(lineList) return lineList def encrypt (lines,x): encrypted = [] for line in lines: for idx in range(0,len(line)-1): num = or...
the-stack_0_15756
''' @Author: hua @Date: 2019-12-03 14:44:23 @description: @LastEditors: hua @LastEditTime: 2019-12-03 15:18:00 ''' from app.Models.Admin import Admin from sqlalchemy import event import time @event.listens_for(Admin, "before_insert") def admin_before_insert(mapper, connection, target): target.add_time = int(time....
the-stack_0_15757
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
the-stack_0_15763
import dsd, os path = 'ADItotal\\' lista = os.listdir(path) dsd.limpar_arquivo('ADItotal(sem_andamentos).txt') dsd.limpar_arquivo('ADItotal(andamentos).txt') dsd.limpar_arquivo('excluidos.txt') partes_total = [] dados_csv = [] andamentos_csv = [] lista_excluidos = [] dsd.limpar_arquivo('ADItotalpartes...
the-stack_0_15764
import pytest from Cryptodome.PublicKey import RSA from django.urls import reverse from oidc_provider.models import RESPONSE_TYPE_CHOICES, RSAKey, UserConsent from oidc_apis.factories import ApiFactory, ApiScopeFactory from users.factories import OIDCClientFactory, UserFactory from users.views import TunnistamoOidcAut...
the-stack_0_15766
import numpy as np from pyscf import gto, scf from kspies import wy mol = gto.M(atom = 'N 0 0 0 ; N 1.1 0 0', basis = 'cc-pVDZ') mf = scf.RHF(mol).run() dm_tar = mf.make_rdm1() PBS = gto.expand_etbs([(0, 13, 2**-4 , 2), (1, 3 , 2**-2 , 2)]) mw = wy.RWY(mol, dm_tar, pbas=PBS) #Note ...
the-stack_0_15768
#!/usr/bin/env python # Construct a command that will create a texture, appending console # output to the file "out.txt". def omaketx_command (infile, outfile, extraargs="", options="", output_cmd="-otex", showinfo=True, showinfo_extra="", silent=False, c...
the-stack_0_15769
# Always prefer setuptools over distutils from setuptools import setup # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, "README.md"), encoding="utf-8") as f: long_descri...
the-stack_0_15770
from cereal import car from common.numpy_fast import mean from selfdrive.config import Conversions as CV from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser from selfdrive.car.interfaces import CarStateBase from selfdrive.car.gm.values import DBC, CAR, AccState, CanBus, \ ...
the-stack_0_15771
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2020, John McNamara, jmcnamara@cpan.org # from ..excel_comparison_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
the-stack_0_15772
import os import unittest from shutil import rmtree import numpy as np class TestSkeletonIo(unittest.TestCase): shape = 128 n_nodes = 100 tmp_folder = './tmp' def setUp(self): os.makedirs(self.tmp_folder, exist_ok=True) def tearDown(self): try: rmtree(self.tmp_folder...
the-stack_0_15773
from exception_wrappers.libraries.playhouse.apsw_ext import * def migrate(migrator, database): # Account migrator.add_column('account', 'deleted', BooleanField(default=False)) # # Schema specification (for migration verification) # SPEC = { 'account': { 'id': 'INTEGER PRIMA...
the-stack_0_15774
import numpy as np from gym.spaces import Box from metaworld.envs.asset_path_utils import full_v1_path_for from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set class SawyerBasketballEnv(SawyerXYZEnv): def __init__(self): liftThresh = 0.3 goal_low = (-0.1...
the-stack_0_15776
from pgshovel.interfaces.replication_pb2 import ( State, StreamState, ) from pgshovel.replication.validation.bootstrap import validate_bootstrap_state from pgshovel.replication.validation.consumers import validate_consumer_state from pgshovel.replication.validation.transactions import validate_transaction_state...
the-stack_0_15777
"""This module provides file I/O for Quake BSP2 map files. Example: bsp_file = bsp.Bsp.open('ad_sepulcher.bsp') """ import struct from .bsp29 import Bsp as Bsp29 __all__ = ['is_bspfile', 'Bsp'] IDENTITY = b'BSP2' def _check_bspfile(fp): fp.seek(0) data = fp.read(struct.calcsize('<4s')) identity...
the-stack_0_15778
import os import setuptools dir_repo = os.path.abspath(os.path.dirname(__file__)) # read the contents of REQUIREMENTS file with open(os.path.join(dir_repo, "requirements.txt"), "r") as f: requirements = f.read().splitlines() # read the contents of README file with open(os.path.join(dir_repo, "README.md"), encoding...
the-stack_0_15780
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- from . import _utils, _io, _logger from ._graph_execution_manager import...
the-stack_0_15782
# Copyright (C) 2011-2020 Airbus, Louis.Granboulan@airbus.com import sys, os import logging log = logging.getLogger("plasmasm") try: # Check amoco dependency on OrderedDict from collections import OrderedDict del OrderedDict except ImportError: log.error('amoco backend needs python 2.7, with OrderedDict...
the-stack_0_15785
# coding: utf-8 import copy import numpy as np from flearn.common.distiller import DFDistiller, KDLoss from .strategy import ParentStrategy from .utils import convert_to_tensor class DF(ParentStrategy): """ Ensemble distillation for robust model fusion in federated learning [1] Lin T, Kong L, Stich S ...
the-stack_0_15787
import webloader from bs4 import BeautifulSoup as soup def get_company_credentials(url): html = webloader.load(url) return html_to_list(html) def html_to_list(html): page_soup = soup(html, "html.parser") table = page_soup.find("div", {"class": "govspeak"}).table.findAll("tr") table_list = [] ...
the-stack_0_15794
# # Copyright (c) 2006-2019, RT-Thread Development Team # # SPDX-License-Identifier: Apache-2.0 # # Change Logs: # Date Author Notes # 2019-03-21 Bernard the first version # 2019-04-15 armink fix project update error # import os import sys import glob from utils import * from utils ...
the-stack_0_15795
""" API operations allowing clients to determine datatype supported by Galaxy. """ from galaxy.web import _future_expose_api_anonymous_and_sessionless as expose_api_anonymous_and_sessionless from galaxy import exceptions from galaxy.web.base.controller import BaseAPIController from galaxy.util import asbool from galax...
the-stack_0_15797
"""Webroot plugin.""" import argparse import collections import json import logging from typing import DefaultDict from typing import Dict from typing import List from typing import Set from acme import challenges from certbot import crypto_util from certbot import errors from certbot import interfaces from certbot._i...
the-stack_0_15801
log_level = 'INFO' load_from = None resume_from = None dist_params = dict(backend='nccl') workflow = [('train', 1)] checkpoint_config = dict(interval=50) evaluation = dict(interval=50, metric='mAP', key_indicator='AP') optimizer = dict( type='Adam', lr=0.0015, ) optimizer_config = dict(grad_clip=None) # learni...
the-stack_0_15803
#!/usr/bin/env python # coding: utf-8 # In[7]: #!/usr/bin/env python # coding: utf-8 # In[1]: """ This script will check for the zip codes format and whether it begins with a 68 for the City of Omaha """ import xml.etree.cElementTree as ET from collections import defaultdict import re import pprint osmfile = 'o...
the-stack_0_15806
import logging import examples.basic.main as basic import sim.docker as docker from sim.core import Environment from sim.faas import FunctionDefinition, FunctionSimulator, FunctionReplica, FunctionRequest from sim.faassim import Simulation logger = logging.getLogger(__name__) def main(): logging.basicConfig(lev...
the-stack_0_15807
from .. utils import TranspileTestCase, BuiltinFunctionTestCase class BinTests(TranspileTestCase): def test_int_but_no_index(self): self.assertCodeExecution(""" class IntLike: def __init__(self, val): self.val = val def __int__(self): ...
the-stack_0_15808
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch import torch.nn.functional as F from fairseq import utils from fairseq.criterions import LegacyFairseqCriterion, reg...
the-stack_0_15810
# -*- coding: utf-8 -*- """ author: 左想 date: 2018-01-11 """ import cv2 import random import numpy as np from math import fabs, sin, cos, radians from PIL import Image, ImageDraw, ImageEnhance def img_rotation(file_path, output, degree, is_full): """ 对图片进行旋转,并另存为旋转后的图片; :param file_path: String 图片路径...
the-stack_0_15811
import numpy as np import pytest from docarray import DocumentArray from docarray.array.qdrant import DocumentArrayQdrant from docarray.array.sqlite import DocumentArraySqlite from docarray.array.annlite import DocumentArrayAnnlite, AnnliteConfig from docarray.array.storage.qdrant import QdrantConfig from docarray.arr...
the-stack_0_15813
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2020 Edgewall Software # Copyright (C) 2004 Francois Harvey <fharvey@securiweb.net> # Copyright (C) 2005 Matthew Good <trac@matt-good.net> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as par...
the-stack_0_15814
# -*- coding: utf-8 -*- """ pygments.lexers.sas ~~~~~~~~~~~~~~~~~~~ Lexer for SAS. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, words from pygments.token import...
the-stack_0_15815
#!/usr/bin/env python """ """ # ============================================================================== # --General imports ------------------------------------------------------------ # ============================================================================== from time import sleep import math import num...
the-stack_0_15816
"""Data types for agent-based learning.""" import collections import enum import akro import numpy as np from garage.np import concat_tensor_dict_list, slice_nested_dict # pylint: disable=too-many-lines class EpisodeBatch( collections.namedtuple('EpisodeBatch', [ 'env_spec', 'observ...
the-stack_0_15817
#!/usr/local/bin/python3 import argparse import random class GenerationConfig: count = 0 maximum = 0 minimum = 0 def __init__(self, count = 100, maximum = 100, minimum = 0): if count <= 0: raise Exception("Count must be positive!") if minimum >= maximum: raise...
the-stack_0_15818
"""Utility functions for tensor operations """ import numpy as np from six.moves import xrange def _check_1d_vector(vector): """Check 1D vector shape Check 1D vector shape. array with shape [n, 1] or [n, ] are accepted. Will return a 1 dimension vector. Parameters ---------- vector : a...
the-stack_0_15821
""" Analysis code for IGMSurvey objects """ from __future__ import print_function, absolute_import, division, unicode_literals import numpy as np import glob import json import pdb from astropy.table import Table from linetools import utils as ltu def calc_slgrid_atan(surveys, Agrid, Bgrid, Cgrid, C2grid): ""...
the-stack_0_15822
# 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"); you may not u...
the-stack_0_15824
import copy from membase.helper.cluster_helper import ClusterOperationHelper from couchbase_helper.documentgenerator import BlobGenerator from .xdcrnewbasetests import XDCRNewBaseTest from .xdcrnewbasetests import NodeHelper from .xdcrnewbasetests import Utility, BUCKET_NAME, OPS from remote.remote_util import RemoteM...
the-stack_0_15825
# -*- coding: utf-8 -*- """ Provides the service module for systemd .. versionadded:: 0.10.0 .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.start' is not available*), see :ref:`here...
the-stack_0_15829
from __future__ import unicode_literals import hashlib import itertools import json import re from ..compat import compat_HTTPError, compat_str from ..utils import (ExtractorError, float_or_none, get_element_by_attribute, int_or_none, lowercase_escape, std_headers, try_get, u...
the-stack_0_15830
import time import inspect from functools import update_wrapper from fixate.core.common import mode_builder, unit_scale from fixate.core.exceptions import ParameterError, InstrumentError from fixate.drivers.funcgen.helper import FuncGen MODES = { ":SINusoid": { " [{frequency}]": {",[{amplitude}]": {",[{off...
the-stack_0_15832
from __future__ import unicode_literals import os import re import sys import types from django.conf import settings from django.core.urlresolvers import Resolver404, resolve from django.http import ( HttpRequest, HttpResponse, HttpResponseNotFound, build_request_repr, ) from django.template import Context, Engin...
the-stack_0_15835
EPSILON = 1e-5 DICT_ALIASES_CORE = { 'node': 'NODE', 'displacement': 'DISPLACEMENT', 'disp': 'DISPLACEMENT', 'nodal_stress': 'NodalSTRESS', 'nodal_strain': 'NodalSTRAIN', 'nodal_mises': 'NodalMISES', 't_init': 'INITIAL_TEMPERATURE', 't_cnt': 'CNT_TEMPERATURE', 'reac': 'REACTION_FORC...
the-stack_0_15836
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015, Perceivon Hosting Inc. # Copyright 2021, Vladimir Botka <vbotka@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source co...
the-stack_0_15837
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
the-stack_0_15838
import numpy as np import scipy.stats as stats from sira.modelling.structural import Base from sira.modelling.structural import Element as _Element from sira.modelling.structural import Info class Algorithm: @staticmethod def factory(response_params): function_name = response_params["function_name"]...
the-stack_0_15839
# Copyright (c) 2014 Intel Corporation. # # 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...
the-stack_0_15840
import re import textwrap from ast import literal_eval from inspect import cleandoc from weakref import WeakKeyDictionary from parso.python import tree from parso.cache import parser_cache from parso import split_lines _EXECUTE_NODES = {'funcdef', 'classdef', 'import_from', 'import_name', 'test', 'o...
the-stack_0_15845
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2021, Phillipe Smith <phsmithcc@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: run...
the-stack_0_15846
# Copyright (C) 2019 Project AGI # # 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 writi...
the-stack_0_15847
"""train finetune""" # Copyright 2021 Huawei Technologies Co., Ltd # # 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 applic...
the-stack_0_15848
# coding: utf-8 from __future__ import absolute_import from bitmovin_api_sdk.common import BaseApi, BitmovinApiLoggerBase from bitmovin_api_sdk.common.poscheck import poscheck_except from bitmovin_api_sdk.models.audio_volume_filter import AudioVolumeFilter from bitmovin_api_sdk.models.bitmovin_response import Bitmovi...
the-stack_0_15849
# -*- coding: utf-8 -*- """ DWX_ZMQ_Execution.py -- @author: Darwinex Labs (www.darwinex.com) Copyright (c) 2019 onwards, Darwinex. All rights reserved. Licensed under the BSD 3-Clause License, you may not use this file except in compliance with the License. You may obtain a...
the-stack_0_15851
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HugginFace 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/LICENS...
the-stack_0_15852
import os, tempfile, subprocess from string import Template from PuzzleLib import Config from PuzzleLib.Compiler.JIT import getCacheDir, computeHash, FileLock from PuzzleLib.Cuda.SourceModule import SourceModule, ElementwiseKernel, ElementHalf2Kernel, ReductionKernel from PuzzleLib.Cuda.SourceModule import eltwiseTes...
the-stack_0_15853
# Written by Hannah Horng (hhorng@seas.upenn.edu) import pandas as pd import neuroCombat as nC from sklearn.preprocessing import LabelEncoder import matplotlib.pyplot as plt from scipy.stats import ranksums, ttest_ind, ttest_rel, ks_2samp import os def NestedComBat(dat, covars, batch_list, categorical_cols=None, cont...
the-stack_0_15854
import subprocess import re # ************************************************ # remove_custom_emoji # 絵文字IDは読み上げない # ************************************************ def remove_custom_emoji(text): #pattern = r'<:[a-zA-Z0-9_]+:[0-9]+>' # カスタム絵文字のパターン pattern = r'<:' # カスタム絵文字のパターン text = re.sub(...
the-stack_0_15855
''' The Pool.map and Pool.apply will lock the main program until all a process is finished, which is quite useful if we want to obtain resuls in a particular order for certain applications. In contrast, the async variants will submit all processes at once and retrieve the results as soon as they are finished. One more ...
the-stack_0_15857
from operator import attrgetter import pyangbind.lib.xpathhelper as xpathhelper from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType from pyangbind.lib.base import PybindBase from d...
the-stack_0_15861
import numpy as np import cv2 as cv ''' Based on GeeksForGeeks article with an opticalFLow demonstration ''' def opticalFlow(img1_path,img2_path,blur=False,maxValue=True): ''' Optical flow between two images inputs: two consecutive images, blur: Boolean - adds blurring to the image for filtering...
the-stack_0_15864
"""Utilities for processing test outputs.""" import pathlib import re import subprocess from pathlib import Path from typing import Iterator, Tuple def split_string( string: str, sub_length: int = 40, copy: bool = False ) -> Tuple[str, ...]: """Split a string into subsections less than or equal to new length....
the-stack_0_15866
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import int_or_none class TumblrIE(InfoExtractor): _VALID_URL = r'https?://(?P<blog_name>[^/?#&]+)\.tumblr\.com/(?:post|video)/(?P<id>[0-9]+)(?:$|[/?#])' _TESTS = [{ 'url': 'ht...
the-stack_0_15867
import re import threading from typing import Any from antlr4 import CommonTokenStream, InputStream, ParserRuleContext from antlr4.error.ErrorListener import ErrorListener from .errors import GrammarParseError # Import from visitor in order to check the presence of generated grammar files # files in a single place. ...
the-stack_0_15868
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import pytest # test.BACKEND_NAME is a configuration variable determining which # nGraph backend tests will use. It's set during pytest configuration time. # See `pytest_configure` hook in `conftest.py` for more details. BACKEND_NAME = ...
the-stack_0_15869
######################################################################### ## This file is part of the alpha-beta-CROWN verifier ## ## ## ## Copyright (C) 2021, Huan Zhang <huan@huan-zhang.com> ## ## K...
the-stack_0_15870
# Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
the-stack_0_15871
import types import sys import os import io from pathlib import Path from urllib.parse import urlparse import logging import asyncio import tarfile from io import BytesIO import mimetypes import functools import ssl import click from girder_client import GirderClient from flask import Flask, send_from_directory, jsoni...