text stringlengths 3.07k 12.6k |
|---|
"""
Read Alise's training and testing data files and smash them all into one H5 file.
This script is hard-coded to run on ocelote.
"""
import itertools
import os
import time
import h5py
import numpy as np
# 500, 1000, 5000pb
# Phage, Proc
# 4, 6, 8 mers
# kmer_file1.fasta.tab, kmer_file2.fasta.tab, ..., kmer_file10... |
# coding: utf-8
import os
import pytest
from Ensemble_Analyses import EnsembleAnalyses
from Ensemble_Analyses import grdc_metadata_reader
forecast_data = os.path.join(os.path.dirname(__file__), "forecast_data")
grdc_data = os.path.join(os.path.dirname(__file__), "grdc_data")
def test_set_directories():
data = E... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 27 14:38:30 2020
Implementation of Unit Test for L Test
@author: khawaja
"""
import os
import numpy
import unittest
import xml.etree.ElementTree as ET
import datetime
from csep.core.poisson_evaluations import _number_test_ndarray, _w_test_ndarray, _... |
#!/usr/bin/env python3
import collections
import ctypes
import multiprocessing
import multiprocessing.managers
import multiprocessing.shared_memory
import textwrap
import threading
import time
import numpy as np
from caproto.server import PVGroup, ioc_arg_parser, pvproperty, run
UPDATE_PERIOD_SEC = 0.001
IMAGE_DTYP... |
from operator import ne
from typing import List, Dict
from hwt.code import Concat, And, Or
from hwt.code_utils import _mkOp
from hwt.math import isPow2, log2ceil
from hwt.synthesizer.rtlLevel.rtlSignal import RtlSignal
def parity(bit_vector):
return _mkOp(ne)(*bit_vector)
# https://chipress.co/2019/07/09/how-t... |
import yaml
# Assumes this is ran from the root of the repository
file_path = "./bin/GameIndex.yaml"
# These settings have to be manually kept in sync with the emulator code unfortunately.
# up to date validation should ALWAYS be provided via the application!
allowed_game_options = [
"name",
"region",
"co... |
# -*- coding: utf-8 -*-
"""Stats based utils"""
__author__ = "<NAME>"
__copyright__ = "MIT"
import pandas as pd
import numpy as np
from scipy import stats
import scipy
from sklearn.metrics import roc_curve
import matplotlib.pyplot as plt
import json
# AUC comparison from <NAME>
# https://github.com/yandexdataschool/... |
from __future__ import annotations
from typing import Any, Callable, Dict, List, Mapping, Optional, Union
import xarray as xr
from .base import BaseSchema, SchemaError
from .components import (
ArrayTypeSchema,
AttrsSchema,
ChunksSchema,
DimsSchema,
DTypeSchema,
NameSchema,
ShapeSchema,
)... |
import collections
import pickle
import os
import spacy
import pandas as pd
from tqdm import tqdm
from nltk import pos_tag
from nltk.corpus import stopwords, wordnet as wn
from nltk.stem import WordNetLemmatizer
from typing import Dict
from embeddings import get_best_sentence, get_data_from_articles
def create_stats_d... |
from rest_framework import status, generics
from .models import *
from .serializers import *
from django.views.decorators.csrf import csrf_exempt
from django.http.response import JsonResponse
from rest_framework.parsers import FormParser, JSONParser, MultiPartParser
import datetime
from datetime import datetime
from us... |
#!/usr/bin/env python
from pathlib import Path
import os
import configparser
import argparse
import sys
import re
from difflib import SequenceMatcher
##
# The F!
#
# Shorthand for terminal
#
######
# Installation
#
#########
### Bash
#
# function q()
# {
# source="python /{installation path}/main.py"
#
# if ... |
# -*- coding: utf-8 -*-
# Copyright 2018 the HERA Project
# Licensed under the MIT License
import nose.tools as nt
import os
import shutil
import numpy as np
import sys
from pyuvdata import UVData
from pyuvdata import utils as uvutils
import hera_cal as hc
from hera_cal.data import DATA_PATH
from collections import Or... |
'''
## Play ##
# Run a trained DQN on an Open AI gym environment and observe its performance on screen
@author: <NAME> (<EMAIL>)
'''
import json, os, sys, argparse, logging, random, time
import numpy as np
import gym, gym_sokoban
import matplotlib.pyplot as plt
import tensorflow as tf
import matplotlib.pyplot as plt
... |
import logging.config
import re
from icq.bot import ICQBot
from icq.constant import TypingStatus
from icq.filter import MessageFilter
from icq.handler import (
CommandHandler, UnknownCommandHandler, UserAddedToBuddyListHandler, TypingHandler, MessageHandler, DefaultHandler,
FeedbackCommandHandler,
)
from icq.u... |
# -*- coding: utf-8 -*-
"""
Classes for parsing relevant info
========
author: <NAME>
email: <EMAIL>
"""
from chemdataextractor.parse.cem import BaseParser, lenient_chemical_label
from chemdataextractor.nlp.tokenize import WordTokenizer
from chemdataextractor.model import Compound
class LabelParser(BaseParser):
... |
import datetime
import os
import logging
import traceback
class StockMarket(object):
"""
StockMarket class.
This class contains two main attributes:
trades -> memcache "like" for the trades
exchange_table_data -> stock table
"""
__slots__ = ["trades", "exchange_table_data"]
... |
#first thing is the node data storing one to store the state, parent, action underwent
import sys
class Node() :
def __init__(self, state, parent, action) :
self.state=state
self.parent=parent
self.action=action
#class for the frontier to store nodes those are objects of the class node
#we can use frontier as ... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals, absolute_import
import os
import h5py
import numpy as np
import tensorflow as tf
from sacred import Ingredient
ds = Ingredient('dataset')
@ds.config
def cfg():
name = 'shapes'
path = './data'
binary =... |
#encoding=utf-8
import re
import os
import sys
def read_rpc_cfg(path):
class_table = []
function_table = {}
f = open(path, "r")
line = f.readline().strip()
class_table_num = int(re.match(r"class_table_num:(\d+)", line).group(1))
class_pattern = re.compile(r"field_count:(\d+),c_imp:(\d+),class... |
import os
import discord
from discord import Embed, Colour
from discord.ext import commands, tasks
from firebase_admin import firestore
from google.cloud.firestore import Increment
LEADERBOARD = os.getenv('LEADERBOARD')
db = firestore.client()
class LeaderboardCog(commands.Cog):
def __init__(self, bot):
... |
import numpy as np
import matplotlib.pyplot as plt
import os
import time
import h5py
import pandas as pd
import scipy.io as sio
from tqdm import tqdm
from components.grading.local_binary_pattern import local_standard, MRELBP
from components.utilities.load_write import load_binary, load_vois_h5
def pipeline_lbp(image... |
import copy
import gym
from gym.spaces import Box, Discrete
import numpy as np
import random
class SimpleContextualBandit(gym.Env):
"""Simple env w/ 2 states and 3 actions (arms): 0, 1, and 2.
Episodes last only for one timestep, possible observations are:
[-1.0, 1.0] and [1.0, -1.0], where the first ele... |
# fea data structures
from optimism.Mesh import *
from optimism import Surface
from optimism import QuadratureRule
# solver
from optimism.EquationSolver import newton_solve
# timing utils
from optimism.Timer import Timer
# testing utils
from optimism.test.TestFixture import *
d_kappa = 1.0
d_nu = 0.3
d_E = 3*d_kapp... |
#!/usr/bin/env python
import csv
import json
import os
import sys
from glob import glob
import matplotlib
import matplotlib.pyplot as plt
class OnDemandData(object):
def __init__(self, line=None):
if line is None:
self.src_ip = "0.0.0.0",
self.dst_ip = "0.0.0.0",
self.... |
import logging
import re
from datetime import timezone, datetime
from functools import lru_cache
from time import sleep
from typing import Any, Optional
import requests
from yarl import URL
import __init__
from utils.exeptions import InvalidUrl, GithubError
from utils.vars import footer_message, GITHUB_TOKEN, _MARKDO... |
import argparse
import json
import logging
import numpy as np
import os
import cyclic_esn
#.. Initialize logger
logger = logging.getLogger(__name__)
handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(h... |
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import tqdm
import numpy as np
import utils
import dataloaders
import torchvision
from trainer import Trainer
torch.random.manual_seed(0)
np.random.seed(0)
# Load the dataset and print some stats
batch_size = 64
image_transform = torchvision.transfor... |
import pytest
import ggps
def expected_tcm_first_trackpoint():
return {
"altitudefeet": "850.3937408367167",
"altitudemeters": "259.20001220703125",
"distancekilometers": "0.0",
"distancemeters": "0.0",
"distancemiles": "0.0",
"elapsedtime": "00:00:00",
"h... |
import os
import cv2
import torch
import numpy as np
import torch
import torch.nn as nn
import torchvision.models as models
import matplotlib.pyplot as plt
def get_driver_path(driver_path):
folder_path = driver_path.split('/')[0]
driver = [
x for x in os.listdir(folder_path) if 'driver' in x
][0]
... |
# this code heavily reference: detectron2
from __future__ import division
import math
import torch
from typing import List
from bisect import bisect_right
from segmentron.config import cfg
__all__ = ['get_scheduler']
class WarmupPolyLR(torch.optim.lr_scheduler._LRScheduler):
def __init__(self, optimizer, target... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from matplotlib.font_manager import FontProperties
def plot_GP_1D(X_train, Y_train, lin, mean, var):
"""Function to plot a GP 1-D Object"""
plt.fill_between(lin.ravel(), (mean + 2 * var).ravel(), (mean - 2 * var).ravel(),
... |
'''
2019 NeurIPS Submission
Title: Differentially Private Bagging: Improved utility and cheaper privacy than subsample-and-aggregate
Authors: <NAME>, <NAME>, <NAME>
Last Updated Date: May 28th 2019
Code Author: <NAME> (<EMAIL>)
-----------------------------
Data loading
- Load two real-world data (MAGGIC and UCI Adu... |
# coding: utf-8
'''
Convert 6502 data from json files to our own
data format.
'''
from __future__ import division, print_function
import sys
from collections import defaultdict
from circuit import load_circuit,Node,Transistor,NODE_PULLUP,NODE_PULLDOWN,NODE_GND,NODE_PWR,NODE_UNDEFINED
from node_group import extract_grou... |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torchvision.datasets as dset
import torchvision.transforms as transforms
from torch.utils.data import DataLo... |
from enum import IntEnum
from typing import List, Dict, Set, Union, Tuple, Optional
import re
import tokens
from cish import Ref, StringPtr
class TokenKind(IntEnum):
INLINE_WHITESPACE = 0
BUILTIN_ID = 1
USER_ID = 2
ARG = 3
NEWLINE = 4
ASSIGN_OP = 5
DOUBLE_QUOTED_STRING = 6
COMMENT = 7
... |
from graph_data import make_graph,show_graph
'''
Simulates the device using a file that denotes whether a device is on or off at any given time with
with intervals designated in a csv file that follows the format
device,state,on/off
ie
tv,on,111111010101111110000011111
'''
from test.test_wsgiref ... |
"""
MIT License
Copyright (c) 2021 PARITHI_POTTER
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish... |
# Usage: specify params (time interval, instance types, avail zones)
# Does: Looks up from cache 1st; fetches results that aren't in the cache
# Check if instance type is present
# Gets present time range: have latest early time thru earliest late time; assumes present time ranges are contiguous
import os
import bo... |
""" Introduit les classes necessaires a l'etude du marketing dans un reseau social
social.Player(initialstate) est un participant d'un Network
social.Network(players, qualities, isolationutility) est un reseau de participants, capables d'evoluer"""
import math
import random
import networkx as nx
import matplotlib.pyp... |
# Copyright 2019 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, ... |
from app import app, db, login_manager
from datetime import datetime
from passlib.apps import custom_app_context as pwd_context
roles_users = db.Table('roles_users',
db.Column('user_id', db.Integer(), db.ForeignKey('user.id')),
db.Column('role_id', db.Integer(), db.Foreig... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 6 16:09:02 2020
@author: mhari
"""
import json
from flatten_dict import flatten
from flatten_dict import unflatten
from csv import writer
import os
from fnmatch import fnmatch
EMPTYCELL = " "
def merge_dicts(dic1, dic2):
flatten_1, flatten_2 = flatten(dic1), flat... |
import io
import os
import os.path
import sys
import json
import pandas as pd
from Google import Create_Service
from googleapiclient.http import MediaIoBaseDownload, MediaDownloadProgress
from gDrive_calculator import getSize
CLIENT_SECRET_FILE = 'credentials.json'
API_NAME = 'drive'
API_VERSION = 'v3'
SCOPES = ['http... |
from __future__ import print_function
from __future__ import division
from . import _C
import math
import numpy as np
import scipy
import scipy.stats as stats
from sklearn import preprocessing as prep
from fuzzytools.datascience.statistics import dropout_extreme_percentiles, get_linspace_ranks
from sklearn.decompositi... |
import datetime
from custom.bihar import getters, BIHAR_DOMAINS
from custom.bihar.calculations.homevisit import DateRangeFilter
from custom.bihar.calculations.utils import filters
from fluff.filters import Filter
from pillowtop.listener import BasicPillow
from casexml.apps.case.models import CommCareCase
from couchform... |
# -*- coding: utf8 -*-
# Copyright 2019 JSALT2019 Distant Supervision Team
#
# 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
#
# U... |
#!/usr/bin/env python
# coding: utf-8
#------------------------------
# Import the needed libraries
#------------------------------
import pandas as pd
import numpy as np
import csv, os, sys, re
import logging
import argparse
import gzip
logging.basicConfig(level=logging.INFO,
format='%(asctime)... |
import time
from datetime import date
import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class UserProfile:
path_user_profile_table = '../data/user_profile_table.csv'
data = None
shape = None
def __init__(self):
self.data = pd.read_csv(self.path_user_profil... |
import torch
from torch.utils.data import Dataset, DataLoader
def mpc_epoch(env, mpc, mpc_sim_steps, mpc_sim_batch_size, mpc_iter_max):
x = env.reset(mpc_sim_batch_size, mpc.device)
mpc.set_nbatch(mpc_sim_batch_size)
xm = []
um = []
Lm = []
xm1 = []
for t in range(mpc_sim_steps):
w... |
import os
import threading
#==================================banner==========================================
print(' ')
print('################################################################')
print(' ')
pri... |
#!/usr/bin/env python3
import networkx as nx
TILE_TRAVERSABLE = "O"
TILE_IMPASSABLE = "X"
TILE_START = "B"
TILE_MOUSE = "M"
class NestBuilder:
def __init__(self):
self.graph = nx.Graph()
self.start_position = None
self.mice_positions = []
self.current_row_index = 0
self.c... |
# general includes
import os, sys
import argparse
import numpy as np
from PIL import Image
import cv2
import matplotlib.pyplot as plt
from collections import OrderedDict
from copy import deepcopy
import re
import skvideo.io
# pytorch includes
import torch
import torch.nn.functional as F
from torch.autograd import Vari... |
import re
from calendar import monthrange
import datetime
class Card(object):
"""
A credit card that may be valid or invalid.
"""
# A regexp for matching non-digit values
non_digit_regexp = re.compile(r'\D')
# A mapping from common credit card brands to their number regexps
BRAND_VISA = '... |
from ._sql import (
Column, ForeignKey, Index, UniqueConstraint, PrimaryKeyConstraint,
declarative_base, relationship, now, text,
)
from ._types import Boolean, Float, Integer, NullType, String, Text, UnixTimeMicro
PlacesBase = declarative_base()
class AnnotationAttributeOrm(PlacesBase):
__tablename__ = ... |
#!/usr/bin/python
# Copyright 2017 Google Inc. 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 applica... |
"""
Code to enable coverage of any external code called by the
notebook.
"""
import os
import coverage
# Coverage setup/teardown code to run in kernel
# Inspired by pytest-cov code.
_python_setup = """\
import coverage
__cov = coverage.Coverage(
data_file=%r,
source=%r,
config_file=%r,
auto_data=Tru... |
from itertools import chain
from operator import attrgetter
from typing import Literal, List
from django.db.models import Q
from django.db.models import QuerySet
from django.db.transaction import atomic
from drf_stripe.stripe_api.api import stripe_api as stripe
from .customers import get_or_create_stripe_user
from ..... |
import cv2
import numpy as np
import imutils
# img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
def find_face(img):
#输入彩色图像
tag = 1
img_c=img
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = img_gray
size = img.shape
# cv2.imshow('imgfind',img)
# cv2.waitKey(0)
face_detector = cv2.C... |
# Built-in Imports
import os
import io
import sys
import jsonify
import json
import numpy as np
import pandas as pd
import pickle
from datetime import datetime
from base64 import b64encode
import base64
from io import BytesIO #Converts data from Database into bytes
from datetime import datetime, timedelta
from pathlib ... |
import argparse
import logging
import os
import pdb
import sys
import traceback
import pickle
import random
from collections import Counter
from ELMo.processor import Processor
def main(args):
if not os.path.exists(args.dest_dir):
os.makedirs(args.dest_dir)
processor = Processor()
# colle... |
import math
from copy import copy
from typing import List, Type
import pytest
from pyfakefs.fake_filesystem import FakeFilesystem
from crawlMp.crawlMp import CrawlMp
from crawlMp.crawlers.crawler import Crawler
from crawlMp.crawlers.crawler_fs import CrawlerFs, CrawlerSearchFs
from crawlMp.enums import Mode
@pytest... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module to drive robot with a given acceleration profile. Should be
called directly from the main.py wrapper. Arguments are defined in
the AccControl class docstring below.
Questions? <EMAIL>, BU CODES Lab
"""
from __future__ import division
import rospy
import numpy as... |
"""
Script to center and crop an MRI based on regions given by the CerebrA atlas.
Distributed under MIT License by <NAME>.
"""
import argparse
from pathlib import Path
import ants
from rich import print
from rich.console import Console
from rich.progress import track
from roiloc.location import crop, get_coords
from... |
from VAE1D import *
from scipy.stats import multivariate_normal
from time import sleep
import matplotlib.pyplot as plt
plt.style.use('ggplot')
size = 512
n_channels = 14
n_latent = 50
kl_weight = 1
date = '190130'
desc = 'accumulator'
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
def loa... |
from os import environ
from io import BytesIO, SEEK_END, SEEK_SET
from uuid import uuid4
import os
import json
from bs4 import BeautifulSoup
from celery import Celery, result
from werkzeug.utils import secure_filename
from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
... |
import numpy as np
from getdata import load, test_load
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Activation, Flatten, Reshape
from keras.layers import Conv2D, MaxPooling2D
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras import applications
from keras.optimiz... |
from PySide.QtCore import Qt, Signal, QRectF
from PySide.QtGui import (QGraphicsView, QGraphicsPixmapItem,
QGraphicsScene, QBrush)
from traits.api import (Instance, HasTraits, Int, WeakRef,
on_trait_change, List)
from traitsui.key_bindings import KeyBindings
from traitsui.qt4.editor import Editor
from ... |
#1
# TODO: use list comp AND zip
def subtraction(numbersA, numbersB):
out = []
for i in range(min(len(numbersA), len(numbersB))):
out.append(numbersA[i] - numbersB[i])
return out
#answer:
def subtraction(numbersA, numbersB):
return ([i[0] - i[1] for i in list(zip(numbersA, numbersB))])
# answer
... |
#!/usr/bin/python3
__author__ = 'ebianchi'
import boto.ec2
import boto.route53
import bottle
import configparser
import json
import sys
from contextlib import closing
app = application = bottle.Bottle()
def load_cfg():
cfg = configparser.ConfigParser()
try:
cfg.read(sys.argv[1])
except:
... |
# Python Native
import logging
import matplotlib.pyplot as plt
import rasterio
# 3rd Party
import gdal
import numpy
from matplotlib.offsetbox import AnchoredText
def apu_calc(data1, data2):
'''This function compute APU metrics.
:param data1: Array of pixel values of a single band.
:type data1: numpy.array
... |
import os
import glob
import cv2
from util.misc import load
import json
import numpy as np
from util.mx_tools import calibration_matrix
MUPO_TS_PATH = None
OPENPOSE25_NAMES = np.array(['nose', 'neck', 'right_shoulder', 'right_elbow', 'right_wrist', 'left_shoulder', 'left_elbow', 'left_wrist',
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os
import re
import requests
import sys
import time
from urllib.parse import urljoin
sys.path.append(os.path.join(sys.path[0], "../", "lib"))
import lkft_squad_client # noqa: E402
def extract_version_info(version):
"""
IN: version="v... |
from ScanServer.forms import NameForm, ScipyForm, PrintLogForm, LoginForm, RegisterForm
from ScanServer.util import get_net, get_txt_file, redirect_back
from ScanServer.models import User
from ScanServer.extensions import db
from flask import render_template, request, flash, redirect, url_for , session, jsonify, Bluep... |
# Copyright 2020 The Nomulus 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... |
# !/usr/bin/env python3
# -*-coding:utf-8-*-
# @file:
# @brief:
# @author: <NAME>, <EMAIL>, <EMAIL>
# @version: 0.0.1
# @creation date: 11-11-2019
# @last modified: Mon 11 Nov 2019 02:35:01 PM EST
#NOTE: code is copied from https://gist.github.com/MInner/8968b3b120c95d3f50b8a22a74bf66bc;
import datetime
import linec... |
import os
# Set TESTING environmental variable as soon as test is imported
os.environ['TESTING'] = 'true'
import base64
import logging
import warnings
import pytest
from mixer.backend.sqlalchemy import Mixer
from paste.deploy.loadwsgi import appconfig
from pyramid import testing
from webtest import lint
from webtes... |
# -*- coding: utf8 -*-
# test encoding: à-é-è-ô-ï-€
# Copyright 2021 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
import json
import os
from datetime import datetime
from invoke import task
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
PROJECT_SLUG = 'documenters_aggregator'
DEPLOY_TAG = datetime.now().strftime("%Y%m%d%H%M")
ECS_URI = os.environ.get('ECS_REPOSITORY_URI')
crawler... |
from django.db.models import Case, Count, F, IntegerField, Sum, Value as V, When
from django.db.models.functions import Coalesce
from kolibri.auth.models import FacilityUser
from kolibri.content.models import ContentNode
from kolibri.logger.models import ContentSummaryLog
from le_utils.constants import content_kinds
fr... |
from __future__ import unicode_literals
import os
import urllib2
import urlparse
import logging
from lxml import etree
from docutil.url_util import get_local_url, get_url_without_hash,\
ensure_path_exists, get_path_from_url, get_sanitized_url
from docutil.commands_util import get_encoding, download_file
from do... |
import json
import warnings
from jsonschema import RefResolver
import voluptuous
from voluptuous import Schema, Any, All
class EnumArray:
"""Validates an ordered array using an ordered list of schemas
If additional_items is False, extra items are allowed past at the
end of the array (you can have more ... |
"""Top-level commands for peer reviewing.
This module contains the top-level functions for RepoBee's peer review
functionality. Each public function in this module is to be treated as a
self-contained program.
.. module:: peer
:synopsis: Top-level commands for peer reviewing.
.. moduleauthor:: <NAME>
"""
import ... |
from django import forms
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from hordak.models import Account
from mptt.forms import TreeNodeChoiceField
from .models import Housemate
class HousemateCreateForm(forms.ModelForm):
existi... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
"""CSAIL course catalog ETL"""
import logging
import re
from datetime import datetime, timedelta
from decimal import Decimal
from urllib.parse import urljoin
import pytz
import requests
from bs4 import BeautifulSoup as bs
from django.conf import settings
from course_catalog.constants import OfferedBy, PlatformType
f... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on Thu Aug 30 15:30:28 2018
@author:
"""
import os
import codecs
import datetime
try:
import pandas as pd
except:
... |
import numpy as np
import pickle
from archived.elasticache import hlist_keys
from archived.elasticache import hget_object,hget_object_or_wait
from archived.elasticache import hset_object
from archived.elasticache.Redis.delete_keys import hdelete_keys
def merge_w_b_layers(endpoint, bucket_name, num_workers, ... |
import numpy as np
import gym_electric_motor.envs
from gym_electric_motor.physical_systems.solvers import *
import pytest
"""
simulate the system
d/dt[x,y]=[[3 * x + 5 * y - 2 * x * y + 3 * x**2 - 0.5 * y**2],
[10 - 0.6 * x + 0.9 * y**2 - 3 * x**2 *y]]
with the initial value [1, 6]
"""
g_initial_val... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""distance_from_median_pis.py
This script investigates the L1 distance between each of the images to the
median vectorial representation of a persistence image within a diagnostic
category.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import matplotlib.pyplot as p... |
"""
Main package for loading common data file types:
1. csv
2. Common MNE-supported file types (txt, mat, etc.)
to numpy array with dimension (p, m, e).
"""
import os
import re
import numpy as np
from scipy.io import loadmat
from mne.io import read_raw
from pathlib import Path
from .utils import rea... |
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.urlresolvers import reverse
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import Http404
from... |
#!/bin/python
# This script will ...
#
#
#
# <NAME>
# created on: 2020-02-13 09:22:14
import logging
import os
import sys
import time
from datetime import datetime
import numpy as np
import pandas as pd
from .helper_general import Outputs
DATE = datetime.now().strftime("%Y-%m-%d")
logger = logging.getLogger("main... |
from firebaseConfig import firebase
from config import CLAN_CODE
from googleapiclient import discovery
from pprint import pprint
from config import GOOGLE_SPREADSHEET_ID
def read_from_firebase():
database = firebase.database()
# each member is one row
members = database.child("clans").child(CLAN_CODE).get().val()["... |
"""Methods to build dataset files."""
# builtins
import pathlib
from typing import Dict, List
# 3d party/FOSS
import numpy as np
import pandas as pd
import yaml
# this
from afwerx_datathon.io.csv import CSVReader
from afwerx_datathon.io.parquet import ParquetReader
from afwerx_datathon.io.path import DEV_DATA, get_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.