text stringlengths 6.04k 39.5k |
|---|
import argparse
import os
import json
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
import logging
import torchvision.transforms as transforms
import torch.utils.data as data
from itertools import product
import copy
from sklearn.metrics import confusion_matrix
from model import FcN... |
"""
This is the main app for VariantGrid, and this file contains the main models for Variants / Samples
etc and things that don't fit anywhere else.
'snpdb' was the highly unoriginal name I used before 'VariantGrid'
"""
import json
import logging
import re
from datetime import datetime
from functools import total_ord... |
#
# 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
# ... |
# Owner(s): ["module: primTorch"]
from collections import defaultdict
from torch import Tensor
import torch.autograd
from torch.utils._python_dispatch import enable_torch_dispatch_mode
from torch._decomp import decomposition_table
from torch.utils._pytree import tree_map, tree_flatten, tree_unflatten
from torch.testi... |
# Copyright (c) 2012 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.
"""This module tests the cros image command."""
from __future__ import print_function
import copy
import mock
import os
import shutil
from chromite... |
from bson import ObjectId
from fastapi import Depends, Request
from starlette.background import BackgroundTasks
from api import router_public, current_user_id, optional_user_id
from api.user import table_user, get_user
from api.user import random_avatar
from config import conf
from db import mongo
from models import R... |
import json
import time
from operator import itemgetter
import requests
from pkg_resources import resource_string
from six import StringIO
from base import api_asserts
# Simple workflow that takes an input and call cat wrapper on it.
workflow_str = resource_string( __name__, "data/test_workflow_1.ga" )
# Simple wo... |
import importlib
import importlib.abc
import importlib.machinery
import importlib.util
import logging
import logging.handlers
import os
import site
import sys
import time
import traceback
import types
import pythiainternal
import pythialogger as logger
# If you want the user modules to be reloaded each time the funct... |
# -*- coding: utf-8 -*-
'''
This module have been tested on infoblox API v1.2.1,
other versions of the API are likly workable.
:depends: libinfoblox, https://github.com/steverweber/libinfoblox
libinfoblox can be installed using `pip install libinfoblox`
API documents can be found on your infoblox server at:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018, <NAME> and contributors
# For license information, please see license.txt
# python std lib imports
from __future__ import unicode_literals
import datetime
from calendar import monthrange
# frappe imports
import frappe
from frappe.model.document import Document
class Rea... |
import os
import subprocess
from os.path import join
import yaml
import tempfile
import argparse
from pathlib import Path
from skimage.io import imread
import numpy as np
import librosa
from util import util
from tqdm import tqdm
import torch
from collections import OrderedDict
import cv2
from moviepy.video.io.ffmpeg_t... |
from pymatgen.analysis.magnetism.analyzer import MagneticStructureEnumerator
from shutil import copy
from solver import solver
import os
import numpy as np
from tqdm import tqdm
from pymatgen.core import Structure
from pymatgen.io.vasp.sets import MPStaticSet
import matplotlib.pyplot as plt
from pymatgen.io.vasp.output... |
import json
import multiprocessing
import os
import cv2_extras as cv2x
import cv_color_features as color_utils
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from sklearn.cluster import spectral_clustering
from sklearn.feature_extraction import image as sk_image
# weird import style to un-co... |
import random
import cv2
import numpy as np
import time
import os
import pymunk
import robolib.modelmanager.downloader as downloader
# ==Win==
pointsToWin = 3
# ==MODEL==
MODEL_FILE = downloader.get_model(downloader.HAARCASCADE_FRONTALFACE_ALT, True)
face_cascades = cv2.CascadeClassifier(MODEL_FILE)
# ==WINDOW==
... |
import os,sys,operator,copy
class node:
def __init__(self):
self.function = None
self.arguments = []
class parse_to_asp:
def __init__(self, asp_dir, word_to_ontology_map):
#store arguments
self.asp_dir = asp_dir
self.word_to_ontology_map = word_to_ontology_map
#functions to known ASP fact names wh... |
from collections import OrderedDict
import sys
import opt_einsum
from pyro.distributions.score_parts import ScoreParts
from pyro.distributions.util import scale_and_mask
from pyro.ops.packed import pack
from pyro.poutine.util import is_validation_enabled
from pyro.util import warn_if_inf, warn_if_nan
class Trace(ob... |
import logging
import math
import multiprocessing
import struct
import sys
import threading
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from contextlib import contextmanager
import os
import random
import requests
import cv2
import numpy as np
import time... |
#!/usr/bin/env python
# coding: utf-8
# Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# ... |
# 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... |
import numpy as np
import pandas as pd
import glob
import os
import webbrowser
import time
# import sys
# import matplotlib
# matplotlib.use('TkAgg')
# import matplotlib.pyplot as plt
import pytz
def make_lat_long_grid(lat_lims=[-124,-66], lon_lims=[25, 47], lat_step=1, lon_step=1 ):
"""
Make a lat/long grid... |
import math as m
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.distance import cdist
import random as rd
def distanceEu(a, b):
d = 0.0
for i in range(len(a)):
d += (b[i]-a[i])*(b[i]-a[i])
return np.sqrt(d)
def neighborhoodFunction(dist, sigma):
return m.exp... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
TODO:
* None --> undefined
* provide:
print(...) --> console.log
str(...) --> ...toString()
* check environment:
Browser
nodejs
JScript
* self --> this is currently handled by manipulating the name space. That's kind of uncool.
"""
... |
from django.http import HttpResponse, JsonResponse
from django.urls import reverse
from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import View, TemplateView
from django.conf import settings
from django.template.loader import render_to_string
from django.db import transaction
f... |
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import autograd
from models.layers import Identity, MLP
from models.reparam import NormalDistributionLinear
from utils import loss_kld_gaussian, loss_kld_gaussian_vs_gaussian, loss_recon_gaussian, normal_energ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Dell EMC OpenManage Ansible Modules
# Version 3.5.0
# Copyright (C) 2019-2021 Dell Inc. or its subsidiaries. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from __future__ import (absolute_import, divi... |
import os.path
import re
import warnings
from collections import defaultdict
from itertools import chain
from six import string_types
from six.moves import reduce, filter as ifilter
from . import builtin
from .. import options as opts
from .compile import Compile, ObjectFiles
from .file_types import local_file
from ..... |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2018 Contributor
#
# 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... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# -*- mode: Python -*-
#
# (C) <NAME>, 2019, 2020
#
__author__ = '<NAME>'
__license__ = 'MIT License'
__version__ = '1.0'
import sys
from sys import exit, exc_info, stdout, stderr, stdin
import collections
from collections import Iterable, Mapping
from copy import copy, dee... |
# rendering.py
""" Rendering functions """
import base64
import logging
import os
import typing
import flask
import werkzeug.exceptions as http_error
from flask import redirect, request, send_file, url_for
from pony import orm
from . import (__version__, caching, image, index, model, path_alias, queries,
... |
""" Callbacks for calculating scores."""
from contextlib import contextmanager
from contextlib import suppress
from distutils.version import LooseVersion
from functools import partial
import warnings
import numpy as np
import sklearn
from sklearn.metrics import make_scorer, check_scoring
if LooseVersion(sklearn.__ve... |
from __future__ import print_function
import numpy as np
import pycuda.driver as drv
from pycuda.compiler import SourceModule
from km3net.util import *
class CorrelateSparse(object):
""" Base class for kernels that correlate hits and output a sparse matrix """
def __init__(self, N, sliding_window_width, cc,... |
#
# Copyright (c) 2021 steelpy
#
# Python stdlib imports
from typing import NamedTuple, Tuple
# package imports
#
#
# self.compacness_compression, self.compacness_flexure
#
class ItemClass(NamedTuple):
"""
"""
compression:Tuple
flexure:Tuple
#
class Compactness:
"""
"""
__slots__ = ['comp... |
"""This file contains tests for individual management commands
These commands are run via `./manage.py command`."""
from datetime import date, datetime, time
from io import StringIO
import unittest
from unittest.mock import MagicMock
from django.core.management import call_command
from django.test import TestCase
im... |
#
# Copyright 2017 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# timeutils.py - <NAME> (<EMAIL>) - Sept 2013
'''
Contains various useful tools for dealing with time in astronomical contexts.
'''
#############
## LOGGING ##
#############
import logging
from astrobase import log_sub, log_fmt, log_date_fmt
DEBUG = False
if DEBUG:
... |
from argparse import ArgumentParser
import inspect
import os
import pickle
import sys
from pylatex import *
from pylatex.utils import *
from psychsim.pwl.keys import *
from psychsim.action import ActionSet
from psychsim.world import loadWorld
from psychsim.graph import DependencyGraph
def key2tex(key):
if isStat... |
###########################################################################
# Created by: Tramac
# Date: 2019-03-25
# Copyright (c) 2017
# https://github.com/Tramac/Fast-SCNN-pytorch
# modified by <NAME>
# Licensed under Apache 2.0
###########################################################################
"""Fast Seg... |
# Interactive with OpenLDAP server configured by iRedMail:
# https://www.iredmail.org/
#
# For more details, please read iRedMail official tutorial:
# https://docs.iredmail.org/integration.mlmmj.ldap.html
#
# Required Python modules:
#
# - `python-ldap` for LDAP backends
#
# Required parameters in settings.py
#
# -... |
import re
from typing import Optional, Union, Callable
from typeguard import typechecked
import numpy as np
import tensorflow as tf
from tensorflow.python.keras.optimizer_v2.optimizer_v2 import OptimizerV2
from tensorflow.python import ops, math_ops, state_ops, control_flow_ops
from tensorflow.python.keras import back... |
import time
import gym
import gym.spaces
import numpy as np
import numpy.linalg as la
from beamngpy import BeamNGpy, Scenario, Vehicle, setup_logging
from beamngpy.sensors import Electrics, Damage
from shapely import affinity
from shapely.geometry import LinearRing, LineString, Polygon, Point
def normalise_angle(a... |
import logging
import threading
import time
import random
from concurrent import futures
import grpc
import mafia_pb2
import mafia_pb2_grpc
import mafia.service.service_config as config
from mafia.service.decorators import validate_day, validate_night, validate_game_started, validate_game_not_started, \
validate_... |
import numpy as np
import os.path as osp
from gym import utils
from brl_gym.wrapper_envs.bayes_env import BayesEnv
from brl_gym.wrapper_envs.env_sampler import DiscreteEnvSampler
from brl_gym.envs.mujoco.point_mass import PointMassEnv
from brl_gym.envs.mujoco.point_mass_slow import PointMassSlowEnv
from brl_gym.envs.m... |
from nipype import Node, Workflow
import nipype.interfaces.mrtrix3 as mrt3
import nipype.interfaces.fsl as fsl
import os
import matplotlib.pyplot as plt
from pathlib import Path
import shutil
import argparse
import fnmatch
import sys
#TO-DO Add subject ID flags
parser = argparse.ArgumentParser()
parser.add_argument... |
# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import unicode_literals
from __future__ import print_function
import operator
from six.moves import xrange as range
# Set to true to enable additional assertions, array access checki... |
# Copyright 2021 CR.Sparse Development 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
"""
@dependencies: requirements.txt
@authors: <NAME>/ <NAME>
@coding: UTF-8
@url: https://github.com/rge123/c19sim
@v1.2.0 released 02/03/2022
A set of functions called by utils to run simulation compiled with numba
"""
import numpy as np
from numba import njit
def iterate(demographics, beta, gamma=0.25, omega=0.1):... |
import os, asyncio, time, requests, json
from datetime import datetime, date, time, timezone
import discord
from discord import Embed, Member, message
from discord.ext import commands, tasks
from itertools import cycle
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv("TOKEN")
client = commands.Bot(comm... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Aided regularization parameter estimation.
@author: <NAME>, Computational Imaging group, CWI, The Netherlands,
and ESRF - The European Synchrotron, Grenoble, France
"""
import numpy as np
from numpy.polynomial.polynomial import Polynomial
import matplotlib.pyplot as... |
import base64
import json
import copy as _copy
from .record import Record
from .exceptions import SerializationError, MethodNotAllowed, RequestError, ResourceMisconfigured
from .conf import settings
from .resolver import SchemaResolver, RequestResolver
from .response import Response
from .utils import get
from .expres... |
import xml.etree.ElementTree as ET
from xml.dom import minidom
debug_level = 2
function_uid = 1342649436
def debug_print(text, level = 1):
global debug_level
if (debug_level >= level):
print(text)
def printItems(self):
print(self.items)
class Snixception(RuntimeError):
def __init__(s... |
# power_ratings_v0.3.py
# Last updated: 29 August 2020
# https://github.com/JohnBurant/COVID19-Model-Power-Ratings
# Timeframe choices
first_week = 17
last_week = 35
nweeks = 3 # Input as 0-indexed, i.e., how many we actually want - 1
Nroll = 4 # Number of weeks to use for rolling average overall power rating (N->inf ... |
# -*- coding: utf-8 -*-
'''
Tests to try out nacling. Potentially ephemeral
'''
# pylint: skip-file
import sys
import inspect
import struct
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
from ioflo.base.consoling import getConsole
console = getConsole()
from ioflo.aid.odict... |
from __future__ import absolute_import
from nose.tools import (assert_equal, assert_not_equal, assert_almost_equal,
raises)
from nose.plugins.skip import Skip, SkipTest
import io
import sys
"""
import time
import re
if ((sys.version_info.major < 3)
or (sys.version_info.major == 3 and sy... |
# oracle.py
# Copyright (C) 2005, 2006, 2007 <NAME> <EMAIL>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sys, StringIO, string, re
from sqlalchemy import util, sql, engine, schema, ansisql, exceptions, logging
import sqlalche... |
import os
import json
import requests
import tornado.web
import tornado.ioloop
import tornado.autoreload
import sys
import asyncio
#import psycopg2
import time
# On IBM Cloud Cloud Foundry, get the port number from the environment variable PORT
# When running this app on the local machine, default the port to 8000
por... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import ... |
#!/usr/bin/env python3
"""Usage:
dogmover.py pull (<type>) [--tag tag]... [--dry-run] [-h]
dogmover.py push (<type>) [--dry-run] [-h]
Examples:
Dashboards:
dogmover.py pull dashboards
dogmover.py push dashboards
Synthetic api tests using --tag that only pulls tests if all the defined tags ... |
#!/usr/bin/env python
# Python 3.7
import argparse
import os
import sys
from osgeo import gdal
from osgeo import gdalconst
class QualityBandConverter:
def __init__(self, args):
self.args = args
self.bqa_dict = {}
self.nodatavalue = gdal.GDT_UInt16
if args.fill: self.fill_dict =... |
"""
Goo
===========================
This example shows how to implement a the basics of a WorldOfGoo clone
"""
from b2d.testbed import TestbedBase
from dataclasses import dataclass
import math
import random
import numpy
import b2d
from functools import partial
import networkx
def best_pairwise_distance(data, f, dis... |
# Copyright 2021 Sony Group 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 ... |
from collections import defaultdict
import pytest
from bluesky import Msg, RunEngineInterrupted
from bluesky.plan_stubs import (
create,
save,
drop,
read,
monitor,
unmonitor,
null,
abs_set,
rel_set,
trigger,
sleep,
wait,
checkpoint,
clear_checkpoint,
pause,
... |
"""Support for Xiaomi Smart WiFi Socket and Smart Power Strip."""
import asyncio
from functools import partial
import logging
from miio import AirConditioningCompanionV3, ChuangmiPlug, DeviceException, PowerStrip
from miio.powerstrip import PowerMode
import voluptuous as vol
from homeassistant.components.switch impor... |
#
"""
Functions that define and manipulate images. Images are just data and a World Coordinate System.
"""
import copy
import logging
import warnings
from astropy.wcs import FITSFixedWarning
warnings.simplefilter('ignore', FITSFixedWarning)
import numpy
import astropy.units as u
from astropy.coordinates import SkyCoo... |
# 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 appl... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder base configuration management
This file only deals with non-GUI configuration features
(in other words, we won't import any PyQt object here, av... |
# transformers.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import multiprocessing
from logging import getLogger
from math import ceil, log
from os import path, unlink, devnull
import platform
import random
import string
import subprocess
try:
from cStringIO import BytesIO
except ImportError... |
#!/usr/bin/python
# Copyright: (c) 2017, Ansible Project
# 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': '1.1',
'status': ['st... |
import time
import pytest
import logging
from datetime import datetime
from distutils.version import LooseVersion
from threading import Event
from cassandra import ConsistencyLevel as CL
from cassandra import ReadFailure
from cassandra.query import SimpleStatement
from ccmlib.node import Node, TimeoutError
from dtes... |
import os
import sys
import json
import torch
import pickle
import argparse
import numpy as np
from tqdm import tqdm
from copy import deepcopy
from torch.utils.data import DataLoader
from numpy.linalg import inv
#sys.path.append(os.path.join(os.getcwd())) # HACK add the root folder
#sys.path.append(os.path.join(os.g... |
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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
# 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
#
# Authors:
# - <NAME>, <EMAIL>, 2016-2017
# - <NAME>, <EMAIL>, 2017
# - <NAM... |
# Copyright 2016 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) 2017-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fut... |
# Space Invaders
# By Dave
#
# A simple Space Invaders clone
#
# Planned features not yet implemented:
# - bonus dropped if strobing invader hit
# - high scores tracking using pickled data
# - explosion effects (drawn using colored pixels?)
# - more....
# all the imports that make the code run
import math
import pyga... |
from __future__ import print_function, division, absolute_import
import time
import multiprocessing
import pickle
from collections import defaultdict
import warnings
import sys
# unittest only added in 3.4 self.subTest()
if sys.version_info[0] < 3 or sys.version_info[1] < 4:
import unittest2 as unittest
else:
... |
# Copyright 2021 SECTRA AB
#
# 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... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import threading
import weakref
from importlib import import_module
from sentry_sdk._types import MYPY
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.scope import add_global_event_processor
from sentry_sdk.serializer i... |
# -*- coding: utf-8 -*-
from sqlalchemy import Column, Unicode, Integer, Float, Boolean
from chsdi.models import register, bases
from chsdi.models.vector import Vector, Geometry2D, Geometry3D
Base = bases['vbs']
class Kulturgueter:
__table_args__ = ({'schema': 'babs', 'autoload': False})
__template__ = 'te... |
'''
Laws
====
*law of fresh*
if x is fresh, then unify(v, x) succeeds and associates x with v
*law of unify*
unify(v, w) is the same as unify(w, v)
*law of conde*
to get more values from conde, pretend that the successful conde line
has failed, refreshing all... |
# -*- coding: utf-8 -*-
# Copyright (C) 2006 <NAME>
#
# 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 2 of the License, or
# (at your option) any later version.
"""Read and writ... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Pylint widget"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disable=R0201
# Standard library imports
import os.path as osp... |
# Copyright 2017 The Oppia 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 applicable ... |
#
# Stackless compatible socket module (for Python 3.0+):
#
# Author: <NAME> <<EMAIL>>
#
# This code was written to serve as an example of Stackless Python usage.
# Feel free to email me with any questions, comments, or suggestions for
# improvement.
#
# This wraps the asyncore module and the dispatcher class it provid... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.c_cpp
~~~~~~~~~~~~~~~~~~~~~
Lexers for C/C++ languages.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, \
this... |
# -*- coding: utf-8 -*-
"""
Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational,
research, and not-for-profit purposes, without fee and without a signed licensing agreement, is
he... |
import numpy as np
import matplotlib.pyplot as plt
from .viz import Topo
from borsar.channels import find_channels
# TODOs:
# Viewer will need review and changes:
# 1. API
# for TFR: Viewer(data, info) - info lets you know what dims etc. if TFR
# Viewer(data, info, view='line') # for chan x freq or chan x time
#... |
"""Simulated cameras for rendering images."""
import itertools
import typing
import pathlib
import yaml
import numpy as np
import pybullet
from scipy.spatial.transform import Rotation
def calib_data_to_matrix(data: dict) -> np.ndarray:
"""Extract a matrix from a camera parameter dict (as loaded from YAML)."""
... |
import unittest
from succinct import tree
from test import (
bitvector,
encoding,
)
def getpos(n):
return n if n is None else n.pos
class TreeTestCases(object):
class TreeTests(unittest.TestCase):
# 1
# / | \
# 2 7 ... |
"""
File: my_drawing.py
Name: <NAME>
----------------------
The function draws a face by using GObject(GOval, GRect, GLabel, GPolygon, GArc) and Gwindow.
"""
from campy.graphics.gobjects import GOval, GRect, GLabel, GPolygon, GArc
from campy.graphics.gwindow import GWindow
window = GWindow(800, 400, title='Cute Emoji... |
#!/usr/bin/env python
import datetime
import json
import logging
import os
import pathlib
import re
import subprocess
import sys
from typing import List, NamedTuple, Optional, Text, Tuple
import pytz
from lxml import etree
# Configure logger. Increase to DEBUG for verbose logging in this parser.
logging.basicConfig(... |
# coding=utf-8
# Copyright 2021 The Trax 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 a... |
import io
import json
from operator import itemgetter
import re
from typing import Any, Dict, List, Optional, Union, cast
import pytest # type: ignore
from PIL import Image # type: ignore
from looker_sdk.sdk.api31 import methods as mtds
from looker_sdk.sdk.api31 import models as ml
@pytest.fixture(scope="module")... |
# Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from __future__ import absolute_import
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU Gener... |
# ===============================================================================
# Copyright 2013 <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/LI... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
import re
import numpy as np
from Bio import SeqIO
from function.utilities import fasta_to_seqlist
from function.utilities import find_human_sequence
from function.utilities import get_fasta_seq_info
class FastaExtreFilter:
"""
filter some homologous,
i.e. some sequences in homologous have very long gap... |
#!/usr/bin/env python3
from moveit_commander import roscpp_initialize
import moveit_commander
import actionlib
import rospy
import sys
from geometry_msgs.msg import Pose, Quaternion, Twist
import time
from tf.transformations import quaternion_from_euler, euler_from_quaternion
from tf.transformations import *
import tf... |
# -*- coding: utf-8 -*-
"""
hangulize.models
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2017 by <NAME>
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from collections import deque
import functools
import re
import sys
from six import text_type
from six.moves import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#%%
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patheffects as PathEffects
import seaborn as sns
from sklearn.metrics import confusion_matrix
from sklearn.utils.multiclass import unique_labels
import matplotlib
#%%
"""
Custom ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.