text stringlengths 3.07k 22.1k |
|---|
import numpy as np
import json
from jsonschema import *
import requests
import os
import sys
import time
#Se define el constructor del tipo Active, con los campos que posee cada activo de red
class Active:
def __init__(self, ip,services,software,os,ja3,useragents):
self.ip=ip
self.services=services... |
"""Provides Sun-related parameters
The following code is heavily based on IDL function get_sun.pro which itself
is based on algorithms presented in the book Astronomical Formulae for
Calculators, by <NAME>.
Every function returning a quantity is of type astropy.units.Quantity
A correct answer set to compare to
Solar... |
# ___________________________________________________________________________
#
# Prescient
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
# This software is ... |
"""Govee BLE monitor integration."""
from datetime import time, timedelta
from time import sleep
import logging
from typing import List, Optional, Dict, Set, Tuple
from bleson import get_provider # type: ignore
from bleson.core.hci.constants import EVT_LE_ADVERTISING_REPORT # type: ignore
from bleson.core.types impo... |
# Original credit: https://github.com/milaq/rpi-rf
# Copyright (c) 2016 <NAME>, <NAME>
import argparse
import logging
import time
import paho.mqtt.client as mqtt
import math
from math import ceil
from time import sleep
from RPi import GPIO
from rpi_rf import RFDevice
logging.basicConfig(level=logging.INFO, datefmt='... |
import tokens
from environment import Environment
from errors import LoxRuntimeError, Return
import statements as Stmt
import expressions as Expr
from lox_function import LoxFunction
from lox_class import LoxClass, LoxInstance
class CLOCK:
@staticmethod
def arity():
return 0
@staticmethod
d... |
import error
import functools
import gc
import install
import license
import log
import os
import preferences
import process
import rumps
import suspender
import sys
import time
import utils
import version_manager
import webbrowser
import psutil
import socket
RESOURCE_PATH = getattr(sys, "_MEIPASS", os.path.abspath(".... |
"""
Script to restore motor positions from the archive.
"""
import argparse
from datetime import datetime, timedelta
import os
import sys
from typing import List, Tuple, Optional, Any, TextIO
from genie_python import genie as g
from genie_python.mysql_abstraction_layer import SQLAbstraction
DATA_TIME_DISPLAY_FORMAT ... |
# Copyright 2021 san kim
#
# 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, soft... |
import logging
from requests import request, Session
from august.activity import (
DoorbellDingActivity,
DoorbellMotionActivity,
DoorbellViewActivity,
LockOperationActivity
)
from august.doorbell import (
Doorbell,
DoorbellDetail
)
from august.pin import Pin
from august.lock import (
Lock,... |
# -*- coding: utf-8 -*-
"""
Created on :2018/8/29 18:28
@author: sgs4176
"""
import os
import cv2
import time
#import argparse
#import multiprocessing
import numpy as np
import tensorflow as tf
import sys
import subprocess as sp
import psycopg2
import configparser
import logging
import uuid
import glob
logging.basicCo... |
"""Utils for parsing policy and applying them.
The module reads in policy as yaml and then through apply_policy
applies them to dataframes.
Example policy yaml:
label: test_policy
version: 1
rules:
- match:
name: value
actions:
# Tells the policy runner to apply the transforma... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 26 20:51:32 2022
@author: bennett
"""
"""
[] add gaussian IC, source
[] clean up scripts/drafts
"""
import numpy as np
import math as math
import scipy.integrate as integrate
# from numba import njit, cfunc, jit
import matplotlib.pyplot as plt
f... |
import sys
import joblib
import seaborn as sns
import re
from sqlalchemy import create_engine
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
from sklearn.model_selection import train_test_split
from feature_extraction.text_length_extractor import TextlengthExtractor
from nltk.tokenize impo... |
import os
import sys
from copy import deepcopy
import helpers
import numpy
import pytest
import toughio
output_ref = {
"element": {
0: {
"PRES": 9641264.130638,
"TEMP": 149.62999493,
},
-1: {
"PRES": 635804.12294844,
"TEMP": 142.89449866,
... |
import logging
from dataclasses import dataclass, field
from pathlib import Path
from typing import MutableMapping, MutableSequence, Set, Sequence, Iterable
from clutchless.command.command import Command, CommandOutput
from clutchless.domain.torrent import MetainfoFile
from clutchless.external.filesystem import Filesy... |
import re
import json
import os
import configparser
config = configparser.ConfigParser()
try:
config.read("config.ini", encoding="utf-8")
except configparser.MissingSectionHeaderError:
config.read("config.ini", encoding="utf-8-sig")
core_version = config.getfloat("main", "core_version")
name_key = "name" if ... |
##########################################################################
## FUNCTIONS UTILIZED IN MAIN SCRIPT
## seed_everything: set seed for all options for reproducibility
## label_to_num : convert string type label into int type (-1, 0, 1)
## train_split : split dataset into train/test dataset
## divide... |
import pytest
import os, io
import osmdigest.pythonify as pythonify
# Don't really need this, but it's fun to show how a test fixture works
@pytest.fixture()
def pickle_file():
yield None
os.remove("test.pic.xz")
def test_pickle(pickle_file):
obj = {"a":1, "b":7}
pythonify.pickle(obj, "test.pic.xz")
... |
import re
from datetime import datetime, timedelta
from unittest import mock
import numpy
import pandas
import pytest
from cognite.client import CogniteClient, utils
from cognite.client.data_classes import DatapointsQuery, TimeSeries
from tests.utils import set_request_limit
COGNITE_CLIENT = CogniteClient()
@pytes... |
import math
from dataclasses import dataclass
from typing import List, Optional
from qtpy.QtCore import QRectF, Qt, QPointF, Signal
from qtpy.QtGui import (
QPainter,
QPen,
QColor,
QPolygonF,
QMouseEvent,
QTextBlockFormat,
QTextCursor,
QPainterPath,
)
from qtpy.QtWidgets import (
QG... |
"""
Usage: cache_aws_config_data.py [options]
Options:
--profile PROFILE profile to use for AWS access
"""
import platform
import time
from datetime import datetime
import boto3
import os
import yaml
from docopt import docopt
import batch.cache_aws_security_data as aws_security
import batch
import getpass
d... |
import sys
#import os
#os.environ['KIVY_DPI'] = '227'
#os.environ['KIVY_METRICS_DENSITY'] = '1'
from kivy.app import App
from kivy.app import Builder
#from kivy.metrics import sp, dp
from kivy.uix.actionbar import ActionBar
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.graphics.texture import Textu... |
import logging
import re
import time
from abc import ABCMeta
from typing import Any, Callable, Dict, List, Optional, Tuple, Type
import optuna
import pandas as pd
from irspack.utils.default_logger import get_default_logger
from ..evaluator import Evaluator
from ..parameter_tuning import Suggestion, is_valid_param_na... |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, <NAME>'
__docformat__ = 'restructuredtext en'
import re, os, traceback
from zi... |
import numpy as np
import matplotlib.pyplot as plt
import time
#First Step of the Project
# A function to plot images
def show_image(img):
image = img.reshape((28, 28))
plt.imshow(image, 'gray')
# Reading The Train Set
train_images_file = open('train-images.idx3-ubyte', 'rb')
train_images_file.seek(4)
num_of... |
# Copyright (c) 2016-2017 Intel 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... |
#!/usr/bin/env python
"""Script that visualizes the DGP dataset via dataset JSON or directory of scene.json(s).
Usage:
# Visualize dataset JSON
$ python python dgp/scripts/visualize_dataset.py \
--dataset-json /mnt/scene_dataset_v0.json --split 'train' \
--point-cloud --video
# Visualize directory of scen... |
# -*- coding: utf-8 -*-
"""
Bugs lyric crawler 0.7 by HeHeHwang
update: 2018.01.07
"""
import configparser as cp
import csv
import os
import sys
import time
from collections import Counter
from operator import itemgetter
from urllib.request import urlopen
import bs4
import numpy as np
from PIL import Image
from konlpy... |
"""Module containing the utilities that are to do with CRON jobs"""
from datetime import date, time, datetime, timedelta
from typing import Optional, Dict, Any
import pytz
from pydantic import BaseModel
from enum import IntEnum
from judah.utils.dates import add_month_to_datetime_but_maintain_day
class Month(IntEnum... |
from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
from django.db import transaction
from django.utils.translation import ugettext_lazy as _
from tagging.fields import TagField
from tagging.models import Tag
try:
from notification import models as notification
... |
## Modules
import os
os.environ['PYTHONHASHSEED'] = '0'
import random
random.seed(0)
import numpy as np
np.random.seed(0)
import tensorflow as tf
tf.set_random_seed(0)
session_conf = tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1)
import pickle
from matplotlib import pyplot as plt
fro... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
About: Setup VNF
ToDo: soft-code physical interface and its MAC addresses
"""
import argparse
import os
import shutil
import sys
import time
import multiprocessing
from shlex import split
from subprocess import run, PIPE
import docker
with open(... |
#!/usr/bin/env python
# Utility Module to push an app to the App Catalog, regardless of the format of the source file. This is designed to be called by push_new_sumo_app.bash
# Usage:
# python push_app.py -s </full/path/app_source_file.json> -u <access_id>:<access_key> -m </full/path/app_manifest_file.json> <API_Endp... |
"""
Module contains tools for processing files into DataFrames or other objects
"""
from datetime import datetime
from itertools import izip
import re
import string
import numpy as np
from pandas.core.index import Index
from pandas.core.frame import DataFrame
def read_csv(filepath_or_buffer, header=0, skiprows=None... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 10 08:48:04 2020
@author: atidem
"""
"""
c = class
pm = property_magnitude
h = housing
p = purpose
ps = personal_status
j = job
e = employment
ot = own_telephone
ch = credit_history
formula = p(c).p(pm|c).p(h|pm,c).p(p|h,c).p(ps|h,c).p(j|pm,c).p(e|j,c).p... |
# The hsv_merge code is subject to the following
# ******************************************************************************
# $Id$
#
# Project: GDAL Python Interface
# Purpose: Script to merge greyscale as intensity into an RGB(A) image, for
# instance to apply hillshading to a dem colour relief.
... |
# Load external modules.
from datetime import datetime
import logging
from neo4j.v1 import GraphDatabase
import os
import pandas as pd
import yaml
# Load internal modules.
import constants as const
import utils
class MongoCollection:
def __init__(self, db, collection):
self.collection = db[collection]
... |
#*********************************************************************
# content = informs artists about changes
# version = 0.1.0
# date = 2019-12-01
#
# license = MIT <https://github.com/alexanderrichtertd>
# author = <NAME> <<EMAIL>>
#********************************************************************... |
import sys
import pdb
import math
import os
import types
import copy
import numpy as np
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
# Must be on path
import multiview as mv
from .labeled_slider import LabeledSlider
class QRelDial(QDial):
onStartDial = pyqtSignal()
o... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: gianghale
# Politeness and formality tagger for English -> Japanese translation.
"""
from __future__ import division
import Mykytea
import os
import sys
import argparse
import re
import difflib
###############################################################... |
import calendar
import datetime
import os
from itertools import chain, islice, tee
from typing import Any, Iterable, List, Optional
from warnings import warn
import numpy as np
import pandas as pd
from click import confirm
from tabulate import tabulate
from ipl import image_analysis as image_anal
from ipl import impo... |
#! /usr/bin/env python
from MyUtils import *
import cv2
import dlib
import base64
import numpy as np
import json
from camShift import camshiftTracker, meanshiftTracker
from demo_config import Config
# Tracking
class TrackerInitializer(object):
def __init__(self, prev_frame, prev_roi, frame):
self.prev_fra... |
#!/usr/bin/python3
"""
Written by <NAME>, 2018
Functional Test: MNIST-SP
This tests that the spatial pooler can recognise basic patterns in its input.
The system consists of a simple black & white image encoder, a spatial pool, and
an SDR classifier. The task is to recognise images of hand written numbers 0-9.
This ... |
import sys
import threading
import time
import pytest
import numpy as np
import ray
from ray.state import available_resources
import ray._private.test_utils as test_utils
def ensure_cpu_returned(expected_cpus):
test_utils.wait_for_condition(
lambda: (available_resources().get("CPU", 0) == expected_cpus)... |
import os
import logging
import time
import json
import numpy as np
import networkx as nx
import copy
import csv
from os.path import join as pjoin
from run_simple import run_simple, gen_id, load_model
log = logging.getLogger(__name__)
def create_cfg(data, app_mix, mixscale, args, out_folder):
data = copy.deepc... |
#!usr/bin/python
# -*- coding: UTF-8 -*-
#python3.x
# ------ 模块 ------
from random import Random #随机数
import re #正则表达式
import urllib.request #http模块
import http.cookiejar #http-cookie模块
import socket #网络编程模块
import os #操作系统模块
import datetime, time #日期时间模块
try:
import chardet # html内容分析模块
except ImportError as e:
... |
"""pipText text driver for a Pip CPU simulation.
See actions list at the end of the file.
This is an alternative to the graphical interface of pipGUI.py.
The main loop reads input, notes cmd name and remembers remaining tokens,
and then finds the entry in the actions list corresponding to the cmd and calls
the... |
import pandas as pd
import numpy as np
import logging
import itertools
def HitCallingFoldThreshold(frame, fold_threshold, assaylist, samplelist, ctrl):
# returns dataframe with hit yes or no
data = frame[samplelist].reindex(assaylist)
pdf = pd.DataFrame(columns = samplelist, index = assaylist)
pdf_quan... |
"""Helper module to define static html outputs"""
__all__ = [
'add_header',
'row',
'rows',
'fig',
'card',
'card_deck',
'card_rows',
'title',
'div',
'table_from_df',
'hide',
'tabs',
'input'
]
def add_header(html:str, title="explainerdashboard")->str:
"""Turns a ... |
import torch
import torch.utils.data as Data
import numpy as np
import copy
import json
import pickle
import os
root = 'data/'
dataset = 'conll04'
dataset_root = os.path.join(root, dataset)
root_data = os.path.join(dataset_root, 'conll04.corp')
def readfile(data):
with open(data, "r", encoding="utf-8") as f:
... |
import dash
import sys
import os
from pathlib import Path
from dash_bootstrap_components._components.Card import Card
from dash_bootstrap_components._components.CardBody import CardBody
from dash_bootstrap_components._components.CardImg import CardImg
from numpy.core.fromnumeric import compress
home_path = Path.home()... |
#!/usr/bin/env python
from pqdict import PQDict as pqd
from itertools import combinations
import random
import unittest
def generateData(pkey_type, num_items=None):
# shuffled set of two-letter dictionary keys
pairs = combinations('ABCDEFGHIJKLMNOP', 2)
dkeys = [''.join(pair) for pair in pairs]
random.... |
import asyncio
import random
import time
from typing import Sequence
import pytest
import torch
from hivemind import Quantile8BitQuantization, aenumerate
from hivemind.averaging.allreduce import AllReduceRunner, AveragingMode
from hivemind.averaging.partition import TensorPartContainer, TensorPartReducer
from hivemin... |
import OpenGL
from OpenGL.GL import *
from OpenGL.GLU import *
import numpy
import random
from math_utils import *
def drawOrigin():
glBegin(GL_LINES)
glColor(1,0,0)
glVertex3f(0,0,0)
glVertex3f(0,1000,0)
glColor(0,1,0)
glVertex3f(0,0,0)
glVertex3f(1000,0,0)
glColor(0,0,1)
glVertex... |
import sys
import os
import csv
import cv2
import numpy as np
import math
# fovea
FOVEA = 1
FOVEA_PX = FOVEA * 45
data_path = './processed_data_tobii'
dataFile_list = os.listdir(data_path)
STI_WIDTH = 1920
STI_HEIGHT = 1080
def checkFoveaRange(_fovea, _x, _y, _c, _r):
_flag = False
if (_x-_c)... |
import python.common.vips_api as vips
import logging
import json
from unittest.mock import MagicMock
from python.common.helper import load_json_into_dict, localize_timezone
import pytest
import pytz
from iso8601 import parse_date
from datetime import datetime, timezone
class TestConfig:
VIPS_API_ROOT_URL ... |
"""
Jobs
====
Run arbitrary scripts on NimbleBox.ai instances with simplicity of ``nbox``.
This immensely powerful tool will allow methods to be run in a truly serverless fashion.
In the background it will spin up a VM, then run a script and close the machine. This is
the second step towards YoCo and CasH, read more
... |
import torch
from torch import nn
import torch.nn.functional as F
from models.attention import ChannelAttention, SpatialAttention
class AttConvBlockGN(nn.Module):
def __init__(self, in_chans, out_chans, num_groups,
use_ca=True, reduction=16, use_gap=True, use_gmp=True,
use_sa=Tr... |
from itertools import islice
from collections import defaultdict
import random
def read_input():
"""Read the contents of the puzzle input file
:return relations: replacement rules
:return target: target molecule
"""
relations = []
# Read file contents
with open("../input/input_19.txt", '... |
from genericpath import exists
from http.client import ResponseNotReady
import json, requests
from pickle import TRUE
import random as rand
import utilities as util
from datetime import datetime
from binance.spot import Spot
FIXERIOFXAPI_URL = "http://data.fixer.io/api/latest?access_key=419f3befde9b7e362bc748d9c767a96... |
#!/usr/bin/python
# (c) 2021, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
na_ontap_service_policy
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: na_ontap_service_policy
short_des... |
from uuid import UUID
from django.conf import settings
from django.db import models
from django.utils.crypto import get_random_string
from django.utils.timezone import now
from django.utils.translation import pgettext, ugettext_lazy as _
from pretalx.common.choices import Choices
from pretalx.common.mixins import Log... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""""Device model"""
import asyncio
from typing import Dict
import graphene
import pychromecast
from pychromecast.controllers import media
from graphql.execution.base import ResolveInfo
from playlistcast import error, util
from .subscription import SubscriptionModel
class M... |
# -*- coding: utf-8 -*-
import csv
import json
import os.path
import logging
from boto import connect_s3
from boto.s3.key import Key
from google.appengine.api import search
from google.appengine.ext import ndb
import config
from errors import NoSuchEmployee
from logic.secret import get_secret
from logic.toggle import... |
import numpy as np
import pandas as pd
import tensorflow as tf
import scipy.sparse as sp
import pickle as pkl
from sklearn.metrics import mean_absolute_error,mean_squared_error
def round_list2D(lst):
lst = np.array(lst)
return np.around(lst,2)
def linear_normolization(feature):
maximum = feature.max()
... |
from __future__ import unicode_literals
import sys
import os
from pprint import pprint
import numpy as np
import pandas as pd
import tensorflow as tf
from keras.utils import to_categorical
from keras.models import load_model
from keras_text.processing import WordTokenizer, SentenceWordTokenizer
from keras_text.data ... |
import dbt.clients.git
import dbt.clients.system
import dbt.config
import dbt.exceptions
from dbt.config import Project
from dbt.context.base import generate_base_context
from dbt.config.renderer import DbtProjectYamlRenderer
import collections
import os
import time
import datetime
import json
import io
import hash... |
import pandas as pd
import numpy as np
import math
from random import uniform
from copy import deepcopy
import matplotlib.pyplot as plt
class Trajectory:
''' Multivariate longitudinal object for k-means clustering
Parameters
----------
identity: int
A unique identifier
cluster: int
... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import gridspec
import re
import lightkurve as lk
import exoarch
import starspot as ss
import starspot.rotation_tools as rt
from stardate.lhf import gk_age_model
from stardate import load_samples, read_samples
from isochrones impor... |
# coding:utf-8
from typing import (
List,
Tuple,
Dict,
Collection,
Callable,
Type,
Union,
Optional,
Generic,
Any,
)
import re
from tempfile import mktemp
from itertools import chain, combinations
from .debug import DEBUG
from .wrappers import const
from .utils import name_of
from... |
import os, glob
import cv2, dlib
import numpy as np
from threading import Thread
from __init__ import raw_dir, raw_fids_dir, ref_dir, log_dir
from pca import PCA
from face import get_landmark, LandmarkIndex, facefrontal
srcdir = '%s/mp4' % raw_dir
dstdir = '%s/fids' % raw_dir
subdirs = os.listdir(dstdir)
su... |
# Importations
from keras.applications import ResNet50, VGG16, imagenet_utils
from sklearn.preprocessing import LabelEncoder
from keras.preprocessing.image import img_to_array, load_img
from keras.utils import to_categorical
from imutils import paths
import numpy as np
import pickle
import random
import os
# Extract ... |
#!/usr/bin/env python3
"""
Motocal Image download script.
Usage: python3 download_image.py arm
python3 download_image.py chara
Debug e.g: python3 download_image.py arm -c
Assume directory layouts
* /
* ./imgs
* ./charaImages
* ./txt_source/ URL list files
* ./scripts/download_image.py This s... |
import math
import time
import random
import pandas as pd
from os import system, name
def clear():
if name == 'nt': system('cls')
else: system('clear')
def is_prime(number):
"""
Diz se um número é primo
"""
# 1 e 2 falham no loop mas são primos
if (number == 1) or (number == 2): return True
# numeros de... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Part of the Reusables package.
#
# Copyright (c) 2014-2020 - <NAME> - MIT License
_roman_dict = {
"I": 1,
"IV": 4,
"V": 5,
"IX": 9,
"X": 10,
"XL": 40,
"L": 50,
"XC": 90,
"C": 100,
"CD": 400,
"D": 500,
"CM": 900,
"M": 1... |
"""
A multiroom thermostat controller
"""
import socket
import time
import threading
import datetime
from copy import copy
from collections import deque
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM) # set pin naming scheme to rpi
# If you are running Debian (including Raspbian/Raspberry Pi O... |
import numpy as np
import re
import json
from markdown2 import Markdown
from Bio import Entrez
from Bio import SeqIO
from collections import defaultdict, OrderedDict
from scipy import stats
from utils import getBindingCore, importBindData,\
importData, reference_retreive, div0, getBindingCore, getRandomColor
def s... |
##########################################################################
#
# Copyright (c) 2005 Imaginary Landscape LLC and Contributors.
#
# 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 w... |
import copy
import json
import logging
import os
import pathlib
import tkinter
from tkinter import messagebox
from tkinter import filedialog
from typing import Optional
from game.gamemap import GameMap
from game.json_import.map_schema import MapSchema
from game.utils.size import Size
from gui.block_views.block_view_fa... |
# -*- coding: utf-8 -*-
from model.user import User
from random import randrange
from model.group import Group
from fixture.orm import ORMFixture
import re
import random
import time
def test_add_user(app,db, json_users):
user = json_users
old_user = db.get_user_list()
app.user.add(user)
new_user = db... |
import re
import tokenize
import sympy
import sympy.abc
from sympy.parsing import sympy_parser
from sympy.core.numbers import Integer, Float, Rational
from . import ParsingException, UnsafeInputException
from .utils import process_unicode_chars, auto_symbol, evaluateFalse
__all__ = ["cleanup_string", "is_valid_symbol... |
# -*- coding: utf-8 -*-
"""Simulation utils."""
# pylint: disable=no-member,too-many-arguments
import logging
import parmed
import simtk.openmm as mm
import simtk.openmm.app as mmapp
from simtk import unit
from simtk.openmm import XmlSerializer
from simtk.openmm.openmm import LangevinIntegrator, State, VerletIntegrat... |
"""Cloudhands database and security models.
The data model for Cloudhands is heavily subclassed using the concept of
multi-table inheritance. For example, a large number of the models are
subclassed from the Resource class. This usefully represents the fact that an
actor or artifact can have a variety of resources ass... |
import pyautogui as pg
import time
import os
import re
import pyperclip
'''
only works with 4k resolution main display,
80% zoom rym page snapped the left 1st tab in chrome,
txt document snapped to the right (ONLY ONE DOC)
spotify snapped to the left
view in spotify is reset and zoomed out twice
vscode is... |
import decimal
from django.db.models import Q, F, Value, Count, Min, Max, Avg
from django.db.models.functions import (
Now,
Concat,
Coalesce,
Abs,
Ceil,
Floor,
Exp,
Ln,
Log,
Mod,
Pi,
Power,
Round,
Sin,
Cos,
Sqrt,
Tan,
Trim,
Lower,
Upper,
... |
import functools
import random
import sys
from zope.interface import implementer
from zope.event import notify
from zope.security.checker import CheckerPublic
from zope.security.interfaces import NoInteraction, Unauthorized
from zope.security.management import getInteraction
from zope import component
from zope.annot... |
from __future__ import division
from cctbx.uctbx.reduction_base import iteration_limit_exceeded
from cctbx.uctbx.reduction_base import reduction_base
from cctbx.uctbx.reduction_base import minimum_reduction_mixin
from cctbx import uctbx
from scitbx import matrix
def entier(x):
"greatest integer which is not greater ... |
# Copyright 2018-2020 <NAME>. See also the LICENSE file.
import os
import shutil
import cv2
import numpy as np
def make_clean_directory(path):
"""
Creates an empty directory.
If it exists, delete its content.
:param path: path to the directory.
"""
need_create = True
try:
if os.p... |
# -*- coding: utf-8 -*-
u"""
ボーン回転を3方向の独立した角度(捻り、横曲げ、縦曲げ)に分解・合成する Maya ノード。
"""
__author__ = 'ryusas'
__version__ = '1.1.20160920'
#==================================================================================
maya_useNewAPI = True
_TYPE_IDS = ( # 0x00000000 ~ 0x0007ffff
0x00070001,
0x00070002,
)
impor... |
from __future__ import print_function
import torch
import torch.nn as nn
from torch.nn import init
import torch.nn.functional as F
import functools
import math
import numpy as np
import torch.optim as optim
from torchvision import models
from torchvision.models.vgg import VGG
from config import config
import matplot... |
import my_utils
import numpy as np
import matplotlib.lines as mlines
import matplotlib.pyplot as plt
def get_phi():
"""
Calculate phi
"""
return num_yi_is_1 / (num_yi_is_1 + num_yi_is_0)
def get_mu0():
"""
Calculate mean for class 0(mu0)
"""
num_features = X.shape[1]
mu0 ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 2 09:49:19 2019
@author: frainville
library requirements
pip install python-can
pip install intelhex
pip install crcmod
"""
import can
import os
import copy
from intelhex import IntelHex
import crcmod
import time
import math
from threading import Timer, Thread, Ev... |
"""Utility functions"""
from typing import Callable
import graphviz
import numpy as np
import pandas as pd
from fim import eclat # pylint: disable=no-name-in-module
from scipy.optimize import linear_sum_assignment
from sklearn.metrics import jaccard_score
def jaccard_index(prediction: np.ndarray, true_labels: np.n... |
#!/usr/bin/python
import argparse
import json
import os
import time
from typing import Any, Dict, List, TypedDict, cast
from spikeforest._common.calling_framework import add_standard_args, call_cleanup, extract_hither_config, parse_shared_configuration, print_per_verbose
import spikeextractors as se
import hither2 as ... |
import logging
log = logging.getLogger('msn.p2p.file')
import path
import hashlib
import struct
import sys
import io
import random
import uuid
import time
import msn.P2P as P2P
import msn.P2P.P2PApplication as P2PApp
import msn.P2P.P2PMessage as P2PMessage
import util.packable as packable
import common.filetransfer as... |
import os
import re
import sys
import getpass
import keyword
from boltons.strutils import pluralize, strip_ansi
from boltons.iterutils import split, unique
from boltons.typeutils import make_sentinel
import face
try:
unicode
except NameError:
unicode = str
raw_input = input
ERROR = make_sentinel('ERROR... |
import click
import numpy as np
import os
import torch
import pandas as pd
import pytorch_lightning as pl
import random
import torch.nn.functional as F
import torchvision.models.resnet as resnet
import torchvision.transforms as T
import sacred
from datetime import datetime
from pytorch_lightning import Trainer
from py... |
import discord
from discord.errors import ApplicationCommandInvokeError
from discord.ext import commands
import sys
import time
import traceback
from discord.ext.commands.errors import CommandOnCooldown
from discord.ui.item import Item
from Utilities import Checks
from Utilities.AyeshaBot import Ayesha
... |
"""
Workflow actions trigger one or more outcomes.
Outcomes are defined as Outcome objects. Some outcomes are internal/built-in to the workflow,
and some can be injected in by external modules. An action will always have at least one action,
which is to determine the next action in the workflow.
Outcomes are registered... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.