text
stringlengths
2
999k
# Copyright 2020 Nicole Borrelli # # 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...
# -*- coding: utf-8 -*- import numpy as np np.random.seed(111) import argparse import os import json from yolo.frontend import create_yolo, get_object_labels os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="0" argparser = argparse.ArgumentParser( description='Train and validate YO...
import lind_test_server from lind_net_constants import * SyscallError = lind_test_server.SyscallError sockfd = lind_test_server.socket_syscall(AF_INET, SOCK_STREAM, 0) assert(lind_test_server.getsockname_syscall(sockfd) == ('0.0.0.0', 0)) # should work... lind_test_server.bind_syscall(sockfd,'127.0.0.1',50102) ...
from abc import ABCMeta, abstractmethod from gym.spaces import Discrete import numpy as np from pathlib import Path import unittest from ray.rllib.utils.exploration.exploration import Exploration from ray.rllib.utils.framework import try_import_tf, try_import_torch from ray.rllib.utils.from_config import from_config f...
""" Validators for message arguments. """ from .validators import Validator
class AccessibleStates(Enum,IComparable,IFormattable,IConvertible): """ Specifies values representing possible states for an accessible object. enum (flags) AccessibleStates,values: AlertHigh (268435456),AlertLow (67108864),AlertMedium (134217728),Animated (16384),Busy (2048),Checked (16),Collapsed (1024),De...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
from .dense_spatial_conv import SpatialConv, SpatialConvOrderK from .diff_conv import DiffConv from .graph_attention import AttentionScores, MultiHeadGraphAttention, GATLayer from .gat_conv import GATConv from .grin_cell import GRIL from .spatio_temporal_att import SpatioTemporalAtt from .gated_gn import GatedGraphNetw...
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler") load(":protobuf.bzl", "cc_proto_gen_validate", "java_proto_gen_validate", "python_proto_gen_validate") def pgv_go_proto_library(name, proto = None, deps = [], compilers = ["@io_bazel_rules_...
# to export raw nrrd (using emdrp toolset): #dpLoadh5.py --srcfile /mnt/cne/from_externals/K0057_D31/K0057_D31.h5 --chunk 90 78 15 --size 192 192 32 --offset 96 96 96 --dataset data_mag1 --outraw ~/Downloads/K0057_webknossos_test/K0057_D31_x90o96_y78o96_z15o96.nrrd --dpL # script to read the webknossos formatted labe...
# -*- coding: utf-8 -*- #!/usr/bin/python # ROS import socket import cv2 import numpy TCP_IP = 'localhost' TCP_PORT = 5001 while True: try: sock = socket.socket() sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.connect((TCP_IP, TCP_PORT)) cap = cv2.VideoCapture(0...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from numpy.testing import assert_allclose from astropy import units as u from astropy.utils.data import get_pkg_data_filename from gammapy.catalog import SourceCatalogGammaCat from gammapy.utils.gauss import Gauss2DPDF from gammapy.utils.test...
""" Visualisation ============= """ from ..utils import getLogger logger = getLogger(__name__) try: import matplotlib from .map_viewer import MapView from .rotation_angle_plotter import RotationAnglePlotter except ImportError: logger.warning('Cannot use MapView or RotationAnglePlotter as matplotlib is ...
#!/usr/bin/env python3 # # Rewrite of sub_test by Sung-Eun Choi (sungeun@cray.com) # sub_test is used by start_test in the Chapel Testing system # August 2009 # # This script can be overridden with a script by the same name # placed in the test directory. # # The use and behavior of the various environment variables...
#!/usr/bin/env python # # Copyright 2016 Google Inc. 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 requir...
from user import User from pymongo import MongoClient,DESCENDING from werkzeug.security import generate_password_hash from datetime import datetime from bson import ObjectId client=MongoClient('mongodb+srv://GH_Admin:GirlHackersPass@cluster0-scgff.mongodb.net/ChatData?retryWrites=true&w=majority') chat_db=cli...
from math import sqrt, pow, hypot co = float(input("Digite o comprimento do cateto oposto: ")) ca = float(input("Digite o comprimento do cateto adjacente: ")) hipo = hypot(co, ca) ''' # Outra versão 1 hipo = sqrt( pow(co,2) + pow(ca,2) ) # Outra versão 2 hipo = (co ** 2 + ca ** 2) ** (1/2) ''' print(f'A hipoten...
from collections.abc import MutableMapping import itertools class LayeredMapping(MutableMapping): def __init__(self, *layers): self.mutations = {} self.layers = self.__filter_layers(layers) @staticmethod def __filter_layers(layers): return [layer for layer in layers if layer is no...
import torch import time from torch.utils.tensorboard import SummaryWriter import torch.nn.functional as F import os from utils import utils from utils.visualization import disp_error_img, save_images from metric import d1_metric, thres_metric class Model(object): def __init__(self, args, logger, opt...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals """ oauthlib.oauth1 ~~~~~~~~~~~~~~ This module is a wrapper for the most recent implementation of OAuth 1.0 Client and Server classes. """ from .rfc5849 import Client, Server from .rfc5849 import SIGNATURE_HMAC, SIGNATURE_RSA, SIGNATURE...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
#!/usr/bin/env python ## Copyright 2002-2010 by PyMMLib Development Group (see AUTHORS file) ## This code is part of the PyMMLib distribution and governed by ## its license. Please see the LICENSE file that should have been ## included as part of this package. import sys import getopt import copy import popen2 from m...
from datetime import datetime import operator from textwrap import dedent from typing import FrozenSet, Union import warnings import numpy as np from pandas._libs import algos as libalgos, index as libindex, lib import pandas._libs.join as libjoin from pandas._libs.lib import is_datetime_array from pandas._libs.tslib...
# Copyright (c) 2018-2021, NVIDIA CORPORATION. from __future__ import annotations import builtins import pickle import warnings from types import SimpleNamespace from typing import ( Any, Dict, List, MutableSequence, Optional, Sequence, Tuple, TypeVar, Union, cast, ) import cu...
# -*- coding: utf-8 -*- # Generated by Django 1.11.14 on 2018-08-21 13:14 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('questions', '0030_data_migration'), ] operations = [ migrations.RenameField( ...
from collections import namedtuple from marshmallow import missing from marshmallow.error_store import merge_errors def test_missing_is_falsy(): assert bool(missing) is False CustomError = namedtuple('CustomError', ['code', 'message']) class TestMergeErrors: def test_merging_none_and_string(self): ...
import os from collections import defaultdict from datetime import datetime as dt import numpy as np from .utils.ek_raw_io import RawSimradFile, SimradEOF FILENAME_DATETIME_EK60 = ( "(?P<survey>.+)?-?D(?P<date>\\w{1,8})-T(?P<time>\\w{1,6})-?(?P<postfix>\\w+)?.raw" ) class ParseBase: """Parent class for all...
pkgname = "libgtop" pkgver = "2.40.0" pkgrel = 0 build_style = "gnu_configure" configure_args = ["--with-libgtop-smp", "--enable-introspection"] make_cmd = "gmake" hostmakedepends = ["gmake", "pkgconf", "perl", "gobject-introspection"] makedepends = ["libglib-devel", "libxau-devel", "linux-headers"] pkgdesc = "GNOME li...
""" Generic views, viewsets and mixins that extend the Django REST Framework ones adding separated serializers for read and write operations. """ from __future__ import absolute_import, unicode_literals __version__ = '1.0.1' # pylint: disable=invalid-name default_app_config = 'drf_rw_serializers.apps.DrfRwSerializer...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2017, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import json import requests from operator import itemgetter from django.contrib.gis.geos import GEOSGeometry from django.conf import settings from django.db import connection ...
import os.path as op from flask import request, Response from flask_admin import Admin from flask_admin.contrib.sqla import ModelView from flask_admin.contrib.fileadmin import FileAdmin from app import app, db from app.models import User from werkzeug.exceptions import HTTPException admin = Admin(app, name='Admin'...
#!/usr/bin/env python # -*- coding: UTF-8 -*- from base import BaseObject class SkipgramGenerator(BaseObject): def __init__(self, some_tokens): """ Created: 12-Feb-2017 craig.trim@ibm.com * refactored out of TokenizeText.py Updated: 21-Feb...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib import style style.use('ggplot') import seaborn as sns from gensim.models import Word2Vec def find_pct(word,age): df = pd.read_csv('word_acq_pct1.csv') row = df[df.definition2 == word] pct = row.iloc[0][int(age)] pct...
from machine import UART,Pin import time uart=UART(0,baudrate=9600,tx=Pin(0),rx=Pin(1)) def writedata(command): TERMINATION_CHAR = '\n\r' rxData=bytes() uart.write(b''+command+ b'' + TERMINATION_CHAR) time.sleep(0.1) while uart.any()>0: rxData += uart.readline() print(rxData.decode('utf...
"""Implements the method used for deciding which feature goes to which level when plotting.""" import itertools import math class Graph: """Minimal implementation of non-directional graphs. Parameters ---------- nodes A list of objects. They must be hashable. edges A list of the fo...
""" mbed SDK Copyright (c) 2011-2020 ARM Limited 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 writin...
from django.apps import AppConfig from django.db.models import signals class MarketplaceFlowsConfig(AppConfig): name = 'waldur_mastermind.marketplace_flows' def ready(self): from . import handlers, models signals.post_save.connect( handlers.process_flow_state_change, ...
@require_logged_in def query(): import re q = request.vars.get ('q') ql = q.split (' ') mq = [] for item in ql: regex = re.compile (item, re.IGNORECASE) mq.append ({ 'title': {'$regex': regex} }) result = mongo.refs.find ({'$and': mq}).limit (10) ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'npc/gui/uis/about.ui' # # Created by: PyQt5 UI code generator 5.7.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_AboutDialog(object): def setupUi(self, AboutDialog): ...
#!/usr/bin/python3 # # Copyright (c) 2016-2020 The Khronos Group 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...
# # General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall # model for 1st, 2nd and 3rd generation solar cells. # Copyright (C) 2008-2022 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com # # https://www.gpvdm.com # # This program is free software; you can redist...
# coding=utf-8 u""" User: xulin Date: 13-6-6 Time: 上午11:19 """ import os from model.config import development as config, production ENV = os.environ.get('MODEL_ENV', 'development') print 'MODEL: %s' % ENV if ENV == 'development': import development as config if ENV == 'production': import production as conf...
import argparse import logging import os import re import sys from collections import OrderedDict from pip._internal.network.session import PipSession from pip._internal.req.constructors import install_req_from_parsed_requirement from pip._internal.req.req_file import parse_requirements def clean_name(name): # E...
# Copyright 2016 Cisco Systems, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
"""idlelib.config -- Manage IDLE configuration information. The comments at the beginning of config-main.def describe the configuration files and the design implemented to update user configuration information. In particular, user configuration choices which duplicate the defaults will be removed from the user's conf...
from django.contrib import admin from minecraft.models import Blog, Category # Register your models here. class BlogAdmin(admin.ModelAdmin): list_display = ['title', 'created', 'updated'] admin.site.register(Category) admin.site.register(Blog, BlogAdmin)
from __future__ import unicode_literals import frappe def get_context(context): user = frappe.session.user ExamId=frappe.form_dict.Exam result = frappe.get_list("Exam Result", fields=["user", "student", "exam_id", "exam_start_date", "exam_end_date", "name", "attended", "correct_answers", "wrong_ans...
# -*- coding: utf-8 -*- """ Annotation storage API. This module provides the core API with access to basic persistence functions for storing and retrieving annotations. Data passed to these functions is assumed to be validated. """ from datetime import datetime from pyramid import i18n from memex import schemas fro...
#!/usr/bin/env python3.6 from Plocker import User import random from Plocker import Password def create_user(username,password,accountName): ''' Function to create a new user ''' user_details=User(username,password,accountName) return user_details def save_user(Plocker): ''' Function to sa...
import theano.tensor as T import theano import numpy as np from scipy.spatial.distance import pdist, squareform import random import time ''' Sample code to reproduce our results for the Bayesian neural network example. Our settings are almost the same as Hernandez-Lobato and Adams (ICML15) https://jmhldotorg....
# =============================================================================== # Copyright 2017 ross # # 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/LICE...
# Copyright 2011 OpenStack Foundation # Copyright 2011 Nebula, Inc. # 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/...
#!/usr/bin/env python3 # 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. from typing import Any, Callable, Dict, List, Optional, Tuple import torch from ax.core.types import TConfig, TGenMeta...
# -*- coding: utf-8 -*- # DO NOT EDIT THIS FILE! # This file has been autogenerated by dephell <3 # https://github.com/dephell/dephell try: from setuptools import setup except ImportError: from distutils.core import setup import os.path readme = "" here = os.path.abspath(os.path.dirname(__file__)) readme_p...
import FWCore.ParameterSet.Config as cms import os import pickle def _yellow(string): return '%s%s%s' %('\033[1;33m',string,'\033[1;0m') def include(includes_set): """ It takes a string or a list of strings and returns a list of FWCore.ParameterSet.parseConfig._ConfigReturn objects. In the pack...
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # 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 # with...
import os import json # Constants prj_root_path = os.path.dirname(os.path.dirname(__file__)) data_root_path = os.path.join(prj_root_path, "data") kfold_root_path = os.path.join(prj_root_path, "output_kfold") unet_model_root_path = os.path.join(prj_root_path, 'output_unet') # Kfold configuration def get_kfold_configu...
# # Copyright (C) 2018-2019 the YAMBOpy team # https://github.com/henriquemiranda/yambopy # # Authors (see AUTHORS file for details): HM AMS # # This file is distributed under the terms of the GNU # General Public License. You can redistribute it and/or # modify it under the terms of the GNU General Publi...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from ..input import ItemType from ..state import State, StateFlags from . import ItemAction, Action, VolumeUtilAction, ContainerUtilAction, DerivedAction from .base import AbstractActionGenerator class ResumeActionGenerator(AbstractActionGenerator): ...
# ----------------------------------------------------------------------------- # User configuration # ----------------------------------------------------------------------------- dataset_destination_path = '/Users/seb/Desktop/vtk_volume_v2' # -------------------------------------------------------------------------...
################################################################################# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Apache License, Version 2.0 (the "License"). ...
class Direcao: def __init__(self): self.direcao = 'Norte' def virar_a_direita(self): if self.direcao == 'Norte': self.direcao = 'Leste' elif self.direcao == 'Leste': self.direcao = 'Sul' elif self.direcao == 'Sul': self.direcao = 'Oeste' ...
import smtplib from email.mime.text import MIMEText from email.header import Header import traceback def mail(exception): sender = 'pynickle@sina.com' receivers = 'pynickle@sina.com' msg = "" msg += "<p>Exception happened when others using your cishen application:</p>" msg += "<pre>...
import sys sys.path.append('../tytus/parser/team27/G-27/execution/abstract') from expression import * class Literal(Expression): """ value: valor puro (es decir un número, un string, true | false, null) typ: recibe un enum ubicado en el archivo typ.py en la carpeta symbol """ def __init__(self, va...
from pywintypes import com_error import win32com.client from main import OutputError, BrailleOutput class Virgo (BrailleOutput): """Braille output supporting the Virgo screen reader.""" name = 'Virgo' def __init__(self, *args, **kwargs): super (Virgo, self).__init__(*args, **kwargs) try: self.object = win...
from flask import Blueprint public_bp = Blueprint("public", __name__, template_folder="templates") from . import routes
#!/usr/bin/env python #encoding=utf-8 import urllib2 import urllib import yaml import json from pprint import pprint import demjson def fetch(url, args): url = url + '?' + urllib.urlencode(args) request = urllib2.Request(url) response = urllib2.urlopen(request) data = response.read() return data def GetLeague...
# Generated by Django 2.2b1 on 2019-02-25 23:23 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='UBIGEO_INEI', fields=[ ('cod_dep', models.C...
#!/usr/bin/python import sys import logging import re import numpy as np from parsevasp import utils from parsevasp.base import BaseParser # Map from number of columns in DOSCAR to dtype for the total density of states. DTYPES_DOS = { 3: np.dtype([('energy', float), ('total', float), ('integrated', float)]), ...
import pygame from board import * from piece import * class Game: def __init__(self, width, height, fps): pygame.init() pygame.font.init() pygame.display.set_caption('Tetris') self.running = True self.FPS = pygame.time.Clock() self.frames = fps ...
# Copyright 2016 David M. Brown # # This file is part of Goblin. # # Goblin is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
from forambulator.download import download_data
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # 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...
# -*- coding: utf-8 -*- """ Created on Mon Jul 27 12:12:09 2020 @author: Arsenic align AM 316L HT 02 dataset """ import numpy as np from argos import align, process from argos.gui import kbentry, loadtxtfile, loadimgfile, loadimgfile, msgbox from skimage.io import imread, imsave import cv2 from PIL impor...
class Solution: def reverseStr(self, s, k): """ :type s: str :type k: int :rtype: str """ result = '' for i in range(len(s)//(2*k)): print(i, k) print(s[i*2*k:(2*i+1)*k]) print(s[i*2*k:(2*i+1)*k][::-1]) ...
import sys, struct, SocketServer from odict import OrderedDict from datetime import datetime from calendar import timegm class Packet(): fields = OrderedDict([ ("data", ""), ]) def __init__(self, **kw): self.fields = OrderedDict(self.__class__.fields) for k,v in kw.items(): ...
# # 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...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
filename = "fileName.txt" ans = 0 flag = False with open(filename) as f: while True: c = f.read(1) if not c: break if(c == ' ' or c == '\t' or c == '\n'): flag = False else: if flag: continue else: ans += 1 flag...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2020 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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...
#!/usr/bin/env python import subprocess import tempfile passed = 0 n_tests = 6; # Run a for loop of tests. for i in range(1,n_tests+1): print "Running test " + str(i) + "... " # Create a temporary file to contain output tmpfile = tempfile.NamedTemporaryFile(); # Run case i, put output into tmpf...
from __future__ import unicode_literals from django.apps import AppConfig class CalcConfig(AppConfig): name = 'calc'
__author__ = "Rick Sherman, Nitin Kumar" __credits__ = "Jeremy Schulman" import unittest2 as unittest from nose.plugins.attrib import attr from mock import MagicMock, patch, mock_open import os from lxml import etree from ncclient.manager import Manager, make_device_handler from ncclient.transport import SS...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # from datetime import datetime from covid import Covid from userbot import CMD_HELP from userbot.events import registe...
'''A module for retrieving a list of all optimization parameters unique to each algorithm. ''' ALGORITHM_KEYS = { 'xgboost_classifier': ( 'max_depth', 'min_child_weight', 'gamma', 'learning_rate', 'subsample', 'colsample_bylevel', 'colsample_bytree', ...
import argparse import logging import signal import sys import time import yaml from fortiwlc_exporter import __version__, settings from fortiwlc_exporter.collector import FortiwlcCollector from fortiwlc_exporter.exceptions import ExporterConfigError from fortiwlc_exporter.server import start_server def setup_loggi...
import random import torch from torch import nn from recbole.model.abstract_recommender import SequentialRecommender from recbole.model.loss import BPRLoss import torch.nn.functional as F class ComiRec_SA(SequentialRecommender): r"""ComiRec_SA is a model that incorporate Capsule Network for recommendation. ...
# -*- coding: utf-8 -*- # Copyright 2017 ProjectV 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 requi...
#!/usr/bin/env python import pytest """ Test 1987. Number of Unique Good Subsequences """ @pytest.fixture(scope="session") def init_variables_1987(): from src.leetcode_1987_number_of_unique_good_subsequences import Solution solution = Solution() def _init_variables_1987(): return solution ...
import time class TreeNode: def __init__(self, value): self.value = value self.children = [] def add_child(self): student = [] possible_numbers = [] for m in self.children: possible_numbers.append(m.value[0]) student_identity = ...
from pathlib import Path from starlette.config import Config from typing import Tuple BASE_DIR: str = str(Path(__file__).parent) config: Config = Config(f"{BASE_DIR}/.env") ip_info_token: str = config("IP_INFO_TOKEN") ip_info_url: str = config("IP_INFO_URL") organizations: Tuple[str, ...] = ( "AS47764", # mai...
import os import pytest import numpy as np from tifffile import tifffile from brainio import brainio from imlib.cells.cells import Cell from imlib.IO.cells import get_cells from imlib.general.system import ( delete_directory_contents, get_sorted_file_paths, ) import cellfinder.extract.extract_cubes as extra...
# Automatic Python regression test. # # Some essential parts of the Python interpreter are tested by the module # 'testall'. (Despite its name, it doesn't test everything -- that would # be a truly Herculean task!) When a test fails, 'testall' raises an # exception. When all tests succeed, it produces quite a lot of...
import tensorflow as tf import tensorflow_hub as hub import numpy as np import os import pandas as pd import re # Load all files from a directory in a DataFrame. def load_directory_data(directory): data = {} data["sentence"] = [] data["sentiment"] = [] for file_path in os.listdir(directory): with tf.gfile....
try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="tfplugin", version="dev", author="Martin Atkins", author_email="mart@degeneration.co.uk", description="Implement Terraform plugins in Python", packages=['tfplugin'], install_require...
from dataclasses import dataclass, field from typing import Dict, Union, Iterator, Tuple import numpy as np @dataclass class Transition: """ A single transition in a MDP, consisting of observations, actions, reward and done flag. It holds observations and actions as dictionaries. """ observation:...
from rss_actions import __version__ def test_version(): assert __version__ == '0.1.0'
""" Copyright [2019] [TROJAN WIN32 NT] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwa...