text stringlengths 3.07k 22.1k |
|---|
#
# -*- coding: utf-8 -*-
# Wireshark tests
# By <NAME> <<EMAIL>>
#
# Ported from a set of Bash scripts which were copyright 2005 <NAME>
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
'''Subprocess test case superclass'''
import difflib
import io
import os
import os.path
import re
import subprocess
import sys
import ... |
import math
from ns import core, propagation, wifi
from ns.mobility import ConstantPositionMobilityModel
from networks.QoS import QoS
from networks.connections import Wireless
from utils.location import Location
def db_to_watt(db):
return 10 ** (db / 10.0)
class SISO(Wireless):
# Default propagation mode... |
import numpy as np
import random
from model import Actor, Critic
from oun_noise import OUNoise
from reply_memory import ReplayBuffer
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e6) # replay buffer size
BATCH_SIZE = 512 # minibatch size
GAMMA = 0.95 #... |
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
from pgl.sampling.custom import subgraph
import pgl
import math
class DenseLayer(nn.Layer):
def __init__(self, in_dim, out_dim, activation=F.relu, bias=True):
super(DenseLayer, self).__init__()
self.activation ... |
"""
Utility code for gene sets handling
"""
import re
import csv
import hashlib
from .errors import AnnotationsError
GENESETS_TIDYCSV_HEADER = [
"gene_set_name",
"gene_set_description",
"gene_symbol",
"gene_description",
]
def read_gene_sets_tidycsv(gs_locator, context=None):
"""
Read & pa... |
import os
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from sklearn.datasets import make_sparse_spd_matrix
from sgl import LearnGraphTopolgy
from metrics import ModelSelection, Metrics
from utils import Operators
from scipy.linalg import block_diag
plots_dir = './plots'
outs_dir = './outs'
... |
from __future__ import absolute_import
import atexit
import io
import operator
import os
import tempfile
import unittest
import tarfile
import time
import zipfile
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.expected_conditions import presence_of_elemen... |
"""
Clusteriza com k-means as unidades hospitalares e salva planilhas com a coluna CLUSTER adicionada com os respectivos
clusters encontrados.
Nota:
O número k de clusters é determinado automaticamente. Para a análise DEA, segundo [Cooper et al, 2011], o número mínimo
de DMUs deve ser superior a três vezes a soma de v... |
"""
Copyright (C) 2022 <NAME>
Released under MIT License. See the file LICENSE for details.
Extract data from the UTOCS dataset
To run GUTS on a custom dataset, you may want to create a similar
class for your own dataset
"""
from pathlib import Path
import numpy as np
from scipy.linalg import n... |
"""
This is a custom time parsing that use a format like: 3d50m / 3h / 30 seconds / etc.
Created since I need a custom one for everything that use this kinda thing.
This module will convert a string of text into `:cls:`arrow.Arrow format
---
MIT License
Copyright (c) 2019-2021 naoTimesdev
Permission is hereby gran... |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# <NAME> <<EMAIL>> <https://hanxiao.github.io>
import tensorflow as tf
from nlp.encode_blocks import CNN_encode
from nlp.nn import linear_logit, layer_norm, dropout_res_layernorm
def AttentiveCNN_match(context, query, context_mask,
query_mask, ca... |
def fix(name):
return name.replace("_", "")
def convert_bool(b):
return "True" if b else "False"
class Function(object):
def __init__(self, name):
self.name = name
self.cases = []
def addcase(self, case):
case_name, code = case
self.cases.append((fix(cas... |
"""
# This is a uArm hockey demo python script
# joystick is using Arduino, if you are interested on the Arduino source code. You could download it here.
# https://github.com/uarm-demo/uarm-hockey
# this script is base on pyuarm which is uArm Python Library. https://github.com/uArm-Developer/pyuarm
#
# (C) 2016 UFACT... |
"""
MixCli **job** command group **wait** command
This command is not really expected to be used by users directly. The implementation codes are
being used by other commands.
"""
import json
import time
from typing import Union, Optional, Dict, Tuple, TypeVar
from argparse import ArgumentParser
from mixcli import MixC... |
import numpy as np
import pandas as pd
import nltk
import re
import pickle
import stanfordnlp
import warnings
from sklearn.metrics import accuracy_score
from sklearn.model_selection import KFold
from sklearn.metrics import f1_score
from sklearn.metrics import precision_recall_fscore_support
import random
import sys
#F... |
# pylint: disable=W0223
from pandas.core.common import _asarray_tuplesafe
from pandas.core.index import Index, MultiIndex
import numpy as np
# "null slice"
_NS = slice(None, None)
class IndexingError(Exception):
pass
class AmbiguousIndexError(Exception):
pass
class _NDFrameIndexer(object):
def __i... |
from highlevel_planning_py.skills.grasping import SkillGrasping
from highlevel_planning_py.tools.util import get_combined_aabb, SkillExecutionError
import pybullet as p
import numpy as np
class PredicatesBase:
def __init__(self, client_id):
self.pb_client_id = client_id
def on_(self, supporting_uid, ... |
# -*- coding: utf-8 -*-
"""
Catch-up TV & More
Copyright (C) 2017 SylvainCecchetto
This file is part of Catch-up TV & More.
Catch-up TV & More 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 Foundat... |
import pickle, pdb, os
import numpy as np
import pandas as pd
import torch
import torch.utils.data as data
class Dataset(data.Dataset):
def __init__(self, states, actions, next_states, disturbance, rewards, old_logprobs, CC, cc):
self.states = states
self.actions = actions
self.next_states... |
# Copyright (c) 2012, <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... |
"""rpmci - Command Line Interface
The `cli` module provides a command-line interface to the rpmci package. It
provides the most basic way to execute and interact with the rpmci functions.
"""
# pylint: disable=invalid-name,too-few-public-methods
import argparse
import contextlib
import json
import logging
import os
... |
# tests for authentication application
from authors.apps.authentication.models import User, UserManager
from authors.apps.authentication.views import (
generate_ver_token, send_verification_link
)
import datetime
import jwt
from decouple import config
from django.test import TestCase
from rest_framework import... |
from ctapipe.visualization import CameraDisplay
from matplotlib.collections import PatchCollection
from ctapipe.instrument import PixelShape
from matplotlib import pyplot as plt
from astropy import units as u
from matplotlib.patches import RegularPolygon, Rectangle, Circle
from ctapipe.io import EventSource, EventSeeke... |
import pandas as pd
import numpy as np
from utils import duplicates_in_list
from sklearn.cluster import KMeans
from matplotlib import pyplot
import random
def combine_estimation_methods():
return None
def conc_flood_fill_com(conc_estimated, threshold=0.95):
"""
Flood fills from center of mass
"... |
from enum import Enum
# Helper method for getting an enum value from a string
def enum_from_string(enum_dict, string):
string = string.lower()
if string in enum_dict:
return enum_dict[string]
return None
# The languages supported by CRACKn
class Language(Enum):
PYTHON = 0
@classmethod
... |
import numpy as np
import control
import scipy
import matplotlib.pyplot as plt
class SE2:
"""
This is an implementation of the mathematical group SE2, that represents rigid
body motions in the plane. We are using it as it allows us to turn the
non-linear control problem of driving a car on a plane into a lin... |
"""
Logic for parsing the "flat" lists of JSON data from the Khan Academy API and
converting to a topic tree of `KhanNode` classes.
"""
from collections import OrderedDict
from html2text import html2text
import json
import os
from le_utils.constants.languages import getlang, getlang_by_name
from ricecooker.config impo... |
# Auto generated from issue_14.yaml by pythongen.py version: 0.9.0
# Generation date: 2021-01-04 21:53
# Schema: test14
#
# id: https://example.com/test14
# description:
# license: https://creativecommons.org/publicdomain/zero/1.0/
import dataclasses
import sys
import re
from typing import Optional, List, Union, Dict,... |
"""
uplinker.py:
Contains the code necessary to uplink files through the F prime ground system to a running deployment. The file uplink
process will read in a file from the OS, and uplink it in chunks. The system throttles chunks of the file requiring a
handshake packet in return before the next chunk is sent out.
@a... |
from gurobipy import GRB, quicksum
import gurobipy as gp
def get_core_gurobi_model(space, add_model_core=None):
"""Add core to gurobi model, i.e. bounds, variables and parameters.
Parameters
----------
space : scikit-optimize object
Captures the feature space
model : gurobipy.Model,
... |
# -*- coding: utf-8 -*-
import logging
import numba
import numpy as np
try:
import scipy.signal
from scipy import optimize as opt
except ImportError as e:
opt_import_err = e
else:
opt_import_err = None
from africanus.util.requirements import requires_optional
@numba.jit(nopython=True, nogil=True,... |
from math import isnan, isinf
import pandas as pd
from pyspark.ml.linalg import DenseVector
from pyspark.rdd import RDD
from pyspark.sql import functions as F, DataFrame, Row
from pyspark.sql.types import ArrayType, DoubleType, StructType, StructField
from pyspark.mllib.common import _java2py, _py2java
import traceback... |
from pelican import signals
from pelican.readers import BaseReader
import json
import os
from pathlib import Path
from urllib.parse import urlparse
from bs4 import BeautifulSoup
import requests
from time import sleep
import posixpath
from plugins.utils import fetch_image, get_last_modified
from pelican.utils import sl... |
#!/usr/bin/env python
"""Distutils setup file, used to install or test 'setuptools'"""
import io
import os
import sys
import textwrap
# Allow to run setup.py from another directory.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
src_root = None
from distutils.util import convert_path
command_ns = {}
init_path... |
import math
from typing import Optional, Union, List, Type
import numpy as np
import torch
import torch.multiprocessing
from falkon.sparse.sparse_tensor import SparseTensor
__all__ = (
"select_dim_over_nm",
"select_dim_over_nd",
"select_dim_over_nm_v2",
"calc_gpu_block_sizes",
"choose_fn",
"... |
import h5py
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
from skimage.measure import EllipseModel, regionprops
import math
def keys(f):
return [key for key in f.keys()]
# function to visualize T2 images, whole gland mask and sextant submasks
def mask_view(T2,whole,sextants,filepat... |
"""
Robust piecewise regression.
"""
# <NAME> <<EMAIL>>
# Copyright (C) 2020
import numbers
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.utils import check_array
from sklearn.utils import check_consistent_length
from sklearn.exceptions import NotFittedError
from .direct import lsq_direct
... |
# Copyright 2020 The FedLearner 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... |
#!/usr/bin/python
"""
Demo code
To run our method, you need a bounding box around the person. The person needs to be centered inside the bounding box and the bounding box should be relatively tight. You can either supply the bounding box directly or provide an [OpenPose](https://github.com/CMU-Perceptual-Computing-Lab... |
"""Support for aggregation-based AMG"""
__docformat__ = "restructuredtext en"
import numpy
import scipy
from scipy.sparse import isspmatrix_csr, isspmatrix_bsr
from pyamg.multilevel import multilevel_solver
from pyamg.util.utils import relaxation_as_linear_operator
from pyamg.relaxation.smoothing import change_smoot... |
""""
Essential Functions for applying MVARICA process on input signals.
"""
import numpy as np
import scipy as sp
from scipy.fftpack import fft
class MVAR:
"""
Implementing a multivariate vector autoregressive model.
Arguments:
model_order: Int, defines order of MVAR model.
fitting_meth... |
#!/usr/bin/env python 3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 PanXu, Inc. All Rights Reserved
#
"""
基于 bilstm + gat 的实体识别模型
相关论文:
Leverage Lexical Knowledge for Chinese Named Entity Recognition via Collaborative Graph Network
[ACL2019 论文地址](https://www.aclweb.org/anthology/D19-1396/)
Authors: PanXu
Date: ... |
"""
Main module to load the data
"""
# pylint: disable=C0330
import re
import random
import uuid
import os
from spark_partitionr import schema
INVALID_HIVE_CHARACTERS = re.compile("[^A-Za-z0-9_]")
storage = {'parquet': 'STORED AS PARQUET',
'com.databricks.spark.csv': ("ROW FORMAT SERDE"
... |
#!/usr/bin/python
# (c) 2020, NetApp Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""NetApp StorageGRID - Manage Grid-administration Users"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata... |
from flask import Blueprint, render_template, redirect, request, session, current_app, Flask
from flask.helpers import url_for
from flask_mail import Message
from datetime import datetime
from itsdangerous import URLSafeTimedSerializer, SignatureExpired
user = Blueprint("user", __name__, static_folder="static"... |
#!/usr/bin/env python3
import logging
logging.disable(logging.CRITICAL)
import os
import sys
import json
import socket
import requests
import pudb
import pfmisc
# pfstorage local dependencies
from pfmisc._colors import Colors
from pfmisc.debug import debug
from pfmisc.C_snode im... |
from __future__ import print_function
import sys
import re
import sublime
try:
# Python 3
from .__version__ import __version__
except (ValueError):
# Python 2
from __version__ import __version__
class BeautifierOptions:
def __init__(self):
self.indent_size = 4
self.indent_char = ' '... |
#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
from array import array
import cv2
import numpy as np
import time
import openncc as ncc
import struct
min_score = 0.8
media_head = 'iII13I'
def coordinate_is_valid(x1, y1, x2, y2):
if ((x1 < 0) or (x1 > 1)):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Pseudo-continuum-normalization. """
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__author__ = "<NAME> <<EMAIL>>"
__all__ = [
"fit_sines_and_cosines",
"normalize_individual_visit",
"normalize_... |
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import base64
import hashlib
import json
import logging
from typing import TYPE_CHECKING, Any, Dict
from Crypto.Cipher import AES
from feishu.dt_callback import (EventAppOpen, EventApproval, EventAppTicket, EventConta... |
# Import necessary libraries
import tweepy
from textblob import TextBlob
from tweepy import OAuthHandler
import csv
import re
import twitter_credentials
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import argparse
# TWITTER AUTHENTICATOR
class TwitterAuthenticator():
# Class constructor... |
#!/usr/bin/python
#
# (c) Copyright 2016 Hewlett Packard Enterprise Development LP
# (c) Copyright 2017 SUSE 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
#
# http://www.apache.org/lice... |
#!/usr/bin/python
import sys
import os
import re
import xml.sax
from nltk import tokenize
import time
import threading
from collections import Counter
from nltk.stem.porter import *
from Stemmer import Stemmer
from nltk.corpus import stopwords
from spacy.lang.en.stop_words import STOP_WORDS
from datetime import date... |
from enum import Enum
from typing import Union, List, Dict
def adcard():
def wrapper(K):
setattr(K, "get_element", get_element)
return K
return wrapper
def isFilled(value):
if value == None:
return False
return True
def get_element(self):
ret = {}
if self == None:
... |
from collections import OrderedDict
from string import Formatter
import shlex
from .table import Table
from .utils import interleave, basestring, ctx
class Reference:
def __init__(self, remote_table, remote_field, rjoins, join_alias, column):
self.remote_table = remote_table
self.remote_field = r... |
from typing import *
import re
import json
import os
class ClassLayout(Dict):
class_size: int
# layout : [ (offset_in_class, member_name, member_type),... ]
# member_type is the hash of the class or struct of the member
layout: List[Tuple[int, str, str]]
# {
# class_hash: {
# 'class_s... |
from collections.abc import Iterable
from math import inf
from math import pi as π
from . import _ureg
from .util import fsolve, sanitize_energy
class TransitionRegistry(list):
_parent = None
def __init__(self, *args, parent=None, **kwargs):
super().__init__(*args, **kwargs)
self._parent = p... |
from struct import unpack
import pytest
import six
from lomond.errors import ProtocolError
from lomond.frame import Frame
from lomond.opcode import Opcode
@pytest.fixture
def frame_factory():
def inner(opcode=Opcode.TEXT, payload=b'', fin=1):
return Frame(opcode, payload, fin=fin)
return inner
def... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
# We know that MNIST images are 28 pixels in each dimension.1
img_size = 28
# Images are stored in one-dimensional arrays of this length.
img_size_flat = img_size * img_size
# Tuple with height and width of images u... |
"""
Generic utilities.
"""
from copy import deepcopy
from typing import List, Any, Tuple, Union, Dict, Callable, Optional
from functools import reduce, partial
from warnings import warn
import logging
import numpy as np
def as_list(x: Any) -> List[Any]:
"""Wrap argument into a list if it is not iterable.
:pa... |
# pyTweener
#
# Tweening functions for python
#
# Heavily based on caurina Tweener: http://code.google.com/p/tweener/
#
# Released under M.I.T License - see above url
# Python version by <NAME> 2009
# All kinds of slashing and dashing by <NAME> 2010, 2014
import math
import collections
import datetime as dt
import time... |
#####################################################################
# LogOddsRatio Class
#
# A class for computing Log-odds-ratio with informative Dirichlet priors
#
# See http://languagelog.ldc.upenn.edu/myl/Monroe.pdf for more detail
#
#####################################################################
__autho... |
#!/usr/bin/env python3
# Project : From geodynamic to Seismic observations in the Earth's inner core
# Author : <NAME>
""" Define classes and functions to play with positions and coordinates systems. """
from __future__ import division
from __future__ import absolute_import
import numpy as np
import sys # .float_i... |
"""
# ----------------------------------------------------------------------
# ast.py
#
# AST constructors for the Llama language
# http://courses.softlab.ntua.gr/compilers/2012a/llama2012.pdf
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# -----------------------------------------------------------------... |
import numpy as np
import datetime as dt
from os import listdir, path
def gather_mats(
split_mat, avg_5_mat, avg_25_mat, avg_50_mat, dates_mat, min_year
):
"""
Collects chosen columns from split and avg matrices and adds dates_mat
indicator data for each row (each day).
:param split_mat: origi... |
from ..scaled_prediction_statistics import ScaledPredictionStatistics
BALANCED = ([({'prediction': True}, True) for i in range(50)] + # TP
[({'prediction': False}, True) for i in range(50)] + # FN
[({'prediction': True}, False) for i in range(50)] + # FP
[({'prediction': False}... |
"""
`ast_processor.py`
-------------------
Processing ASTs. This module can generate networkx compatible graphs from this.
@author: <NAME> (@thaonguyen19), <NAME> (@dtsbourg)
License: CC-BY 4.0
"""
import utils
import networkx as nx
import ast
import json
import os
import numpy as np
import itertools
from ast_tran... |
#!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "<NAME>" at 21:19, 17/03/2020 %
# ... |
import json
from datetime import timedelta
from functools import wraps
from django.db import IntegrityError
from django.contrib.auth import get_user_model
from django.contrib.auth.models import BaseUserManager
from django.shortcuts import get_object_or_404
from django.views.decorators.csrf import ensure_csrf_cookie
fr... |
"""
This example script creates a box in the middle of a half room
"""
import os
import sys
import time
import shutil
import fnmatch
import zipfile
import uuid
import bpy
#import rendering.BlenderAPI as bld
from . import BlenderAPI as bld
def finds(patterns, list):
results = []
for pattern in patterns:
... |
# Author: IconBall
from sklearn.model_selection import StratifiedKFold
import pandas as pd
import sys
from PIL import Image
import warnings
from tqdm import tqdm
import time
from torchvision import datasets, transforms
import torchvision
import copy
import numpy as np
import torch.optim as optim
import torch.nn.functio... |
from __future__ import absolute_import, division, print_function
import numpy as np
import pandas as pd
from dask.dataframe.core import _Frame, DataFrame, Series, aca, map_partitions
from dask.utils import derived_from
def _groupby_apply(df, ind, func):
return df.groupby(ind).apply(func)
def _groupby_apply_lev... |
import sys
import tempfile
import subprocess
import os
try:
from PyQt5.QtCore import Qt, QT_VERSION_STR, QDateTime, QCoreApplication, QRect, QThread, pyqtSignal, QProcess
from PyQt5.QtGui import QImage, QIntValidator, QValidator
from PyQt5.QtWidgets import QApplication, QFileDialog, QMainWindow, QDialog, Q... |
import sys
import os
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, os.path.join(ROOT_DIR, "src"))
import util
import torch
import numpy as np
from model import make_model
from render import NeRFRenderer
import torchvision.transforms as T
import tqdm
import imageio
impor... |
import logging
import quopri
import re
from datetime import datetime
from email import utils as email_utils
from email.message import EmailMessage
from typing import List, Optional, Set, Tuple
from aiohttp.web_exceptions import HTTPBadRequest
from bs4 import BeautifulSoup
from buildpg.asyncpg import BuildPgConnection
... |
import os
import sys
import time
import logging
from collections import namedtuple
import megengine as mge
import megengine.distributed as dist
import megengine.functional as F
import megengine.autodiff as autodiff
import megengine.optimizer as optim
import yaml
from tensorboardX import SummaryWriter
from nets impor... |
from __future__ import annotations
from typing import List, Optional, cast
import sqlalchemy as sa
import sqlalchemy_utils as su
from flask import url_for
from sqlalchemy import orm as so
from overhave.db.base import BaseTable, PrimaryKeyMixin, PrimaryKeyWithoutDateMixin, metadata
from overhave.db.statuses import Dr... |
# We compare armijo line search to fixed learning rate SGD
# when used to fit a CNN / MLP to MNIST
# Linesearch code is from
# https://github.com/IssamLaradji/stochastic_line_search/blob/master/main.py
import superimport
from armijo_sgd import SGD_Armijo, ArmijoModel
# Neural net code is based on various tutorials
... |
#!/usr/bin/env python3
import boto3
import inquirer
from botocore.client import BaseClient
from pathlib import Path
from subprocess import run
from typing import Optional
def get_basics() -> (BaseClient, list[str], list[dict], list[set], list[str]):
known_ssh_users = sorted(["ubuntu", "ec2-user", "centos", "admi... |
"""
This file includes code to index, load, and manage the traj_data json files from ALFRED.
"""
from typing import List, Dict, Union
import os
import json
import copy
# imports from ALFRED
from alfred.gen.utils.image_util import decompress_mask
from lgp.env.alfred.wrapping.paths import get_task_traj_data_path, get_... |
import logging
from contextlib import contextmanager
from datetime import datetime, timedelta
from decimal import Decimal
from functools import cached_property
from typing import Any, Callable, Dict, Generator, List, Optional
from grpc import Channel
from pytest_freezegun import freeze_time
from tinkoff.invest import... |
import unittest
import numpy
import torch
import nestedtensor as NT
from numbers import Number
from math import inf
from collections import OrderedDict
string_classes = (str, bytes)
def is_iterable(obj):
try:
iter(obj)
return True
except TypeError:
return False
# NOTE: Methods copy pa... |
# Copyright (c) 2016 by Revisify. All Rights Reserved.
from flask import Blueprint, render_template, redirect, session, request, flash
from flask.ext.login import login_user, login_required, current_user
from revisify.utils import *
from revisify.models import *
from revisify.forms import *
import json, requests, urll... |
from django.shortcuts import render,get_object_or_404,redirect
from django.contrib.auth import authenticate,login,logout
from django.http import HttpResponse
from .models import Album,Song,Palbum, Plist, Orders, OrderUpdate
from django.views.generic import View,CreateView,UpdateView,DeleteView
from .myforms import Mylo... |
import datetime as dt_module
from dynamicmethod import dynamicmethod
from collections import OrderedDict
__all__ = ['datetime', 'date', 'time',
'make_datetime', 'str_datetime',
'DATETIME_FORMATS', 'TIME_FORMATS', 'DATETIME_FORMATS']
DATE_FORMATS = [
'%m/%d/%Y', '%Y-%m-%d', '%y-%m-%d', '%m/... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""This module corresponds to the misc directory in idlutils.
"""
from __future__ import print_function
import numpy as np
from . import PydlutilsException
def decode_mixed(x):
"""Convert bytes in Numpy arrays into strings. L... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Docstring
"""Butyi's Python3 Auto-DJ RadioPlayer. It plays programme of my radio station."""
# Authorship information
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, butyi.hu"
__credits__ = "<NAME> (jiaaro) for pydub (https://github.com/jiaaro/pydub)"
__license__... |
import random
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('bmh')
import matplotlib
matplotlib.rcParams['font.family'] = 'IPAPGothic'
import seaborn as sns
from sklearn.model_selection import train_test_split
import umap
import keras
from keras.models import Sequential
from... |
# coding: utf-8
# In[ ]:
print("ElizaBETE Project (alpha) - https://git.io/vN3nr")
print(" ")
print("===============")
# print("DISCLAIMER - this code is only for educational purposes and cannot be used as a therapy of any kind. Seek professional assistance if you have any physical or emotional disorders.")
# print(... |
#!/usr/bin/env python3
"""Script for launching the Science Data Processor Subarray Product Controller.
Copyright (c) 2013 SKA/KAT. All Rights Reserved.
"""
import os
import os.path
import signal
import argparse
import logging
import asyncio
import socket
import json
import urllib.parse
from typing import Tuple, O... |
# -*- coding: utf-8 -*-
import scrapy
import re
import os.path as pth
import logging
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support.wait import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC
from scrapy.loader import ItemLoader
# from scrapy_selenium ... |
import copy
from unittest import TestCase
import os.path as osp
import numpy as np
from pylinac.core.geometry import Point
from pylinac.core import image
from pylinac.core.image import DicomImage, ArrayImage, FileImage, DicomImageStack
from pylinac.core.io import TemporaryZipDirectory
from tests.utils import save_fil... |
#2016-2017 PERSONAL PROJECTS: TurtleChat!
#WRITE YOUR NAME HERE!
#####################################################################################
# IMPORTS #
##################################################################################... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 23 12:37:35 2015
Fock State Simulation, based on <NAME>, Chapman group
thesis
use fourth order Runge-Kutta to integrate equations.
@author: zag
"""
import numpy as np
import matplotlib.pyplot as plt
from numba import autojit
import sys
import time
from tqdm import tqdm
fr... |
# -*- coding: utf-8 -*-
# HQ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# HQ X
# HQ X quippy: Python interface to QUIP atomistic simulation library
# HQ X
# HQ X Copyright <NAME> 2010
# HQ X
# HQ X These portions of the source code are released under the GNU General
# HQ X Publ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Visualize bundles from a list.
The script will output a mosaic (image) with screenshots,
6 views per bundle in the list.
"""
from __future__ import division, print_function
import argparse
import logging
import os
import shutil
import nibabel as nib
from fury import ... |
#!/usr/bin/env python3
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
'''
How to Run this script:
python iterative_reranking_v3.py --use_cache --gold ../../worldtree_corpus_textgraphs2019sharedtask_withgraphvis/questions/ARC-Elementary+EXPL-Dev.tsv --eval -... |
import time
#import cv2 #what is this? I need to install OpenCV to use this
import os #what is this?
import math
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from collections import namedtuple
import numpy as np
from... |
def shoot(lon, lat, azimuth, maxdist=None):
"""Shooter Function
Original javascript on http://williams.best.vwh.net/gccalc.htm
Translated to python by <NAME>
lon : float
lat : float
azimuth : float
return : list
"""
glat1 = lat * np.pi / 180.
glon1 = lon * np.pi / 1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.