text
stringlengths
2
999k
# This file is generated by objective.metadata # # Last update: Sun Sep 29 13:08:51 2019 import objc, sys if sys.maxsize > 2 ** 32: def sel32or64(a, b): return b else: def sel32or64(a, b): return a misc = { } misc.update({'sfntInstance': objc.createStructType('sfntInstance', sel32or64(b'{sfntInstance=ss[1l]}...
import os import re import foolbox from foolbox.distances import Linf from foolbox.criteria import TargetClass import numpy as np import tensorflow as tf from sklearn.utils.multiclass import unique_labels from tensorflow.python.keras import backend as K from tensorflow.python.keras.models import load_model from tenso...
# coding=utf-8 # Copyright 2021 The OneFlow 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 require...
# get mappings based on MRCONSO in UMLS with CUI and STY from tqdm import tqdm from collections import defaultdict, Counter from owlready2 import * MRCONSO_FILE = '/mnt/datashare/UMLS/MRCONSO.RRF' MRSTY_FILE = '/mnt/datashare/UMLS/MRSTY.RRF' SNOMEDCT_onto_file = '/mnt/datashare/UMLS-processed/ontos/snomed.owl' # the...
# -*- coding: utf-8 -*- # # Copyright (C) 2020 CERN. # # CDS-ILS is free software; you can redistribute it and/or modify it under # the terms of the MIT License; see LICENSE file for more details. """CDS-ILS Book model.""" from __future__ import unicode_literals from copy import deepcopy from cds_ils.importer.overd...
from __future__ import absolute_import, division, print_function, unicode_literals import sys from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QMessageBox, QFileDialog, QGridLayout, QHBoxLayout, \ QVBoxLayout, QGroupBox, QCheckBox, QPushButton, QAction from PatchEdit impor...
""" Support for KNX/IP covers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.knx/ """ import asyncio import voluptuous as vol from homeassistant.components.cover import ( ATTR_POSITION, ATTR_TILT_POSITION, PLATFORM_SCHEMA, SUPPORT_CLOSE, ...
""" Events for xonsh. In all likelihood, you want builtins.events The best way to "declare" an event is something like:: events.doc('on_spam', "Comes with eggs") """ import abc import builtins import collections.abc import inspect from xonsh.tools import print_exception def has_kwargs(func): return any(p....
import torch print("PyTorch Version: ",torch.__version__) import torch.nn as nn import torch.optim as optim import numpy as np import torchvision from torchvision import datasets, models, transforms import matplotlib.pyplot as plt import time import os,glob,shutil import copy # print("PyTorch Version: ",torch.__versio...
# -*- coding: utf-8 -*- """ Created on Sat Feb 20 01:20:56 2021 @author: raula """ import connect # call in our API data import csv from binance.client import Client # https://python-binance.readthedocs.io/en/latest/ READ HERE for more func # web socket documentation: # https://github.com/binance/binance-spot-api-d...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/03_Measures.ipynb (unless otherwise specified). __all__ = ['lsradialcenterfit', 'radialcenter'] # Cell import matplotlib.pyplot as plt import numpy as np from numpy.matlib import repmat from PIL import Image from torch import Tensor # Cell def lsradialcenterfit(m, b, w...
from django.contrib import admin from sorl.thumbnail.admin import AdminImageMixin from .models import Score @admin.register(Score) class ScoreAdmin(AdminImageMixin, admin.ModelAdmin): list_display = ["game_name", "player_name", "player_score"] list_filter = ("player_name",)
#Ref: Sreenivas Sarwar Anik """ References from the video: https://www.thispersondoesnotexist.com/ http://www.wisdom.weizmann.ac.il/~vision/courses/2018_2/Advanced_Topics_in_Computer_Vision/files/DomainTransfer.pdf """ #FOr single image # example of generating an image for a specific point in the latent space from k...
import pkg_resources import sphinx_rtd_theme project = 'Spaceland' copyright = '2017 Já hf' version = release = pkg_resources.require('spaceland')[0].version master_doc = 'index' exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] default_role = 'py:obj' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext....
# coding:utf-8 import os from collections import namedtuple from SRC.common.config import EasyConfig from SRC.common.configFactory import ConfigFactory as CFactory from ui.project.model.testPlan import TestPlan ''' 测试方案配置工厂 ''' class ConfigFactory(CFactory): def __init__(self,projectPath,configXmlPath=None): sup...
import requests PT_SVC_ADDR = 'http://0.0.0.0:5000/' class CommonAPITest(object): '''Define the API tests in their own inheritable class so they may be reused in multiple test cases. This was done to allow testing of the api in a container and as local service. ''' def test_api_hello_world(s...
from queries import * import numpy as np import pandas as pd from bokeh.io import output_file, show from bokeh.models import HoverTool, ColumnDataSource, LogColorMapper, ColorBar, LogTicker, LabelSet from bokeh.plotting import figure from bokeh.palettes import Accent8 def scatter_foreigners_totalMarketValue(): d...
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Hiphopcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the generation of UTXO snapshots using `dumptxoutset`. """ from test_framework.test_framework i...
import calendar from datetime import date, datetime, time import locale import unicodedata import numpy as np import pytest import pytz from pandas._libs.tslibs.timezones import maybe_get_tz from pandas.core.dtypes.common import is_integer_dtype, is_list_like import pandas as pd from pandas import ( ...
# -*- coding: utf-8 -*- # !/usr/bin/env python3 import filecmp if __name__ == '__main__': import pathlib # -- COMPARING FILES --- print('COMPARING FILES') # Let's first compare files "fileset_a/bar.txt" with itself bar_a = (pathlib.Path(__file__) / '..' / 'fileset_a' / 'bar.txt').resolve() ...
# -*- coding: utf-8 -*- # # 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 #...
print(__doc__) import matplotlib.pyplot as plt import numpy as np from sklearn import datasets, linear_model # Load the sample dataset sample = datasets.load_diabetes() print(sample) # Use only one feature sample_x = sample.data[:, np.newaxis, 2] # Split the data into training/testing sets sample_x_train = sample_x[...
import pandas as pd import numpy as np from . import BaseAgent class QTableAgent(BaseAgent.BaseAgent): def __init__(self, learning_rate=0.05, lr_decay=False, epsilon=0.9, decay_rate=1e-5, unexplored=0, discount_...
import pytest from ui import ui @pytest.fixture def app(): yield ui.app @pytest.fixture def client(app): return app.test_client()
from talon import actions, Module import json from typing import Any, List mod = Module() class NotSet: def __repr__(self): return "<argument not set>" @mod.action_class class Actions: def cursorless_single_target_command( action: str, target: str, arg1: Any = NotSet, ...
# Generated by Django 2.2.6 on 2020-02-18 09:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0024_auto_20200217_1919'), ] operations = [ migrations.AddField( model_name='user_data', name='credit_a...
# Copyright 2017 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...
import pytest from django.urls import resolve, reverse from cipefilos.users.models import User pytestmark = pytest.mark.django_db def test_user_detail(user: User): assert ( reverse("api:user-detail", kwargs={"username": user.username}) == f"/api/users/{user.username}/" ) assert resolve(f...
import logging logging.getLogger('tensorflow').disabled = True logging.getLogger('matplotlib').disabled = True import numpy from numpy import testing numpy.random.seed(0) from tensorflow.random import set_seed set_seed(2) from nose.tools import eq_, assert_less, assert_greater, assert_almost_equal import pandas fro...
# 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...
from .tools import (try_gpu, try_all_gpus,summary) from .classes import (Timer,Accumulator)
"""Timezone related utilities for BSON.""" from datetime import (timedelta, tzinfo) ZERO = timedelta(0) class FixedOffset(tzinfo): """Fixed offset timezone, in minutes east from UTC. Implementation based from the Python `standard library documentation <http://docs.python.org/libra...
from . import Manager, Fields class News(Manager): def __init__(self, table_name=None): Manager.__init__(self, table_name) title = Fields().charfield( 'title', 100, not_null=True ) date = Fields().charfield( 'date', 10, not_null=True ) ...
import os from get_data import read_params, get_data import argparse def load_and_save(config_path): config = read_params(config_path) df = get_data(config) new_cols = [col.replace(" ", "_") for col in df.columns] raw_data_path = config["load_data"]["raw_dataset_csv"] df.to_csv(raw_data_path, ...
from functools import wraps, partial from itertools import product import numpy as np from sympy import S from devito.tools import Tag, as_tuple from devito.finite_differences import Differentiable class Transpose(Tag): """ Utility class to change the sign of a derivative. This is only needed for odd or...
from async_timeout import timeout from datetime import datetime from bs4 import BeautifulSoup import sys import socket import aiohttp from fake_useragent import UserAgent import asyncio import concurrent.futures import random from json import loads, dumps from aiohttp_socks import ProxyConnector, ProxyType from urllib....
# Copyright 2019 Doyoung Gwak (tucan.dev@gmail.com) # 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 ...
# Copyright 2021 Google LLC # # 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, ...
from datetime import datetime, date, timedelta from uuid import UUID, uuid4 from ..tasks.task_wrapper import TaskWrapper from ..utils.dag import query as dag_query, topological_sort from .config import get_connections from .errors import Err, Ok from ..logging import EventTracker from ..database import Database run_i...
""" @author: Qingyun Hu @contact: dianesohungry@gmail.com """ import sys sys.path.append("./utils/") from preprocessing_dictionary import * from preprocessing_word2vec import * from preprocessing_weibo import CreateTagsByID from preprocessing_weibo_corpus import * from gensim.models import Word2Vec from gensim.model...
# -*- coding: utf-8 -*- from PyQt5.QtWidgets import QTableView, QPushButton from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QDialog, QDialogButtonBox from PyQt5.QtWidgets import QLabel, QLineEdit from PyQt5.QtWidgets import QGridLayout class Ui_Widget(obje...
class Array: """sizeOfArray: denotes the total size of the array to be initialized arrayType: denotes the data type of the array(as all the elements of the array have same data type) arrayItems: values at each position of array """ def __init__(self, sizeOfArray, arrayType=int): self.sizeOf...
#!/usr/bin/env python # Add RunManager modules to PYTHONPATH import sys import params sys.path.append(params.RM_DIR) import cgi from RunManager import * from HTMLLib import * # Enable python stack trace output to HTML import cgitb; cgitb.enable() # Globals rm = None def init(): global rm rm = RunManag...
from django.apps import AppConfig class TruthsConfig(AppConfig): name = 'truths'
# -*- coding: utf-8 -*- # @Time : 2021/5/5 0005 14:18 # @Author : Daniel Zhang # @Email : zhangdan_nuaa@163.com # @File : train.py # @Software: PyCharm import torch import torch.nn as nn from torchvision.utils import save_image logit_criterion = nn.BCEWithLogitsLoss(reduction='mean') prob_cri...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
""" Tests for calculations.""" from aiida import orm from aiida.common import datastructures from aiida.plugins import CalculationFactory # from . import TEST_DIR def test_create_bxsf_from_wannier90(aiida_localhost, tmp_path): """Test running a ``create_bxsf_from_wannier90``.""" # Prepare input bxsf_fil...
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import pytest import functools from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError, ServiceRequestE...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import hashlib import math from ccxt.base.errors import ExchangeError from ccxt.base....
# # File: smoother.py # import numpy as np import torch from numpy.random import choice from scipy.optimize import least_squares, minimize from torch.distributions.multivariate_normal import MultivariateNormal from ceem import utils from ceem.opt_criteria import GroupSOSCriterion, STRStateCriterion from tqdm import t...
""" Test postprocessing algorithms """ import numpy as np from yatsm.algorithms.postprocess import commission_test, refit_record # COMMISSION TEST def test_commission_nochange(sim_nochange): """ In no change situation, we should get back exactly what we gave in """ record = commission_test(sim_nochange, ...
"""Copyright (c) 2005-2022, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms,...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: fraud_detection_service.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection fro...
# 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. # pyre-unsafe import tempfile from pathlib import Path import testslide from .. import ( command_arguments, configuration, pyre...
"""Adds config flow for Trafikverket Train integration.""" from __future__ import annotations from typing import Any from pytrafikverket import TrafikverketTrain import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_API_KEY, CONF_NAME, CONF_WEEKDAY, WEEKDAYS from home...
from lazyapi import app from fastapi import HTTPException from pydantic import BaseModel import requests import os import json class Batch(BaseModel): token: str path: str filename: str tofilename: Optional[str] = None class BatchList(BaseModel): batch: List[Batch] spgraph_url = os.getenv("SPGRA...
"""Auto-generated file, do not edit by hand. GP metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_GP = PhoneMetadata(id='GP', country_code=590, international_prefix='00', general_desc=PhoneNumberDesc(national_number_pattern='[56]\\d{8}', possible_length=(9,)), ...
#!/usr/bin/env python import os import scandir import matplotlib.pyplot as plt import cv2 from matplotlib.widgets import RectangleSelector from generate_xml import write_xml # global constants img = None tl_list = [] br_list = [] object_list = [] # constants image_folder = 'temp_images' savedir = 'temp_annotations' ...
import re import yaml import csv import requests from django.contrib import messages from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.db.models import Count, Q, Model from django.shortcuts import redirect, render, get_object_or_404 from d...
import pytest from allennlp.common import Params from allennlp.common.util import ensure_list from allennlp.common.testing import AllenNlpTestCase from allennlp_models.classification import StanfordSentimentTreeBankDatasetReader from tests import FIXTURES_ROOT class TestStanfordSentimentTreebankReader: sst_path...
# coding:utf-8 from collections import OrderedDict class StateObject(object): txt = {} _keys = [] # dummy _values = [] # dummy v2k = {} # dummy @classmethod def get_txt(cls, index): return cls.txt.get(index) @classmethod def keys(cls): return cls._keys @class...
"""Discrete CNN QFunction with CNN-MLP structure.""" import tensorflow as tf from metarl.tf.models import CNNModel from metarl.tf.models import CNNModelWithMaxPooling from metarl.tf.models import MLPDuelingModel from metarl.tf.models import MLPModel from metarl.tf.models import Sequential from metarl.tf.q_functions im...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Font(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "histogram2dcontour.hoverlabel" _path_str = "histogram2dcontour.hoverlabel.font" _valid_props =...
import os import sys import shutil import re from datetime import datetime import numpy as np import pandas as pd #import matplotlib.pyplot as plt import yaml from astropy.io import fits from astropy.wcs import WCS from shutil import which set_type ='evaluation' #set_type ='development_small' #set_type= 'debug' run_f...
# -*- coding: utf-8 -*- import os import sys import pickle import math import datetime import matplotlib matplotlib.use("WXAgg", warn=True) # 这个要紧跟在 import matplotlib 之后,而且必须安装了 wxpython 2.8 才行。 import matplotlib.pyplot as pyplot import matplotlib.font_manager as font_manager import numpy from matplotlib.tick...
from typing import Dict, List, Optional, Union import gdsfactory as gf from gdsfactory.components.bend_euler import bend_euler from gdsfactory.cross_section import strip from gdsfactory.difftest import difftest from gdsfactory.port import Port from gdsfactory.types import ComponentSpec, CrossSectionSpec, Routes def ...
from __future__ import unicode_literals from django_rdkit import models from rdkit import Chem from urllib import quote class Compound(models.Model): name = models.CharField(max_length=256) molecule = models.MolField() #torsionbv = models.BfpField(null=True) #mfp2 = models.BfpField(null=True) ...
# model settings model = dict( type='CenterNet', pretrained='modelzoo://resnet34', backbone=dict( type='ResNet', depth=34, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_eval=False, add_summay_every_n_step=200, style='pytorch'), ...
#!/usr/bin/env python """ File : angular_upload_s3cf.py Package : angular_upload_s3cf Description : A Python package to upload Angular build to S3 along with CloudFront Created by Avinash on 25/07/2020 """ # git checkout production # git fetch origin # git merge origin/production #...
from model.contact import Contact import random def test_delete_some_contact(app, db, check_ui): if len(db.get_contact_list()) == 0: app.contact.add_new_contact(Contact(firstname="agata")) old_contacts = db.get_contact_list() contact = random.choice(old_contacts) app.contact.delete_contact_by_...
import pytest from aqaapi.users.models import User pytestmark = pytest.mark.django_db def test_user_get_absolute_url(user: User): assert user.get_absolute_url() == f"/users/{user.username}/"
import sys import os import os.path as op import logging from optparse import OptionParser from piccel import WorkBook, LocalFileSystem logger = logging.getLogger('piccel') import getpass def main(): min_args = 2 max_args = 2 usage = 'usage: %prog [options] WORKBOOK_FILE OUTPUT_KEY_FILE' descripti...
# Generated by Django 3.2.5 on 2021-08-07 16:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scanmodule', '0010_auto_20210807_1912'), ] operations = [ migrations.AlterField( model_name='siteassest', name='last...
from collections import defaultdict from copy import deepcopy import io import json import math import matplotlib.pyplot as plt plt.switch_backend('agg') import matplotlib.ticker as ticker import os import re import string import sys import time import unicodedata from .preprocessing.database import load_alignments_fr...
import gym import torch import random import collections from torch.autograd import Variable import numpy as np from collections import namedtuple, deque from .agent import BaseAgent from .common import utils # one single experience step Experience = namedtuple('Experience', ['state', 'action', 'reward', 'done']) ...
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest from io import StringIO class TestSequenceFu...
# -*- coding: utf-8 -*- # Copyright 2012 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 require...
import pytest from werkzeug.exceptions import Forbidden from werkzeug.exceptions import HTTPException from werkzeug.exceptions import InternalServerError from werkzeug.exceptions import NotFound import flask def test_error_handler_no_match(app, client): class CustomException(Exception): pass @app.er...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @trojanzhex from pyrogram import Client, filters from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton from script import script @Client.on_message(filters.command(["start"]) & filters.private) async def start(client, message): try: await ...
"""STIX 2 error classes. """ class STIXError(Exception): """Base class for errors generated in the stix2 library.""" class InvalidValueError(STIXError, ValueError): """An invalid value was provided to a STIX object's ``__init__``.""" def __init__(self, cls, prop_name, reason): super(InvalidValu...
go = "Game Over!" write = "Trzeba nauczyć się pisać poprawnie :( - " + go side = input("Witaj na wyspie. Twoim celem jest znalezienie skarbu. Możesz się udać w prawo (right) lub w lewo (left): ").lower() if side == "left": swimOrWait = input("Dotarłeś na brzeg. Możesz popłynąć (swim) lub poczekać (wait): ").lower()...
# coding= utf-8 # 测试入口 import os import time import sys from src.streams.manger import Manager from src.analysis.Analysis import AnalysisTool from threading import Timer from src.zipmanager import make_zip manager = None powerTest = False timeStr = "" def startAnalysis(): analysis = AnalysisTool(dir=os.path.jo...
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import l...
import pytest import sys import os sys.path.append(".") from asset_app import app @pytest.fixture def client(): app.config["LOGIN_DISABLED"] = True app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['WTF_CSRF_METHODS'] = [] app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql...
import functools import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import segmentation_models_pytorch as smp import utils class FCN(nn.Module): def __init__(self, num_input_channels, num_output_classes, num_filters=64): super(FCN, self).__init__() self.con...
from websocket import create_connection class Logger: msg_placeholder = "{\"message\": \"%s\"}" def __init__(self, channel): self.ws = create_connection("ws://alpharithmic.herokuapp.com/ws/logs/%s/" % channel) def __del__(self): self.ws.close() def log(self, msg): self.ws.se...
''' Schema for making GraphQL queries and mutations ''' from . import models from . import mutations from . import query import graphene import graphql from graphene.relay import Node from graphene_mongo import MongoengineConnectionField, MongoengineObjectType import graphene_file_upload import graphene_file_upload.sc...
#!/usr/bin/env python "Makes working with XML feel like you are working with JSON" from xml.parsers import expat from xml.sax.saxutils import XMLGenerator from xml.sax.xmlreader import AttributesImpl try: # pragma no cover from cStringIO import StringIO except ImportError: # pragma no cover try: from S...
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns # Load Stocks in to different dataframes data1 = pd.read_csv(r'C:\Users\TATAPOWER.csv') data2 = pd.read_csv(r'C:\Users\VOLTAS.csv') data3 = pd.read_csv(r'C:\Users\APOLLOTYRE.csv') data4 = pd.read_csv(r'C:\Users\BERGEPAINT.csv') data5 = ...
import argparse import glob import numpy as np import os import torch import constants as c def get_best_epoch_cell(ckpt_path, cell_type): model_ckpt = torch.load(ckpt_path) loss_history = model_ckpt['loss'] acc_history = model_ckpt['acc'] pp_acc_history = model_ckpt['pp_acc'] best_epoch = -1 ...
class Solution: def dfs(self, pos, tmp): # only add to answer when size >= 2 if (len(tmp) >= 2): # use a set to delete duplicates self.res.add(tuple(copy.deepcopy(tmp))) # when we reach the last element return if (pos == len(self.nums) - 1): ...
import pickle import random from time import time from typing import Union import numpy as np import torch from torch import nn, optim from torch.nn import functional as F from torch.nn.functional import mse_loss, l1_loss, binary_cross_entropy, cross_entropy from torch.optim import Optimizer device = torch.device("cu...
import logging import os import platform import stat import requests from datetime import datetime, timedelta from checkov.common.bridgecrew.platform_integration import bc_integration from checkov.common.bridgecrew.integration_features.base_integration_feature import BC_API_URL from checkov.common.util.dict_utils impo...
''' print_task.py ancilla Created by Kevin Musselman (kevin@frenzylabs.com) on 01/08/20 Copyright 2019 FrenzyLabs, LLC. ''' import time import sys import os import zmq from zmq.eventloop.zmqstream import ZMQStream # import zmq.asyncio import json from tornado.ioloop import IOLoop, PeriodicCallback # from zmq.ev...
import os import sys import time import logging import yaml import signal import threading import shout logging.basicConfig(level=logging.INFO, format='(%(threadName)-10s) %(asctime)s - %(name)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) logger.info("Loading config file " + sys.argv[1] + "....
""" Author: Jay Lago, NIWC/SDSU, 2021 """ import tensorflow as tf import pickle import datetime as dt import os import sys sys.path.insert(0, '../../') import DLDMD as dl import LossDLDMD as lf import Data as dat import Training as tr # =====================================================================...
from django.contrib import admin from . models import LearningSettings, ClassSettings, MailLists # Register your models here. admin.site.register(LearningSettings) admin.site.register(ClassSettings) admin.site.register(MailLists)
from templet import stringfunction @stringfunction def template (name, typename, value) : """ <configProperty> <name>${name}</name> <value> <type> <kind>tk_${typename}</kind> </type> <value> <${typename}>${value}</${typename}> </value> </val...
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" ...
# -*- coding: utf-8 -*- # Copyright 2016 Stanford University # # 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 applicab...