id
stringlengths
3
8
content
stringlengths
100
981k
9995088
import re from datetime import datetime import discord from PIL import ImageColor from d4dj_utils.master.chart_master import ChartDifficulty from d4dj_utils.master.common_enums import ChartSectionType from d4dj_utils.master.music_master import MusicMaster from miyu_bot.bot.bot import PrefContext from miyu_bot.command...
9995117
import os import sys from pathlib import Path from subprocess import CalledProcessError from unittest.mock import call, patch import pytest from click.testing import CliRunner from app_enabler.cli import cli from app_enabler.errors import messages from tests.utils import working_directory def test_cli_install_wrong...
9995123
import FreeCAD, FreeCADGui import Points import lithophane_utils from utils.geometry_utils import linesToPointCloud from utils.resource_utils import iconPath import utils.qtutils as qtutils def showPointCloud(pts, name): pointCloud = Points.Points() pointCloud.addPoints(linesToPointCloud(pts)) Points.sho...
9995125
from easydict import EasyDict config = EasyDict() config.dataset_dir = './datasets/dped/' config.checkpoint_dir = './checkpoints/' config.tensorboard_dir = './tensorboard/' config.phone = 'blackberry' # ['blackberry', 'iphone', 'sony'] config.batch_size = 30 config.width = 100 config.height = 100 config.channels =...
9995166
from math import ceil, floor from nullroute.string import fmt_size_short from shutil import get_terminal_size import sys import time class ProgressBar(): def __init__(self, max_value, *, file=None, fmt_func=None): self.bar_width = 40 self.num_incrs = 0 self.cur_value = 0 self.max_va...
9995191
from dateutil.parser import parse from lux.utils import test from tests.odm.utils import OdmUtils class TestPostgreSql(OdmUtils, test.AppTestCase): @classmethod async def beforeAll(cls): cls.super_token = await cls.user_token('testuser', jwt=cls.admin_jwt) async def test_odm(self): tab...
9995223
from typing import Optional, Tuple, List import struct import asyncio import pathlib def parse_query(data: bytes) -> Tuple[int, List[bytes]]: header = data[:12] payload = data[12:] ( transaction_id, flags, num_queries, num_answers, num_authority, num_additi...
9995227
import numpy as np llf = np.array([-240.29558272688]) nobs = np.array([ 202]) k = np.array([ 5]) k_exog = np.array([ 1]) sigma = np.array([ .79494581155191]) chi2 = np.array([ 1213.6019521322]) df_model = np.array([ 3]) k_ar = np.array([ 2]) k...
9995264
from django.test import TestCase from django.core.management import call_command from django.utils.six import StringIO import shutil import os from generate_secret_key.management.commands.generate_secret_key import Command class ImportCsvCommandTests(TestCase): command_name = 'generate_secret_key' BASE_DIR =...
9995280
from MyPyWidgets.ButtonClass import Button from MyPyWidgets.SpinBoxClass import SpinBox from MyPyWidgets.LabelClass import Label from MyPyWidgets.InputFieldClass import InputField from MyPyWidgets.CheckButtonClass import CheckButton from MyPyWidgets.DropDownClass import DropDown from MyPyWidgets.MyPyWindow3Class import...
9995332
import random import math import fractions from ..__init__ import * from .algebra import * from .basic_math import * from .calculus import * from .computer_science import * from .geometry import * from .misc import * from .statistics import *
9995335
import importlib import os import warnings from torch.utils.data import DataLoader, DistributedSampler from e2edet.dataset.helper import ShardDistribtedSampler from e2edet.dataset.base import BaseDataset from e2edet.utils.general import get_batch_size from e2edet.utils.distributed import get_world_size TASK_DATASET...
9995377
import backtrader as bt import datetime as dt import csv class BitcoinFeed(bt.feeds.GenericCSVData): params = (('high', 1),('low',1),('close',1),('volume', 2),('openinterest',-1)) def _loadline(self, linetokens): dtfield = linetokens[self.p.datetime] dtime = dt.datetime.utcfromtimestamp(int(d...
9995401
import xmltodict import pytest from jmeter_api.configs.user_defined_variables.elements import Argument, UserDefineVariables from jmeter_api.basics.utils import tag_wrapper class TestArgument: class TestName: def test_type_check(self): with pytest.raises(TypeError): Argument(na...
9995410
from django.core.management.base import BaseCommand from onadata.apps.logger.models import XForm from onadata.settings.local_settings import XML_VERSION_MAX_ITER import os import re class Command(BaseCommand): help = 'Check if version exists in xform xml' def add_arguments(self, parser): parser.add_a...
9995413
import dash from dash import dcc, html, Output, Input, State import dash_labs as dl import dash_bootstrap_components as dbc app = dash.Dash( __name__, plugins=[dl.plugins.pages], external_stylesheets=[dbc.themes.BOOTSTRAP, dbc.icons.FONT_AWESOME], ) navbar = dbc.NavbarSimple( dbc.DropdownMenu( ...
9995418
import io import os import time import atexit import datetime import threading from queue import Queue, Empty import Utils import Model from GetResults import ResetVersionRAM from WebServer import WsRefresh q = None streamer = None terminateMessage = '<<<terminate>>>' def formatTimeHHMMSS( secs ): return Utils.for...
9995432
import shutil import os os.makedirs('temp/dir1/dir', exist_ok=True) os.makedirs('temp/dir2', exist_ok=True) with open('temp/dir1/file.txt', 'w') as f: f.write('original') print(os.listdir('temp/dir1/')) # ['file.txt', 'dir'] print(os.listdir('temp/dir2/')) # [] new_path = shutil.move('temp/dir1/file.txt', 'tem...
9995435
import gspread import youtube_dl from pathlib import Path import sys import datetime import boto3 import os from dotenv import load_dotenv from botocore.errorfactory import ClientError import argparse import math import ffmpeg import threading import time from bs4 import BeautifulSoup import requests load_dotenv() d...
9995436
from collections import defaultdict from typing import Any, Iterable, Dict, List, Tuple, Union from numpy import ndenumerate, ndarray from py4j.java_collections import JavaList from py4j.java_gateway import java_import, JavaObject from keanu.algorithm._proposal_distribution import ProposalDistribution from keanu.cont...
9995450
from __future__ import print_function from argparse import ArgumentParser import sys sys.path.insert(0, 'src') import os, random, subprocess, evaluate, shutil from utils import exists, list_files import pdb TMP_DIR = '.fns_frames_%s/' % random.randint(0,99999) DEVICE = '/gpu:0' BATCH_SIZE = 4 def build_parser(): ...
9995480
from factory import SubFactory, Sequence, post_generation from factory.django import DjangoModelFactory from events.tests.factories import UserFactory from jobs.models import Job class JobFactory(DjangoModelFactory): class Meta: model = Job owner = SubFactory(UserFactory) title = Sequence(lambda...
9995497
from django.apps import apps as django_apps from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import gettext_lazy as _ def get_reference_model(): try: return django_apps.get_model( settings.BASED_...
9995546
from transformers import GPT2LMHeadModel, GPT2Tokenizer from causal_transformer_decoder import ( CausalTransformerDecoder, CausalTransformerDecoderLayer, ) import torch import torch.nn as nn import time import numpy as np device = "cuda" if torch.cuda.is_available() else "cpu" hdim = 768 nhead = 12 dim_feedfor...
9995551
from Interprete.NodoAST import NodoArbol from Interprete.Tabla_de_simbolos import Tabla_de_simbolos from Interprete.Arbol import Arbol from Interprete.Valor.Valor import Valor from Interprete.SELECT.indexador_auxiliar import indexador_auxiliar from Interprete.SELECT.indexador_auxiliar import IAT from Interprete.simbolo...
9995585
from annotypes import Anno, add_call_types from malcolm.core import ( APartName, Display, NumberMeta, Part, PartRegistrar, Widget, config_tag, ) from ..hooks import ReportStatusHook, UInfos from ..infos import MinTurnaroundInfo with Anno("Initial value for min time between non-joined poin...
9995696
import pygame import pygame._view from pygame.locals import * import sys import random pygame.init() class Cell(pygame.sprite.Sprite): def __init__(self, game, pos, num): pygame.sprite.Sprite.__init__(self) self.game = game self.num = num self.color = self.getColor() ...
9995699
import lambentlight.client as client async def show_builds(ready_only: bool): """ Shows the full list of builds. """ # Get the list of builds builds = await client.get("/builds") # And print those needed values = [] for build in builds: if ready_only and not build["is_ready"]: ...
9995726
import angr proj = angr.load_shellcode(b")\xd8", arch="x86") state = proj.factory.blank_state() #state.solver.add(state.regs.eflags == 0x202) #print(state.regs.eflags) state.regs.eax = state.solver.BVV(0, 32) state.regs.ebx = state.solver.BVV(1<<31, 32) successor = state.step()[0] print(successor.regs.eflags)
9995727
from __future__ import absolute_import, unicode_literals from unittest import TestCase from invoke_release import tasks class TestTasks(TestCase): """ At a later point, we will write some actual tests. This project is difficult to test with automated tests, and we largely rely on manual tests. """ ...
9995811
from typing import Optional, List, Set, Tuple from problog.engine import GenericEngine from problog.logic import Term from problog.program import PrologFile, SimpleProgram from mai_version.IO.input_format import KnowledgeBaseFormat from mai_version.IO.label_collector import LabelCollectorMapper from mai_version.IO.pa...
9995939
import nltk expr_read = nltk.sem.DrtExpression.fromstring expr2 = expr_read('([x,y], [John(x), Went(x),Sam(y),Meet(x,y)])') print(expr2) expr2.draw() print(expr2.fol())
9995988
import cupy as np def kernel(TSTEPS, A, B): for t in range(1, TSTEPS): B[1:-1, 1:-1] = 0.2 * (A[1:-1, 1:-1] + A[1:-1, :-2] + A[1:-1, 2:] + A[2:, 1:-1] + A[:-2, 1:-1]) A[1:-1, 1:-1] = 0.2 * (B[1:-1, 1:-1] + B[1:-1, :-2] + B[1:-1, 2:] + ...
9995993
from app.mongo_connect import MongoConnect from eliza.config import ConfigLoader from datetime import datetime, timedelta from app import state class DatabaseHelper: def __init__(self, environment): config_loader = ConfigLoader(verify=False) self.config = config_loader.load_config("resources/", env...
9995996
from setuptools import setup setup(name='gservice', version='0.1', install_requires=['requests==2.4.3'], packages=['gservice', 'gservice.api', 'gservice.calls'], test_suite='tests', )
9996000
from typing import Dict from botocore.paginate import Paginator class ListAliases(Paginator): def paginate(self, OrganizationId: str, EntityId: str, PaginationConfig: Dict = None) -> Dict: """ Creates an iterator that will paginate through responses from :py:meth:`WorkMail.Client.list_aliases`. ...
9996002
import numpy as np from scipy.stats import binned_statistic_2d import matplotlib.pyplot as plt from matplotlib.patches import Circle, Rectangle, Arc import seaborn as sns from bokeh.plotting import figure, ColumnDataSource from bokeh.models import HoverTool from math import pi sns.set_style('white') sns.set_color_cod...
9996013
from edtf.parser.grammar import parse_edtf from edtf.natlang import text_to_edtf from edtf.parser.parser_classes import * from edtf.convert import dt_to_struct_time, struct_time_to_date, \ struct_time_to_datetime, trim_struct_time, struct_time_to_jd, \ jd_to_struct_time
9996033
import pytest from asgiref.sync import sync_to_async from channels.testing import WebsocketCommunicator from v1.notifications.constants import PRIMARY_VALIDATOR_UPDATED_NOTIFICATION from v1.notifications.status_updates import send_primary_validator_updated_notification from ..consumers.primary_validator_updated import...
9996097
import yaml try: yaml.warnings({'YAMLLoadWarning': False}) # not all versions of YAML support this except AttributeError: pass from .builders.jupyter import JupyterBuilder from .builders.jupyterpdf import JupyterPDFBuilder from .directive.jupyter import jupyter_node from .directive.jupyter import Jupyter as ...
9996114
import os from django.core.management.base import BaseCommand from poetry.apps.corpus.models import Poem from poetry.settings import BASE_DIR class Command(BaseCommand): def handle(self, *args, **options): poems = Poem.objects.all() directory = os.path.join(BASE_DIR, "datasets", "corpus", "all_ra...
9996165
from test import multibytecodec_support import unittest class Test_GB2312(multibytecodec_support.TestBase, unittest.TestCase): encoding = 'gb2312' tstring = multibytecodec_support.load_teststring('gb2312') codectests = (b'abc\x81\x81\xc1\xc4', 'strict', None), (b'abc\xc8', 'strict', None), (b'abc\...
9996168
import unittest from slack.signature import SignatureVerifier class MockClock: def now(self) -> float: return 1531420618 class TestSignatureVerifier(unittest.TestCase): def setUp(self): pass def tearDown(self): pass # https://api.slack.com/authentication/verifying-requests...
9996192
import BPG from BPG.gds.io import GDSImport class TestGDSImport(BPG.PhotonicTemplateBase): @classmethod def get_params_info(cls): return dict( gds_path='Path to gds to import' ) def draw_layout(self): master = self.new_template(params=self.params, temp_cls=GDSImport) ...
9996200
import sys from spacy.lang.fi import FinnishDefaults from spacy.lang.char_classes import LIST_PUNCT, LIST_ELLIPSES, LIST_QUOTES, LIST_ICONS from spacy.lang.char_classes import LIST_HYPHENS, CURRENCY, UNITS from spacy.lang.char_classes import CONCAT_QUOTES, ALPHA, ALPHA_LOWER, ALPHA_UPPER, PUNCT from spacy.language impo...
9996203
from wallace import nodes, db, information, models class TestEnvironments(object): def setup(self): """Set up the environment by resetting the tables.""" self.db = db.init_db(drop_all=True) def teardown(self): self.db.rollback() self.db.close() def add(self, *args): ...
9996205
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch import Tensor import numpy as np from...
9996216
import pprint from ggplib.non_gdl_games.draughts import desc, model def test_model(): m = model.create_sm_model(desc.BoardDesc(10)) pprint.pprint(m.roles) pprint.pprint(m.bases) pprint.pprint(m.actions)
9996225
from typing import Any, Callable, Dict, Iterable, List, Optional, Set import pyarrow as pa from fugue.column.expressions import ( ColumnExpr, _BinaryOpExpr, _FuncExpr, _LiteralColumnExpr, _NamedColumnExpr, _UnaryOpExpr, col, lit, ) from fugue.column.functions import is_agg from fugue.ex...
9996234
import numpy as np import time from utils.data_loader import load_dataset from dtw import slow_dtw_distance from dtw import dtw_distance as numba_sample_distance from odtw import dtw_distance as numba_dataset_distance from ucrdtw import dtw_distance as ucr_dataset_distance X_train, y_train, X_test, y_test = load_data...
9996297
from django.forms.widgets import NullBooleanSelect class IAPNullBooleanSelect(NullBooleanSelect): """ A Select Widget intended to be used with NullBooleanField. """ def value_from_datadict(self, data, files, name): value = data.get(name) return { "0": False, "1...
9996313
from itertools import chain from collections import Counter __all__ = ['sequence_preprocess', 'word_count', 'word_low_freq', 'word_high_freq', 'filter_word', 'filter_punctuation'] def sequence_preprocess(sequence): """Sequence preprocess, keep only Chinese. Args: sequence: pd.Series or...
9996330
from flask import Flask, request, render_template, send_from_directory from flask_restful import Resource, Api from flask_jsonpify import jsonify from tasks import predict as dpredict from tasks import predict_byname from tasks import app as taskbackend import sys import json import tweets app = Flask(__name__) app....
9996345
import os import re import numpy as np import cv2 import imageio from pyquaternion import Quaternion class PointList: class Point: def __init__(self, id, coord): self.id = id self.coord = coord def __init__(self, line): words = line.split() self.points = [] for i in range(0, len(words) / 3): id =...
9996351
import os import sys from sage.all import Zmod path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(os.path.abspath(__file__))))) if sys.path[1] != path: sys.path.insert(1, path) from shared.polynomial import fast_polynomial_gcd def attack(N, e, c1, c2, f1, f2): """ Recovers the shar...
9996376
import os import csv import tensorflow as tf BUFFER_SIZE=10000 def load_dataset(datapath, vocab, dimesion=0, splits=["split_1", "split_2", "split_4", "split_8", "split_16"]): dataset = [] data = csv.DictReader(open(datapath, "r")) midi_paths = [] for row in data: filepath, valence, arousal =...
9996379
from __future__ import division, absolute_import, print_function from struct import * # This file defines much of the structure needed to carry out our communication protocol in Python. # You can find more information about our communications protocol here: # https://github.com/HumanDynamics/OpenBadge/wiki/Communica...
9996404
from django.conf import settings from rest_framework.settings import APISettings USER_SETTINGS = getattr(settings, 'NESTED_FORM_PARSER', {}) DEFAULTS = { 'OPTIONS': { 'allow_empty': False, 'allow_blank': True } } api_settings = APISettings(USER_SETTINGS, DEFAULTS)
9996436
import pytest from pytest_alembic.plugin.error import AlembicTestFailure from pytest_alembic.tests.experimental.all_models_register_on_metadata import ( get_full_tableset, traverse_modules, ) class Module: pass def make_module(name, *, package=None, path=None, dict=None): module = Module() modu...
9996479
import requests from django.core.management.base import BaseCommand from bs4 import BeautifulSoup from psalter.models import Psalm, PsalmVerse from website.settings import BASE_DIR class Command(BaseCommand): help = "Import the psalms" def add_arguments(self, parser): pass def handle(self, *arg...
9996541
from manim_imports_ext import * class MeasureScene(AlgoScene): def construct(self): shape = self.camera.frame.get_shape() font_size = 30 t = Text("1 width %.2f height %.2f delta 0.00"%(shape[0], shape[1]), color=GREEN, font_size=font_size).shift(LEFT*3) self.add(t) hw = s...
9996550
import sys from typing import Union, Optional from operator import add, sub, mul, truediv from PySide6.QtWidgets import QApplication, QMainWindow from PySide6.QtGui import QFontDatabase from design import Ui_MainWindow operations = { '+': add, '−': sub, '×': mul, '/': truediv } error_zero_div = 'Div...
9996552
from __future__ import absolute_import, unicode_literals __all__ = [ 'DefaultExecutor', 'AsyncExecutor', 'BatchExecutor', 'TransactionExecutor' ] from collections import OrderedDict from uuid import uuid4 from six import moves from .exceptions import ( AsyncExecuteError, BatchStateError, ...
9996643
import numpy as np import typing import cv2 import collections # https://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html from sklearn.cluster import KMeans from findit.logger import logger from findit.toolbox import Point from findit.engine.base import FindItEngine, FindItEngineResponse class ...
9996650
import pytest from django.utils.crypto import get_random_string from resources.models import Unit, Resource, ResourceType from respa_exchange.models import ExchangeConfiguration @pytest.mark.django_db @pytest.fixture def space_resource_type(): """ A ResourceType denoting a space """ return ResourceTy...
9996668
import os from rep.test.test_notebooks import check_single_notebook import six if six.PY3: # Notebooks are written in python2, so not testing it under python 3 import nose raise nose.SkipTest def test_notebooks_in_folder(folder='../howto/'): dirname = os.path.dirname(os.path.realpath(__file__)) ...
9996712
import numpy as np from multiprocessing import Queue from multiprocessing.sharedctypes import RawArray from ctypes import c_uint, c_float, c_double class Runners(object): NUMPY_TO_C_DTYPE = {np.float32: c_float, np.float64: c_double, np.uint8: c_uint} def __init__(self, tab_rep, EmulatorRunner, emulators, w...
9996734
try: from deep_utils.dummy_objects.callbacks.tf_keras import LRScalar from .lr import LRScalar except: pass
9996759
import torch from typing import Dict from .conv_classifier_interface import ConvClassifierInterface class FeedforwardImageClassifierInterface(ConvClassifierInterface): def create_input(self, data: Dict[str, torch.Tensor]) -> torch.Tensor: return super().create_input(data).flatten(1)
9996766
from setuptools import setup import os import sys version = '0.9.1' if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') os.system('python setup.py bdist_wheel upload') sys.exit() if sys.argv[-1] == 'tag': print("Tagging the version on github:") os.system("git tag -a %s -m 'ver...
9996788
try: import cupy as xp except ImportError: import numpy as xp from common import const, gainplot, pack from common.hardware import HydrophonesSection try: import shm except ImportError: from common import shm class Controller: def __init__(self, section, L_interval, plot=False): if section...
9996817
from . import convert from . import search from . import data from . import normalize from . import describe
9996818
from netmiko.centec.centec_os import CentecOSSSH, CentecOSTelnet __all__ = ["CentecOSSSH", "CentecOSTelnet"]
9996824
from pyplan.pyplan.common.baseService import BaseService from .models import NodeExternalLink class NodeExternalLinkService(BaseService): def getOrCreateNodeExternalLink(self, node_id: str, common_instance: bool = True): """ Get or Create NodeExternalLink by node_id """ node_exte...
9996831
import FWCore.ParameterSet.Config as cms L1O2OTestAnalyzer = cms.EDAnalyzer("L1O2OTestAnalyzer", printL1TriggerKey = cms.bool(True), printL1TriggerKeyList = cms.bool(True), printPayloadTokens = cms.bool(True), ...
9996832
import numpy as np from menpofit.error import compute_cumulative_error def _check_multi_argument(arg, n_objects, dtypes, error_str): # check argument's dtype with provided dtypes if not isinstance(dtypes, list): dtypes = [dtypes] is_dtype = False for t in dtypes: if (t is None and arg...
9996871
from __future__ import absolute_import, division, print_function class SpotfinderError(Exception): def __init__(self,message,processdict=None): Exception.__init__(self,message) self.classname="Spotfinder Problem" self.parameters = processdict
9996901
import argparse from mobilium_client.client import MobiliumClient from mobilium_proto_messages.accessibility import Accessibility, AccessibilityById, AccessibilityByXpath class TestRunner: def __init__(self, device_udid: str, server_address: str, port: int): self.client = MobiliumClient() self.de...
9996942
import logging from typing import Dict, Any, List from mage.graph_coloring_module.graph import Graph from mage.graph_coloring_module.components.individual import Individual from mage.graph_coloring_module.utils.parameters_utils import param_value from mage.graph_coloring_module.utils.validation import validate from mag...
9996966
from amuse.test import amusetest from amuse.units import constants from amuse.units.generic_unit_converter import * class TestGenericUnits(amusetest.TestCase): def test1(self): L = 1 | length T = 1 | time V = 1 | speed self.assertTrue(L/T == V) def test2(self): #natural...
9996992
from flask import render_template, redirect, url_for from app import app, db from app.forms import CreateGameFrom, FeedbackFrom from app.models import Game from app.api.email import sendFeedbackMail @app.route('/index2') def index2(): return render_template('index2.html') @app.route('/') @app.route('/index', m...
9997003
import os import pytest from thumbor.config import Config from thumbor.context import Context, ServerParameters, RequestParameters from thumbor.importer import Importer from thumbor.server import configure_log, get_application try: from shutil import which except ImportError: from thumbor.utils import which ...
9997007
import _coretaint import angr import claripy def source_dummy(_core, old_path, new_path): pass def memcpy(_core, old_path, new_path): # FIXME do taint untaint! cp_new_p = new_path.copy() try: # if the second parameter is tainted (or pointing to a tainted location) # or the third is t...
9997033
from ggshield.cmd import cli class TestScanRepo: def test_invalid_scan_repo_github(self, cli_fs_runner): """ GIVEN a repo url from github that doesn't finish in .git WHEN scan repo is called THEN a validation error proposing error correction should be shown """ resu...
9997054
from __future__ import absolute_import from __future__ import division from __future__ import print_function from data.botany import BotanyDataset, BotanyTest from data.iamdb import IamDataset from data.icdar import IcdarDataset from data.iclef import IclefDataset
9997113
import mrp mrp.process( name="proc", runtime=mrp.Conda( channels=[ "conda-forge", "robostack", ], dependencies=[ "python>=3.7", "ros-common-msgs", ], run_command=["python", "proc.py"], ), ) mrp.main()
9997118
from os import path, environ from types import FunctionType from typing import Dict, List import json import yaml from pathlib import Path _DEF_CFG = { "github_token": "", "user": "", "target": "repositories", "ignore": "", "depth": "" } def parse() -> Dict: cfg = _DEF_CFG _parse_config_...
9997123
import json import os from pathlib import Path from typing import Dict, List, Optional, Union import pytest import yaml from demisto_sdk.commands.common.legacy_git_tools import git_path from demisto_sdk.commands.generate_integration.code_generator import ( IntegrationGeneratorConfig, IntegrationGeneratorOutput) f...
9997155
import h5py import numpy as np import matplotlib.pyplot as plt import os import argparse # Class to read results from a h5py file. class ReadResults: def __init__(self, file_path, various_data=True): self.file = h5py.File(os.path.join(file_path, 'results.h5'), 'r') self.various_data = various_data # True...
9997170
import pandas as pd import math from .exp import main def test_int(): assert main(data=0)["exp"] == 1 def test_series(): assert main( data=pd.Series( { "2019-08-01T15:20:12": 0, "2019-08-01T15:44:12": None, "2019-08-01T15:44:16": 2, ...
9997174
from .equipment import find_equipment from .functional_location import find_functional_locations from .model import find_models from .failure_mode import find_failure_modes from .location import find_locations from .notification import find_notifications from .system import find_systems from .workorder import find_work...
9997202
import os, sys, wave, re import copy import math import numpy as np import pickle, string, csv from emotion_inferring.dataset.iemocap_utils import * from gensim.models.keyedvectors import KeyedVectors emotions_used = np.array(['ang', 'exc', 'hap', 'neu', 'sad']) sessions = ['Session1', 'Session2', 'Session3...
9997224
import base64 import datetime import os import pandas as pd from bokeh.embed import file_html from bokeh.io import save from bokeh.layouts import gridplot from bokeh.models import Div, NumeralTickFormatter, Panel, Tabs, Title from bokeh.models import Range1d from bokeh.palettes import d3 from bokeh.plotting import fig...
9997228
from sympy import (Symbol, gamma, expand_func, beta, digamma, diff) def test_beta(): x, y = Symbol('x'), Symbol('y') assert isinstance(beta(x, y), beta) assert expand_func(beta(x, y)) == gamma(x)*gamma(y)/gamma(x + y) assert expand_func(beta(x, y) - beta(y, x)) == 0 # Symmetric assert expand_fu...
9997289
from __future__ import absolute_import from rlib import jit from rlib.min_heap_queue import heappush, heappop, HeapEntry from som.compiler.bc.bytecode_generator import ( emit1, emit3, emit_push_constant, emit_return_local, emit_return_non_local, emit_send, emit_super_send, emit_push_glo...
9997292
from __future__ import ( annotations, ) import logging import warnings from enum import ( Enum, ) from functools import ( total_ordering, ) from typing import ( Any, Optional, ) from uuid import ( UUID, uuid4, ) from minos.common import ( DeclarativeModel, ) from .abc import ( Bro...
9997313
from gazette.spiders.base.sigpub import SigpubGazetteSpider class RjAssociacaoMunicipiosSpider(SigpubGazetteSpider): name = "rj_associacao_municipios" TERRITORY_ID = "3300000" CALENDAR_URL = "http://www.diariomunicipal.com.br/aemerj"
9997339
import pytest @pytest.mark.asyncio async def test_get_methods(rpc_context): client = await rpc_context.make_client() methods = await client.call('get_methods') assert sorted(methods) == ['get_methods', 'get_subscriptions', 'get_topics', 'subscribe', 'unsubscribe'] @pytest...
9997359
import sys import torch from tqdm import tqdm from transformers import AutoTokenizer, AutoModel from varclr.data.preprocessor import CodePreprocessor def forward(model, input_ids, attention_mask): output = model( input_ids=input_ids, attention_mask=attention_mask, output_hidden_states=True ) all...
9997377
import os import base64 import time import logging import uuid import boto3 from boto3.dynamodb.conditions import Key from common import utilities ## Config CONFIG_OPTIONS = utilities.load_config() ## Logging logger = utilities.initialize_logging(logging.getLogger(__name__)) class CommandItem: def __init__(self...