text stringlengths 957 885k |
|---|
<reponame>wezu/p3d_gpu_anim<filename>main.py<gh_stars>1-10
from panda3d.core import *
loadPrcFileData("", "show-frame-rate-meter 1")
from direct.showbase.ShowBase import ShowBase
from direct.gui.OnscreenText import OnscreenText
import random
from crowd import Crowd
from camera import *
# Function to put instructions ... |
import pickle,os,glob
import numpy as np
import pandas as pd
from common import tflogs2pandas
with open("output_data/tmp/all_jobs_1xx.pickle", "rb") as f:
all_jobs = pickle.load(f)
cache_path = "output_data/tmp/1xx_tb_results.pandas"
bodies = np.arange(100,108).tolist()
def load_tb(force=0):
try:
if f... |
import numpy as np
from .evaluate_12ECG_score import (
compute_accuracy,
compute_auc,
compute_beta_measures,
compute_challenge_metric,
compute_f_measure,
is_number,
load_weights,
organize_labels_outputs,
)
def train_evaluate_score_batch_helper(data_eval, features, data_cache, loaded_m... |
#!/usr/bin/env python
"""
Classes which define the individuals of a population with
its characteristic genes, generation, crossover and
mutation processes.
"""
from __future__ import annotations
import math
import pprint
import random
import multiprocessing as mp
from abc import ABC, abstractmethod
from tempfile impor... |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... |
import warnings
import functools
import inspect
import time
import sys
import pathlib
from datetime import datetime
string_types = (type(b''), type(u''), type(f''))
class tcolor:
ResetAll = "\033[0m"
Bold = "\033[1m"
Dim = "\033[2m"
Underlined = "\033[4m"
Blink = "\033[5m"
... |
import socket
import ssl
import ipaddress
from urlparse import urlparse
import datetime
from datetime import timedelta
import json
import time
def validIP(ip):
ip = unicode(ip)
try:
ipaddress.ip_address(ip)
return True
except:
return False
def validPort(port):
try:
por... |
import json
import pytest
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock
from ...wallet.basic import BasicWallet
from ..pds import *
from ...aathcf.credentials import verify_proof
from aries_cloudagent.connections.models.connection_record import ConnectionRecord
credential_... |
# coding: UTF-8
### GPU 指定
import os
#os.environ["CUDA_VISIBLE_DEVICES"] = "4"
### import
import torch
device=torch.device('cuda')
import sys
import cv2
import numpy as np
import time
import torch.nn.functional as F
import matplotlib.pyplot as plt
import statistics
from sift_flow_torch import SiftFlowTorch
from t... |
<gh_stars>10-100
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras.layers import Dense, Conv2D, GlobalAveragePooling2D, Concatenate
from tf2rl.algos.policy_base import OffPolicyAgent
from tf2rl.misc.target_update_ops import update_target_variables
from tf2rl.policies... |
import torch
import torchvision
from tool import imutils
import argparse
import importlib
import numpy as np
import cv2
import voc12.data
from torch.utils.data import DataLoader
import scipy.misc
import torch.nn.functional as F
import os.path
from tool import imutils, pyutils
import time
from PIL import Image
import o... |
# coding=utf-8
from utils import Parser, criterions
import setproctitle # pip install setproctitle
from predict import AverageMeter
from data.data_utils import init_fn
from data.sampler import CycleSampler
from data import datasets
import models
import numpy as np
import argparse
import os
import time
impo... |
<gh_stars>1-10
"""
This module define the Item class which is base of Item instance object
in this project and the Filed class which is used to instantiate an item filed.
Item object yield by the the spider parser method or callback associated with
a Request object should derive from the Item class.
"""
from U... |
from dynamic_graph import plug
from dynamic_graph.sot.core import Selec_of_vector
from dynamic_graph.sot.torque_control.talos.create_entities_utils_talos import NJ, create_rospublish, create_topic, get_sim_conf
from dynamic_graph.sot.torque_control.talos.create_entities_utils_talos import create_waist_traj_gen, create... |
#!/usr/bin/env python
# coding: utf-8
# # Measure orientation of seashore streets in relation to SW wind
#
# Computational notebook 06 for Climate adaptation plans in the context of coastal settlements: the case of Portugal.
#
# Date: 27/06/2020
#
# ---
#
# This notebook computes deviation of seashore street orien... |
# 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... |
<gh_stars>1-10
"""
SPEECh: Scalable Probabilistic Estimates of EV Charging
Code first published in October 2021.
Developed by <NAME> (<EMAIL>).
This script demonstrates how to extract individual sessions data from running the model.
"""
from speech import DataSetConfigurations
from speech import SPEECh
from speech im... |
<filename>cinder/brick/iscsi/iscsi.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
#... |
<gh_stars>1-10
from pathlib import Path
from re import findall
from modules.CardType import CardType
from modules.Debug import log
class TextlessTitleCard(CardType):
"""
This class describes a type of CardType that does not modify the source
image in anyway, and only optionally blurs it. No text of any ki... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn import model_selection
from sklearn import preprocessing
from sklearn import svm
from mlxtend.plotting import plot_decision_regions
from sklearn import linear_model
from sklearn import tree
from sklearn impo... |
<gh_stars>1-10
import time
import json
import queue
import random
import hashlib
import threading
import requests
from apscheduler.schedulers.background import BackgroundScheduler
from django.http import HttpResponse
from django.shortcuts import render
from django.template.context_processors import csrf
from django.v... |
<filename>tflow_model.py
#!/usr/bin/python
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import cv2
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
sess = tf.InteractiveSession()
def draw_batches(batches):
for i, batch in enumerate(batches)... |
# -*- coding: utf8 -*-
import sys
import os
from PIL import Image, ImageTk
import tkinter
import argparse
color_list = ["金", "茶", "赤", "橙", "桃", "黒", "青", "紫", "緑", "白", "銀", "黄"]
hair_color_list = ["金", "茶", "赤", "橙", "桃", "黒", "青", "紫", "緑", "白", "銀"]
hair_type_list = ["ロング", "ショート", "ツインテ", "ドリル", "ポニテ"... |
import jax.numpy as jnp
import haiku as hk
import chex
from ._base import PolicyObjective
from ..utils import is_qfunction
class SoftPG(PolicyObjective):
def __init__(self, pi, q_targ_list, optimizer=None, regularizer=None):
super().__init__(pi, optimizer=optimizer, regularizer=regularizer)
sel... |
# Copyright (c) 2015. Mount Sinai School of Medicine
#
# 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... |
<reponame>ncrubin/chemftr
""" Determine costs for DF decomposition in QC """
from typing import Tuple
from chemftr.utils import QR, QI, power_two
import numpy as np
from numpy.lib.scimath import arccos, arcsin # want version that has analytic continuation to cplx
def compute_cost(n: int, lam: float, dE: float, L: in... |
<gh_stars>0
# ----------------------------------------------------------------------------
# Copyright (c) 2020, <NAME>.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------... |
from audioop import tomono
from platform import release
from typing import Sized
from pywhatkit.main import search
from pywhatkit.sc import cancelShutdown
import speech_recognition as sr
import pyttsx3
import pywhatkit
import datetime
import wikipedia
import pyjokes
import googlesearch
import os
import time
import date... |
<reponame>crwxrws/Waybar
#!/usr/bin/env python3
import argparse
import logging
import sys
import signal
import gi
import json
gi.require_version('Playerctl', '2.0')
from gi.repository import Playerctl, GLib
logger = logging.getLogger(__name__)
def write_output(text, player):
logger.info('Writing output')
ou... |
<filename>jovsatools/function_approximation.py
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/function_approximation.ipynb (unless otherwise specified).
__all__ = ['KerasPipeline', 'HighLevelKerasPipeline', 'HighLevelKerasPipelineMultiTarget']
# Cell
from abc import ABC, abstractmethod
from fastcore.test impor... |
<gh_stars>0
import os
import tempfile
from decimal import Decimal
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Ingredient,... |
<gh_stars>0
import base64
import io
import os
import socket
import threading
import time
from importlib import import_module
from typing import Deque, List, Dict, Tuple
from uuid import uuid4
import json
from collections import deque
import PIL.Image
from PIL.Image import Image
import falcon
import numpy as np
from t... |
# coding: utf-8
# # Pipeline processing using serial workflows.
#
# This notebook demonstrates the continuum imaging and ICAL pipelines. These are based on ARL functions wrapped up as SDP workflows using the serial class.
# In[1]:
#get_ipython().run_line_magic('matplotlib', 'inline')
import os
import sys
sys.pa... |
<reponame>RiccardoAiolfi/bbt<filename>py-scripts/bip32_testvector1.py
#!/usr/bin/env python3
# Copyright (C) 2017-2020 The btclib developers
#
# This file is part of btclib. It is subject to the license terms in the
# LICENSE file found in the top-level directory of this distribution.
#
# No part of btclib including t... |
from o3seespy.base_model import OpenSeesObject
class FrictionModelBase(OpenSeesObject):
op_base_type = "frictionModel"
class Coulomb(FrictionModelBase):
"""
The Coulomb FrictionModel Class
This command is used to construct a `Coulomb friction <http://en.wikipedia.org/wiki/Friction>`_ model obje... |
<reponame>ZurMaD/DeepGrabCut-PyTorch<filename>dataloaders/custom_transforms.py
import torch, cv2
import numpy.random as random
import numpy as np
from dataloaders import utils
class ScaleNRotate(object):
"""Scale (zoom-in, zoom-out) and Rotate the image and the ground truth.
Args:
two possibilities:
... |
import discord
from discord import Message, Role, Embed, Color, TextChannel, Guild, Member, Reaction, Emoji, PartialEmoji
from discord.abc import Snowflake
from discord.ext import commands
from discord.raw_models import RawReactionActionEvent
from peewee import ModelSelect
import checks
from awaiter import Adv... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__author__ = 'banxi'
ui_field_constraint_map = {
'x': '',
'y': '',
'l': 'app:layout_constraintLeft_toLeftOf',
't': 'app:layout_constraintTop_toTopOf',
'r': 'app:layout_constraintRight_toRightOf',
'b': 'app:layout_constraintBottom_... |
<gh_stars>0
#!/usr/bin/env python3
import os
import websocket
import time
import sys
import json
import subprocess
import logging
import signal
import libdlt
from libdlt.util import common as common
from libdlt.util.common import ExnodePUBSUBQuery, parseArgs, print_progress
SYS_PATH="/etc/periscope"
USER_DEPOTS=os.p... |
<gh_stars>1-10
import matplotlib
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import yt
from yt.units import second, g, cm ,dyne
from yt.visualization.fixed_resolution import FixedResolutionBuffer
G = 6.674e-8*cm**3/second**2/g
ctr = 5e18*cm
yt.mylog.setLevel(50)
import numpy as np
import os
# Particle Clean ... |
<filename>tests/unit/deployment/serverprovider/providers/test_cobbler.py
# 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
#
# U... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
'''Data generator'''
import keras
from keras.preprocessing.image import *
from keras.applications.imagenet_utils import preprocess_input
from keras import backend as K
import numpy as np
import cv2
import scipy.io
from config import cfg
class DataGen(object):
'Ge... |
<reponame>leipzig/gatk-sv
#!/usr/bin/env python
from scipy import stats
import numpy as np
from sklearn import mixture
# calculate the Del statistic given a FME combo in het files
def Deltest(F, M, E, length, crit=0.01, thres1=0.0005):
# if True:
thres1 = min(50 / length, thres1)
if F / length < thres1 an... |
import json
from datetime import datetime
from flask import Flask, session
from wtforms import BooleanField, DateField, Form, RadioField, SelectField, SelectMultipleField, StringField, TextAreaField, ValidationError
from wtforms.csrf.session import SessionCSRF
from wtforms.validators import data_required, input_requir... |
import pyvisa
from pyvisa import VisaIOError
from typing import List, Tuple
# Globals
rm = pyvisa.ResourceManager()
# Utility Functions
def get_devices_addresses() -> Tuple[str]:
"""
returns a list of the addresses of peripherals connected to the computer
"""
return rm.list_resources()
def identif... |
<gh_stars>0
#!/usr/bin/python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and licens... |
<filename>generate_feed.py<gh_stars>0
import json
import praw # to connect to reddit
from feedgen.feed import FeedGenerator # to generate the feed
from hackernews import HackerNews # to get entries from hackernews
import feedparser # to parse feeds
import numpy a... |
<gh_stars>10-100
# Copyright (c) 2012 NetApp, 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
#
# ... |
# python3
# Copyright 2020 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
<reponame>Jajc09/sifco-api
# clase para obtener información de la tabla sifco_request
from app import db
from app.utils.errors import BadRequestException
import datetime
import pytz
import psycopg2
import hashlib
# contiene la función update_request_assign y update_request_redeem
# actualiza en sifco_request la inf... |
# System imports
import os
import sys
import time
import utils
import argparse
# Local imports
from utils import ENGYN_CONFIG
parser = argparse.ArgumentParser(description = "This is a utility to create boilerplate apps")
create_args = parser.add_argument_group("create options")
create_args.add_argument('-c', '--cr... |
<gh_stars>0
import numpy as np
from numpy.matlib import rand,zeros,ones,empty,eye
import scipy
class matrixops():
def __init__(self):
self.LnDetPsi = None
self.Psi = np.zeros((self.n,self.n), dtype=np.float)
self.psi = np.zeros((self.n,1))
self.one = np.ones(self.n)
self.mu... |
<reponame>TaoZheng9/br<filename>trainPMOriginEval.py
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# 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 os
import time
import torch
from options... |
import os
import unittest
from decimal import Decimal
from .common import JinsiTestCase
class JinsiExamples(JinsiTestCase):
def test_simple_template(self):
doc = """\
::let:
user:
::object:
- ::titlecase:
::get: $user.user... |
<filename>tests/functional/conftest.py
import time
import pytest
from scrapli_netconf.driver.async_driver import AsyncNetconfDriver
from scrapli_netconf.driver.sync_driver import NetconfDriver
from ..test_data.devices import DEVICES, PRIVATE_KEY
NETCONF_1_0_DEVICE_TYPES = ["cisco_iosxe_1_0", "juniper_junos_1_0"]
NE... |
"""A module for compute scheduling."""
#pylint: disable=too-many-instance-attributes, no-self-use, missing-docstring
import networkx as nx
import matplotlib.pyplot as plt
from ordered_set import OrderedSet
from copy import deepcopy
from .tvm import tensor
from .tvm import make as _make
from .tvm import stmt as _stmt
fr... |
<filename>syncless/reactor.py
#! /usr/local/bin/python2.4
"""A Syncless-based implementation of the Twisted main loop.
This Python module was written by reusing the source code of
libevent.reactor v0.3, available from http://launchpad.net/python-libevent
(simple BSD license).
To install the event loop (and you shoul... |
<filename>tests/integration/test_psycopg2_connector.py
import functools
import json
import psycopg2.errors
import pytest
from procrastinate import psycopg2_connector
@pytest.fixture
def psycopg2_connector_factory(connection_params):
connectors = []
def _(**kwargs):
json_dumps = kwargs.pop("json_dum... |
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def add_attachments_to_set(self, attachments: List, attachmentSetId: str ... |
import io
from nose.tools import istest, assert_equal
import funk
import sdmx
@istest
def dataset_key_family_is_retrieved_from_dsd():
dataset_file = io.BytesIO(
b"""<message:CompactData xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message" xmlns:common="http://www.SDMX.org/resources/SDMXML/schem... |
<filename>model.py
"""model.py
Neural network to train on the labeled data.
"""
import sys
import torch
from torch import nn
class Net(nn.Module):
def __init__(self, batch_size=32, auxiliary=True):
super(Net, self).__init__()
self.batch_size = batch_size
self.auxiliary = auxiliary
... |
import marshal
import sys
import os
class Cache:
def __init__(self, root_dir):
self.root = root_dir
self.dump = marshal.dump
self.load = marshal.load
# ---[ key1, key2, value interface ]----------------------------------------
def get(self, k1, k2, default=None):
path = _path(self.root, k1, k2)
try:... |
import pickle
import numpy as np
import os
def _analyze_query_point_assignment(
query_data_dict: dict,
init_Rdata_dict: dict,
init_Edata_dict: dict,
num_R: int,
query_point_assignment_array: np.ndarray,
root: str,
n_points_to_copy=50,
):
"""
Analyzes and visualizes qDCA results.
... |
<filename>boa/worker.py
"""
worker.py
Implements the actual reverse engineering used by both the
"""
import os
import io
import re
import sys
import typing as t
import hashlib
import contextlib
import logging
import coloredlogs
import lief
import ssdeep
import requests
from boa.unfreeze import get_installer
fro... |
<reponame>jbrockmendel/sm2
import os
import numpy as np
cur_dir = os.path.dirname(os.path.abspath(__file__))
class ARLagResults(object):
"""
Results are from R vars::VARselect for sunspot data.
Comands run were
var_select <- VARselect(SUNACTIVITY, lag.max=16, type=c("const"))
"""
def __ini... |
<reponame>marcinn/midicontrol
def cmd(cmd, stop=False):
def wrapped(event):
if stop:
event.stop()
return cmd
return wrapped
class CommandsController(object):
def __init__(self):
self._times = {}
def command_decorator(self, threshold=None):
def decorator(fn)... |
import os
import dipy.reconst.dti as dti
import numpy as np
from dipy.core.gradients import gradient_table, generate_bvecs
from dipy.io.image import save_nifti
from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel
from dipy.reconst.csdeconv import auto_response
from dataset.mnist.database import MnistData... |
#-*- encoding: utf-8
import mmap
import os, os.path
import time, math
import sys
class Superbloque:
# Se leen los datos del superbloque
def __init__(self):
with open('fiunamfs.img', 'r+b') as f:
fs_mmap = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
self.fs_nombre ... |
<reponame>yunus-ceyhan/kivyx<filename>kivyx/bottomsheet.py
"""
<MainApp>:
XButton:
text: "open bottom sheet"
pos_hint: {"center_x": .5, "center_y": .5}
on_release: bottom_sheet.open_menu()
XBottomSheet:
id: bottom_sheet
XBottomSheetContent:
orientation: "ver... |
<reponame>remigermain/chernobyl-disaster.org-backend
from django.test import tag
from lib.test import BaseTest
from django.urls import reverse
from django.core import mail
from django.conf import settings
from django.contrib.auth import get_user_model
import json
@tag('auth', 'authentication')
class AuthTest(BaseTest... |
from app.main.service.user_team_service import check_user_in_team, check_user_is_owner_or_editor, check_user_is_owner
from flask import request
from flask_restplus import Resource, reqparse
from ..util.decorator import token_required, admin_token_required
from ..util.dto import PortfolioDto
from ..service.portfolio_ser... |
<filename>celer/tests/test_homotopy.py
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD 3 clause
import numpy as np
import pytest
from itertools import product
from scipy import sparse
from sklearn.utils.estimator_checks import check_estimator
from sklearn.linear_model i... |
# Copyright 2020 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... |
<gh_stars>0
import os
import random
import re
from pathlib import Path
import intervals as I
from pytorch_pretrained_bert import BertTokenizer
from collections import defaultdict
from config import Config
entity_label2abbr = {'自然人主体': 'NP',
'非自然人主体': 'NNP',
'机动车': 'MV',
... |
"""support to generate SQLObject-based fixtures."""
from fixture.style import camel_to_under
from fixture import SQLObjectFixture
from fixture.command.generate import (
DataHandler, FixtureSet, register_handler, code_str,
UnsupportedHandler, MisconfiguredHandler, NoData )
try:
import sqlobje... |
from itertools import product
from collections import OrderedDict
# comparable set
_set_ID = 0
class xset(set):
def __init__(self, iterable=None):
if iterable is not None:
self.data = OrderedDict({e: None for e in iterable})
else:
self.data = OrderedDict()
global _set_ID
self._id = _set_ID
... |
<reponame>sivikt/14m2-alg
# Draws Hilbert Curve
# author <NAME> <<EMAIL>>, 2014 Public Domain
import sys
from tkinter import *
class TkDraw(object):
def __init__(self):
self._color = 'black'
self._x_coor = 0
self._y_coor = 0
self._width = 1024
self._height = 800
... |
<reponame>fjfaggingerauer/obsim
__all__ = ['Telescope',]
import astropy.units as u
import astropy.coordinates as c
import astropy.time as t
import hcipy as hp
from ..config import default_units, simulation_units
from ..util import make_properties
# Conversion functions for grid properties
# pupil grid: diameter = pu... |
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
from plotly.subplots import make_subplots
import geopandas as gpd
from pages.constants import TOPIC_COLORS
class SentimentCRUD(object):
def __init__(self):
self.base_df = pd.read_csv(
'./data/results_sa_all.txt',... |
import enum
import json
from typing import List, Union
import msgpack
from aioredis import Redis
class RequestType(int, enum.Enum):
SOCKETS = 0
ALL_ROOMS = 1
REMOTE_JOIN = 2
REMOTE_LEAVE = 3
REMOTE_DISCONNECT = 4
REMOTE_FETCH = 5
SERVER_SIDE_EMIT = 6
class PacketType(int, enum.Enum):
... |
<reponame>christopherpickering/djangosaml2<filename>tests/testprofiles/tests.py
# Copyright (C) 2012 <NAME> (<EMAIL>)
# Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2010 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... |
<filename>stars/__init__.py
import traceback
from typing import List, Mapping, Any, Dict, Tuple, Union
import logging
from logger import APPNAME
from state import BaseState
from utils import http
logger = logging.getLogger(APPNAME)
class MessageSign(BaseState):
EXC = '[!]'
STR = '[*]'
PLS = '[+]'
MI... |
import unittest
from torchsummary import summary, summary_string
from torchsummary.torchsummary import _build_summary_dict, _build_summary_string
from torchsummary.tests.test_models.test_model import SingleInputNet, MultipleInputNet, \
MultipleInputNetDifferentDtypes, NestedNet, CustomModule
import torch
gpu_if_av... |
<filename>uhd_restpy/testplatform/sessions/ixnetwork/topology/commandsnippetsdata_bfd4407665f4331cd53fee07f65b1820.py
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Soft... |
<reponame>louisenje/Pitches
from flask import render_template,request,redirect,url_for,abort
from . import main
from ..models import Pitch,Comment
from flask_login import login_required,current_user
from ..models import User
from ..import db,photos
from .forms import UpdateProfile,AddPitch,CommentInput
from datetime ... |
<reponame>thautwarm/rtpy
from wisepy.fn_describe import describe
from wisepy.dynamic_cast import dynamic_cast
from wisepy.cmd_parser import parse
from wisepy.cmd_ast import Quote, Cmd, Closure, PlaceHolder
from wisepy.color import *
from Redy.Magic.Pattern import Pattern
from pprint import pprint
import types
import io... |
import os
import argparse
import tensorflow as tf
import tensorflow.keras as keras
from rich.console import Console
from rich.markdown import Markdown
#from models.DGV2.model_v2 import DGMV2
from models.DGV2.model_v2_1 import DGMV2_1
from models.DGV4.model_v4 import DGMV4
from models.DGV4.model_v4_mnet import DGMV5
... |
import abc
from .logic import Predicate, Object, Action, State
###
# Objects
###
class Robot(Object):
def __init__(self, name):
super().__init__(name, 'Robot')
class Box(Object):
def __init__(self, name):
super().__init__(name, 'Box')
class Area(Object):
def __init__(self, name):
super().__init__(name, 'Are... |
<filename>MCP2221/MCP2221.py<gh_stars>0
import hid
from time import sleep
from enum import Enum, unique, auto
from typing import Dict, List, Union
class TYPE(Enum):
INPUT = auto()
OUTPUT = auto()
ADC = auto()
DAC = auto()
CLOCK_OUT = auto()
INTERRUPT = auto()
LED_RX = auto()
LED_TX = a... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... |
<reponame>ankush07d/iac_electricals_v13
# Copyright (c) 2021, IAC Electricals and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
class PriceSchedule(Document):
def validate(sel... |
<filename>DFCV.py
"""
Provides a way to quickly validate column conversions didn't result in null across large dataframes.
Can also be used to find problem columns and rows.
Will need to specify or create a primary key column for matching before and after rows.
Use case: Converting StringType columns to TimestampTyp... |
import shapely.geometry as sg
from shapely.geometry import box, MultiLineString, Point, MultiPoint, Polygon, MultiPolygon, LineString
import shapely.affinity as sa
import shapely.ops as so
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import geopandas
import vpype_cli
from typing import List, G... |
<gh_stars>10-100
# 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
# di... |
from typing import List, Union
from dataclasses import dataclass
@dataclass
class Player:
"""
Calculate stats for a player.
:param player_index: A unique player ID.
:type player_index: str or List[str]
:example: *None*
:note: This class is intended to be used internally.
"""
def __i... |
<gh_stars>1-10
import torch
import numpy as np
import torch.nn as nn
# io utils
from pytorch3d.io import load_obj
# datastructures
from pytorch3d.structures import Meshes, list_to_padded
from pytorch3d.renderer.mesh.textures import TexturesVertex
# 3D transformations functions
from pytorch3d.transforms import Rotate... |
from __future__ import division
from __future__ import print_function
import time
import argparse
import numpy as np
import math
import random
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from utils import load_data, accuracy, normalize, load_polblogs_da... |
<reponame>csanders-git/pyTenable<filename>tests/sc/test_scanners.py<gh_stars>0
from tenable.errors import *
from ..checker import check, single
import pytest
@pytest.fixture
def scanner(request, admin, vcr):
with vcr.use_cassette('test_scanners_create_success'):
scanner = admin.scanners.create('Example', '... |
<filename>core/app.py<gh_stars>10-100
from Cookie import Cookie
from random import randint
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth import SESSION_KEY
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
f... |
from plex import Plex
from plex.lib.six.moves.urllib_parse import urlencode
from plex_activity.sources.base import Source
import json
import logging
import re
import sys
import time
import websocket
log = logging.getLogger(__name__)
SCANNING_REGEX = re.compile('Scanning the "(?P<section>.*?)" section', re.IGNORECASE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.