text stringlengths 6.04k 39.5k |
|---|
import pytest
from lib import test_lib
class TestsGeneric:
@pytest.mark.run_on(['all'])
def test_bash_history_is_empty(self, host):
users = [host.user().name, 'root']
for u in users:
file_path = f'/home/{u}/.bash_history'
bash_history_file = host.file(file_path)
... |
import numpy as np
import torch
import shutil
import matplotlib.pyplot as plt
import cv2
# os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
def unNormalizeImage(image, mean=[0.485, 0.456, 0.406], STD=[0.229, 0.224, 0.225]):
"""
Unnormalizes a numpy array given mean and STD
:param image: Image to unormalize
... |
import traceback
from math import pi
from reclaimer.enums import unit_animation_names, unit_weapon_animation_names,\
unit_weapon_type_animation_names, vehicle_animation_names,\
weapon_animation_names, device_animation_names, fp_animation_names,\
unit_damage_animation_names
from reclaimer.hek.de... |
from django.contrib.auth import (login as auth_login,
logout as auth_logout,
update_session_auth_hash
)
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm, PasswordChangeForm
from django.contrib.au... |
"""
Specification:
- Make a 6x6 board with some cute icons (36/2 = 18 icons)
- Create a button above the board that selects the theme, each features a different set of 18 icons
- When the button is clicked, pop up a dropdown list or alike that lets the user choose a theme (new game)
- Add another button that res... |
from typing import List, Dict, Iterable, Union, Tuple, Any
import os
import subprocess
import yaml
import importlib
import random
import numpy as np
from multiprocessing import Queue
import threading
from jinja2 import Environment, FileSystemLoader
from eval_engines.util.core import IDEncoder, Design
from eval_engine... |
import numpy as np
import pandas as pd
from sklearn import svm
import tensorflow as tf
class Manhattan(object):
"""
Manhattan distance to the mean template vector.
"""
def fit(self, X):
self.X = X
self.mean = X.mean(axis=0)
def score(self, X):
if X.ndim == 1:
... |
import collections
Results = collections.OrderedDict([
("00000000","instr_LUI"),
("00000001","instr_AUIPC"),
("00000010","instr_JAL"),
("00000011","instr_JALR"),
("00000100","instr_BEQ"),
("00000101","instr_BNE"),
("00000110","instr_BLT"),
("00000111","instr_BGE"),
("00001000","instr_BLTU"),
("00001001","instr_BGEU"),... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from collections import abc, defaultdict
from enum import Enum
import logging
from typing import Any, Dict, List, Optional, Union
import warni... |
import asyncio, discord, random, time, pickle, subprocess
from discord.ext import commands
# > 변수
checking = False
master_ID = [] # 개발 명령어 사용가능한 아이디
player_list = []
player_Info = {}
with open("save/player_Info", 'rb') as f:
player_list = pickle.load(f)
player_Info = pickle.load(f)
# =======================... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
"""
Web_editor-context rendering needs to add some metadata to rendered and allow to edit fields,
as well as render a few fields differently.
Also, adds methods to convert values back to Odoo models.
"""
import ast
imp... |
# based on my solution of assignment 2 and Udacity's implementation of ddpg-pendulum/ddpg_agent.py
import numpy as np
import random
import copy
import torch
import torch.nn.functional as F
import torch.optim as optim
from collections import namedtuple, deque
from model import Actor, Critic
device = torch.device("cu... |
#!/usr/bin/env python
#
# Perform Security Manager Test Cases using two BTstack instances
#
# Copyright 2018 BlueKitchen GmbH
#
import os
import subprocess
import sys
import time
import signal
import select
import fcntl
import csv
import shutil
import datetime
io_capabilities = [
'IO_CAPABILITY_DISPLAY_ONLY',
'IO_CAP... |
from abc import ABC, abstractmethod
import torch
import torch.nn.functional as F
from torch import nn, topk
from torch.nn import NLLLoss2d, MSELoss, BCEWithLogitsLoss
class LossCalculator(ABC):
@abstractmethod
def calculate_loss(self, outputs, sample):
pass
def r2_loss(output, target):
eps = 1... |
# Train with MRI Cine Data
# Date: 2nd April 2019
# Contact <NAME> at <EMAIL>
import os
import time
import numpy as np
import keras
from keras import backend as K
import pylab
import matplotlib.cm as cm
import keras.layers
import tensorflow as tf
from keras.models import Sequential, model_from_json, Model
from keras.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Retrain the YOLO model for your own dataset.
"""
import os, time, random, argparse
import numpy as np
import tensorflow.keras.backend as K
#from tensorflow.keras.utils import multi_gpu_model
from tensorflow.keras.callbacks import LearningRateScheduler, TerminateOnNaN, ... |
# Copyright 2019 <NAME>
#
# 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, so... |
from kivy.uix.button import Button
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.clock import Clock
from kivy.uix.boxlayout import BoxLayout
from kivy.app import App
from kivy.graphics import Color, Ellipse, Rectangle, Triangle, Bezier
from kivy.core.window import Window
from functools ... |
from paradoc.objects import (
PdObject, Environment, PdSeq, PdValue, PdNum, Char, Block,
pd_deepmap_n2v, pd_deepmap_r2v, pd_deepmap_rc2v,
Hoard, PdImmutableSeq, PdEmptyStackException,
)
from typing import Any, Callable, List, Optional, Tuple, Type, Union
# A "type" of an argument, possi... |
'''Game main module.
Contains the entry point used by the run_game.py script.
Feel free to put all your game code here, or in other modules in this "gamelib"
package.
'''
import pygame
import pygame.time
import pygame.display
import pygame.event
import os
import math
import moderngl
import array
import numpy
from ga... |
# Copyright (C) 2020 <NAME>
#
# SPDX-License-Identifier: MIT
import logging
from collections import defaultdict
from datetime import timedelta
from functools import partial, reduce
from os import environ
from threading import Thread
import numpy as np
from bokeh.layouts import layout, column, row
from bokeh.models im... |
import os
import sys
import gzip
import io
import traceback
import argparse
import math
import numpy as np
import scipy.stats as st
import h5py
import scrappy
from mlpy import dtw_subsequence
from matplotlib import rcParams
rcParams['pdf.fonttype'] = 42
rcParams['ps.fonttype'] = 42
# rcParams['figure.figsize'] = [12.0,... |
import pathlib
import sys
import numpy as np
import optuna
import pandas as pd
import torch
import torch.nn as nn
from pyreadr import pyreadr
from sklearn.metrics import roc_auc_score, precision_recall_curve, auc
from torch.utils.data import Subset, DataLoader
from datasets import VisitSequenceWithLabelDataset, pad, ... |
from django.contrib.auth.models import AbstractUser, Group
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from jsonfield import JSONField
from simple_history.models import HistoricalRecords
import django.db.models.options as options
from djan... |
"""This module stores classes that make a finite element analysis mesh.
"""
from matplotlib.patches import Polygon # needed for plotting elements
from . import geometry
class Element(object):
"""Makes a mesh element.
Supports 4 noded quads, 8 noded quads, 3 noded tris, 6 noded tris.
Args:
enum (... |
# coding: utf8
import numpy as np
import utils_mpc
import time
from QP_WBC import wbc_controller
import MPC_Wrapper
import pybullet as pyb
from Planner import PyPlanner
import pinocchio as pin
from solopython.utils.viewerClient import viewerClient, NonBlockingViewerFromRobot
class Result:
"""Object to store the ... |
#!/usr/bin/env python
import os
import xmltodict
import numpy as np
from copy import deepcopy
from collections import OrderedDict
from mujoco_py import const, load_model_from_path, load_model_from_xml, MjSim, MjViewer, MjRenderContextOffscreen
import safety_gym
import sys
'''
Tools that allow the Safety Gym Engine t... |
###########################################
#IMPORTING
#Imports OS
import os
#Needed for sleep
import time
#GUI
import tkinter as tk
#Import filename
from tkinter import filedialog
#Import filename
from tkinter import messagebox
#Import py file (needs __init__.py)
from Gifhandler import *
#Tabs
from tkinter impo... |
import itertools
import operator
from functools import reduce
from scipy.spatial import distance
import numpy as np
import pandas as pd
import networkx as nx
import matplotlib as mpl
import matplotlib
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import matplotlib.path as mplPath
from scipy.sparse import i... |
# -*- coding: utf-8 -*-
"""
flask_cors
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
:copyright: (c) 2014 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
import re
import logging
import collectio... |
"""
PROBLEM
Suppliers 'A' and 'B' provided the following numbers of products for the luxury hamper market:
Product 'A' 'B'
Beluga Caviar 5248 640
Christmas Cake 1312 1888
Gammon Joint 2624 3776
Vintage Port 5760 3776
Champagne Truffles 3936 5664
Although the suppliers try very hard to shi... |
import sys, os
import json
import re
import argparse
from collections import defaultdict
import random
import gzip
# Copied from Ras's repo to decouple it with other prepocessing steps.
def process_paths_for_relation(input_dir, out_dir, vocab_dir, isOnlyRelation, getOnlyRelation, MAX_POSSIBLE_LENGTH_PATH,
... |
# Copyright (c) 2020, <NAME>.
#
# 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
#
# https:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""eddytools
Usage:
eddytools schema list-schemas <db_url>
eddytools schema list-classes <db_url> [--details] [--o=OUTPUT_FILE]
eddytools schema discover <db_url> <output_dir> [--classes=CLASSES_FILE] [--max-fields=K] [--sampling=SAMPLES] [--resume]
eddytools schema stats <metadata_file>
eddytools extract <d... |
'''
<NAME>
<EMAIL>
General info:
This module is for creating/running/analazing simulations (e.g. Fluent simulations) with multiple varying parameters.
Technical info:
What could be a bit confusing is that 'selected' indexes are positive numbers ala Matlab (i.e. first element in an
array is counted as being #1 etc), w... |
from __future__ import division
import atexit
import sys
import time
import warnings
from six import StringIO
try:
import curses # pytype: disable=import-error
except ImportError:
# Allow fuzz_logger_curses to be imported on Windows -- will fail if you try to use it.
warnings.warn("Importing curses fail... |
#!/usr/bin/env python3
"""A command based todo list that displays in the terminal."""
from datetime import datetime as dt
from datetime import timedelta
import pickle
import re
import classes as cl
def decide_action(command):
"""Decide on the actions and function calls command requires."""
current_date = d... |
import logging
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.lib.p... |
'''VMSS Zones - tool to visualize multi-zone scale sets'''
import json
import os
import sys
import threading
import tkinter as tk
from time import sleep, strftime
from tkinter import messagebox
import subscription
import vmssz
# size and color defaults
btnwidth = 14
entrywidth = 15
if os.name == 'posix': # Mac OS
... |
"""
Basic k nearest neighbors classifier that supports approximate nearest neighbor querying and custom distance
metrics including shared nearest neighbors.
"""
import numpy as np
import sys
import multiprocessing
import operator
from functools import partial
import logging
from helpers.knn_index import KNNIndex
from s... |
#!/usr/bin/env python3
# file://mkpy3_plot_add_compass_rose_v5.py
# <NAME>
# SETI Institute
# =============================================================================
def mkpy3_plot_add_compass_rose_v5(
ax=None,
wcs=None,
draw=None,
cx=None,
cy=None,
north_arm_arcsec=None,
edge_col... |
#- Utility functions for working with the DESI footprint
import numpy as np
import os
from time import time
from . import focalplane
from . import io
from . import __version__ as lvmmodel_version
from lvmutil.log import get_logger
log = get_logger()
_pass2program = None
def pass2program(tilepass):
'''
Conver... |
# Warning! Running this file may replace any tables
# previously created for this app. Ensure lines 56-59
# are commented out to prevent replacement of tables
# if they already exist.
import mysql.connector
from AttackAssessmentsApp.dbFiles import config as cfg
#https://github.com/mitre/cti/blob/master/USAGE.md
fr... |
import numpy as np
import os
import csv
import sys
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from keras.callbacks import ReduceLROnPlateau, Callback
from keras.models import Model, Sequential, load_model
from keras.layers import Input, Dense, Dropout,... |
import datetime
import json
from copy import deepcopy
from rdflib import DOAP, OWL, RDF, RDFS, Graph, Literal, Namespace, URIRef, BNode
from werkzeug.urls import url_fix
from check_overlap import layer_dict, trans_opti, trans_loss
substitution_dict = {'rectified_linear_unit': 'relu',
'exponentia... |
# Copyright 2021 DeepMind Technologies Limited. 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 sys, signal, os, urllib, subprocess, json, logging, ntpath, platform, requests, shutil, threading, multiprocessing
from PyQt4 import QtGui, QtCore
from logging.handlers import RotatingFileHandler
# Setup logging
log_formatter = logging.Formatter(
'%(asctime)s - %(levelname)-10s - %(name)-10s - %(funcName)-2... |
"""Hermes MQTT server for Rhasspy ASR using Mozilla's DeepSpeech"""
import gzip
import logging
import threading
import typing
from dataclasses import dataclass, field
from pathlib import Path
from queue import Queue
import networkx as nx
import rhasspyasr_deepspeech
from rhasspyasr import Transcriber, Transcription
fr... |
#!/usr/bin/python3
import pytest
from brownie import network, Contract, Wei, chain
@pytest.fixture(scope="module")
def requireMainnetFork():
assert (network.show_active() == "mainnet-fork" or network.show_active() == "mainnet-fork-alchemy")
def loadContractFromAbi(address, alias, abi):
try:
return ... |
#! python3
r"""This script extracts the features of the dataset.
It uses the previously extacted dataset from the HDF5 file.
Author:
- <NAME>
Logs:
- 2020/11/04
- Create this script
C:\Users\vince\AppData\Local\Programs\Python\Python38\Scripts\ipython.exe -i
.\src\dataset_h5_to_feature_h5.py .\datas... |
'''
Created on Mar 11, 2017
@author: hans-werner
'''
import unittest
# Internal libraries
from assembler import Assembler
from fem import QuadFE
from fem import DofHandler
from function import Nodal
from gmrf import GMRF
from gmrf import distance
from gmrf import CovKernel
from gmrf import Covariance
from mesh i... |
"""
Support for Shelly smart home devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/shelly/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICES, CONF_DISCOVERY... |
from typing import Optional
from _custom_constants import *
import miscellaneous
import random
# defs is a package which claims to export all constants and some JavaScript objects, but in reality does
# nothing. This is useful mainly when using an editor like PyCharm, so that it 'knows' that things like Object, Cree... |
from rest_framework.decorators import parser_classes, api_view, permission_classes
from rest_framework.parsers import JSONParser
from rest_framework.response import Response
import datetime
import os.path
import json
import requests
from googleapiclient.discovery import build
from google.oauth2.credentials import Crede... |
# coding=utf-8
"""
# @Time : 10/16/19 5:34 PM
# @Author : F0rGeEk@root
# @Email : <EMAIL>
# @File : assets_handler.py
# @Software: PyCharm
***********************************************************
███████╗ ██████╗ ██████╗ ██████╗ ███████╗███████╗██╗ ██╗
██╔════╝██╔═████╗██╔══██╗██╔════╝ ██╔════╝██╔════╝██║... |
import torch
import numpy as np
import torch.utils.data as dataloader
import os
from config import Config
from models.segmentor_v1 import HybridUNet_single_out_consistency
from miscellaneous.metrics import dice, rAVD, hd, brier, nll, ece
import pandas as pd
from data.datagenerator import CTData_test
from miscellaneous.... |
# Copyright 2016, 2018 IBM Corp.
#
# 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... |
# -*- coding:utf-8 -*-
"""
This module is a library of reusable, extendable widgets.
"""
import os
from PySide2 import QtCore, QtWidgets
# #############################################################################
# # BASIC WIDGETS
# #############################################################################... |
#====================== BEGIN GPL LICENSE BLOCK ======================
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later vers... |
# -*- coding: utf-8 -*-
# Copyright 2017, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""IBMQJob module
This module is used for creating asynchronous job objects for the
IBM Q Experience.
"""
from concurrent i... |
import pytest
import logging
from multisieve_coreference.constituency_trees import ConstituencyTrees
@pytest.fixture
def example_constituency_tree(example_naf_object):
# <dep from="t_1" to="t_0" rfunc="hd/su" />
# <!--hd/obj1(herkende, zichzelf)-->
# <dep from="t_1" to="t_2" rfunc="hd/obj1" />
return... |
import toml
import re
import copy
from urllib.parse import urlparse
from Jumpscale import j
JSBASE = j.application.JSBaseClass
# Some links that needs to be skipped from verifying because the crawling is forbidden
SKIPPED_LINKS = [
"t.me",
"chat.grid.tf",
"linkedin.com",
"docs.grid.tf",
"btc-alp... |
import logging
import math
from decimal import Decimal
from typing import Any
from typing import Dict
from typing import Optional
from typing import Sequence
from typing import Tuple
from service_capacity_modeling.interface import AccessConsistency
from service_capacity_modeling.interface import AccessPattern
from ser... |
#!/usr/bin/env python
#
# report_cmd.py: implement auto process 'report' command
# Copyright (C) University of Manchester 2018-2019 <NAME>
#
#########################################################################
#######################################################################
# Imports
##############... |
"""--------------------------------------------------------------------
COPYRIGHT 2016 Stanley Innovation Inc.
Software License Agreement:
The software supplied herewith by Stanley Innovation Inc. (the "Company")
for its licensed SI Vector Platform is intended and supplied to you,
the Company's customer, for use so... |
import os
from api.annotator.m_input import TargetCEA, TargetCTA, TargetCPA
from flask import render_template, request, jsonify, flash, redirect, url_for
from api import m_f
from time import time
from api.annotator.main import annotate_api, template_encode_results, run
from collections import defaultdict
import m_conf... |
from keras.layers.core import Dense, Activation, Dropout
from keras.models import load_model
from keras.models import Sequential
from keras.utils import np_utils
import tensorflow as tf
import pandas as pd
import numpy as np
import shutil
import flask
import os
from flask_cors import CORS
import json
from threading im... |
#!/usr/bin/env python
"""Module providing tools for pdb, fep and general input file creation
Author: {0} ({1})
This program is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
from __future__ import print_function
import logging
import math
import os
from cadee.executables impor... |
from typing import NoReturn, Optional, Union
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import rpy2.robjects.packages as rpackages
from rpy2 import robjects
from communiquer.drawing import draw_chord_diagram, draw_dotplot
from communiquer.command_line import (
... |
#!/usr/bin/env python3
# Author: <NAME>
# Contact: <EMAIL>
"""Define common operations for **PETGEM**."""
# ---------------------------------------------------------------
# Load python modules
# ---------------------------------------------------------------
import time
import yaml
import sys
import os
import numpy ... |
""" Original Flappy Bird game by `sourahbhv`.
Copy of the code in the "FlapPyBird" repository on GitHub
(https://github.com/sourabhv/FlapPyBird) by `sourahbhv`. Minor alterations were
made on the code in order to improve readability.
"""
from itertools import cycle
import random
import sys
import pygame
from pygame.... |
import logging
import urllib
import urllib.request
import urllib.parse
import re
import json
import random
from pajbot.managers.db import DBManager
from pajbot.managers.handler import HandlerManager
from pajbot.models.command import Command
from pajbot.models.songrequest import SongrequestQueue
from pajbot.models.song... |
import os
from uuid import uuid4
from operator import itemgetter
from pathlib import Path
#import pycrfsuite
#from bson.binary import Binary as BsonBinary
import arrow
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelBinarizer, MultiLabelBinarizer
from sklearn.metrics import precision_rec... |
import multiprocessing as mlpcs
from multiprocessing import current_process
import yfinance as yf
import pandas as pd
from dateutil import parser
from datetime import datetime, timedelta, timezone
from time import perf_counter
from pygooglenews import GoogleNews
from vanga_me_configs import *
from vanga_me_pygooglenew... |
import datetime
from dateutil.relativedelta import relativedelta
import urllib
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse, reverse_lazy
from django.db import ... |
import aiohttp
import discord
import asyncio
import collections
import json
import logging
import os
import re
import sys
import time
import traceback
from datetime import datetime
from discord.ext import commands, tasks
from logging.handlers import RotatingFileHandler
from settings import database, constants
from ut... |
# Copyright (c) 2015, <NAME> and <NAME> All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and ... |
# coding: utf-8
import pygame
import sys
import random
import os
from functions import *
from color import *
from pygame.locals import *
from Card import Card
from Sound import Sound
from Hand import Hand
from Field import Field
from Score import Score
from Rules import adjacent
from listOfCards import allCards # The... |
# -*- coding: utf-8 -*-
"""
Copyright: <NAME> (<EMAIL>)
(2019)
IO operations for loading data
"""
import time
import csv
import numpy as np
import pandas as pd
###############################################################################
# loading data and retrieving meta info
####################... |
import scipy
import pickle
import re
import pandas as pd
import numpy as np
import json
import seaborn as sns
import metrics
from pathlib import Path
def is_singletask(cfg):
return cfg['games'][0] == cfg['games'][1]
def get_config(exp):
log_filename = str(exp['dir'] / "log.txt")
with open(log_filename, "r... |
from socket import *
from ipaddress import ip_address
import re, argparse, threading
from datetime import datetime
MAX_BYTES = 4096
serverPort = 67
clientPort = 68
class serverDHCP(object):
def server(self, _server_ip, _gateway, _subnet_mask, _range, _time, _dns ):
self.server
self.server_ip = _server_ip
sel... |
# -*- coding: utf-8 -*-
""" Unit Test On Shapes
description:
This is the unit test for shapess.
content:
- TestLine
- TestCircle
- TestOctagon
- TestRectangle
- TestOctagonLine
- TestParallelogram
author: Shin-Fu (<NAME>
latest update:
- 2019/05/13
- 2019/05/14 add Tes... |
def zhang2007_F1_pil(x):
return """
# Domains
length d1 = 10
length d2a = 6
length d2b = 6
length d2c = 12
length d3 = 4
length d4 = 16
length d5 = 6
length d6 = 16
# Species
C = d4 d5
OB = d1 d2a d2b d2c
ROX = d1 d2a
S = d1 d2a( d2b( d2c( ... |
""" network.py contains scripts that define the neural network.
"""
import numpy as np
import torch
import time
import gc
import torch.nn.functional as F
from torch.distributions import Normal, Bernoulli
from torch.optim import Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau
from torch import nn
from scipy... |
# Copyright (c) 2020 Open Collector, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... |
from multiprocessing.pool import ThreadPool as Pool
import requests
import wget
import zipfile
import platform
import os
import stat
import time
import sqlite3
import re
from urllib.parse import parse_qs
from urllib.parse import urlparse
import urllib.request
from pathlib import Path
from toollib.logger import Logger... |
# -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
# Copyright (c) 2015, Battelle Memorial Institute
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistri... |
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright (C) 2018-2020 UAVCAN Development Team <uavcan.org>
# This software is distributed under the terms of the MIT License.
#
"""Language-specific support in nunavut.
This package contains modules that provide specific support for gene... |
from typing import List, Callable, Tuple
import streamlit as st
import xarray as xr # TODO: these references should be moved to DataManager
import pandas as pd # TODO: these references should be moved to DataManager
import numpy as np
import matplotlib.pyplot as plt
from ruins.plotting import plt_map, k... |
import sys
import re
import json
import boto3
def get_ec2_instance_ids(environment, stack_instance):
tag_name = environment + "-prod-" + stack_instance
instances = get_ec2_instances_by_name(tag_name)
return [inst.id for inst in instances]
def get_ec2_instances_by_name(name):
ec2 = boto3.resource("ec2"... |
# 6/11/21
import matplotlib.pyplot as plt
import numpy as np
import math as m
#
# hitbox detection attempt 1
#
def Rxyz_helper(V):
x = V[0]
y = V[1]
z = V[2]
# theta relative to axis
ax = m.atan2(m.sqrt(y**2+z**2), x);
ay = m.atan2(m.sqrt(z**2+x**2), y);
az = m.atan2(m.sqrt(x**2+y**2), z);
return np... |
#ALGORITMO CRIADO COM O OBJETIVO DE SIMULAR UM JOGO DA VELHA PARA PRÁTICA DOS CONHECIMENTOS ADQUIRIDOS, O ÚSUARIO PODE
#JOGAR ELE COM UM AMIGO OU CONTRA O COMPUTADOR
from time import sleep
from random import choice
def cria_tabuleiro():
"""Função utilizada para montar a estrutura do tabuleiro
sem parâmetros... |
"""
The main class of the game that defines the display, game objects, methods, rules, etc.
"""
import pygame
import time
import random
from datetime import datetime, timedelta
import colors
import config as c
from game import Game
from gate import Gate
from ball import Ball
from shutter import Shutter_left, Shutter... |
import sklearn
import torch
from torch.utils.data import TensorDataset, DataLoader
import torch.nn.functional as F
from torch_geometric.utils import negative_sampling, remove_self_loops, add_self_loops
from torch_geometric.nn.inits import reset
from torch_geometric.nn import GCNConv, BatchNorm
from .utils import cluste... |
import os
import random
import numpy as np
import paddle.fluid as fluid
import paddle.fluid.dygraph as dygraph
from PIL import Image
from paddle.fluid.dygraph import Linear, Embedding, Conv2D
source_path = os.getcwd() + r'/learn/paddle_learn/recommended_system/'
class MovieLen(object):
def __init__(self, use_po... |
import sys
import logging
import warnings
import itertools
import subprocess
from tqdm.auto import tqdm, trange
import argparse
from pathlib import Path
import json
import numpy as np
import torch
import time
import pytorch_lightning as pl
# My imports
from weighted_retraining import GP_TRAIN_FILE, GP_OPT_FILE
from we... |
#!/usr/bin/env python
"""
Classes that handles reading STORM movie files. Currently this
is limited to the dax, fits, spe and tif formats.
Hazen 06/13
"""
import hashlib
import numpy
import os
import re
import tifffile
# Avoid making astropy mandatory for everybody.
try:
from astropy.io import fits
except Impor... |
import torch
import numpy as np
import matplotlib.pylab as plt
from os.path import join
from scipy.interpolate import interp1d, InterpolatedUnivariateSpline, PchipInterpolator
from scipy.optimize import newton, root_scalar, minimize_scalar
def dist_step2(BGAN, ImDist, ticks, refvec, tanvec, refimg):
"""Compute the... |
# -*- coding: utf-8 -*-
# Copyright 2021, SERTIT-ICube - France, https://sertit.unistra.fr/
# This file is part of sertit-utils project
# https://github.com/sertit/sertit-utils
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Yo... |
#!/usr/bin/python3
# Copyright (c) 2020 MIT
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.