text stringlengths 8.04k 46.5k |
|---|
"""OpenMC transport operator
This module implements a transport operator for OpenMC so that it can be used by
depletion integrators. The implementation makes use of the Python bindings to
OpenMC's C API so that reading tally results and updating material number
densities is all done in-memory instead of through the fi... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Generic functions for use with GEOS-Chem's planeflight diagnostic module
"""
# compatibility with both python 2 and 3
from __future__ import print_function
# - Required modules:
# I/O functions / Low level
import sys
import csv
import glob
import pandas as pd
import loggin... |
import wx.grid as gridlib
import pandas as pd
import numpy as np
import copy
import ciw
import re
import math
import statistics
import random
import imp
adapt = imp.load_source('adapt', 'src/adapt.py')
summary = imp.load_source('summary', 'src/Summary.py')
cluster = imp.load_source('cluster', 'src/clustering.py')
tra... |
"""Class for cross-validation over distributions of hyperparameters
-- <NAME> and <NAME>
"""
import logging
from tune_sklearn.utils import check_is_pipeline
from tune_sklearn.tune_basesearch import TuneBaseSearchCV
from tune_sklearn._trainable import _Trainable
from tune_sklearn._trainable import _PipelineTrainable... |
import sys
import ctypes
from PIL import Image
Image.MAX_IMAGE_PIXELS = None
import cv2
import numpy as np
#from pyassimp import load, release
from gibson2.core.render.mesh_renderer.glutils.meshutil import perspective, lookat, xyz2mat, quat2rotmat, mat2xyz, \
safemat2quat, xyzw2wxyz
from transforms3d.quaternions ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import random
from odoo import api, models, fields, tools, _
from odoo.http import request
from odoo.exceptions import UserError, ValidationError
_logger = logging.getLogger(__name__)
class SaleOrder(mo... |
""" Fitting of various models. """
import warnings
import operator
import matplotlib.pyplot as plt
import numpy as np
import scipy
from typing import Tuple, Dict, Any
from lmfit.model import Model, ModelResult
from qcodes.data.data_array import DataArray
import qtt.pgeometry
from qtt.algorithms.functions import Fer... |
# -*- coding: utf-8 -*-
# (C) Copyright 2014 Voyager Search
#
# 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 l... |
# Copyright 2017 The dm_control 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 i... |
import os
import re
import csv
import h5py
import glob
import shutil
import random
import numpy as np
import tensorflow as tf
import tensorflow.keras.backend as B
num_classes = [2, 1] # grapy, edges
def extract_edges(mask):
edges = tf.image.sobel_edges(mask)
boundary = tf.zeros([256, 192, 1])
for i in r... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import datetime
import logging
import os
import pprint
import numpy as np
import tensorflow as tf
from sklearn import metrics
from tensorflow.python.saved_model import builder as saved_model_builder
from tensorflow.python.saved_model import (
signature_constants, si... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
#!/usr/bin/env python3
import hashlib
import json
import jsonschema
import os
import pathlib
import requests
import shutil
import stat
import sys
try:
from xpload_config import *
except ImportError:
__version__ = "0.0.0-notinstalled"
XPLOAD_CONFIG_SEARCH_PATHS = [".", "config"]
pass
general_schema =... |
#!/usr/bin/python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import re
import collections
import gdb
import pwngef.config
import pwngef.commands
from pwngef.commands import GenericCommand
import pwngef.commands.registers
from pwnge... |
from abc import abstractmethod
from typing import Dict, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from transformers import AutoModel, AutoConfig
from .layers import WordSequence
class BackBone(nn.Module):
def __init__(self, n_class, binary_mode=F... |
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at:
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... |
from .ahdl import *
from .ahdlhelper import AHDLVarReplacer
from .ahdlusedef import AHDLUseDefDetector
from .block import Block
from .ir import *
from .stg import State, STGItemBuilder, ScheduledItemQueue
class PipelineState(State):
def __init__(self, name, nstate, first_valid_signal, stg, is_finite_loop=False):
... |
import functools
__all__ = [
"_C_ARY_B",
"_C_ARY_E",
"_C_BFLD",
"_C_BOOL",
"_C_BYCOPY",
"_C_BYREF",
"_C_CHARPTR",
"_C_CHR",
"_C_CLASS",
"_C_CONST",
"_C_DBL",
"_C_FLT",
"_C_ID",
"_C_IN",
"_C_INOUT",
"_C_INT",
"_C_LNG",
"_C_LNG_LNG",
"_C_ONEWAY",
"_C_OUT",
"_C_PTR",
"_C_SEL",
"_C_SHT",
"_C_STRUCT... |
#===============================================================================
#
# Flatmap viewer and annotation tools
#
# Copyright (c) 2019 <NAME>
#
# 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 t... |
import socket
import sys
from datetime import datetime, timedelta
from Queue import Empty
from kombu.transport.base import Message
from kombu.connection import BrokerConnection
from celery.utils.timer2 import Timer
from celery.app import app_or_default
from celery.concurrency.base import BasePool
from celery.excepti... |
import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
from random import randint,random
import networkx as nx
import matplotlib.pyplot as plt
import torch
import pickle,os,math
import scipy.sparse as sparse
from collections import Counter
from matplotlib.ticker import MaxNLocator
from sklearn.cluster... |
import sys
import os
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5 import QtCore, QtGui, QtWidgets
import torch
import numpy as np
import cv2
from src.data import process
from src.model import models
from src.ui import MainWindow
import random
import types
BRUSH_MULT = ... |
from dataclasses import dataclass, field
from typing import List
from string import Template
import subprocess
from xml.sax import saxutils
import json
def get_version_tag():
tag = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'])
return tag.decode(encoding='ascii').rstrip()
@dataclass
class ... |
# -*- coding: utf-8 -*-
import numpy as np
from .utils import fft, ifft, ifftshift, FFT_GLOBAL
from .utils import WARN, adm_cwt, adm_ssq, _process_fs_and_t
from .utils import padsignal, process_scales, logscale_transition_idx
from .utils import backend as S
from .utils.backend import Q
from .algos import replace_at_inf... |
from struct import pack, Struct
from collections import defaultdict
from typing import List, Dict, Tuple, Union, Any
from pyNastran.bdf.cards.collpase_card import collapse_thru_packs
from pyNastran.op2.errors import SixtyFourBitError
from .geom1_writer import write_geom_header, close_geom_table
def write_geom4(op2_fi... |
import random
def translate_n_seq():
dna_typed = []
rna_typed = []
dna_match = []
reader = 0
base_list = 'a','t','g','c','u'
ans1 = input("Random dna sequence? y/n")
if ans1 == 'y':
print("Choose length:")
seq_len = int(input())
input_seq = "".join(random.choices(ba... |
from __future__ import print_function
import xml.dom.minidom as dom
import os
import re
import numpy as np
from properties import Properties
import dbconnect
import wx
import logging
logging.basicConfig(level=logging.DEBUG)
# PER-IMAGE DATA
# output/<image dir>/ImageIndex.ColumbusIDX.xml
# -- referenced from output/Me... |
import inspect
import os
import warnings
from unittest.mock import MagicMock, patch
import numpy as np
import pandas as pd
import pytest
import woodwork as ww
from evalml.model_understanding.graphs import visualize_decision_tree
from evalml.pipelines.components import ComponentBase
from evalml.utils.gen_utils import ... |
from __future__ import division
from __future__ import print_function
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : train.py
@Contact : <EMAIL>
@Modify Time : 2022/4/7 20:01
------------
"""
''''
Main function for traininng DAG-GNN
'''
import time
import argparse
import pickle
... |
import cv2
import numpy as np
from collections import deque
import json
LEN_TOL = 5000
CELL_HEIGHT_TOL = 50 # depend on size of image
CELL_WIDTH_TOL = 100 # depend on size of image
NON_LN_TOL = 50000
LN_SPACE = 35
LN_NONE = 10
WRD_SPACE = 100
WRD_NONE = 1000
MIN_NUM_LN = 3
MIN_LEN_LN = 100000
OFFSET = 5
EPS = 0.01
... |
import json
from datetime import date, timedelta
from django.conf import settings
import waffle
from mock import patch
from nose.tools import eq_
from pyquery import PyQuery as pq
import amo
import amo.tests
from addons.models import AddonCategory, AddonDeviceType, Category
from amo.utils import urlparams
from amo.u... |
"""
Backend database modules for SKA SDP configuration information.
At the moment we only support etcd3.
"""
import time
import queue as queue_m
import etcd3
# Some utilities for handling tagging paths.
#
# The idea here is that etcd3 only supports straight-up prefix
# searches, but we do not want to get "/a/b/c" ... |
#!/usr/bin/env python3
# Import modules
from scipy import optimize
import numpy as np
import sys, os
import pandas as pd
import collections
import itertools
import argparse
import re
# Define functions
def sWrite(string):
sys.stdout.write(string)
sys.stdout.flush()
def sError(string):
sys.stderr.write(s... |
"""
Basically a contains parser that is faster, because it tries to parse only
parts and if anything changes, it only reparses the changed parts.
It works with a simple diff in the beginning and will try to reuse old parser
fragments.
"""
import re
import difflib
from collections import namedtuple
import log... |
# Inspired by https://deap.readthedocs.io/en/master/examples/gp_symbreg.html
# it is used by search.py
import os
import random
import copy
import math
import time
import json
import numpy as np
from deap import gp # gp.PrimitiveSet, gp.genHalfAndHalf, gp.PrimitiveTree, gp.genFull, gp.from_string
import interpret
imp... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import constant_init, kaiming_init
from ...core.utils import load_checkpoint, inflate_weights
from ...core.ops import (Dropout, Conv3d, HSigmoid, HSwish, conv_kxkxk_bn, conv_1xkxk_bn,
conv_kx1x1_bn, co... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import copy
import os
import datetime
import shutil
from collections import OrderedDict
from itertools import product
import yaml
from numpy import uint8 # noqa: F401 (used in evaluated strings)
CURRENT_DIR = os.path.dirname(os... |
import json
import logging
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.colors import LogNorm
from pylossmap import BLMData
# from tensorflow.keras.utils import Sequence
from tqdm.auto import tqdm
U... |
try:
import argparse
import requests
import configparser
from requests.auth import HTTPDigestAuth
import json
import time
import subprocess
import copy
import logging
import pymongo
import urllib3
import os
import sys
import datetime
import re
from pprint import pprint
from bson.json_u... |
# coding=utf-8
# Copyright 2021 The Balloon Learning Environment 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 require... |
from django.core.exceptions import ValidationError
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_str
DATA_FILES = './data_files/'
MIXED_OPEN = 'Mixed Open'
MEN_OPEN = ... |
__author__ = 'thorwhalen'
from bs4 import BeautifulSoup
import re
# import os.path
# from urllib2 import urlopen
# from ut.pfile import to
from lxml import etree
import tldextract
import ut.parse.util as util
from urllib.parse import urlparse, parse_qs
from ut.util import extract_section
# RE_HAS_NEW_LINE = re.compi... |
import pygame, random, sys, pickle
from pygame.locals import *
costPerTree = 0
fullness = 20
blood = 20
screenWidth = 800
screenHeight = 600
WHITE = (255,255,255)
NAVYBLUE = (0,0,128)
SKYBLUE = (112,228,255)
BLACK = (0,0,0)
CLOCK = pygame.time.Clock()
FPS = 20
class Item(object):
def __init__(self... |
import warnings
import numpy as np
import quaternionic
import pytest
algebra_pyufuncs = type('AlgebraPyufuncs', (object,), dict())()
quaternionic.utilities.pyguvectorize_module_functions(quaternionic.algebra, algebra_pyufuncs)
def test_basis_multiplication():
# Basis components
one, i, j, k = tuple(quaterni... |
from edl.util import parseMapFile
from edl.taxon import getNodeFromHit, \
getAncestorClosestToRank, \
readTaxonomy, \
add_taxonomy_dir_argument
from edl.blastm8 import filterM8Stream, \
FilterParams, \
for... |
from django.shortcuts import get_object_or_404
from django.forms.models import modelform_factory
from django.db.models import Count
from django.http import Http404, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.conf import settings
from django.core.paginator import Paginator... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import version_info
from base64 import b64encode, b64decode
from binascii import hexlify, unhexlify
__all__ = ['encrypt_ecb', 'decrypt_ecb',
'encrypt_cbc', 'decrypt_cbc',
'encrypt', 'decrypt']
if version_info[0] == 2:
# python2
... |
"""This module contains implementations for storing simulated values for later use."""
import io
import logging
import os
import pickle
import shutil
import numpy as np
import numpy.lib.format as npformat
logger = logging.getLogger(__name__)
_default_prefix = 'pools'
class OutputPool:
"""Store node outputs to... |
from jqdata import *
import numpy as np
import pandas as pd
import talib as ta
from math import isnan, floor
from math import atan
import tushare as ts
# 股票池来源
class Source(Enum):
AUTO = 0 # 程序根据波动率及股价自动从沪深300中获取股票
CLIENT = 1 # 使用用户提供的股票
g.stocks_source = Source.CLIENT # 默认使用自动的方法获得股票
g.stock_id_list_fr... |
""" This contains Thiel analysis plots """
from os import read, path
# import px4tools
import numpy as np
import math
import io
import os
import sys
import errno
import base64
from db_entry import *
import pickle
import simstats # this the module that you can modify to add your own stats
#import thiel_analysis
fr... |
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import Max
from django.utils import formats
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy, ugettext_noop
from jsonfield i... |
import warnings
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, xavier_init
from mmcv.runner import auto_fp16, BaseModule
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from ..builder import NECKS
class GroupAttention(BaseModule):
def __init_... |
"""Flask web views for Caravel"""
from datetime import datetime
import json
import logging
import re
import time
import traceback
from flask import (
g, request, redirect, flash, Response, render_template, Markup)
from flask.ext.appbuilder import ModelView, CompactCRUDMixin, BaseView, expose
from flask.ext.appbui... |
"""
localization_detection.py
This script contains all methods used for localization and detection.
- parse_annotations: groundtruth localization, based on metadata annotation parsing
- ld_oracle: wrapper for parse_annotations methor
- ld_basic: diffuseness mask and simple event grouping by temporal continuity
- ld_ba... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import zmq
import collections
from datetime import datetime
import threading
from mql5_zmq_backtrader.adapter import PositionAdapter, OrderAdapter, BalanceAdapter
import backtrader as bt
from backt... |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 16 16:13:39 2021
@author: ruizca
"""
import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord, FK5
from astropy.table import Table, unique, join
from astropy.utils.console import color_print
from astropy_he... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
'''
Does Covid 19 contact tracing analysis on data of the form:
<name, latitude, longitude, date, time, condition>
where name = name of the person, latitude & longitude are the geographical coordinates, date
& time are the time stamp when those coordinates were recorded and finally condition indicates
whether this per... |
"""
Functions to handle h5 save and load with all types present in python.
Currently, deepdish is still used due to dependecy issues with old files,
however it will be deprecated in future releases
"""
import os
import platform
from pathlib import Path, PureWindowsPath
from collections import UserDict
from datetime imp... |
#!/usr/bin/env python
# filename: batch_cellranger.py
#
# Copyright (c) 2015 <NAME>
# License: The MIT license (http://opensource.org/licenses/MIT)
#
# 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 So... |
#! /usr/bin/env python
# -*- coding:utf-8 -*-
import smach
import smach_ros
import rospy
import numpy as np
import tf
import math
import cv2
import time
from geometry_msgs.msg import Twist, Vector3, Pose
from nav_msgs.msg import Odometry
from sensor_msgs.msg import Image, CompressedImage, LaserScan, Imu
from turtlebot... |
# -*- coding: utf-8 -*-
# (c) 2008-2010, <NAME>
"""
Create and parse XMind maps.
"""
from lxml import etree
import zipfile
from .id_gen import IdGen, qualify_id, unique_id
from .xmlutil import XmlHelper, ns_name, \
CONTENT_NSMAP, STYLES_NSMAP, find_xpath
import logging
log = logging.getLogger(__name__)
DUMP_PAR... |
#!/usr/bin/env python3
###################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: train_classifier.py
# Authors: <NAME>
#
# Requires: Python 3.x
#
#####################################################################... |
from matplotlib.pyplot import plot
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
import os
import csv
from tripedal_kinematics import TripedalKinematics
COS120 = math.cos(math.pi * 2 / 3)
SIN120 = math.sin(math.pi * 2 / 3)
COS240 = math.cos(-math.... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import numpy as np
import pickle, re, os
import acq4.Manager
import collections
import acq4.util.functions as functions
import acq4.util.advancedTypes as advancedTypes
import acq4.util.debug as debug
from acq4.util import Qt
import six
from six.moves import ... |
"""
@author: <NAME> (University of Sydney)
-------------------------------------------------------------------------
AMICAL: Aperture Masking Interferometry Calibration and Analysis Library
-------------------------------------------------------------------------
Function related to data cleaning (ghost, background c... |
"""
1 - Reads the csv files that contain all the coordinates of apple, stem, gravity and origin
2 - Obtains the angles: Hand-to-Stem, Hand-to-Gravity and Stem-to-Gravity which are the key
to replicate a pick
3 -
Some references
https://stackoverflow.com/questions/11140163/plotting-a-3d-cube-a-sphere-and-a-vector-i... |
import math
from datetime import timedelta, datetime
from django.core.cache import cache
from django.db import models
from django.db.models import F, Prefetch
from django.dispatch import receiver
from django.db.models.signals import post_delete, post_save
from django.contrib.auth.models import User
from django.utils.t... |
"""
Generalized Transport Velocity Formulation
##########################################
Some notes on the paper,
- In the viscosity term of equation (17) a factor of '2' is missing.
- A negative sign is missing from equation (22) i.e, either put a negative
sign in equation (22) or at the integrator step equation(... |
# Author: <EMAIL>
# <NAME>
# Date: 20-Oct-2015
# ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# File modified: <NAME> #
# Date: 3/10/2019 #
# #########################################... |
# Copyright 2017 The Wallaroo 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 ... |
"""
wrapper for imagej and python integration using ImgLyb
"""
# TODO: Unify version declaration to one place.
# https://www.python.org/dev/peps/pep-0396/#deriving
__version__ = '0.6.0.dev0'
__author__ = '<NAME>, <NAME>, <NAME>'
import logging, os, re, sys
import scyjava_config
import jnius_config
from pathlib impor... |
######################################
## save_and_check_Phase1.py ##
## <NAME> ##
## Version 2020.04.21 ##
######################################
# This is based on Linc's save_and_check_twopoint.
# It has been adapted to make .fits files for the Phase1 r... |
import unittest
import os
import logging
from models.client import ClientDAO, Client
from models.db import DbDAO, DB
from models.insurance import InsuranceDAO, Insurance
from models.invoice import InvoiceDAO, Invoice
from models.profile import ProfileDAO, Profile
from models.quotation.quotation import QuotationDAO, Quo... |
"""
Modeling Pipeline
Author: <NAME>
Email: <EMAIL> | <EMAIL>
"""
import gc
import os
import random
import copy
import torch
import torch.nn as nn
from sklearn import metrics
from torch.optim.lr_scheduler import *
from torch.optim.optimizer import Optimizer
from datautils.datahandler import DataHandler
from builder ... |
# Copyright (c) 2022 PaddlePaddle 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 appli... |
#!/usr/bin/python3
# -*- encoding="UTF-8" -*-
#Import Package
import numpy as np
from tkinter.messagebox import *
import parameters
from Functions.string2num import string2num
def getOutTitleDC():
if len(parameters.listDCParam) == 1:
paramName = parameters.listDCParam[0].paramName
WriteString = ... |
from selenium import webdriver, common
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import math
import time
import os
import demjson
driver = None
all_pokemon_data = demjson.decode(open('pokemon_data.txt', 'r').read())
own_team = []
opponent_team = [N... |
'''
This module contains all the functions that will parse a particular dataset
into a `target_extraction.data_types.TargetTextCollection` object.
Functions:
1. semeval_2014
'''
import json
from pathlib import Path
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import Element
from xml.etree.ElementTree... |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
#
# scapy.contrib.description = IEC-60870-5-104 APCI / APDU layer definitions
# scapy.contrib.status = loads
"""
IEC 60870-5-104
~~~~~~... |
"""
See https://github.com/deepset-ai/haystack/issues/955 for further context
"""
import os
import logging
from copy import deepcopy
from typing import Dict, Generator, List, Optional, Union
import numpy as np
from elasticsearch.helpers import bulk, scan
from tqdm.auto import tqdm
from haystack.utils import get_batche... |
# Copyright 2016 <NAME>
# Governed by the license described in LICENSE.txt
import libtcodpy as libtcod
import cProfile
import scipy.spatial.kdtree
import config
import algebra
import map
import log
from components import *
import miscellany
import bestiary
import ai
import actions
import spells
import quest
import co... |
"""Pre-process accessibility-based provincial OD matrix
Purpose
-------
Create province scale OD matrices between roads connecting villages to nearest communes:
- Net revenue estimates of commune villages
- IFPRI crop data at 1km resolution
Input data requirements
-----------------------
1. Correct paths to... |
"""
gamd.py: Implements the GaMD integration method.
Portions copyright (c) 2020 University of Kansas
Authors: <NAME>, <NAME>
Contributors: <NAME>
"""
from __future__ import absolute_import
__author__ = "<NAME>"
__version__ = "1.0"
from simtk import unit as unit
from abc import ABCMeta, ABC
from abc import abstrac... |
import torch
from torch.utils.data.dataset import Dataset
from torchvision import transforms
import torchvision.transforms.functional as TF
import numpy as np
from PIL import Image, ImageFilter, ImageDraw
import pandas as pd
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import cm
import matplotlib.pyplot a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
MCMC-estimation of status transition rates from IUCN record
Created on Mon Oct 28 14:43:44 2019
@author: <NAME> (<EMAIL>)
"""
import numpy as np
np.set_printoptions(suppress=True)
import pandas as pd
import os,sys
import datetime
from scipy.optimize import curve_fit
... |
import numpy as np
import scipy
import scipy.special
import scipy.interpolate
import pickle
import sklearn
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import MySQLdb
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
import sqla... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position, too-many-locals
"""
Create time- and DOM-independent (TDI) whole-detector Cartesian-binned Retro
table.
The generated table is useful for computing the total charge expected to be
deposited by a hypothesis across the entire detecto... |
# Copyright 2013 <NAME> & individual contributors
#
# 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 la... |
#!/usr/bin/env python
#
# Copyright 2014 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.
from __future__ import print_function
import collections
import multiprocessing
import optparse
import os
import platform
import re
... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
#!/usr/bin/env python
__doc__ = '''Assign new working names to glyphs based on csv input file
- csv format oldname,newname'''
__url__ = 'http://github.com/silnrsi/pysilfont'
__copyright__ = 'Copyright (c) 2017 SIL International (http://www.sil.org)'
__license__ = 'Released under the MIT License (http://opensource.org/l... |
import os
import random
import argparse
import logging
import json
import time
import multiprocessing as mp
import scipy.sparse as ssp
from tqdm import tqdm
import networkx as nx
import torch
import numpy as np
import dgl
#os.environ["CUDA_VISIBLE_DEVICES"]="1"
def process_files(files, saved_relation2id, add_traspose... |
# -*- coding: utf-8 -*-
import time
import subprocess
import digitalio
import board
from PIL import Image, ImageDraw, ImageFont
import adafruit_rgb_display.st7789 as st7789
import requests
#####################################################################################################
# You can disable panels th... |
from collections import defaultdict
import copy
from enum import Enum
import hashlib
import json
# From UD v2: https://universaldependencies.org/u/pos/
class Pos(Enum):
UNKNOWN = 0
# Open class
ADJ = 1
ADV = 2
INTJ = 3
NOUN = 4
PROPN = 5
VERB = 6
# Closed class
ADP = 7
AUX = 8
CCONJ = 9
DET =... |
#main class handles user input and current gameState class
import pygame as p
import shogiEngine1
import os
import copy
import Piece
import Menu
height = 1057 #defines the board resolution
width = 1920
sq_size = 66
x_offset = 459
y_offset = 243
scale = 1
p.font.init()
myfont = p.font.SysFont('Comi... |
## -*- coding: utf-8 -*-
from joern.all import JoernSteps
from igraph import *
from .general_op import *
import pickle
from py2neo.packages.httpstream import http
http.socket_timeout = 9999
def get_all_use_bydefnode(db, node_id):
query_str = "g.v(%d).in('USE')" % node_id
results = db.runGremlinQuery(query_str)... |
# -*- coding: utf-8 -*-
import base64
from datetime import datetime
from xml.dom import minidom
from django.conf import settings
from django.core.cache import cache
from nose.tools import eq_, ok_
from olympia import amo
from olympia.amo.tests import TestCase
from olympia.amo.urlresolvers import reverse
from olympia... |
"""
PURPOSE:
Run feature selection mettestd available from sci-kit learn on a given dataframe
Must set path to Miniconda in HPC: export PATH=/mnt/testme/azodichr/miniconda3/bin:$PATH
INPUT:
-df Feature file for ML. If class/Y values are in a separate file use -df for features and -df2 for class/Y
-alg ... |
# Code by <NAME>, 2018
import numpy as np
import matplotlib.pyplot as plt
# import math as m
from astropy import wcs
from astropy.coordinates import SkyCoord
from astropy.io import fits
import random as r
def sub_stars(condition):
subtract = np.zeros(len(B), dtype=bool)
# Set seed for replicability
r.see... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.