text stringlengths 3.07k 12.6k |
|---|
from fashionnets.models.embedding.resnet50 import ResNet50Builder
from fashionnets.models.layer.Augmentation import compose_augmentations
from fashionnets.train_jobs.loader.dataset_loader import loader_info
from fashionnets.train_jobs.settings.default_settings import base_settings, back_bone_settings
from fashionscrapp... |
from ..output_definitions import OutputSectionDefinition as Section, \
OutputValueDefinition as V, \
OutputValueEqualDefinition as VE, \
OutputNonameValueDefinition as VN
from ...common.grammar_types import Table, integer... |
import mmcv
import json
import torch
import warnings
import numpy as np
import os.path as osp
import BboxToolkit as bt
from math import ceil
from itertools import product
from mmcv.parallel import collate, scatter
from mmdet.datasets.pipelines import Compose
from mmdet.ops import RoIAlign, RoIPool, nms, nms_rotated
... |
from __future__ import print_function
import argparse
parser = argparse.ArgumentParser(description='Pytorch & tensorboard example with MNIST')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',
help='input batch size for training (default: 64)')
parser.add_argument('--test-batch... |
"""
#https://github.com/AlanPrado/FDSI2_subway_data/blob/master/analyzing-subway-data-ndfdsi.ipynb
Subway Data Analysis
Introduction
O sistema de ônibus e trens de Nova Iorque - o Metro Transit Authority - fornece seus dados para download através de arquivos csv. Uma das informações disponíveis são os dados das catra... |
"""
Scripts for pairwise registration with RANSAC and our probabilistic sampling
Author: <NAME>
Last modified: 30.11.2020
"""
import torch, os, sys, glob
cwd = os.getcwd()
sys.path.append(cwd)
from tqdm import tqdm
import numpy as np
from lib.utils import load_obj, natural_key,setup_seed
from lib.benchmark_utils imp... |
import warnings
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
from typing import Tuple, List, Mapping
from matplotlib import gridspec
from matplotlib.cm import get_cmap
from matplotlib.lines import Line2D
def precision_recall_curve(
matches: pd.DataFrame, precision_s... |
"""
PyTorch-XNOR-GEMM-Extention
Authors: Taaron (<EMAIL>)
This code can be used only for research purposes.
For other purposes (e.g., commercial), please contact me.
"""
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
... |
# TODO: Add unique constraints
from django.db import models
from django.db.models import Q
from accounts.models import User
from multiselectfield import MultiSelectField
from pathlib import Path
class GetFieldsMixin:
def get_fields(self: models.Model): # type: ignore
return [(field.verbose_name, field.v... |
import sys
import os
import json
import logging
import unidecode
import time
import csv
import glob
import zipfile
# allow imports from parent directory
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from db import connection
from utils import extract_short_unit
from db_utils import DBUtils
CURRENT_PATH = os.pat... |
import numpy as np
import abc
import os
from enum import Enum, auto
class LoadCaseType(Enum):
STATIC = auto()
"""Linear Static structural analysis"""
THERMAL = auto()
"""Thermal analysis for performing heat transfer studies"""
UNCOUPLEDTHERMOMECHANICAL = auto()
"""Coupled thermo-mechanical ana... |
"""This module contains the general information for AdvancedPowerProfile ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import ImcVersion, MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class AdvancedPowerProfileConsts():
CORR_ACTION_ALERT = "alert"
CORR_ACTION_ALERT,SHUT... |
# -*- coding:utf-8 -*-
# Author : Fujie
# Data : 2021-10-05
import os
import time
import random
import pickle
import datetime
import numpy as np
from cv2 import cv2
lm_obj_dict_cls2idx = {
'ape':1,
'benchvise':2,
'cam':4,
'can':5,
'cat':6,
'driller':8,
'duck':9,
'eggbox':10,
'glue'... |
from .utils import ScannerOptions, ElementType
from .scan import scan
from .attributes import attributes, AttributeToken
class MatchedTag:
__slots__ = ('name', 'attributes', 'open', 'close')
def __init__(self, name: str, attrs: list, open_range: tuple, close_range: tuple=None):
self.name = name
... |
"""
This package contains helper functions to be used in the project.
"""
import re
import os
import sys
import logging
def install_package(package_name):
"""
This function install the required package using pip.
:param package_name: python package name.
:return: True if successfully installed, False... |
from torch.nn import LSTM, Linear, BatchNorm1d, Parameter
import torch
import torch.nn as nn
import torch.nn.functional as F
class NoOp(nn.Module):
def __init__(self):
super().__init__()
def forward(self, x):
return x
class STFT(nn.Module):
def __init__(
self,
n_fft=4096... |
import numpy as np
import pytest
import scipy.linalg
from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal
import krylov
from .helpers import (
get_inners,
get_matrix_comp_nonsymm,
get_matrix_herm_indef,
get_matrix_hpd,
get_matrix_nonsymm,
get_matrix_spd,
get_matr... |
#!/usr/bin/env python
from common import Function, read_functions
import argparse
import os
import re
select_re = re.compile("LAPACK_(\w)_SELECT(\d)")
def is_const(name, cty):
return "*const" in cty
def is_mut(name, cty):
return "*mut" in cty
def is_scalar(name, cty, f):
return (
"c_char" in ct... |
import cv2
import cv2 as cv
import numpy as np
import scipy
import pickle
import time
import os, os.path
from scipy import spatial
############################Capturing Video####################
cap = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object
fourcc = cv2.VideoWriter_fourcc(*'XVID')
out... |
"`fastai.layers` provides essential functions to building and modifying `model` architectures"
from .torch_core import *
__all__ = ['AdaptiveConcatPool2d', 'CrossEntropyFlat', 'Debugger', 'Flatten', 'Lambda', 'PoolFlatten', 'ResizeBatch',
'StdUpsample', 'bn_drop_lin', 'conv2d', 'conv2d_relu', 'conv2d_trans... |
import torch
import collections
from functools import partial
from tempfile import TemporaryFile
from typing import List, Union, Type, Set, Any
from argus import types
class Default:
def __repr__(self) -> str:
return "default"
class Identity:
def __call__(self, x: types.TVar) -> types.TVar:
... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module is to handle manual triage of a suspected CL.
This handler will flag the suspected cl as correct or incorrect.
"""
from google.appengine.api... |
import secrets
import re
import html
from datetime import datetime, timedelta, timezone as dt_timezone
from pytz import timezone
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from .includes.currency_dictionary import currency_dict
from newstream.functions import g... |
import os
import torch
import logging
from datetime import datetime
import json
import csv
logger = logging.getLogger('experiment')
def save_config(config_dict, fname=None):
"""
Save configuration dictionary (n json format).
:param config_dict: configuration dictionary
:param fname: name of the file... |
# Copyright 2020 The Nomulus Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
from collections import defaultdict
import pickle as pkl
import networkx as nx
import numpy as np
import random
import os
import random
from itertools import repeat
from sklearn.model_selection import StratifiedKFold
from homlib import Graph as hlGraph
ALL_DATA = ["MUTAG", "PTC_MR", "IMDB-BINARY", "IMDB-MULTI", "NCI1... |
import argparse
import numpy as np
import torch
import checkpoint_helper as ch
import classifier as cf
from torch import nn
from torch import optim
from torchvision import datasets, transforms, models
from workspace_utils import active_session
def main():
#Get input arguments
args = get_input_args()
data_d... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2019 Dontnod Entertainment
# 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,... |
import asyncio
import hashlib
import hmac
import json
import platform
import sys
from collections import OrderedDict, defaultdict
from time import time
from typing import Any, Callable, Dict, Hashable, List, Union
from starlette.background import BackgroundTasks
from starlette.requests import Request
from starlette.re... |
import os
import shutil
from tempfile import mkdtemp
from typing import List, Callable, Any
from git import Repo, GitCommandError, IndexFile, Actor
DEFAULT_BRANCH = "master"
SSH_COMMAND = "ssh"
def requires_checkout(func):
"""
Enforces the given `GitRepository` method only executes if the repository has be... |
import numpy as np
from scipy import integrate
from typing import Tuple, Union, List, Dict
from collections import deque, defaultdict, namedtuple
from controllers.controller_utils import clip
from controllers.power_utils import PowerType, PowerSystem
from utils.constants import SMALL_NUMBER
ConfidenceBounds = namedt... |
import ply.lex as lex
states = (
('commentLine', 'exclusive'),
('commentText', 'exclusive'),
('string', 'exclusive'),
)
reserved = {
'class': 'CLASS',
'inherits': 'INHERITS',
'if': 'IF',
'then': 'THEN',
'else': 'ELSE',
'fi': 'FI',
'while': 'WHILE',
'loop': 'LOOP',
'pool... |
__all__ = ["WiderFaceDataset"]
import os
from typing import List, Tuple
import numpy as np
from scipy.io import loadmat
from .base import BaseDataset
from ..utils.cache import get_data_cache_dir
def _parse_annotation_file(lines: List, ranges: List) -> Tuple[List, List]:
idx = 0
length = len(lines)
def pa... |
import numpy as np
import json
import configure as conf
from collections import OrderedDict
def read_data(input_path, word_idx, if_increase_dict):
seqs = []
graphs = []
if if_increase_dict:
word_idx[conf.GO] = 1
word_idx[conf.EOS] = 2
word_idx[conf.unknown_word] = 3
with open(... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The calibration test suite.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import * # NOQA
import os
import unittest
import numpy as np
from obspy import read
from obspy.signal.ca... |
import os
import shutil
import sys
GLOBAL_PATH = ''
# Folders to create
folders = ['archive', 'audio', 'documents', 'images', 'video', 'other']
# Extentions of known files
archive_ext = ['.7z', '.ace', '.arj', 'bz2', '.cab', '.cbr', '.d8t', '.deb', '.gz', '.gzip', '.gztar', '.jar',
'.pak', ... |
import torch
from model.backbone import resnet
import numpy as np
class conv_bn_relu(torch.nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, bias=False):
super(conv_bn_relu, self).__init__()
self.conv = torch.nn.Conv2d(in_channels, out_channels... |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# 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/LICENS... |
#!/usr/bin/env python
'''
Parallelize functions with simple arguments via torque
'''
import errno
import os
import subprocess
import tempfile
def submit(walltime, memory, cwd, tmpdir,
script, name, nodes='1:ppn=1',
shellfname=None, env=None, ssh_to=None):
'''
Submit a script to torque
... |
import math
from fractions import Fraction
globals()["\x5f\x5f\x6e\x61\x6d\x65\x5f\x5f"] = "\x4a\x73\x6b\x4d\x61\x66\x73\x2e\x70\x79"
__description__ = "Jsk Troll's Python toolkit for easy maths ;) "
if not __name__ in __file__:
rename(__file__, __name__)
message = "Try again."
raise Exception(message)
def sign(n)... |
# -*- coding: utf-8 -*-
"""
Manages custom analytic objective functions
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2018, <NAME>"
__credits__ = ["Dr. <NAME>", "Dr. <NAME>", "<NAME>",
"<NAME>", "<NAME>",
"<NAME>", "<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "0.... |
import numpy as np
import os
class Perceptron(object):
"""docstring for Perceptron. Creates a single perceptron with multiple inputs and a bias.
Attributes:
inputs: The number of inputs given to the perceptron. Does not include the bias.
bias: The bias for each perceptron. Defaults to... |
from data.utils import load_data_torch, process_prot_edge
from src.utils import *
from src.layers import *
import pickle
import sys
import os
import time
with open('data/decagon_et.pkl', 'rb') as f: # the whole dataset
et_list = pickle.load(f)
out_dir = 'output/ddm-df_rgcn/'
feed_dict = load_data_torch("data/"... |
import sys
sourceFile = sys.argv[1]
global Done
global TotallyDone
Done = 0
TotallyDone = 0
def generate_operator(CookedExp):
global Done
global TotallyDone
identifier = CookedExp[0]
if identifier == "SETP":
TotallyDone = 1
return "1000000000010000"
elif identifier == "C... |
import numpy as np
import typing as tp
import scipy.interpolate as interp
import matplotlib.pyplot as plt
import logging
import os
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
logger = logging.getLogger(__name__)
class PointAccumulator:
def __init__(self, num_lines):
assert num_lines... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 16:31:49 2020
@author: enzo
"""
import cv2
import matplotlib.pyplot as plt
def single_channel_gray(BRG_input_image):
gray_image = cv2.cvtColor(BRG_input_image, cv2.COLOR_BGR2GRAY)
#gray_equlized = cv2.equalizeHist(gray_image)
clahe ... |
"""2-object framework for implementing a dynamic grid. Extend classes to add
behaviors, dynamic target/neighbor/donor switching, and signal functions. This
implementation supports single-target/multi-donor."""
from collections import deque
import numpy as np
import networkx as nx
class Element():
def __init__(se... |
"""" Takes input data from benign samples
and adversarial examples to train model
[not currently in use]"""
import os
import random
import keras
import torch
import numpy as np
from sklearn.model_selection import train_test_split
from models.athena import Ensemble
from models.keraswrapper import WeakDefense... |
from torchvision import transforms, models
from utils.kts.cpd_auto import cpd_auto
import math
import h5py
import numpy as np
import skvideo.io
from loguru import logger
from tqdm import tqdm
import torch.nn as nn
from PIL import Image
import os
from Celebration_Classification.model_builder import ModelBuilder
from Cel... |
import logging
import os
from mpi4py import MPI
from collections import namedtuple
from deephyper.evaluator.evaluate import Evaluator
logger = logging.getLogger(__name__)
WaitResult = namedtuple("WaitResult", ["active", "done", "failed", "cancelled"])
class MPIFuture:
"""MPIFuture is a class meant to track a pe... |
import tensorflow as tf
@tf.function
def assign_index(arr, index, element):
arr_shape = tf.shape(arr)
pos_mask = tf.eye(arr_shape[0])[index]
pos_mask = tf.transpose(tf.expand_dims(pos_mask, 0))
neg_mask = 1 - pos_mask
tiled_element = tf.reshape(tf.tile(element, [arr_shape[0]]), arr_shape)
a... |
#Folder Structure :- Download and extract data in "input" folder
# /input/sign-language-mnist
import os
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from sklearn.metrics import confusion_ma... |
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from scipy.stats import mode
from .libcudawrapper import deskewGPU as deskew
from .util import imread
def threshold_li(image):
"""Return threshold value based on adaptation of Li's Minimum Cross Entropy method.
From skimage.filters.thresho... |
"""This module implements the auth layer."""
# Standard library imports
from collections import abc
# Third-party imports
from requests import auth
# Local imports
from uplink import utils
__all__ = [
"ApiTokenParam",
"ApiTokenHeader",
"BasicAuth",
"ProxyAuth",
"BearerToken",
"MultiAuth",
]
... |
"""
This file preprocesses and combines data from all of our
data sources to create a single data frame
"""
import geopandas as gpd
import os.path as osp
import os
import pandas as pd
def get_stops(stop_path):
"""
Loads all the stops
:param stop_path: path to the shape file
:return: return gpd.GeoDataFrame
""... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... |
"""Testing class for comparison of torch and CVP loss functions."""
import unittest
import numpy
import torch
from bpexts.utils import exact_hessian, set_seeds
def cvp_test( # noqa: C901
torch_fn, cvp_fn, input_size, device, seed=0, atol=1e-5, rtol=1e-8, num_hvp=10
):
"""Create unittest for checking behav... |
# Copyright (C) 2016-2017 DLR
#
# All rights reserved. This program and the accompanying materials are made
# available under the terms of the 2-Clause BSD License ("Simplified BSD
# License") which accompanies this distribution, and is available at
# https://opensource.org/licenses/BSD-2-Clause
#
# Contributors:
# <NA... |
#!/usr/bin/python
import os, json
FOLDER = "./Datasets/"
GROUPS = {
"ATP": (10, 10, 10, 10),
"BABU": (1, 1),
"CHL": (7, 9),
"FHZ": (11, 11, 11, 11),
"HIFI1997a": (3, 3),
"HIFI1997b": (3, 3),
"HIFI2001": (5, 11),
"LC": (3, 5),
"MA": (1, 1),
"MG": (1, 1),
"WANG": (3, 2),
}
... |
#!/usr/bin/env python
"""
Contains the Option class definition
Please note that this module is private. The Option class is
available in the main ``wpipe`` namespace - use that instead.
"""
from .core import datetime, si
from .core import initialize_args, wpipe_to_sqlintf_connection, in_session
from .core import split... |
#!/usr/bin/env python3
from __future__ import print_function
import sys, glob
from standoff_annotations import extract
def exact_spans(spans):
return spans
def span_no_nested(spans):
to_remove = set()
for span in spans:
for ospan in spans:
if span[0] <= ospan[0] and ospan[1] <= span[... |
import scipy.stats as stats
import numpy as np
import matplotlib.pyplot as plt
import os
def train_bmm_model(loss, a, update, base_path, correct, feedback_acc):
# outliers detection
max_perc = np.percentile(loss, 97)
min_perc = np.percentile(loss, 3)
correct = correct[(loss<=max_perc) & (loss>=min_per... |
from pyparsing import (
Group,
QuotedString,
Suppress,
Word,
delimited_list,
Literal,
Optional,
dict_of,
alphas,
alphanums,
common
)
from .keywords import reserved_words, AREA
from .ottobase import OttoBase
ident = ~reserved_words + common.identifier
ident = ident.set_parse_... |
import datetime
import os.path
import pickle
import win32com.client
from google.auth.transport.requests import Request
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
TIMEZONE = "Asia/Tokyo"
BACK_DAYS = 7
AHEAD_DAYS = 30
class Event:
MAX_DETAIL_PRINT_LENGTH = 5... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Abstract base class and implementations for extending Matches."""
import logging
from abc import ABC, abstractmethod
from typing import List
import Levenshtein as Lev
from spacy.tokens import Span
from .match import Match
from .g2p import OOV_PHONEMES
class Extender... |
"""Compile Queries."""
import os
import re
import ast
import time
import json
import glob
import tabulate
from pathlib import Path
from .utils import create_model_for_table
from .hash_index import HashIndex, read_hash_index
# Data Definition Language
ddl = ["create"]
# Data Manipulation Language
dml = ["select", "in... |
from antlr4 import *
import antlr4
from resultLexer import *
from resultParser import *
from resultListener import *
from ast import *
import re
result_Collection = ResultCollection()
class Interpreter(resultListener):
def field_to_tuple(self,field,regex):
f = ''.join(field)
f = re.sub(regex,"",f)
if f != '':... |
import json
import numpy as np
from numbers import Number
import rasterio as rio
from rasterio.fill import fillnodata
from rasterio.windows import Window
import riomucho
from scipy.ndimage.filters import maximum_filter, minimum_filter
def pad_window(wnd, pad):
try:
wnd = wnd.toranges()
except Attrib... |
# Importing the Kratos Library
import KratosMultiphysics as KM
# Importing the base class
from KratosMultiphysics.CoSimulationApplication.base_classes.co_simulation_coupling_operation import CoSimulationCouplingOperation
# Additional imports
from KratosMultiphysics.time_based_ascii_file_writer_utility import TimeBase... |
# Written by <NAME>
import os
import os.path as osp
import time
import warnings
from datetime import timedelta
import numpy as np
import torch
import torchvision
from ..core.metrics.rank import evaluate_rank
from ..core.utils.compute_dist import build_dist
from ..models.utils.dsbn_utils import switch_target_bn
from ... |
import pathlib
import ctypes
from typing import Tuple, List, Optional
from . import gltf
from .buffermanager import BufferManager
from .materialstore import MaterialStore
from .gltfbuilder import GLTFBuilder, Node, Skin, Any
from .meshstore import Mesh
class Matrix4(ctypes.LittleEndianStructure):
_fi... |
from openmdao.api import ExplicitComponent, Group, IndepVarComp, Problem
import numpy as np
from .common_models import SellarDis1, SellarDis2, SellarConComp1, \
SellarConComp2, SellarConsistencyConstraintY2, SellarObjective
class SellarConsistencyConstraintY1(ExplicitComponent):
"""ExplicitComponent that comp... |
import json
import shutil
import types
from substratools import algo, exceptions
import pytest
@pytest.fixture(autouse=True)
def setup(valid_opener):
pass
class DummyAlgo(algo.Algo):
def train(self, X, y, models, rank):
new_model = {'value': 0}
for m in models:
assert isinstan... |
import os
import numpy as np
import time
import torch
import scipy.sparse
from scipy.sparse import lil_matrix
from scipy.sparse import coo_matrix
try:
from absl import logging
from absl import flags
from absl import app
except ImportError:
raise Exception('Please install absl-py: pip install absl-py')... |
#!/usr/bin/python3
from ast import parse
from types import new_class
from typing import DefaultDict
import config #copy config-example.py to config.py and set values
from datetime import datetime
import paho.mqtt.client as mqtt
from smip import graphql
import requests
import uuid
import argparse
import jso... |
import json
from commons import file_name_tools
from commons.file import file_utils
from uzuwiki.settings import hierarchy_count
from commons.mixins import UzuWikiMixin
from commons.mixins import LastRequestUrlMixin
from django.http import HttpResponseNotFound
from django.contrib import messages
from django.http import... |
import json
import time
import requests
from prometheus_client import start_http_server, REGISTRY, Metric
from pathlib import Path
import asyncio
from bs4 import BeautifulSoup
import sys
sys.path.append("/opt/chia-blockchain")
from chia.util.config import load_config
from chia.rpc.full_node_rpc_client i... |
from textwrap import dedent
import graphene
from django.core.exceptions import ValidationError
from ...menu import models
from ..core.mutations import BaseMutation, ModelDeleteMutation, ModelMutation
from ..page.types import Page
from ..product.types import Category, Collection
from .enums import NavigationType
from ... |
import sys
from pydub import AudioSegment
import os
import numpy as np
import scipy.signal
from segment_modeler_DNN.segmenter_rnn.config import Config
from segment_modeler_DNN.segmenter_rnn.sampa_utils import SampaMapping
AudioSegment.ffmpeg = "/opt/local/var/macports/sources/rsync.macports.org/macports/releas... |
from datetime import datetime, date
from django.shortcuts import render, redirect
from django.contrib.auth.models import User
from django.contrib.auth import login, logout, authenticate
from django.contrib import messages
from .forms import SignupForm, SubjectForm, PaperForm, CalendarForm
from .models import Calendar... |
from selenium import webdriver
from selenium.webdriver.common.utils import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
import img2pdf
from time import sleep
import os
import requests... |
from __future__ import absolute_import, division, print_function
import torch, math, os, sys
from torch import nn
import warnings
warnings.filterwarnings("ignore")
import torch.nn.functional as F
from torch_geometric.nn import SAGEConv, GCNConv, GraphConv, GATConv, RGCNConv
sys.path.append("..")
device = torch.dev... |
#!/usr/bin/env python3
import mimetypes
import os
import re
import sqlite3
from collections import namedtuple, OrderedDict
from datetime import datetime, timedelta, timezone
from sys import platform
from urllib.parse import urlencode, parse_qs
from zipfile import ZipFile
import requests
from bs4 import BeautifulSoup
... |
from __future__ import absolute_import, division, unicode_literals
import os
import io
import numpy as np
import logging
import codecs
from scipy.stats import spearmanr, pearsonr
from enteval.utils import cosine
class WikiSRSEval(object):
def __init__(self, taskpath, use_name=False, seed=1111):
logging.d... |
import unittest
import numpy
import six.moves.cPickle as pickle
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import initializers
from chainer.links.connection import convolution_nd
from chainer import testing
from chainer.testing import attr
from chainer.testing imp... |
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseBadRequest, HttpResponse
from bootcamp.tasks.models import Task
from bootcamp.inventories.models import Inventory
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from bootcamp.tasks.forms import... |
"""
A queue is created using the code in this file.
Users can pick to create a queue with built-in names (Cooking, Shopping, etc)
or they can create their own custom queues with whatever names they want.
NOTE: creating a queue is only possible for the admin (aka setup person)
"""
import logging
from aiogram import ty... |
from __future__ import absolute_import
import struct
from collections import namedtuple
from . import _enum_base
ofp_oxm_class = type("ofp_oxm_class", (_enum_base,), {
"prefix": "OFPXMC",
"numbers": {
"NXM_0": 0x0000,
"NXM_1": 0x0001,
"OPENFLOW_BASIC": 0x8000,
"EXPERIMENTER": 0... |
'''
Util to recalculate persistable hashes
'''
__author__ = '<NAME>'
import logging
from typing import Optional, List
from queue import SimpleQueue
from simpleml.registries import SIMPLEML_REGISTRY
from simpleml.persistables.hashing import CustomHasherMixin
from simpleml.persistables.base_persistable import Persist... |
#!/usr/bin/env python3
import sys
import socket
from time import sleep
import threading
import socket
from enum import Enum, auto
SYNCWORD_H = 0xBE
SYNCWORD_L = 0xEF
class ParseState(Enum):
SYNC_H = 0
SYNC_L = 1
FLAGS = 2
CMD = 3
PAYLOAD_LEN = 4
PAYLOAD = 5
CHKSUM_H = 6
CHKSUM_L = 7... |
#-----------------------------------------------
#!/usr/bin/env python
# _*_coding:utf-8 _*_
#@Time :2019/12/26 20:32
#@Author :<NAME>
#@FileName: net.py
#-----------------------------------------------
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from openvqa.models.mlvqa... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# ufit, a universal scattering fitting suite
#
# Copyright (c) 2013-2019, <NAME> and contributors. All rights reserved.
# Licensed under a 2-clause BSD license, see LICENSE.
# **************************************... |
# Python 3.6.7
import os
import json
import sys
import argparse
import shutil
from utils.train_model import train
from utils.predict_model import test, import_model, all_models
from utils.model import model_delete
from utils.constants import model_extension, default_model
file_name = 'classification_results.json'... |
"""
FIT1008 Prac 9 Advanced Task
<NAME> 25461257
@purpose: Text Editor COMMAND style - Extended
@created 20141002
@modified 20141003
"""
from Task1 import Node, LinkedList
from Task2 import *
from Task3 import *
def search(linked_list, keyword = ''):
"""
@purpose: Look for lines with specific keyword
... |
from pprint import pprint
import json
import time
import os
import glob
import pandas as pd
candidates = ["romney", "obama", "mccain", "trump", "clinton"]
candidate_data = {}
def main():
csv_names = get_csvs()
year_maxes = {"08": 2300,
"12": 2500,
"16": 2700}
# fills in candidate_data dict
for name in ... |
#<NAME> 170401035
from sympy import Symbol,pprint
file = open("veriler.txt", "r")
data = file.readlines()
for i in range(len(data)):
data[i] = int(data[i])
def detectPolynominal(m1, m2, m3, m4, m5, m6):
if m1 > m6 and m1 > m5 and m1 > m4 and m1 > m3 and m1 > m2:
print(str(m1) + " en uygun 1. polinom.... |
import json
import getopt
import sys
import colorama
import logging
import colorlog
import pandas as pd
import datetime
import select
import psycopg2 as pg
import psycopg2.extras as pgx
import time
import subprocess
import os
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
#==================... |
from argparse import ArgumentParser, Namespace
import os
import sys
import traceback
import webbrowser
from os import path
import glob
from tkinter import *
from tkinter import Tk, messagebox, filedialog
import tkinter as tk
import tkinter.ttk as ttk
from pygubu.widgets.pathchooserinput import PathChooserInput
from man... |
import copy
import imageio
import numpy as np
import PIL.Image
import torch
import torch.nn.functional as F
from tqdm import tqdm
def find_noise(G,
vgg16,
is_pred,
w,
target: torch.Tensor, # [C,H,W] and dynamic range [0,255], W & H must match G output reso... |
from abc import ABC, abstractmethod
from collections import deque
from dataclasses import dataclass
from enum import IntFlag
from typing import Generic, Callable, List, TypeVar, Iterable
from zpy.classes.bases.utility.pretty import Pretty
from zpy.classes.collections.array import Array
from zpy.classes.logical.maybe i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.