text stringlengths 6.04k 39.5k |
|---|
"""
Copyright (c) 2017, Battelle Memorial Institute
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of cond... |
from sqlalchemy import create_engine
from td.client import TDClient
from datetime import datetime
from td import exceptions
from requests.exceptions import ConnectionError
import datetime
import pandas as pd
import sqlite3
import time
import credentials
print("- Modules imported -")
def make_sqlite_table(table_name)... |
# -*- coding: UTF-8 -*-
# NOTE: Local Best Version Under Development to be integrated with clinn.py
import itertools
from functools import reduce
import operator
import tensorflow as tf
import time
import random
import math
import argparse
from utils import msgtime, str_memusage, print_prog_bar, fcn_stats, chical, max... |
from xml.dom import minidom
import pyperclip
import numpy as np
import json
import tqdm
import multiprocessing
import lief
import re
class ImportsFeatures(object):
dim = 1000
APIsList = []
def FindApi(self,ApiName,ApiList):
for x in range(len(ApiList)) :
if ApiList[x] == ApiName:
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 30 04:52:49 2018
Kumpulan Fungsi EMpirical Analysis Hard Clustering
Mata Kuliah Data Mining Prodi Statistika FMIPA UI
Semester Ganjil 2018
@author: <NAME>
"""
import numpy as np, time
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.datasets... |
import argparse
import ruletaker.common as common
from ruletaker.common import Example, Fact, Rule, Theory, TheoryAssertionInstance
import json
import nltk
from nltk import Nonterminal, PCFG
from numpy.random import choice
import random
import problog
from problog.program import PrologString
from problog.core import ... |
from collections import OrderedDict
from Config.ResourceType import ResourceType
from SharedMethods import get_resource_type
from IndicatorObject import IndicatorObject
from IndicatorObjectAdvanced import IndicatorObjectAdvanced
from RequestObject import RequestObject
from AttributeObject import parse_attribute
from T... |
# Leo colorizer control file for cython mode.
# This file is in the public domain.
# Properties for cython mode.
properties = {
"indentNextLines": "\\s*[^#]{3,}:\\s*(#.*)?",
"lineComment": "#",
}
# Attributes dict for cython_main ruleset.
cython_main_attributes_dict = {
"default": "null",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import fontforge
import psMat
import os
import sys
from datetime import datetime
ASCENT = 1600
DESCENT = 400
FULLWIDTH = 2400
HALFWIDTH = 1200
SOURCE = os.getenv('JuGeM_SOURCE_FONTS_PATH', './sourceFonts')
LICENSE = open('./LICENSE.txt').read()
COPYRIGHT = open('./COPYRIGH... |
# Copyright 2017 The TensorFlow 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 applica... |
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the NiBabel package for the
# copyright and license terms.
#
### ### ### #... |
import copy
import cv2
import datetime
import os
import numpy as np
import pandas as pd
import streamlit as st
import altair as alt
from vega_datasets import data
from PIL import Image
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.preprocessing.image import img_to_array
f... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 18 02:09:40 2017
@author: cusgadmin
"""
# DONE: Find ratio for polytope vs inner ellipsoid
# DONE: Find ratio for polytope vs random point hull
# TODO: Find ratio for polytope vs charge separation point hull
import numpy as np
import cvxpy
import cdd
import time
# Pro... |
#!/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import numpy.linalg as nl
import scipy.linalg as sl
import scipy.stats as ss
import time
aca = np.ascontiguousarray
def H(arr):
"""conjugate transpose"""
return arr.T.conj()
def eig(M):
return np.sort(np.abs(nl.eig(M)[0]))[::-1]
def truncate_r... |
# Copyright(c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
from typing import Callable, List
import abc
import dill
import inspect
import textwrap
from pandas import DataFrame
import warnings
RETURN_COLUMN_NAME = "return_val"
"""
_SQLBuilder implementations are used ... |
"""Methods for formatting recaps from tab-based lists into WorldAnvil/BBcode"""
def format_recap(text):
"""take a string containing lines that are tab-indented.
Output BBCode for WorldAnvil"""
link_map = init_links()
lines = text.splitlines()
length = len(lines)
formatted = []
i = 0
wh... |
import cv2
#import matplotlib.pyplot as plt
import pdb
import time
import serial
import json
import os
from check_frame_rate import approx_frame_rate
import cam_threads
from utils import get_current_list,update_list
# TO DO:
# Change to 2 min acquisition
# remove baseline1 and baseline 2
# To Do:
# check the synchron... |
#! /usr/bin/env python
#
# This script ingests the ADMIT results (the textual ones, not XML) into a sqlite3 database
# to be queried with astroquery.admit
#
# There is also an option to query the alma.db via a side door
#
#
# import admit_study7.log as "admit" (L/W/S)
# import admit_sq.log as "alma" (A)
#
# ... |
import requests
from matplotlib.pyplot import imshow
import time
from PIL import Image, ImageDraw
import face_recognition
import pandas as pd
import numpy as np
from os.path import basename
import math
import pathlib
from pathlib import Path
import os
import random
from sklearn.preprocessing import normalize
from skle... |
# -*- coding: utf-8 -*-
#
# Authors: <NAME>, Finland 2010-2014
# <NAME>, Finland 2013
#
# This file is part of Kunquat.
#
# CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, Kunquat Affirmers have waived all
# copyright and related or neighboring rights... |
# +++++++++++++MODULE++++++++++++++++
from cgitb import text
from logging import root
from sre_parse import State
from tkinter import *
from tkcalendar import Calendar
from tkinter import messagebox
import pickle
import time
from datetime import date, datetime
from random import randint
import os.path
from tkinter impo... |
# coding=utf-8
import copy
from p2_mahjong.DEF import ActionType
log_head = "player.py"
class MahjongAction:
def __init__(self):
self.action = ActionType.ActionTypeNull
self.origin_actor_type = 0
self.player_id = 1
self.assist_card = []
self.target_card = None
self... |
from __future__ import print_function
import os
import sys
import shlex
import platform
from datetime import datetime
# https://stackoverflow.com/questions/11301138/how-to-check-if-variable-is-string-with-python-2-and-3-compatibility/11301392?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
try... |
# Copyright 2016 Eotvos Lorand University, Budapest, Hungary
#
# 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 appli... |
# The Admin4 Project
# (c) 2013-2022 <NAME>
#
# Licensed under the Apache License,
# see LICENSE.TXT for conditions of usage
import wx
import adm
import logger
from wh import xlt, Menu, StringType
def TreeItemData(data):
return data
class TreeCtrl(wx.TreeCtrl):
def __init__(self, parentWin, name, size=wx.Def... |
"""
@date: 20.11.29
@editor: <NAME> <EMAIL>
Modified code to probe appositional and noun compound modifiers.
Part of UMass CS685 Fall 2020 project"""
import os
import io
import logging
import torch
import numpy as np
# from senteval.tools.validation import SplitClassifier
# New code
from reval.probing_tasks.probe_val... |
""" This module is going to parse ICR in JSON format and convert to html web page
"""
import json
import argparse
import os.path
import cgi
import logging
import pprint
from LogManager import logger, initConsoleLogging
from ICRSchema import ICR_FILE_KEYWORDS_LIST, SUBFILE_FIELDS
from ICRSchema import isSubFile, isWord... |
import enum
from datetime import datetime, timedelta, timezone
import pytz
from django.db import models
from rest_framework.exceptions import ValidationError
from vbb.utils.models.base import BaseUUIDModel
TIMEZONES = tuple(zip(pytz.all_timezones, pytz.all_timezones))
# NOTE this should be a relationship to the L... |
# -*- coding: cp1252 -*-
#Setup start
import pygame
import sys
import time
import random
import os
from definitions.color import *
from pygame.locals import *
pygame.init()
pygame.display.set_caption('Oisin\'s Maths Quiz')
WINDOWWIDTH = 640
WINDOWHEIGHT = 480
DISPLAYSURF = pygame.display.set_mode((WINDOWWIDTH, WINDO... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
def tanh_clip(x, clip_val=10.): # Nawid- Clips the output of a tanh
'''
soft clip values to the range [-clip_val, +clip_val]
'''
if clip_val is not None:
x_clip = clip_val * torch.tanh((1. / clip_val) * x)
... |
""" Different Data Processing and Other Helper Functions """
import sys
import os
import json
from shutil import copyfile
import re
from collections import Counter, OrderedDict
from hashlib import md5
import random
import time
from multiprocessing import Pool
import logging
import tensorflow as tf
import numpy as np
... |
#!/usr/bin/env python
# Installed
import numpy as np
# Local
from mm3dot import MM3DOT, init_mm3dot_arg_parser, run_mm3dots
from mm3dot.model import load_models, Model, MOTION_MODELS
from mm3dot.datapi import ifile
# Extensions
import mm3dot.model.constant_accumulation
import mm3dot.model.kalman_tracke... |
from __future__ import annotations
import json
import os
import pathlib
import pickle
from copy import deepcopy
from typing import Callable, Dict, List, Optional, Sequence, Union
import cytoolz as tz
import datasets
from datasets import Features
from datasets.arrow_writer import ArrowWriter
from pyarrow import json a... |
"""Diagnose 21 installation."""
from urllib.parse import urljoin
import enum
import logging
import os
import platform
import requests
import shutil
import socket
import sys
import urllib.parse as parse
import click
from two1.commands import market
from two1.commands.util import bitcoin_computer
from two1.commands.uti... |
#
# MIT License
#
# (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
#
# 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... |
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.forms import Form, ModelForm, BaseModelFormSet
from django.forms.fields import CharField, ChoiceField, IntegerField
from django.forms.widgets import Select, TextInput, NumberInput
from .models import Source, Meta... |
# * From: https://github.com/youngjung/improved-precision-and-recall-metric-pytorch (MIT license)
# * Fetched: 05 May 2022
# * Modifications: Compatibility with architecture and memory optimization.
import os
from functools import partial
from collections import namedtuple
from glob import glob
import numpy as np
from... |
#!/usr/bin/env python3
import struct
import serial
from enum import Enum, unique
class CRCError(Exception):
pass
def rint(x):
return int(round(x))
def digit_str(value, max_decimals, disp_digits=4):
'''Fixed-width output of numeric value, to simulate segmented display behavior'''
int_digits = 1 if ... |
import asyncio
import json
import logging
import sys
from asyncio.events import AbstractEventLoop
from datetime import datetime, timezone
from typing import Any, AsyncGenerator, Callable, Optional, Union
from ansq.tcp import consts
from ansq.tcp.exceptions import (
ConnectionClosedError,
NSQUnauthorized,
P... |
# Columbus - An A* Integrated Smart Navigation System
# <NAME>
# This is the main file that controls all features of Columbus. This file calls
# others in the main project folder to import and export data as needed to
# operate Columbus and create a cogent user-experience. This file will call
# Columbus' main algorith... |
import argparse
import logging
import time
# from xlwt import Workbook
import cv2
import numpy as np
import math
import matplotlib.pyplot as plt
from scipy.signal import find_peaks_cwt
import scipy.signal as signal
from scipy.interpolate import make_interp_spline, BSpline
from matplotlib.pyplot import plot, scatter,... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 2 11:53:24 2020
@author: mike_ubuntu
"""
import time
import numpy as np
import tensorflow as tf
from scipy.interpolate import RegularGridInterpolator
import matplotlib.pyplot as plt
def Heatmap(Matrix, interval = None, area = ((0, 1), (0, 1))):
... |
#!/usr/bin/python
import olymap
from olypy.oid import to_oid
import olymap.utilities as u
from olymap.loc import get_barrier, get_civ_level
import olypy.details as details
import pathlib
from pngcanvas import *
import math
from olypy.db import loop_here
from jinja2 import Environment, PackageLoader, select_autoescape
... |
#<NAME>'s Iterator for grtrans as of June 23, 2015
#Added Secant method to the iterator, no longer producing 3 per iteration
#Factor of 4 speedup from before
#When using, look at the power law dependence of the flux on mdot or whatever, and use appropriately.
#note iterator can be turned off by finding 33 + tries an... |
from fileinput import filename
import os
import sys
import logging
from glob import glob
import spacy
import pandas as pd
from bs4 import BeautifulSoup
from tqdm import tqdm
import xml.etree.ElementTree as ET
from nltk import tokenize
import subprocess
import scispacy
import json
import re
import yake
try:
nlp = sp... |
# The storage utility.
# Manipulates the database.
# SQlite/Mongodb.
import os
import sys
import json
from sqlalchemy import Column, ForeignKey, Integer, String, Float, Boolean
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqla... |
# -*- coding: UTF-8 -*-
"""The main window of the pokedex. This module handles all the GTK/Glade
specific functions
"""
import os
from gi.repository import Gtk, GdkPixbuf
from pydex import evolution, io, pokedex, regional_dex, utils
GAMES = [
"Red", "Blue", "Yellow", "Gold", "Silver", "Crystal",
"Ruby", ... |
from umqtt.robust import MQTTClient
import json
import ussl
import socket
import array
import ustruct
import time
import gc
NX_PREFIX = ""
def _encode(data, dtype, dim):
if dtype=="":
if isinstance(data, str):
return bytes(data, "utf-8")
elif isinstance(data, bytes):
return... |
import plotly.express as px
import tkinter as tk
from tkinter import ttk
import re
import pandas as pd
import os
import math
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image, ImageTk
from tkinter import *
import PIL.Image
import matplotlib.image as mpimg
#-------------------------- front end st... |
# # -*- coding: utf-8 -*-
# """
# author: <NAME>, <NAME> Cardiac Research Institute
# """
from __future__ import print_function
from __future__ import division
import subprocess
from subprocess import PIPE
import copy, re
class VCFManager:
vcf_count = 1
def __init__(self, vcf_file, name='VCF ' + str(vcf_coun... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from torch.nn.parameter import Parameter
# abstract class for the encoder of the medication recommendation model
class Encoder(nn.Module):
def __init__(self, device, input_size, hidden_size, diagnoses_count, procedu... |
# Copyright 2016-2021 The <NAME> at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");
# you ... |
"""
A module providing a ToolBox for the users of the compiler to use.
"""
import os
import os.path as path
from collections import namedtuple as named_tuple
from decimal import Decimal
from fpdf import FPDF
from markup import Markup, MarkupStart, MarkupEnd
from tools import assure_decimal, trimmed, assert_instance, ... |
"""Module with functions for plotting IRT-related results."""
import os
from typing import List
import matplotlib.pyplot as plt
import numpy
from mpl_toolkits.mplot3d import Axes3D
from . import irt
from .simulation import Simulator
def __column(matrix, i):
"""Returns columns from a bidimensional Python list (... |
import pygame as pg
import sys
import random
import math
import os
os.environ['SDL_VIDEO_CENTERED'] = '1'
W = 800
H = 600
BG = (100, 100, 100)
WHITE = (255, 255, 255)
car_accident = 0
drove_cars = 0
speed = 2
acceleration = 0.05
f_screen = [1, 2]
level = 40
R, G, B = 0, 255, 0
radius = 140
stop = 1
stop_tick = 0
star... |
from enum import Enum
from time import sleep
from typing import Iterable, Optional, Tuple, Callable
import torch
from torch import FloatTensor, LongTensor, Tensor, BoolTensor
from torch.nn.functional import one_hot, softmax
from transformers import RobertaModel, BertPreTrainedModel, RobertaConfig
import torch.nn as nn... |
import shlex
import docker
import docker.errors
from django.conf import settings
from django.db import transaction
from django.urls import reverse
from django.utils import timezone
from docker.types import Ulimit
from statemachine import StateMachine, State
from containers.models import (
STATE_CREATED,
STAT... |
"""interval - a library for handling periods of time.
Intervals are periods of time - a timedelta with a start date.
ProperIntervals are Intervals that correspond to named periods of time like
dates on a calendar instead of an arbitrary 24 hour period. ProperIntervals
can also vary in length like Months or Years.
In... |
from warnings import warn
import numpy as np
import scipy.sparse
import scipy.sparse.csgraph
from sklearn.manifold import SpectralEmbedding
from sklearn.metrics import pairwise_distances
from sklearn.utils import as_float_array
from topo.base.dists import pairwise_special_metric, SPECIAL_METRICS
from topo.base.sparse... |
import math
import os
from copy import copy
from functools import lru_cache
from functools import partial
from os.path import join
import igl
import numpy as np
from numpy.linalg import norm
#
@lru_cache(maxsize=None)
def get_icosahedron(level=0):
if level == 0:
v, f = get_base_icosahedron()
retu... |
import os,sys
import pandas as pd
import numpy as np
from scipy import odr
from scipy.linalg import invpascal
import scipy.stats as stats
from datetime import datetime
from geographiclib.geodesic import Geodesic
from multiprocessing import Process
from functools import reduce,cmp_to_key
def check_dir(d):
if not os... |
import urllib
from datetime import datetime
from django.conf import settings
from django.utils.datastructures import SortedDict
import commonware.log
from tower import ugettext_lazy as _lazy
import amo
from access import acl
from amo.helpers import absolutify
from amo.urlresolvers import reverse
from amo.utils impor... |
import hashlib
import io
import json
import logging
import os
import pathlib
import shutil
import subprocess
import ue4_constants
import Editor.LogProcesser.packageinfolog as PackageInfoLog
from Editor import commandlets, editorutilities
L = logging.getLogger(__name__)
class ProjectHashMap:
"""
Takes in a ... |
# -*- coding: utf-8 -*-
"""
Fulfil.IO Model Helper
A collection of model layer APIs to write lesser code
and better
"""
import six
import logging
import functools
import warnings
from datetime import datetime, date
from copy import copy
from decimal import Decimal
from money import Money
import fulfil_client
from ful... |
# @mark.steps
# ----------------------------------------------------------------------------
# STEPS:
# ----------------------------------------------------------------------------
import os
import re
import base64
from behave import given, then, when
from pyshould import should, should_not
from servicebindingoperato... |
#!/usr/bin/env python
"""
chimeraBuster is a tool for the detection and correction
of chimeric gene annotations.
This script is the first step of the workflow, aimed
at detecting chimeric genes based on transcript mapping.
For further information please visit the tool Github:
https://github.com/MayroseLab/chimeraBuste... |
import os
import pathlib
import stat
import time
from unittest import mock
from unittest.mock import call
import pytest
import dlpt
thisFile = str(pathlib.Path(__file__).resolve())
thisFolder = os.path.dirname(thisFile)
urlPath = "https://xkcd.com/"
uncPath = r"\\root\rootFolder\folder1\folder2\folder3\folder4"
@... |
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
#
# Copyright (c) 2015 Juniper Networks, Inc.
# All rights reserved.
#
# Use is subject to license terms.
#
# 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... |
from flask import Blueprint, render_template, flash, request, redirect, url_for, jsonify
from flask_login import login_user, logout_user, login_required
from analyzeapp.extensions import cache
from analyzeapp.forms import LoginForm, SelectForm
from analyzeapp.models import User, Recent, Setting
from analyzeapp import ... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
------------------------------------------... |
#------------------------------------------------------------------------------------
# Name: Comparing Two Datasets (Excel Sheets), Measuring Trial Lengths
# Purpose: Takes input from an excel file, finds lines in a certain column
# with multiple lines in them, then spreads it out into multi... |
import argparse
import os
import time
from tqdm import tqdm
import shutil
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
import torch
import torch.distributed as dist
import torch.nn as nn
import apex
from apex import amp
from apex.parallel import DistributedDataParallel as DDP
#from... |
from enum import Enum
class ModelNumber(Enum):
None_ = 0x00000000
# AAAABBCC, AAAA(Project Number), BB(Device Type), CC(Revision)
Drone_3_Drone_P1 = 0x00031001 # Drone_3_Drone_P1 (Lightrone / GD65 / HW2181 / Keil / 3.7v / barometer / RGB LED / Sh... |
import re
from typing import *
import numpy as np
from nlp_libs.fancy_logger.colorized_logger import ColorizedLogger
from .processed_book import ProcessedBook
logger = ColorizedLogger(logger_name='Book Extractor', color='yellow')
def createNamedDictionary(personList):
personList.sort(key=len, reverse=True)
n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 11 13:56:08 2020
@author: amelie
"""
from brian2 import *
from scipy import signal
from FEF_full3_alte import *
from LIP_full_alte import *
from itertools import *
from joblib import Parallel, delayed
import multiprocessing
def save_raster(nam... |
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without res... |
import enum
import sys
import os
import hashlib
import zlib
import collections
import difflib
import operator
import stat
import struct
import time
import urllib.request
# Data for one entry in the git index
IndexEntry = collections.namedtuple("IndexEntry", [
"ctime_s", "ctime_n", "mtime_s", "dev",
"ino", "mo... |
#!/usr/bin/env python
"""
Module for tasks that do post-run processing of output files.
"""
__author__ = "<NAME>"
__license__ = "MIT"
import datetime
import json
import logging
import re
import subprocess
import time
from os import remove
from typing import List
from uuid import uuid4
from cidc_utils.requests import ... |
import numpy as np
from utils.Finger.tool import tools as tl
import cv2
import time
import matplotlib.pyplot as plt
# 面的纹理映射
def mapping_faces_gray(data_points, camera_index_to_points, faces_point, imgs):
# 得出每个三角面片都属于哪一个相机,两个点及以上属于一个相机,则该面属于该相机
camera_index_to_faces = get_faces_belong_which_camera(camera_ind... |
import sys
import datetime as dt
import numpy as np
import scipy.stats
from write_round_scores import find_round_files,get_latest_round_file,\
write_differences
import glob
def running_total(contestant_rounds_dict,rounds_completed):
'''
Calculate the running total for each contest... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import OrderedDict
import numpy as np
import astropy.units as u
from astropy.table import Table
from astropy.time import Time
from ..spectrum.utils import C... |
"""
This file contains the object and CLI for training our VAEs.
The models themselves are in the `models/` directory. Each of these Python
files should have a `build` function that returns a dictionary with
entries for: encoder, decoder, and vae.
We also require each model to define a corresponding `prepare_data` fu... |
""" Models """
import torch
import torch.nn as nn
import torch.nn.functional as F
import random
import numpy as np
import time
import math
import matplotlib.pyplot as plt
class EndToEndOptimus(nn.Module):
def __init__(self, lr=1e-4, weight_decay=0.0, embedding_dim=512):
super().__init__()
self.... |
# -- coding: utf-8 --
import sys
import os
import re
import textwrap
import logging
lg = logging.getLogger('schemaparser')
LANG_NAME = "C++"
NS_PREFIX_MAP = {
"http://www.w3.org/XML/1998/namespace": "xml",
"http://www.w3.org/1999/xlink": "xlink",
"http://www.isocat.org/ns/dcr": "datcat"
}
AUTHORS = "<NAM... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import tensorflow_datasets as tfds
from datetime import datetime
from tensorflow.keras.utils import plot_model
from tensorflow.keras.preprocessing import image
from tensorflow.keras.optimizers import SGD, RMSprop, Adadelta, Nadam, Adamax
from tensorflow.keras.metrics imp... |
"""Converts a CPLEX solution file into the same format produced by CBC
"""
import sys
from typing import List, Union, Tuple
from pytest import mark
from pytest import fixture
import argparse
class ConvertLine(object):
"""Abstract class which defines the interface to the family of convertors
Inherit this clas... |
# Original work Copyright 2018 The Google AI Language Team Authors.
# Modified work Copyright 2019 <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/license... |
import json
import urllib.parse
import base64
import datetime
import time
import logging
import log
import zlib
import os
import boto3
import requests
# import uuid
from requests_aws4auth import AWS4Auth
from botocore.client import Config
from types import SimpleNamespace
endpoint = os.environ['ES_ENDPOINT']
logger = ... |
import os
import sys
import math
import numpy as np
import sklearn.datasets
from scipy.stats import multivariate_normal
import torch
import torch.utils.data
def _normal_energy_func(x, mu=0., logvar=0.):
energy = logvar + (x - mu)**2 / math.exp(logvar) + math.log(2.*math.pi)
energy = 0.5 * energy
return ... |
import collections as col
import argparse as argp
import pathlib as pl
import functools as fnt
import logging as logging
import multiprocessing as mp
import re
import shelve
import pickle as pck
import pandas as pd
import xopen
import networkx as nx
from ontourage.constants import ORIENTATION_MAP
from ontourage.struc... |
r"""
Manifolds Catalog
A catalog of manifolds to rapidly create various simple manifolds.
The current entries to the catalog are obtained by typing
``manifolds.<tab>``, where ``<tab>`` indicates pressing the tab key.
They are:
- :class:`~sage.manifolds.differentiable.examples.euclidean.EuclideanSpace`: Euclidean spa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# :noTabs=true:
# (c) Copyright Rosetta Commons Member Institutions.
# (c) This file is part of the Rosetta software suite and is made available under license.
# (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
# (c) For more infor... |
"""
=======
fimport
=======
Python import hook for importing Fortran modules.
Usage::
import fimport
fimport.install(reload_support=True)
import somefortrancode # <- builds and imports somefortrancode.f90
But why in the world would you want that? One reason is
interactive use, where being able to reloa... |
from itertools import product
from math import atan2
from random import choice, randrange,shuffle
from ring import *
from copy import deepcopy
import time
class Point(object):
def __init__(self,x,y):
self.x = int(x)
self.y = int(y)
def __repr__(self):
return 'Point({},{})'.f... |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: _Shared.py
import dsz
import dsz.windows.sid
TAB = '\t'
SYSTEM_ACCESS = 'system access'
EVENT_AUDIT = 'event audit'
KERBEROS_POLICY = 'kerberos polic... |
# -*- coding: utf-8 -*-
# Based on ANSYS 2019R2
# Python 3.7 x64
# ----------------------------------------------------------------------------------
# | |
# | Copyright © 2021 by <NAME> & <NAME> of AOT Lab in Soochow University |
# | ... |
# -*- coding: utf-8 -*-
import logging
from iso8601 import parse_date
from openprocurement_client.compatibility_utils import munchify_factory
from retrying import retry
from simplejson import loads
from openprocurement_client.constants import DOCUMENTS
from openprocurement_client.exceptions import InvalidResponse
fr... |
#!/usr/bin/python3
import _io
import os
import os.path
import warnings
import re
import socket
from math import ceil
import filecmp
from utils import MyParser, int_to_string_bytearray, NullBuffer
from config import SERVER_ADDRESS, PORT
import jsockets
import sys, threading
import time
class HandshakeException(Excep... |
import string
from csc.nl import NLTools, get_nl, get_wordlist, get_mapping
import re
def doctest_globals():
en_nl = get_nl('en')
return locals()
class lazy_property(object):
def __init__(self, func):
'''
A lazy decorator. Runs a function only once to get a
property's value; after ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.