text stringlengths 3.07k 12.6k |
|---|
import json
import functools
import random
import sys
from PyQt5.QtCore import (QByteArray, QDataStream, QFile, QFileInfo,QLineF, QLine,
QIODevice, QPoint, QPointF, QRectF, Qt)
from PyQt5.QtWidgets import (QApplication, QDialog, QFrame,
QDialogButtonBox, QFileDia... |
###Primary functions
def download_update_yomaha(savepath):
"""
Input: Folder where to save the dataset
"""
# Dependencies
import warnings
warnings.filterwarnings('ignore')
import os
import urllib
import gzip
## URLs of the Yomaha dataset and metadata
url = ['http://apdrc.soest.hawaii.edu/projects/Argo/da... |
import tensorflow as tf
import pickle
import os,sys
import glob
import random
from os import path
def get_dataset(ds):
"""
- imgnet_train / imgnet_test:
Use records in constants.IMAGENET_TFRECORDS_ROOT
- *.pkl:
Use dataset with any paths, as created by PathsDataset.make_paths_pickl... |
"""A module to process the Platform.sh environment."""
import base64
import json
import os
import shlex
from functools import partial
from itertools import chain, tee
from six.moves.urllib_parse import urlencode, urlunsplit
_json_vars = (
'PLATFORM_APPLICATION',
'PLATFORM_VARIABLES',
'PLATFORM_RELATIONSH... |
import json
import tqdm
import torch
import numpy as np
from skimage import measure
import pycocotools.mask as mask
# from pycocotools.mask import _mask
def close_contour(contour):
if not np.array_equal(contour[0], contour[-1]):
contour = np.vstack((contour, contour[0]))
return contour
def binary_m... |
import datetime as dt
from django.shortcuts import render, redirect
from django.http import HttpResponse,Http404, HttpResponseRedirect
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRe... |
#!/usr/bin/env python3
import sys
import os
import fcntl
import struct
import mmap
import hashlib
from optparse import OptionParser
force_update = False
def FirmwareUpdateException(str):
"""Report the error info and exit"""
if not force_update:
print(str)
sys.exit(1)
class FirmwareUpdate(ob... |
#!/usr/bin/env python
"""
.. py:currentmodule:: FileFormat.Results.ElectronExistResults
.. moduleauthor:: <NAME> <<EMAIL>>
Read electron exit results simulated with MCXRay.
"""
# Script information for the file.
__author__ = "<NAME> (<EMAIL>)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) ... |
# -*- coding: utf-8 -*-
# @Time : 2021/4/28 13:19
# @Author : Jiangzhesheng
# @File : subgbam.py
# @Software: PyCharm
import sys
import os
import subprocess
from typing import List, Dict, Set
from bioclass.sam import GeneralSamFile, Sam
from flye.repeat_graph.repeat_graph import RepeatGraph, RgEdge, RgNode, E... |
# Copyright 2015 <NAME>
# 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 applic... |
import copy
import logging
import torch
import torch.nn as nn
from nni.nas.pytorch.mutables import Mutable
from .ops import OPS, FactorizedReduce, ReLUConvBN, DropPath_
PRIMITIVES = [
"max_pool_3x3",
"avg_pool_3x3",
"skip_connect",
"sep_conv_3x3",
"sep_conv_5x5",
"dil_conv_3x3",
"dil_con... |
#!/usr/bin/env python
import dateutil.relativedelta
import dateutil.parser
import docopt
import json
import os.path
import sys
usage = """\
Translate a benchmark result formatted as JSON into a LUE JSON file
Usage:
{command} [--epoch=<epoch>] <benchmark_file> <lue_file>
{command} --meta <benchmark_file> <lue... |
#Copyright (C) 2021. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software;
#you can redistribute it and/or modify
#it under the terms of the MIT License.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHA... |
# Module: text_classification.py
# Purpose: train and test text_classification model
import pandas as pd
import random
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import confu... |
"""
CsvResource and CsvCollection together offer a generic data storage mechanism
optimized for append-only data storage such as headset pose changes.
Functionality at the instance and collection levels are split logically between
the two classes. For example, CsvResource contains the method for saving an
instance, an... |
import os
import imageio
import numpy as np
from PIL import Image
def fill_figures(offset, figures, dirpath, files):
for file in files:
if file == 'bishop.png':
figures[offset + 0] = imageio.imread(os.path.abspath(os.path.join(dirpath, file)))
elif file == 'king.png':
figur... |
import sys
from typing import List, Dict, Any, Tuple
import dataclasses
from .core import Parameter, ParameterWithPath, Handler, Runtime, DefaultFactory, _empty
from .utils import merge_parameter_trees, consolidate_parameter_tree
from .utils import ignore_parameters
handlers: List[Handler] = []
def register_handler... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2001-2010 <NAME>.
# See LICENSE for details.
import time
import unittest
class VectorClock(object):
"""A vector clock implementation. Each node's clock is stored as a
tuple: (clock, timestamp) in a dict with name as key. This means
that the key needs to be hashabl... |
from tqdm import tqdm
import networkx as nx
from random import randint
from Wrappers.GraphWrapper import GraphWrapper
from utils import random_retime
def parse_float(p):
return str(p).replace('.', 'd')
def generate_test():
"""
Generate test graphs as dot files.
It is composed in three phases:
1... |
import argparse
import os
import sys
import time
import json
import torch
import torch.nn.functional as F
import utils
import tabulate
import models
from data import get_data
import numpy as np
from tensorboardX import SummaryWriter
from qtorch.auto_low import lower
from qtorch.optim import OptimLP
from torch.optim.lr_... |
def concat_networks(p_in_dir_data
, p_in_dir_pred
, p_out_file
, file_suffix
, flag_matrix
, p_in_reg
, p_in_target
, flag_method
, l_p_in_net
... |
"""
Default settings for madflow
This program is to be installed alongside VegasFlow and
PDFFlow so we'll take the main configuration from there.
The environment variables for log levels and float/int types
are propagated to any other programs used by madflow
"""
import os
import logging
from distu... |
import Box2D as b2d
from ped_env.envs import PedsMoveEnv as Env
from ped_env.pathfinder import AStarController, AStarPolicy
from ped_env.utils.maps import *
from rl.utils.classes import make_parallel_env, PedsMoveInfoDataHandler
from ped_env.classes import PedsRLHandler, PedsRLHandlerWithPlanner
def HelloWorldProject... |
#!/usr/bin/env python3
# Developed by <NAME> and <NAME>
# This file is covered by the LICENSE file in the root of this project.
# Brief: This script computes the ground truth overlap between current frame and grid virtual frames.
import os
import sys
import yaml
import numpy as np
from tqdm import tqdm
import utils
... |
import os
import re
import types
from datetime import datetime, timedelta
import pytest
from finance.models import Asset
from finance.utils import (
DictReader,
date_range,
date_to_datetime,
extract_numbers,
insert_stock_record,
parse_date,
parse_datetime,
parse_decimal,
parse_int,
... |
import paho.mqtt.client as mqtt
import socket
import logging
import asyncio
import sys
import argparse
from mendeleev import MendeleevProtocol
logger = logging.getLogger(__name__)
PREFIX = "mendeleev"
NUM_ELEMENTS = 118
CLIENT_ID = "mqtt2mendeleev_bridge"
def update():
logger.info("update")
def sensor_test():
... |
"""The Conductor module orchestrates Display module generation based on changing data."""
from flask import current_app
from app.display_modules import all_display_modules, sample_display_modules
from app.samples.sample_models import Sample
from app.sample_groups.sample_group_models import SampleGroup
from app.tool_r... |
#-----------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root for license information.
#-----------------------------------------------------------------------------... |
import logging
import pickle
from pathlib import Path
from typing import List, Set
import numpy as np
import pandas as pd
from pyspark.files import SparkFiles
from scipy.sparse import coo_matrix
from sm.engine.annotation.formula_validator import (
make_compute_image_metrics,
formula_image_metrics,
)
from sm.e... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import datetime
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.mail import EmailMultiAlternatives
from django.http import HttpResponse
from django.template.loader import render_to_string
from django.utils.ht... |
import ftplib
import socketserver
import socket
from ftplib import FTP
import ftplib
import sys
from threading import Thread
import queue
import requests
import time
import sys
import os
import whois
import string
from string import punctuation
import random
import zipfile
import urllib
from urllib.re... |
import sys
import random
import requests
import json
from datetime import datetime, timedelta
from secret_keys import *
from blacklist_words import blacklist
from replacement_mapping import dict_replacement
TARGET_SUB = 'cryptocurrency'
sub = reddit1.subreddit(TARGET_SUB).hot(limit=5)
COMMENT_LIMIT = 5000
COMMENT_SORT... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 CERN.
# Copyright (C) 2019 Northwestern University.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modifya
# it under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration.
See https://pytest-invenio.readthedoc... |
#!/usr/bin/env python
"""Calculate summary statistics from data"""
import numpy as np
import simulate_data as sim
from scipy import stats
from sklearn import linear_model
#from matplotlib import pyplot as plt
__author__ = "yasc"
__date_created__ = "07 July 2016"
def sv_stats(delta, y):
"""Calculate statistics f... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil; coding: utf-8 -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license ... |
# -*- coding: utf-8 -*-
"""convert csv file into catchpy webannotation json format"""
import copy
import csv
import json
import mimetypes
import re
from datetime import datetime
from dateutil import tz
# catchpy webannotation
CATCH_CURRENT_SCHEMA_VERSION = '1.1.0'
CATCH_DEFAULT_PLATFORM_NAME = 'edX'
CATCH_JSONLD_CON... |
import os
import glob
from functools import lru_cache
from collections import defaultdict
import json
from lxml import etree as ET
from lxml.etree import Element
dir_path = os.path.dirname(os.path.realpath(__file__))
def process_mapping(schema_directory):
mappings = ET.parse(os.path.join(schema_directory, 'mapp... |
#!/usr/bin/env python3
# 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
# "L... |
import git
import ast
import astor
import os
import sys
import shutil
import argparse
from pymongo import MongoClient
parser = argparse.ArgumentParser()
parser.add_argument("-D", "--delete_clones", help="delete cloned repos after processing", action="store_true")
parser.add_argument("-L", "--language", help="specify t... |
#!/usr/bin/python
#
# <NAME> <EMAIL>
#
# unixsniff is a UNIX socket tap to print out data between the processes.
#
# USAGE: unixsniff.py [-h] [-p PID] [-c COMM]
#
# To test, open a terminal window, it will generate DBUS messages on unix sockets.
# Alternatively, run:
# socat - UNI... |
#!/usr/bin/env python3
import argparse
import sklearn
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk import pos_tag
from nltk.chunk import ne_chunk
import numpy
from classifiers import genre, polarity, event_type
def parseDataFile(filename):
"""Parse data from file"""
... |
# doodle.py
'''
This module contains the DoodleWindow class which is a window that you
can do simple drawings upon.
'''
import wx
class DoodleWindow(wx.Window):
colours = ['Black', 'Yellow', 'Red', 'Green', 'Blue', 'Purple',
'Brown', 'Aquamarine', 'Forest Green', 'Light Blue', 'Goldenrod',
'Cyan... |
import json
from django.db.utils import OperationalError
from django.db.utils import ProgrammingError
from slavdict.custom_user.models import CustomUser
from slavdict.dictionary import constants
from slavdict.dictionary.models import Entry
from slavdict.dictionary.utils import volume_label
def _json(x):
return j... |
#!/usr/bin/python3
#
# Copyright (c) <NAME>, 2020
# <EMAIL>
#
# SPDX-License-Identifier: MIT
#
import os
import re
import subprocess
DEFAULT_ARGUMENTS = ['--omit-symbol-names', '--omit-arguments']
DEFAULT_TIMEOUT = 3
def check_if_called_by(source_files_list, parent_function_name, function_name, depth=0):
""... |
#-*- coding: utf-8 -*-
# Plot vehicle data
# Tkinter Imports
import Tkinter
from Tkinter import *
from tkFileDialog import askopenfilename
import tkMessageBox
# xml Imports
import xml.etree.ElementTree as ET
# matplotlib Imports
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplot... |
from keras import backend as K
def weighted_bce(y_true, y_pred, weight):
"""Weighted binary cross-entropy for Keras.
Arguments:
----------
y_true (tensor): passed silently by Keras during model training.
y_pred (tensor): passed silently by Keras during model training.
weight (numeric): Weight... |
# Copyright (c) 2017-2018 The Elements Explorer developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import datetime
import json
import requests
import mintools
from explorer.models.faucet import Faucetsent
from explorer.e... |
import numpy as np
def rot(ang, axis='x'):
"""
given an angle of ang in degrees
rotate around an axis 'x','y',or 'z'
"""
ang = np.deg2rad(ang)
rots = {'x': np.array([[1, 0, 0],
[0, np.cos(ang), -np.sin(ang)],
[0, np.sin(ang), np.co... |
# -*- coding: utf-8 -*-
import os
import csv
import re
import urllib.request
import io
import sys
import time
import random
topnum = 1
#sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='gb18030')#改变默认输出编码
#将url转换为HTML源码
def getHtml(url):
try:
page = urllib.request.urlopen(url)
... |
from django.http import JsonResponse
from django.shortcuts import render
# Create your views here.
from rest_framework.authtoken.models import Token
from rest_framework.views import APIView
from django.contrib.auth.models import User
from src.user_profile.serializers import UserSerializer
from src.user_profile.tasks... |
"""Execute a DDS communictaion test following a json definition file."""
# Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# 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
... |
from flask import Flask, url_for, redirect, render_template, request
from wtforms import form, fields, validators
from wtforms.fields import SelectField, TextAreaField
from flask.ext import admin, login
from flask.ext.admin.contrib import sqla
from flask.ext.admin import helpers, expose
from flask.ext.admin.model.templ... |
"""
Based on https://github.com/KinglittleQ/GST-Tacotron/blob/master/GST.py
"""
import torch
import torch.nn as nn
from modules.layers import LinearNorm, ConvBlock
from utils.utils import OutputsGST
class ReferenceEncoder(torch.nn.Module):
def __init__(self, hparams):
super().__init__()
channels... |
def main(filename: str):
with open(filename, 'r') as file:
lines = file.readlines()
print("Part 1: There are {} occurences of 1, 4, 7 and 8".format(part1(lines)))
print("Part 2: The sum of all values is: {}".format(part2(lines)))
def part1(input: list[str]) -> int:
counter: int = 0
for li... |
import asyncio
import json
import time
import ccxt
import websockets
import redis
from binance import AsyncClient, DepthCacheManager, BinanceSocketManager
import os
if os.name == 'nt':
import requests
else:
import pycurl
from io import BytesIO
import certifi
async def upbit_ws_client... |
# Copyright 2022 Xanadu Quantum Technologies 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 agre... |
"""
Get AWS spot price information
"""
import datetime
import time
import boto3
import pandas as pd
import decisionengine_modules.load_config as load_config
from decisionengine.framework.modules import Source
from decisionengine.framework.modules.Source import Parameter
# default values
REGION = "us-west-2"
INSTAN... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Experiment 2: pooling bias
"""
import pdb
import csv
import sys
from collections import namedtuple
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import matplotlib.colors as pltc
plt.rc('text', usetex=True)
plt.rc('font', family='serif',... |
import random
import time
import copy
import numpy as np
# TODO Code is full of magic numbers.
# TODO Needs heavy cleanup. Priority was getting something working.
class Bandit:
def __init__(self):
self._id = str(random.random()) + str(random.random())[-10:]
self.is_terminal = False
self.... |
"""
Preference profiles and voters
Preference profiles consist of voters.
Voters in a profile are indexed by 0, ..., len(profile)-1
Candidates are indexed by 0, ..., profile.num_cand-1
The preferences of voters are specified by approval sets, which are sets of candidates.
"""
from abcvoting.misc import str_set_of... |
"""Vector container
The vector container implements these methods:
at -> access specified element with bounds checking
[] -> access specified element
front -> access the first element
back -> access the last element
empty -> checks whether the underlying array is empty
data -> direct access to the underl... |
#!/usr/bin/env python
""" Detects which objects were recognized by the operator based on a free awareness model"""
import cv2
import rospy
from cv_bridge import CvBridgeError
from sensor_msgs.msg import CompressedImage, Image
from awareness_detector.sa import (
DistanceTrackingStrategy,
GazeBuffer,
Punishm... |
##### experiment_dong_consumer_behavior_gen_data.py #######
# 5/20/2019
# This file produces the data for the "learning consumer preferences" (DCZ 2018)
# computational experiment we carried out from
# the Dong, Chen, & Zeng 2018 paper.
# Readers can find more information about this data generation process by going... |
import time
import logging
import json
import urllib2
import xqueue_util as util
import settings
import urlparse
import project_urls
import requests
import boto3
import auth
import traceback
log = logging.getLogger(__name__)
QUEUE_NAME = auth.XQUEUE_INTERFACE['queue_name']
LAMBDA_URL = project_urls.LAMBDA_URL
def... |
import pytest
from covador import list_schema, schema, dpass, soft_map, typed_map, compat
from covador.types import Int, SoftListMap
from covador.utils import wrap_in
from covador.errors import BadField
from covador.vdecorator import (ErrorHandler, ErrorContext,
ValidationDecorator, mer... |
#!/usr/bin/env python
# Copyright (C) 2017 The Android Open Source Project
#
# 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... |
# Copyright 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.
import itertools
from telemetry.web_perf.metrics import rendering_frame
# These are LatencyInfo component names indicating the various components
# that the... |
from openpyxl import load_workbook
from django import forms
from django.db.models import DateField, CharField, TextField
from dateutil.parser import parse
from collections import namedtuple
from django.core import management
import logging
logger = logging.getLogger(__name__)
class BulkImportForm(forms.Form):
sp... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(
__file__), "src"))
import glob
import numpy as np
import io_utils
from image_processing import LVImage
from models import LeftVentricle, LeftHeart
from marching_cube import marching_cube, vtk_marching_cube
import utils
print(dir(utils))
import vtk
impo... |
# Ad Soyad: <NAME> Numara: 180401011
from sympy import Symbol
def polinomaUydurma(pDerece,vakalar): # Polinomun derecesini ve verileri alarak polinoma uydurma işlemini yapar ve korelasyon katsayısını bularak en uygun polinomu seçer.
matris = []
temp = 0
for i in range(pDerece+1):
satir = []
... |
#%% Initialization
import numpy as np
import cv2
import os
import pickle
from my_util import print_section_header
import p05_01_correct_distortion as dist_correct
import p05_02_create_binary_lane as bin_lane
import p05_03_perspective_transform as p_trans
import p05_04_identify_lane_line as id_ll
import p05_05_curvatur... |
import adafruit_fancyled.adafruit_fancyled as fancy
import board
import neopixel
from digitalio import DigitalInOut, Direction, Pull
led_pin = board.D1 # which pin your pixels are connected to
num_leds = 78 # how many LEDs you have
brightness = 1.0 # 0-1, higher number is brighter
saturation = 255 # 0-255, 0 is pu... |
import math
import os
from utilities import chunks, load_template
NO_IMAGE_DATA = \
"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%22500%22%20height%3D%22500%22%20xmlns%3D%22http%3A" \
"%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20500%20500%22%20preserveAspectRatio%3D%22none%" \
"22%3E%3Cde... |
"""This module contains the main functions used to load the required data from disk for training."""
import functools
import gzip
import pickle
import os
import numpy as np
import torch
from sketchgraphs_models import distributed_utils
from sketchgraphs_models.nn import data_util
from sketchgraphs_models.graph impor... |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from datetime import datetime
from uuid import uuid4
import scout_apm.core.backtrace
from scout_apm.core.n_plus_one_call_set import NPlusOneCallSet
from scout_apm.core.request_manager import RequestManager
from scout_apm... |
#!/usr/bin/env python3
# Note:
# - Hardlinks are copied
# - The size of symlinks and directories is meaningless, it depends on whatever
# the filesystem/tar file reports
import argparse
import json
import os
import stat
import sys
import itertools
import logging
import hashlib
import tarfile
VERSION = 3
IDX_NAME ... |
from APIWrapper import FogDirector
import time, random, math, os
from infrastructure import ciscorouters_30pz_5b5m20s as infrastructure
import requests
import simplejson, signal, array
from collections import defaultdict
port = os.environ.get('SERVER_PORT', "5000")
infrastructure.create()
def bestFit(cpu, mem):
... |
import json
import os
import requests
import tempfile
import platform
import re
import sys
import progressbar
import shutil
import subprocess
import shlex
import yaml
import rfc3987
from distutils.version import LooseVersion
from .utils import *
from .uninstall import uninstall_package
from contextlib import closing
im... |
import copy
import numpy as np
import numpy.linalg as npl
from . import ysJacobian as yjc
from ..Util import ysPythonEx as ype
from . import ysReferencePoints as yrp
from . import ysMomentum as ymt
from . import ysControl as yct
from ..Math import mmMath as mm
from ..Simulator import csVpModel as cvm
from ..Simulator ... |
'''
Function:
打地鼠(Whac-A-Mole)小游戏
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import os
import pygame
import random
from ...utils import QuitGame
from ..base import PygameBaseGame
from .modules import Mole, Hammer, endInterface, startInterface
'''配置类'''
class Config():
# 根目录
rootdir = os.path.split(os.... |
import datetime
import psutil
import humanize
import time
import os
class C:
c = '\033[0m'
White = '\033[1m'
Italics = '\033[3m'
Underline = '\033[4m'
BlinkItalics = '\033[5m'
BlinkInverted = '\033[7m'
Strike = '\033[28m'
Invisible = '\033[30m'
RedDark = '\033[31m'
GreenDark = ... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2015, <NAME>"
__credits__ = ["<NAME>"]
__license__ = "Apache License 2.0"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Examination program"
def ExibeEstatisticas():
print("##################################")
print(" ... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import pytest
import tempfile
import pkg_resources
import numpy as np
import os
from astropy import units as u
import sunpy.map
#from ..classes import *
from solarbextrapolation.map3dclasses import Map3D#, Map3DCube
from solarbextrapola... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 12 13:26:32 2017
@author: sitibanc
"""
import math
import numpy as np
from sklearn import datasets
def entropy(p1, n1): # postive, negative
if p1 == 0 and n1 == 0:
return 1
value = 0
pp = p1 / (p1 + n1)
pn = n1 / (p1 ... |
import re
import os
shader_include_root = '/Users/yushroom/program/FishEngine/Engine/Shaders/include'
def Print(*args, **kw):
# print(args, kw)
pass
# https://gist.github.com/ChunMinChang/88bfa5842396c1fbbc5b
def removeComments(text):
""" remove c-style comments.
text: blob of text with comments ... |
import random
import os
from os.path import join
import numpy as np
import json
import common
import load_img
import model
import para
import callback
from argparse import ArgumentParser
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
from keras.applications.densenet import pr... |
# File: lp_tree.py
# Author: <NAME>
# Created On: 29 Jan 2019
# Purpose:
# Specifies a class for handling LP-tree Models.
import sys, os
sys.path.insert(0, os.path.abspath('..'))
from examples.relation import Relation
from utility.conditional_preferences import CPT
from random import shuffle, sample, random, randin... |
import pickle
import zipfile
import tempfile
import glob
from pathlib import Path
import numpy as np
import shutil
import os
import json
import collections
from ast import literal_eval
import collections.abc
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
def recursive_dict_update(d, u):
... |
from helpers.helpers import AverageMeter, ProgressMeter, iouCalc, visim, vislbl
import torch
import torch.nn.functional as F
import os
import numpy as np
import time
from PIL import Image
import cv2
"""
=================
Routine functions
=================
"""
def train_epoch(dataloader, model, criterion, optimizer, l... |
import b2d
import numpy
import random
import time
from pydantic import BaseModel
class DebugDrawCallback(object):
def __init__(self, pre_debug_draw, post_debug_draw):
self._pre_debug_draw = pre_debug_draw
self._post_debug_draw = post_debug_draw
def pre_debug_draw(self):
self._pre_debu... |
import tarfile
from typing import List, Tuple, Dict
import numpy as np
from deep500.utils.download import real_download, unzip
from deep500.lv2.dataset import NumpyDataset
from deep500.utils.onnx_interop.losses import SoftmaxCrossEntropy
def download_cifar10_and_get_file_paths(folder=''):
"""
Download cifar1... |
import argparse
import numpy as np
import pandas as pd
from tqdm import tqdm
from explanation_generation import (contextualize_candidate_sentences,
get_contextualizer, get_preference)
from sentence_pair_model import TfIdfSentencePair
from util import convert_str_to_list, substitute... |
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
from .models import *
#<NAME> 0273/19
#<NAME> 0281/19
"""Klasa UslugeSerializer se koristi za serijalizaciju klase Usluge"""
class UslugeSerializer(serializers.ModelSerializer):
class Meta:
model = Usluge
... |
import json
import datetime
import base64
import plistlib
import os
import scripts.artifacts.artGlobals #use to get iOS version -> iOSversion = scripts.artifacts.artGlobals.versionf
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, kmlgen, is_platform_windows
def time... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import inspect
import argparse
import baseline
from utils import (write_meta, set_random_seed, mkdir_if_no_exists,
BasicDataset, Timer)
funcs = inspect.getmembers(baseline, inspect.isfunction)
method_names = [n for n, _ in funcs]
def parse_... |
# Copyright 2021 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... |
"""Integration tests."""
from __future__ import annotations
import os
import uuid
import pytest
from flask import url_for
from labster.di import injector
from labster.domain2.model.structure import Structure, StructureRepository
from labster.domain2.model.type_structure import UN
from labster.domain.models.profiles ... |
import numpy as np
import torch
import torch.nn as nn
from sklearn import linear_model
from .base_models import BaseEstModel
# TODO: consider treatments other than binary treatment.
class PropensityScore:
"""
The class wrapping a machine learning model to be able to predict the
propensity score
... |
'''/*******************************************************
* Copyright (C) 2019-2020 JSOF LTD <EMAIL>>
*
*
* this poc can not be copied and/or distributed and/or modified without the express
* permission of <NAME>, JSOF
* Unauthorized copying of this file, via any medium is strictly prohibited
*
* P... |
import argparse
import re
import string
import random
import io
parser = argparse.ArgumentParser(description='AV Bypass PowerShell Obfuscation')
parser.add_argument('-i','--IP', help='Enter IP for Remote Host', required=True)
parser.add_argument('-p','--Port', help='Enter Port for Remote Host', required=True)
parser.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.