text stringlengths 3.07k 22.1k |
|---|
# The MIT License (MIT)
#
# Copyright (c) 2014 WUSTL ZPLAB
#
# 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, modif... |
import csv
import datetime
import os
import re
from django.core.management.base import BaseCommand, CommandError
from members.models import Person, Member, Category, Patron
CAT_ESTUDIANTE = 'Estudiante'
CAT_DESCRIPTIONS = {
'Activo': "Personas que manifiesten su adhesión con los objetivos de esta entidad, reali... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from beta_rec.models.torch_engine import ModelEngine
from beta_rec.utils.common_util import timeit
class VBCAR(nn.Module):
"""VBCAR Class."""
def __init__(self, config):
"""Initialize VBCAR Class."""
super(VBCAR, self).__init... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
from datetime import datetime as dt
from datetime import timedelta as td
from decimal import Decimal
from typing import Any
from kusto_tool.expression import OP, Column, Prefix, typeof
def function(name, *args):
"""Translate to any Kusto function call.
Parameters
----------
name: str
The nam... |
# import section
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import pyttsx3
import pywhatkit
import pyjokes
import rotatescreen
import os
import PyPDF2
from textblob import TextBlob
import platform
import calendar
import cowsay
from translate import Translator
import sounddevice
f... |
import io
import os
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.db import models
from django.urls import reverse
from hashids import Hashids
from imagekit.models import ImageSpecField
from imagekit.processors import ResizeToFit
import piexif
from .... |
#!/usr/bin/env python
# Copyright (c) 2016 <NAME> (<EMAIL>)
# This version is compatible with Python v2
import socket
import sys
from optparse import OptionParser, OptionGroup
import signal
import select
import time
from threading import Thread
import os
import re
try:
import SocketServer
except ImportError:
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 14:38:40 2020
@author: thosvarley
"""
import numpy as np
from sklearn.cluster import k_means
from sklearn.decomposition import PCA
from scipy.spatial.distance import squareform, pdist
from scipy.stats import zscore, entropy
import igraph as ig
f... |
import argparse
import datetime
import dateutil.parser
import logging
import re
import os
import string
import subprocess
import sys
import fs
import tzlocal
log = logging.getLogger(__name__)
METADATA_ALIASES = {
'group': 'group._id',
'project': 'project.label',
'session': 'session.label',
'subject':... |
#!/usr/bin/env python
# coding: utf-8
# # CROSS VALIDATION: IMPLEMENTATION
#
# This notebook describes how to do cross validation for simulation models.
#
# Cross validation partitions the observed data into *folds*.
# A fold consists of a pair of training data and test data.
# For simulation models,
# the training ... |
"""Script to download era-interim data.
Before running the script:
1. Install the dependency i.e. ECMWFDataServer.
For this, run pip install ecmwf-api-client
2. Create an account at https://www.ecmwf.int/
3. Follow the instruction at:
https://confluence.ecmwf.int/display/WEBAPI/Accessing+ECMWF+data+servers+in+batch
... |
import bpy
import time
import math
from array import array
from struct import pack
class Bounds:
def __init__(self):
self.min = [0.0, 0.0, 0.0]
self.max = [0.0, 0.0, 0.0]
self.center = [0.0, 0.0, 0.0]
self.extents = [0.0, 0.0, 0.0]
self.size = [0.0, 0.0, 0.0]
def get_boundi... |
from os.path import join
import numpy as np
from numpy.testing import assert_almost_equal
import pytest
from SciDataTool.Functions.Plot.plot_2D import plot_2D
from pyleecan.Classes.OPdq import OPdq
from pyleecan.Classes.Simu1 import Simu1
from pyleecan.Classes.InputCurrent import InputCurrent
from pyleecan.Classes.... |
import pytest
import numpy as np
import pandas as pd
from scipy.io import loadmat
from echopype import open_raw
from echopype.testing import TEST_DATA_FOLDER
@pytest.fixture
def ek80_path(test_path):
return test_path["EK80"]
def pytest_generate_tests(metafunc):
ek80_new_path = TEST_DATA_FOLDER / "ek80_new"... |
import torch.nn as nn
import torch
import torch.optim as optim
from torchvision import datasets
from torchvision.transforms import ToTensor
from torch.utils.data import DataLoader, random_split
import time
import torch.optim.lr_scheduler as lr_s
import torchvision.transforms as transforms
from Block import Block
class... |
#!/usr/bin/env python3
# This file is a part of misk and is subject to the the terms of the MIT license.
# Copyright (c) <NAME> <<EMAIL>>
# See https://github.com/marzer/misk/blob/master/LICENSE.txt for the full license text.
# SPDX-License-Identifier: MIT
import sys as _sys
import shutil as _shutil
import fnmatch as ... |
import base64
import uuid
from kazoo.exceptions import (
CancelledError,
KazooException,
LockTimeout,
NoNodeError,
NotEmptyError
)
from kazoo.retry import (
ForceRetryError,
KazooRetry,
RetryFailedError
)
# The ZooKeeper node that contains lock entries for an entity group.
LOCK_PATH_TEMPLATE = u'/app... |
# -*- coding: utf-8 -*-
__author__ = "HLN Consulting, LLC"
__copyright__ = "Copyright 2018, HLN Consulting, LLC"
from flask import json, request
from cdshooks_core import Card
from cdshooks_core import Link
from cdshooks_core import Source
from ice_cdshooks import pyicefhir
import pyiceclient
import datetime
from ice... |
import os
import cv2
import argparse
import numpy as np
from tqdm import tqdm
from sklearn import metrics
import json
import torch
import torch.nn.functional as F
from config import config
from utils.pyt_utils import ensure_dir, link_file, load_model, parse_devices
from utils.visualize import print_iou, show_img
from... |
import torch
import torch.nn.functional as F
import math
def tps_grid(H, W):
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_unnormalized(H, W):
xi = torch.linspa... |
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from equivariant_attention.modules import GConvSE3, GNormSE3, get_basis_and_r, GSE3Res, GMaxPooling, GAvgPooling
from equivariant_attention.fibers import Fiber
# import pytorch_lightning as pl
import torchmetrics as tm
from dat... |
from collections import namedtuple
from functools import partial
import hashlib
import os
from PIL import Image
import torch
import urllib.request
from os import path
import sys
import zipfile
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
import nump... |
import timestring
import datetime
import json
from flask import Blueprint, request, jsonify, abort, make_response
from ..models.meetup import Meetup, Rsvp
from ..models.user import User
from ..utils.base_vals import BaseValidation, token_required
from ..utils.meet_validator import MeetValid
v_blue = Blueprint("ap1vv",... |
import os
import pickle
import numpy as np
from mayavi import mlab
import matplotlib.pyplot as plt
from scipy.spatial.distance import cdist
import pandas as pd
class PlotModelSimulation():
'''
PlotModelSimulation class is used to visualize using mayavi/vtk a series of mesh solutions that can later be stitche... |
# MIT LICENSE
# Mycroft Skill: Application Launcher, opens/closes Linux desktop applications
# Copyright © 2019 <NAME> <EMAIL>
# 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 restric... |
#!/usr/bin/env python
#how to use: python MD_bond_length_extraction.py XDATCAR1 [XDATCAR2] [XDATCAR3] ...
import re
import sys
import math
def number_times_list(number, a_list):
return [number*ele for ele in a_list]
def elementwise_list_plus_list(list_1, list_2, list_3):
return [ele_1+ele_2+ele_3 for ele_1,... |
# -*- coding: utf-8 -*-
import copy
import importlib
import logging
import os
import re
import string
import visa
from .. import db
from .util import IEEE_488_2_BinBlock
log = logging.getLogger(__name__)
log.addHandler(logging.NullHandler())
class BaseDriver:
"""Base class for Driver"""
... |
import json
import gpxpy
import numpy as np
import pandas as pd
def manipulate_gpx(gpx_fn, fsav, fliplat=True, rotlon=True):
gpx_file = open(gpx_fn, 'r')
gpx = gpxpy.parse(gpx_file)
lat, lon = [], []
for t in gpx.tracks:
for s in t.segments:
lon = [p.longitude for p in s.points]
... |
from machine import I2C, Pin
import time
class Display():
def write_cmds(self, cmds): # Use the i2c interface to send commands to the display
temp = [0x80 for i in range(len(cmds) * 2)]
temp_cmd_index = 1
cmds_array_index = 0
while temp_cmd_index != len(temp) - 1:
... |
#!/usr/bin/env python2
"""WebWare for Python adapter for mod_python.
Contributed by: <NAME>
Modified by <NAME> and <NAME>
Here's how I set up my Apache conf:
<Location /WK >
SetHandler python-program
# add the directory that contains ModPythonAdapter.py
PythonPath "sys.path+['/path/to/WebKi... |
# coding=utf-8
# Copyright 2016-2018 <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 required by applicable law or agreed ... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import math
import argparse
import cv2 as cv
import numpy as np
import onnxruntime
import mediapipe as mp
from utils import CvFpsCalc
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--device", type=int, default=0)
parser.... |
import torch
import torch.nn as nn
class SelfAttention(nn.Module):
def __init__(self, embed_size, heads):
super(SelfAttention, self).__init__()
self.embed_size = embed_size
self.heads = heads
self.head_dim = embed_size // heads
assert (
self.head_dim * heads ==... |
import tensorflow as tf
import time
import numpy as np
flags = tf.flags
logging = tf.logging
flags.DEFINE_string(
"model", "small",
"A type of model. Possible options are: small, medium, large.")
flags.DEFINE_string("data_path", None, "data_path")
flags.DEFINE_bool("use_fp16", False,
"Train... |
import asyncio
import datetime
from typing import Dict, List
from discord import Embed, Emoji
from discord.ext import commands, tasks
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.triggers.cron import CronTrigger
from sqlalchemy import and_, or_
from bot.bot import Bot
from bot.crawler.... |
import functools
import random
import re
from typing import Any, Callable, Dict, Generator, List, Union
import gevent # type: ignore
from locust.env import Environment
from . import logger
ENV = Environment()
log = logger.getLogger(__name__)
def format_label(label: str, delimiter: str = None, index: int = 0) -> s... |
"""
Joint Monkey
------------
- Animates degree-of-freedom ranges for a given asset.
- Demonstrates usage of DOF properties and states.
- Demonstrates line drawing utilities to visualize DOF frames (origin and axis).
"""
import math
import numpy as np
from isaacgym import gymapi, gymutil
def clamp(x, min_value, max_... |
import numpy as np
import pandas as pd
from sklearn.ensemble import RandomForestClassifier, BaggingClassifier
from sklearn.model_selection import train_test_split, StratifiedKFold
from sklearn.model_selection._split import _BaseKFold
from sklearn.metrics import roc_curve, classification_report, log_loss, accuracy_score... |
"""
deviceinfo.py
A simple Device Information service
Device information is stored in files named <devicename>.py in the devices sub-folder
Each device file contains a dict of values
These device files are [ideally] generated from DFP information by [running generate_device_info.py | hand]
"""
# Python 3 compatibility... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 25 15:51:15 2020
@author: wuyuanqi
"""
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.lines as mlines
from matplotlib.font_manager import FontProperties
import se... |
import requests
import secret
import gc
import sqlite3 as sql
# precautionary memory stop gap
def clear_requests(req_list):
for i in req_list:
del i
gc.collect()
#STRIPE API REQUESTS
class request(object):
def __init__(self, method="get"):
self.headers = {"Authorization": f"Bearer {sec... |
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib import messages
from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.db import transaction
from django.db.models import Count
from django.shortcuts import get_object_or_404, redirect, re... |
from django.contrib import admin
from django.db.models import Q
from django.db.models.functions import Lower
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.utils.safestring import mark_safe
from allianceauth.eveonline.models import EveAllianceInfo
from eveuniverse.models ... |
import os
import json
import asyncio
import inspect
from pathlib import Path
from http import HTTPStatus
from contextlib import AsyncExitStack
from typing import Dict, Iterable, List, Optional, Union, TYPE_CHECKING
import aiohttp
from rich.console import Console
from jina.helper import colored
from jina.jaml.helper i... |
__license__ = "GNU General Public License v3"
__author__ = 'Hwaipy'
__email__ = '<EMAIL>'
import threading
import msgpack
import re
from tornado.ioloop import IOLoop
from threading import Thread
import types
class IFDefinition:
PROTOCOL = b'IF1'
DISTRIBUTING_MODE_BROKER = b'Broker'
DISTRIBUTING_MODE_DIRE... |
'''
Flexible Data Gathering: readfile
=================================
This fdg module allows for reading in the contents of files, with various
options for format and filtering.
'''
from __future__ import absolute_import
import json as _json
import logging
import os
import re
import yaml as _yaml
from salt.exceptio... |
"""
This is a DCGAN following Radford et al. 2015 which will train on Cifar-10 and
generate images accordingly.
"""
import argparse
import logging
import os
import sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision as tv
from torch.utils.data import DataLoader
from tensorboardX... |
# (c) 2012-2014, <NAME> <<EMAIL>>
#
# This file is part of Ansible
#
# Ansible 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 3 of the License, or
# (at your option) any later version.
#
# Ansi... |
import collections
import numbers
import logging
from collections import defaultdict
def permute(A, exclude=None):
'''returns all possible _unique_ permutations of A'''
exclude = exclude or set()
seen = set()
for i, x in enumerate(A):
if i in exclude:
continue
exclude.add(... |
#!/usr/bin/env python3
import os.path
from glob import glob
import sys
from illuminatus.RunInfoXMLParser import RunInfoXMLParser, instrument_types
class RunStatus:
"""This Class provides information about a sequencing run, given a run folder.
It will parse information from the following sources:
R... |
"""Perform validation of final calls against known reference materials.
Automates the process of checking pipeline results against known valid calls
to identify discordant variants. This provides a baseline for ensuring the
validity of pipeline updates and algorithm changes.
"""
import csv
import os
import yaml
impor... |
import os
import tensorflow as tf
from easytransfer import base_model, FLAGS
from easytransfer import layers
from easytransfer import model_zoo
from easytransfer import preprocessors
from easytransfer.datasets import TFRecordReader
from easytransfer.losses import softmax_cross_entropy
from sklearn.metrics import classi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Script to open and parse the evidence image."""
from __future__ import print_function
import datetime as dt
import getpass
import locale
import logging
import sys
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.helpers import volume_scanner
_TIME... |
import random
import numpy
import glob
import os
import cv2
import settings
from helpers_dicom import DicomWrapper
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
random.seed(1301)
numpy.random.seed(1301)
def get_pred_patient_dir(patient_id):
... |
"""
Bbox Target Operator
select foreground and background proposal and encode them as training target.
"""
import mxnet as mx
import numpy as np
import numpy.random as npr
from ast import literal_eval
from .detectron_bbox_utils import bbox_overlaps, bbox_transform_inv
def _sample_proposal(proposals, gt_bboxes, image... |
"""Frameworks for the available pipelines
Description:
------------
To add a new pipeline, simply create a new .py-file in the pipelines-directory. Each pipeline is split into several
parts called stages. These stages will be called in the order they are registered in the source file (by using the
`@plugins.register`... |
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
# import pandas_datareader.data as web
import plotly.graph_objs as go
from datetime import datetime
import pandas as pd
import numpy as np
import os
import flask
import psycopg2
from pat... |
from fides import (
Optimizer, BFGS, SR1, DFP, BB, BG, Broyden, GNSBFGS, HybridFixed,
FX, SSM, TSSM, SubSpaceDim, StepBackStrategy
)
import numpy as np
import logging
import pytest
import fides
import time
def rosen(x):
f = 100 * (x[1] - x[0] ** 2) ** 2 + (1 - x[0]) ** 2
return f
def rosengrad(x):... |
from datetime import datetime
import json
import mimetypes
from eve.render import send_response
from flask import request, send_from_directory
from flask_caching import Cache
from taarifa_api import api as app, main
cache = Cache(app, config={'CACHE_TYPE': 'simple'})
def pre_get_waterpoints(request, lookup):
"""... |
"""Test if we can initialise tasks and execute them"""
import sys
import unittest
import logging
import json
import yaml
import os
import shutil
from pprint import pprint, pformat
from os.path import abspath, normpath, expanduser
from os.path import join as joinpath
import numpy as np
import numpy.testing as nptest
fro... |
import os
import librosa
import numpy as np
import soundfile as sf
def crop_center(h1, h2):
h1_shape = h1.size()
h2_shape = h2.size()
if h1_shape[3] == h2_shape[3]:
return h1
elif h1_shape[3] < h2_shape[3]:
raise ValueError('h1_shape[3] must be greater than h2_shape[3]')
# s_fre... |
import tensorflow as tf
def DenseNet(nb_dense_block=4, growth_rate=32, nb_filter=64, reduction=0.1,
dropout_rate=0.1, weight_decay=1e-4, classes=7, weights_path=None):
'''Instantiate the DenseNet 121 architecture,
# Arguments
nb_dense_block: number of dense blocks to add to end
... |
import logging
from collections import defaultdict
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend, RemoteUserBackend as _RemoteUserBackend
from django.contrib.auth.models import Group, AnonymousUser
from django.core.exceptions impor... |
import cv2
import numpy as np
import time
import math
import sys
import os
import defaultGesturesLoader
from gesture import Gesture
class HandProcessor(object):
def __init__(self, gestureFile = "gestureData.txt"):
self.cap = cv2.VideoCapture(0)
self.cameraWidth = 1920
self.cameraHeight = 10... |
import unittest
from itertools import product
from typing import Optional
import mock
import numpy as np
import pytest
from tensorkit import tensor as T
from tensorkit import *
from tensorkit.distributions import *
from tensorkit.distributions.normal import BaseNormal
from tensorkit.distributions.utils import copy_di... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Plotting utilities.
.. codeauthor:: <NAME> <<EMAIL>>
"""
import logging
import os
import numpy as np
from bottleneck import allnan, anynan
import matplotlib
from matplotlib.ticker import MaxNLocator
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import m... |
# The MIT License (MIT)
#
# Copyright (c) 2019 <NAME> for Capable Robot Components
#
# 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 righ... |
# Author: <NAME>
import logging
import mxnet as mx
from mxnet import gluon, autograd, nd
from mxnet.gluon.nn import Conv2D, Conv2DTranspose, LeakyReLU, Activation, BatchNorm, HybridBlock, Dropout, \
HybridSequential
import numpy as np
import datetime
import time
import os
from mxnet_img_to_img.library.image_utils... |
# Copyright (c) 2010-2016 <NAME> <<EMAIL>>
# Copyright (c) 2008-2016, Neotion
# 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 copyright... |
from dataclasses import dataclass
from datetime import datetime
import functools
import json
import traceback
import typing as t
from bamboo import (
ErrInfo,
HTTPStatus,
WSGIApp,
WSGIEndpoint,
WSGIServerForm,
WSGITestExecutor,
)
from bamboo.api import JsonApiData
from bamboo.request import Res... |
#!/usr/bin/env python3
# Standard library imports
import datetime
import logging
import os
import sys
from itertools import groupby
from pathlib import Path
# External imports
import click
import requests
VALID_TYPES = (
"type: bug",
"type: feature",
"type: task",
)
SCRIPT_ROOT = Path(__file__).resolve(... |
#!/usr/bin/env python3
# @Author : <NAME>
# @FileName : pcc_region_eval.py
# @Software : NANOME project
# @Organization : JAX Li Lab
# @Website : https://github.com/TheJacksonLaboratory/nanome
"""
Evaluate PCC at different regions in nanome paper
"""
import argparse
import pybedtools
from scipy import stats
from ... |
#!/usr/bin/env python
#
#===- check_clang_tidy.py - ClangTidy Test Helper ------------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===---------... |
import json
import os
import re
import shutil
from pathlib import Path
from luscious_dl import __version__
from luscious_dl.logger import logger
def info() -> None:
"""Show package version."""
logger.info(f'Luscious Downloader version: {__version__}')
def cls() -> None:
"""Clears the command prompt."""
os.... |
import json
import unittest
from mock import patch, MagicMock
import botocore
CODE = __import__('service')
RESOURCE_TYPE = 'some-resource-type'
CONFIG_CLIENT_MOCK = MagicMock()
class rdklibUtilServiceTest(unittest.TestCase):
def test_check_defined(self):
ref = {}
with self.assertRaises(Exception... |
"""
Tests for kf_lib_data_ingest/extract/operations.py
"""
import pandas
import pytest
from kf_lib_data_ingest.common.type_safety import function
from kf_lib_data_ingest.etl.extract import operations
from test_type_safety import type_exemplars
df = pandas.DataFrame({"COL_A": ["1", "2", "3"]})
other_df = pandas.DataF... |
# <NAME>
# July 2017
# @ Sebit Information & Education Technologies
# METU Teknokent, Ankara, Turkey
# v6
from Tkinter import *
from google.cloud import datastore
import datetime
import tkMessageBox
# GLOBALS
client = datastore.Client()
pages = []
def place(thing, r, c, px, py):
thing.grid(row = r, column = c, padx... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Programmatic execution of notebooks."""
# pylint: disable=invalid-name
import argparse
import os
from datetime import datetime
from typing import Dict, List
import papermill as pm
PROJ_ROOT_DIR = os.getcwd()
data_dir = os.path.join(PROJ_ROOT_DIR, "data")
output_no... |
import pandas as pd
import thermotar as th
import numpy as np
import matplotlib.pyplot as plt
import warnings
from scipy import interpolate
import thermotar as th
from thermotar.sub_modules.potential_chunk import Potential
# fit within specified range to specified orer polynomial
def ranged_poly_fit(y,x,n... |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. 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... |
from mxnet import autograd, contrib, gluon, image, init, nd
from mxnet.gluon import nn
from utils import util
import time
def cls_predictor(num_anchors, num_classes):
return nn.Conv2D(num_anchors * (num_classes + 1), kernel_size=3, padding=1)
def bbox_preditor(num_anchors):
return nn.Conv2D(num_anchors * 4,... |
from typing import Tuple
import torch
from torch.utils.data import DataLoader, Subset
import numpy as np
from sklearn.model_selection import train_test_split
from transformers import AutoTokenizer
from transformers import DataCollatorWithPadding, default_data_collator
from hfutils.arg_parser import HfArguments
from... |
"""Simulate a basic scRNA-seq count matrix dataset, for unit tests."""
import numpy as np
import scipy.sparse as sp
from typing import Tuple, List, Union
def simulate_dataset_without_ambient_rna(
n_cells: int = 100,
clusters: int = 1,
n_genes: int = 10000,
cells_in_clusters: Union[Lis... |
import os
import pytest
from jina import Document, DocumentArray
from jina.types.arrays.memmap import DocumentArrayMemmap
from tests import random_docs
def test_memmap_append_extend(tmpdir):
dam = DocumentArrayMemmap(tmpdir)
docs = list(random_docs(100))
assert len(dam) == 0
for d in docs[:40]:
... |
#!/usr/bin/env conda run -n py38 python
import json
import requests
import os
from xmlrpc.client import boolean
import mistletoe as md
from mistletoe.ast_renderer import ASTRenderer
from rich import inspect
from rich.console import Console
from rich.markdown import Markdown
from rich.logging import RichHandler
import ... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... |
#!/usr/bin/env python
"""
#############################################################################
Copyright : (C) 2017 by Teledomic.eu All rights reserved
Name: timon.configure
Description: apply new configuration for timon
#############################################################################
... |
#!/usr/bin/python3
''' Linux only. Requires PySerial. '''
import os
import sys
import getopt
import fcntl
import select
from serial import Serial
import socket
from asyncio import Queue
import kiss
class Config():
''' Configuration for UART/UDP bridge '''
device = None
baud = 9600
server_host = 'localhost'
se... |
import sys
sys.path.insert(0, '../ELINA/python_interface/')
import numpy as np
import os
from eran import ERAN
from read_net_file import *
import tensorflow as tf
import csv
import time
from deepzono_milp import *
import argparse
from hasse import hasse
def str2bool(v):
if v.lower() in ('yes', 'true', 't', 'y', '1... |
import os
import random
import numpy as np
import pandas as pd
import joblib
import itertools
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.utils import shuffle
import tensorflow as tf
from tensorflow.python.keras.preprocessing import sequence
from tensorflow.python.keras.preprocessing imp... |
import player
import numpy as np
import sys
import random
import matplotlib.pyplot as plt
sys.path.append("../")
number_of_pieces = 4
# states = ["home", "goal_zone", "goal", "danger", "glob","safe"]
total_number_of_states = 60
# actions = ["move_out", "normal", "goal_zone", "goal", "star", "globe", "protect", "kill"... |
from django import forms
from django.forms import ModelForm
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import Event, Announcement, EventPlanner, Appointment, StaffProfile, Comment, SubjectClass, SubjectGrade, ReportCardPage
from django.contrib.auth.mixins import LoginRequiredMixin, Us... |
"""
This module speficies class Notifier for transaction processing based on specified watchlists.
"""
import logging
import smtplib
import requests
import queue
from datetime import datetime, timedelta
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.utils import formatda... |
import numpy as np
import matplotlib.pyplot as plt
from survival.distributions.weibull import *
from survival.distributions.lomax import *
from survival.distributions.lognormal import *
from survival.distributions.loglogistic import *
from survival.nonparametric.non_parametric import *
from survival.markovchains.markov... |
import argparse
import json
import neat
import os
import subprocess
import re
import sys
import matplotlib
# select matplotlib backend
matplotlib.use('pdf')
import matplotlib.pyplot as plt
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from goal_reaching.utils_gr import parse_controller... |
"""
rtd.py
------
Attempt at an implementation of the rank turbulence divergence, which
was recently introduced in the following paper:
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>.,
<NAME>., <NAME>., <NAME>., <NAME>., <NAME>.
(2020). Allotaxonometry and rank-turbulence divergence: A universal instrument
for comparing... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.