text
stringlengths
2
999k
# -*- coding: utf-8 -*- """ @date: 2022/4/19 下午7:15 @file: caltech101.py @author: zj @description: """ from simpleir.utils.split import caltech101 print(caltech101.__all__) # print(caltech101.__dict__) dataset_type = 'Caltech101' m = caltech101.__dict__[dataset_type]('./data/') print(m)
import pytest import networkx as nx import scse.controller.miniscot as miniSCOT from scse.main.cli import MiniSCOTDebuggerApp _HORIZON = 10 def _create_miniscot(): return miniSCOT.SupplyChainEnvironment(time_horizon = _HORIZON, asin_selection = 1) def test_importable()...
from __future__ import print_function import requests import os import hashlib import base64 import time import hmac import json import boto3 from base64 import b64decode print('Loading function') # Use LogicMonitor's API to search for a monitored device given an ARN def find_device_by_arn(args): device_info =...
weather = input() if weather == "sunny": print("It's warm outside!") else: print("It's cold outside!")
from pprint import pformat import sys from flask import Blueprint, current_app, jsonify from lever import (API, LeverException) import six from .models import (Block, Share, Transaction, Payout, OneMinuteShare, Status, Blob, BonusPayout) from . import db api = Blueprint('api_bp', __name__) @a...
import shutil import os from nightcapcore.printers.print import Printer from nightcappackages.classes.databases.mogo.mongo_modules import MongoModuleDatabase from nightcappackages.classes.databases.mogo.mongo_packages import MongoPackagesDatabase from nightcappackages.classes.databases.mogo.mongo_submodules import ( ...
from distutils.version import LooseVersion import logging import math import random import six import numpy as np import torch import torch.nn.functional as F from argparse import Namespace from espnet.nets.ctc_prefix_score import CTCPrefixScore from espnet.nets.ctc_prefix_score import CTCPrefixScoreTH from espnet.n...
''' Created by auto_sdk on 2015.08.04 ''' from aliyun.api.base import RestApi class Rds20140815AllocateInstancePublicConnectionRequest(RestApi): def __init__(self,domain='rds.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.ConnectionStringPrefix = None self.DBInstanceId = None self.Po...
import httpx from anilist.types import Anime from pyrogram import filters from pyrogram.types import CallbackQuery from pyromod.helpers import ikb from pyromod.nav import Pagination from amime.amime import Amime @Amime.on_callback_query(filters.regex(r"^summer_2023 anime (?P<page>\d+)")) async def anime_suggestions(...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import re import sys import pickle from sklearn.datasets import load_files from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.metrics import accuracy_score, confu...
# -*- coding: utf-8 -*- # Scrapy settings for leads project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/latest/t...
import sys import re import click import tempfile from getoc.mirror import Mirror CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) @click.group(context_settings=CONTEXT_SETTINGS) @click.pass_context def cli(ctx): pass @cli.command() @click.argument("version") def dl(version): """Download an Ope...
import logging import os import torch import dill import json import pickle import msgpack from eisen.utils import EisenModuleWrapper from eisen_deploy.utils import encode_data, decode_data logger = logging.getLogger(__name__) def json_file_to_dict(json_file): if not os.path.exists(json_file): raise Fi...
# coding: utf-8 """ EVR API OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. # noqa: E501 The version of the OpenAPI document: 1.8.0 Generated by: https://openapi-generator.tech """ from ...
from django.db import transaction from django.db.models import Prefetch from django.utils.timezone import now from django.utils.translation import ugettext as _ from pretix.base.models import ( Checkin, CheckinList, Order, OrderPosition, Question, QuestionOption, ) class CheckInError(Exception): def __init__...
import unittest import requests from requests.auth import HTTPDigestAuth from testdata.test_data import url class DataExtractionAPITestCase(unittest.TestCase): def setUp(self): self.DIGEST_CREDENTIALS = HTTPDigestAuth('tester150411@gmail.com', 'tester150411') self.WRONG_DIGEST_CREDENTIALS = HTTP...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
import asyncio async def coro(delay: int): try: print(f"start sleeping for {delay}") await asyncio.sleep(delay) print(f"slept without disturbance for {delay}") except asyncio.CancelledError: print("sleep disturbed!!") async def main(): loop = asyncio.get_running_loop() ...
from typing import Optional, Iterable, Union import gzip as gz try: from utils import arguments as arg from utils.decorators import deprecated_with_alternative from interfaces import StreamType, ItemType, FileType, Auto, AUTO from streams import stream_classes as sm from functions import item_funct...
# -*- test-case-name: twisted.python.test.test_setup -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. # pylint: disable=I0011,C0103,C9302,W9401,W9402 """ Setuptools convenience functionality. This file must not import anything from Twisted, as it is loaded by C{exec} in C{setup.py}. If you...
# coding=utf-8 # Copyright 2021 Google Research and The HuggingFace Inc. team. 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/LICE...
############################################# # Author: Kim Sharp # Date: 7/21/2017 # # branch off dockeye_c_v2.3.py to dock multiple conformations # of ligand simultaneously # usage inside pymol command window: de('protein_target.pdb','ligand.pdb') # target protein 1st, then ligand- ligand pdb file must have at...
#! /usr/bin/env python from ..io.toltec.table import TableIO, KidsModelParams, KidsModelParamsIO from ...utils import get_pkg_data_path from astropy.table import Table import pytest import pickle from kidsproc import kidsmodel def test_txt_file_io_basic_open(): # local file filepath = get_pkg_data_path().j...
# -*- coding: utf-8 -*- import sys import warnings from pathlib import Path PROJECT_DIR = Path(__file__).resolve().parent if str(PROJECT_DIR.parent) not in sys.path: sys.path.insert(0, str(PROJECT_DIR.parent)) warnings.filterwarnings( "ignore", category=FutureWarning, module="sklearn.utils.deprecation" ) from...
# -*- coding: utf-8 -*- """ Project : PyCoA Date : april 2020 / march 2022 Authors : Olivier Dadoun, Julien Browaeys, Tristan Beau Copyright ©pycoa.fr License: See joint LICENSE file Module : coa._version About : Gives the version information, also used in the setup.py and __init__.py files """ # Store the vers...
import pytest from biserici_inlemnite.users.models import User from biserici_inlemnite.users.tests.factories import UserFactory @pytest.fixture(autouse=True) def media_storage(settings, tmpdir): settings.MEDIA_ROOT = tmpdir.strpath @pytest.fixture def user() -> User: return UserFactory()
# Copyright 2017 reinforce.io. 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 law or...
# @l2g 1711 python3 # [1711] Count Good Meals # Difficulty: Medium # https://leetcode.com/problems/count-good-meals # # A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two. # You can pick any two different foods to make a good meal. # Given an array o...
from sqlalchemy.orm import Session from models import sql from models.api import SubscriptionDB, Subscription from models.covid_data.school_cases_by_district import SchoolDistricts def add_(db: Session, subscription: SubscriptionDB): sub_dict = subscription.dict() sub_dict["district"] = subscription.district...
#EJERCICIO NUMERO 3 DE PYTHON DESDE CERO print("Calcular el numero mayor") num1 = int(input("INGRESA EL PRIMER NUMERO: ")) num2 = int(input("INGRESA EL SEGUNDO NUMERO: ")) num3 = int(input("INGRESA EL TERCER NUMERO: ")) print("LOS NUMEROS A COMPARAR SON: ",num1,", ",num2," y ",num3) if num1 > num2 and num2 > num3: ...
#!/usr/bin/env python import rospy import actionlib from actionlib_msgs.msg import * from geometry_msgs.msg import Pose, Point, Quaternion, Twist from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal from tf.transformations import quaternion_from_euler from visualization_msgs.msg import Marker from math import ...
import tkinter as tk from tkinter import ttk class CosmoDirectory(tk.Tk): def __init__(self): """ Cosmo Directory launcher and window. Load information from text files a...z.txt. Saves information before closing window to allow for user to edit text to their liking. Allows for per...
"""lcd URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vie...
#!/usr/bin/env python import cv2 import numpy as np def getPerspectiveTransformMatrix(p1, p2): matrixIndex = 0 A=[] for i in range(0, len(p1)): x, y = p1[i][0], p1[i][1] u, v = p2[i][0], p2[i][1] A.append([x, y, 1, 0, 0, 0, -u * x, -u * y, -u]) A.append([0, 0, 0, x, y, 1, -v...
""" Evaluation class that performs forward pass through trained models """ import os import cv2 import numpy as np from pocovidnet import MODEL_FACTORY from tensorflow.keras.preprocessing.image import ImageDataGenerator DIR_PATH = os.path.dirname(os.path.realpath(__file__)) NUM_FOLDS = 5 CLASS_MAPPING = { 3: ['c...
#|==============================================================|# # Made by IntSPstudio # PTB Database # Thank you for using this software! # Version: 0.1.2.20171010 # ID: 980005031 # # Twitter: @IntSPstudio #|==============================================================|# #IMPORT import mse #RETURN DEFAULT VSL SETT...
# Author: Mark Wronkiewicz <wronk@uw.edu> # # License: BSD-3-Clause import numpy as np from numpy.testing import assert_allclose from scipy.interpolate import interp1d import pytest from mne import create_info, find_events, Epochs from mne.io import RawArray from mne.preprocessing import realign_raw @pytest.mark.pa...
import unittest from netapp_ocum.objects.volume import NetApp_OCUM_Volume class NetApp_OCUM_Object_Volume_Test(unittest.TestCase): """Tests for `netapp_ocum/objects/volume.py`.""" def test_volume_instance(self): """ Test creating an instance of `NetApp_OCUM_Volume` """ volume = NetApp_OCUM_Vol...
__all__ = ['load_image', 'load_image_from_url', 'load_image_from_string'] from .load_image import load_image from .load_image import load_image_from_url from .load_image import load_image_from_string
# ------------------------------------------------------------------------------ # Copyright (c) 2020. Anas Abu Farraj. # ------------------------------------------------------------------------------ """Creating Authentication Blueprint.""" from flask import Blueprint auth = Blueprint('auth', __name__)
# plugin/plugin_base.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Testing extensions. this module is designed to work as a testing-framework...
import twitch_api from models import TwitchCredentials, TwitchFollowRelation from twitch_cred import cred_list import os import csv import write_twitch_csv clientId, secret = cred_list[0] twitch_id = '38051463' directory = f'data/{twitch_id}' if not os.path.exists(directory): os.makedirs(directory) cred: TwitchCre...
from django.urls import path from . import views urlpatterns = [ path('', views.HomePage, name="home"), path('US/', views.US_Data, name="US"), path('EU/', views.EU_Data, name="EU"), path('average/', views.Moving_Average, name="average"), ]
# 将列表写入txt import numpy as np a = [1, 2, 3] np.savetxt('11.txt', a, fmt='%i', delimiter=',')
cube_numbers = [number**3 for number in range(1, 11)] print (cube_numbers) for number in cube_numbers : print (number)
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ # SECURITY WARNING: keep the...
"""Custom Indicator Models""" __docformat__ = "numpy" import logging from typing import Any, Tuple import pandas as pd from openbb_terminal.decorators import log_start_end from openbb_terminal.rich_config import console logger = logging.getLogger(__name__) @log_start_end(log=logger) def calculate_fib_levels( ...
""" >>> import grok.tests.directive.argumenterror_fixture Traceback (most recent call last): ... TypeError: name takes...1...argument...3...given... """
# Copyright 2016 Anselm Binninger, Thomas Maier, Ralph Schaumann # # 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...
#Private modules, still needs docstrings def f(x, y): 'Doc string'
from hanapin import Google, Bing, DuckDuckGo, Ask # define search engines __SEARCH_ENGINES = { "google": Google, "bing": Bing, "duckduckgo": DuckDuckGo, "ask": Ask } def search(website: str, query: str): try: hp = __SEARCH_ENGINES[website] except KeyError: return "Search Engin...
# 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 use ...
# Copyright (C) 2017 Beijing Didi Infinity Technology and Development 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/LI...
import numpy as np import math def sigmoid(z): return np.array([1/(np.exp(-x)+1) for x in z]) class MLPModel: # w^(l)_(j,k) = weight[l][j][k] # b^(l)_(k) = biases[l][k] # z^(l)_(j) = ∑(k)w^(l)_(j,k)*a^(l-1)_(k) + b^(l)_(j) # = ∑(k)weight[l][j][k]*record[l-1][k] + biases[j] # a^(l)_(k) = record[l][k] ...
# Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is present. # Examples: # spin...
import pytest from openapi_tester.case_checks import is_camel_case from openapi_tester.exceptions import SpecificationError camel_case_test_data = [ {'incorrect': 'snake_case', 'correct': 'snakeCase'}, {'incorrect': 'PascalCase', 'correct': 'pascalCase'}, {'incorrect': 'kebab-case', 'correct': 'kebabCase'...
""" Definition of the :class:`PipelineRunner` class. """ import json from typing import Any, Dict, List, Union from django.db.models import QuerySet from django_analyses.models.input.definitions.list_input_definition import \ ListInputDefinition from django_analyses.models.pipeline.node import Node from django_an...
# 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, software # distributed under the Li...
# 1. Math greatest common divisor (GCD) def canMeasureWater(self, jug1Capacity: int, jug2Capacity: int, targetCapacity: int) -> bool: def gcd(x: int, y: int) -> int: if x < y : x, y = y, x while x != y and y != 0 : remainder = x % y x = y...
######## # # Spark Class # # Class to package commands to send to Positive Grid Spark # # See https://github.com/paulhamsh/Spark-Parser import struct class SparkMessage: block_header = b'\x01\xfe\x00\x00\x53\xfe' # size could be anything and is replaced later size = 33 ...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rlunch.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
""" Django settings for django_hello project. Generated by 'django-admin startproject' using Django 2.2.13. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) __version__ = "1.11.1"
''' Helper functions for ``image_slicer``. ''' import os from PIL import Image def get_basename(filename): """Strip path and extension. Return basename.""" return os.path.splitext(os.path.basename(filename))[0] def open_images(directory): """Open all images in a directory. Return tuple of Image instances...
# Generated by Django 3.2.8 on 2021-10-21 08:37 from django.db import migrations import tinymce.models class Migration(migrations.Migration): dependencies = [ ('cloneapp', '0003_comment_userprofile'), ] operations = [ migrations.AlterField( model_name='post', nam...
# # Copyright (c) 2018-2020 Tuukka Norri # This code is licensed under MIT license (see LICENSE for details). # import argparse import os import sys from Bio import SeqIO parser = argparse.ArgumentParser("Compare the first sequences in two FASTA files.") parser.add_argument('--lhs', required = True, type = str) pa...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'new_name_32678.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise...
import numpy as np from torch.utils.data import Dataset, DataLoader import os import torch from tqdm import tqdm from sklearn.metrics import balanced_accuracy_score from uv_dataloader import LeafDataset as DatasetGerste import uuid import argparse import matplotlib.pyplot as plt import matplotlib as mpl from matplotli...
# # This file is part of pysnmp software. # # Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pysnmp/license.html # # Copyright (C) 2008 Truelite Srl <info@truelite.it> # Author: Filippo Giunchedi <filippo@truelite.it> # # This program is free software; you can redistribute it a...
from .field import RawField, Merge, ImageDetectionsField, ImageDetectionsFieldWithID, TextField from .dataset import COCO from torch.utils.data import DataLoader as TorchDataLoader class DataLoader(TorchDataLoader): def __init__(self, dataset, *args, **kwargs): super(DataLoader, self).__init__(dataset, *ar...
# Lint as: python2, python3 # Copyright 2019 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
import subprocess import MySQLdb import os import shutil import json import uuid from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.Alphabet import generic_protein from biokbase.workspace.client import Workspace as workspaceService from GenomeAnnotationAPI.GenomeAnnotationAPIClie...
# coding=utf8 # Copyright 2018 JDCLOUD.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 agreed ...
# A função reduce() é outra função nativa do python, ela vai aplicar uma # função em todos os valores passados em forma de lista, # e retornar apenas um valor. # reduce(funcao_aplicada, lista_de_elementos) from functools import reduce soma = reduce((lambda x, y: x + y), [1,2,3,4,5,6,7,8,9,10]) print(soma) lista = ...
# -*- coding: utf-8 from django.apps import AppConfig class DjExperimentConfig(AppConfig): name = 'dj_experiment'
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'window - Copy.ui' ## ## Created by: Qt User Interface Compiler version 6.2.3 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #############...
# # Copyright (c) 2020 Pangeanic SL. # # This file is part of NEC TM # (see https://github.com/shasha79/nectm). # # 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 owne...
# code by Razerman, thanks! import requests import json import zlib import struct import os # Helper function to strip out bytes def remove_bytes(buffer, start, end): fmt = '%ds %dx %ds' % (start, end - start, len(buffer) - end) # 3 way split return b''.join(struct.unpack(fmt, buffer)) # Helper f...
import traci import subprocess import sys import os from sumolib import checkBinary import time if __name__ == '__main__': try: sys.path.append(os.path.join(os.path.dirname( __file__), '..', '..', '..', '..', "tools")) sys.path.append(os.path.join(os.environ.get("SUMO_H...
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: yandex/cloud/mdb/sqlserver/v1/resource_preset.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflect...
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
""" Receiving data from user Types of prints Python 2.x print('Welcome %s' % name) Python 3.3 3.5 print('Welcome {}'.format(name)) Python 3.6 3.7 print(f'Welcome {name}') Cast is a conversion of data input() -> All the data it will be string Quotation Mark of strings - '' - "" - ''' ''' - """ """ """ # Data inp...
# (C) Copyright 2010-2020 Enthought, Inc., Austin, TX # All rights reserved. from unittest import mock import numpy as np import matplotlib.pyplot as plt from force_bdss.api import BaseDataSourceFactory, DataValue from eggbox_potential_sampler.eggbox_pes_data_source.data_source import ( EggboxPESDataSource) fro...
import smtplib #here mail library import getpass s = smtplib.SMTP('smtp.gmail.com',587) # start TLS for security s.starttls() sender_email = "nikhilsamninan@gmail.com" password = getpass.getpass(prompt="Type your password and press enter: ") receivers_mail ='nikhilsamninan@gmail.com' s.login(sender_email,password...
# coding=utf-8 import json import logging import os from typing import List, Tuple import torch import transformers from torch.utils.data import DataLoader, Dataset, TensorDataset from utils import InputExample, InputFeatures import re logger = logging.getLogger(__name__) class KlueReProcessor: def __init__(se...
""" html_generator.py this module perform making result of backtest into HTML format. """ import os from jinja2 import Environment, PackageLoader from abc import * class HtmlGenerator(metaclass=ABCMeta): PACKAGE_PATH = os.path.basename(os.path.dirname(os.path.realpath(__file__))) TEMPLATE_PATH = "templates...
from commands import aliases from commands import aliases_manager from commands import delete_messages from commands import delete_notify from commands import duty_signal from commands import info from commands import members_manager from commands import ping from commands import prefixes from commands import role_play...
""" @Date: 2021/09/19 @description: """ import json import os import argparse import cv2 import numpy as np import torch import matplotlib.pyplot as plt import glob from tqdm import tqdm from PIL import Image from config.defaults import merge_from_file, get_config from dataset.mp3d_dataset import MP3DDataset from dat...
# -*- coding: utf-8 -*- from __future__ import absolute_import from abc import ABCMeta from enum import Enum import six from aiida.common.exceptions import MultipleObjectsError, NotExistent from aiida.common.utils import abstractclassmethod, classproperty from aiida.orm.querybuilder import QueryBuilder __all__ = [ ...
# -*- coding:utf-8 -*- import urllib2 def send_request(): url = '' headers = { } # 构建请求对象,可以添加请求报头 request = urllib2.Request(url, headers=headers) # 1. 添加请求报头 # 两个参数, 分别是请求报头的键和值 request.add_header('Connection', 'keep-alive') # 2. 获取指定的请求报头值, 返回字符串 # 参数为请求报头的键,(只能是第一个字母的大写) ...
#!/usr/bin/env python """ 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");...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Interact with a Spack Monitor Service. Derived from https://github.com/spack/spack-monitor/blob/main/script/spackmoncli...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import pandas as pd def plot_grid_search(file_name, title): """Function to plot the results of the grid search optimisation process.""" data = pd.read_csv(file_name) # Read the data to a pandas DataFrame data_acc = data.pivot(...
from setuptools import setup, find_packages from turbogears.finddata import find_package_data import os execfile(os.path.join("videostore", "release.py")) setup( name="videostore", version=version, # uncomment the following lines if you fill them out in release.py #description=description, #autho...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf from lib.rnn_cells.base_cell import BaseCell from lib import linalg #*************************************************************** clas...
""" This module is used for generating custom SSL certificates. """ import argparse import logging import os import requests from OpenSSL import crypto from ocs_ci.framework import config from ocs_ci.ocs import constants, exceptions from ocs_ci.utility.utils import download_file, exec_cmd logger = logging.getLogge...
#!/usr/bin/env python """Patch Rekall's dependencies. This file patches some of Rekall's dependencies which are not pyinstaller friendly. Typically the problems are that these dependencies use __file__ to try to locate their dlls but this variable does not exist when running from inside a pyinstaller bundle. Needed f...
import yaml import sys import os def get_or(d, k, e): if k in d: d[k] else: e def print_args(c): if 'args' in c: print() print(f"**Arguments**") args = c['args'] print(""" |Name|Switch|Kind|Multiple|Description| |----|------|----|--------|-----------|""") ...
from django.contrib.auth import get_user_model from rest_framework import serializers from pawn_app.models import PawnPostModel from . import models class FlexPostListSerializer(serializers.ModelSerializer): class Meta: model = models.FlexPostModel fields = '__all__' post_id = serializers.In...