text stringlengths 3.07k 22.1k |
|---|
# coding=utf-8
# Copyright 2019 team Purifier
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License")
from __future__ import absolute_import, division, print_fun... |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 18 10:53:12 2019
@author: ivan
"""
"""
Signature: mesh.ray.intersects_location(ray_origins,
ray_directions,
multiple_hits=True)
Docstring:
Return the location of where a ray hits a surface.
P... |
import torch
import torch.nn as nn
import torch.utils.data as Data
import torchvision
import numpy as np
from copy import deepcopy
from trajectoryReweight.gmm import GaussianMixture
from scipy import spatial
class WeightedCrossEntropyLoss(nn.Module):
"""
Cross entropy with instance-wise weights. Leave `aggregate` t... |
#
# (C) 2014-2017 <NAME>
# Licensed under the MIT License (MIT)
# http://opensource.org/licenses/MIT
#
import os
import yaml
""" Import Wildman-Crippen logP parameters """
with open(os.path.join(os.path.dirname(__file__), "wclogp.yaml")) as file:
DATA = yaml.load(file.read())
def wclogp(mol):
return wcparam... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
# Utility functions.
import getpass
import glob
import hashlib
import json
import logging
import os
import platform
import re
import shutil
import subprocess
# Third party modules
import git
def run(cmd, cwd=None, sanitiz... |
import csv
import os
import re
import read_file as RF
import write_file as WF
import matplotlib.pyplot as plt
import numpy as np
import itertools
import pandas as pd
import seaborn as sns # need to install in our environment for visualization of plot
import interquantile_range as IQR
import z_score_algo as ... |
import os
import time as s
from datetime import date, datetime
import webbrowser
import sys
import inspect
# setting up variables etc.
os.environ['API_USER'] = 'd.koot'
os.environ['API_PASSWORD'] = '<PASSWORD>##'
version = "v1.1.2"
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
cs_input = ""
allSettings... |
import pystan
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import seaborn as sns
import pandas as pd
import numpy as np
import scipy.stats as stats
import sys
sys.path.append('../')
from LightningF.Datasets.data import create_twofluo, d... |
from __future__ import print_function
import re
import sys
import api
import config
_VALID_SORTS = [
'Number',
'YearFrom',
'YearFromDESC',
'Pieces',
'PiecesDESC',
'Minifigs',
'MinifigsDESC',
'Rating',
'UKRetailPrice',
'UKRetailPriceDESC',
'USRetailPrice',
'USRetailPric... |
from collections import Counter
from cycler import cycle
import qgrid
import pandas as pd
class Board:
"""
Has 4 methods:
- add: if one adds cubes to the city
- remove: if one removes cubes from the city
- draw: infection step, may pass several cards at once.
... |
import cv2
import numpy as np
import itertools
import mediapipe as mp
from mediapipe.python.solutions import face_detection
mp_face_detection = mp.solutions.face_detection
face_detection = mp_face_detection.FaceDetection(
model_selection=0,
min_detection_confidence=0.5
)
mp_drawing = mp.solutions.drawing_util... |
"""Command-line interface."""
import re
import click
from loguru import logger
from .etl import DATA_DIR, collections, qcmr
def _fiscal_year_etl(cls, fiscal_year, dry_run, no_validate):
"""Internal function to run ETL on fiscal year data."""
# Get the directory of raw files
dirname = cls.get_data_dire... |
from os.path import dirname, basename
import os.path
from asgiref.sync import async_to_sync
from bokeh.embed import components
from bokeh.events import Event, PanEnd, Reset, PinchEnd, Pinch, MouseWheel
from bokeh.layouts import gridplot, layout, column, row
from bokeh.models import BoxSelectTool, LassoSelectTool, Colu... |
import json
import os
import sys
from urllib.parse import parse_qs
from oidcmsg import add_base_path
from oidcop.configure import create_from_config_file
from oidcop.utils import lower_or_upper
from oidcrp.configure import Configuration
import pytest
import responses
from fedservice.configure import FedRPConfiguratio... |
from asyncio.windows_events import NULL
from sys import flags
from turtle import title
from unicodedata import category, name
from django.contrib.auth import authenticate, login, logout
from django.db import IntegrityError
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
fr... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 16:45:08 2019
@author: <NAME> - <NAME> - <NAME> - <NAME> - <NAME> - <NAME>
This project was presented in the 3rd Summer Datathon on
Linguistic Linked Open Data (SD-LLOD-19) at Schloss Dagstuhl,
Leibniz Center for Informatics, Wadern, Germany.
More informati... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
import sublime
import sublime_plugin
import webbrowser
import datetime
import codecs
from operator import attrgetter
if int(sublime.version()) < 3000:
import locale
_target = None
_user_input = None
_display = True
############... |
import json
import hashlib
import logging
import requests
from time import time
from uuid import uuid4
from textwrap import dedent
from urllib.parse import urlparse
from flask import Flask, jsonify, request
class Blockchain(object):
def __init__(self):
self.chain = []
self.current_transactions = []
self.nodes =... |
import socket
import threading
import hashlib
import base64
import struct
from colorama import Back
from loguru import logger as LOG
def server(host, port, backlog=100):
sock_srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
with sock_srv:
sock_srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEAD... |
from dataclasses import dataclass
from enum import Enum
from typing import Callable, Iterator, Sequence, Text, Union
from collections import deque
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import LabelEncoder
from sklearn.feature_extraction import DictVectorizer
@dataclass()
class ... |
import numpy as np
import os
import h5py
from config import IMAGE_DATASET_NAME, BOARD_DATASET_NAME, proj_path, IMAGE_CHANNELS, TRAIN_IMAGE_SIZE, BOARD_SIZE, BATCH_SIZE
import argparse
import sys
def _generate_batch_indices(pool, batch_size):
batch_indices_list = []
remain = np.ones([np.shape(pool)[0]], dtype=... |
################################################################################
# Python script for ..
# - Description:
# - Author: <NAME> (<EMAIL>)
################################################################################
################################################################################
# Co... |
# coding=utf-8
import os
import re
import sys
import platform
import subprocess
import sysconfig
import torch.utils.cpp_extension
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(se... |
import argparse
import csv
import json
import os
import random
from typing import List, Tuple
import networkx as nx
import numpy as np
from tqdm import tqdm
def create_graph(
node_list: List[int], edges_dataset: List[Tuple[str, str, str]]
) -> nx.Graph:
"""Creates graph from list of nodes and list of edges
... |
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing ... |
# 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, software
# distributed under t... |
# coding=utf-8
# !/usr/bin/python3.6 ## Please use python 3.6
"""
__synopsis__ : Builds embeddings for pre-trained sentences using either LSTM or CNN.
__description__ : Builds embeddings for pre-trained sentences using either LSTM or CNN.
__project__ : MNXC
__author__ : <NAME> <<EMAIL>>
__version__ : "... |
import argparse
import os
import shutil
import time
import datetime
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms... |
from django.contrib import admin
from .models import Contact, ContactNote, \
ContactAddress, ContactRoleGroup, RoleGroup, Zone, \
Center, IndividualRole, IndividualContactRoleCenter, \
IndividualContactRoleZone, ContactTag
from config.models import Tag
admin.AdminSite.site_header = "aasaan"
admin.AdminSi... |
import json
import time
import datetime
import os
from subprocess import run
from unittest.mock import patch
import pytest
import rq
from gtmcore.dispatcher import Dispatcher, default_redis_conn
import gtmcore.dispatcher.jobs as bg_jobs
from gtmcore.dispatcher.tests import RUNNING_ON_CI, BG_SKIP_MSG, BG_SKIP_TEST
fr... |
# Borrowed from django.contrib.auth.hashes v1.11
import binascii
import hmac
import hashlib
import importlib
import warnings
import random
import time
import re
from collections import OrderedDict
UNUSABLE_PASSWORD_PREFIX = '!' # This will never be a valid encoded hash
UNUSABLE_PASSWORD_SUFFIX_LENGTH = 40 # number o... |
#!/usr/bin/env python3
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from apiclient import errors
from datetime import datetime, timezone
import os.path
import pickle
import ast
import operator
import time
import l... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2020-2021 <NAME> <<EMAIL>>
#
# Distributed under terms of the BSD 3-Clause license.
"""Main function.
"""
# pylint: disable=wrong-import-position
import time
import logging
import pathlib
import argparse
# due to openmpi's problematic im... |
import os
import pickle
import hashlib
import time
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (12.0, 12.0)
from PIL import Image
from joblib import Parallel, delayed
### Create config file
class DatasetGeneratorConfig():
# Scene image shape
IMAGE_WIDTH = 96
... |
import argparse
import os
import random
import shutil
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import network
import numpy as np
import pre_process as prep
import torch
import torch.nn as nn
from data_list import ImageList
from sklearn.manifold import TSNE
from torch.utils.data import DataLoader
from... |
"""
Integration test taking in csv of local attributions
and producing csv of global attributions
"""
import glob
import os
import numpy as np
import pandas as pd
import pytest
from gam import gam
import dask.array as da
import dask.dataframe as dd
from dask.distributed import Client
def test_read_df_or_list():
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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... |
import IMU
import math
import datetime
# If the IMU is upside down (Skull logo facing up), change this value to 1
IMU_UPSIDE_DOWN = 0
RAD_TO_DEG = 57.29578
M_PI = 3.14159265358979323846
G_GAIN = 0.070 # [deg/s/LSB] If you change the dps for gyro, you need to update this value accordingly
AA = 0.40 # Complemen... |
#!/usr/bin/env python
import os, sys
import re
from itertools import izip_longest
import random
import csv
import logging
import numpy as np
import data_utils
from data_utils import tokenize, tokenize_hanzi
from zipfile import ZipFile
from data_utils import get_file, to_one_hot, syslogger
download_all_csvs = False
# ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 8 22:49:54 2019
image
@author: chineseocr
"""
from PIL import Image
import numpy as np
import cv2
import time
def timer(func):
def new_func(*args, **args2):
t0 = time.time()
back = func(*args, **args2)
print ("%.3fs tak... |
#!/usr/bin/env python3
import random
import math
import numpy as np
from itertools import chain
class Unit:
def __init__(self, value, grad=0):
self.value = value
self.grad = grad
def __add__(self, other):
return Unit(self.value + (other.value if isinstance(other, Unit) else other))
... |
import glob
import numpy as np
import matplotlib.pyplot as plt
import cv2
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
from datetime import datetime
import time
import yaml
from pathlib import Path
from nd2reader import ND2Reader
import pandas as pd
from scipy import ndimage as ndi
from skimag... |
import numpy as np
import scipy
import torch
from nystrom import Nystrom
from gaussian_exact import GaussianKernel
import sys
sys.path.append("../utils")
from misc_utils import set_random_seed
from quantizer import Quantizer
import math
EPS = 1e-15
class EnsembleNystrom(object):
def __init__(self, n_feat, n_learn... |
import pygame
import os
import sys
pygame.init()
pygame.font.init()
pygame.mixer.init()
import random
win = pygame.display.set_mode((600,300))
score_font = pygame.font.SysFont('comicsans',20)
game_font = pygame.font.SysFont('comicsans',40)
pygame.display.set_caption("Dinorun")
clock = pygame.time.Clock()... |
# ============================================================================
#
# Copyright (C) 2007-2016 Conceptive Engineering bvba.
# www.conceptive.be / <EMAIL>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
... |
#---------------------------
# organize imports
#---------------------------
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import random
import os
import warnings
from sklearn.datasets import load_boston
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from s... |
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, List, Optional, Tuple
import numpy as np
import torch
from torch import nn as nn
class MLP(nn.Module):
"""A Multi-layer Perceptron."""
def __init__(
self,
input_dim: int,
output_dim: int,
... |
"""
.. module:: computers
:platform: Unix, Windows
:synopsis: a module for defining computers, which are subclasses of OpenMM Context_ class.
.. moduleauthor:: <NAME> <<EMAIL>>
.. _Context: http://docs.openmm.org/latest/api-python/generated/simtk.openmm.openmm.Context.html
"""
import itertools
import numpy a... |
import sys, os, subprocess
import argparse
import statistics
import optuna
import yaml
import random
import pathlib
from datetime import datetime
from nto_templating import template_from_tunable_dict
def get_all_tunables(tunables_file):
with open(tunables_file, "r") as stream:
try:
tunables_ya... |
# -*- coding: utf-8 -*-
"""CREEDS Analysis."""
import pickle
import logging
from collections import defaultdict
from typing import Optional, Type
import bioregistry
import bioversions
import numpy as np
import pandas as pd
import protmapper.uniprot_client
import pyobo
import pystow
import seaborn
from indra.sources ... |
# Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
import ase.data as ad
from pyscf import gto, dft, scf, cc, mp, ci
#from pyscf.geomopt import berny_solver
import aqml.cheminfo.core as cic
import os, sys, scipy
from pyscf.tools.cubegen import *
from pyscf.data import elements
import numpy as np
from functools import reduce
import pyscf
_mult = {1:2, 3:2, 4:1, 5:2, 6... |
import threading
import socket
import random
import time
import socket
import threading
import queue
import string
import time
import os
import math
import sys
PORT_DETECTOR = 9001
PORT_WARNING = 9002
MAX_LENGTH = 100000
BATCH_SIZE = 64
PORT_REPORT = 9004
PORT_QUERY = 9005
batch_size = 4
model_path = '/home/ubuntu/... |
# Copyright 2014 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 applicable law or agre... |
#!/usr/bin/env python3
import json, sys, argparse
from core.fnv import Fnv
from core.aes import AES256
class Key:
def __init__(self, config, before, after, fnv, password):
self.config = config
self.before = before
self.after = after
self.fnv = fnv
self.password = password
class Greta:
def __init__(self, ... |
# Copyright 2013-2019, <NAME> and The Tor Project
# See LICENSE for licensing information
"""
Parsing for Tor microdescriptors, which contain a distilled version of a
relay's server descriptor. As of Tor version 0.2.3.3-alpha Tor no longer
downloads server descriptors by default, opting for microdescriptors instead.
... |
#!/usr/local/bin/python3
#
# Usage: parse.py WATCH_FILE
# Generates watch face image from passed watch file and saves it to
# 'index.html'. If no argument is specified, then all files in folder 'watches'
# get parsed.
import ast
import os
import sys
from collections import namedtuple
from math import ceil, sqrt
fro... |
"""
# _*_ coding: utf-8 _*_
# @Time : 2021/02/09 00:47:19
# @FileName: strcnn.py
# @Author : <NAME>
# @Software: VSCode
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from ...build import BACKBONE_REGISTRY
class BasicBlock(nn.Module):
def __init__(self, in_channels):
... |
# -*- coding: utf-8 -*-
#
import math
from mpmath import mp
import numpy
import pytest
import quadpy
from helpers import check_degree_1d
@pytest.mark.parametrize(
"scheme",
[quadpy.line_segment.Midpoint()]
+ [quadpy.line_segment.Trapezoidal()]
+ [quadpy.line_segment.ClenshawCurtis(k) for k in range... |
# Copyright 2015, Pinterest, Inc.
#
# 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 writ... |
from __future__ import annotations
from dataclasses import dataclass, replace
from typing import Tuple, Iterator, FrozenSet, List, TypeVar, Generic, Type
from functools import reduce
from operator import and_
from .constants import ACTION, INCLUDE, EXCLUDE, AS, IN, T_STATE, INDEX, STATE, CASE
from .generic_items impor... |
# -*- coding: utf-8 -*-
"""MPI support wrapper using mpi4py as backend.
License: 2-clause BSD; copyright 2012-2017 <NAME> and University of Jyväskylä.
To load MPI, import this module. The module is designed so that it can
always be imported, regardless of whether mpi4py is installed.
The availability of the mpi4py l... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatch
import matplotlib.path as mplPath
# =============================================================================
# Define functions
# =============================================================================
def mask_from_poly... |
from IMLearn.utils import split_train_test
from IMLearn.learners.regressors import LinearRegression
from typing import NoReturn
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.io as pio
import matplotlib.pyplot as plt
pio.templates.default = "simple_wh... |
"""
This module provides fittable models based on 2D images.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import warnings
import logging
import numpy as np
import copy
from astropy.modeling import Fittable2DModel
from astropy.modeling.parameters imp... |
import os
import cv2
import glob
import json
import shutil
import pickle
import numpy as np
from PIL import Image
from io import BytesIO
from termcolor import colored
import alfred.gen.constants as constants
TRAJ_DATA_JSON_FILENAME = "traj_data.json"
def prepare_for_traj(json_file, args):
# make directories
... |
import pandas as pd
import numpy as np
import logging
import torch
import os
import src.config as cf
import src.problem_config as pcf
def read_instance_data(instance_name, path):
"""reads instance data"""
PATH_TO_BENCHMARK_INSTANCES = path
benchmark_file = '{path_to_benchmark_instances}/{instance}.txt'... |
# ===============================================================================
# Copyright 2016 <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/LI... |
import locale
import sys
import os
from gevent import monkey
monkey.patch_all() # REALLY IMPORTANT: ALLOWS ZERORPC AND TG TO WORK TOGETHER
from twython import Twython
BASE_PATH = os.environ.get('BASE_PATH')
sys.path.insert(1, BASE_PATH + '/telegram-bots/src')
from graphqlclient import GraphQLClient
import time
from... |
"""
Created on Oct 30, 2013
@author: <NAME>
"""
from tkinter import Frame, SUNKEN, StringVar, IntVar, ttk, YView, XView, Scrollbar, Canvas, \
Variable, Text
from tkinter.constants import E, W, LEFT, RIGHT, CENTER, TOP, BOTTOM, X, VERTICAL, FALSE, Y, BOTH, TRUE, NW, END
def make_entry(_master, _caption, _row, _sp... |
import requests
import os
from selenium import webdriver
import sys
import time
import inspect
import random
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from panel import logo
lang_codes = ["en-US", "en-GB... |
import gym
import numpy as np
import opentuner
from opentuner import ConfigurationManipulator
from opentuner import FloatParameter, Result
from opentuner.measurement import MeasurementInterface
from multiprocessing import pool
pool = pool.Pool()
def nyan(cfg):
def core():
env = gym.make('BipedalWalker-v... |
#!/usr/bin/env python
# coding: utf-8
"""
This script joins the following datasets`claim_vehicle_employee_line.csv`,
`Preventable and Non Preventable_tabDelimited.txt` and `employee_experience_V2.csv`
to create a CSV file that contains the required information for the interactive plot.
It also cleans the resulting CS... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.ResNet50Encoder import Bottleneck
class DeepLabHead(nn.Module):
def __init__(self, num_classes, encoder):
super().__init__()
self.aspp = ASPP(2048, 256)
self.low_level_feature_reducer = nn.Sequential(
... |
import warnings
import numpy as np
from scipy.integrate import IntegrationWarning, quad, quad_vec
# Load the C library
import os.path
from pathlib import Path
import ctypes
# # Commands to manually generate
# gcc -Wall -fPIC -c voigt.c
# gcc -shared -o libvoigt.so voigt.o
dllabspath = Path(os.path.dirname(os.path.abs... |
# -*- coding: utf-8 -*-777777yyy
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, sys
import csv
from frappe.utils import getdate
def import_students():
with open(frappe.get_app_path('shishuvan', 'stude... |
# encoding: utf-8
from attest import (
Tests, assert_hook,
contextmanager, raises,
)
import rdflib
from lkbutils import relationprovider
relationchecker_unit = Tests()
relationprovider_unit = Tests()
@contextmanager
def empty_relationchecker(**options):
try:
yield relationprovider.RelationCheck... |
import numpy as np
from os import path as osp
from glob import glob
from superpoint.settings import EXPER_PATH
def get_paths(exper_name):
"""
Return a list of paths to the outputs of the experiment.
"""
return glob(osp.join(EXPER_PATH, 'outputs/{}/*.npz'.format(exper_name)))
def compute_tp_fp(data,... |
#
# This code is placed into the PUBLIC DOMAIN.
# It was written by <NAME> <EMAIL>
#
"""
Sherpa interface to XSPEC local models from [1]_:
agnslim
zkerrbb
thcompc (convolution; only supported if CIAO contrib package
is loaded)
agnslim 14 0.03 1.e20 agnslim add 0
mass... |
import calendar
import csv
import datetime
import json
import os
import random
import sys
import time
from pathlib import Path
from typing import Literal
import requests
import yaml
def pre_checks(config:dict,mode:Literal["fast","full"]):
"""Pre check function to create directory and generate endpo... |
import os, sys, numpy, logging, time, warnings, json
from pathos.multiprocessing import Pool, ThreadPool, cpu_count
from mpi4py import MPI
from itertools import product
from argparse import ArgumentParser
#
from covid19_stats.engine import core, viz, viz2
from covid19_stats import COVID19Database
os.environ[ 'NUMEXPR_... |
# Copyright (c) 2013 Rackspace
# 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... |
# This file is part of the kivy-garden project.
# Copyright (c) <NAME>, <EMAIL>
# Available under the terms of the MIT license.
"""Several textures superimposed on one another, and possibly offset
by some amount.
In 2D games where characters can wear different clothes or hold
different equipment, their graphics are of... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2017/11/4 上午9:26
# @Author : fanqiang
# @Site :
# @File : spider.py
# @Software: PyCharm
import hashlib
import pathlib
import re
import subprocess
import time
from datetime import datetime
import requests
from PIL import Image, ImageEnhance
from pret... |
#!/usr/bin/python
import datetime, requests, sys, json, inquirer, urllib
# Entry in the timesheet
class OperateEntry:
date = None
duration = None
client = None
project = None
task = None
rate = 0
billable = 0
def __init__(self, date, duration, client=None, project=None, task=None):
... |
#!/usr/bin/env python3
import os
import binascii
import time
from os import listdir
from pathlib import Path
from typing import List, AnyStr
from core.operation import Operation
from utils.test_result import TestResult
from utils.process_manager import ProcessManager
from input_parser import add_operation
class Tes... |
# Copyright (c) 2020 <NAME> & LabWare
#
# This program and the accompanying materials are made available under
# the terms of the MIT license, see LICENSE file.
#
# SPDX-License-Identifier: MIT
"""
This module contains classes and functions to
model image objects (i.e., Smalltalk objects)
"""
import gdb
from itertoo... |
#!/usr/bin/python
# Copyright (c) 2017, 2018, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
from builtins import *
from builtins import str
from builtins import range
import os
impo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 7 14:24:20 2021
@author: bmoseley
"""
# This module defines various active schedulers, which are iterables which allow us
# to define which FBPINN subdomains are active/fixed/inactive at each training step
# This module is used by constants.py w... |
"""
This is a single-class program.
In the driver main class, you can choose:
+ whether to apply median-of-three by changing mOfThree = True/False
+ whether to write an output file by changing writeFile = True/False.
A random generator will be used to initialize the input arrays.
Sort will automatically run on both ... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
class input_data:
"""Data object that handles reading in the data.
Args:
filename (string): The filename of the input file.
filedir (string): The directory containing the input file.
"""
def... |
# -*- coding: utf-8 -*-
"""
Provides various URLs handles for the website
"""
from flask import render_template, render_template_string, request, jsonify
from app import app
from nlp import LocationTagger
from geolocator import Geolocator, RetrieveLatLngs
import time
@app.route('/')
@app.route('/home')
def Index():... |
# -*- coding: utf-8 -*-
"""
Q02 from First assignment letter (c)
Backpropagation, Stochastic with Delta Rule and Momentum Term
Class Deep Learning
UFPB
Mar, 31 2018.
<NAME>
GitHub @rafaelmm
"""
####################################
# IMPORTANT THINGS HERE
#
#
####################################
... |
#### imports ####
import matplotlib
import pandas as pd
from modelinter.models.constants import Const, ConstE, TimeseriesVariablesE, Paths, Slices
matplotlib.use('nbagg')
from types import SimpleNamespace
def process_timeseries(load_path):
timeseries = pd.read_csv(load_path)
timeseries.timestamp = pd.to_da... |
from collections import defaultdict
import cv2
import numpy as np
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.autograd import Variable
from torch.utils.data import DataLoader
from tqdm import tqdm
from config import opt
from data.dataset import yoloDataset
from models.res... |
import typing as tp
import pathlib
import functools
import torch
import pytorch_lightning as pl
import tqdm
import os
import numpy as np
import numpy.typing as npt
from .utils import parse_line, uopen
_PtrNetItem = tp.Tuple[torch.Tensor, torch.Tensor, torch.Tensor]
_Batch = tp.Tuple[
torch.nn.utils.rnn.PackedSeq... |
# Copyright (c) 2019 <NAME> (<EMAIL>)
# parts of the code was borrowed from
# 1. Atlasnet(https://github.com/ThibaultGROUEIX/AtlasNet/blob/master/auxiliary/model.py)
# 2. DGCNN (https://github.com/WangYueFt/dgcnn/blob/master/pytorch/model.py)
from __future__ import print_function
import sys
import torch
import torc... |
import cv2, imutils
import numpy as np
import socket
import time
import process_image
from parameters import numCam, STOP, UP, DOWN, RIGHT, LEFT, direction, grid_size, frame_height, frame_width, decision, TCP_IP_RPI, TCP_PORT_WASD, TCP_IP_WORKSTATION, TCP_PORT_IMU_DATA, BUFFER_SIZE, tracker
position = []
def drawBo... |
from typing import Tuple
from typing_extensions import Literal
import numpy as np
import pydicom
import xarray as xr
from pymedphys._dicom import dose
def xdose_from_dataset(
ds: "pydicom.dataset.Dataset",
name="Dose",
coord_system: Literal["D", "P", "S"] = "S",
) -> "xr.DataArray":
return xr.DataA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.