text
stringlengths
1
927k
#!/usr/bin/python # Copyright (c) 2014 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. """Module that finds and runs a binary by looking in the likely locations.""" import os import subprocess import sys def run_comman...
''' Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). Example 1: Input: root = [3,9,20,null,null,15,7] Output: [[3],[9,20],[15,7]] Example 2: Input: root = [1] Output: [[1]] Example 3: Input: root = [] Output: [] ''' # Definition...
import os import requests import pymysql import pytest from flask import url_for from solarforecastarbiter.datamodel import QualityFlagFilter as QFF from sfa_dash import create_app BASE_URL = 'http://localhost' resample_threshold = QFF.resample_threshold_percentage @pytest.fixture(scope='session') def auth_toke...
import glob def search(directory, searchElem:list, extension = ".txt"): """Searches files in a specified directory and checks if they contain the specified elements. directory format: /home/runner/project directory type: folder element type: list extensions requirments: MUST have a period bef...
""" This module is used to predict the Air Quality Index model for 2019 for all counties. """ import pickle import warnings import pandas as pd import numpy as np from keras.models import load_model import helpers warnings.filterwarnings("ignore") def main(): data2019_raw = pd.read_csv("""air_pollution_death_r...
from office365.directory.identities.userflows.language_page import UserFlowLanguagePage from office365.entity import Entity from office365.entity_collection import EntityCollection from office365.runtime.resource_path import ResourcePath class UserFlowLanguageConfiguration(Entity): """Allows a user flow to suppor...
import json import time from typing import Any from typing import Callable from typing import cast from typing import Dict from typing import List from typing import Optional from typing import Union from . import upgrades from ..__version__ import VERSION from ..exceptions import UnableToReadBaselineError from ..sett...
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): """A funcion that executes before all tests""" def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_supe...
# -*- coding: utf-8 -*- class State : """ Classe définissant un état caractérisée par : - un identifiant - un booleen pour savoir si c'est un état initial - un booleen pour savoir si c'est un état final - un label utilisé pour les constructions ou il faut memorise...
# import import numpy as np import sklearn as skl import sklearn.cluster as cluster import sklearn.metrics as metrics import torch import torch.distributions.kl as kl import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as data import torchvision import torchvision.d...
# -*- coding: utf-8 -*- # (c) 2009-2021 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Original PyFileServer (c) 2005 Ho Chun Wei. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Implementation of a WebDAV provider that provides a very basic, read-...
# -*- coding: utf-8 -*- """ meraki_sdk This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class SwitchProfilePortModel(object): """Implementation of the 'SwitchProfilePort' model. TODO: type model description here. Attributes: profile (strin...
from pygame import * class Blocker(sprite.Sprite): def __init__(self, size, color, row, column): sprite.Sprite.__init__(self) self.height = size self.width = size self.color = color self.image = Surface((self.width, self.height)) self.image.fill(self.color) ...
famousauthor = "Herman Melville" print(famousauthor + ' wrote in Moby Dick, "Now then, thought I, unconsciously rolling up the sleeves of my frock, here goes a cool, collected dive at death and destruction, and the devil fetch the hindmost."')
import itertools import math import string import sys from bisect import bisect_left as bi_l from bisect import bisect_right as bi_r from collections import Counter, defaultdict, deque from functools import lru_cache, reduce from heapq import heapify, heappop, heappush from operator import or_, xor sys.setrecursionlim...
from ....control import core from ....control.instruments.berkeleynucleonics765 import stop from ..switching import preset_run_function import pandas as pd import numpy as np import os import warnings import time __all__ = ("FE",) class FE(core.experiment): """Experiment class for running pulsed Ferroelectric ...
def w(j, p): return 4 * j * (1 - p) for p in [0.5, 0.75, 0.99]: print([w(j, p)*24*7 for j in [5, 20, 50]])
# Copyright 2020 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 applicable law or agreed to...
import json a=""" [ { "_id": 1, "id": 1, "pid": 0, "city_code": "101010100", "city_name": "北京" }, { "_id": 2, "id": 2, "pid": 0, "city_code": "", "city_name": "安徽" }, { "_id": 3, "id": 3, "pid": 0, "city_code": "", "city_name": "福建" }, { "_id...
# Copyright 2013 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. { 'variables': { 'chromium_code': 1, }, 'includes': [ 'sync_android.gypi', 'sync_tests.gypi', ], 'conditions': [ # Notes: # 1...
"""Module containing tools to deprecate the use of selected keys in a given dictionary. This module provides: deprecate_keys ============== Class to wrap a dict to deprecate some keys in it. dkey ==== Function to generate deprecated keys. __version__ =========== A string indicating which version of dkey is currentl...
__all__ = ['kd_tree'] from math import sqrt from heapq import heappush,heappop class kd_tree: class node: def point_distance(self,point): return sqrt(sum([ (a - b)**2 for (a,b) in zip(point,self.point)])) def separator_distance(self,point): return point[self.axis] - self.p...
import os import numpy as np from .general_utils import get_logger from .data_utils import load_vocab, get_processing_word class Config(): def __init__(self, load=True): """Initialize hyperparameters and load vocabs Args: load_embeddings: (bool) if True, load embeddings into ...
# -*- coding: utf-8 -*- """Tests for BARD pointer module""" import math import numpy as np import pytest import sksurgerycore.algorithms.tracking_smoothing as reg def test_rvec_to_quaterion(): """ Does it convert correctly """ #a 90 degree rotation about the x axis rvec = np.array([math.pi/2.0, ...
# Generated by Django 2.0.2 on 2018-02-23 08:56 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Playlists', fields=[ ...
import sys def problem(): """ Minimal Tree: Given a sorted (increasing order) array with unique integer elements, write an algorithm to create a binary search tree with minimal height. """ pass class BST: def __init__(self): self.count = 0 self.root = None ...
# coding: utf-8 """ Accounting API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: 2.1.6 Contact: api@xero.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 from xero_pytho...
#!/usr/bin/env python import python_bitbankcc from math import floor from datetime import datetime import pathlib import csv from settings import BITBANK_API_KEY, BITBANK_API_SECRET class BitBankPubAPI: def __init__(self): self.pub = python_bitbankcc.public() def get_ticker(self, pair): try:...
import os from os.path import isfile, join from PIL import Image import pandas as pd import torch from torch.utils.data.dataset import Dataset from torchvision import transforms import numpy as np import matplotlib.pyplot as plt import shutil from sklearn.model_selection import KFold from sklearn.model_selection import...
# Copyright 2018 The TensorFlow Probability 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class TestAppConfig(AppConfig): name = 'test_app' verbose_name = 'Test App'
from .iterator import Span, RawIterator class Token: def __init__(self, start, end): self.start = start.copy() self.end = end.copy() @property def raw(self): return str(Span(RawIterator(self.start), RawIterator(self.end))) def __str__(self): return str(Span(self.start...
from . import PythonExpressions class CodeBlock: def get_code(self, scope): return NotImplemented class CBAssign(CodeBlock): def __init__(self, var, value): self._var = var self._value = value def get_code(self, scope): return f"SCOPE.set_var(\"{self._var.get_...
""" The data-file handling functions """ #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------...
""" An example config file to train a ImageNet classifier with detectron2. Model and dataloader both come from torchvision. This shows how to use detectron2 as a general engine for any new models and tasks. To run, use the following command: python tools/lazyconfig_train_net.py --config-file configs/Misc/torchvision_...
import random import threading import pika """ 总结: """ def send(): tag = random.choice(['info', 'error', 'warn']) rb_conn = pika.BlockingConnection(pika.ConnectionParameters(host='192.168.101.129', port=5672, ...
import os import os.path import re import sqlite3dbm from threading import RLock from hippybot.hipchat import HipChatApi from hippybot.decorators import botcmd, contentcmd CONFIG_DIR = os.path.expanduser("~/.techbot") DB = os.path.expanduser("~/.techbot/score.db") class Plugin(object): """Plugin to handle knewton re...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Logchecker tool for scanning log files against YETI Threat Intelligence Repository. By LIFARS This code is licensed under MIT license (see LICENSE for details) """ __version__ = "0.8" __author__ = "LIFARS LLC" __copyright__ = "Copyright (c) 2020,2021 LIFARS LLC" __cr...
################################################################################ # # Copyright (c) 2019, the Perspective Authors. # # This file is part of the Perspective library, distributed under the terms of # the Apache License 2.0. The full license can be found in the LICENSE file. # from enum import Enum clas...
#Explicit function def digitSum(n): dsum=0 for ele in str(n): dsum+=int (ele) return dsum #Initializing list List=[367,111,562,945,6726,873] #Using the function on odd element of the list newList=[digitSum(i) for i in List if i & 1] print(newList)
# resnet34.py COPYRIGHT Fujitsu Limited 2022 import torch.nn as nn import torch.nn.functional as F def zero_padding(x1, x2): num_ch1 = x1.size()[1] num_ch2 = x2.size()[1] ch_diff = num_ch1 - num_ch2 # path1 < path2 : zero padding to path1 tensor if num_ch1 < num_ch2: ch_diff = -1 * ch_diff...
from mock import patch, MagicMock, call from allegation.factories import ( DownloadFactory, OfficerAllegationFactory, AllegationFactory, ComplainingWitnessFactory, OfficerFactory) from allegation.services.download_allegations import AllegationsDownload from api.models import Setting from common.tests.core import S...
""" Copyright 2017-present, Airbnb 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 writing, sof...
from eth_typing import BlockNumber # https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md MAINNET_CHAIN_ID = 1 # Fork Blocks listed in ascending order # # Homestead Block # HOMESTEAD_MAINNET_BLOCK = BlockNumber(1150000) # # DAO Block # DAO_FORK_MAINNET_BLOCK = BlockNumber(1920000) DAO_FORK_MAINNET_EXTRA...
# -*- coding: utf-8 -*- # # GRR documentation build configuration file, created by # sphinx-quickstart on Wed Nov 22 17:54:03 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All c...
from kafka import KafkaProducer, KafkaConsumer from resend_kafka_message.setting import ( KafkaProducerConfig, KafkaConsumerConfig, ) import json from kafka.structs import TopicPartition from resend_kafka_message.utils.logger import logger class KafkaBackupProducer: def __init__(self) -> None: sel...
# -*- coding: utf-8 -*- name = 'powershell' version = '6.0.2' author = ['microsoft'] tools = ["pwsh"] requires = [] variants = [ ['platform-windows'], ] def commands(): import os applications_path = os.environ["APPLICATIONS_PATH"] env.PATH.append(os.path.joi...
import os import torch from torch.utils.data import Dataset, DataLoader import torchvision.transforms.functional as F from torchvision import transforms, utils from PIL import Image class resized_dataset(Dataset): def __init__(self, dataset, transform=None, start=None, end=None, resize=None): self.data=[] ...
""" Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None """ class Solution: """ @param inorder : A list of integers that inorder traversal of a tree @param postorder : A list of integers that postorder traversal of a tree ...
from itertools import combinations import pandas as pd from utils.utils import * def load_etf(): etf_data = pd.read_csv( "data/etf_data.csv", encoding="euc_kr", parse_dates=["tdate"] ) etf_ohlcv = etf_data.set_index(["tdate", "etf_code", "data_name"])[ "value" ].unstack() etf_clos...
# -*- encoding: UTF-8 -*- import string from neko.Common import Threat from neko.Common.CLSID import CLSID_NULL, LOW_RISK_LEVEL_OBJECTS, HIGH_RISK_LEVEL_OBJECTS from neko.Common.DataStructures.OLE1 import LengthPrefixedByteArray from neko.Common.DataStructures.OLE2 import OLEStream, SOAPMoniker, CompositeMoniker, Fi...
# From https://stackoverflow.com/a/34325723 _prev_str_length = None # Print iterations progress def print_progress_bar(iteration, total, prefix='', suffix='', decimals=1, length=18, fill='█'): """ Call in a loop to create terminal progress bar @params: iteration - Required : current iteration (Int) total ...
# -*- coding: utf-8 -*- from app.entity.MineBeneficiation import * import json import pandas as pd from app.graph.Graph import Edge class NodeJSONEncoder(json.JSONEncoder): def default(self, o): if isinstance(o, Node): return o.moniker() if isinstance(o, pd.core.series.Series): ...
"""SCons.Builder Builder object subsystem. A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking. The main entry point here is the Builder() factory method. This provides a...
print("String example") s = "this is a test String" print(f"String: {s}") print(f"String Capitalized: {s.capitalize()}") print(f"String Finding index: {s.find('e')}") print(f"String Lowercase: {s.lower()}") print(f"String Uppercase: {s.upper()}") print(f"String Length: {len(s)}") print(f"String Replace: {s.replace('thi...
# coding: utf-8 import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).parent.parent))
# Copyright (c) 2016 Huawei Technologies Co., Ltd. # 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 # # ...
#!/usr/bin/env python # Copyright (c) 2012 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. """Enables directory-specific presubmit checks to run at upload and/or commit. """ __version__ = '1.8.0' # TODO(joi) Add caching ...
from __future__ import absolute_import import time import os import unittest import tempfile import shutil from io import StringIO from . import punc from .punc import Punctuator, download_model class Tests(unittest.TestCase): samples = [ ( 'mary had a little lamb its fleece was white as sn...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2011 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import ssl import logging from sleekxmpp.util import sasl from sleekxmpp.util.stringprep_profiles import StringPrepError from sleekxmpp.stanza ...
def findDecision(obj): #obj[0]: Driving_to, obj[1]: Passanger, obj[2]: Weather, obj[3]: Temperature, obj[4]: Time, obj[5]: Coupon, obj[6]: Coupon_validity, obj[7]: Gender, obj[8]: Age, obj[9]: Maritalstatus, obj[10]: Children, obj[11]: Education, obj[12]: Occupation, obj[13]: Income, obj[14]: Bar, obj[15]: Coffeehouse,...
from __future__ import print_function from .Photostim import *
#!/usr/bin/env python3 #-*- coding: iso-8859-1 -*- ################################################################################ # # This module contains an implementation of XMLRPC interface/resource. # # Sample XMLRPC interface configuration (config_interface_xmlrpc_1.py): # # config = dict \ # ( # protocol = "xml...
import sys from ingenialink.ethernet.network import EthernetNetwork, NET_TRANS_PROT def connection_example(): net = EthernetNetwork() servo = net.connect_to_slave("192.168.2.22", "../../resources/dictionaries/eve-net-c_eth_1.8.1.xdf", 1061, ...
from chill import * source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c') destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d/tmp_files/9010.c') procedure('kernel_heat_3d') loop(0) known('n>3') tile(0,2,8,2) tile(0,4,64...
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# coding: utf-8 # # Copyright 2015 The Oppia 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...
from warnings import simplefilter simplefilter(action='ignore', category=FutureWarning) import numpy as np import argparse import pandas as pd from tqdm.auto import tqdm from datetime import datetime from sklearn.metrics import log_loss import seaborn as sns import matplotlib.pyplot as plt from utils.functions import...
# coding: utf-8 """ OpenShift API (with Kubernetes) OpenAPI spec version: v3.6.0-alpha.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import openshift.client from kubernetes.client.rest import Api...
""" Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W...
import atexit from threading import Event, Thread, current_thread from time import time from warnings import warn __all__ = ["TMonitor", "TqdmSynchronisationWarning"] class TqdmSynchronisationWarning(RuntimeWarning): """tqdm multi-thread/-process errors which may cause incorrect nesting but otherwise no adve...
''' * * (C) Copyright Broadcom Corporation 2015 * * 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 appli...
n=int(100) for i in range(n): for j in range(10): print("*", end="") print()
"""Given a linked list, swap every two adjacent nodes and return its head. Example 1: Input: head = [1,2,3,4] Output: [2,1,4,3] Example 2: Input: head = [] Output: [] Example 3: Input: head = [1] Output: [1] Constraints: The number of nodes in the list is in the range [0, 100]. 0 <= Node.val <= 100 Follow up: Ca...
# -*- coding: utf-8 -*- from django import forms class AuthenticationForm(forms.Form): # bk_token format: KH7P4-VSFi_nOEoV3kj0ytcs0uZnGOegIBLV-eM3rw8 bk_token = forms.CharField()
current_iteration = iteration ########################################################################## ### GAN-TTS : HIGH FIDELITY SPEECH SYNTHESIS WITH ADVERSARIAL NETWORKS ### ########################################################################## # Learning Rate / Optimization decay_start = 99999999 A_ = 0.2e-...
# coding=utf-8 # Copyleft 2019 project LXRT. import os import collections import torch import torch.nn as nn import logging from torch.utils.data.dataloader import DataLoader from tqdm import tqdm from param import args from lxrt.qa_answer_table import load_lxmert_qa from tasks.vqa_model import VQAModel from tasks.v...
# Create a function that implements a basic compression algorithm by counting the chars # thtat are present in a string, if the result string is longer than input # then return original input. # # Examples: # aaabcccccaaa: a3b1c5a3 # abcdef: abcdef # aaaaaaaaaaba: a10b1a1 ### Note: Don't use extra space import unit...
def find_subsets(nums): subsets = [] # TODO: Write your code here subsets.append([]) for i in range(len(nums)): storeLen = len(subsets) for j in range(0,storeLen): currSet = list(subsets[j]) currSet.append(nums[i]) subsets.append(currSet) return subsets
""" This script is brought from https://github.com/nkolot/SPIN Adhere to their licence to use this script """ import math import torch import numpy as np import os.path as osp import torch.nn as nn from lib.core.config import DATA_DIR from lib.utils.geometry import rotation_matrix_to_angle_axis, rot6d_to_rotmat from ...
from typing import Optional from typing import Union from collections.abc import Callable import numpy as np from .typing import RandomStateType from .typing import Literal class DictionaryLearning: components_: np.ndarray error_: np.ndarray n_iter_: int def __init__( self, n_compon...
# Databricks notebook source # MAGIC %md # MAGIC ## Model Monitoring # COMMAND ---------- # MAGIC %run ./includes/utilities # COMMAND ---------- # MAGIC %run ./includes/configuration # COMMAND ---------- # grab the station information (system wide) stationDF=get_bike_stations()[['name','station_id','lat','lon']] ...
""" Canon Log Encodings =================== Defines the *Canon Log* encodings: - :func:`colour.models.log_encoding_CanonLog` - :func:`colour.models.log_decoding_CanonLog` - :func:`colour.models.log_encoding_CanonLog2` - :func:`colour.models.log_decoding_CanonLog2` - :func:`colour.models.log_encoding_CanonLo...
# coding: utf-8 # ----------------------------------------------------------------------------------- # <copyright company="Aspose" file="insert_list_online_request.py"> # Copyright (c) 2021 Aspose.Words for Cloud # </copyright> # <summary> # Permission is hereby granted, free of charge, to any person obtaining a c...
from test.utilities.env_vars import set_env_vars from test.utilities.excel import Excel def test_simple_script_for_addition(xll_addin_path): with set_env_vars('basic_functions'): with Excel() as excel: excel.register_xll(xll_addin_path) ( excel.new_workbook() ...
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
# Generated by Django 3.2.3 on 2021-05-21 04:17 from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='FAQ', ...
# -*- coding: utf-8 -*- ''' The crypt module manages all of the cryptography functions for minions and masters, encrypting and decrypting payloads, preparing messages, and authenticating peers ''' # Import python libs from __future__ import absolute_import, print_function import os import sys import copy import time im...
""" WSGI config for booktrade project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SE...
from __future__ import division, print_function from conllu.parser import parse, parse_tree from tags import Tags, Tag, Label import os import re import math import numpy as np import itertools import pdb import pickle import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import torch from torch.aut...
"""This module defines miscellaneous utility functions that is public to users.""" import numpy as np from numpy import unique, linalg, diag, sqrt, dot from Bio.Phylo.BaseTree import Tree, Clade from prody import PY3K from .misctools import addEnds, interpY, index, isListLike from .checkers import checkCoords from ....
from rpython.translator.translator import TranslationContext from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rtyper import rint from rpython.rtyper.lltypesystem import rdict, rstr from rpython.rtyper.test.tool import BaseRtypingTest from rpython.rlib.objectmodel import r_dict from rpython.rlib.rarithm...
# ROS/IOP Bridge # Copyright (c) 2017 Fraunhofer # # This program is dual licensed; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2 as published by the Free Software Foundation, or # enter into a proprietary license agreement with the copyright # holder. # # This...
import matplotlib.pyplot as plt import numpy as np def stockUp(priceFile): # read the file infile = open(priceFile, "r") date = [] stock = [] # store only the dates and closing price day = 1 firstLine = True for line in infile: if firstLine: firstLine = False ...
# -*- coding: utf-8 -*- """ @author: %(Mikel Val Calvo)s @email: %(mikel1982mail@gmail.com) @institution: %(Dpto. de Inteligencia Artificial, Universidad Nacional de Educación a Distancia (UNED)) @DOI: 10.5281/zenodo.3759306 """ #%% class SlotsManager: # Inicializa la lista de callbacks def __init__(self): ...
import itertools import sqlalchemy as sa from sqlalchemy import and_ from sqlalchemy import desc from sqlalchemy import exc as sa_exc from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import lateral from sqlalchemy import literal...
"""Command line wrapper to serve one or more named Bokeh scripts or folders.""" import logging import os import re import pathlib import tempfile from typing import Any, Dict, Tuple import bokeh.server.views import click from bokeh.application.application import Application from bokeh.command.util import build_single_...
from django_filters import rest_framework as filters from rest_framework import viewsets from rest_framework.filters import SearchFilter, OrderingFilter from rest_framework.permissions import IsAuthenticated, BasePermission from invoices.api.serializers import InvoiceSerializer from invoices.models import Invoice cl...
"""Tests for experimental code using pandas objects for internal storage. See pandasdmx.experimental for more information. """ from pandasdmx.experimental import DataSet as PandasDataSet from pandasdmx.model import ( AttributeValue, DataAttribute, DataSet, Key, Observation, ) import pytest pyt...
import functools import operator import os import os.path import sys import numpy as np # Bamboo utilities current_file = os.path.realpath(__file__) current_dir = os.path.dirname(current_file) sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python')) import tools # ==============================...