text stringlengths 6.04k 39.5k |
|---|
import sys
sys.path.append('..')
from main import *
import pytz
class Economia(commands.Cog):
@commands.command(name='atm',aliases=['money','coin','coins','dinheiro','meudinheiro','mymoney'])
@commands.before_invoke(usou)
@commands.cooldown(1,5,commands.BucketType.member)
@blacklists()
... |
# Copyright 2019 The TensorFlow Probability Authors.
#
# 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 o... |
"""
# @Description:
Script: Train the recurrent neural network model for face finding tasks with continuous likelihood.
"""
import argparse
import numpy as np
import pandas as pd
import torch
from torch import nn
import pyro
import pyro.distributions as dist
from pyro.infer.util import torch_item
from tqdm imp... |
import json
from sys import platform
import shutil
import os
import socket
import ipaddress
from typing import List, Iterator, Tuple
from cli_formatter.table_builder import TableBuilderClassic
from cli_formatter.output_formatting import colorize_string, Color, info
from dns_messages import Question, RRType
from .add_p... |
import json
import os
class FaceLabel:
"""
106 x,y label
[(x1,y1), (x2,y2)...]
"""
# __landmark = []
# __landmark_schema = []
"""left,height,top,width"""
# __face_rectangle = []
# __face_rectangle_schema = []
"""
BLACK, WHITE, ASIAN
"""
# __ethnicity = []
# __... |
#! /usr/bin/env python
import sys
import os
import logging
import operator
import wx
import wx.lib.newevent
log = logging.getLogger('squaremap')
#log.setLevel( logging.DEBUG )
SquareHighlightEvent, EVT_SQUARE_HIGHLIGHTED = wx.lib.newevent.NewEvent()
SquareSelectionEvent, EVT_SQUARE_SELECTED = wx.lib.newevent.NewEve... |
import math
import os
import random
import shutil
import time
from datetime import datetime
from logging import warning
import numpy as np
import pandas as pd
# spark_location = '/Users/Leo/spark-2.4.3-bin-hadoop2.7' # Set your own
# java8_location = '/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/... |
from __future__ import division
from __future__ import print_function
import time
from os.path import join as pjoin
import numpy as np
import math
import tensorflow as tf
from utils.data import fill_feed_dict_ae, read_data_sets_pretraining
from utils.data import read_data_sets, fill_feed_dict
from utils.flags import F... |
import boto3
import json
import re
import math
import os.path
from datetime import *
import common
import compare_output
from . import ecs_compares
def main(text):
regionList = ['us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', 'ap-northeast-1', 'ap-southeast-2']
region = regionList[0]
cluster = ""
... |
from rdflib import Graph, Literal, BNode, Namespace, RDF, URIRef
from rdflib.namespace import DC, FOAF
family_ns = Namespace("http://earasoft.com/family/0.1/")
g = Graph()
g.bind("family", family_ns)
g.bind("foaf", FOAF)
def createPerson(id, name):
"""
method responsible for creating person to... |
import numpy as np
import parl
import os.path
#import paddle
import paddle.fluid as fluid
from parl.utils import logger
# Author for Paddle(): <NAME>
# Author :skywalk
LEARN_FREQ = 5 # 训练频率,不需要每一个step都learn,攒一些新增经验后再learn,提高效率
MEMORY_SIZE = 20000 # replay memory的大小,越大越占用内存
MEMORY_WARMUP_SIZE = 200 # replay_memory ... |
from __future__ import annotations
from abc import abstractmethod
from dataclasses import dataclass
from datetime import datetime
from enum import EnumMeta, Enum, auto
from functools import partial
from itertools import chain
import logging
from typing import Any, Callable, List, Optional, Set, Tuple
import re
TIMEF... |
"""
Implementation of different Options / Parameters for model definitions
- create_class_mappings
- create_optimizer
- create_data_generators
- create_callbacks
- model_save
"""
# from tools.image import ImageDataGenerator
from keras.preprocessing.image import ImageDataGenerator
from config.config import config, cfg_p... |
# Template: https://www.pygame.org/docs/tut/tom_games2.html
import pygame,math
import numpy as np
import sys,os
from labcommon import * # @UnresolvedImport
from version import SIMULATOR_VERSION
INFOA = "LITEC Lab 2 Simulator"
INFOB = INFOA+" Version "+SIMULATOR_VERSION
SIMSTEP = 0.01 # seconds between updates
class ... |
import logging
from allauth.socialaccount.models import SocialAccount
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.http impor... |
import os
import sys
import argparse
from tqdm import tqdm
import helper
def save_script(args):
if args.local:
if not os.path.exists('../decoding_scripts/'):
os.makedirs('../decoding_scripts/')
else:
if not os.path.exists('../../decoding_scripts/'):
os.makedirs('../../decoding_scripts/')
# file name assi... |
"""
Script to collect metrics (total desired, actual and pending) from a DC
"""
from __future__ import print_function
import json
import operator
import sys
import time
from collections import defaultdict, namedtuple
from datetime import timedelta
from functools import partial
import attr
from effect import Compose... |
import csv
import datetime
import io
import itertools
import json
import time
from typing import List, Tuple
import botocore
import cherrypy
from natsort import natsorted
from girder.constants import AccessType
from girder.exceptions import GirderException, RestException, ValidationException
from girder.models.collec... |
##############################################
# User Defined Functions for Phrase Learning
##############################################
import pandas as pd
import numpy as np
import re, nltk, time, gc, math
from azureml.logging import get_azureml_logger
run_logger = get_azureml_logger()
run_logger.log('amlrealworl... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import random
import cv2
import numpy as np
import torch
from torch.utils.data.dataset import Dataset
from .mosaic_utils import random_perspective, adjust_box_anns, box_candidates
import torchvision.transforms.functional as... |
import numpy as np
from numpy.random import Generator, PCG64
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib.patches import Patch
from modpy.stats import metropolis_hastings
from modpy.stats._core import auto_correlation, auto_correlation_time
from modpy.plot.plot_util impor... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fast Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
#
# Copyright (C) 2013-2018 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of c... |
import json
from pathlib import Path as userPath
from glob import glob
from os import environ, getcwd, walk, path, makedirs, replace, remove
from hashlib import sha256
from collections import Counter
from webbrowser import open as launchBrowser
from datetime import datetime
from sys import argv
##Define global const... |
import numpy as np
from pydot import Dot, Edge, Node
from pyml.logger import logger
# 这里要实现CART树
# 1. 如何选择分裂点?
# 1. 对于离散型特征:遍历特征中的每一个值
# 1. 创建两个节点,左:样例特征等于该值 右:样例特征不等于该值
# 2. 计算分裂成本:分类任务中,寻找gini值最小的,回归任务中,寻找平方误差最小的
# 2. 对于连续性数据:先对数据进行排序, 遍历每一个可能的分裂点
# 1. 创建一个分裂点,左:小于这个分裂点的数据 右:大于这个分裂点的... |
#!/usr/bin/python
from krrt.utils import get_opts, write_file
from krrt.planning.strips.representation import parse_problem, generate_action, Action
from krrt.planning import parse_output_FF, parse_output_popf, parse_output_ipc
from krrt.sat.CNF import OptimizedLevelWeightedFormula
from linearizer import count_linear... |
import numpy as np
import cv2
import glob
import math
from sklearn.linear_model import LinearRegression
from scipy.cluster.hierarchy import ward, fclusterdata
from scipy.spatial.distance import pdist
import copy
import matplotlib
from matplotlib import pyplot as plt
def cal_curvature_2nd(x, coefs):
return np.powe... |
from __future__ import print_function, division
import imgaug as ia
from imgaug import augmenters as iaa
from imgaug import parameters as iap
import numpy as np
from scipy import ndimage, misc
from skimage import data
import matplotlib.pyplot as plt
from matplotlib import gridspec
import six
import six.moves as sm
impo... |
import numpy as np
def target_poly(x, n_degrees):
sum = 0
for i in range(n_degrees):
sum += np.power(x, i+1)
return sum
def target_nguyen7(x):
return np.log(x+1) + np.log(np.power(x, 2)+1)
def target_nguyen10(x):
return 2 * np.sin(x[:,0]) * np.cos(x[:, 1])
def target_... |
# camera.py
# Based on Nerfies codebase
"""Class for handling cameras.
Assume OpenCV camera model, which is compatible with COLMAP.
"""
import copy
import json
from typing import Tuple
import numpy as jnp
import torch
def _compute_residual_and_jacobian(
x: jnp.ndarray,
y: jnp.ndarray,
xd: jnp.ndarray... |
import numpy as np
from dowel import tabular
import matplotlib.pyplot as plt
import tensorflow as tf
import io
import matplotlib.image as mpimg
def plot_return_success(episodes, label):
episodes_return = 0
episodes_success = 0
has_success = "success" in episodes[0]._logs
# if success:
# num_tr... |
import threading
import json
from os import getpid, getcwd, path, environ
from platform import node
from pathlib import Path
from functools import partial
from signal import signal, SIGINT, SIGTERM
from subprocess import PIPE, DEVNULL
from textwrap import dedent
from logging import getLogger
from logging.handlers impor... |
from operator import itemgetter
import networkx as nx
from numpy import random, sqrt, triu_indices
import numpy as np
from scipy.spatial.distance import pdist
from sss.misc.generalized_star_clustering import (
default_priority_func,
degree_and_weight_priority_func,
layered_clustering,
)
MIN_NUM_LEVELS_IN... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
'''
.. _module_mc_remote_pillar:
mc_remote_pillar / masterless pillar management
===============================================
The idea is to have masterless ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
COMP0088 lab exercises for week 2.
Add your code as specified below.
A simple test driver is included in this script. Call it at the command line like this:
$ python week_2.py
A 4-panel figure, `week_2.pdf`, will be generated so you can check it's doing what you
... |
import csv
import json
import os
import random
from collections import Counter, defaultdict
import math
import operator
import logging
import nltk
import numpy as np
from tqdm import tqdm
class Data(object):
def __init__(self, config, train_data=None):
self.config = config
self.batch_size = confi... |
'''
Generate transaction sequence and other necessary input information
'''
import yaml
import argparse
import numpy as np
from numpy.random import default_rng
import random
import math
import pickle
import pdb
import scipy.stats as stats
from os.path import dirname
from os.path import abspath
from pathlib import P... |
#!/usr/bin/python
##########################################################################
# Copyright (c) 2015, Salesforce.com, Inc.
# All rights reserved.
#
# Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# Redistributions in binary... |
""" This module contains miscellaneous utility functions and classes for creating the OWS webservices. The most useful
functions in the module are probably the date manipulation functions.
"""
from collections import namedtuple
import datetime
import json
from django.contrib.auth.models import User, Group, AnonymousU... |
import heapq
from copy import deepcopy, copy
from math import inf
class Board:
def __init__(self, rows, columns, player_1_pawns, player_2_pawns):
self.rows = rows
self.columns = columns
self.num_placed_walls = 0
self.player_1_pawns = deepcopy(player_1_pawns)
self.player_2_p... |
import datetime
import json
import os
from enum import Enum
import numpy as np
import sqlalchemy as db
from sqlalchemy import Column, Integer, String, DateTime, Text, ForeignKey, or_, func
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
from common.utils i... |
import os
import warnings
from collections import OrderedDict
from typing import Optional, Union
import imageio
import cv2
import numpy as np
import torch
from torch.utils import data
import datautils
__all__ = ["RIO10"]
class RIO10(data.Dataset):
r"""Expecting the RIO10 Dataset to be in this format:
.. co... |
import os
import random
import tempfile
from copy import copy
from functools import partial
from multiprocessing import cpu_count
import pickle
import numpy as np
import tensorflow as tf
from joblib import Parallel, delayed
from .tokenization import printable_text
from .utils import (BOS_TOKEN, EOS_TOKEN, add_special... |
"""
Main processing business logic for the OAG application. This is where the back-end processing
of requested identifiers actually happens, and where the asynchronous Celery tasks are defined
and triggered by requests.
Throughout this module we use the OAG record object as the message format that is passed around
th... |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: RainbowSecret
## Modified from: https://github.com/AlexHex7/Non-local_pytorch
## Microsoft Research
## <EMAIL>
## Copyright (c) 2018
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in t... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 22 00:25:51 2019
@author: user
"""
import json
import csv
import numpy as np
import librosa
import matplotlib.pyplot as plt
from scipy.signal import medfilt, butter, filtfilt
from sklearn.metrics import f1_score, accuracy_score
from keras.models import load_model
from ke... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import nose
import os
import json
from functools import wraps
from openpyxl import Workbook
from xlseries.strategies.discover.parameters import Parameters
from xlseries.strategies.discover.parameters import InvalidParameter
from xlseries.strategies.discove... |
# -*- coding: utf-8 -*-
# @Author: yancz1989
# @Date: 2016-06-19 10:52:42
# @Last Modified by: yancz1989
# @Last Modified time: 2016-12-06 21:30:03
from __future__ import absolute_import, print_function, division
import numpy as np
import tunas.core.interfaces
import theano
import theano.tensor as T
import theano... |
"""Scikit-learn Estimator Wrappers."""
import logging
import os
import tempfile
from functools import partial
from pathlib import Path
import cloudpickle
import dask.bag
from dask import delayed
from sklearn.base import BaseEstimator, MetaEstimatorMixin, TransformerMixin
from sklearn.pipeline import Pipeline
from sk... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 shmilee
'''
Contains class to display graphics in terminal.
'''
import io
import os
import sys
import struct
import tempfile
from ..glogger import getGLogger
from ..utils import which_cmds, run_child_cmd, find_available_module
__all__ = ['get_imgfwh', 'resize_imgwh', 'c... |
import logging
from io import BytesIO
from reportlab.lib import pagesizes, colors
from reportlab.lib.units import mm, toLength
from reportlab.lib.enums import TA_RIGHT, TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.pdfbase import pdfmetrics
from repor... |
from kf_lib_data_ingest.common import constants
from kf_lib_data_ingest.common.concept_schema import CONCEPT
from pandas import concat, DataFrame, notna
P = CONCEPT.PARTICIPANT
FR = CONCEPT.FAMILY_RELATIONSHIP
FAM = CONCEPT.FAMILY
class FamilyException(Exception):
pass
def _p1p2_relationships_from_motherfather... |
import argparse
import os
import pypcd
import sklearn.cluster
import itertools
import tqdm
import hdbscan
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from kitti_bounding_box_provider import get_bounding_boxes, count_points_bboxes_matching, transform_points_velo_to_rect, get_2... |
import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
import numpy as np
from copy import deepcopy
import pdb
class Learner(nn.Module):
"""
"""
def __init__(self, ... |
#
# This file is part of Mapnik (c++ mapping toolkit)
#
# Copyright (C) 2015 <NAME>
#
# Mapnik is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) an... |
import torch
import torch.nn as nn
import numpy as np
from torch.utils import data
import argparse
import os
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.utils.data as data
from PIL import Image
from PIL import ImageFile
from tensorboardX import SummaryWriter
from to... |
# Copyright 2013-2020 <NAME>
# Distributed under the terms of the GNU Public License (GPLv3)
"""
Upload data to MQTT server
This service requires the python bindings for mqtt:
pip install paho-mqtt
Minimal configuration:
[StdRestful]
[[MQTT]]
server_url = mqtt://username:password@localhost:1883/
... |
import sys
import pprint
import wrapt
import gen_util_constants as util_constants
from google.protobuf.descriptor import Descriptor, EnumDescriptor, EnumValueDescriptor, FieldDescriptor, FileDescriptor
from typing import Tuple
pp = pprint.PrettyPrinter(indent=4, stream=sys.stderr)
Num2Type = {
1: "double",
2: "... |
import copy
import pickle
from pathlib import Path
import numpy as np
from tqdm import tqdm
from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...utils import common_utils, box_utils, self_training_utils
from ..dataset import DatasetTemplate
class LyftDataset(DatasetTemplate):
def __init__(self, data... |
import torch.nn as nn
import torch
import numpy as np
from .utils import iou_wo_center,generalized_iou,build_targets
#Functional Utils
mse_loss = nn.MSELoss()
bce_loss = nn.BCELoss()
def dice_loss1d(pd,gt,threshold=0.5):
assert pd.shape == gt.shape
if gt.shape[0]==0:
return 0
inter = torch.sum(pd*g... |
#!/usr/bin/env python
"""
Convert DICOM files to corresponding PNG files.
NOTE: Only works with DICOM files containing a single
layer!
"""
import sys, os, collections, toml, asyncio, hashlib, time, platform, queue
import numpy as np, png, pydicom, multiprocessing
from pathlib import Path
from PyQt5 import QtCore, QtWi... |
#!/usr/bin/env python3
# coding: utf8
# Author: <NAME>, 2016
'''
Parameter handling.
This module provides:
- a description of all parameters and their defaults
- parsers for command-line arguments and .ini-file settings
- a config object initialised with parameter attributes
'''
import re
import sys
import json
i... |
import numpy as np
from typing import List
from functools import lru_cache, reduce
from pyspark.sql import Window
from pyspark.sql.types import (
IntegerType,
LongType,
StructField,
StructType,
Row
)
from pyspark.sql.functions import col, year, month, dayofmonth, row_number, udf, desc, asc
from . im... |
"""
experiment6_2.py
Extension to experiment6 that uses the NEAT algorithm to evolve the network's weights.
"""
import argparse
import csv
import multiprocessing as mp
import os
import shutil
import time
from collections import Counter
import matplotlib.pyplot as plt
from numpy import mean
from scipy.stats import gme... |
import numpy as np
import copy
from itertools import combinations
class Import:
"""
Imports data from various sources.
Currently, just tab-delimited files are supported
"""
def __init__(self, file, ftype):
self.data = None
self.data_modified = None
self.data_slow = None
... |
# Copyright 2019 The Texar Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
"""
Created on Tue July 13 12:01 2021
@author: juliaroquette
Spin evolution model implemented in the development of the study by
Roquette et al. 2021.
The class SpinEvolutionCode performs the spin evolution modeling of stars
in the mass range 0.1-1.3 Msun. For a details on the theoretical background
in the model, s... |
#!/usr/bin/python
# Copyright 2016 NEC Corporation
# 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 a... |
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.preprocessing.image import ImageDataGenerator
# from tensorflow_docs.vis import embed
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import pandas as pd
import imageio
import argparse
ap = argparse.Argum... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: romanText/writeRoman.py
# Purpose: Writer for the 'RomanText' format
#
# Authors: <NAME>
#
# Copyright: Copyright © 2020 <NAME> and the music21 Project
# License: BSD, see license.t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2018 <NAME>
""" Top level model classes
.. Created on Wed Mar 14 11:08:28 2018
.. codeauthor: <NAME>
"""
import os.path
import json_tricks
from collections.abc import Sequence
import rayoptics
import rayoptics.elem.elements as ele
import rayoptics.optical... |
import os
r = "\033[31m"
g = "\033[32m"
y = "\033[33m"
p = "\033[35m"
banner=f"""{r} ▄▄▄▄ ██▓ ▒█████ ▒█████ ▓█████▄▓██ ██▓
▓█████▄ ▓██▒ ▒██▒ ██▒▒██▒ ██▒▒██▀ ██▌▒██ ██▒
▒██▒ ▄██▒██░ ▒██░ ██▒▒██░ ██▒░██ █▌ ▒██ ██░
▒██░█▀ ▒██░ ▒██ ██░▒██ ██░░▓█▄ ▌ ░ ▐██▓░
░▓█ ▀█▓░███... |
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2015 HP Development Company, L.P.
#
# 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 late... |
# Import packages
import tensorflow
import numpy
import math
# Import required src
from usienarl import SpaceType, Config, Model
class Buffer:
"""
A buffer for storing trajectories experienced by a DDPG agent interacting with the environment, it is a simple FIFO
experience replay buffer.
"""
de... |
#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2019 <NAME>, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... |
import string
import tkinter
import BingoBoard
import Config
from time import time
from tkinter import ttk
from tkinter import messagebox
from copy import deepcopy
from math import ceil
class TimespinnerBingo(tkinter.Frame):
def __init__(self, master, **kw):
super().__init__(master, **kw)
self.con... |
#this file contains functions specifically for the double jump (aka dead cat bounce) algo
#when a penny stock gains a significant amount with a large volume then falls with a small volume, then it generally gains a second time
import otherfxns as o
algo = o.os.path.basename(__file__).split('.')[0] #name of the algo b... |
import json
import math
import torch
import torch.distributions as distributions
from daphne import daphne
# funcprimitives
from evaluation_based_sampling import evaluate_program
from tests import is_tol, run_prob_test,load_truth
# Useful functions
from primitives import _hashmap, _vector, _totensor
from primitives imp... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# 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 above copyri... |
from PIL import Image
import requests
from io import BytesIO
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy as sp
from wordcloud import WordCloud, STOPWORDS
import surprise
from surprise import Reader
from surprise import Dataset
from surprise.model_selectio... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 10:24:54 2020
@author: jireh.park
"""
# 대곡 봉명
import pandas as pd
import numpy as np
import re
#%%
class basic():
def __init__(self, df):
self.df = df
#% 지하철 경로 함수 정의
def intersect(self, a, b):
return list(set(a)... |
# -*- coding: utf-8 -*-
"""
flask.ext.security.datastore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains an user datastore classes.
:copyright: (c) 2012 by <NAME>.
:license: MIT, see LICENSE for more details.
"""
from .utils import get_identity_attributes, string_types
class Datastore(object)... |
from decimal import Decimal, DecimalException
from django.db import models, IntegrityError
from django.utils import timezone
from django.core.exceptions import ValidationError
from django.core.validators import (MinValueValidator, MaxValueValidator,
MinLengthValidator, MaxLengthValidator)
from django.utils.transl... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
import math
from enum import Enum, unique
from pathlib import Path
from typing import Any, Dict, List, Set, Tuple
import boto3
from botocore.exceptions import ClientError
from packaging import ver... |
import json
import pymel.core as pm
from mgear.shifter import guide
def updateGuide(*args):
"""Update the guide rig"""
if pm.selected():
rgGuide = guide.Rig()
rgGuide.update(pm.selected()[0])
else:
pm.displayWarning("Please select the guide top node")
# guide differences checker... |
# -*- coding: utf-8 -*-
"""Session management and client IO."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 <NAME>
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
from collections import deque
from os.path import exists, join
from .. import ... |
import docker
import os
import subprocess
import shutil
import cv2
import numpy as np
import pickle as pkl
import time
import mediapipe as mp
mp_pose = mp.solutions.pose
from PIL import Image
from django.shortcuts import render
from django.http import JsonResponse, HttpResponse, HttpResponseForbidden
from django.http... |
# Created by <NAME> at 01.05.20
# E-mail: <EMAIL>
# Detection algorithm. All the stages of the detection algorithm are called from this module.
import cv2
import numpy as np
import queue
import timeit
import pickle
from collections import deque
from functools import wraps
import logging
import feature_extractor as f... |
"""
Usage Instructions:
"""
import csv
import numpy as np
# import pickle
import random
import tensorflow as tf
import pandas as pd
from maml import MAML
from scene_sampling import SLICProcessor, TaskSampling
from tensorflow.python.platform import flags
from utils import tasksbatch_generator, sample_generator, met... |
DEBUG = False
UNIT_TEST_DEBUG = False
import re
import os
import string
from os import path
PACKAGE_NAME = "ClassesAndTests"
def plugin_loaded():
global settings
settings = sublime.load_settings(PACKAGE_NAME+ '.sublime-settings')
global PACKAGE_DIR
global TEMPLATES_DIR
PACKAGE_DIR = os.path.join(... |
#!/usr/bin/env python
'''
Copyright (C) 2007 <NAME> <EMAIL>
Copyright (C) 2013 <NAME> <EMAIL>
This extension allows you to draw a Cartesian grid in Inkscape.
There is a wide range of options including subdivision, subsubdivions
and logarithmic scales. Custom line widths and colors are also possible.
All elements are ... |
from copy import copy, deepcopy
from datetime import timedelta
from unittest import mock
import pytest
from ticts import TimeSeries
from ticts.utils import MAXTS, MINTS
from .conftest import CURRENT, HALFHOUR, ONEHOUR, ONEMIN
class TestTimeSeriesInit:
def test_with_dict(self, smalldict):
ts = TimeSerie... |
#!bin/python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import urllib2
import xml.dom.minidom
import datetime
import json
import copy
from dateutil import parser
import csv
import StringIO
import re
from pytz import timezone
import logging
import logging.handlers
import contextlib
country = 'Spain'... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import absolute_import
import sys
import os
import shutil
import logging
import traceback
from abc import abstractmethod
from itertools import groupby
from database_schema_collect.util import format_pg_col_str
from database_schema_collect.ERD import ERD
from datab... |
# Copyright (c) 2017, <NAME>
from os import getcwd
import logging
import typing
import subprocess
import re
import bson
from pathlib import Path
from operator import attrgetter
from functools import partial
import arvet.batch_analysis.job_system
from arvet.batch_analysis.task import Task
import arvet.batch_analysis.scr... |
import random
#all the characters that are considered valid
validChars = ["Q", "W", "E", "R", "I", ">", "<", "V", "^"]
def convertToValid (fileInput):
'''Convert file data to array of valid characters only'''
#convert to upper case
fileInput = fileInput.upper()
#create array to hold data in
... |
from machaon.core.type import TypeDefinition
import os
import shutil
import sys
import tempfile
import configparser
import re
import importlib
import traceback
from typing import Dict, Any, Union, List, Optional, Iterator
from machaon.core.importer import module_loader, walk_modules, module_name_from_path, PyBasicModu... |
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020-2021 <NAME> <<EMAIL>>
import enum
import logging
import os
import pathlib
import re
import subprocess
import common
COMPOSITE_FRAME_SIZE = 4
class ThumbnailType(enum.Enum):
SMALL_SQ = 1
MEDIUM_SQ = 2
REGULAR = 3
class Thum... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 14:19:05 2020
Functions to attach the LCFS to carbon emissions, based on code by <NAME>
@author: lenakilian
"""
import numpy as np
import pandas as pd
import io_functions as io
df = pd.DataFrame
import demand_functions as dm
import copy as cp
... |
# -*- coding: utf-8 -*-
"""
Hilltop read functions for COM connection.
Hilltop uses a fixed base date as 1940-01-01, while the standard unix/POSIT base date is 1970-01-01.
"""
try:
from win32com.client import Dispatch, pywintypes, makepy
except:
print('Install pywin32 or com functions will not work')
from panda... |
##########################################################
# lane_detector.py
#
# SPDX-FileCopyrightText: Copyright 2021 <NAME>
#
# SPDX-License-Identifier: MIT
#
# Lane detection techniques
#
# ########################################################
#
# Import libraries
import cv2
import numpy as np
import math
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.