text stringlengths 3.07k 22.1k |
|---|
import unittest
from unittest import mock
import pytest
import string
import dbt.exceptions
import dbt.graph.selector as graph_selector
import dbt.graph.cli as graph_cli
from dbt.node_types import NodeType
import networkx as nx
def _get_graph():
integer_graph = nx.balanced_tree(2, 2, nx.DiGraph())
package... |
import datetime as dt
import urllib.parse
from typing import Dict, Union
from utils.database import tibiaDatabase
from utils.general import get_local_timezone
from utils.tibia import get_tibia_time_zone
WIKI_ICON = "https://vignette.wikia.nocookie.net/tibia/images/b/bc/Wiki.png/revision/latest?path-prefix=en"
def g... |
import json
import networkx as nx
from typing import List, Set, Tuple
from nltk.corpus import stopwords
from collections import defaultdict, Counter
def tuple_contains(tup1: Tuple, tup2: Tuple) -> Tuple[bool, int]:
"""Check whether tuple 1 contains tuple 2"""
len_tup1, len_tup2 = len(tup1), len(tup2)
for ... |
"""
Please keep the code which we need for testing here.
"""
import numpy as np
import enum
from collections import namedtuple
from copy import deepcopy
"""
Convert to make the plane for Black (Game State represenation assumed: Black(1), White(2) and empty(0))
"""
def convert2to0(game_state):
if game_state is N... |
# python version is 3.6.1
from enum import Enum
import numpy as np
import scipy as sp
from scipy import sparse
from . import rulsif
def sq_puc_tr_rulsif(xp_tr, xu_tr, xu_te, prior, lambda_list=np.logspace(-3, 0, num=11),
gamma_list=None, sigma_list=None, n_fold=5, n_basis=200, kertype='gauss'):... |
import logging
import gevent
from volttron.platform.vip.agent import Agent
from volttrontesting.utils.platformwrapper import start_wrapper_platform
from volttron.platform.agent import json
import pytest
import random
import requests
import os
import tempfile
from volttrontesting.fixtures.volttron_platform_fixtures im... |
#!/usr/bin/python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
import swiftclient
from django.db import models
from django.conf import settings
import django_filters
from rest_framework.filters import FilterSet
from feeds.models import Feed, FeedFile
from .fields import CPUField, MemoryField
# API types
TYPE_CHOICES = [("string", "String values"), ("float", "Float values"),
... |
#!/usr/bin/env python
# Copyright (c) 2015 IBM. 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 ... |
"""
The MIT License (MIT)
Copyright (c) 2017-2018 <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 restriction, including without limitation the rights to
use, copy, modify, merge, ... |
import os
import gym
import sys
from agents import TDAgent, HumanAgent, TDAgentGNU, RandomAgent, evaluate_agents, Agent_2ply
from gnubg.gnubg_backgammon import GnubgInterface, GnubgEnv, evaluate_vs_gnubg
from gym_backgammon.envs.backgammon import WHITE, BLACK
from model import TDGammon, TDGammon_stock, TDGammonCNN
from... |
import logging
import textwrap
from datetime import datetime, timedelta
from airflow import DAG # noqa
from airflow import macros # noqa
from airflow.operators.python_operator import PythonOperator # noqa
from pyhocon import ConfigFactory
from databuilder.extractor.hive_table_metadata_extractor import HiveTableMet... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2018 CNRS
# 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 limita... |
#!python3
"""Keyboard shortcuts.
**Key commands**
Key command is kind of global shortcut in Pythonista. They're visible if you
hold down ``Cmd`` key for example. Black Mamba does use key commands for
shortcuts like toggle comments, etc.
Related functions:
* `UIKeyModifier`
* `UIKeyInput`
* `register_ke... |
"""
Split a sequence into a set of stills.
Example:
dials.sequence_to_stills sequence.expt sequence.refl
"""
from __future__ import absolute_import, division, print_function
import logging
from libtbx.phil import parse
from scitbx import matrix
from dxtbx.model import MosaicCrystalSauter2014
from dxtbx.model.ex... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.linear_model import LinearRegression, LassoCV, RidgeCV
from sklearn.model_selection import cross_val_score, train_test_split
from sklearn.preprocessing import StandardScaler, PolynomialFeatures
from sklearn.metric... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# 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 multiprocessing
import time
from functools import partial, update_wrapper
from defaults import EXTRACTION_MAX_READ_PAIRS, EXTRACTION_MAX_NM, EXTRACTION_MAX_INTERVAL_TRUNCATION, EXTRACTION_TRUNCATION_PAD
import pysam
compl_table = [chr(i) for i in xrange(256)]
compl_table[ord('A')... |
"""
Utilities for dotted paths
Definitions:
- dotted path:
a string pointing to an object (e.g. my_module.my_function)
- dotted path spec:
a str or dict pointing to an object with optional parameters for
calling it (a superset of the above)
"""
import warnings
from pathlib import Path
i... |
import sys
import random
from time import sleep
import pygame
import music
from bullet import Bullet
from ufo import Ufo
from star import Star
from explosion import Explosion
from life import Life
def check_events(game_settings, screen, stats, ship, ufos, bullets, play_button, lifes):
for event in pygame.event.... |
#!/usr/bin/env python
###############################################################################
# Copyright Kitware Inc. and Contributors
# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)
# See accompanying Copyright.txt and LICENSE files for details
##################################... |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
import os
import subprocess
import sys
import numpy as np
import pandas as pd
import string
from .dataMaker import CorelsDataMake
import copy
#This method accepts a string which contains a definition of a dictionary
#it returns a dictionary, which contains certain inputs that correspond to an output
#Ex: {X1:4,X2:3,... |
import re
import pytest
from errors import TemplateSyntaxError
from template import Template
def tryRender(text, ctx=None, expected=None):
actual = Template(text).render(ctx or {})
if expected:
assert actual == expected
def assertSyntaxError(text, ctx=None, msg=None):
with pytest.raises(Templa... |
# Experimental Class for Smiles Enumeration, Iterator and SmilesIterator adapted from Keras 1.2.2
# Source: https://github.com/EBjerrum/molvecgen
from rdkit import Chem
import numpy as np
class SmilesVectorizer(object):
"""SMILES vectorizer and devectorizer, with support for SMILES enumeration (atom order randomi... |
from astropy import units as u, constants as const
import numpy as np
from ..nuclear import nuclear_binding_energy, nuclear_reaction_energy, mass_energy
from plasmapy.utils.pytest_helpers import run_test, run_test_equivalent_calls
from plasmapy.atomic.exceptions import AtomicError, InvalidParticleError
import pytest
... |
"""
GTSAM Copyright 2010-2018, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
Authors: <NAME>, et al. (see THANKS for the full author list)
See LICENSE for the license information
Pose SLAM example using iSAM2 in the 2D plane.
Author: <NAME>, <NAME>
Modeled after:
- VisualISAM2... |
# app/main/routes.py
from app.main import main
from app import db, bcrypt#, limiter
from app.auth.models import User
from app.blocks.models import Block
from app.likes.models import Like
from app.main.models import Picture
from app.tags.models import Tag
from app.notifications.models import Notification
from app.main.f... |
import copy
import re
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import connection
from django.db.models import Q
from django.db.models.sql.query import AND, OR
from django.utils.tree import Node
ORDER_PATTERN = re.compile(r'^[-+]?[a-zA-Z0-9_]+$')
FIELD_PATTERN = re... |
import numpy as np
from optuna import Trial
from sklearn.decomposition import PCA
import mutation_prediction.data as data
import mutation_prediction.embeddings.aaindex as aaindex
from mutation_prediction.data import Dataset
from mutation_prediction.embeddings import Embedding, EmbeddingMatrix
class AcidsOneHot(Embed... |
'''
generates input data for pipeline
producing four files attributes, samples, values and coexistences
see ./docs/documentation.md for details
'''
import os
import re
import csv
import sys
import math
import json
import time
import glob
import timeit
import string
import requests
import itertools
import pandas as pd
f... |
from app import AppError
from platform import maybe_mkdir, delete_recursively
from .scripts import SingleKey, Multisig
import json
from bitcoin import ec, hashes, script
from bitcoin.networks import NETWORKS
from bitcoin.psbt import DerivationPath
import hashlib
class WalletError(AppError):
NAME = "Wallet error"
... |
import atexit
import builtins
import os
import tempfile
import webbrowser
from types import TracebackType
from typing import Any, Dict, Iterator, Optional, Union
from urllib import parse
import certifi
import lomond
import requests
import simplejson
import determined_common.requests
from determined_common.api import ... |
#!/usr/bin/python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
# encoding: utf8
from datetime import datetime
import hashlib
from flask import url_for
from markdown import markdown
import bleach
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import request, current_app
fro... |
#!/usr/local/bin/python
import os
import sys
import boto3
import time
import acme
from botocore.exceptions import ClientError, WaiterError
LOGGER = acme.get_logger(__name__)
# AWS SSM Client
SSM_CLIENT = boto3.client('ssm')
def generate_csr(common_name, instance_id, platform, subject_alternative_names, path):
... |
# Copyright 2019 Open Source Robotics Foundation, 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... |
# from pickle import TRUE
# from urllib import response
# import requests
# import json
# from .models import CarDealer, DealerReview
# from requests.auth import HTTPBasicAuth
# from ibm_watson import NaturalLanguageUnderstandingV1
# from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
# from ibm_watson.natur... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2017-2018 CNRS
# 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 limita... |
# Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
"""
SPLAT
Splat similates a parachute jump in which you try to open your parachute
at the last possible moment without going splat! You may select your own
terminal velocity or let the computer do it for you. You may also select
the acceleration due to gravity or, again, let the computer do it
in which case you might ... |
# Easy to use offline chat archive.
#
# Author: <NAME> <<EMAIL>>
# Last Change: November 4, 2020
# URL: https://github.com/xolox/python-chat-archive
"""Python API for the `chat-archive` program."""
# Standard library modules.
import collections
import importlib
import os
# External dependencies.
from humanfriendly i... |
import collections
import datetime
import json
import multiprocessing.pool
import random
import time
import traceback
import types
from django import forms
from django.db import models
import django.core.mail
import django.urls
import django.forms.renderers
from cached_property import cached_property
from constance i... |
"""
=============
Interpolation
=============
Provides interpolation algorithms across tabular data for ``vivarium``
simulations.
"""
import pandas as pd
import numpy as np
from typing import Union, List, Tuple
ParameterType = Union[List[List[str]], List[Tuple[str, str, str]]]
class Interpolation:
"""A callabl... |
#!/bin/python3.4
import re, os, sys
import shlex, time, datetime
import json, yaml
import subprocess, multiprocessing
from pprint import pprint
import memcache
class MemCacheClient():
"""
My test memcached client class, inteneded to be moved to a official tool lib
"""
def __init__( self, **options ):
self... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Avani
"""
import math
from collections import defaultdict
import timeit
from wikiIndexer import removeStopWords, stem, tokenise
wlist = []
tlist = []
title_dic = defaultdict(int)
opt_dict = defaultdict(int)
global no_of_docs
def get_docNum():
global no_... |
"""
jfrog2pypi: Jfrog Artifactory python modules loader
A simple yet useful module that was originally developed to be able to
parse any generic jfrog artifactory repositories and secondly, to provide
the version-control mechanism over all contained packages. It implements
a really easy-to-use class to find and load... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
print(sys.version)
sys.path.append('/data/project/edgars/pywikibot/')
#sys.path.append('/data/project/edgars/pwb_helpers/toolforge/')
import requests, os
import json
import urllib.parse
import pywikibot, re
import pymysql
from datetime import dat... |
"""
Module for building the structural model
<EMAIL>
v. 2017-12-17
"""
import numpy as np
import numpy.matlib
########################################################################
def masMat(nDof,inpMas,fixDof):
"""
Returns structural lumped mass matrix.
Input:
- nDof: number of active DOFs
- i... |
# Copyright (c) 2013, TeamPRO and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe.utils import flt
from frappe import _
def execute(filters=None):
if not filters: filters = {}
currency = None
if filters.get('cur... |
# -*- coding: utf-8 -*-
import numpy as np
import torch
from scilpy.tracking.propagator import AbstractPropagator
from dwi_ml.data.dataset.single_subject_containers import SubjectDataAbstract
from dwi_ml.data.processing.volume.interpolation import \
interpolate_volume_in_neighborhood
from dwi_ml.models.main_model... |
# -*- coding: utf-8 -*-
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing the scheduler stages."""
from __future__ import print_function
import json
import os
import time
from chro... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 24 22:11:47 2020
@author: jake
"""
import tello_controller
import tello_video
import numpy as np
import cv2 as cv
import time
import Scheduler
def process_frame(_video, _pose_estimater):
global pose
img_query = cv.imread('pose_estimater/d... |
from __future__ import absolute_import, unicode_literals
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db.models import Q
... |
"""
Utility Functions
"""
import logging
import os
from io import StringIO
import csv
from functools import wraps
import random
import re
from flask import jsonify, make_response, current_app, request
import flask
from flask_sqlalchemy import get_debug_queries
import jinja2
# For backwards compatibility
from .fileut... |
from datetime import datetime
from dateutil.relativedelta import relativedelta
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models, transaction
from django.db.models import Q
from django.utils import timezone
from djan... |
import numpy as np
from scipy.integrate import ode, odeint
import matplotlib.pyplot as plt
parsec = 3.086 * 1e16 #m
year = 3.156 * 1e7 #s
pi = 3.14159265358979323846
G = 6.67430 * 1e-11 #N * m2 / kg2
LO=93.016 * 1e9 * 9.461e15/2 #90 billions ly in m (diameter)
a0=1
omega_R = 4.8e-5
omega_lambda = 0.683-omega_R
omeg... |
import logging
import sys
import torch
from mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,
merge_aug_masks, merge_aug_proposals, multiclass_nms)
logger = logging.getLogger(__name__)
if sys.version_info >= (3, 7):
from mmdet.utils.contextmanagers import completed
class RPN... |
import sys
from typing import List, Union
from datetime import datetime
import subprocess
import inspect
from pathlib import Path
from tqdm import tqdm
import cv2
import numpy as np
import torch
import torch.nn as nn
def most(l: List[bool], factor: float = 0.67):
r"""
Args:
l (List[bool]): The input ... |
import os
import shutil
from pathlib2 import Path
from global_var import globalVars
from License_Plate_Localization.core.config import cfg
import xml.dom.minidom as mnd
def DealXMLFile(filePath):
domTree = mnd.parse(filePath)
# 所有annotation
rootNode = domTree.documentElement
# folder 元素
folder = r... |
import optparse
import tokenize
import warnings
# Polyfill stdin loading/reading lines
# https://gitlab.com/pycqa/flake8-polyfill/blob/1.0.1/src/flake8_polyfill/stdin.py#L52-57
try:
from flake8.engine import pep8
stdin_get_value = pep8.stdin_get_value
readlines = pep8.readlines
except ImportError:
from... |
"""Read/write linear transforms."""
import numpy as np
from nibabel.volumeutils import Recoder
from nibabel.affines import voxel_sizes, from_matvec
from .base import (
BaseLinearTransformList,
StringBasedStruct,
LinearTransformStruct,
TransformFileError,
)
transform_codes = Recoder(
(
(0,... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
# Copyright (c) 2018 <NAME>, Inc.
#
# This file is part of Mycroft Skills Kit
# (see https://github.com/MycroftAI/mycroft-skills-kit).
#
# 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
#
# h... |
from copy import copy
from openpyxl.cell import Cell
from openpyxl.worksheet import Worksheet
import openpyxl
from wysiwygtemplate.dictcontext import DictExcelTemplateContext
from wysiwygtemplate.looptemplate import ExcelArchetectureTemplate
from wysiwygtemplate.pyevaluator import PyEvaluator, EmbeddedPyEvaluator
fr... |
"""
Copyright (C) 2021 NVIDIA Corporation. All rights reserved.
Licensed under the NVIDIA Source Code License. See LICENSE at the main github page.
Authors: <NAME>, <NAME>, <NAME>, <NAME>
"""
import torch
import torch.nn as nn
from torch import autograd
from torch.autograd import Variable
import torch.nn.functional a... |
from __future__ import absolute_import
import logging
import os
import time
import click
import cachetools
import functools
import itertools
import re
from pathlib import Path
import pandas as pd
try:
import cPickle as pickle
except ImportError:
import pickle
from datacube.ui import click as dc_ui
from data... |
import numpy as np
import cv2
from pyquaternion import Quaternion
from Quaternion import Quat
import timeit
from scipy import stats
# seek_time = 40
source = 'france' #'own', 'france'
topic_dict = {'paris':'paris.mp4', 'diving':'ocean40.webm', 'venise':'venise.webm', 'roller':'roller65.webm',
'timelap... |
# -*- coding: utf-8 -*-
import ctypes
import os
import shutil
import cv2
import glob
import subprocess
import signal
from pydub import AudioSegment
from collections import defaultdict
from tqdm import tqdm
from multiprocessing import Process, Queue, Value, Pipe
from queue import Empty
from logging import getLogger, Str... |
# 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... |
from pyspark.context import SparkContext
from pyspark.sql.dataframe import DataFrame
from pyspark.rdd import RDD
from pyspark.sql import SparkSession
from h2o.frame import H2OFrame
from pysparkling.initializer import Initializer
from pysparkling.conf import H2OConf
import h2o
from pysparkling.conversions import FrameCo... |
import streamlit as st
import pandas as pd
import yfinance as yf
import sqlalchemy
import cufflinks as cf
import datetime
import json
import os
from pathlib import Path
import requests
import hvplot.pandas
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import statistics
#from MCForecas... |
import os
import cv2
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import ipywidgets as widgets
from IPython.display import display,clear_output
def apply_brightness_contrast(input_img, brightness = 0, contrast = 0):
'''change contrast and brightness'''
if brightness != 0:
if brightness >... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import solve_ivp
import csv
def red_blue_ode(t, p):
r, b, rt, bt = p
dp = [0, 0, 0, 0]
lambda_a = 1.0
lambda_t = 1.0
p_t = 0.5
p_c = 0.5
k = 10.0
flag_r_0 = 1.0 if r > 0 else 0.0
flag_b_0 = 1.0 if b > 0 else 0.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
SimpleBee base driver emulator
(c) 2015 - Orange Labs <NAME>
------------------------------------------------------
"""
#
# Copyright (C) 2015 Orange
#
# This software is distributed under the terms and conditions of the 'Apache-2.0'
# license which can be found in t... |
from tqdm import tqdm
import numpy as np
import scipy.sparse as sps
import numpy as np
import scipy.sparse as sps
from collections import defaultdict
from fim import apriori, fpgrowth, fim, arules
from utils.evaluator import Evaluator
from utils.datareader import Datareader
from personal.Lele.prefixspan import PrefixS... |
import random
import numpy as np
import cv2
import scipy.ndimage as ndimage
from scipy.interpolate import RegularGridInterpolator
from scipy.ndimage.filters import gaussian_filter
class RandomChoice(object):
"""
choose a random tranform from list an apply
transforms: tranforms to apply
p: probability
... |
#!/usr/bin/env pytest
import classad
import htcondor
import logging
import os
import shutil
import subprocess
import time
from ornithology import *
from pathlib import Path
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
@standup
def config_dir(test_dir):
config_dir = test_dir / "condor" / ... |
from .interval_limit import IntervalLimit
def local_compare_to(a, b):
return -1 if a < b else 1 if a > b else 0
class Interval:
@staticmethod
def closed(lower, upper):
return Interval(lower, True, upper, True)
@staticmethod
def open(lower, upper):
return Interval(lower, False, up... |
import os
import numpy as np
import argparse
import random
import tensorflow as tf
from data_generators.data_generator import DataGenerator
from models.maml import MAML
parser = argparse.ArgumentParser()
parser.add_argument('data_path', metavar='DATA',
help='path to data')
parser.add_argument('ckpt_name', metavar... |
#Author: <NAME>
#Version: 11/7/2021
#Reference: https://dataaspirant.com/nlp-text-preprocessing-techniques-implementation-python/#t-1600081660730
#Many of the NLP related preprocessing techniques found in this file come from or are influenced by this webpage.
#Definition for Sentence_Matrix: the sentence matrix is ... |
import os
import numpy as np
import numpy.fft as npfft
import pickle
import sklearn.gaussian_process.kernels as gpk
from scipy.spatial.distance import cdist
from copy import deepcopy
from nephelae.types import DeepcopyGuard
class NephKernel(gpk.Kernel):
"""
NephKernel
Base class for Gaussian Process... |
"""
SaltsRD XBMC Addon
Copyright (C) 2014 tknorris
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 Foundation, either version 3 of the License, or
(at your option) any later version.
... |
import pytest
from click.testing import CliRunner
import os
import json
from .utils import git_repo
from keras.layers import Dense, Flatten, Reshape, Input, LSTM, Embedding, Input, Concatenate
from keras.models import Sequential, Model
from keras import backend as K
import wandb
from wandb import wandb_run
from wandb.... |
"""
problog.kbest - K-Best inference using MaxSat
---------------------------------------------
Anytime evaluation using best proofs.
..
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this f... |
from urllib.parse import urlparse
from google.cloud import storage
import numpy as np
import resampy
import tensorflow as tf
import urllib.request
import itertools
import io
import jsonlines
from pydub import AudioSegment
import yamnet.params as yamnet_params
import yamnet.yamnet as yamnet_model
import os
from ar... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 5 12:05:57 2017
@author: manishdevana
Further experiments with ray tracing after doing wave property calculations
(runs calculations in internal_wave_properties)
"""
import numpy as np
import matplotlib.pyplot as plt
import data_load
import gsw
... |
"""
knox
~~~~
Implements a monte carlo algorithm to compute knox statistics and p-values.
1. <NAME>, "The Burglary as Clue to the Future: The Beginnings of
Prospective Hot-Spotting", European Journal of Criminology Volume: 1
issue: 2, page(s): 237-255. DOI: https://doi.org/10.1177/1477370804041252
2. <NAME>., <... |
# -*- coding: utf-8 -*-
class VerticeInvalidoException(Exception):
pass
class ArestaInvalidaException(Exception):
pass
class MatrizInvalidaException(Exception):
pass
class Grafo:
QTDE_MAX_SEPARADOR = 1
SEPARADOR_ARESTA = '-'
__maior_vertice = 0
def __init__(self, V=None, M=None):
... |
"""Eppy example: square coil parallel to plate.
This example illustrates how to use eppy to calculate the eddy
currents in a plate due to a flat square coil.
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import imageio
import time
import sys
import os
sys.path.append... |
import dbus
import urllib
import subprocess
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1"
WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1"
WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1"
WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface... |
"""
A script to embed every phrase in a dataset as a dense vector, then
to find the top-k neighbors of each phrase according to cosine
similarity.
1. Install missing dependencies.
# More details: https://github.com/facebookresearch/faiss/blob/master/INSTALL.md
conda install faiss-cpu -c pytorch
2. Prepare da... |
"""Transformations utilities module.
This module contains utility functions used to instantiate transformation/augmentation ops.
"""
import logging
import torchvision.transforms
import torchvision.utils
import thelper.utils
logger = logging.getLogger(__name__)
def load_transforms(stages, avoid_transform_wrapper=... |
#!/usr/bin/env python
import json # Used when TRACE=jsonp
import os # Used to get the TRACE environment variable
import re # Used when TRACE=jsonp
import sys # Used to smooth over the range / xrange issue.
import aug_avl
# Python 3 doesn't have xrange, and range behaves like xrange.
if sys.version_info >... |
#!/usr/bin/python3
import logging
import os
import sys
try:
import cPickle as pickle
except ImportError: # Python 3.x
import pickle
import colorlog
import numpy as np
from PIL import Image
logger = logging.getLogger()
logger.setLevel(colorlog.colorlog.logging.INFO)
handler = colorlog.StreamHandler()
handl... |
import sys
import traceback
import textwrap
import warnings
import attr
__all__ = ["MultiError"]
################################################################
# MultiError
################################################################
def _filter_impl(handler, root_exc):
# We have a tree of MultiError's, ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session
from django.db import models
from django.db.models import Count
from django.db.models import When, Case
from django.utils.translatio... |
# coding: utf-8
from struct import Struct
from zlib import compress, decompress
__version__ = "0.1.9"
__is_cython__ = False
try:
# Python 2.7
long = long
except NameError: # pragma: no cover
# Python 3.3
unicode = str
xrange = range
long = int
DEFAULT_ENCODING = "utf-8"
ERL_NEW_FLOAT = b'F'
ERL_COMPRESS... |
import os
import logging
import subprocess
from pathlib import Path
from typing import List, Dict, Optional
from dataclasses import dataclass
from datetime import datetime, timedelta
from fairseq.data import Dictionary
from fairseq.data.audio.data_cfg import S2TDataConfig
from fairseq.data.audio.speech_to_text_dataset... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
coordinate calculation
"""
# information
__author__ = '<NAME>'
__copyright__ = 'Copyright (C) 2021 - <NAME>'
__license__ = 'New BSD License - https://opensource.org/licenses/BSD-3-Clause'
__maintainer__ = '<NAME>'
__email__ = 'toru.ver.11 at-sign gmail.com'
__all__ ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.