text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/env python3
# 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.
import argparse
import os
import random
import sys
import time
from math import pi
import numpy as np
import orbslam2
i... |
"""Adapted from:
@longcw faster_rcnn_pytorch: https://github.com/longcw/faster_rcnn_pytorch
@rbgirshick py-faster-rcnn https://github.com/rbgirshick/py-faster-rcnn
Licensed under The MIT License [see LICENSE for details]
"""
from __future__ import print_function
import torch
import torch.nn as nn
import to... |
# -*- coding:utf-8 -*-
"""
mincheng:<EMAIL>
"""
from __future__ import division
import sys
import printlog
import datetime
import os
import time
import sklearn
from sklearn.metrics import confusion_matrix
from baselines import sclearn
import evaluation
from collections import defaultdict
import tensorflow as tf
import ... |
"""
@file Pre_Build.py
@author IR
@brief This script preprocesses source files for use with Log_t
@version 0.1
@date 2020-11-11
@copyright Copyright (c) 2020
This script works by first duplicating source files to the build folder. \n
Then it scans each file for calls to a Log function and modifies them as follows. \n... |
# Copyright (C) Microsoft Corporation. All rights reserved.
# 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 version.
import vie... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# <NAME>, <EMAIL>
'''
Summary
-------
Exports and converts *waf* project data, for C/C++ programs, static- and shared
libraries, into **Microsoft Visual Studio**, also known as **msdev**,
project files (.vcproj) and solution (.sln) files.
**Microsoft Visual ... |
#!/usr/bin/env python3
import argparse
import gzip
import hashlib
import os
import re
import subprocess
import sys
print("Running pre-commit security hook....")
# Limits for rules
file_add_limit = 20
file_change_limit = 50
# The following patterns are regular expressions and are matched
# case-insensitive. They... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Eviloid, 22.08.2019
import os, sys
import urllib, urllib2, urlparse, cookielib
import re, json
import xbmc, xbmcgui, xbmcplugin, xbmcaddon
import CommonFunctions
import sqlite3 as sql
PLUGIN_NAME = 'FanSerials'
common = CommonFunctions
common.plugin = PLUGIN_NAME
try:ha... |
import logging
import toml as hjson
import mistune
import urllib.parse
import base64
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.template import loader
from django.urls import reverse
from django.utils import timezone
from django.conf imp... |
from pymongo import MongoClient
from bs4 import BeautifulSoup, element
from datetime import datetime, timedelta
from dateutil import parser as dateparser
from random import random
import base64
import calendar
import copy
import json
import requests
import time
import sys
class WSK:
def __init__(self, environment=''... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger
import operator as op
import re
from .._vendor.toolz import excepts
from ..common.compat import string_type... |
import json
from copy import deepcopy
from fate_manager.utils.base_utils import current_timestamp
from fate_manager.controller import version_controller
from fate_manager.controller.apply import apply_result_task, allow_apply_task
from fate_manager.db.db_models import AccountInfo, FederatedInfo, FateSiteInfo, DeploySi... |
import os
import os.path
import datetime
import tempfile
import io
from PIL import Image
import base64
import threading
import torchvision.transforms.functional as F
from torchvision import datasets, models, transforms
import torch
import torch.nn as nn
import time
import numpy as np
import skimage.io
from skimage imp... |
# ---
# jupyter:
# hide_input: false
# jupytext:
# cell_metadata_filter: all
# metadata_filter:
# cells:
# additional: all
# notebook:
# additional: all
# notebook_metadata_filter: all
# text_representation:
# extension: .py
# format_name: percent
# form... |
import os
import sys
import pickle
import copy
import numpy as np
import json
from skimage import io
from pathlib import Path
import torch
import spconv
from pcdet.utils import box_utils, common_utils
from pcdet.ops.roiaware_pool3d import roiaware_pool3d_utils
from pcdet.config import cfg
from pcdet.datasets.data_augm... |
import torch
import torch._prims as prims
import torch._prims.utils as utils
from torch._prims.utils import (
DimsType,
TensorLike,
TensorLikeType,
DimsSequenceType,
TensorSequenceType,
Number,
NumberType,
ELEMENTWISE_TYPE_PROMOTION_KIND,
elementwise_dtypes,
)
from torch._prims.wrap... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
<NAME>, <NAME>
Cisco Systems, Inc.
Copyright (c) 2015-2015 Cisco Systems, 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.apach... |
# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... |
"""Asynchronous Advantage Actor-Critic (A3C) algorithm for reinforcement learning."""
from deepchem.models import TensorGraph
from deepchem.models.tensorgraph.optimizers import Adam
from deepchem.models.tensorgraph.layers import Feature, Weights, Label, Layer
import numpy as np
import tensorflow as tf
import collectio... |
# -*- coding: ISO-8859-1 -*-
#===============================================================================
# VLC Player Plugin by <NAME> 2007
# modified by <NAME> 2008
#
# This is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as publishe... |
from bitarray import bitarray
from random import *
from time import sleep
from threading import Thread
from subprocess import call
import sys, os, re, datetime
from cqc.pythonLib import *
##############################
#
# QGMNode class derived from CQCConnection, with reg* attributes
#
class GMNode():
def __ini... |
import json
import logging
import secrets
from typing import List, Optional, Tuple
import arrow
from chupacabra_client.protos import game_structs_pb2
import numpy as np
from dbs.redis_cache import RedisCacheHandler
from game_server.game_servicer import GameImplementation
from protos import game_server_pb2
from tic_ta... |
#!/usr/bin/env python3
"""
A TTF font-viewer for creating bitmaps.
Usage: font-viewer.py [OPTIONS]
Options:
-f, --font-name NAME Font to use [default: Deferral-Regular]
-o, --output PATH Save path [default: <repo>/bitmaps]
-p, --point-size SIZE Initial font-point to use [default: 6]
--help ... |
import os
import argparse
from copy import deepcopy
DATA_DIR = '../data'
parser = argparse.ArgumentParser()
parser.add_argument("--seed", type=int, default=0)
parser.add_argument("--epochs", nargs='+', type=int, default=[10, 10, 10, 10, 10],
help='Epoch number for each task')
parser.add_argument("... |
# Copyright: 2019, NLnet Labs and the Internet.nl contributors
# SPDX-License-Identifier: Apache-2.0
import inspect
import random
import re
import json
from collections import defaultdict
from functools import wraps
from celery.five import monotonic
from contextlib import contextmanager
from django.conf import setting... |
import argparse
import time
from datetime import datetime
import numpy as np
import tensorflow as tf
from cleverhans.model import CallableModelWrapper
import attacks as ae
import data
import models
import regularizers
import utils
nn_dict = {'fc': models.MLP,
'cnn_lenet_small': models.LeNetSmall
... |
from __future__ import absolute_import
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'vilbert_multitask.settings')
import django
django.setup()
from django.conf import settings
from demo.utils import log_to_terminal
from demo.models import QuestionAnswer, Tasks
import demo.constants as constants
import p... |
import numpy as np
import matplotlib as plt
import argparse
import os
import json
from collections import OrderedDict
import helpers
#
# Utilities
#
def find_ocurrence(s, pattern, oc):
pos = -1
for i in range(0, oc):
pos = s.find(pattern, pos + 1)
return pos
def name_machine(machine_folder):
... |
"""
Linear dynamical system model for the AP text dataset.
Each document is modeled as a draw from an LDS with
categorical observations.
"""
import os
import gzip
import time
import pickle
import collections
import numpy as np
from scipy.misc import logsumexp
from sklearn.feature_extraction.text import CountVectorizer... |
from multitrader.indicators import Indicators
from multitrader.order import Order, Trade
import pandas as pd
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.dates as mdates
from datetime import datetime
class Commission():
"""
Commission calculator
... |
import os
import sys
import struct
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from build.codeoptimize import optimizeText
import fileutil
from util import ParseXMLWithIncludes, ScenesPath, SC... |
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.distributions.utils import log_sum_exp
from torch import optim
from torch.autograd import Variable
import util
import coref_ops
import conll
import metrics
import scipy.misc as sp
class CorefModel(nn.Module):
def _... |
import io
import random
import unittest
import music21
import pandas as pd
import AugmentedNet.score_parser
octaveTest = """
**kern **kern
*part1 *part1
*staff2 *staff1
*I"Piano *
*I'Pno. *
*clefF4 *clefG2
*k[] *k[]
*M4/4 *M4/4
=1 =1
16CCCCLL 16BBBB 4r
16CCC 16BBB .
16CC 16BB .
16CJJ 16B .
16CCLL 16BB 16r
16C 16B 16... |
#!/usr/bin/env python3
import sys
import os
import argparse
import logging
import datetime
import dateutil
import time
import tempfile
import subprocess
import atexit
import shutil
import json
import socket
# TODO: add the following to the install/config README:
#
# Setup aws configuration
# Create ~/.aws/credentials... |
from __future__ import annotations
# Enable using `Upath` in type annotations in the code
# that defines this class.
# https://stackoverflow.com/a/49872353
# Will no longer be needed in Python 3.10.
import abc
import concurrent.futures
import contextlib
import datetime
import logging
import os
import os.path
import pa... |
"""
Events, for Survol, are RDF triples inserted in a graph database by Python daemons, executing scripts
in the background. These scripts are the usual CGI scripts, executed in a daemon controlled by
the Python module "supervisor" (supervisor-win" on Windows).
Conclusion: Plain CGI scripts which are norammly called by... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# 适用于 tensorflow >= 2.0, keras 被直接集成到 tensorflow 的内部
# ref: https://keras.io/about/
from tensorflow.keras.layers import Layer, Input, LSTM, TimeDistributed, Bidirectional, Dense, Lambda, Embedding, Dropout, \
Concatenate, RepeatVector
from tensorflow.keras.optimizers im... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
#
# 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
#
# Unle... |
#! /usr/bin/env python3
'''
This file contains functions to DNS server to complete its tasks.
'''
import datetime
import os
import json
import glob
import random
import logging
import logging.config
import traceback
from stem.util import term
from enum import Enum
from Helper.Helper import Helper
from Helper.He... |
#!/usr/bin/python
import copy
import inspect
import sys
import subprocess
import unittest
import asyncio
all_machines = {'daint', 'tsa'}
# For each spack test there should be at least one line of comment stating
# why this spack command is tested and/or where this spack command is used.
# Otherwise this may apply:
#... |
# %%
import csv
import numpy as np
import time
import re
import gurobipy as gp
from gurobipy import GRB
from numpy.random import default_rng
# %%
class CPP:
def __init__(self, coreFile):
self.numTerminal = 20
self.numCustomers = 50
self.numResources = 10
self.numScen = 0
se... |
# ! /usr/bin/python
# -*- coding: utf-8 -*-
# Description: Functions used in determination of sphericity and roundness
# import modulues
import numpy as np
# import module for image manipulation
import cv2
# import plotting module
import matplotlib.pyplot as plt
# from scipy.ndimage.filters import gaussian_filter1... |
import numpy as np
import numpy.linalg as la
import torch
import torch.nn.functional as F
import torchvision
import json
import time
from matplotlib import pyplot as plt
#from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm, trange
from lietorch import SE3, LieGroupParameter
from scipy.spatial.transf... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import gym
import babyai # This registers the 19 MiniGrid levels.
import numpy as np
from utils.spec_reader import spec
BABYAI_ENV_LEVEL = spec.val("BABYAI_ENV_LEVEL")
USE_SUCCESS_RATE = spec.val("USE_SUCCESS_RATE") # Used by post-processing fi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2021, <NAME> <<EMAIL>>
#
# 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 ... |
from PyQt5.QtCore import QObject, pyqtSignal
from Models.Transition import Transition
from Models.Etat import Etat
from Models.Alphabet import Alphabet
from graphviz import Digraph
import datetime
class Type:
AFD = 'Automate Fini Deterministe'
AFN = 'Automate Fini Non Deterministe'
eAFN = f'Epsilon {AFN}... |
# Copyright (c) Microsoft Corporation. All rights reserved.
import numpy as np
import pandas as pd
import copy
"""
This file contains miscellaneous helper classes and functions for the data-assertion routines
"""
# ---------------------------------------------------------------
# Class _AssertionType... |
#!/usr/bin/env python3
#
# yosys -- Yosys Open SYnthesis Suite
#
# Copyright (C) 2012 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or 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... |
#-*-coding:utf-8-*-
import math
import os
import random
import sys
sys.path.remove('/opt/ros/kinetic/lib/python2.7/dist-packages')
import numpy as np
import cv2
import matplotlib.pyplot as plt
from matplotlib import patches
from matplotlib.patches import Polygon
from skimage.measure import find_contours
from mrcnn.con... |
# ##### 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 version.
#
# This program is distrib... |
# uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: inspect
__author__ = '<NAME> <<EMAIL>>'
__date__ = '1 Jan 2001'
import sys, os, types, string, re, dis, imp, tokenize, linecache
from op... |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import matplotlib as plt
import torch.optim
from src.models.skip import skip
from src.utils.inpainting_utils import *
from src.utils.utils import *
class DIP_net(object):
def __init... |
from pathlib import Path
import time
from hysynth.utils.hybrid_system import HybridSystemAffineDynamics, map_initial_condition
from hysynth.utils.dynamics import *
from hysynth.utils import Logger, Statistics, load_from_file, save_to_file
from hysynth.pwld import ha_adaptation_from_pwld_functions, ha_synthesis_from_pw... |
# -*- coding:utf-8 -*-
import json
import os
import numpy as np
import random
import config
import jieba
import re
class file_data_loader:
def __next__(self):
raise NotImplementedError
def next(self):
return self.__next__()
def next_batch(self, batch_size):
raise NotImplementedE... |
# -*- coding: utf-8 -*-
import datetime
import uuid
from collections import abc
from typing import MutableSequence, Any, Optional, Sequence
import typing
import numpy as np
from ..base import Property
from .array import StateVector, CovarianceMatrix, PrecisionMatrix, StateVectors
from .base import Type
from .particle... |
#A file to store functions for making elaborations based on a specific profile
#Import Libaries
#########Standard Libraries##########
import numpy as np
import pandas as pd
#########RDKit Modules############
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem import rdMMPA
from rdkit.Chem import All... |
# Based on testing harness dated 2017-06-02.
# STUDENTS: TO USE:
#
# The following command will test all test cases on your file:
#
# python3 <thisfile.py> <your_one_file.py>
#
#
# You can also limit the tester to only the functions you want tested.
# Just add as many functions as you want tested on to the comma... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 <NAME> (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import absolute_import, division, print_function
from past.builtins import unicode
... |
#!/usr/bin/env python
#
# test_ovf.py - Unit test cases for COT OVF/OVA handling
#
# September 2013, <NAME>
# Copyright (c) 2013-2017 the COT project developers.
# See the COPYRIGHT.txt file at the top-level directory of this distribution
# and at https://github.com/glennmatthews/cot/blob/master/COPYRIGHT.txt.
#
# This... |
# coding: utf-8
from __future__ import absolute_import, print_function
""" Interface with Spectrum Investigation """
__author__ = "<NAME> <<EMAIL>>"
import logging
import multiprocessing as mp
import numpy as np
import os
import re
import shutil
import scipy.optimize as op
from random import choice
from signal impo... |
"""
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... |
#Copyright ReportLab Europe Ltd. 2000-2004
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/demos/gadflypaper/gfe.py
__version__=''' $Id: reporting.py,v 1.5 2007/08/15 17:54:08 schalch Exp $ '''
__doc__=''
#REPORTLAB_TEST_SCRIPT
import... |
from deckparser.importers.dessem.util.pmo import real_date
from deckparser.importers.dessem.out.result_loader import ResultLoader
from deckparser.importers.dessem.loader import Loader
from difflib import SequenceMatcher
from collections import defaultdict
from datetime import date
import logging
import zipfile
import o... |
import argparse
import inspect
import subprocess
import re
import tempfile
from typing import Any, List, Optional, Sequence, Tuple
from dataclasses import dataclass
from pathlib import Path
from textwrap import dedent, indent
import inflection
import _zivid
def _to_snake_case(name: str) -> str:
# Workaround due ... |
# -*- coding: utf-8 -*-
"""
common_model.py: This model has functions to handle database transaction for
functionalities that is common across user, faculty, organization admin and
administrator roles.
"""
###################################################################################
# Added to enable code compl... |
#!/usr/bin/env python
"""Read, write, and convert AnimData.D2 to JSON & tabbed TXT (and vice versa)."""
__version__ = "0.2.1"
# MIT License
# Copyright (c) 2020 pastelmind
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softw... |
"""
Author: <NAME>
BSD 3-Clause License
Copyright (c) 2019, The Regents of the University of Minnesota
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the... |
"""igvm - Command Routines
Copyright (c) 2021 InnoGames GmbH
"""
import logging
import math
from collections import OrderedDict
from contextlib import contextmanager, ExitStack
from ipaddress import ip_address
from os import environ
from time import sleep
from typing import List, Optional
from adminapi.dataset impor... |
import collections
import math
import numpy as np
#cython: linetrace=True
#cython: language_level=3
#from vec4 import *
#from vec3 import *
from memblock import *
from rotations import *
from canvas import *
#from shape import material, Shape, Sphere, sphere, glass_sphere, set_transform, intersect, normal_at, re... |
# from __future__ import print_function
import pretty_midi
import pypianoroll
import numpy as np
import pandas as pd
import scipy.stats
from collections import Counter
from functools import reduce
import os
def remove_empty_track(midi_file):
'''
1. read pretty midi data
2. remove empty track,
also re... |
"""
Utility functions to support entity data testing
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "<NAME> (<EMAIL>)"
__copyright__ = "Copyright 2014, <NAME>"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
import logging... |
import re
from datetime import datetime
import calendar
from django.contrib import admin
from django.urls import reverse, resolve, NoReverseMatch
from django.contrib.admin import AdminSite
from django.utils.text import capfirst
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
fr... |
from os.path import join
import sys
sys.path += ['../']
sys.path += ['../../']
import argparse
import glob
import json
import logging
import os
import random
import numpy as np
import torch
sys.path.append(os.getcwd())
sys.path.append(os.path.abspath(os.path.dirname(os.getcwd())))
#
from torch.utils.data import Da... |
#!/usr/bin/env python3
import sys
import csv
import time
import argparse
import re
import heapq
import itertools as it
import logging
from multiprocessing import Pool
from Bio import SeqIO
from igraph import *
from collections import defaultdict
from bidirectionalmap.bidirectionalmap import BidirectionalMap
from tqdm... |
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for generic stages."""
from __future__ import print_function
import contextlib
import copy
import os
import sys... |
################################################################################
#
# MIT License
#
# Copyright (c) 2020-2021 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to dea... |
from behaviors import *
from peristimulus import *
def test_FP_preprocessing():
show = True
folder_load = "/Users/albertqu/Documents/7.Research/Wilbrecht_Lab/CADA_data/ProbSwitch_Raw"
folder_save = "/Users/albertqu/Documents/7.Research/Wilbrecht_Lab/CADA_data/ProbSwitch_FP_data"
animal, session = 'A2A... |
import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import cv2
import glob
import argparse
import pickle
from PIL import Image
import os
DEFAULT_COLOR_THRESHOLD = (190, 255)
DEFAULT_ABS_THRESHOLD = (0, 255)
DEFAULT_MAG_THRESHOLD = (0, 255)
DEFAULT_DIR_THRESHOLD = (0, np.pi/6)
DEFAULT_C... |
# -*- coding: utf-8 -*-
"""
Segments and curves intersections in n-dimensional Euclidean space
The module provides routines and methods for determining segments and curves intersections
in n-dimensional Euclidean space.
Currently, two methods are implemented out of the box:
- ``exact`` -- exact interesections by... |
#!/usr/bin/env python
# coding: utf-8
# In[59]:
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
sns.set_style('ticks')
# In[60]:
df = pd.read_csv("../../../input/mirichoi0218_insurance/insurance.csv")
# # EDA Section... |
#! /usr/bin/env python
# encoding: utf-8
from waflib import TaskGen, Context, Build
import os
import sys
from minixml import XmlNode, XmlDocument
oe_cdt = 'org.eclipse.cdt'
cdt_mk = oe_cdt + '.make.core'
cdt_core = oe_cdt + '.core'
cdt_bld = oe_cdt + '.build.core'
def unique(seq):
seen = set()
seen_add = se... |
### Algorithm of choice of crypto using DQN Reinforcement Learning Algo
### Model can be continuously improved by generating augmented database
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # To use only CPU (for debugging)
print('Use of CPU')
import pandas as pd
import numpy as np
import json
from matplotlib im... |
import numpy as np
import cv2
# BGR values for different colors
col_bgr = {
'snow': (250, 250, 255),
'snow_2': (233, 233, 238),
'snow_3': (201, 201, 205),
'snow_4': (137, 137, 139),
'ghost_white': (255, 248, 248),
'white_smoke': (245, 245, 245),
'gainsboro': (220, 220, 220),
'floral_whi... |
from matplotlib.pyplot import hist, plot, text
import torch
import os
import numpy as np
from torch.utils.tensorboard.writer import SummaryWriter
from ..utils import U
from typing import Dict, Tuple, List, Optional, Callable, Union
import threading
import atexit
from torch.multiprocessing import Process, Queue, Event
f... |
"""
physical_models_vec.py
A module for material strength behavior to be imported into python scripts for
optimizaton or training emulators. Adapted from strength_models_add_ptw.py
Authors:
<NAME>, <EMAIL>
<NAME>, <EMAIL>
<NAME>, <EMAIL>
"""
import numpy as np
np.seterr(all =... |
"""RPC functions implemented from vizier_service.proto."""
import collections
import datetime
import random
import threading
from typing import Optional
from absl import logging
import grpc
import numpy as np
from vizier import pythia
from vizier import pyvizier as base_pyvizier
from vizier._src.algorithms.designers ... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2021 <NAME> <<EMAIL>>
#
# Distributed under terms of the MIT license.
import os
import os.path as osp
import datetime
import time
import json
from collections import Counter
from itertools import groupby
import numpy as np
from sklearn.me... |
import os
import sys
import threading
from fanstatic import compat
import fanstatic.checksum
import fanstatic.registry
DEFAULT_SIGNATURE = 'fanstatic'
VERSION_PREFIX = ':version:'
BUNDLE_PREFIX = ':bundle:'
NEEDED = 'fanstatic.needed'
DEBUG = 'debug'
MINIFIED = 'minified'
_resource_file_existence_checking = True... |
"""Clinical file format validation and processing"""
import datetime
from io import StringIO
import logging
import os
import pandas as pd
import synapseclient
from genie.example_filetype_format import FileTypeFormat
from genie import process_functions
from genie.database_to_staging import redact_phi
logger = logging... |
"""Models related to the Tibia.com character page."""
import datetime
import re
import urllib.parse
from collections import OrderedDict
from typing import List, Optional, TYPE_CHECKING
from tibiapy import abc
from tibiapy.enums import AccountStatus, Sex, Vocation
from tibiapy.errors import InvalidContent
from tibiapy.... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 30 15:37:03 2016
@author: hoseung
MODIFICATIONS
2015.12.03
final_gal is removed as non-main-progenitors are also analized,
there is no 1:1 correlation between final galaxies and earlier galaxies.
2015.12.21
Galaxies are saved... |
#!/usr/bin/python
# Copyright: (c) 2019, DellEMC
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
-... |
# Copyright 2012 Managed I.T.
#
# Author: <NAME> <<EMAIL>>
#
# 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 applicabl... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Modelo SEIR | Evolução do R | COVID-19 no Brasil
--------------------------------------------
Ideias e modelagens desenvolvidas pela trinca:
. <NAME>
. <NAME>
. <NAME>
Sobre o modelo SEIR
https://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology#The_SEIR_model
"... |
from evdev import InputDevice, categorize, ecodes
from subprocess import call
import RPi.GPIO as GPIO
from picamera import PiCamera
from picamera import Color
import time
import sys
import datetime
import cv2
import numpy as np
import subprocess
from subprocess import DEVNULL, STDOUT, check_call
import _thread
import o... |
# -*- coding: utf-8 -*-
import struct
import copy
from tkinter import *
from tkinter import filedialog as fd
from tkinter import ttk
from tkinter import messagebox as mb
from tkinter import simpledialog as sd
train = []
indexList = []
trainName = []
varList = []
btnList = []
byteArr = []
file_path = ""
CSTrainName =... |
import os
import torch
from torch import nn
from torch.autograd import Variable
from torchvision.utils import save_image
import numpy as np
from tqdm import tqdm_notebook as tqdm
from functionalities import evaluater as ev
from functionalities import filemanager as fm
from functionalities import tracker as tk
from func... |
#!/usr/bin/env python
# Edit this script to add your team's training code.
# Some functions are *required*, but you can edit most parts of required functions, remove non-required functions, and add your own function.
from helper_code import *
# from helper_code_old import *
import numpy as np, sys #, joblib
from skle... |
"""
Does speech synthesis on a folder of videos
"""
import argparse
import ast
import itertools
import glob
import os
import re
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
import cv2
import numpy as np
import pandas as pd
import pystoi
import requests
from google.cloud import sp... |
# 2013.04.26
# S.Rodney
# checking if the simulated SN distributions are in line with the observed
# mags and colors for 0.5 < z < 1.0
# TODO: handle upper limits
# TODO : handle missing nicknames
# TODO : adjust default x scaling
import os
import sys
import stardust
import numpy as np
from matplotlib import pypl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.