text stringlengths 3.07k 22.1k |
|---|
from __future__ import annotations
from copy import deepcopy
import inspect
import os
from collections.abc import Iterable
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Tuple,
Union,
get_type_hints,
)
import click
import yaml
from gs_manager.command.types import Server
fro... |
from __future__ import annotations
from inspect import Parameter, formatannotation, _empty
from typing import Union
from io import StringIO
from pathlib import Path
import functools
class _PyTextList(list):
def append(self, value):
if not isinstance(value, PyTextObject):
value = PyTextObject(v... |
import os
import numpy as np
import argparse
import json
import torch
import cv2
import scipy.io as sio
import matplotlib.pyplot as plt
import sys
sys.path.append('..')
import PnP
import models
def parse_arguments():
parser = argparse.ArgumentParser(description='PyTorch Training')
parser.add_argument('--confi... |
# Copyright (C) 2021, Pyronear contributors.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import enum
from .session import Base
from sqlalchemy.sql import func
from sqlalchemy import Column, DateTime, ... |
from typing import *
from pydgraph import DgraphClient
from grapl_analyzerlib.nodes.comparators import (
Cmp,
IntCmp,
_int_cmps,
StrCmp,
_str_cmps,
PropertyFilter,
)
from grapl_analyzerlib.nodes.queryable import NQ, Queryable
from grapl_analyzerlib.nodes.types import PropertyT, Property
from g... |
import numpy as np
from numpy.polynomial.polynomial import polyval, polyder
import networkx as nx
from networkx.algorithms.shortest_paths.generic import shortest_path
import spiceypy as spice
from ale.rotation import ConstantRotation, TimeDependentRotation
def create_rotations(rotation_table):
"""
Convert an... |
import penman
import re
from collections import Counter, defaultdict
from types import SimpleNamespace
import numpy as np
from .amr_graph import _is_attr_form, need_an_instance
# Note that penman triples typically have a colon in front of the relationship but
# it appears to add these automatically when creatin... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
%prog [anchorfile|ksfile] --qbed query.bed --sbed subject.bed
visualize the anchorfile in a dotplot. anchorfile contains two columns
indicating gene pairs, followed by an optional column (e.g. Ks value).
The option --colormap specifies the block color to highlight ce... |
from abc import ABCMeta, abstractmethod
import pygame
import math
from hexmap.map import Grid, Map, MapUnit
import sys
SQRT3 = math.sqrt( 3 )
class Render( pygame.Surface, metaclass=ABCMeta ):
def __init__( self, map, radius=24, *args, **keywords ):
self.map = map
self.radius = radius
# Colors for th... |
"""
`Learn the Basics <intro.html>`_ ||
`Quickstart <quickstart_tutorial.html>`_ ||
`Tensors <tensorqs_tutorial.html>`_ ||
`Datasets & DataLoaders <data_tutorial.html>`_ ||
`Transforms <transforms_tutorial.html>`_ ||
`Build Model <buildmodel_tutorial.html>`_ ||
`Autograd <autogradqs_tutorial.html>`_ ||
**Optimization... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_qs,
qualities,
try_get,
unified_strdate,
url_or_none,
)
class ArteTVBaseIE(InfoExtractor):... |
"""
This example shows a polyphonic generation with the performance rnn model.
VERSION: Magenta 1.1.7
"""
import math
import os
import time
import magenta.music as mm
import tensorflow as tf
from magenta.models.performance_rnn import performance_sequence_generator
from note_seq.protobuf.generator_pb2 import Generato... |
import time
import pandas as pd
import numpy as np
import gc
from os.path import join as opj
import matplotlib.pyplot as plt
import pickle
from tqdm import tqdm
import torchvision
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from dataset import HuBMAPDatasetTrain
from models import b... |
import torch
import torch.nn as nn
import functools
import torch.nn.functional as F
import torchvision.models as models
import torch.nn.utils
from torch.autograd import Function
import copy
def get_norm_layer(norm_type='instance'):
if norm_type == 'batch':
norm_layer = functools.partial(nn.Bat... |
import os
import numpy as np
from pymatgen.io.vasp.inputs import Poscar
from pymatgen import Structure
from pymatgen.core.operations import SymmOp
## A lot of the functions in here have been copied and only
## slightly modified from functions in the MPInterfaces package.
## It should be possible to merge and replace... |
"""Abstracts evaluation of IAM Policy statements."""
import logging
from cached_property import cached_property
from policy_sentry.analysis.analyze import determine_actions_to_expand
from policy_sentry.querying.actions import (
remove_actions_not_matching_access_level,
get_actions_matching_arn,
)
from policy_... |
# -*- coding: utf-8 -*-
# SenseNets is pleased to support the open source community by making caffe-sparse-tool available.
#
# Copyright (C) 2018 SenseNets Technology Ltd. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This program is dedicated to the public domain under the CC0 license.
# Coded with ❤️ by <NAME> (@NandiyaLive)
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, run_async
import requests
from bs4 import BeautifulSoup as bs
from te... |
# Copyright (c) 2021 Lishixian (znsoooo). All Rights Reserved.
#
# Distributed under MIT license.
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
'''
运行__main__.py获得一个加载所有插件的IDLE-Advance的示例文件。
运行__init__.py获得一个打开自身脚本并加载所有插件的editor的例子。
分别运行idlealib目录下的扩展文件,可以得到一个打开自身的editor或shell的例子。
如果需要停... |
# -*- coding: utf-8 -*-
"""Main module."""
import copy
import datetime
import getopt
import json
import logging as log
import os
import re as reg_ex
import sys
import threading
import time
import requests
from website_monitor import db_utils
from .wm_exceptions import (
ConfigFileEmpty, ConfigFileInvalid, Requir... |
# Adafruit MicroPython Tool - Command Line Interface
# Author: <NAME>
# Copyright (c) 2016 Adafruit Industries
#
# 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... |
import numpy as np
from numpy.testing import assert_almost_equal
from numpy.testing import assert_array_almost_equal
import pytest
from pygbm.plain.splitting import _find_histogram_split
from pygbm.plain.splitting import (SplittingContext, find_node_split,
find_node_split_subtraction,
... |
"""
Copyright (c) Yugabyte, Inc.
This module provides utilities for generating and publishing release.
"""
import glob
import json
import logging
import os
import platform
import shutil
import sys
import re
import distro # type: ignore
from subprocess import call, check_output
from xml.dom import minidom
from yb.co... |
# -*- test-case-name: foolscap.test.test_copyable -*-
# this module is responsible for all copy-by-value objects
import six
from zope.interface import interface, implementer
from twisted.python import reflect, log
from twisted.python.components import registerAdapter
from twisted.internet import defer
from . import s... |
'''
CLI application for transcoding music files
'''
import os
import json
import platform
import time
import sys
from argparse import ArgumentParser
from contextlib import contextmanager
from datetime import datetime
from functools import partial
from pkg_resources import resource_string
from subprocess import Popen,... |
import torch
import torch.nn as nn
from torch.nn import functional as F
import math
from .utils import LinearNorm, FFN
from utils.tools import get_mask_from_lengths
# device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class BaseAttention(nn.Module):
def __init__(self, attention_dim):
... |
from __future__ import print_function
import datetime
import io
import os
import sys
import time
import config
try:
input = raw_input
except NameError:
pass
import azure.batch.batch_auth as batch_auth
import azure.batch.batch_service_client as batch
import azure.batch.models as batchmodels
import azure.stor... |
## Added by <NAME>
## July 26, 2021
"""
A Herbie template for the HRRR model.
Because the file path to GRIB2 model data is predictable, we can
template the download URL for model output. Follow this template for
writing your own template file for any model with GRIB2 files available
via https.
Requirements
---------... |
from collections import OrderedDict
import datetime
import json
import os
from multiprocessing import Process
import urllib.request
from bs4 import BeautifulSoup
from flask import Flask, render_template, request, abort, jsonify
from flask_debugtoolbar import DebugToolbarExtension
from flask_sslify import SSLify
import... |
from mpi4py import MPI
import math
import numpy as np
from scipy.integrate import solve_ivp
from scipy.special import comb, perm
import xlrd
import time
import random
import pandas as pd
import timeit
import operator
import h5py
##################### parameters ####################
N = 39 ... |
import os, sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("please declare environment variable 'SUMO_HOME'")
sys.path.append(os.path.join('c:', os.sep, 'whatever', 'path', 'to', 'sumo', 'tools'))
import traci
import sumolib
im... |
"""
Utilities for working with the
`Cityscapes dataset <https://www.cityscapes-dataset.com>`_.
| Copyright 2017-2020, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import logging
import os
import eta.core.serial as etas
import eta.core.utils as etau
import fiftyone.core.dataset as fod
import fiftyone.c... |
# (c) Copyright 2018, 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
# -*- coding: utf-8 -*-
"""
Utility functions for use with or in SLS files
"""
# Import Python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import textwrap
# Import Salt libs
import salt.exceptions
import salt.loader
import salt.template
import salt.utils.args
import salt.u... |
import torch
from lm_trainer import TokenNegLossCalculator
import utils
class Evaluator(object):
def __init__(self, pad_id):
self.pad_id = pad_id
class DocumentEvaluator(Evaluator):
def __init__(self, bptt, pad_id):
super().__init__(pad_id)
self.bptt = bptt
def evaluate(self, ... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load(
"@io_bazel_rules_scala//scala:scala.bzl",
"scala_binary",
"scala_library",
"scala_macro_library",
"scala_test",
"scala_test_suite",
)
load(
"@io_baze... |
"""
KINASE dataset loader
"""
import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/KINASE_training_disguised_combined_full.csv.gz"
VALID_UR = "https://de... |
import re
from urllib.parse import urlparse
from werkzeug.exceptions import NotFound, Forbidden
from flask import Blueprint, render_template, request, redirect, url_for
from .utils import srcf_db_sess as sess
from .utils import parse_domain_name, create_job_maybe_email_and_redirect, find_mem_society
from . import ut... |
# Copyright 2020 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... |
from __future__ import unicode_literals
import os
import requests
import aiohttp
import youtube_dl
import wget
import math
from pyrogram import filters, Client
from youtube_search import YoutubeSearch
from Python_ARQ import ARQ
from urllib.parse import urlparse
import aiofiles
import os
from random import randint
from ... |
#
# Cython -- Things that don't belong
# anywhere else in particular
#
from __future__ import absolute_import
try:
from __builtin__ import basestring
except ImportError:
basestring = str
import os
import sys
import re
import io
import codecs
from contextlib import contextmanager
modification_ti... |
import os
import tensorflow as tf
from utils.tools import shape_list, get_shape_invariants, merge_repeated
from utils.text_featurizers import TextFeaturizer
from AMmodel.layers.time_frequency import Melspectrogram, Spectrogram
from AMmodel.layers.LayerNormLstmCell import LayerNormLSTMCell
class TransducerPredic... |
# -*- coding: utf-8 -*-
"""
File Name: models
Description : 模型
Author : mick.yi
date: 2019/3/13
"""
import keras
from keras import layers
from keras import Input, Model
import tensorflow as tf
from .base_net import resnet50
from .anchor import CtpnAnchor
from .target import CtpnTarget
fr... |
import os
import sys
try:
import termios
except ImportError:
# Not available on Windows
termios = None
from contextlib import contextmanager
from invoke.vendor.six import BytesIO, b, iteritems, wraps
from mock import patch, Mock
from spec import trap, Spec, eq_, ok_, skip
from invoke import Program, Runn... |
"""
For communication with devices from Applied Motion Products.
The IP can be set via a small wheel (S1) on the device itself.
We used the windows software 'STF Configurator' from Applied Motion
Products for the first configuration of the controller and to
give it its IP address in our local subnet.
File name: appli... |
import sys
import os
import omegaconf
from typing import Optional, Dict, Callable, List
from pathlib import Path
from omegaconf import OmegaConf
from mlad.cli.libs import utils
from mlad.cli.exceptions import (
NotExistContextError, CannotDeleteContextError, InvalidPropertyError,
ContextAlreadyExistError
)
M... |
import logging
from flask import abort
from flask import url_for
from flask_restful import Resource
from flask_restful import reqparse
from sqlalchemy import and_
from sqlalchemy import func
from sqlalchemy.orm import noload
import pajbot.web.utils
from pajbot import utils
from pajbot.managers.db import DBManager
fro... |
"""
test_ext_graphviz
~~~~~~~~~~~~~~~~~
Test sphinx.ext.graphviz extension.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import pytest
from sphinx.ext.graphviz import ClickableMapDefinition
@pytest.mark.sphinx('html', t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2016-2019 VMware, Inc. All rights reserved.
This module defines basic helper functions used in the sample codes
"""
__author__ = 'VMware, Inc'
import sys
import ssl
if (sys.version_info[0] == 3):
from urllib.request import urlopen
else:
from urll... |
import abc
import logging
import os
import time
from pyjob import cexec, config
from pyjob.exception import (
PyJobError,
PyJobExecutableNotFoundError,
PyJobTaskLockedError,
)
from pyjob.script import ScriptCollector
logger = logging.getLogger(__name__)
class Task(abc.ABC):
"""Abstract base class fo... |
'''
testcode2.validation
--------------------
Classes and functions for comparing data.
:copyright: (c) 2012 <NAME>.
:license: modified BSD; see LICENSE for more details.
'''
import re
import sys
import warnings
import testcode2.ansi as ansi
import testcode2.compatibility as compat
import testcode2.exceptions as ex... |
import argparse
from convlab2.e2e.rnn_rollout.deal_or_not import DealornotAgent
from convlab2.e2e.rnn_rollout.deal_or_not.model import get_context_generator
from convlab2 import DealornotSession
import convlab2.e2e.rnn_rollout.utils as utils
import numpy as np
session_num = 20
def rnn_model_args():
parser = argp... |
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from estimagic.benchmarking.process_benchmark_results import (
create_convergence_histories,
)
from estimagic.config import PLOTLY_TEMPLATE
from estimagic.utilities import propose_alternatives
from estimagic.visualization.plotting_util... |
"""
@author: <NAME>
"""
###########################################################################
## Import the necessary functions
###########################################################################
import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import numpy as np
import ma... |
from django.shortcuts import render
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.admin.sites import AdminSite
from django.template import loader
from django.http import HttpResponse
from django.conf import settings
from django.shortcuts import redirect
from django.views.generic import... |
import queue
import threading
from link_2 import LinkFrame
class MPLSlabel:
labelLength = 5
## initialize the frame and label
def __init__(self, frame, label):
self.frame = frame
self.label = label
## called when printing the object
def __str__(self):
return self.to_byte... |
'''
xrootiface.py
XRootD interface for the WOPI server for CERNBox
Author: Gi<EMAIL>ppe.<EMAIL>, CERN/IT-ST
Contributions: <EMAIL>
'''
import time
from XRootD import client as XrdClient
from XRootD.client.flags import OpenFlags, QueryCode
# module-wide state
config = None
log = None
xrdfs = {} # this is to map e... |
import base64
import logging
import pathlib
from xml.etree import ElementTree
from xml.dom import minidom
from pymaginopolis.chunkyfile import model as model, codecs as codecs
EMPTY_FILE = "EmpT"
def chunky_file_to_xml(this_file, chunk_data_dir=None):
"""
Generate an XML representation of a chunky file
... |
# -*- coding: utf-8 -*-
# Copyright (C) 2005 <NAME>
# 2006 <NAME>
# 2013 <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, ... |
'''
Maps ELMs to their protein IDs and the interacting domain's protein ID and inserts the two into an SQL database.
:argument: EXPORT_DB_LOCATION: saving location of the final database
:argument: ELMS_FILE: all ELM classes of the four used species in a .tsv files: http://elm.eu.org/classes/
:argument: INT_DOMAINS_F... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 30 15:54:04 2018
@author: chrelli
"""
#%% Import the nescessary stuff
# basic OS stuff
import time, os, sys, shutil
# for math and plotting
import pandas as pd
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
# small utilitie... |
from __future__ import absolute_import, division, print_function
import logging
import numpy as np
from glue.utils import unbroadcast, broadcast_to, axis_correlation_matrix
__all__ = ['Coordinates', 'WCSCoordinates', 'coordinates_from_header', 'coordinates_from_wcs']
class Coordinates(object):
'''
Base ... |
from django.contrib.auth.models import User, Group
from django.contrib.contenttypes.models import ContentType
from rest_framework import serializers
from reversion.models import Version, Revision
from .models import (
Container,
ExperimentRun,
RunType,
Individual,
Instrument,
PropertyValue,
... |
from abc import ABC, abstractmethod
from pybullet_utils import bullet_client
from typing import List, Tuple
import pybullet as p
import numpy as np
import math
import gym
from gym import spaces
from gym_solo import solo_types
class Observation(ABC):
"""An observation for a body in the pybullet simulation.
At... |
import subprocess
import os
import time
import unittest
import tempfile
import shutil
import uuid
import sys
from pynailgun import NailgunException, NailgunConnection
is_py2 = sys.version[0] == '2'
if is_py2:
from StringIO import StringIO
else:
from io import StringIO
if os.name == 'posix':
def transport... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (c) 2020 <NAME>, Stratford Ontario Canada
# All rights reserved.
#
# This diffstat code was extracted and heavily modified from:
#
# https://github.com/techtonik/python-patch
# Under the following licen... |
import copy
import os
import random
from collections import namedtuple, deque, Iterable
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from src.model import Dueling_DQN
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print(device)
class DQNAgent:... |
from collections import defaultdict
import curses
from ..observable import Observable
BORDER_STYLES = {
"light" : "┌┐│─└┘",
"heavy" : "┏┓┃━┗┛",
"double": "╔╗║═╚╝",
"curved": "╭╮│─╰╯",
}
class BindMagic:
"""
Decorator that binds a method to attributes. Attributes in `attrs` that aren't Obse... |
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.image import Image
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.vector import Vector
from kivy.clock import Clock
from k... |
import logging
from collections import defaultdict
import networkx
from . import Analysis
from .code_location import CodeLocation
from ..errors import AngrDDGError
from ..sim_variable import SimRegisterVariable, SimMemoryVariable
l = logging.getLogger("angr.analyses.vsa_ddg")
class DefUseChain(object):
"""
... |
"""Collection filters.
Example usage:
Filter('time', low, high)
.bounds(ring)
.eq('time', value)
.lt('time', value)
"""
# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
# Our custom instance/static decorator is not recognized by lint.
# pylint: disable=... |
# -*- coding: utf-8 -*-
""" Disaster Victim Identification, Controllers """
if not settings.has_module(c):
raise HTTP(404, body="Module disabled: %s" % c)
# -----------------------------------------------------------------------------
def s3_menu_postp():
# @todo: rewrite this for new framework
menu_sele... |
# Copyright 2019 The Bazel 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 la... |
"""Module containing classes and methods for querying prometheus and returning metric data.
"""
# core python dependencies
from datetime import datetime, timedelta, timezone
from uuid import UUID
from typing import Dict, Iterable, Any, Union
import logging
import requests
from string import Template
import math
# ext... |
#!/usr/bin/env python
# tile-generator
#
# Copyright (c) 2015-Present Pivotal Software, 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... |
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from skimage.transform import rescale
from dataset import TomoDetectionDataset
def log_images(x, y_true, y_pred):
images = []
y_true_np = y_true.detach().cpu().numpy()
y_pred_np = y_pred.detach().cpu().numpy()
x_np = x.detach().cpu().nump... |
import numpy as np
from numba import njit as jit, prange
from numpy import pi, sin, cos, sqrt
from scipy import integrate
from scipy.special import iv
# User defined libearayr
import data.planetary_data as pd
import odap.aerodynamics as aero
from .utils import E_to_M, Nu_to_E
def null_perts():
return {
... |
"""mGear shifter components"""
# pylint: disable=import-error,W0201,C0111,C0112
import maya.cmds as cmds
import maya.OpenMaya as om1
import maya.api.OpenMaya as om
import pymel.core as pm
from pymel.core import datatypes
import exprespy.cmd
from mgear.shifter import component
from mgear.rigbits.facial_rigger import ... |
from django.conf.urls import url
from rest_framework import routers
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework.views import APIView
from onadata.apps.api.viewsets.charts_viewset import ChartsV... |
import matplotlib
matplotlib.use( 'tkagg' )
import matplotlib.pyplot as plt
import os
from collections import OrderedDict
import cv2
import numpy as np
import argparse
import torch
from torch.autograd import Variable
import torch.nn as nn
from torchvision import transforms
from scipy.ndimage.measurements import label... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn import Parameter
import math
def myphi(x,m):
x = x * m
return 1-x**2/math.factorial(2)+x**4/math.factorial(4)-x**6/math.factorial(6) + \
x**8/math.factorial(8) - x**9/math.factorial(... |
#!/usr/bin/env python
"""Exploratory analysis of a whatsapp chat conversation."""
import datetime
import os
import re
# core modules
from collections import Counter
import matplotlib.pyplot as plt
# 3rd party modules (you might have to install them via pip)
import pandas as pd
def main(path):
"""Analyze a what... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, <NAME> <https://github.com/kbrebanov>
# Based on pacman (Afterburn <http://github.com/afterburn>, <NAME> <<EMAIL>>)
# and apt (<NAME> <<EMAIL>>>) modules.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... |
import json
import os
import time
import requests
from jinja2 import Template
from fabric.api import env, task, local, sudo, run
from fabric.api import get, put, require
from fabric.colors import red, green, blue, yellow
from fabric.context_managers import cd, prefix, show, hide, shell_env
from fabric.contrib.files i... |
# =============================================================================================== #
# Test module for Median Voter Model.
# Author: <NAME>, <EMAIL>
# =============================================================================================== #
from .mvm import *
from importlib import import_module
... |
import os
import numpy as np
import cv2
import argparse
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import seaborn as sns
from tensorflow.keras import Input
from model import u_net
from preprocessing.preprocess_utils import display
from experiments import lip_hair_color
def make_confu... |
import calendar
import datetime
import functools
import importlib
import os
import re
import time
import unicodedata
import uuid
import warnings
from collections import OrderedDict
from itertools import chain
from operator import itemgetter
import jwt
import requests
from django.apps import apps
from django.conf impor... |
# Copyright (C) 2019-2022, Pyronear.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import datetime
import os
import time
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import wandb... |
#*****************************************************
# *
# Copyright 2018 Amazon.com, Inc. or its affiliates. *
# All Rights Reserved. *
# *
#********************************************... |
# This script reads the output generated by DesigniteJava tool
# and emits the output indexed by filepath i.e.,
# Filepath, smell, project, package, type, method, cause, start_line_no
import os.path
import sys
from model import Type, Method, ImplSmell, DesignSmell, ArchSmell
def _get_type_list(out_path):
type_fil... |
# -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import string
import subprocess
from os.path import expanduser
try:
from scandir import walk
except ImportError:
from os import walk
from viper.common.abs... |
# import sys
# sys.path.append('/data2/qt/MusicGeneration/mg/model/Musictransformer')
from network import MusicTransformer
from metrics import *
from criterion import SmoothCrossEntropyLoss, CustomSchedule
import config
from data import Data
import utils
import datetime
import time
import optparse
import torch
import ... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Backbone modules.
"""
from collections import OrderedDict
import torch
import torch.nn.functional as F
import torchvision
from torch import nn
from torchvision.models._utils import IntermediateLayerGetter
from typing import Dict, List
from uti... |
# Very, very naive RE-based way for collecting declarations inside
# 'cdef extern from *' Cython blocks in in source files, and next
# generate compatibility headers for MPI-2 partially implemented or
# built, or MPI-1 implementations, perhaps providing a subset of MPI-2
from textwrap import dedent
from warnings impor... |
# (c) 2012-2018, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... |
"""
Supervised and Experiential Learning (SEL)
Master in Artificial Intelligence (UPC)
PW2 - Implementation of a Decision Forest and Random Forest
Author: <NAME> <<EMAIL>>
Course: 2020/2021
"""
import sys
import os
sys.path.append(os.path.abspath(r'..'))
import pandas as pd
import time
import math
from sklearn.metri... |
# Copyright 2019 The Bazel 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 la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.