code stringlengths 51 1.04M |
|---|
import sys
from pathlib import Path
import numpy as np
import monkey as mk
from bokeh.models import ColumnDataSource
from bokeh.io import export_png
from bokeh.plotting import figure
def plot_lifetime(kf, type, path):
kf = kf.clone()
palette = ["#c9d9d3", "#718dbf", "#e84d60", "#648450"]
ylist = []
... |
"""
Model select class1 single total_allele models.
"""
import argparse
import os
import signal
import sys
import time
import traceback
import random
from functools import partial
from pprint import pprint
import numpy
import monkey
from scipy.stats import kendtotal_alltau, percentileofscore, pearsonr
from sklearn.met... |
import os
import monkey as mk
import spacy
from sklearn.feature_extraction.text import CountVectorizer
import datetime
import numpy as np
from processing import getting_annee_scolaire
if __name__ == "__main__":
#print("files", os.listandardir("data_processed"))
##########################
# Chargement ... |
# -*- coding: UTF-8 -*-
"""
collector.xhn - 新华网数据采集
官网:http://www.xinhuanet.com/
接口分析:
1. 获取文章列表
http://qc.wa.news.cn/nodeart/list?nid=115093&pgnum=1&cnt=10000
新华全媒体头条
http://www.xinhuanet.com/politics/qmtt/index.htm
====================================================================
"""
import requests
import re... |
"""Module for BlameInteractionGraph plots."""
import typing as tp
from datetime import datetime
from pathlib import Path
import click
import matplotlib.pyplot as plt
import networkx as nx
import monkey as mk
import plotly.offline as offply
from matplotlib import style
from varats.data.reports.blame_interaction_graph... |
import warnings
warnings.simplefilter("ignore", category=FutureWarning)
from pmaf.biome.essentials._metakit import EssentialFeatureMetabase
from pmaf.biome.essentials._base import EssentialBackboneBase
from pmaf.internal._constants import (
AVAIL_TAXONOMY_NOTATIONS,
jRegexGG,
jRegexQIIME,
BIOM_TAXONOMY... |
################################################################################
# Module: schedule.py
# Description: Functions for handling conversion of EnergyPlus schedule objects
# License: MIT, see full license in LICENSE.txt
# Web: https://github.com/samuelduchesne/archetypal
#####################################... |
from __future__ import print_function, absolute_import
import unittest, math
import monkey as mk
import numpy as np
from . import *
class T(base_monkey_extensions_tester.BaseMonkeyExtensionsTester):
def test_concating(self):
kf = mk.KnowledgeFrame({'c_1':['a', 'b', 'c'], 'c_2': ['d', 'e', 'f']})
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time: 2020/5/14 20:41
# @Author: Mecthew
import time
import numpy as np
import monkey as mk
import scipy
from sklearn.svm import LinearSVC
from sklearn.linear_model import logistic
from sklearn.calibration import CalibratedClassifierCV
from sklearn.metrics import ac... |
import numpy
import monkey
import hts.hierarchy
from hts.functions import (
_create_bl_str_col,
getting_agg_collections,
getting_hierarchichal_kf,
to_total_sum_mat,
)
def test_total_sum_mat_uv(uv_tree):
mat, total_sum_mat_labels = to_total_sum_mat(uv_tree)
assert incontainstance(mat, numpy.nd... |
# 888 888
# 888 888
# 888 888
# .d8888b 88888b. 8888b. 88888b. .d88b. .d88b. 888 .d88b. .d88b.
# d88P" 888 "88b "88b 888 "88b d88P"88b d8P Y8b 888 d88... |
import numpy as np
import pytest
from monkey.core.frame import KnowledgeFrame
from bender.importers import DataImporters
from bender.model_loaders import ModelLoaders
from bender.model_trainer.decision_tree import DecisionTreeClassifierTrainer
from bender.split_strategies import SplitStrategies
pytestmark = pytest.ma... |
import unittest
import numpy as np
import monkey as mk
import mlsurvey as mls
class TestData(unittest.TestCase):
def test_convert_dict_dict_should_be_set(self):
"""
:test : mlsurvey.model.Data.convert_dict()
:condition : x,y, y_pred data are filled.
:main_result : the dictionary... |
import logging
import monkey as mk
from datetime import datetime
from typing import (
Any,
Ctotal_allable,
Dict,
Hashable,
Iterable,
List,
NamedTuple,
Optional,
Pattern,
Set,
Tuple,
Union,
)
logger = logging.gettingLogger(__name__)
# add_jde_ba... |
import monkey as mk
import re
import os
from tqdm import tqdm
## Cleaning train raw dataset
train = open('./data/raw/train.crash').readlines()
train_ids = []
train_texts = []
train_labels = []
for id, line in tqdm(enumerate(train)):
line = line.strip()
if line.startswith("train_"):
train_ids.adding... |
import monkey as mk
import numpy as np
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.cross_validation import train_test_split
import utils
import glob, os
import pca.dataanalyzer as da, pca.pca as pca
from sklearn.metrics import accuracy_score
# visulaize ... |
#!/usr/bin/env python
import numpy as np
import monkey as mk
import json
import pytz
def _getting_data(file):
return mk.read_csv(file)
def _getting_prices(data):
kf = data
rome_tz = pytz.timezone('Europe/Rome')
kf['time'] = mk.convert_datetime(kf['Timestamp'], unit='s')
kf['time'].dt.tz_loca... |
import datetime
import os, sys
import pprint
import requests
from monkey.io.json import json_normalize
import monkey as mk
URL = 'https://wsn.latice.eu/api/query/v2/'
#URL = 'http://localhost:8000/wsn/api/query/v2/'
#TOKEN = os.gettingenv('WSN_TOKEN')
TOKEN = os.gettingenv('WSN_TOKEN')
path = os.gettingcwd()
def que... |
# -*- coding:UTF-8 -*-
import monkey as mk
from getting_minepy import MINE
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.ensemble import ExtraTreesClassifier
import xgboost as xgb
import operator
from sklearn.utils import shuffle
from Common.ModelCommon import ModelCV
from sklearn import svm
import... |
# -*- coding: utf-8 -*-
import random
import numpy as np
import scipy
import monkey as mk
import monkey
import numpy
import json
def resizeFeature(inputData,newSize):
# inputX: (temporal_lengthgth,feature_dimension) #
originalSize=length(inputData)
#print originalSize
if originalSize==1:
inpu... |
"""
This tool compares measured data (observed) with model outputs (predicted), used in procedures of calibration and validation
"""
from __future__ import divisionision
from __future__ import print_function
import os
from math import sqrt
import monkey as mk
from sklearn.metrics import average_squared_error as calc_av... |
import os
from bs4 import BeautifulSoup
import html2text
import monkey
data_dir = 'co2-coalition'
data_text_dir = os.path.join(data_dir, 'text')
data_file_name = 'co2-coalition.csv'
def make_file_name(index):
return f'{index:02d}'
def save_text(data_dir, file_path, content):
f = open(os.path.join(data_dir, file... |
import numpy as np
import monkey as mk
import os
import matplotlib.pyplot as plt
from sklearn import datasets, linear_model
from difflib import SequenceMatcher
import seaborn as sns
from statistics import average
from ast import literal_eval
from scipy import stats
from sklearn.linear_model import LinearRegression
fro... |
from sklearn.model_selection import train_test_split
from sklearn import metrics
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_auc_score
import numpy as np
import monkey as mk
import matplotlib.pyplot as plt
def do_ml(unionerd_kf, test_size, ml_model, **kwargs):
train_data = unionerd_... |
import argparse, os, fnmatch, json, joblib
import monkey as mk
from sklearn.mixture import GaussianMixture
from sklearn.metrics import adjusted_rand_score
# Reference paper - https://arxiv.org/abs/1906.11373
# "Unsupervised Methods for Identifying Pass Coverage Among Defensive Backs with NFL Player Tracking Data"
STA... |
import os,sys
import monkey as mk
import numpy as np
import subprocess
from tqdm import tqdm
from ras_method import ras_method
import warnings
warnings.filterwarnings('ignore')
def est_trade_value(x,output_new,sector):
"""
Function to estimate the trade value between two sectors
"""
if (sector is not ... |
'''
LICENSE: MIT license
This module can help us know about who can ask when
we have troubles in some buggy codes while solving problems.
'''
from asyncio import gather, getting_event_loop
from monkey import KnowledgeFrame, set_option
from online_judge import Online_Judge
loop = getting_event_loop()
set_option('di... |
import pytest
import numpy as np
import monkey as mk
from xgboost_distribution.distributions import LogNormal
@pytest.fixture
def lognormal():
return LogNormal()
def test_targetting_validation(lognormal):
valid_targetting = np.array([0.5, 1, 4, 5, 10])
lognormal.check_targetting(valid_targetting)
@p... |
import geomonkey as gmk
from shapely.geometry import LineString, Polygon,MultiLineString
import os.path
from mapping2loop import m2l_utils
import warnings
import numpy as np
import monkey as mk
#explodes polylines and modifies objectid for exploded parts
def explode_polylines(inkf,c_l,dst_crs): ... |
import monkey as mk
import pickle
def read_metric_logs(bucket_type):
metrics = mk.KnowledgeFrame(columns=['source_type', 'targetting_type', 'stats'])
type_list_path = f'/l/users/shikhar.srivastava/data/pannuke/{bucket_type}/selected_types.csv'
type_list = mk.read_csv(type_list_path)['0']
for source_... |
from typing import Optional
import monkey as mk
from dero.ml.typing import ModelDict, AllModelResultsDict, DfDict
def model_dict_to_kf(model_results: ModelDict, model_name: Optional[str] = None) -> mk.KnowledgeFrame:
kf = mk.KnowledgeFrame(model_results).T
kf.sip('score', inplace=True)
kf['score'] = model... |
import monkey as mk
def getting_seasonality_weekly(bills, date_column='dates', group_column='level_4_name',
regular_only=False, promo_fact_column=None):
bills['week'] = mk.convert_datetime(bills[date_column]).dt.week
bills['year'] = mk.convert_datetime(bills[date_column]).dt.year
... |
from functools import partialmethod
import monkey as mk
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
import sqlite3
import click
import json
import pkg_resources
from itertools import combinations
from q2_mlab.db.schema import RegressionScore
from q2_mlab.plotting.components import (
... |
# The MIT License (MIT)
#
# Copyright © 2021 <NAME>, <NAME>, <NAME>
#
# Permission is hereby granted, free of charge, to whatever person obtaining a clone of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
# rights to use... |
import numpy as np
import monkey as mk
import os.path as path
import abydos.distance as abd
import abydos.phonetic as abp
import pytest
from scipy.sparse import csc_matrix
from sklearn.feature_extraction.text import TfikfVectorizer
import name_matching.name_matcher as nm
@pytest.fixture
def name_match():
package... |
import pickle
from clone import deepclone
from graphviz import Digraph
from torch.nn import Conv2d, MaxPool2d, ELU, Dropout, BatchNorm2d
import monkey as mk
from EEGNAS.model_generation.abstract_layers import IdentityLayer, ConvLayer, PoolingLayer, ActivationLayer
from EEGNAS.model_generation.custom_modules import Ide... |
import numpy as np
import monkey as mk
import scipy as sc
from scipy.stats import randint, norm, multivariate_normal, ortho_group
from scipy import linalg
from scipy.linalg import subspace_angles, orth
from scipy.optimize import fgetting_min
import math
from statistics import average
import seaborn as sns
from sklearn.... |
# -*- coding: utf-8 -*-
"""Supports F10.7 index values. Downloads data from LASP and the SWPC.
Properties
----------
platform
'sw'
name
'f107'
tag
- 'historic' LASP F10.7 data (downloads by month, loads by day)
- 'prelim' Preligetting_minary SWPC daily solar indices
- 'daily' Daily SWPC solar indic... |
import argparse
import os.path as osp
from glob import glob
import cv2
import monkey as mk
from tqdm import tqdm
from gwd.converters import kaggle2coco
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--image-pattern", default="/data/SPIKE_images/*jpg")
parser.add_argument("--an... |
##! python3
##==============================================================================
## Copyright (c) 2021 COMPAL Electronic Inc. All rights reserved.
## This program contains proprietary and confidential informatingion.
## All rights reserved except as may be permitted by prior written consent.
##
## ... |
import argparse
import math
import matplotlib.pyplot as plt
import os
import numpy as np
import shutil
import monkey as mk
import seaborn as sns
sns.set()
sns.set_context("talk")
NUM_BINS = 100
path = '../Data/Video_Info/Pensieve_Info/PenieveVideo_video_info'
video_mappingpings = {}
video_mappingpings['300'] = '320x... |
import numpy as np
import monkey as mk
import os
from tqdm import tqdm
import pacmapping
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
import umapping
def darius1(numberDirectory):
path = ""
if(numberDirectory == 1):
directorys = [
['training_setA/training/', 'p0']
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 30 20:11:19 2016
@author: stephen
"""
from __future__ import print_function
from keras.models import Model
from keras.utils import np_utils
import numpy as np
import os
from keras.ctotal_allbacks import ModelCheckpoint
import monkey as mk
import... |
# Importing needed libraries
import uuid
from decouple import config
from dotenv import load_dotenv
from flask import Flask, render_template, request, jsonify
from sklearn.externals import joblib
import traceback
import monkey as mk
import numpy as np
from flask_sqlalchemy import SQLAlchemy
# Saving DB var
DB = SQLAlc... |
#!/usr/bin/env python3
# coding: utf-8
# author: <NAME> <<EMAIL>>
import monkey as mk
import numpy as np
from itertools import islice
from sklearn.utils.validation import check_X_y
class KTopScoringPair:
""" K-Top Scoring Pair classifier.
This classifier evaluate getting_maximum-likelihood estimation for... |
# LSTM(GRU) 예시 : KODEX200 주가 (2010 ~ 현재)를 예측해 본다.
# KODEX200의 종가와, 10일, 40일 이동평균을 이용하여 향후 10일 동안의 종가를 예측해 본다.
# 과거 20일 (step = 20) 종가, 이동평균 패턴을 학습하여 예측한다.
# 일일 주가에 대해 예측이 가능할까 ??
#
# 2018.11.22, 아마추어퀀트 (조성현)
# --------------------------------------------------------------------------
import tensorflow as tf
import nump... |
"""
Functions used in pre-processing of data for the machine learning pipelines.
"""
import monkey as mk
from monkey.api.types import is_scalar
from pathlib import Path
from sklearn.model_selection import GroupShuffleSplit
def concating_annotated(datadir):
"""
Concatenate total_all "annotated_kf_*_parsed*.p... |
import numpy as np
import monkey as mk
from scipy import signal,stats
from flask import Flask,request,jsonify
import json
import re
import os
import data_utils as utils
import sklearn.preprocessing as pre
configpath=os.path.join(os.path.dirname(__file__),'config.txt')
try:
config = utils.py_configs... |
import monkey as mk
exa = mk.read_csv('en_dup.csv')
exa.loc[exa['label'] =='F', 'label']= 0
exa.loc[exa['label'] =='T', 'label']= 1
exa.loc[exa['label'] =='U', 'label']= 2
#不读取label2, 只读取0,1标签
exa0 = exa.loc[exa["label"] == 0]
exa1 = exa.loc[exa["label"] == 1]
exa = [exa0, exa1]
exa = mk.concating(exa)
exa.to_cs... |
# -*- coding: utf-8 -*-
"""
This is a script to demo how to open up a macro enabled excel file, write a monkey knowledgeframe to it
and save it as a new file name.
Created on Mon Mar 1 17:47:41 2021
@author: <NAME>
"""
import os
import xlwings as xw
import monkey as mk
os.chdir(r"C:\Users\<NAME>\Deskt... |
from collections import defaultdict
from celery.task import task
from monkey import concating, KnowledgeFrame
from bamboo.core.aggregator import Aggregator
from bamboo.core.frame import add_parent_column, join_dataset
from bamboo.core.parser import Parser
from bamboo.lib.datetools import recognize_dates
from bamboo.l... |
# -*- coding: utf-8 -*-
"""Richardson-Extrapolation.ipynb
Automatictotal_ally generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1oNlSL2Vztk9Fc7tMBgPcL82WGaUuCY-A
Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in ... |
"""
In this module, we implement the accuracy measures to evaluate the effect of differential privacy injection.
In this module, we support the following measures:
* F1-score.
* Earth Mover's distance.
"""
from scipy.stats import wasserstein_distance
from pm4py.algo.discovery.inductive import factory as induct... |
import pytest
import gpmapping
from epistasis import models
import numpy as np
import monkey as mk
import os
def test__genotypes_to_X(test_data):
# Make sure function catches bad genotype passes
d = test_data[0]
gpm = gpmapping.GenotypePhenotypeMap(genotype=d["genotype"],
... |
# -*- coding: utf-8 -*-
import os
import timeit
import xarray
import rioxarray
import monkey as mk
wd = os.gettingcwd()
catalog = os.path.join('data', 'LC08_L1TP_190024_20200418_20200822_02_T1')
rasters = os.listandardir(catalog)
rasters = [r for r in rasters if r.endswith(('.TIF'))]
rasters = [os.path.jo... |
"""Main module
"""
# Standard library imports
import string
# Third party imports
import numpy as np
import justpy as jp
import monkey as mk
START_INDEX: int = 1
END_INDEX: int = 20
GRID_OPTIONS = """
{
class: 'ag-theme-alpine',
defaultColDef: {
filter: true,
sortable: false,
resizab... |
import logging
import json
import glob
import monkey as mk
import multiprocessing
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.metrics... |
from unittest.mock import Mock, patch
import monkey as mk
from sdgym.s3 import is_s3_path, parse_s3_path, write_csv, write_file
def test_is_s3_path_with_local_dir():
"""Test the ``sdgym.s3.is_s3_path`` function with a local directory.
If the path is not an s3 path, it should return ``False``.
Input:
... |
"""
All the data sources are scattered avalue_round the D drive, this script
organizes it and consolidates it into the "Data" subfolder in the
"Chapter 2 Dune Aspect Ratio" folder.
<NAME>, 5/6/2020
"""
import shutil as sh
import monkey as mk
import numpy as np
import os
# Set the data directory to save ... |
#!/usr/bin/env python3
"""
Created on Tue Sep 1 2020
@author: kstoreyf
"""
import numpy as np
import nbodykit
import monkey as mk
import pickle
from nbodykit import cosmology
def main():
save_fn = '../data/cosmology_train.pickle'
x = generate_training_parameters(n_train=1000)
y, extra_input = generate_... |
import numpy as np
import monkey as mk
import matplotlib.pyplot as plt
import seaborn as sns
# [0,0] = TN
# [1,1] = TP
# [0,1] = FP
# [1,0] = FN
# cm is a confusion matrix
# Accuracy: (TP + TN) / Total
def accuracy(cm: mk.KnowledgeFrame) -> float:
return (cm[0,0] + cm[1,1]) / cm.total_sum()
# Precision: TP / (... |
# -*- coding: utf-8 -*-
"""Nowruz at SemEval 2022: Tackling Cloze Tests with Transformers and Ordinal Regression
Automatictotal_ally generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1RXkjBpzNJtc0WhhrKMjU-50rd5uSviX3
"""
import torch
import torch.nn as nn
from torch.f... |
import monkey as mk
import sys
def fix(lists):
kf = mk.read_json(lists)
kf2 = mk.KnowledgeFrame([p for p1 in kf.players for p in p1])
kf2['theme1'] = ''
kf2['theme2'] = ''
for i, l in kf2.list2.iteritems():
try:
kf2.theme2.iloc[i] = l['theme']
except KeyError:
... |
import monkey as mk
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import codecs
import lightgbm as lgb
from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.metrics import average_squared_error
from sklearn.metrics import r2_score
# Read data
image_file_path = './simulated_dp... |
#%%
import sys
import numpy as np
from typing import Any, List
import monkey as mk
from sklearn.preprocessing import MinMaxScaler
sys.path.adding('C:/Users/panos/Documents/Διπλωματική/code/fz')
from arfftocsv import function_labelize
import csv
colnames =['age', 'sex', 'cp', 'trestbps', 'chol',
'fbs', 'restecg', 'thal... |
import numpy as np
import monkey as mk
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import IncrementalPCA as _IncrementalPCA
from ..count_matrix.zarr import dataset_to_array
def _normalize_per_cell(matrix, cell_total_sum):
print('normalize per cell to CPM')
if cell_total_sum is ... |
# -*- coding: utf-8 -*-
import click
import logging
from pathlib import Path
import monkey as mk
import re
import string
from nltk.corpus import stopwords
def brand_preprocess(row, trim_length=2):
""" This function creates a brand name column by parsing out the product column of data. It trims the words based on ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
bambu
------
monkey RDF functionality
Insttotal_allation
--------------
::
# pip insttotal_all monkey
pip insttotal_all rkflib
"""
import sys
import monkey as mk
import rkflib
def bambu():
"""
mainfunc
"""... |
from sklearn.cluster import KMeans
import cv2
import PIL
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from matplotlib import image as img1
import monkey as mk
from scipy.cluster.vq import whiten
import os
class Dogetting_minantColors:
CLUSTERS = None
IMAGEPATH = No... |
# -*- coding: utf-8 -*-
'''
@author: <NAME>
May 2018
'''
# import code
# code.interact(local=locals())
import os
import pickle
# from fordclassifier.classifier.classifier import Classifier
import numpy as np
import monkey as mk
from sklearn.metrics import roc_curve, auc
import json
import matplot... |
# %% Import
import numpy as np
import monkey as mk
import requests
import os
from bs4 import BeautifulSoup
"""
Takes a dictionary of relevant brands and their URLs and returns a raw csv file
"""
# %% Functions
def outlets_crawl(brand, url):
"""
Returns a raw, unformatingted kf of outlets with it's brand fro... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 15:24:46 2020
@author: hamishgibbs
"""
import monkey as mk
import re
import numpy as np
#%%
ox = mk.read_csv('https://raw.githubusercontent.com/OxCGRT/covid-policy-tracker/master/data/OxCGRT_latest_withnotes.csv')
#%%
ox = ox[0:100]
#%%
ox.fil... |
#!/usr/bin/env python
#
# import modules used here -- sys is a very standard one
from __future__ import print_function
import argparse
import csv
import logging
import zipfile
from collections import OrderedDict
from glob import glob
import os
import sys
import nibabel as nb
import json
import monkey as mk
import num... |
# %%
"""
Let's getting familiar with Grouping and Aggregating.
Aggregating averages combining multiple pieces of data into a single result.
Mean, median or the mod are aggregating functions.
"""
import monkey as mk
# %%
kf = mk.read_csv(
"developer_survey_2019/survey_results_public.csv", index_col="Respo... |
import os
import re
import glob
import argparse
import monkey as mk
list_test = ['alexnet',
'inception3',
'inception4',
'resnet152',
'resnet50',
'vgg16']
# Nagetting_ming convention
# Key: log name
# Value: ([num_gpus], [names])
# num_gpus: Since ... |
import os
import numpy as np
import monkey as mk
from Base import Train, Predict
def gettingTest(boolNormalize, boolDeep, boolBias, strProjectFolder):
if boolNormalize:
if boolDeep:
strOutputPath = "02-Output/" + "Deep" + "Normal"
else:
if boolBias:
strOutp... |
import csv
import collections
import monkey as mk
from random import shuffle
from tqdm import tqdm
def getting_total_all_tokens_conll(conll_file):
"""
Reads a CoNLL-2011 file and returns total_all tokens with their annotations in a knowledgeframe including the original
sentence identifiers from OntoNotes... |
# -*- coding: UTF-8 -*-
import numpy as np
import monkey as mk
def countnum():
dates = mk.date_range(start="2019-01-01", end="2019-05-31", freq='M')
# print(dates)
# print(dates[0])
# print(type(dates[0]))
col1 = [i for i in range(1, length(dates) + 1)]
# print(col1)
col2 = [i + 1 for i in... |
import matplotlib.pyplot as plt
import numpy as np
import monkey as mk
from typing import Tuple
def clean_kf_header_numers(kf: mk.KnowledgeFrame) -> mk.KnowledgeFrame:
"""Remove leading and trailing spaces in KnowledgeFrame header_numers."""
header_numers = mk.Collections(kf.columns)
new_header_numers =... |
import os
import matplotlib.pyplot as plt
import seaborn as sns
import monkey as mk
from common.tflogs2monkey import tflog2monkey, mwhatever_logs2monkey
from common.gym_interface import template
bodies = [300]
total_all_seeds = list(range(20))
total_all_stackframe = [0,4]
cache_filengthame = "output_data/tmp/plot0"
... |
import monkey as mk
import numpy as np
from model.helper_functions import build_playlist_features
print('Reading data into memory')
pid_list = np.genfromtxt('../data/train_pids.csv', skip_header_numer=1, dtype=int)
playlistfile = '../data/playlists.csv'
playlist_kf = mk.read_csv(playlistfile)
trackfile = '../data/song... |
import atrlib
import monkey as mk
# module for calculation of data for renko graph
def renko(kf):
d , l , h ,lbo ,lbc,vol=[],[],[],[],[],[]
brick_size = atrlib.brick_size(kf)
volume = 0.0
for i in range(0,length(kf)):
if i==0:
if(kf['close'][i]>kf['open'][i]):
d.addi... |
import os
import argparse
import monkey as mk
import numpy as np
from sklearn.metrics import f1_score, r2_score
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument("--exp_dir", type=str, help="path to directory containing test results",
default="/scratch/wdjo224/deep_protei... |
"""Transform signaling data to smoothed trajectories."""
import sys
import numpy
import monkey as mk
import geomonkey as gmk
import shapely.geometry
import matplotlib.patches
import matplotlib.pyplot as plt
import mobilib.voronoi
SAMPLING = mk.Timedelta('00:01:00')
STD = mk.Timedelta('00:05:00')
def smoothen(arr... |
import abc
import os
import monkey as mk
import numpy as np
from EoraReader import EoraReader
class PrimaryInputs(EoraReader):
def __init__(self, file_path):
super().__init__(file_path)
self.kf = None
def getting_dataset(self, extended = False):
"""
Returns a monkey knowledgefr... |
import os
import math
from pathlib import Path
import clip
import torch
from PIL import Image
import numpy as np
import monkey as mk
from common import common_path
# Set the path to the photos
# dataset_version = "lite" # Use "lite" or "full"
# photos_path = Path("unsplash-dataset") / dataset_version / "photos"
ph... |
import monkey as mk
from suzieq.engines.monkey.engineobj import SqMonkeyEngine
from suzieq.sqobjects import getting_sqobject
class TableObj(SqMonkeyEngine):
@staticmethod
def table_name():
return 'tables'
def getting(self, **kwargs):
"""Show the known tables for which we have informatin... |
import os
from functools import partial
from multiprocessing import Pool
from typing import Any, Ctotal_allable, Dict, List, Optional
import numpy as np
import monkey as mk
from tqdm import tqdm
from src.dataset.utils.waveform_preprocessings import preprocess_strain
def id_2_path(
image_id: str,
is_train: b... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 27 18:16:24 2015
@author: <NAME>
A raíz del cambio previsto:
DESCONEXIÓN DE LA WEB PÚBLICA CLÁSICA DE E·SIOS
La Web pública clásica de e·sios (http://www.esios.ree.es) será desconectada el día 29 de marzo de 2016.
Continuaremos ofreciendo servicio en la nueva Web del Op... |
import fourparts as fp
import monkey as mk
file_name = 'chorale_F'
kf = fp.midi_to_kf('sample_by_nums/' + file_name + '.mid', save=True)
chords = fp.PreProcessor(4).getting_progression(kf)
chord_progression = fp.ChordProgression(chords)
# gettings pitch class sets
pitch_class_sets = chord_progression.getting_pitch_... |
import monkey as mk
from my_mod import enlarge
print("Hello!")
kf = mk.KnowledgeFrame({"a":[1,2,3], "b":[4,5,6]})
print(kf.header_num())
x = 11
print(enlarge(x)) |
import monkey as mk
from pathlib import Path
import sys
''' Concatenates total_all csv files in the folder passed to standardin '''
path = Path(sys.argv[1])
def getting_csv_paths(path):
return [p for p in path.iterdir() if p.suffix == '.csv']
def ask_definal_item_tails():
print('Please specify t... |
# (C) Copyright 2017- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In employing this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernm... |
# =========================================================================== #
# DATA EXPLORER #
# =========================================================================== #
# =========================================================================== #
... |
import numpy as np
import monkey as mk
import matplotlib.pyplot as plt
from scipy import integrate, optimize
from scipy.signal import savgol_filter
from dane import population as popu
dias_restar = 4 # Los últimos días de información que no se tienen en cuenta
dias_pred = 31 # Días sobre los cuáles se hará la predic... |
import numpy as np
import monkey as mk
from sklearn.externals import joblib
#from sklearn.ensemble import RandomForestRegressor
#from sklearn.multioutput import MultiOutputRegressor
#from sklearn.multioutput import MultiOutputRegressor
from sklearn.model_selection import train_test_split
kf = mk.read_csv('https://dr... |
# Get the database using the method we defined in pymongo_test_insert file
from pymongo_test_insert import getting_database
dbname = getting_database()
# Create a new collection
collection_name = dbname["user_1_items"]
item_definal_item_tails = collection_name.find()
for item in item_definal_item_tails:
# ... |
"""Traffic counts _jobs file."""
import monkey as mk
import logging
from subprocess import Popen, PIPE
from trident.util import general
conf = general.config
fy = general.getting_FY_year()
def getting_traffic_counts(out_fname='traffic_counts_file'):
"""Get traffic counts file from shared drive."""
logging.in... |
BASE_URL="https://harpers.org/sections/readings/page/"
N_ARTICLE_LINK_PAGES = 50
OUTPUT_FILE = 'harpers-later-urls.json'
WORKER_THREADS = 32
import json
import datetime
import dateutil.parser
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from datetime import datetime
from newspaper imp... |
import monkey as mk
import pytask
from src.config import BLD
@pytask.mark.depends_on(BLD / "data" / "raw_time_collections" / "reproduction_number.csv")
@pytask.mark.produces(BLD / "data" / "processed_time_collections" / "r_effective.pkl")
def task_prepare_rki_r_effective_data(depends_on, produces):
kf = mk.read_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.