text stringlengths 6.04k 39.5k |
|---|
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from typing import Optional
import numba
import numpy as np
import pyarrow as pa
from numba import njit, prange
FASTMATH = True
PARALLEL = True
def _extract_data_buffer_as_np_array(array: pa.Array) -> np.ndarray:
"""Extra... |
from flask import Flask, redirect, url_for, render_template, flash, session, request
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager, UserMixin, login_user, logout_user, current_user, login_required
from oauth import OAuthSignIn
from app import app, db
impo... |
"""main program
"""
import numpy as np
import json
import requests
import grpc
import time
from datetime import datetime
import subprocess
import os
import tensorflow as tf
import pickle
from tensorflow.keras.regularizers import L2
from tensorflow import make_tensor_proto
from tensorflow.python.data.ops.dataset_ops im... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import time
import json
import string
from types import SimpleNamespace
import pygsheets
import requests
from io import BytesIO
import pandas as pd
from typing import Union, List, Optional, Tuple, Dict
from tabulate import tabulate
from asyncio import F... |
import random
import gzip
import socket
import struct
import time
import sys
import json
import os
import subprocess
import threading
import http.client
import getpass
import urllib.request
LUCENE_SERVER_BASE_VERSION = '0.1.1'
JVM_OPTIONS = '-XX:+AlwaysPreTouch -Xms2g -Xmx2g -verbose:gc'
# killall java; ssh 10.17.4.... |
# pylint: disable=R,C,E1101
import torch
import torch.cuda
import numpy as np
from string import Template
from functools import lru_cache
from s2cnn.utils.decorator import cached_dirpklgz
# s2_ft.py
def s2_rft(x, b, grid):
"""
Real Fourier Transform
:param x: [..., beta_alpha]
:param b: output bandwid... |
import datetime
import os, json
import numpy as np
from tqdm import tqdm
from transformers import BertTokenizer, AutoTokenizer
import argparse
import torch
from transformers import AdamW
import torch.nn as nn
from tqdm import tqdm
import copy
from torch.utils.data import Dataset, DataLoader
import logging
from snippets... |
from tkinter import *
from tkinter import messagebox
from spotipy.exceptions import SpotifyException
from requests.exceptions import ReadTimeout
from intershuffle import *
from traceback import format_exc
from datetime import date, datetime
import os
import requests
HEIGHT = 600
WIDTH = 960
NAMESIZE = 103
# Seaweed ... |
import tensorflow as tf
from tensorflow.python.layers.layers import dropout
import numpy as np
from experiments.utils import ExperimentData
from os import path
from types import GeneratorType
import threading
from .dirichlet_fastfit import meanprecision_with_sufficient_statistic, \
fixed... |
# -*- coding: utf-8 -*-
"""30cappa.ipynb
# 30cappa con meno di 5mila abitanti

- trovare i piccoli Comuni (fino a 5mila abitanti)
- calcolare i 30kmdal confine da cui possono spostare
- impedendo di andare nei Comuni ca... |
"""
MixCli **project** command group **build** command
This command would launch model builds for a Mix project. Please note to launch NLU model builds, if
specified, command line argument 'locale' is mandatory. Furthermore the build note will be set for all
model builds, same as in Mix UI. Last but not least, same as... |
import numpy as np
import pytest
import torch
from varz import Vars
import lab as B
# noinspection PyUnresolvedReferences
from .util import (
approx,
approx,
KV,
dtype,
vs,
vs_source,
assert_lower_triangular,
assert_positive_definite,
assert_orthogonal,
)
def test_get_latent_vars(... |
import unittest
from robot.utils.asserts import *
from robot.common.statistics import *
from robot.common.model import _Critical, BaseTestCase
from robot import utils
class SuiteMock:
def __init__(self, name='<NAME>', id='s1', crit_tags=None):
self.name = self.longname = name
self.id = id
... |
from collections import defaultdict
import logging
import os
import sys
import time
from typing import Type, Union
import h5py
import numpy as np
from sklearn.metrics import f1_score
import torch
from torch.utils.data import DataLoader
from omegaconf import DictConfig, OmegaConf, ListConfig
from torch import nn
from t... |
import os
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
from skmisc.loess import loess
from maskrcnn.postprocess.analysis import (
winsorize, load_nightlight_from_point,
load_buil... |
# Sprint Week Challenge
# Date
# Author - <NAME>
# Project 3 - Python Program
'''
Option 1. Simple IPO Program.
The Edsel Car Rental Company rents automobiles for $35.00 per day and 10 cents per kilometer travelled.
Allow the user to enter the number of days the car was rented, the mileage when the ca... |
import torch
import numpy as np
from tqdm import tqdm
import hashlib
from pathlib import Path
from torch_geometric.data import Data
# from utils.pdb import register_pdb_hook
# register_pdb_hook()
from utils.file import read_hdf5
import sys
def _info(etype, value, tb):
if hasattr(sys, 'ps1') or not sys.stderr.... |
#!/usr/bin/env python
"""
Copyright (c) 2021 <NAME>
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, publi... |
# -*- coding:UTF-8 -*-
from __future__ import unicode_literals
from PIL import ImageColor
from PIL import ImageFont
from PIL import ImageDraw
from PIL import Image
from luma.oled.device import ssd1351
from luma.core.render import canvas
from luma.core.interface.serial import spi
import OLED_Driver as OLED
import RPi.GP... |
""" Finite State Transducer """
import json
from typing import Any, Iterable
import networkx as nx
from networkx.drawing.nx_pydot import write_dot
from pyformlang.indexed_grammar import DuplicationRule, ProductionRule, \
EndRule, ConsumptionRule, IndexedGrammar, Rules
class FST:
""" Representation of a Fini... |
# Copyright (c) 2021 <NAME>
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from dataclasses import asdict, dataclass, field
import logging
from contextlib import contextmanager
from typing import Generator, Iterable, List, Optional, Sequence, Tuple, Dict, Union
import numpy ... |
import re
from collections import Counter, defaultdict
from tabulate import tabulate
from math import ceil
from loader.Database import DBViewIndex, DBManager, DBView
from exporter.Shared import SkillData, PlayerAction, ActionParts
from exporter.Mappings import AFFLICTION_TYPES
SKILL_DESC_ELEMENT = re.compile(r'(flam... |
# -------------------------------------------------------------------------------------------------------------------- #
# standard distribution imports
# -----------------------------
import logging
# additional module imports (> requirements)
# ------------------------------------------
import numpy as np
import pan... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2020, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
"""
Orbital DataFrame
####################
Orbital information. All of the dataframe structures and functions associated
with the results of a quantum chemical calculation. The Orbit... |
import numpy as np
import torch
import os
import math
import torch.nn as nn
import torch.nn.functional as F
import gym
from ppo.distributions import Bernoulli, Categorical, DiagGaussian
from ppo.utils import init
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class Policy(... |
# from sequitur.models import LSTM_AE
import torch
from torch import nn
import numpy as np
# from sequitur import quick_train
from torch.utils.data.sampler import SubsetRandomSampler
from torch.utils.data import DataLoader
from torch.nn import MSELoss
from models.AED.simpleAED import Encoder, Decoder, RecurrentAutoenco... |
import tensorflow as tf
import numpy as np
import os
import glob
class BasePPO(object):
def __init__(self, action_space, observation_space, scope, args, path_models, type="Simple"):
"""Class with backend of algorithm of PPO.
Parameters:
action_space: int
Count of max ... |
"""
Copyright 2019-present NAVER Corp.
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... |
import re
from datetime import datetime, timedelta
from bson.objectid import ObjectId
from werkzeug.security import check_password_hash, generate_password_hash
class DatabaseHandler(object):
def __init__(self, mongo):
self.mongo = mongo
def add_user(self, firstname, lastname, email, password, confi... |
from flask import Blueprint, render_template, abort, Flask, jsonify, redirect, send_from_directory
from flaskext.markdown import Markdown
from flask_minify import minify
import glob
import collections
import csv
import json
import os
import dateutil.parser
import yaml
year=2021
year_blueprint = Blueprint("vis{}".forma... |
import numpy as np
import pandas as pd
import tensorflow as tf
from PIL import Image
from PIL import ImageOps
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import os
import time
def metrics_np(y_true, y_pred, metric_name,
metric_type='standard', drop_last = True, mean_per_class=False, verbose=F... |
from __future__ import division
import cv2
import dlib
import time
import sys
import random
import numpy as np
from matplotlib import pyplot as plt
from scipy.sparse import spdiags
from scipy.sparse import dia_matrix
from scipy.sparse.linalg import cg
import math
from linebot.exceptions import LineBotApiError
from flas... |
from datenguidepy import Query
from datenguidepy.query_helper import get_regions, get_statistics
import os
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from flask import Response
import io
from flask import Flask, render_template, request, session
from... |
# -*- coding: utf-8 -*-
"""Defines fixtures available to all tests."""
import json
import pytest
from webtest import TestApp
from polylogyx.application import create_app
from polylogyx.database import db as _db
from polylogyx.settings import TestConfig
from .factories import (
NodeFactory, RuleFactory, UserFact... |
from flask_restplus import Namespace, fields
import socket
import time
import pymongo
from datetime import datetime, date, time, timedelta
from flask import jsonify, request
from database import DB
from bson import json_util, ObjectId
import json
from apis.utils.common import *
from apis.libraries.send_mail import Send... |
from __future__ import division
import sys
import math
import random
import pytest
from gmpy_cffi import mpfr, mpq, mpz, isinf, isnan
from math import sqrt
PY3 = sys.version.startswith('3')
invalids = [(), [], set(), dict(), lambda x: x**2]
small_floats = [random.random() for _ in range(5)]
large_floats = [random... |
# -*- coding: utf-8 -*-
"""chatbot.py
"""
import nltk
import random
import numpy as np
import json
import pickle
import pyttsx3
import datetime
import wikipedia
import pyowm
import pygame
import webbrowser
import speech_recognition as sr
from nltk.stem import WordNetLemmatizer
from tensorflow.python.keras.models im... |
"""
Hopf fibration functions.
"""
# Copyright (c) 2020 <NAME>. All rights reserved.
import cv2
import numpy as np
from symbols import transforms, composite as comp
def total_points(base_point, fiber_points):
"""find points in the total space S3 from a point in S2 and points S1"""
a, b, c = base_point
... |
import cv2
import numpy as np
import pandas as pd
from random import randint
import os
import sys
import math
import torch
import matplotlib
import matplotlib.pyplot as plt
from PIL import Image
from collections import defaultdict
import torch.nn.functional as F
import torch
import torch.optim as optim
from torch.o... |
#!/usr/bin/env python
"""
create_counts_lookup.py
"""
print('3)-->files')
import sys,os
import argparse
import pymysql as MySQLdb
import json
import configparser as ConfigParser
"""
SELECT sum(seq_count), dataset_id, domain_id,domain
FROM sequence_pdr_info
JOIN sequence_uniq_info USING(sequence_id)
JOIN silva_t... |
# -*- coding: utf-8 -*-
"""
Realtime hpi monitor for Vectorview/TRIUX MEG systems.
@author: jussi (<EMAIL>)
"""
import sys
from PyQt5 import QtCore, uic, QtWidgets, QtGui
from PyQt5.QtCore import pyqtSignal
from pkg_resources import resource_filename
import time
import struct
import FieldTrip
import numpy as np
imp... |
# A Powerful Music Bot Property Of Rocks Indian Largest Chatting Group
# Without Credit (<NAME>)
# Rocks © @Dr_Asad_Ali © Rocks
# Copyright (C) 2021 By @Itz_VeNom_xD
# Copyright (C) 2021 By @Dr_Asad_Ali
# Copyright (C) 2021 By @HarshitSharma361
# Code Owner Unknown Dialogue © Asad & Vir
import asyncio
import random... |
import math
import torch
import torch.nn.functional as F
def tps_grid(H, W):
# Create points matrix [Nx2]
xi = torch.linspace(-1, 1, W)
yi = torch.linspace(-1, 1, H)
yy, xx = torch.meshgrid(yi, xi)
grid = torch.stack((xx.reshape(-1), yy.reshape(-1)), 1)
return grid
def spatial_grid_unnorma... |
# This is the main file used for the paper : TODO
# The platform was designed by <NAME>, <NAME> and <NAME>
# We are aware that we might not have followed conventional python protocols
# but we are of course more than happy to illustrate what we've done.
# You can send an email to frankvee(at)uio.no for any questions, ... |
import abc
import datetime
import logging
from multiprocessing import RawValue
import re
import threading
import time
from aprsd import client, objectstore, packets, stats, threads
LOG = logging.getLogger("APRSD")
# What to return from a plugin if we have processed the message
# and it's ok, but don't send a usage ... |
# -*- coding: utf-8 -*-
###############################################################################
# Author: <NAME>, <EMAIL>
# Copyright (c) 2010-2014, Cartoworks Inc.
###############################################################################
# Permission is hereby granted, free of charge, to any ... |
"""--------------------------------------------------------------------
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 re
import math
from datetime import datetime
from pathlib import Path
SYMBOL_SUFFIX = [
'',
'',
'²',
'³',
]
NAME_SUFFIX = [
'',
'',
'Sqr',
'Cub',
]
NAMESPACE = 'RayQuantities'
NUMBER_OF_DECIMALS = 2
# Dict to define all the base quantities
# The restriction tuple must the of t... |
"""
Gives layer2 support for peer DIDs -- static DID docs. 30 min of coding to port.
"""
import base58 # Must use bitcoin's alphabet, not Flickr's.
import hashlib
import os
import re
import sys
import ecdsa
import base64
import json
import sgl # SGL defined on pypi and on npm; 200 lines of code to port for other lan... |
from importlib import import_module
import requests
from contextlib import closing
from dateutil import relativedelta
from dateutil.parser import parse
from django.conf import settings
from django.contrib.gis.geos import Polygon
from psycopg2.extras import DateTimeTZRange
from rest_framework.views import APIView
from... |
## Python code for finding new species occurrences in Finland and in Finland's biogeographical provinces
## Uses the laji.fi API: https://api.laji.fi
## Gets all the specimens from laji.fi which have location data,
## and compares them to the species distributions which have been saved in Taxon Editor.
## Saves two fil... |
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from results.test_dicts import marker_styles, draw_order, metric_ylim, best_function, is_metric_increasing, \
metric_short_name, metric_en_name
excluded_methods = ['Simple split']
RESULTS_ROOT_DIR = 'detailed_r... |
#emcee analysis for GRB afterglow
#
#<NAME> 01/10/2018 <EMAIL>
from multiprocessing import Pool
import tqdm
import numpy as np
import corner
import emcee
from os.path import join
from astropy.table import Table, Column
import joelib.physics.jethead_expansion as Exp
from joelib.constants.constants import *
#I'VE LE... |
# -*- coding: utf-8 -*-
'''
Created on Oct 5, 2017
@author: marcoxzh3
'''
_debug = True
_release = True
import getpass, hashlib, json, pytz, sys, time
import mysql.connector
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.schedulers.blocking import BlockingScheduler
from datetime i... |
# Copyright 2020 Google LLC
#
# 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, ... |
import copy
import io
import logging
import pathlib
import tkinter
from dataclasses import astuple
from datetime import datetime
from tkinter import ttk
from typing import List
import matplotlib
import matplotlib.animation as animation
import win32clipboard
from matplotlib import pyplot, style
from matplotlib.backends... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 The University of Sydney, Australia
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License, version 2, as published by
the Free Software Foundation.
This program is distribute... |
import json
from ..kernel.core import ExtendedCharacterModifier as ExMDF
class Item():
'''Class Item : Holds informations about Item
Items will hold information about given item.
- parameters
.name : Item's name. Need not be unique.
.level : Item's required level.
.main_option :... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from enum import Enum
import math
class Rnn(Enum):
''' The available RNN units '''
RNN = 0
GRU = 1
LSTM = 2
Transformer = 3
@staticmethod
def from_string(name):
if name == 'rnn':
ret... |
# coding: utf-8
# Copyright (C) <NAME> <<EMAIL>>
import datetime, random, os, sys, copy, json
if sys.version_info.major >= 3:
from .tools.StopWatch import StopWatch
from .tools.ProgressBar import ProgressBar, MultiBar
from .tools.ColorPrint import ColorPrint
from .tools.MultiProcess import MultiProcess... |
# -*- coding: utf-8 -*-
"""
Y bindings to ObsPy core module.
:copyright:
The ObsPy Development Team (<EMAIL>)
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
from __future__ import (absolute_import, division, print_function,
unic... |
import pandas as pd
import numpy as np
data_path = "/home/clairegayral/Documents/openclassroom/data/P4/"
res_path = "/home/clairegayral/Documents/openclassroom/res/P4/"
from sklearn import preprocessing
from sklearn.impute import KNNImputer
###################
#### open data ####
###################
product_catego... |
from pluginbase import PluginBase
from HTMLParser import HTMLParser
from random import randint
import logging
import requests
import re
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
import json
from config import Config, ConfigParser
import datetime, time
from ur... |
"""Converter for dataclass and struct.
The first version of converter is designed to be automatic, in the sense
that no additional annotation is required in neither capnp schema nor
dataclass definition, and the converter will derive the mapping between
the two automatically. The drawback is that the converter will n... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
import numpy as np
import torch
import json
import cv2
import os
from data_loader.center_face_utils.image import flip, color_aug
from data_loader.center_face_utils.image import g... |
"""
vpp_input.py
Input parsing for VPP health monitoring
@author: K.Edeline
"""
import os
import fnmatch
import json
import threading
import time
vpp_libs=[]
# VPP BM libs
try:
from vpp_papi import VPP
from vpp_papi.vpp_stats import VPPStats
vpp_libs.append("vpp")
except:
pass
# gNMI libs
try:
f... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import leastsq
#################
# 通用函数-杂项 #
#################
def get_file_names(directory='data', filter='.*', order='default', with_folder=False):
'''
用以返回目标路径中所有符合后缀的文件列表。
参数:
dir... |
# May 24, 2021
# Created by <NAME>
# <EMAIL>
# This program will log the temperature, pressure and the cryogen liquid level of the Leiden fridge.
import sys
import datetime
import time
import getopt
import signal
# Miscellaneous, needed if server is to be run within this program.
# Currently, all server related dire... |
import abc
import typing
from itertools import chain, combinations
import pandas as pd
import numpy as np
import pydantic
import textwrap
from intervals import FloatInterval
from ..utils import get_subclasses
from ..modelling import DiscreteDistribution
import dash
import dash_table
import dash_bootstrap_components ... |
import scipy.stats as spst
import numpy as np
import sys
import os
import glob
import fnmatch
import pickle
from optparse import OptionParser, OptionGroup
import logging
from .libs.annotation import *
from .libs.viz import *
from .libs.bam import *
from .libs.bam_sparse import *
from .libs.kmer import *
from .scaling... |
# coding=utf-8
import os
import os.path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from loganalysis.const import *
class Log(object):
''' 调度模块Log分析接口类
主要提供如下3类功能:
a) 信息呈现
b)问题发现
c)问题定位
要求所有文件命名符合EI命名格式:子系统_时间.csv
'''
def __init__(self, ... |
from torch import nn
from torch.nn.functional import relu
import torch
import re
import numpy as np
import os
from allennlp.modules.elmo import Elmo, batch_to_ids
from data import PennDataset, SnliDataset, VuaPosDataset
from torch.utils.data import DataLoader
# import eval
from pytorch_pretrained_bert.tokenization im... |
# Copyright 2022 MONAI Consortium
# 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, s... |
"""Defining the neutrino detectors and all related objects (samples, acceptances...)."""
import abc
import copy
import itertools
import logging
import os
import warnings
from collections.abc import Iterable
from typing import List, Optional, Tuple, Union
import astropy
import astropy.coordinates
import h... |
import asyncio
import time
import traceback
from datetime import datetime, timedelta
import discord
from discord.ext import commands, tasks
from pytz import timezone
from helper.lecture_scraper.scrape import scraper
from helper.log import log
from helper.sql import SQLFunctions
async def create_lecture_embed(subjec... |
"""Implements the elements of a momilp problem"""
import abc
from enum import Enum
import math
import numpy as np
def point_on_ray_in_two_dimension(point, ray, tol=1e-4):
"""Returns True of the point is on the ray with the specified error tolerance, False otherwise"""
tan_of_ray = math.tan(math.radians(ray.a... |
# -*- coding: utf-8 -*-
#
# django-codenerix
#
# Copyright 2017 Centrologic Computational Logistic Center S.L.
#
# Project URL : http://www.codenerix.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... |
import os
import re
import itertools
import subprocess
from time import sleep
from datetime import datetime, date
from random import shuffle
from slackclient import SlackClient
from .command import Command
from .state import State
from .lookup import Lookup
from .constants import *
from .scores import Scores
from .con... |
# -*- coding: utf-8 -*-
import os, sys, platform, json, requests, psutil, time
from flask import request
c0 , c1 , c2 , c3 , c4 , c5 = 0, 0, 0, 0, 0, 0
r0 , r1 , r2 , r3 , r4 , r5 = 0, 0, 0, 0, 0, 0
s0 , s1 , s2 , s3 , s4 , s5 = 0, 0, 0, 0, 0, 0
rxa, txa = 0, 0
tim = time.time()
def get_static_info():
print("Gath... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from matplotlib.animation import FuncAnimation, PillowWriter
import matplotlib.patches as mpatches
from matplotlib.legend_handler import HandlerPatch, HandlerCircleCollection
import pandas as pd
from mpl_toolkits.mplot3d import Ax... |
# telegram modules
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from telegram import InlineQueryResultArticle, InputTextMessageContent
from telegram.ext import InlineQueryHandler
import logging
# other modules
#from googlesearch import search # pip3 install google
from new... |
# -*- coding: utf-8 -*-
"""
Utilities for working with related individuals (crosses, families, etc.).
See also the examples at:
- http://nbviewer.ipython.org/github/alimanfoo/anhima/blob/master/examples/ped.ipynb
""" # noqa
from __future__ import division, print_function, absolute_import
# third party dependenc... |
from sklearn.linear_model import LogisticRegression
import os
import pickle
import json
import sys
import pandas as pd
import numpy as np
from sklearn.metrics import f1_score, precision_score, recall_score, accuracy_score
from data_processing.dim_mapping_v2 import dim2emo
import utils
VEC_PATH = '../../../resources/'
... |
from copy import deepcopy
from glob import glob
from os.path import abspath, basename, dirname, join
import numpy as np
import pytest
from mock import patch
import robogym.utils.rotation as rotation
from robogym.envs.rearrange.blocks import make_env as make_blocks_env
from robogym.envs.rearrange.blocks_reach import m... |
import contextlib
import copy
from functools import partial
with contextlib.redirect_stdout(None): # Suppress Hello from Pygame community message
import pygame # Warm hello back to the Pygame community by the way.
# Define some colors
LIGHTGRAY = (192, 192, 192)
GRAY = (128, 128, 128)
DARKGRAY = (45, 45, 45)
N... |
# Developer(s) - <NAME> and <NAME>
# Project Name - Lucifer-The-Ultimate-A.I.(Desktop Assistant)
# Language Used - Python
import pyttsx3 # pip install pyttsx3
import speech_recognition as sr # pip install speechRecognition
import datetime
import os
import pywhatkit # pip install pywhatkit
import requests ... |
# -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder Language Server Protocol Client implementation.
This client implements the calls and procedures required to
communicate with a v3.0 Language Server Protoco... |
"""
strategy_overlay.py
"""
import pandas as pd
import numpy as np
# my modules
from dataframe_tools import merge_two_dataframes_as_of
from financial_analysis.finance_tools import convert_daily_return_to_daily_price_df, realized_volatility, beta
from database.financial_database import FinancialDatabase
from database.... |
"""
get_clipboard_text(): Returns text in clipboard
"""
from __future__ import print_function
import random
import os
import platform
import re
import json
import string
import sys
from threading import Thread, BoundedSemaphore
import collections
import tkinter as tk
# from tkinter import ttk
import subprocess
from pat... |
""" This module defines the functions that generate the burst train """
import numpy as np
from settle import settle
import random
import matplotlib.pyplot as plt
def mean_flux(t1, t2, tobs, a, b):
# Calculates the mean flux between t1 and t2 from the piecewise linear
# interpolation of tobs,a,b
na = le... |
"""CS1 Final Optional Part C2 | <NAME>
This Module runs a game of Cribbage Soletaire as in final_partB,
but using tkinter to make a GUI. Runs the game for a user and a
random deck only.
Includes a CribbageSolitaireGUI class that inherits from
CribbageSolitaire layed out in final_partB and includes methods to
display ... |
# coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import collections
import os
import time
import math
import json
import six
import random
import gc
impor... |
# coding=utf-8
# !/usr/bin/python3.6 ## Please use python 3.6
"""
__synopsis__ : Class to process and load pretrained models.
__description__ : Class to process and load pretrained models.
__project__ : XCGCN
__author__ : <NAME> <<EMAIL>>
__version__ : ": 0.1 "
__date__ : "08-11-2018"
__copyrigh... |
from collections import OrderedDict
from tempfile import TemporaryDirectory
from typing import (
Tuple,
Union,
List,
Iterable,
Dict,
Any,
Type,
Callable,
Optional,
Sequence,
)
import numpy as np
import torch
from nebullvm import optimize_torch_model
from nebullvm.api.frontend.u... |
import logging
import json
from twisted.python import failure
from twisted.internet import error, defer
from twisted.internet.protocol import Protocol, ServerFactory
from lbrynet.core.utils import is_valid_blobhash
from lbrynet.core.Error import DownloadCanceledError, InvalidBlobHashError, NoSuchSDHash
from lbrynet.cor... |
import pickle
import os
from PIL import Image
import math
import shutil
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
class ConvNet2(nn.Module):
def __init__(self):
super().__init__()
# (3,32,32)
self.conv1 = nn.Sequ... |
'''游戏主体逻辑
'''
import sys
import json
import random
from PlayerLegality.player_legality import Parser
from StateSystem.StateSystem import StateSystem
DEBUG = False # DEBUG时会生成一个log.txt记录logic收发的信息
MAX_ROUND = 100
AI_TIME = 3
PLAYER_TIME = 300
def logic_convert_byte(data_str, send_goal):
'''传输数据的... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import glob
import itertools
import os
import random
import warnings
from builtins import FileNotFoundError
from collections import defaultdict
from itertools import filterfalse
import numpy as np
import torch
from PIL import Image
from toolz im... |
"""API for the Sheets app"""
import os
import json
import datetime
import pickle
import logging
from collections import namedtuple
from urllib.parse import urljoin
from django.conf import settings
from django.db import transaction
from django.core.exceptions import ImproperlyConfigured
import pygsheets
from google.oa... |
from math import ceil
from os import getcwd, listdir, path
from os.path import isdir, isfile, join
from platform import system
from re import search, match
from sys import exit as sys_exit, argv
from threading import Thread
from time import sleep, time
from typing import List, Tuple, Optional, Union
import pexpect
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.