text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, <NAME> <<EMAIL>>
# Copyright: (c) 2017, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_MET... |
import json
import logging
import re
import uuid
from datetime import datetime
import requests
from allauth.account.models import EmailAddress
from allauth.account.views import (
LoginView, LogoutView, SignupView,
PasswordChangeView, PasswordSetView,
PasswordResetView, PasswordResetDoneView, PasswordResetF... |
import torch
from torch import nn
import torch.nn.functional as F
from math import sqrt
class MultiHeadAttention(nn.Module):
"""
Multi Head Attention module as described in "Attention is all you need"
After applying a linear transformation splits keys, values and queries in n heads
Then calculates the scaled simi... |
#### PATTERN | ES | INFLECT ########################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2012 University of Antwerp, Belgium
# Author: <NAME> <<EMAIL>>
# License: BSD (see LICENSE.txt for details).
#####################################################################... |
# -*- coding: utf-8 -*-
# for localized messages
from __future__ import print_function
from __future__ import absolute_import
from .__init__ import _
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.MenuList import MenuList
from Comp... |
#Imports
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os
import glob
import random
# import imgaug
# from imgaug import augmenters as iaa
from PIL import Image
from tqdm import tqdm
import matplotlib.pyplot as plt
im... |
#
# Copyright 2016 The BigDL Authors.
#
# 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 ... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
#!/usr/bin/env python3
"""
Description
1. P7 index from comment section in fastq: @fqname comment
2. inline barcode in the sequence, position1, 2
3. SE or PE reads
mission-1:
1. P7 barcode:
2. inline-barcode:
utils:
1. bc reader
2. errors
3. errors: levenshtein distance
## others
1. defq, ultra fasta mult... |
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Intel Corporation
"""This script runs test cases with O-DU and O-RU"""
import logging
import sys
import argparse
import os
from itertools import dropwhile
from datetime import datetime
import json
import socket
N_LTE_NUM_RBS_PER_SYM_F1 = [
# ... |
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.core.agents import Agent
import torch.nn as nn
import torch
import os
from collec... |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Usage: gn_to_cmake.py <json_file_name>
gn gen out/config --ide=json --json-ide-script=../../gn/gn_to_cmake.py
or
gn gen out/config --ide=json
python gn/gn... |
import json
import pickle
import numpy as np
import random
# from fairseq.data import Dictionary
import sys
import torch
import argparse
import os
from model_pretrain import Plain_bert
from fairseq.models.roberta import RobertaModel
# from utils_sample import NewsIterator
# from utils_sample import cal_metric
from fai... |
#!/usr/bin/env python3
from esphome.cpp_generator import MockObj
import json
import argparse
import os
import re
from pathlib import Path
import voluptuous as vol
# NOTE: Cannot import other esphome components globally as a modification in jsonschema
# is needed before modules are loaded
import esphome.jsonschema as ... |
# * Copyright (c) 2020-2021. Authors: see NOTICE file.
# *
# * 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 ... |
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Module containing stages that generate and/or archive artifacts."""
from __future__ import print_function
import glob
import itertools
import jso... |
# MIT License
#
# Copyright (c) 2019 Tskit Developers
#
# 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... |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of CARS
# (see https://github.com/CNES/cars).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... |
"""
This does some basic testing of the whole pipeline. Note this needs to be run through pytest and doesn't use unittest.
"""
# make sure we can import from package directory
import sys, os, re, gzip
packagedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, packagedir)
import shutil... |
import os
import tempfile
import pytest
from bs4 import BeautifulSoup
import tests.html_schema_doc_asserts
from json_schema_for_humans.generate import generate_from_file_object
from json_schema_for_humans.generation_configuration import GenerationConfiguration
from tests.test_utils import generate_case
current_dir =... |
import discord
from discord import embeds
from discord import colour
from discord.ext import commands
import DiscordUtils
import psutil
cmds = {
"joke" : {
"title" : "Joke Command",
"desc" : "Returns a joke from the r/jokes subreddit!",
"htu" : "cb joke",
"aliases" : "*No Aliases*"... |
"""Normalization helper functions"""
from __future__ import absolute_import, print_function, division
import numpy as np
from cddm.conf import CDTYPE, FDTYPE
from cddm.print_tools import print1,print2, enable_prints, disable_prints
from cddm._core_nb import _normalize_cdiff_1,_normalize_cdiff_3,\
_normalize_ccorr... |
"""Evaluation metrics."""
import numpy as np
import pdb
import time
import warnings
import os
import re
import copy
import itertools
from dcCustom.metrics.cindex_measure import cindex
from multiprocessing import Pool
from time import gmtime, strftime
from deepchem.utils.save import log
from sklearn.metrics import roc_... |
#!/usr/bin/env python
from typing import cast, List, Optional, Union
# import datetime
import glob
import os
import pygame
import random
from AudioPlayer import AudioPlayer
from CombatCharacterState import CombatCharacterState
import GameEvents
from GameState import GameState
from GameDialog import GameDialog, GameD... |
import time
import weakref
import logging
import numpy as np
import wgpu.backends.rs
from .. import Renderer
from ...linalg import Matrix4, Vector3
from ...objects import (
id_provider,
KeyboardEvent,
RootEventHandler,
PointerEvent,
WheelEvent,
WindowEvent,
WorldObject,
)
from ...cameras i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
# Let's import what we need
import os
import sys
import tld
import time
import random
import warnings
import argparse
import threading
from math import log
from re import search, findall
from requests import get, post
try:
impor... |
# Copyright 2011 <NAME> <<EMAIL>>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
#coding:utf_8
import os
import json
import requests
import hashlib
from Cryptodome.PublicKey import RSA
from Cryptodome.Cipher import PKCS1_OAEP, PKCS1_v1_5
from Cryptodome.Cipher import PKCS1_v1_5 as Cipher_pkcs1_v1_5
from binascii import b2a_hex, a2b_hex
from Cryptodome.Cipher import AES
from Cryptodome import Random... |
import logging
llog = logging.getLogger(__name__) # the name 'log' is taken in sdl2
#from math import sin, cos, radians, atan2
import os
import json
import errno
import math
import random
import time
import datetime
from OpenGL.GL import *
from copenglconstants import * # import to silence opengl enum errors for pych... |
#!/usr/bin/env python3
# vim:ts=4:sts=4:sw=4:tw=80:et
from datetime import datetime, date, time, timedelta
import argparse
import os
import sqlite3
import sys
import random
ACT_ARRIVE = 'arrive'
ACT_BREAK = 'break'
ACT_RESUME = 'resume'
ACT_LEAVE = 'leave'
MSG_ERR_NOT_WORKING = 1 << 0
MSG_ERR_HAVE_NOT_LEFT = 1 << ... |
'''
Tests of django_plotly_dash.
These tests can be directly used or imported into eg the tests of the demo app.
The use of pytest is assumed.
Copyright (c) 2018 <NAME> and others - see CONTRIBUTIONS.md
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated docu... |
import copy
import random
import re
from typing import Any, Optional, Tuple
import pytest
from _pytest.python_api import RaisesContext
from omegaconf import (
II,
Container,
DictConfig,
IntegerNode,
Node,
OmegaConf,
Resolver,
ValidationError,
grammar_parser,
)
from omegaconf._utils... |
import struct
import collections
class _enum_base(object):
numbers = None
bitshifts = None
def items(self):
ret = []
if self.numbers is None:
pass
elif isinstance(self.numbers, str):
vs = self.numbers.split()
ret += zip(vs, range(len(vs)))
elif isinstance(self.numbers, dict):
for k,v in self.num... |
"""
Windows XP functions
"""
from typing import Sequence, List, Tuple, Dict, Callable, Union, Optional
from ctypes import c_wchar_p, c_int
from ctypes import sizeof as c_sizeof
from ctypes import cast as c_cast
import atexit
from .windows_common import (
byref, create_unicode_buffer,
DWORD, UINT, LONG, CHAR, ... |
"""
The class TeSoProcess is a subclass of SoProcess and
should implement the Tennessee Eastman process by running
the simulation as a shared object.
Since the shared object used by Nils is just doing some
part we have to also implement the other part here.
Our part is solve the derivation so al... |
from __future__ import annotations
from copy import deepcopy
from functools import lru_cache
import requests
import ruamel.yaml as ryaml
from basedosdados.exceptions import BaseDosDadosException
from basedosdados.upload.base import Base
from ckanapi import RemoteCKAN
from ckanapi.errors import NotAuthorized, Validati... |
import os
import re
import argparse
import shutil
import xml.etree.ElementTree as ETree
import doc_utils.doc_tools as doc_tools
import doc_utils.api_tools as api_tools
from functools import partial
api = None
classes = None
functions = None
constants = None
enums = None
#
def now_as_iso_datetime():
#return date... |
# -*- coding: utf-8 -*-
"""
# --------------------------------------------------------
# @Project: torch-Face-Recognize-Pipeline
# @Author : panjq
# @E-mail : <EMAIL>
# @Date : 2019-12-31 09:11:25
# --------------------------------------------------------
"""
import glob
import os
import time
import os, shutil
import... |
from floem import *
n_cores = 1
nic_rx_threads = 10
nic_tx_threads = 1
rx_queues = 1
tx_queues = 1
#mode = 'dpdk'
mode = target.CAVIUM
class protocol_binary_request_header_request(State):
magic = Field(Uint(8))
opcode = Field(Uint(8))
keylen = Field(Uint(16))
extlen = Field(Uint(8))
datatype = Fi... |
from nintendo.common import crypto, util, socket, websocket, scheduler
import itertools
import hashlib
import hmac
import struct
import random
import time
import logging
logger = logging.getLogger(__name__)
TYPE_SYN = 0
TYPE_CONNECT = 1
TYPE_DATA = 2
TYPE_DISCONNECT = 3
TYPE_PING = 4
FLAG_ACK = 1
FLAG_RELIABLE = 2... |
import numpy as np
from numba import jit
import numpy.lib.recfunctions as rfn
##########################################################################
def count_hsps(blast_out):
"""Iterate over blast output. It considers that the output
is in outfmt 6 and that all the hsp should be one after the
other
... |
'''
Implementation of factor graph and (loopy) belief propagation algorithm.
Current approach (order matters):
- (1) add RVs
- (2) add factors to connect them
- (3) set potentials on factors
- (4) run inference
- (5) compute marginals
For some things below, we'll want to represent what's going on in mathema... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#!/usr/bin/env python
# coding: utf-8
# # Crypto Currency Analysis
#
# Crpytocurrency exchanges are websites that enable the purchase, sale, and exchange of crypto and traditional currencies. These exchanges serve the essential functions of providing liquidity for owners and establishing the relative of these currenc... |
import os
import torch
import math
from datetime import datetime
import numpy as np
from PIL import Image
import cv2
import matplotlib.pyplot as plt
import torch.nn.functional as F
import numpy
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker imp... |
from torch import var
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.load_buffer_real import *
from rlkit.samplers.data_collector import MdpPathCollector, \
CustomMDPPathCollector
from rlkit.torch.sac.policies import TanhGaussianPolicy, GaussianPolicy, MakeDeterministic
from rlkit.torch.sac.cql ... |
import astral
import csv
import datetime
import math
import os
import random
import re
import statistics
def load_historical_data_headers():
"""Load the headers for historical weather data."""
with open(os.path.dirname(os.path.realpath(__file__)) + '/../data/1711054.csv') as f:
reader = csv.reader(f)
... |
"""Model of wireless overlay networks"""
from typing import List, Tuple, Iterable
from collections import defaultdict
import math
import networkx as nx
from infrastructure import InfrastructureNetwork
from overlay import OverlayNetwork
DEBUG = False
class ENode:
"""A node representing a possible or actual emb... |
######################################################################
# CliNER - model.py #
# #
# <NAME> #
# ... |
import re
import mido
import warnings
import functools
import collections
import numpy as np
from copy import deepcopy
from .containers import KeySignature, TimeSignature, Lyric, Note, PitchBend, ControlChange, Instrument, TempoChange, Marker
DEFAULT_BPM = int(120)
class MidiFile(object):
def __init__(self, fil... |
import numpy as np
import cv2
import matplotlib.pyplot as plt
import os
nx = 9 # number of horizontal corners on the chessboard
ny = 6 # number of vertical corners on the chessboard
# each object point for calibration i.e. (0,0,0), (1,0,0), (2,0,0) ....,(7,6,0)
obj_point = np.zeros((ny*nx, 3), np.fl... |
from .functions import defun, defun_wrapped
def _hermite_param(ctx, n, z, parabolic_cylinder):
"""
Combined calculation of the Hermite polynomial H_n(z) (and its
generalization to complex n) and the parabolic cylinder
function D.
"""
n, ntyp = ctx._convert_param(n)
z = ctx.convert(z)
q ... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import sys
from col... |
# Copyright (c) 2016-2019, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions ... |
from itertools import combinations
from typing import List
import numpy as np
from extremitypathfinder.helper_classes import AngleRepresentation, PolygonVertex
# TODO numba precompilation of some parts possible?! do line speed profiling first! speed impact
def inside_polygon(x, y, coords, border_value):
# shoul... |
"""Aries-Askar implementation of BaseWallet interface."""
import asyncio
from collections import OrderedDict
import json
import logging
from typing import Optional, List, Sequence, Tuple, Union
from aries_askar import (
crypto_box,
AskarError,
AskarErrorCode,
Key,
KeyAlg,
Session,
)
from arie... |
import tensorflow as tf
import numpy as np
from net.ops import random_bbox, bbox2mask, local_patch
from net.ops import priority_loss_mask
from net.ops import gan_wgan_loss, gradients_penalty, random_interpolates
from net.ops import free_form_mask_tf
from net.vgg import Vgg19
from util.util import f2uint
from functools ... |
import requests
from flask import current_app
from werkzeug.exceptions import BadRequest, Forbidden, InternalServerError, NotFound, ServiceUnavailable, Unauthorized
from datetime import datetime
from dateutil.tz import *
import dateutil.parser
import json
import logging
import pytz
import urllib
from jm_utils import p... |
import contextlib
import io
import os
import subprocess
import sys
import textwrap
from contextlib import ExitStack as does_not_raise # noqa: N813
from io import UnsupportedOperation
from typing import BinaryIO
from typing import Generator
import pytest
from _pytask import capture
from _pytask.capture import _capture... |
# Copyright 2010 <NAME>
# Copyright 2011 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/LICENS... |
from dataclasses import dataclass
from types import FunctionType
import numpy as np
import pytest
from pytest import mark
from myia import xtype
from myia.abstract import from_value, ndarray_aliasable
from myia.api import myia
from myia.debug.finite_diff import GradTester, NoTestGrad, clean_args
from myia.operations ... |
# Copyright 2018 Comcast Cable Communications Management, LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law... |
"""
Pulsar search analysis
"""
import os, glob
import numpy as np
import pylab as plt
import matplotlib.ticker as ticker
import pandas as pd
from astropy.io import fits
from skymaps import SkyDir, Band
from . import (sourceinfo, associations, _html, fermi_catalog)
from .. import tools
from analysis_base import html_... |
#!/usr/bin/python
# Classification (U)
"""Program: mongo_rep_admin.py
Description: Administration program for Mongo replica set. The program
has a number of functions to monitor the status of replication between
primary and secondary databases. The program can monitor and check on
a nu... |
# --- built in ---
import enum
from dataclasses import dataclass
from typing import (
Any,
Callable,
Dict,
Tuple,
Union,
Optional
)
# --- 3rd party ---
import numpy as np
import torch
from torch import nn
import torch_scatter
# --- my module ---
# ======== Utils =========
__all__ = [
'NINF',
'Reductio... |
#!/usr/bin/env python
""" Discovery UBNT and MikroTik devices is local network """
import sys
import logging
import json
import argparse
import csv
import time
from concurrent.futures.thread import ThreadPoolExecutor
import scapy.all
from scapy.config import conf
conf.use_pcap = True
from netifaces import ifaddres... |
"""Code parsing for Coverage."""
import glob, opcode, os, re, sys, token, tokenize
from coverage.backward import set, sorted, StringIO # pylint: disable-msg=W0622
from coverage.bytecode import ByteCodes, CodeObjects
from coverage.misc import nice_pair, CoverageException, NoSource, expensive
class CodeParser(object)... |
# Owner(s): ["module: nn"]
from functools import partial
from itertools import product, chain
import unittest
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import CrossEntropyLoss
from torch.nn.utils._per_sample_grad import call_for_per_sample_grads
from torch.testing._internal.comm... |
# -*- coding: UTF-8 -*-
# Copyright 2009-2019 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Defines the `TableRequest` class.
"""
from __future__ import division
from __future__ import print_function
# from future import standard_library
# standard_library.install_aliases()
from builtins import str
... |
"""
The itsdb module makes it easy to work with [incr tsdb()] profiles.
The ItsdbProfile class works with whole profiles, but it generally
relies on the module-level functions to do its work (such as
get_relations() or decode_row()). Queries over profiles can be
customized through the use of filters (see filter_rows())... |
import math
import bpy, mathutils, bmesh
from .. import xray_io
from ..level import swi as imp_swi, create as level_create
from . import fmt
class Visual(object):
def __init__(self):
self.visual_id = None
self.format_version = None
self.model_type = None
self.shader_id = None
... |
import pickle
import os
from collections import defaultdict
import logging
import torch
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import random
import umap
import numpy as np
import time
from .data_loader import generate_id_neighbor as gin
def setup_logging(log_file, console=True):
logging... |
from . import reporting
from glob import glob
# import io
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from tifffile.tifffile import imread, imsave
from . import bcolors
import shutil
import os
from pathlib import Path
import csv
from skimage.metrics import structural_similarity
import nu... |
import argparse
import glob
import os
import sys
import time
from itertools import product, permutations
import matplotlib.pyplot as plt
import multiprocessing as mp
import numpy as np
import pandas as pd
import seaborn as sns
import statsmodels.nonparametric.api as smnp
import swifter
N_PROC = 1
CHUNK = 25
MIX = ... |
import os
import warnings
warnings.filterwarnings("once", category=DeprecationWarning) # noqa: E402
import pytest
salem = pytest.importorskip('salem')
gpd = pytest.importorskip('geopandas')
import oggm
import xarray as xr
import numpy as np
import pandas as pd
from oggm import utils
from oggm.utils import get_demo_f... |
import torch
import torch.nn
from apex import amp
import os
#import fire
from tqdm import tqdm
from pprint import pprint
import json
from sklearn.metrics import precision_recall_fscore_support
from .model import RGEM, BilinearModel, ConcatModel, XLMForMTBFineTuning, AutoModelForRelationExtraction
from .dataset import... |
# ogrFromBCGW_BCGOV_FINAL2.py
# gamos 06/12/2019 (DD/MM/YY format)
# <EMAIL>
# GIS Technician (auxiliary) / Kootenay Boundary Region / Ministry of Forests, Lands and Natural Resource Operations and Rural Development
# Script to create and execute an ogr2ogr CLI string - i.e translate a BCGW subset into one of several... |
# Copyright 2012 OpenStack LLC.
# 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 b... |
import numpy as NP
import scipy as sp
import scipy.linalg as LA
import numpy.linalg as nla
import os
import sys
import glob
sys.path.append("./../../pyplink")
from fastlmm.pyplink.plink import *
from pysnptools.util.pheno import *
from fastlmm.util.mingrid import *
#import pdb
import scipy.stats as ST
import fastlmm.ut... |
import os, sys
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import numpy as np
from .kdtree import make_cKDTree
from utils.kcnet_utils import Netpara, debugPrint
# global writer
global_step = 0
class KDNet(nn.Module):
def __i... |
import re
from lxml import html
import json
from bs4 import BeautifulSoup
import difflib
import sys
from MyParser import MyHTMLParser, DifferentLines
PLACE_HOLDER = "#text"
PH_SCRIPT = "#script"
SHORTEN_ATTRIBUTES = ["style", "itemprop", "itemtype", "data-photo-count", "onmousedown", "onclick", "href", "data-io-artic... |
import sys
from collections import Counter # tmp
import numpy as np
import chainer
from chainer import cuda
import classifiers.hybrid_sequence_tagger
import common
import constants
from data_loaders import segmentation_data_loader, tagging_data_loader
import dictionary
from evaluators.hybrid_unit_segmenter_evaluator... |
'''
Filename: config.py
Project: image2katex
File Created: Wednesday, 5th December 2018 5:32:00 pm
Author: xiaofeng (<EMAIL>)
--------------------------
Last Modified: Wednesday, 5th December 2018 5:32:04 pm
Modified By: xiaofeng (<EMAIL>)
---------------------------
'''
import logging
import os
from math import ceil
... |
# -*- coding: utf8 -*-
#
# Module NUMERIC
#
# Part of Nutils: open source numerical utilities for Python. Jointly developed
# by HvZ Computational Engineering, TU/e Multiscale Engineering Fluid Dynamics,
# and others. More info at http://nutils.org <<EMAIL>>. (c) 2014
"""
The numeric module provides methods that are l... |
import re
import os
import sys
import gtk
import time
import pango
import gobject
import gtk.glade
import threading
import commands
import Queue
import GlobalConfig
import PLogger
import LocalJobSpec
gobject.threads_init()
gtk.gdk.threads_init()
# thread to synchronize database in background
class Synchronizer(th... |
import numpy as np
from util.stats import *
# ====================================================================
# util.stats
# ====================================================================
def _test_mpca(display=False):
if display:
print()
print("-"*70)
... |
import os
import re
import sys
import time
import traceback
from zipfile import ZipFile
import hashlib
import datetime
import dateutil.parser as parser
import pandas
from lxml import etree
from lxml.etree import Element
from unidecode import unidecode # GPLV2
import sqlalchemy
from sqlalchemy import desc
from billp... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 2 00:03:13 2020
This code allows the user to input a series of clues to a sudoku puzzle, and
will output the (possibly partially) solved puzzle. Any unsolved squares will
be displayed as zeros in the output. The script will not fully solve a puzzle
that is not fully dete... |
import os
import numpy as np
import tensorflow as tf
# tf.logging.set_verbosity(tf.logging.INFO)
import pdb
from tqdm import trange
from parse import load_data
class FRRN():
def __init__(self, x_shp, model='A'):
self.Training = True
self.x_shp = x_shp
self.num_class = 12 # we will have a... |
"""Models for tables not included in UCR, generated for our system
`models.py` is meant to simply reflect the tables as they exist in UCR
itself; `cdemodels.py` extends those model classes. *These* models, on
the other hand, must actually be generated in our system.
"""
from copy import deepcopy
import logging
from p... |
import tensorflow as tf
import numpy as np
import os, csv, time, json, pickle, random
from sklearn.metrics import roc_auc_score, f1_score
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_selection import chi2, SelectKBest
from sklearn.pipeline import Pipeline
from nltk.stem import Porter... |
'''
mode: <NAME>
<EMAIL>
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from model.faster_rcnn.faster_rcnn import _fasterRCNN
import pdb
input_size=[480, 640]
width_mult = 1.
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# class FrozenBatchNorm2d(nn.Mod... |
import sys
import pygame
import random
import time
from pygame.sprite import Sprite
from pygame.sprite import Group
class Settings():
def __init__(self):
self.bg_color = (0, 0, 0)
self.screen_width = 1200
self.screen_hight = 800
self.caption = "Alien Invasion"
self.bullet_sp... |
from contextlib import closing
from subprocess import Popen
from subprocess import PIPE
import argparse
import socket
import psutil
import distro
import os
import re
OS_VALUES = {
'rhel': {
'versions': ['7.2', '7.3', '7.4', '7.5'],
},
'debian': {
'versions': ['16.04'],
},
'suse':... |
"""
Reports gather inputs, outputs, and intermediate computations in a nicely formatted way for convenient manual inspection.
To support reporting, the models providing the data to be reported must subclass ``Reportable`` and call
``self.report_sent_info(d)`` with key/value pairs containing the data to be reported at ... |
from typing import Union, Optional, Iterable, Tuple, Mapping
import argparse
import pathlib
import os
import json
from datetime import datetime
import uuid
import soundfile
from tqdm import tqdm
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
i... |
# -*- coding: utf-8 -*-
#
# A module to interface with PullString's Web API.
#
# Copyright (c) 2016 PullString, Inc.
#
# The following source code is licensed under the MIT license.
# See the LICENSE file, or https://opensource.org/licenses/MIT.
#
"""
PullString Python SDK
This package provides a module to access the... |
import tkinter as tk
from tkinter import ttk, simpledialog
import pylogix
import ast
import datetime
import xml.etree.cElementTree as et
from xml.dom import minidom
''' This is a tool that creates a simple GUI for pylogix. This will allow connections only to
Rockwell ControlLogix, CompactLogix, and Micro800's PLCS... |
p = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff
a = 0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc
b = 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
xG = 0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296
yG = 0x4fe342e2fe1a7f9b8ee7eb4a7... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
import numpy as np
class GPT2Config():
def __init__(
self,
vocab_size=21128,
n_positions=1024,
n_ctx=1024,
n_embd=768,
n_layer=12,
n_head=12,
n_inner=None,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.