text stringlengths 3.07k 12.6k |
|---|
# import lib.forest as forest
import math
import random
import numpy as np
import pandas as pd
from lib.tree import Tree
from lib.forest import RNF
from lib.evalMetrics import *
from sklearn.utils import shuffle
import sys
def cross_val_tree(df, tries):
for i in range(tries):
shuffle = df.sample(frac=1)
... |
from kernel_exp_family.estimators.estimator_oop import EstimatorBase
from kernel_exp_family.tools.assertions import assert_array_shape
from kernel_exp_family.kernels.kernels import gaussian_kernel_hessians, \
gaussian_kernel_dx_dx_dy, gaussian_kernel_dx_dx_dy_dy, gaussian_kernel_grad, \
gaussian_kernel_dx_dx, g... |
# coding=utf-8
"""
Created on Jun 30, 2012
@author: <NAME> <<EMAIL>>
"""
import re
import random
import string
from math import log
from time import ctime
text_width = 80
def random_text(length, alphabet=string.ascii_uppercase+string.digits):
return ''.join(random.choice(alphabet) for _unused in xrange(length... |
import logging
from urllib.parse import urlencode
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.paginator import InvalidPage, Paginator
from django.db import transaction
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.urls import reverse
from ... |
import random
from django.conf import settings
from django.http import HttpResponse, Http404, JsonResponse
from django.shortcuts import render, redirect
from django.utils.http import is_safe_url
from rest_framework.authentication import SessionAuthentication
from rest_framework.decorators import api_view, authenticati... |
import requests
import pandas as pd
from bs4 import BeautifulSoup
import time
import re
from data_loader.accent_data_loader import AccentDataLoader
from accent_dataset.audio_downloader import AudioDownloader
ROOT_URL = 'http://accent.gmu.edu/'
BROWSE_LANGUAGE_URL = 'browse_language.php?function=find&language={}'
# WA... |
import json # interact with the Tribe Events API
import re # parse strings
import urllib.request # pull info from the website
from datetime import datetime # convert utc time to datetime
from html.parser import HTMLParser # clean up HTML
from city_scrapers_core.constants import BOARD
from city_scrapers_core.items... |
# Copyright 2016 OpenStack Foundation
# 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 requ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Includes the Biopac data source class
"""
import pandas as pd
import numpy as np
from scipy.io import loadmat
from scipy.interpolate import UnivariateSpline
from data_source import DataSource
from schema import Schema, Or, Optional
def _val(x, pos, label_bin):
re... |
import os
import json
import torch
import torch.nn as nn
import torchvision.transforms as transforms
import re
import config
def batch_accuracy(predicted, true):
""" Compute the accuracies for a batch of predictions and answers """
_, predicted_index = predicted.max(dim=1, keepdim=True)
agreeing = true... |
"""Hifiberry Platform."""
import logging
from datetime import timedelta
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
SUPPORT_PREVIOUS_TRACK,
SUPPOR... |
# Copyright 2018 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
from unittest import mock
from nesta.packages.nih.preprocess_nih import get_json_cols
from nesta.packages.nih.preprocess_nih import get_long_text_cols
from nesta.packages.nih.preprocess_nih import is_nih_null
from nesta.packages.nih.preprocess_nih import expand_prefix_list
from nesta.packages.nih.preprocess_nih import... |
from urllib.parse import urlparse, parse_qs
import collections
import random
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table
from dash.dependencies import Input, Output, State
import plotly.express as px
import plotly.graph_objects as go
from integrations_lib.macos... |
import os
import json
import random
import argparse
import requests
from pathlib import Path
from string import capwords
ROOT_DIR: str = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
design_patterns = {
"Cloud Architecture": [
os.path.join(ROOT_DIR, "cloud_architecture", "azure_cloud_design... |
#!/bin/python
# This file contains a C-like preprocessor implementation for the
# nsbcomp compiler.
import os
import errno
import os.path
import time
import re
import strutils
import cli
import sys
DIR_TMP_FALLBACK = 'tmp';
def init():
global DIR_TMP, PRE_KEYWORDS, INCLUDE_PATHS;
DIR_TMP = DIR_TMP_FALLBACK;
PRE... |
"""Pytorch implementation of Losses and tools.
.. MIT License
..
.. Copyright (c) 2018 <NAME>
..
.. Permission is hereby granted, free of charge, to any person obtaining a copy
.. of this software and associated documentation files (the "Software"), to deal
.. in the Software without restriction, including without lim... |
from typing import Tuple
import numpy as np
import pandas as pd
def get_overlap(bb1: Tuple[int, int, int, int], bb2: Tuple[int, int, int, int]) -> float:
"""
Computes the overlap between two bounding boxes.
Returns the ratio of area between bb1 and the intersection of bb1 and bb2.
"""
intersecti... |
"""
Copyright Government of Canada 2020-2021
Written by: <NAME>, National Microbiology Laboratory,
Public Health Agency of Canada
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this work except in compliance with the License. You may obtain a copy of the
License at:
http:... |
import json
import numpy as np
import requests
from bs4 import BeautifulSoup
from pprint import pprint
class QueryBuilder(object):
def __init__(self):
self._base_url = 'https://www.harriscountyfws.org/GageDetail/Index/'
self._postfix_url = '&v=stream%20elevation'
def _build_query_range(self,... |
#!/usr/bin/env python3
"""Merge filtered/summarized files with qsim values by user-specified comparison"""
import argparse
import sys
import pandas as pd
DEBUG = False
def getOptions():
parser = argparse.ArgumentParser(
description="Merges together comparate count tables by user-specified comparison"
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from genologics.lims import *
from genologics.config import BASEURI, USERNAME, PASSWORD
import couchdb
import os
import yaml
import argparse
from argparse import ArgumentParser
DESC = """Query all plates in LIMS with project ID
"""
# Only 96 well plates are queried. We ... |
import h5py
import numpy as np
from pathlib import Path
from collections import OrderedDict
NCLV = 5 # number of microphysics variables
def load_input_fields(path, transpose=False):
"""
"""
fields = OrderedDict()
argnames = [
'PT', 'PQ', 'PAP', 'PAPH', 'PLU', 'PLUDE', 'PMFU', 'PMFD',... |
# -*- coding: utf-8 -*-
from models import Type, Category, Expense
from django.contrib.auth.models import User
from django.test import TestCase
import datetime
import views
class ModelTestCase(TestCase):
fixtures = ['users.xml', 'initial_data.json']
def setUp(self):
self.category = Category.objects.ge... |
try:
import os
import sys
import re
import requests
import urllib.request
import os
import subprocess as s
from time import sleep
from pytube import YouTube
except Exception as error:
print(f'[-] Modules missing! {error}')
sleep(2)
sys.exit(1)
def printASCII():
prin... |
"""Mistune v2 renderer for Confluence Storage Format (XHTML)
Used by ConfluencePublisher class to parse Markdown using
mistune v2 and convert it to Confluence XHTML Storage Format.
"""
import base64
import json
from .HTMLCommentPlugin import render_inline_html_comment, render_block_html_comment
from mistune import ... |
import os, sys
import subprocess, shlex
import socket
from subprocess import PIPE, CalledProcessError, check_call, Popen
import json
from pprint import pprint
import requests
import logging
from urllib.parse import urljoin
class PanaceaNode(object):
def __init__(self, ip, port=1317, acc_addr=None):
asser... |
import logging
from contextlib import contextmanager
from datetime import datetime
from functools import partial
from typing import Optional, NamedTuple, Any, Type, ContextManager, TypeVar
from urllib.parse import urlparse, parse_qs, ParseResult, urlunparse
from dataclasses import dataclass, field
from xrpc.dsl impor... |
#!/usr/bin/env python3
import asyncio
import collections
from concurrent.futures import ProcessPoolExecutor
from contextlib import suppress
import copy
import math
import numpy as np
import os
import random
import sys
import subprocess
import torch.multiprocessing as mp
import moves
from game import Game
import deep.... |
import sympy as sp
import numpy as np
from sympy import Matrix,shape,symbols, diff, sin, cos, tan, sinh, tanh, acos, atan, sqrt, limit, oo
import multiprocess as Multi
#for general purposes, zero array creation function
def ZeroArrayCreate(*integers):
elemnum = np.prod(integers)
zerolist = [0] * elem... |
# The MIT License (MIT)
#
# Copyright (c) 2020 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, math
from PyQt5.QtWidgets import QWidget, QSlider, QApplication, QHBoxLayout, QVBoxLayout, QLCDNumber, QGraphicsScene, QGraphicsView
from PyQt5.QtCore import QObject, Qt, pyqtSignal, QRectF
from PyQt5.QtGui import QPainter, QFont, QColor, QPen
class Communicate(... |
# -*-coding:utf-8-*-
# coder: <NAME>
# date: 2019.6.9
# state: half modified
import torch
import torchvision
import torchvision.transforms as transforms
import matplotlib.pyplot as plt
from PIL import Image
def default_loader(path):
return Image.open(path).convert('RGB')
class EasyDataset():
def __init__(... |
from pygame.draw import (
polygon,
)
from pygame.gfxdraw import (
aapolygon,
filled_polygon,
)
BEAD_HEIGHT = .75
BEAD_FLAT = BEAD_HEIGHT * .5 / 1.6
BEAD_DIAMETER = 1.3
COLUMN_HEIGHT = 5.
COLUMN_WIDTH = 15 / 11.
COLUMN_HEAVEN_HEIGHT = 1.2
COLUMN_EARTH_HEIGHT = 3.6
COLUMN_RECKONING_BAR_HEIGHT = .2
COLUMN_RO... |
# -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/spider-middleware.html
import os
import re
import time
import json
import random
import logging
import requests as requests
from fake_useragent import UserAgent
from scrapy ... |
"""
Contains methods for accessing course highlights. Course highlights is a
schedule experience built on the Schedules app.
"""
import logging
from openedx.core.djangoapps.course_date_signals.utils import spaced_out_sections
from openedx.core.djangoapps.schedules.exceptions import CourseUpdateDoesNotExist
from open... |
from __future__ import annotations
from uuid import UUID, uuid4
from .aseprite import AsepriteAnimation
from .sprite import Sprite
from .spritesheet import SpriteSheet
class SpriteAnimation(object):
"""A sprite sheet animation composes an animation from frames all defined within a single sprite sheet.
The s... |
__author__ = 'halley'
import probabilityhelpers as ph
import random
#for checking whether two numbers are roughly the same
def almostEquals(x,y):
if abs(x - y) < 0.001:
return True
return False
def strToRhy(rstr):
return [float(i) for i in rstr.split()]
def rhyToStr(rhy):
return ' '.join([str... |
# Copyright 2018 Bloomberg Finance L.P.
#
# 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 i... |
import cv2 as cv
import argparse
import numpy as np
parser = argparse.ArgumentParser(description=
'Use this script to run Mask-RCNN object detection and semantic '
'segmentation network from TensorFlow Object Detection API.')
parser.add_argument('--input', help='Path to input image or video file. Skip ... |
import datajoint as dj
import sortingview as sv
import labbox_ephys as le
import numpy as np
import pandas as pd
import pynwb
from ..common.common_nwbfile import AnalysisNwbfile
from ..common.common_spikesorting import (CuratedSpikeSorting, SpikeSortingWorkspace,
UnitInclusion... |
from fastapi import APIRouter, Depends, Form
from typing import List, Dict, Optional
from instagrapi import Client
from instagrapi.types import Media, Usertag, Location, UserShort
from dependencies import ClientStorage, get_clients
router = APIRouter(
prefix="/media",
tags=["media"],
responses={404: {"... |
# pylint: disable=invalid-name
import math
import typing
import logging
from networkx.algorithms import approximation
import typing_extensions
import networkx as nx
import numpy as np
import faiss
LOGGER = logging.getLogger(__name__)
DEFAULT_PCT_PROBE = 0
ClusterAssignment = typing_extensions.TypedDict('ClusterAssi... |
#!/usr/bin/env python3
import argparse, base64, os, requests
class Portainer:
base_url = None
registry_data = None
session = None
def __init__(self, base_url) -> None:
self.base_url = base_url
self.registry_data = []
self.session = requests.Session()
self.session.he... |
"""'Entity' data class for f451 Communications module.
This data class is used to define entities (e.g. humans, systems, bots, Yetis, ghosts, etc.) that can
can send or receive communications.
Note:
- Some regex strings below are based on examples found in this blog post:
https://stackabuse.com/python-valid... |
# pylint: skip-file
import typing as t
import pytest
from pymessagebus import api
from pymessagebus._messagebus import MessageBus
def test_simplest_handler_can_have_no_handlers_for_a_message():
sut = MessageBus()
message = EmptyMessage()
handling_result = sut.handle(message)
assert handling_result... |
#!/usr/bin/python2
from __future__ import print_function
import unittest
import logging
logging.basicConfig(level=logging.INFO)
import datetime
import gzip
import json
import os
# own modules
import datalogger4
from datalogger4.Timeseries import Timeseries
from datalogger4.TimeseriesStats import TimeseriesStats
from da... |
from src.model.Interface import ICollaborativeModel, IContentModel, IBestModel
# ----- ABBREVIATIONS ------ #
# K1: keep-1-out
# CV: cross validation
class ItemCBF_CF(IContentModel):
"""
Item CF
- MAP@10 K1-CV5 (only warm and target):
"""
from src.model.KNN.ItemKNNCBFCFRecommender import ItemKNN... |
import ctypes as ct
import os
from sys import platform
from typing import List, Dict, Union
import numpy as np
class _CSRESLoader:
def __init__(self):
self._lib = self._load_lib()
def _get_shared_library_extension(self):
if platform == "linux":
return ".so"
elif platform... |
from decimal import Decimal
from os import environ
import sqlalchemy.types as types
from sqlalchemy import (
Table,
Column,
ForeignKey,
BigInteger,
BLOB,
Boolean,
CHAR,
Date,
DateTime,
Integer,
JSON,
REAL,
SmallInteger,
String,
Text,
Time,
TIMESTAMP,
... |
from cone.app import security
from cone.app.browser import RelatedViewProvider
from cone.app.browser import render_main_template
from cone.app.browser.ajax import ajax_message
from cone.app.browser.table import RowData
from cone.app.browser.table import Table
from cone.tile import Tile
from cone.tile import tile
from p... |
#!/usr/bin/env python3
import typing as tp
from collections import namedtuple
Nil = namedtuple('Nil', ())
Cons = namedtuple('Cons', ('car', 'cdr'))
List = tp.Union[Nil, Cons]
def null(lst: List) -> bool:
"""
>>> null(Nil())
True
>>> null(Cons(0, Nil()))
False
"""
return isinstance(lst, ... |
import os
import csv
import numpy as np
def compute_wasserstein(pos_ll_means, pos_ll_stds, neg_ll_means, neg_ll_stds, k=23):
n_labels = len(pos_ll_means)
pos_vars = np.square(pos_ll_stds)
neg_vars = np.square(neg_ll_stds)
ds = []
for idx in xrange(n_labels):
m1 = pos_ll_means[idx]
m2 = neg_ll_means[idx]
v... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from ... |
import os
import uuid
import hashlib
from flask import Flask, render_template, request, redirect, url_for, Markup, g
from werkzeug import secure_filename
import datetime, os, random
import sqlite3
DATABASE = 'databased.db'
UPLOAD_FOLDER = './static/images/posts'
ALLOWED_EXTENSIONS = {'jpg', 'jpeg', 'png'}
app = Flas... |
import numpy as np
import matplotlib.pyplot as plt
# 常量
pi = 3.1415926
# 声波属性
A = 0.01
u = 343
v = 40000
_lambda = u / v
w = 2 * pi * v
k = 2 * pi / _lambda
T = 2 * pi / w
rho = 1.293
# 悬浮物件的尺度
R = 0.005
# 两点换算为距离
def r(x0, y0, z0, x1=0, y1=0, z1=0):
return np.sqrt(np.square(x0-x1) + np.square(y0-y1) + np.squ... |
__author__ = "<NAME>"
__version__ = "0.1"
import pickle
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA256
from Crypto.Cipher import AES
from Crypto import Random
import base64
class Message:
"""
This is a class to hold an encrypted message. It is specifically
designed to be pickeled and sto... |
from pynotifier import Notification
from sys import exit
from tkinter import *
import time
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_holistic = mp.solutions.holistic
file = open('Output.txt', 'r')
for each in file:
strictness, t1 = map(float, each.split())
def popupError(s):
... |
import numpy as np
import pandas as pd
import kerastuner as kt # pylint: disable=import-error
from sklearn.model_selection import StratifiedKFold # pylint: disable=import-error
import tensorflow as tf # pylint: disable=import-error
import cerebral as cb
class HyperModel(kt.HyperModel):
def __init__(self, train... |
# =============================================
# -*- coding: utf-8 -*-
# @Time : 2020/4/25 下午3:44
# @Author : xiao9616
# @Email : <EMAIL>
# @File : Net.py
# @Software: PyCharm
# ============================================
from tensorflow.keras.layers import Conv2D, BatchNormaliza... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Based on https://github.com/glushchenko/micropress/
from __future__ import absolute_import
from __future__ import print_function
import re
from markdown import Extension
from markdown.extensions import attr_list
from markdown.blockprocessors import BlockProcessor
from ... |
import torch
import torch.nn as nn
import torch.optim as optim
class ToyModel(nn.Module):
def __init__(self):
super(ToyModel, self).__init__()
self.net1 = torch.nn.Linear(10, 10).to('cuda:0')
self.relu = torch.nn.ReLU()
self.net2 = torch.nn.Linear(10, 5).to('cuda:1')
def forward(self, x):
x =... |
"""This component provides binary sensors for Unifi Protect."""
from __future__ import annotations
from dataclasses import dataclass
import itertools
import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_DOOR,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_OCCUPANCY... |
from pathlib import Path
from sys import path
# Path to the build directory including a file similar to 'ruckig.cpython-37m-x86_64-linux-gnu'.
build_path = Path(__file__).parent.absolute() / 'ruckig/build'
print(build_path)
path.insert(0, str(build_path))
from ruckig import InputParameter, Ruckig, Trajectory, Result
... |
import xml.etree.ElementTree as ET
import md
projectSummaryFeatures = [
"number_of_modules",
"lines_of_code",
"lines_of_comment",
"McCabes_cyclomatic_complexity",
"lines_of_code_per_line_of_comment",
"McCabes_cyclomatic_complexity_per_line_of_comment",
"rejected_lines_of_code"
]
proceduralFeatures = ... |
import numpy as np
from bisect import bisect_left
def pipe_filter(elems, pipe, fastbreak=True, w_rm=False, r_flags=False):
"""Return element given a filter pipe
Args:
elems (iterable) : list to filter from
pipe (list of callable) : a callable returns True on element to remove
fastbrea... |
import graphene
from graphene_django.types import DjangoObjectType
from .models import Category, Ingredient
class CategoryType(DjangoObjectType):
class Meta:
model = Category
class IngredientType(DjangoObjectType):
class Meta:
model = Ingredient
class Query(object):
all_categories = grap... |
from value_types import Type, Value
class WithGuard:
def __init__(self, restore):
self.restore = restore
def __enter__(self):
pass
def __exit__(self, type, value, traceback):
self.restore()
class CmdGenerator:
def __init__(self, execute_params, types=None):
self.out... |
#!/usr/bin/env python3
import argparse
from pathlib import Path, PurePath
import os
import sys
import shutil
import filecmp
import vimrunner
import time
import multiprocessing
import subprocess
from pynvim import attach
def log(string, f=None):
"""Log to terminal and to file."""
print(string)
if f is not... |
###############################################################################
# create_EPIC_weather_files.py
# email: <EMAIL>, 24th March, 2015.
#
# Convert downloaded data to EPIC compatible weather files.
###############################################################################
import constants, util, logging... |
"""
Entry point for training and evaluating a lemmatizer.
This lemmatizer combines a neural sequence-to-sequence architecture with an `edit` classifier
and two dictionaries to produce robust lemmas from word forms.
For details please refer to paper: https://nlp.stanford.edu/pubs/qi2018universal.pdf.
"""
import loggi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on July 2, 2020
@author: <NAME> <<EMAIL>>
@author: <NAME> <<EMAIL>>
"""
from typing import Union
import numpy as np
from scipy import sparse
from sknetwork.topology.weisfeiler_lehman_core import weisfeiler_lehman_coloring
from sknetwork.utils.base import Algo... |
# coding=utf-8
# python3 main.py
# ------------------------------配置bot信息------------------------------
bot_name = 'SprinkleBot'
password = ' '
channel = 'main'
hello = True
roll = True
dev = False
msg = '1'
msg1 = '1'
# ------------------------------配置bot信息------------------------------
import sys
import json
import ... |
"""Tests for utils.py."""
import textwrap
from pytype import debug
from pytype.typegraph import cfg
import unittest
class Node:
"""A graph node, for testing tree printing."""
def __init__(self, name, *incoming):
self.name = name
self.outgoing = []
self.incoming = list(incoming)
for n in incomi... |
import math
import numpy as np
import torch
import scipy.signal
import matplotlib.pyplot as plt
from parameters import WINDOW_SIZE, OVERLAP, NPERSEG, BATCHES_PER_EPOCH, FRAMES_PER_BATCH
# Takes input mono audio track, stretches it to twice its length (interpolating
# samples through average of adjacent samples), and s... |
"""
Filename: build_dataset.py
Function: Crops the images into small 256x256 images and divides the dataset into training and testing set.
Author: <NAME> (https://github.com/Paulymorphous)
Website: https://www.livetheaiexperience.com/
"""
import numpy as np
import cv2
from tqdm import tqdm
import os
import math
impo... |
import os, os.path
import sys
import ast
import megalex
from megalex import safelyAccessFirstString, safelyAccessStrings
import datetime
if 3 > len(sys.argv):
print("Must supply at least two parameters! Usage: \n\tbackend_KPML.py infile outfile\n")
sys.exit(1)
outfilePath = sys.argv[2]
infilePath = sys.arg... |
"""
==========================================
Evaluation of outlier detection estimators
==========================================
This example benchmarks outlier detection algorithms, :ref:`local_outlier_factor`
(LOF) and :ref:`isolation_forest` (IForest), using ROC curves on
classical anomaly detection datasets. T... |
from som.interpreter.ast.frame import FRAME_AND_INNER_RCVR_IDX
from som.interpreter.ast.nodes.variable_node import (
UninitializedReadNode,
UninitializedWriteNode,
NonLocalVariableReadNode,
LocalInnerVarReadNode,
LocalFrameVarReadNode,
NonLocalVariableWriteNode,
LocalInnerVarWriteNode,
L... |
from quex.output.syntax_elements import Variable
from quex.blackboard import Lng
from copy import copy
candidate_db = {
# Name Type(0), InitialValue(2), PriorityF(3)
"input": ["QUEX_TYPE_LEXATOM", "(QUEX_TYPE_LEXATOM... |
"""
The MIT License (MIT)
Copyright (c) 2022-present EmreTech
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, me... |
__id__ = "$Id: setup.py 239 2008-01-07 17:47:47Z jlconlin $"
__author__ = "$Author: jlconlin $"
__version__ = " $Revision: 239 $"
__date__ = "$Date: 2008-01-07 10:47:47 -0700 (Mon, 07 Jan 2008) $"
import distutils.ccompiler
import distutils.sysconfig
from distutils.core import setup, Extension
from distuti... |
"""
Sample script for getting camera feed and showing predictions from a Larq-ed model
References:
- https://github.com/aiden-dai/ai-tflite-opencv/blob/master/object_detection/test_camera.py
- https://stackoverflow.com/questions/5998245/get-current-time-in-milliseconds-in-python
"""
from datetime import datetime
from ... |
import torch
import torch.nn as nn
from torch.nn import functional as F
from functorch.compile import memory_efficient_fusion
from torch.testing._internal.common_utils import TestCase, run_tests
import inspect
from typing import Callable
import unittest
HAS_CUDA = torch.cuda.is_available()
def _num_args(fn: Callable... |
from marshmallow import validates_schema
from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Relationship
from sqlalchemy.orm.exc import NoResultFound
from app.api.helpers.exceptions import UnprocessableEntity
from app.api.helpers.utilities import dasherize
from app.api.schema.base import Soft... |
import numpy as np
import math
from CLT_calculation import calc_Q_0, CLT_ABD, Shell_Engineering_Constants, Plate_Engineering_Constants, CLT_Stress_Puck, CLT_Stress_ZTL
from Rotational_speed_Buckling import twisted_critical_speed, bending_critial_speed, torsion_buckling
# Geometry and Load data
l = 500 # shaft length... |
"""Control the hue lamps from Philips using Python."""
from lively_lights import environment
from lively_lights import scenes
from lively_lights.cli import get_parser
from lively_lights.environment import ReachableLights
from lively_lights.phue import Bridge
import configparser
import contextlib
import daemon
import l... |
# MAYA Xtractor
# https://github.com/chenghui-lee/maya-xtractor
import os
import time
import random
import datetime
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webd... |
"""
We want to translate a Scene
to sdf models.
"""
import logging
from typing import List, Tuple, Dict
import os
import math
import xml.etree.ElementTree as ET
from tempfile import mkstemp
import wget
import shutil
import yaml
import attr
from scenic.core.scenarios import Scene
from scenic.core.object_types import Ob... |
# -*- coding: utf-8 -*-
"""
Learn models using ObjectNet3D images from setupDataFlipped_objectnet3d
"""
import torch
from torch import nn, optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from axisAngle import get_error2, geodesic_loss
from objectnetHelperFunctions import TestImages, ... |
# This is the second implementation of the GUI based emailEncryptor program
# Written and designed by <NAME>
# hrcyber.tech
# github.com/hriewe/
from steg import common, steg_img
import yagmail
import sys
import getpass
import random
import string
# This class encrypts with a caesar rotation cipher
class caesar():
... |
"""Backend for team_db based on MongoDB."""
import json
import logging
from collections.abc import MutableMapping
from functools import wraps
from threading import RLock, current_thread
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Optional, Union
from . import utils
from .utils import base64ify
i... |
# Copyright (c) 2016, <NAME>
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the BSD license. See the accompanying LICENSE file
# or read the terms at https://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, print_func... |
import bpy, os
def apply_lightmaps():
for obj in bpy.data.objects:
if obj.type == "MESH":
if obj.TLM_ObjectProperties.tlm_mesh_lightmap_use:
for slot in obj.material_slots:
mat = slot.material
node_tree = mat.node_tree
... |
# Library
import torch
import numpy as np
import time
import socket
import threading
from asteroid.models import BaseModel
from denoiser.demucs import DemucsStreamer
from denoiser.utils import deserialize_model
from npsocket import SocketNumpyArray
from real_time_omlsa.omlsa import *
import json
inport = 9999
outport... |
from __future__ import annotations
import sys
import types
from typing import Any, Type, Callable, Collection, cast
from PySide6 import QtGui
from PySide6 import QtWidgets
from subtypes import Enum
from pathmagic import File, PathLike
from .widget.label import Label
from .widget.button import Button
from .widget.ht... |
import random
from devicecache import DeviceCache
from pmshelper import *
from util import *
class MediaType:
types = []
artist = None
movie = None
show = None
def __init__(self, name, display_name, default_device):
self.name = name
self.display_name = display_name
self.d... |
from necroassembler.utils import pack
from necroassembler.exceptions import UnknownLabel, AssemblerException
class RelocationNotImplemented(AssemblerException):
message = 'please subclass the ELF class and implement the \'relocate\' method'
class Dummy:
def resolve_unknown_symbol(self, assembler, address, s... |
#!/usr/bin/env python3.6
# coding=utf-8
'''
Scripts to build PSDStringCopyRules and PSDReCategorizor
Data path information should also be specified here for
trainFolderPath, devFolderPath and testFolderPath
as we allow option to choose from two version of data.
@author: <NAME>(<EMAIL>)
@since: 2019-05-30
'''
from ut... |
"""
API resource for text analysis (industry classification, concept extraction and marked-up version of text).
"""
from flask_restful import reqparse
from flask import jsonify
from flask import Flask
from flask_restful import Api
import koltextana
from flask.ext.restful import Resource
from flask.ext.cors import COR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.