text stringlengths 8.04k 46.5k |
|---|
# -*- coding: utf-8 -*-
################################################################################
# LexaLink Copyright information - do not remove this copyright notice
# Copyright (C) 2012
#
# Lexalink - a free social network and dating website platform for the Google App Engine.
#
# Original author: <NAME>... |
# Re-implmenetation of POET with ARS instead of ES and with A1 robot on
# procedurally generated environments
import numpy as np
import multiprocessing as mp
from multiprocessing import Process, Pipe
import argparse
from scenes.poet_env import create_poet_env
from copy import deepcopy
import random
import time
from e... |
'''
New version of the thermodynamics.py module from the SkewT package:
https://pypi.python.org/pypi/SkewT
This module make use of the Cython functions in the _thermodynamics.pyx module
for Parcel analysis for computational efficiency efficiency
and parallelization purposes
'''
# For python 3 portability
from __futu... |
# Copyright 2019 AUI, Inc. Washington DC, USA
#
# 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 ... |
import argparse
import logging
import json
from typing import List, Tuple
from itertools import zip_longest
import re
from unk_replacer.lexical_dictionary import LexicalDictionary
from unk_replacer.number_normalizer import NumberHandler, NumberRestorer
logging.basicConfig(level=logging.INFO)
logger = logging.getLogge... |
import os
import numpy as np
import pandas as pd
import dask.dataframe as dd
import random
import logging
import hashlib
from functools import reduce
from operator import add
import string
from .match import match_lists
from lsst.pipe.tasks.functors import Labeller, CompositeFunctor, RAColumn, DecColumn
from .utils im... |
"""Code used for notebooks and data exploration on
https://github.com/fangohr/coronavirus-2020"""
from functools import lru_cache
import os
import time
import numpy as np
import pandas as pd
# choose font - can be deactivated
from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-... |
# VirtSubproc is part of autopkgtest
# autopkgtest is a tool for testing Debian binary packages
#
# autopkgtest is Copyright (C) 2006-2007 Canonical Ltd.
#
# This program 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 Fo... |
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals
import os
import sys
# from wordcloud import WordCloud
from Models import *
from Utility import *
from Analyzers import *
from DataSourceManagers import *
from DatabaseManager import *
from SearchManager import *
... |
"""
Functionality to create the Taylor diagrams and
metrics table for the Latitude-Longitude set.
"""
import csv
import glob
import os
import matplotlib
import matplotlib.cbook as cbook
import numpy as np
import numpy.ma as ma
from bs4 import BeautifulSoup
import e3sm_diags
from e3sm_diags.logger import custom_logge... |
#!/usr/bin/env python
from scad import *
import math
class Servo(SCAD_Object):
shaft_dia = 4.6
shaft_inner_dia = 1.7
shaft_height = 3.2
#
servo_width = 22.9
servo_depth = 12.20
servo_height = 22.7
#
ears_width = 32.5
ears_depth = servo_depth
ears_height = 2.3
ears_offse... |
# General imports
import logging
import socket
from dataclasses import dataclass, field
from pathlib import Path
import einops
# ML imports
import matplotlib.pyplot as plt
import numpy as np
import pytorch_lightning as pl
import torch
import torch.nn.functional as F
from pytorch_lightning.loggers import WandbLogger
f... |
#!/usr/bin/env python
# Copyright 2016-2018, Rigetti Computing
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""A collection of useful circuit identities"""
from itertools import zip_longest
import numpy as np
from s... |
import datetime
from decimal import Decimal
import pytest
from pypara.currencies import Currencies
from pypara.monetary import IncompatibleCurrencyError, Money, NoMoney, NoneMoney, Price, SomeMoney
## Define some currencies:
eur = Currencies["EUR"]
usd = Currencies["USD"]
## Defines some Decimal quantities:
zero = ... |
import os
import re
import argparse
import datetime
import mimetypes
import uuid
from ..metadata import Metadata
from ..container import DataContainer
from ..util import get_types_from_formats, prompt, split_unique
# Dictionary of language options (display_name, language_code)
language_options = [
('English', 'en... |
""" Used for the bot configarution. If not imported, this can also be used to generate
a config file. Therefore you need to modify the code at the bottom of the file and run
this file"""
import logging
import dataclasses
import json
import typing
import os
from typing import List, Tuple
logger = logging.getLogger(__n... |
import os
import json
import base64
import re
import statistics
from collections import OrderedDict
from matplotlib.widgets import RectangleSelector
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
import base64
class Documen... |
# -*- coding: utf-8 -*-
# @Time : 20/9/22 16:49
# @Author : qgking
# @Email : <EMAIL>
# @Software: PyCharm
# @Desc : syn_train_test.py
import matplotlib
import sys
sys.path.extend(["../", "./"])
from utils.utils import *
from os.path import join, isdir
import time
import torch
from torch.cuda import empty_cac... |
"""MobileNet v1 models for Keras.
MobileNet is a general architecture and can be used for multiple use cases.
Depending on the use case, it can use different input layer size and
different width factors. This allows different width models to reduce
the number of multiply-adds and thereby
reduce inference cost on mobile... |
from qutip import *
from ..mf import *
import pandas as pd
from scipy.interpolate import interp1d
from copy import deepcopy
import matplotlib.pyplot as plt
def ham_gen_jc(params, alpha=0):
sz = tensor(sigmaz(), qeye(params.c_levels))
sm = tensor(sigmam(), qeye(params.c_levels))
a = tensor(qeye(2), destroy... |
import svgwrite
import logging
import tempfile
import cairosvg
import base64
import html
import re
from .job_info import get_human_time
logger = logging.getLogger(__name__)
STYLES = """
rect { stroke-width: 1; stroke-opacity: 0; }
rect.background { fill: rgb(255,255,255); }
rect.box ... |
r"""This module implements the algebra of states in a Hilbert space
For more details see :ref:`state_algebra`.
"""
import re
from abc import ABCMeta
from collections import OrderedDict
from itertools import product as cartesian_product
import sympy
from .abstract_algebra import Expression, Operation
from .scalar_alg... |
'''
This is a core part of Demultiplexer Layer of our Psefabric Dataflow Model.
The point is to create a list of commands for each MO in our infrastructure in accordance to the global logic described in psef_logic.
We need to create these lists for the next cases: address creation/removal, address-set creation/removal... |
# coding=utf-8
# 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");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
from ctypes import *
import os
import threading
#__all__ = ['JavaVMOption', 'JavaVMInitArgs', 'jobject', 'jclass', 'jthrowable', "jstring", "jarray", "jobjectArray", "jmethodID", "jfieldID", "jvalue", "JNINativeInterface", "JNIEnv", "Jni"]
JNI_OK = c_int(0)
'''
typedef struct JavaVMOption {
char *optionString; ... |
from django.db.models import Q
from django.utils import timezone
from feeds.models import Source, Enclosure, Post, WebProxy, Tag
import feedparser as parser
import time
import datetime
import dateparser
from bs4 import BeautifulSoup
from urllib.parse import urljoin
import requests
import pyrfc3339
import json
fro... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 19 11:19:32 2021
@author: Zhantao
"""
import argparse
from os.path import abspath, isfile, join as pjn
import sys
if abspath('../') not in sys.path:
sys.path.append(abspath('../'))
if abspath('./MGN_helper') not in sys.path:
sys.path.appen... |
# -*- coding: utf-8 -*-
import time
import re
import logging
import requests
import math
import ndexindraloader
from .exceptions import NDExIndraLoaderError
logger = logging.getLogger(__name__)
def get_members_of_family_node(net_cx=None, node_id=None):
"""
Gets the members of a protein family by examining ... |
"""
Extensible validation for Python dictionaries.
This module implements Cerberus Validator class
:copyright: 2012-2015 by <NAME>.
:license: ISC, see LICENSE for more details.
Full documentation is available at http://cerberus.readthedocs.org/
"""
import sys
import re
import copy
from datetime i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME>
# base packages
import os
import sys
import json
import logging
import codecs
import hashlib
import datetime
import time
import argparse
import re
import collections
import glob
import copy
from kgtool.core import * # noqa
from kgtool.stats import stat_k... |
"""Tests for toron._node_schema module."""
import os
import sqlite3
import unittest
from collections import namedtuple, OrderedDict, UserString
from stat import S_IRUSR, S_IWUSR
from .common import TempDirTestCase
from toron._exceptions import ToronError
from toron._node_schema import SQLITE_JSON1_ENABLED
from toron.... |
#### Import needed libraries
import sys
import os
import h5py
import importlib
import glob
import numpy as np
import torch
import NNtools
import shutil
import multiprocessing
import scipy.spatial as spat
import time
#### This is the grammar to parse the command line parameters
sys.path.append("src/neural_network_scrip... |
from segmentation import mixture_model as cmm
from sympy.functions.special.gamma_functions import digamma
from sympy import nsolve, symbols, functions
from PIL import Image, ImageEnhance
import scipy.ndimage as nd
from copy import deepcopy
import mahotas as mh
import numpy as np
import cv2
###########################... |
from DocTest.CompareImage import CompareImage
from skimage import metrics
import imutils
import cv2
import time
import pytesseract
import shutil
import os
import uuid
import numpy as np
from pathlib import Path
from robot.libraries.BuiltIn import BuiltIn
from DocTest.PdfDoc import PdfDoc
import re
from concurrent impor... |
import numpy as np
from PIL import Image as PImage
import torch
import os
import json
import torch
from torch.utils.data import Dataset
from torch.utils.data.sampler import BatchSampler
from torchvision import transforms
import pycocotools.coco as coco
from pycocotools.cocoeval import COCOeval
from losses import Cont... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import seaborn as sns
import datetime as dt
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans, DBSCAN, SpectralClustering
from sklearn.metrics import silhouette_samples, silhouette_score
... |
#!/usr/bin/env python
#############################
# @file regionfile.py
# @author <NAME>
# @date 3/11/08
#
# @brief Utilities for managing a region file
##############################
import sys, inspect, os, re, unittest, math, numpy
#############################
__cvs_id__ = "$Id: regionfile.py,v 1.16 2010-11-12... |
import subprocess
import sys
import webbrowser
from datetime import datetime
from math import ceil
from os import path
from shutil import copyfile
from time import localtime, strftime
from win32api import GetFileVersionInfo, LOWORD, HIWORD
from PySide2.QtCore import Qt
from PySide2.QtGui import QIcon, QKeySequence, QF... |
import os
from itertools import chain
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.db import models
from django.db.models import Q
from django.shortcuts import render, get_object_or_404, redirect
from django.utils import timezone
from comanage.comanage_api ... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Run a YOLOv3/YOLOv2 style detection model on test images.
"""
import colorsys
import os, sys, argparse
import cv2
import time
from timeit import default_timer as timer
import tensorflow as tf
import numpy as np
from tensorflow.keras import backend as K
... |
import os
import re
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
from util import stats, game_info as gi
from configparser import ConfigParser
from scipy.interpolate import spline
PROJECT_ROOT = str(__file__).replace("util/graphs/offline_graphs.py", "")
TEMP_DIR = PROJECT_ROOT + "uti... |
"""
test_stringtime
~~~~~~~~~~~~~~~
unit tests for stringtime
"""
import datetime
import os
import pytest
import time_machine
import stringtime
from stringtime import Date
def check_phrase(p: str):
print("check_phrase:", p)
d = Date(p)
# print(' - The year is:::', d[0].get_year())
# p... |
import os
import pickle as pkl
import sys
from datetime import datetime
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.keras as keras
import matplotlib.pyplot as plt
from sklearn.metrics.cluster import normalized_mutual_info_score as compute_nmi
sys.path.append('..')
from configs.cfg... |
#
# Copyright (c) Foreseeti AB 2020
#
import getopt
import json
import re
import sys
import zipfile
import xml.etree.ElementTree as ET
import html
def open(file):
"""
file: .sCAD filename
Returns structure representing the open .sCAD file
May throw a variety of exceptions for bad zip file, unexpected... |
from collections import OrderedDict, Counter
import csv
import json
from multiprocessing.dummy import Pool
import os
import random
import shutil
import string
import sys
import time
import urllib
sep = os.sep
cwd = os.getcwd()
def create_driver(chromedriver_path, url=None, headless=False):
"""
... |
import Tkinter as tk
import ttk
import tkFileDialog, tkMessageBox
import os
from PIL import ImageTk, Image
class TrainingSetBuilder(tk.Frame):
def __init__(self, master=None):
tk.Frame.__init__(self, master)
self.crop_w = 672
self.crop_h = 672
self.chip_w = 224
self.chip_h ... |
from my_utils import *
from args_parser import *
from core.agent import Agent
from core.ac import *
from core.irl import *
import torch.nn as nn
from tqdm import tqdm
class Net(nn.Module):
def __init__(self, args, state_dim, action_dim, hidden_size=256):
super(Net, self).__init__()
self.cuda = a... |
import sys
import os
import copy
import time
from math import cos, sin, pi, atan2, radians, sqrt
import ImportGui
import Part as Partfc
import Mesh
import Draft
import Sketcher
import FreeCAD
import logging
from utility_functions import setup_logger, exitwitherror
import geometry as geom
global logger
... |
""" Evolutionary Algorithm implementation for solving the
Travelling Salesman Problem
"""
__author__ = '<NAME> (r0816917)'
__email__ = '<EMAIL>'
__maintainer__ = "<NAME>"
__credits__ = '<NAME>, <NAME>'
import time
import random
from copy import deepcopy
from itertools import permutations, chain
import warnings
import... |
import numpy as np
import ctypes as ct
from typing import Tuple, List, Optional
from . import types as t
from . import mathctypes as mt
from . import bindingbase as bb
from . import plib
from . import vulib
from . import visubase
from . import object
MAX_QUIT_AT_KEYS = 8
MAX_TRACKBARS = 8
MAX_RENDER_OBJECTS = 1024
... |
import asyncio
import json
import logging
from inspect import getmembers
from pynamodb.connection.util import pythonic
from pynamodb.constants import BATCH_WRITE_PAGE_LIMIT, PUT, DELETE, ATTRIBUTES, UNPROCESSED_ITEMS, PUT_REQUEST, ITEM, \
DELETE_REQUEST, KEY, BATCH_GET_PAGE_LIMIT, RESPONSES, UNPROCESSED_KEYS, KEYS... |
"""
Copyright (c) 2019 NAVER Corp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, su... |
# Copyright 2019 Xilinx 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 writing, ... |
import xml.etree.ElementTree
import re
# an alone field, no choice table
class alone_field(object):
def __init__(self, name, type):
self.attrs = {}
self.attrs['name'] = name
self.attrs['type'] = type
return None
def get(self, field):
return self.attrs[field]
... |
"""Defines interfaces for various learning experiments to be run.
Current supported experiment types include:
* :py:class:`SupervisedLearningExperiment`: An experiment where a
:py:class:`~dair_pll.system.System` is learned to mimic a
dataset of trajectories.
"""
import time
from abc import ABC, abstr... |
# cstRChirp.py
#
# RChirp is a row-based version of chirp, useful for export from and to trackers,
# and other interrupt-based music players.
# Rows can be constructed and accessed in both sparse (dictionary-like) and contiguous (list-like) forms.
# Optionally, rows can be organized into orderlists of (contiguous) row ... |
from __future__ import absolute_import
from __future__ import print_function
import itertools
import numpy
import pylab as pl
from matplotlib.widgets import Cursor, AxesWidget
from FlowCytometryTools import FCMeasurement
from FlowCytometryTools.core.utils import to_list
def apply_format(var, format_str):
"""Fo... |
"""
- search for pre-opened xarray pickles
- load datasets
- subset datasets by (1) domain
- (2) remove extraneous/missing dates from datasets
- subset datasets into train/test splits
- reshaping + stacking dataarrays
- standardization/scaling of dataarrays
"""
import utils
import xarray as xr
import numpy as np
from p... |
import json
import re
from enum import unique
from typing import Dict, List, Optional
import inflect
import shortuuid
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.humanize.templatetags.humanize import ordinal
from django... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Experiment. We will vary:
- type of noise
- type of matrix
- support of noise
- amplitude of noise
- type Laplacian
- size of embedding
- parameter k of local neighborhood
"""
import os
import re
import numpy as np
import matplotlib.pyplot a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Calculate mAP for CenterNet model on some annotation dataset
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, argparse
#import sys
import numpy as np
import cv2
import skimage.io
from PIL import... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 23 13:41:29 2019
@author: compi
We define a set of multi-class probability densities that can be used
for likelihood computations in HMM's, Bayesian Classification and Decision Tree development.
The densities are built up from scratch or are wrappers around existing skl... |
from functools import cmp_to_key
import numpy as np
def earcut(data, holeIndices=None, dim=2):
minX = None
minY = None
invSize = None
hasHoles = isinstance(holeIndices, list) and len(holeIndices) > 0
outerLen = holeIndices[0] * dim if hasHoles else len(data)
outerNode = linkedList(data, 0, ou... |
#!/usr/bin/env python3
"""
script for analyzing rRNA insertions predicted using either 16SfromHMM.py or 23SfromHMM.py
- predict ORFs using Prodigal
- identifying introns usiing cmscan against Rfam intron database
"""
import sys
import os
import subprocess
from ctbBio.fasta import iterate_fasta as parse_fasta
from ite... |
"""
Description:
Author: <NAME> (<EMAIL>)
Date: 2021-06-06 02:02:14
LastEditors: <NAME> (<EMAIL>)
LastEditTime: 2021-06-06 02:02:14
"""
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.ticker import FormatStrFormatter, FuncFormatter, LinearLocator
from mpl_toolkits.axes_grid1 import Divider, Siz... |
import numpy as np
import matplotlib.pyplot as plt
import bisect
import scipy.linalg as la
import scipy.optimize as opti
import sklearn as skl
from skopt import gp_minimize
from mpmath import *
mp.dps = 30
def hMap(a, b, x, y):
return 1 - a * x ** 2 + b * y
# −b−1(1 − ayn2 − bxn)
def backwards_hMap(a, b, x, y):... |
# Copyright (C) 2019 Intel Corporation
#
# SPDX-License-Identifier: MIT
import datetime
import json
import os
import re
import shutil
from django.conf import settings
from rest_framework import serializers
from django.contrib.auth.models import User, Group
from rest_framework.reverse import reverse
from cvat.apps.ann... |
import torch
import torch.utils.data as data
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from utils.dataset import DataAllocate, AudioVisualData
from model.detector import Framework, MapLoss, DiscrimLoss, StatFreq, CAMAudio, AlignLoss, CAMCluster, CAMVisual
from utils.logger import... |
r"""
Design (:mod:`dasi.design`)
=============================
.. currentmodule:: caldera.data._graph_data
This module provide DNA assembly functionality for DASi.
"""
from __future__ import annotations
import functools
from functools import reduce
from typing import Any
from typing import Callable
from typing impor... |
#!/usr/bin/env python
__description__ = 'Extract base64 strings from file'
__author__ = '<NAME>'
__version__ = '0.0.5'
__date__ = '2016/11/18'
"""
Source code put in public domain by Didier Stevens, no Copyright
https://DidierStevens.com
Use at your own risk
History:
2015/06/30: start
2015/07/01: added header
... |
"""Generates simulated data and model to test anamod algorithm"""
import argparse
import copy
from distutils.util import strtobool
import json
import os
import pickle
import pprint
import sys
import anytree
from anytree.importer.jsonimporter import JsonImporter
import cloudpickle
import numpy as np
from scipy.cluster... |
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... |
'''
BSD 3-Clause License
Copyright (c) 2019, <NAME>
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 notice, this
list of condition... |
#
# 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... |
# Copyright 2020 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... |
import sys
sys.path.insert(0, './yolov5')
from yolov5.utils.datasets import LoadImages, LoadStreams
from yolov5.utils.general import check_img_size, non_max_suppression, scale_coords
from yolov5.utils.torch_utils import select_device, time_synchronized
from deep_sort_pytorch.utils.parser import get_config
from deep_sor... |
# *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... |
"""
The Kinetics700 dataset.
Note that the setting for the data loader is obtained from the github
repo provided by the official workers:
https://github.com/pytorch/vision/references/video_classification/train.py
We consider three modalities: RGB, optical flow and audio.
For RGB and flow, we use input clips of 1... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# (c) B.Kerler 2018-2021 MIT License
import hmac
import hashlib
import logging
from struct import pack, unpack
from Library.utils import LogBase, logsetup
from binascii import hexlify
CSS_DEC_DK = 0x00 # CSS Disk Key Decryption
CSS_DEC_TK = 0x01 # CSS Title Key Decryption
... |
import torch
from torch_scatter import segment_min_coo, scatter_min
from dp.potentials import compute_vrp_expansion_solution_potentials, compute_tsp_expansion_solution_potentials
from utils.mask_utils import view_as_uint8, unpackbits, unpack_mask
from utils.scatter_utils import segment_sort_coo, segment_cummax_coo, se... |
# -*- coding: utf-8 -*-
"""
@author: Theo-eBrown
"""
import os
import time
from string import ascii_letters,digits
import random
import csv
import cv2
import pyautogui
import keyboard
import numpy as np
#initialize version 0.0.8
# will work and save data to the location of the package / module
package_path = "\\".jo... |
import functools
from ctypes import c_double
from ctypes import c_float
from ctypes import c_int
from ctypes import c_void_p
from ctypes import cast
from ctypes import POINTER
from ctypes import pointer
from ctypes import Structure
from enum import IntEnum
import numpy as np
from parcels.tools.converters import TimeC... |
# Copyright <NAME> 2015-2020
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#-------------------------------------------------------------------------------
# RunBoostTest
#----------------... |
#!/usr/bin/env python
# Use Python3 integer division rules.
from __future__ import division
import sys
import os
import unittest
import warnings
from numpy import testing, pi, array, matrix, sin, cos, zeros, array, mat, \
arctan
from yeadon.solid import Stadium, Solid, StadiumSolid
from yeadon import inerti... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Utility methods for mixed precision training.
"""
import math
from itertools import chain
from typing import Optiona... |
import time
import numpy as np
from numpy.testing import (
assert_almost_equal,
assert_array_equal,
)
import scipy.sparse as sp
from sklearn.model_selection import (
GroupKFold,
GroupShuffleSplit,
KFold,
LeaveOneGroupOut,
LeavePGroupsOut,
StratifiedKFold,
StratifiedShuffleSplit,
)
fr... |
# coding=utf-8
"""
This module contains various utilities.
"""
import cgi
import hashlib
import io
import random
import tempfile
from copy import copy
from datetime import timedelta, datetime
from email.utils import parsedate
from threading import local
from time import gmtime, strftime
from apscheduler.jobstores.... |
#!/usr/bin/env python3
import argparse
import collections
import os
import pickle
from typing import List, NamedTuple, Optional
import numpy as np
import torch
from fairseq import (
bleu,
data,
iterative_refinement_generator,
options,
progress_bar,
tasks,
utils,
)
from fairseq.meters impor... |
# Copyright (c) Microsoft Corporation.
# (c) <NAME>
# Licensed under the MIT license.
import argparse
from collections import OrderedDict
import importlib
import json
import os
import shutil
import sys
import time
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.paralle... |
import random
SIMILARITY = 0.001
messageCharacters = []
messageBigrams = []
messageTrigrams = []
messageQuadgrams = []
intMessage = []
# calculate natural monogram frequencies
def naturalMonograms(characters):
text_file = open("NaturalFrequencies/monograms.txt", "r")
lines = text_file.read().split("\n")
... |
# -*- coding: utf-8 -*-
"""
Module implementing MainWindow.
"""
import os, sys, math
from time import sleep
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QRubberBand, QGraphicsScene, QFrame, QMainWindow, QFileDialog, QMessageBox, QDesktopWidget, QProgressBar
from PyQt5.QtGui import QPixmap, QPainter, QColor, ... |
import abc
import warnings
import pandas as pd
import numpy as np
from sklearn.base import is_classifier, clone
from sklearn.model_selection import train_test_split, StratifiedKFold
from sklearn.metrics import roc_auc_score
from catboost import CatBoostClassifier
from scipy import stats
from collections import default... |
import unittest
import collections
import re
from minesweeper import *
def sets(o):
return set_(sets(k) if hasattr(k, '__iter__') else k for k in o)
def r(s):
"""helper function to generate a (raw) Rule"""
mines, cells = s.split(':')
cells = cells.split(',') if cells else []
assert all(len(c) == 1... |
# Copyright 2020 DeepMind Technologies 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 License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
# -*- coding: utf-8 -*-
"""Base classes and metaclasses."""
from abc import abstractmethod
from contextlib import contextmanager
from functools import wraps
from inspect import getmro
from typing import TYPE_CHECKING, Callable, Generic, Type, TypeVar, cast
try:
from types import new_class
except ImportError:
... |
import sqlite3, types
import numpy as np
from pwtools import common
import os
def get_test_db():
"""Return in-memory database for playing around."""
db = SQLiteDB(':memory:', table='calc')
db.create_table([('a', 'TEXT'), ('b', 'FLOAT')])
db.execute("insert into calc (a,b) values ('lala', 1.0)")
d... |
import os
import json
from urllib import unquote
from enum import Enum
import flask
from flask_restful import Resource
from cirrus import GoogleCloudManager
from cirrus.errors import CirrusNotFound
from cirrus.google_cloud.errors import GoogleAPIError
from fence.auth import current_token, require_auth_header
from fe... |
from bs4 import BeautifulSoup
import requests
from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator
import matplotlib.pyplot as plt
import krovetz
## utils
import urllib.request as libreq
from bs4 import BeautifulSoup
import json
import re, string
import networkx as nx
from nltk.corpus import stopwords
from... |
# Copyright (c) 2018, <NAME>
# 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 conditions and the foll... |
from timeit import timeit
from copy import deepcopy
import numpy as np
import re
try:
from dev.ESOINN import _ESOINNNode, EnhancedSelfOrganizingIncrementalNN, \
learning_rate_generator
from dev.mock import load_mock, NEIGHBOR_LOCAL_MAXES
from dev.commons import Plotter
except ImportError as error:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.