text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from get_boundary_list import get_shadow_point
from line_analysis import line_analysis
from xlrd import open_workbook
from xlutils.copy import copy
from math import sqrt
# example usage:
# sh.cell_value(rowx=1, colx=1)
# for i in range(sh.nrows)
# for i in range(sh.ncols)... |
""" Functions to scrape trail data from a trail page in the website wikiloc.com
-- <NAME> & <NAME> -- Nov 2019 - ITC data science project
The main function get_trail() is called from wikiloc_scraper.py for a specific web page
and returns trail_data dictionary """
from bs4 import BeautifulSoup as bs
from w... |
from .core import taichi_lang_core
from .util import *
import traceback
# Scalar, basic data type
class Expr:
materialize_layout_callback = None
layout_materialized = False
def __init__(self, *args, tb=None):
self.getter = None
self.setter = None
self.tb = tb
if len(args) == 1:
if isinsta... |
# -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... |
#!/usr/bin/env python3
"""Simple tool to work with protobuf in pyatv."""
import os
import sys
import glob
import stat
import difflib
import zipfile
import requests
import binascii
import argparse
import subprocess
from io import BytesIO
from collections import namedtuple
import cryptography
from google.protobuf.text_... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, <NAME> (@kbreit) <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '... |
# Copyright 2016 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
#!/usr/bin/env python
"""Doxygen XML to SWIG docstring converter.
Usage:
doxy2swig.py [options] input.xml output.i
Converts Doxygen generated XML files into a file containing docstrings
that can be used by SWIG-1.3.x. Note that you need to get SWIG
version > 1.3.23 or use <NAME>'s docstring patch to be able to us... |
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import tree_module as tm
import argparse
import itertools
from collections import defaultdict
import numpy as np
from gener... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
GI/GTK3 reactor tests.
"""
import os
import sys
try:
from twisted.internet import gireactor
from gi.repository import Gio
except ImportError:
gireactor = None
gtk3reactor = None
else:
# gtk3reactor may be unavailable even... |
# Copyright 2017 The Kubernetes 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 law or agreed to ... |
#!/usr/bin/env python
__author__ = "stdlib.h (@r888800009), <NAME> (@tomy0000000)"
__credits__ = ["stdlib.h", "<NAME>"]
__license__ = "MIT"
import random
import re
BUFFER = ""
open_file_seq = [
' %replace_val_name = fopen("/tmp/flag.txt", "w");',
" fclose(%replace_val_name);",
]
exp_seq = [
"""
int ... |
# Copyright (c) 2017,2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `indices` module."""
from datetime import datetime
import numpy as np
from metpy.calc import (bulk_shear, bunkers_storm_motion, critical_angle,
... |
import unittest
from deployer.query import Q, Query, QueryResult
from deployer.node import Node, Env
from deployer.exceptions import QueryException, ActionException
from .our_hosts import LocalHost
def get_query_result(query, instance):
return query._execute_query(instance).result
class ExpressionTest(unittes... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
"""Controller for Zolix TSA200-B and TSA200-BF linear translation stages.
The main component is the `TSA200` class, which represents a connection to the
translation stage. This can probably be used for other Zolix translation stages
by supplying the length argument, but has only been tested on TSA200 series.
Usage ex... |
#!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, 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 ap... |
"""
Extension of the filtering network proposed in Learning Two-View Correspondences and Geometry Using Order-Aware Network (ICCV 2019),
to 3D correspondence filtering. Source coude based on the OANet repository: https://github.com/zjhthu/OANet.
If you use in your project pelase consider also citing: https://arxiv.org... |
# -*- coding: utf-8 -*-
"""
The wordnet_explorer package contains the functions that are used to retreive synonyms from `WordNet <https://wordnet.princeton.edu/>`_ and `WOLF <http://pauillac.inria.fr/~sagot/index.html#wolf>`_.
Like the other packages, it outputs a :obj:`Graph` containing the results.
In addition to ... |
#!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... |
# Copyright 2018 The TensorFlow Probability 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 law o... |
#!/usr/bin/env python3
# Name: <NAME>
#
import sys
from math import sqrt
from collections import defaultdict
from scipy.stats import norm
import time
"""
Homework 1: finding the missing motif
Input/Output: STDIN / STDOUT
This script aims at finding the underrepresented motif by the z-score
Examples:
Order sequenc... |
import requests
import json
import threading
import time
import websocket
try:
import thread
except ImportError:
import _thread as thread
from random import*
class Robot:
def __init__(self,ip):
self.ip = ip
self.images_saved = []
self.audio_saved = []
self.faces_saved = [... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
# Canny
def Canny(img):
# Gray scale
def BGR2GRAY(img):
b = img[:, :, 0].copy()
g = img[:, :, 1].copy()
r = img[:, :, 2].copy()
# Gray scale
out = 0.2126 * r + 0.7152 * g + 0.0722 * b
out = out.astype(np.uint8)
return out
# Gaussian f... |
# Copyright 2016 <NAME>, alexggmatthews, <NAME>
# Copyright 2017 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... |
'''classes to ease the creation of html documents'''
import xml.etree.ElementTree as ET
import sys
IS_PY3 = sys.version[0] == '3'
if IS_PY3:
unicode = str
if callable(ET.Element):
class Element(ET._ElementInterface, object):
pass
else:
class Element(ET.Element):
pass
def quote(text):
... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
import shutil
import tempfile
import pytest
from ddf_utils.chef.api import Chef
from ddf_utils.chef.exceptions import IngredientError, ProcedureError, ChefRuntimeError
wd = os.path.dirname(__file__)
def chef_fn(fn):
return Chef.from_recip... |
import numpy as np
from sklearn.exceptions import NotFittedError
from sklearn.linear_model import Lasso, LinearRegression
from sklearn.linear_model._coordinate_descent import _alpha_grid
try:
import pycasso
except ImportError:
pycasso = None
from .base import AbstractUoILinearRegressor
class PycLasso():
... |
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
from collections import deque
import json
import logging
from leapcast.environment import Environment
import tornado.web
import threading
from __builtin__ import id
class App(object):
'''
Used to relay messages between app Environment.channels
... |
import logging
from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Any, Dict, List, Tuple, Union
import numpy as np
import pandas as pd
import pyarrow as pa
import pytest
from feast.infra.offline_stores.offline_store import RetrievalJob
from feast.types import Array, Bool, Fl... |
import re
import json
import random
import time
from performance.driver.core.events import ParameterUpdateEvent, TeardownEvent, Event
from performance.driver.core.classes import Channel
from performance.driver.core.template import TemplateString, TemplateDict
from performance.driver.core.reflection import subscribesTo... |
import os
import sys
from datetime import datetime
import csv
import json
# Layer code, like parsing_lib, is added to the path by AWS.
# To test locally (e.g. via pytest), we have to modify sys.path.
# pylint: disable=import-error
try:
import parsing_lib
except ImportError:
sys.path.append(
os.path.joi... |
# Copyright 2021 <NAME> (<EMAIL>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
#!/usr/bin/env python
import extractor_util as util
from collections import namedtuple
import os
import ddlib
import config
import sys
import re
parser = util.RowParser([
('relation_id', 'text'),
('doc_id', 'text'),
('section_id', 'text'),
('sent_id', 'int'),
('gene_me... |
"""
Plot detailed results for a single dataset using both adversaries.
"""
import os
import argparse
import sys
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here + '/../')
sys.path.insert(0, here + '/../../')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from plot_dele... |
import json
import eosfactory.core.logger as logger
import eosfactory.core.interface as interface
import eosfactory.core.cleos as cleos
class GetInfo(cleos.Cleos):
'''Get current blockchain information.
:param bool is_verbose: If ``False``, print a message. Default is ``True``.
:return: A :class:`eosf... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 20 19:39:40 2018
@author: abhijay
"""
# Comment
import os
if not os.path.exists('Q14_plots'):
os.mkdir('Q14_plots')
#os.getcwd()
#os.chdir("/home/abhijay/Documents/ML/hw_1/11632196/")
import matplotlib.pyplot as plt
import pandas as pd
import... |
import pandas as pd
import numpy as np
import time
import datetime
import random
from sklearn.preprocessing import Imputer
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn import preprocessing
from sklearn.decomposition import PCA
from sklearn.model_selec... |
import mpi4py
from mpi4py import MPI
import numpy as np
import threading
import logging
import sys
sys_excepthook = sys.excepthook
def mpi_excepthook(v, t, tb):
sys_excepthook(v, t, tb)
mpi4py.MPI.COMM_WORLD.Abort(1)
sys.excepthook = mpi_excepthook
TAG_CNT_PACKETS = 11
TAG_PAYLOAD = 12
mpi4py.rc.threaded = ... |
import requests
import pandas as pd
import glob
import json
import time
import os
def pull_ridership_by_stop(line_number):
"""
Pull the ridership data from the local files - only get the fields we care
about, sorted, and return the Dataframe.
"""
# allFiles = glob.glob('.' + "/gps_*.csv")
fram... |
from __future__ import print_function
import os
import torch
from torch.utils.model_zoo import load_url
from enum import Enum
from skimage import io
from skimage import color
import numpy as np
import cv2
try:
import urllib.request as request_file
except BaseException:
import urllib as request_file
... |
"""
@author: <NAME>, portions originally by JTay
"""
import numpy as np
import pandas as pd
import sklearn.model_selection as ms
from collections import defaultdict
from sklearn.metrics import make_scorer, accuracy_score
from sklearn.utils import compute_sample_weight
import matplotlib.pyplot as plt
cv_folds = 5
# ... |
import json
import os
from typing import IO, Tuple
from io import BytesIO
import numpy as np
from skimage.io import imsave
from slicedimage import (
Collection,
ImageFormat,
Tile,
TileSet,
Writer,
)
from starfish.constants import Coordinates, Indices
AUX_IMAGE_NAMES = {
'nuclei',
'dots'... |
import numpy as np
import gym
import seaborn as sns
import matplotlib.pyplot as plt
import torch
import os.path as osp
import wandb
from PIL import Image
from collections import defaultdict
from gym_minigrid.wrappers import *
from goal_prox.envs.debug_viz import DebugViz
import rlf.rl.utils as rutils
import random
d... |
# coding: utf8
import pickle as pkl
import os
from src.combopt.graph import Grafo_consumos
def inicializar_etiqueta(nodo_rel: object, G: Grafo_consumos, nombre_label: str ):
etiqueta_atributos = {'nodo_rel': nodo_rel,
'nombre_label': nombre_label}
ruta_absoluta = r'D:\UdeA\estado... |
#=============================================================================
# coding=utf-8
#
# Cartesian Coordinate Mapping
#
# A recurring need in graphical programming is mapping one Cartesian
# coordinate system onto another. Writing the same proportional mapping code
# in every program feels wrong, and seems li... |
########
# Copyright (c) 2018 Cloudify Platform Ltd. 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 requi... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2022, <NAME>"
__email__ = "<EMAIL>"
__license__ = "MIT"
import base64
import os
import re
import struct
import time
from snakemake.remote import AbstractRemoteObject, AbstractRemoteProvider
from snakemake.exceptions import WorkflowError, CheckSumMismatchException
from ... |
import time
import yaml
from pathlib import Path
import matplotlib
import numpy as np
import yaml
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import torch
import torch.utils.data
from torch.utils import tensorboard
from liegroups.torch import SO3
from deeplio import datasets as ds
from deeplio.common im... |
# Copyright 2018 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... |
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
def cityscapes_classes():
"""Cityscapes class names for external use."""
return [
'road', 'sidewalk', 'building', 'wall', 'fence', 'pole',
'traffic light', 'traffic sign', 'vegetation', 'terrain', 'sky',
'person', 'rider', 'ca... |
# imports - standard imports
import getpass
import json
import os
import re
import sys
# imports - third party imports
import click
from html2text import html2text
import requests
from tenacity import retry, stop_after_attempt, wait_fixed
# imports - module imports
import frappe
import frappe.utils.backups
from frapp... |
# Copyright (c) 2021 Baidu.com, 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 l... |
"""App API views.
"""
from __future__ import absolute_import, unicode_literals
import logging
import requests
import json
from django.core.files.images import ImageFile
from django.utils import timezone
from drf_yasg2 import openapi
from drf_yasg2.utils import swagger_auto_schema
from filters.mixins import FiltersMi... |
# Copyright 2019 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... |
# Copyright (c) 2022, NVIDIA CORPORATION.
import ast
import functools
from typing import List, Tuple
from cudf._lib.expressions import (
ASTOperator,
ColumnReference,
Expression,
Literal,
Operation,
)
# This dictionary encodes the mapping from Python AST operators to their cudf
# counterparts.
py... |
"""
Contains various tools to aid in preparing MIDI tracks for training the
neural network, as well as tools to convert outputted piano roll format
music into MIDI files to be played.
"""
import os
import numpy as np
import pretty_midi as pm
from mido.midifiles.meta import KeySignatureError
import warnings
from tqdm im... |
import unittest
class Clock:
def __init__(self, hour, minute):
self.hour = hour
self.minute = minute
self._normalize()
def _normalize(self):
if self.minute < 0:
h = (-self.minute) // 60 + 1
self.minute += 60 * h
self.hour -= h
elif ... |
"""Module for image services."""
from ftplib import FTP
import io
import json
import logging
import os
from aiohttp import ClientSession, hdrs, web
from azure.cognitiveservices.vision.computervision import ComputerVisionClient
from azure.cognitiveservices.vision.computervision.models import OperationStatusCodes
from a... |
# Copyright 2018, The TensorFlow Federated 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 law o... |
"""
Author <NAME> <EMAIL>
Main script pulls all EBI expression atlas data into scanpy objects. If you change this code you'll likely
break the ebi ingest script.
To run, source an environment built from requirements.txt and change the TMPDIR and DATADIR globals
below the import statements. Currently the script has no... |
import nibabel
import numpy as np
from ..heart import ahaseg
from .cine import get_frame, auto_crop
from .viz import montage
import matplotlib.pyplot as plt
from os.path import join, basename
import glob
import os
from tqdm import tqdm
import shutil
def get_loc(num, got_apex):
loc = dict()
if got_apex> 0:
... |
import logging
import re
import numpy as np
import pandas as pd
from multiprocessing import Pool
from sklearn.base import BaseEstimator, TransformerMixin
from melusine.utils.multiprocessing import apply_by_multiprocessing
def aggregation_percentile_60(x):
"""
Explicit definition of the percentile 6... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
from helpers import get_regex_images
import numpy as np
from skimage.morphology._util import _offsets_to_raveled_neighbors
import torch
import torch.nn as nn
def channel_losses_to_dict(inputs, targets, channels, loss_dict):
loss = nn.BCELoss()
for i, c in enumerate(channels):
c_input = inputs[:, i, ..... |
#!/usr/bin/env python
import signal
import rospy
import smach
import smach_ros
import cv2
import cv_bridge
import numpy
import time
import math
from sensor_msgs.msg import Image
from enum import Enum
green_mask = [['a']]
red_mask = [['a']]
bridge = cv_bridge.CvBridge()
shutdown_requested = False
h, w, d = 0, 0, 0
c1T... |
# --- ELLIPTIC CURVE MATH ------------------------------------------------------
#
# curve definition: y^2 = x^3 - p*x - q
# over finite field: Z/nZ* (prime residue classes modulo a prime number n)
#
#
# COPYRIGHT (c) 2010 by <NAME> <<EMAIL>>
# ------------------------------------------------------------------... |
# SPDX-License-Identifier: MIT
import os
import os.path
import re
from typing import Any, Dict, List, Mapping, Optional, Tuple
import packaging.markers
import packaging.requirements
import packaging.version
import trampolim._build
class Metadata():
def __init__(self, data: Mapping[str, Any]) -> None:
... |
# Copyright 2012 Nebula, Inc.
# Copyright 2014 IBM Corp.
#
# 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... |
from sympy.core import S, Symbol, Add, sympify, Expr, PoleError, Mul, oo, C
from sympy.functions import tan, cot
from gruntz import gruntz
def limit(e, z, z0, dir="+"):
"""
Compute the limit of e(z) at the point z0.
z0 can be any expression, including oo and -oo.
For dir="+" (default) it calculates t... |
import cv2
import sys
import numpy as np
import maxflow
from skimage.segmentation import slic
from skimage.segmentation import mark_boundaries
from skimage import img_as_ubyte
from dijkstar import Graph, find_path
import os
import preprocess_minh
import matplotlib.pyplot as plt
import numpy as np
import example.exampl... |
from emcee.utils import MPIPool
import matplotlib.pyplot as plt
from matplotlib.ticker import FormatStrFormatter
import subprocess as sp
import sys
import numpy as np
import pandas as pd
import seaborn as sns; sns.set_style('ticks')
import emcee
from astrocail import plotting
import time
class MCMCrun:
def __init_... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import os
import logging
import argparse
import random
from tqdm import tqdm, trange
import pickle
import json
import numpy as np
import torch
from torch.nn import CrossEntropyLoss
from torch.utils.... |
# Terrain Data Menu
import sys
from PyQt5.QtWidgets import QWidget, QDialog, QFormLayout, QLabel, QInputDialog
from PyQt5.QtWidgets import QDialogButtonBox, QGridLayout, QListWidgetItem
from PyQt5.QtCore import Qt, QSize
from PyQt5.QtGui import QIcon
sys.path.append('../')
import Code.Engine as Engine
# So ... |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016-2019 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration."""
from __future__ import absolute_import, print_function,... |
# -*- coding: utf-8 -*-
# Copyright 2018 Etsy 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... |
"""Tools for manipulation of expressions using paths. """
from __future__ import print_function, division
from sympy.core import Basic
class EPath(object):
r"""
Manipulate expressions using paths.
EPath grammar in EBNF notation::
literal ::= /[A-Za-z_][A-Za-z_0-9]*/
number ::= /-?... |
#!/usr/bin/python3
# Halide tutorial lesson 12.
# This lesson demonstrates how to use Halide to run code on a GPU.
# This lesson can be built by invoking the command:
# make test_tutorial_lesson_12_using_the_gpu
# in a shell with the current directory at python_bindings/
import halide as hl
import imageio
impor... |
"""BasicMessage Plugin."""
# pylint: disable=invalid-name, too-few-public-methods
import re
from aries_cloudagent.connections.models.conn_record import ConnRecord
from aries_cloudagent.core.profile import ProfileSession, Profile
from aries_cloudagent.config.injection_context import InjectionContext
from aries_cloudag... |
# encoding: utf-8
__version__ = "1.0"
"""
##--------------------------------------#
## Kvasir
##
## (c) 2010-2013 Cisco Systems, Inc.
##
## Statistical functions
##
## Author: <NAME> <<EMAIL>>
##--------------------------------------#
"""
from StringIO import StringIO
from gluon import current
from skaldship.hosts ... |
# 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
# distrib... |
# Copyright 2019-2020 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" fil... |
import numpy as np
import math
import argparse
def get_parser():
parser = argparse.ArgumentParser(conflict_handler='resolve')
# --------------- specify yml config -------------------------------
# parser.add_argument("--yaml_config", action="store", dest="yaml_config", default=None, type=str,
# ... |
"""Test the self-test functionality.
Self-tests are not unit tests -- they are executed at runtime on a
specific installation. They verify that that installation is properly
configured, not that the code is correct.
"""
import datetime
from ..testing import DatabaseTest
from ..selftest import (
SelfTestResult,
... |
from __future__ import print_function
import argparse
import json
import yaml
import os.path
from jinja2 import Template
from shared.common import parse_arguments, get_regions, get_account_stats, get_collection_date, get_access_advisor_active_counts
from shared.nodes import Account, Region
from shared.public import ge... |
"""Parser for XML bookmarks using the XBEL DTD."""
__version__ = '$Revision: 1.10 $'
import bookmarks
import bookmarks.iso8601
import bookmarks.nodes
import string
class CaptureError(Exception):
def __init__(self, msg):
self.msg = msg
Exception.__init__(self)
class CaptureMixin:
def __ini... |
"""Static Agent Connection."""
import asyncio
import json
from contextlib import contextmanager
from typing import (
Union, Callable, Awaitable, Dict,
Tuple, Sequence, Optional, List,
Set
)
import uuid
from collections import namedtuple
from . import crypto
from .dispatcher import Dispatcher, Handler
from ... |
import os
import quaternion
import numpy as np
from simulator import Simulation
import torch
import json
#Helper functions
vec_to_rot_matrix = lambda x: quaternion.as_rotation_matrix(quaternion.from_rotation_vector(x))
rot_matrix_to_vec = lambda y: quaternion.as_rotation_vector(quaternion.from_rotation_matrix(y))
d... |
# 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
# d... |
"""
Module for input/output utilities
"""
import os
import sys
import numpy as np
try:
import pandas as pd
except:
pd = False
def _fmt_string(array, float_format="{}"):
"""
makes a formatting string for a rec-array;
given a desired float_format.
Parameters
----------
array : np.recar... |
#!/usr/bin/env python3
import logging
# Setup logging as required. Rekall will log to the standard logging service.
logging.basicConfig(level=logging.CRITICAL)
from rekall import session
from rekall import plugins
from rekall.plugins.addrspaces import intel
from fsminidump.minidump import Minidump
import sys
from bina... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from .spectral import SpectralNorm
from torchvision import transforms
import numpy as np
class Self_Attn(nn.Module):
""" Self attention Layer"""
def __init__(self,in_dim,activation):
super(... |
import numpy as np
import basis.robot_math as rm
import basis.data_adapter as da
from panda3d.ode import OdeTriMeshData, OdeTriMeshGeom, OdeUtil, OdeRayGeom
# util functions
def gen_cdmesh_vvnf(vertices, vertex_normals, faces):
"""
generate cdmesh given vertices, vertex_normals, and faces
:return: panda3d... |
import numpy as np
import cv2
import cv2.aruco as aruco
import glob
import argparse
cap = cv2.VideoCapture(0)
# termination criteria
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001)
class Namespace:
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
def calibrate():
... |
# file openpyxl/reader/excel.py
# Copyright (c) 2010-2011 openpyxl
#
# 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, co... |
from django.utils.translation import gettext_lazy as _
from django import forms
import django.core.exceptions
import django.contrib.auth.forms
import django.contrib.auth.password_validation
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Field, HTML, Hidden
import crispy_form... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from contextlib import contextmanager
from itertools import cycle
import logging
from logging import CRITICAL, Formatter, NOTSET, StreamHandler, WARN, getLogger
import os
import signal
import sys
from threading i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.