input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
allow_addons and not base_qs_set and not filter_items and not filter_categories:
event.cache.set(quota_cache_key, quota_cache, 5)
items = [item for item in items
if (len(item.available_variations) > 0 or not item.has_variations) and not item._remove]
return items, display_add_to_cart
@method_decorator(allow_frame... | |
None:
arg2chords = ()
for i in arg1chords:
if (i._size==arg2) or (i._happ==arg2):
arg2chords = arg2chords + (i,)
return arg2chords
def makeProg(self, progsize, arg1dist, arg2dist): # Return chord progression of size with selected distributions
def aux(scale, a1d, a2d):
arg1 = wselect(a1d)
arg2 = w... | |
level
# check if cascade level is one of the approved options.
# returns true if it is procedure step, user need, risk need, business need, design input or design output
# FDR rules: cascade level may only be one of the 6 defined types.
def is_cascade_lvl_approved(value):
if is_procedure_step(value) \
^ is_user_need(... | |
#!/bin/env python
# Plot differences between sets of TEME vectors
import matplotlib.pyplot as plt
import matplotlib.patheffects as pe
import re
import os, sys
import subprocess
import datetime
import csv
from math import degrees, isnan
# Configuration ######################################################... | |
self.model = HodModelFactory(
centrals_occupation=cens_occ,
centrals_profile=TrivialPhaseSpace(redshift=z),
satellites_occupation=sats_occ,
satellites_profile=sat_phase_space)
self.populated_once = False # cover for loadign new ones
def get_assembias_key(self, gal_type):
'''
Helper function to get the key of ... | |
<reponame>spencer-siddons/Moeller_Opentrons_protocol_library
from opentrons import protocol_api
from numpy import ceil
metadata = {'apiLevel': '2.5',
'author': '<NAME>'}
# Set to `True` to perform a short run, with brief pauses and only
# one column of samples
test_run = True
if test_run:
pause_bind = 5
pause_ma... | |
<reponame>ap0ught/NewsBlur<filename>settings.py
import sys
import os
# ===========================
# = Directory Declaractions =
# ===========================
CURRENT_DIR = os.path.dirname(__file__)
NEWSBLUR_DIR = CURRENT_DIR
TEMPLATE_DIRS = (os.path.join(CURRENT_DIR, 'templates'),
os.path.join(CURRENT_DIR, 'vendor/... | |
psql to do first manually if log was already imported using older azm_db_merge:
# alter table all_logs.lte_volte_rtp_msg alter column lte_volte_rtp_source_ssrc type bigint;
# alter table all_logs.lte_volte_rtp_msg alter column lte_volte_rtp_timestamp type bigint;
col_type = "bigint"
#######################
is... | |
<reponame>microchip-pic-avr-tools/iotprovision
#!/usr/bin/env python3
"""
This script can do one or more (default: all) of the following steps:
- Generate root and signer certificates, register with AWS (certs)
- Update the kit's debugger firmware to latest version
- Provision a connected IoT kit (provision)
- Program... | |
command += [bus_path]
run_executable(command)
return {'bus': out_path}
@validate_files(pre=False)
def bustools_count(
bus_path,
out_prefix,
t2g_path,
ecmap_path,
txnames_path,
tcc=False,
mm=False
):
"""Runs `bustools count`.
:param bus_path: path to BUS file to correct
:type bus_path: str
:param out_pre... | |
<reponame>antsfamily/torchtool<filename>torchlib/module/layers/phase_convolution.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-11-07 17:00:48
# @Author : <NAME> (<EMAIL>)
# @Link : http://iridescent.ink
# @Version : $1.0$
import torch as th
import torch.nn.functional as F
class PhaseConv1d(th.nn.Mo... | |
from flask_login import current_user, LoginManager
import logging
import json
import jwt
from sqlalchemy.ext.declarative import declared_attr
from flask_babel import lazy_gettext
import time
import hashlib
from typing import List
import requests
from flask import current_app,redirect, g, flash, request, session, abort,... | |
##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 16:32:55 2020
IN DEVELOPMENT
atm - automated test measurements
Utility toolset that will eventually enable automated measurement of test structure devices.
Consists of a few important classes:
MeasurementControl - performs and analyses measurements according to a ... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
IMG_ROWS = 28
IMG_COLS = 28
NUM_CLASSES = 10
VALID_SIZE = 0.2
RAND... | |
[]]
ew = [[], [], [], []]
dw[0] = [dList[4][0] + window, dList[4][1], dList[4][2] - window]
dw[1] = [dList[1][0] + window, dList[1][1], dList[1][2] + window]
dw[2] = [dList[2][0] - window, dList[2][1], dList[2][2] + window]
dw[3] = [dList[5][0] - window, dList[5][1], dList[5][2] - window]
ew[0] = [dList[4][0] + ... | |
<gh_stars>0
"""Create mass input function for TPUEstimator."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import os
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import numpy as np
import tenso... | |
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import re
from textwrap import dedent
from typing import Iterable, cast
import pytest
from pants.base.exceptions import ResolveError
from pants.base.s... | |
<filename>pycqed/instrument_drivers/physical_instruments/ZurichInstruments/UHFQuantumController.py
"""
To do:
- split off application dependent code, as done for ZI_HDAWG8.py
Notes:
Changelog:
20190113 WJV
- started Changelog
- addressed many warnings identified by PyCharm
- started adding type annotations
- split ... | |
# -*- coding: utf-8 -*-
"""
Module with tools functions used on classes.
"""
import os
import numpy as np
import xarray as xr
from copy import deepcopy
import psutil
import errno
import argparse
import ghalton as gh
# import matplotlib.pyplot as plt
# from matplotlib import cm
# from matplotlib import ticker
# from... | |
from difflib import get_close_matches
import re
import requests
def regex_group(search, num, default=None):
try:
return search.group(num)
except (AttributeError, IndexError):
return default
def regex_match(findall, num, default=None):
try:
return findall[num]
except (TypeError, IndexError):
return default
d... | |
If a nucleophile has 2 atoms, it will select the partially negative atom based on the electronegativity.
if len(elect_grp.atoms) == 2:
elect_atm = elect_grp.atoms[0] if (elect_grp.atoms[0].electronegativity
> elect_grp.atoms[1].electronegativity) else elect_grp.atoms[1]
cation_grp = inter.get_partner(elect_grp)
a... | |
<reponame>zliobaite/teeth-redescription
import os.path
import collections
import sys
import re
import pdb
from ..reremi.classRedescription import Redescription, printTexRedList, printRedList, parseRedList
from ..reremi.classData import Data, DataError
from ..reremi.classQuery import Query
from ..reremi.toolICList imp... | |
from collections import namedtuple
import pytest
from eth_tester.exceptions import TransactionFailed
from raiden_contracts.constants import (
EVENT_CHANNEL_BALANCE_PROOF_UPDATED,
CHANNEL_STATE_OPENED,
CHANNEL_STATE_NONEXISTENT,
TEST_SETTLE_TIMEOUT_MIN,
)
from raiden_contracts.utils.events import check_transfer_up... | |
"""Tests of the xrfi module."""
import pytest
import itertools
import numpy as np
import yaml
from pathlib import Path
from pytest_cases import fixture_ref as fxref
from pytest_cases import parametrize
from edges_cal import xrfi
NFREQ = 1000
@pytest.fixture(scope="module")
def freq():
"""Default frequencies."""
... | |
import hashlib
from mongoengine import Q
from mongoengine.connection import disconnect
import json
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql.expression import and_
from tools.DataBase.CodeGenerator import CodeGen
from tools.DataBase.Definition.Area import Area
from tools.DataBase.Definition.Contact ... | |
logits.
This matrix corresponds to a single sample (includes special tokens, question tokens, passage tokens).
This method always returns a list of len n_best_per_sample + 1 (it is comprised of the n_best_per_sample positive answers along with the one no_answer)
"""
# Initialize some variables
top_candidates: List... | |
for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
TypeBase64 = 8
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def... | |
# encoding: utf-8
import datetime
from ...testing import DatabaseTest
from ...model import (
get_one_or_create,
PresentationCalculationPolicy,
)
from ...model.constants import MediaTypes
from ...model.coverage import CoverageRecord
from ...model.contributor import Contributor
from ...model.datasource import DataSourc... | |
the ELSE nodelist was the one which was rendered, whilst
# still collecting the individual conditions that made up all the if components
# to check which ones failed with a MissingVariable exception rather than just
# evaluating falsy...
conditions_seen = set() # type: Set[TemplateLiteral]
conditions = [] # type: ... | |
<filename>calc/iou.py
# coding = utf-8
import numpy as np
from colorama import init, Fore, Back, Style
"""
Summary:
IoU Calculate:
the IoU between Box_1 and Box_2:
F(x): if x < 0 , =0; else, =x;
IoU: F(max_top - min_bottom) * F(min_right - max_left)
max_top = max(Box_1_top_y, Box_2_top_y)
min_bottom = min(Box_1... | |
<gh_stars>0
#!/usr/bin/python
#
# Copyright (c) 2019 <NAME>, (@zikalino)
#
# 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_METADATA = {'metadata_version': '1.1',
'sta... | |
%s\n' % xr_struct.protect_string
struct_check += '\n'
return struct_check
# Write an inline validation check for handle parents
# self the ValidationSourceOutputGenerator object
# instance_info_string string used to identify the variable associated with the instance information struct.
# first_handle_tuple the h... | |
"""Indicates whether the document is to be saved as master file.
Get: IsSavingAsMasterFile(self: DocumentSavedAsEventArgs) -> bool
"""
OriginalPath = property(
lambda self: object(), lambda self, v: None, lambda self: None
) # default
"""Original path of the document.
Get: OriginalPath(se... | |
<filename>skipole/ski/responders/submitters.py<gh_stars>0
"""A Respond object instance is placed in a Respond page,
The instance is callable, and the respondpage calls it
to provide the page action"""
import json, collections
from http import cookies
from string import Template
from .. import skiboot, tag
from .... | |
npts_per + 1) / float( n * npts_per) * (b2 - b1) + b1
berr = numpy.arange(n * npts_per + 1) * 0.0
bphase = 2.0 * numpy.pi / lambdau * z
btot = bmod * numpy.sin(bphase)
f = open("bfield.dat", 'w')
f.write('# Columns: z(cm), ampl(tesla), phserr, total(tesla)\n')
f.write('# total = ampl * sin ( twopi/period*z + ph... | |
import torch
from torch.utils.data.dataset import TensorDataset
from torch.utils.data import DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
import embrelassess.vecops as vecops
import pandas as pd
import numpy as np
import logging
import os
import io
import array
import six
def simple_syns(val):... | |
[Albergante20]_.
epg_mu
Parameter for ElPiGraph, coefficient of ‘bending’ elasticity [Albergante20]_.
epg_trimmingradius
Parameter for ElPiGraph, trimming radius for MSE-based data approximation term [Albergante20]_.
epg_initnodes
numerical 2D matrix, the k-by-m matrix with k m-dimensional positions of the nodes
... | |
"""
photoz_reference = SPCC_SN_data().get_photoz_reference()
while True:
ref_idx = np.random.choice(len(photoz_reference))
ref_specz, ref_photoz, ref_photoz_err = photoz_reference[ref_idx]
# Randomly choose the order for the difference. Degeneracies work
# both ways, so even if we only see specz=0.2 -> photoz=3... | |
<filename>gym-dataCachingCoding/gym_dataCachingCoding/envs/simulation_entities.py<gh_stars>0
import numpy as np
import math
import scipy.io
#import matplotlib.pyplot as plot
#from matplotlib.animation import FuncAnimation
class Buffer_Object(object):
def __init__(self, size = 4, destinations = 5):
"""
This initial... | |
<filename>A6/A6Part4.py<gh_stars>0
import os
import sys
import numpy as np
import math
from scipy.signal import get_window
import matplotlib.pyplot as plt
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../software/models/'))
import utilFunctions as UF
import harmonicModel as HM
import df... | |
<filename>lib/galaxy/managers/workflows.py<gh_stars>0
from __future__ import absolute_import
from collections import namedtuple
import json
from galaxy import model
from galaxy import exceptions
from galaxy.model.item_attrs import UsesAnnotations
from galaxy.workflow import modules
# For WorkflowContentManager
from ... | |
O O O O
0x19, 0x30, # OO O OO
0x07, 0xC0, # OOOOO
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
# @8142 '¾' (15 pixels wide)
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x00, 0x00, #
0x07, 0xC0, # OOOOO
0x19, 0x30, # OO O OO
0x29, 0x28, # O O O O O
0x41, 0x04, # O O O
0x61, 0x0C,... | |
<filename>simulation/aws-robomaker-sample-application-deepracer/simulation_ws/src/sagemaker_rl_agent/markov/environments/deepracer_racetrack_env.py
from __future__ import print_function
import bisect
import boto3
import json
import logging
import math
import os
import time
import gym
import numpy as np
from gym impor... | |
from PyQt5 import QtWidgets, QtCore, QtGui
from appTool import AppTool
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCButton, FCComboBox, NumericalEvalTupleEntry, FCLabel
from numpy import Inf
from shapely.geometry import Point
from shapely import affinity
import logging
import gettext
import appTrans... | |
{
'fgweight': None,
},
},
}
"""
# Hacky but illustrative
# TODO; implement non-hacky version
allkeys = get_allkeys(dict_)
mat = np.zeros((len(allkeys), len(allkeys)))
for key in allkeys:
if key != root:
for parent in child_to_parents[key]:
rx = allkeys.index(parent)
cx = allkeys.index(key)
mat[rx][cx] =... | |
"""
Name: one_call_class.py
Author:
Created:
Purpose: OOP console app
Get lat and lon from Openweather map current weather
Use lat and lon for One Call Weather
"""
import requests
import textwrap
import os # Clear the console
import weather_utils
# Import geocode_geopy module for reverse geocode
import geocode_g... | |
<filename>Source/chrome/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_backend.py
# Copyright 2013 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.
import datetime
import glob
import heapq
import logging
imp... | |
(pad_to - 1)//2 + 1
else:
freqcenter = pad_to//2
scaling_factor = 1.
elif sides == 'onesided':
if pad_to % 2:
numFreqs = (pad_to + 1)//2
else:
numFreqs = pad_to//2 + 1
scaling_factor = 2.
if not np.iterable(window):
window = window(np.ones(NFFT, x.dtype))
if len(window) != NFFT:
raise ValueE... | |
import glob
import json
import os.path
import math
from functools import reduce
from typing import Union
from collections.abc import Iterable
from datetime import datetime
import numpy as np
import scipy.interpolate
from matplotlib import transforms, rcParams
import matplotlib.pyplot as plt
from matplotlib.patches imp... | |
<reponame>fsanges/glTools
import maya.cmds as mc
import maya.mel as mm
import glTools.utils.attribute
import glTools.utils.base
import glTools.utils.mesh
import glTools.utils.stringUtils
from glTools.utils.weightList import WeightList
import os.path
# ----------
# - Checks -
# ----------
def isNDynamicsNode(nNode)... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
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 r... | |
the signal on the canvas (in pixels)
# Optional Parameters:
# orientation:int- Orientation in degrees (0 or 180) - Default is zero
# sig_callback:name - Function to call when a signal event happens - Default is no callback
# Note that the callback function returns (item_id, callback type)
# sig_passed_button:bool - Cr... | |
<gh_stars>0
# refs.py -- For dealing with git refs
# Copyright (C) 2008-2013 <NAME> <<EMAIL>>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it an... | |
# -*- coding: utf-8 -*-
import unittest
from typed_ast import ast27
class TestCodeGen27(unittest.TestCase):
def setUp(self):
from gen27 import CodeGen27
self.gen = CodeGen27()
def regen(s):
return self.gen.generate(ast27.parse(s), 0)
self.regen = regen
def test_module_docstring(self):
cases = [
'',
'"... | |
<filename>ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocolstack/egtppcrfs5s8range_d7b3bdabbe4bfdf7e1a28233c37db008.py
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentat... | |
import math
# for i in range(10):
# blocks.append({"x":i*10, "y":i*10, "v":minVel})
def solveTimeEq(initialVel, dist, acc):
if dist == 0:
print("solveTimeEq: initialVel", initialVel, "dist", dist, "acc", acc, "time=", 0)
return 0
if acc == 0:
timeA = abs(dist / initialVel)
print("solveTimeEq: initialVel", init... | |
'%s'"
" to method complete_self_service_browser_verification_flow" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'request' is set
if self.api_client.client_side_validation and ('request' not in local_var_params or # noqa: E501
local_var_params['request'] is No... | |
considered as group 2
##the rest will be considered as group 1
##The target =1 means that as long as files include identifier 1, it will be considered as group 2
##the rest will be considered as group 2
id_list=[]
infiles=[]
paired_dict=dict()
for infile in infiles_combine:
infile_name_list=infile.s... | |
Generator:
"""class which handles docs generation."""
def __init__(self) -> None:
self._index_keys: list[str] = []
# Make a list of missing stuff so we can warn about it in one
# big chunk at the end (so the user can batch their corrections).
self._errors: list[Any] = []
self._index: dict[str, tuple[str, Union... | |
joint_target_positions,
)
except Exception as e:
print(f'\033[1;93m[w]\033[0m {e}.')
# =========================== UPDATE FUNCTIONS =========================== #
@staticmethod
def __contact_info_average(
contact_points_info: List[ContactInfo]
) -> Tuple[float, float, np.array]:
"""
Given a robot toe positi... | |
import functools
from copy import deepcopy
from typing import List, Dict, Optional, Union, Any, TypeVar, Type
from motor.motor_asyncio import AsyncIOMotorDatabase, AsyncIOMotorCollection
from pymongo.results import DeleteResult
T = TypeVar("T")
def return_converted(func):
"""
If we have a registered converter,
t... | |
import traceback
from contextlib import redirect_stdout
from io import BytesIO, StringIO
from textwrap import indent
import aiohttp
import discord
from musicbot import exceptions
from musicbot.settings import Settings
from musicbot.utils import Response, command_info, escape_dis, owner_only
class AdminCommands:
a... | |
<= 1`, where
a value of 0 gives an undamped random walk and a value of 1 gives
uncorrelated Gaussian noise. Hence in most applications a small
non-zero value is appropriate.
stddev (float): Standard deviation of the Gaussian component.
"""
super(OUProcess, self).__init__()
self._damping = damping
self._stddev =... | |
self.y)
self.y = sim_box.bottom - diff
if self.z > sim_box.back:
diff = self.z - sim_box.back
self.z = sim_box.front + diff
elif self.z < sim_box.front:
diff = abs(sim_box.front - self.z)
self.z = sim_box.back - diff
self.set_cub() # update the bounding box due to its movement
# Now its inside: ... | |
<reponame>ruarai/epifx.covid
from functools import reduce
import h5py
import logging
import numpy as np
import pypfilt.check as check
import pypfilt.context
import pypfilt.obs
import pypfilt.resample
import pypfilt.state
import pypfilt.stats as stats
import pypfilt.summary
from pypfilt.summary import Table, Monitor, o... | |
import datetime
import os
import uuid
from typing import cast
from unittest.mock import patch
import pytest
from django.core import mail
from django.core.exceptions import ValidationError
from django.test import override_settings
from django.utils import timezone
from freezegun.api import freeze_time
from rest_framewo... | |
#!/usr/bin/python -u
#
# create dictionary files for ADIT-NMR:
#
# adit_nmr_upload_tags.csv
# bmrb_1.view
# default-entry.cif (actually this one's simply copied from Eldon's svn)
# dict.cif
# mmcif_bmrb.dic
# nmrcifmatch.cif
# table_dict.str
# View-bmrb.cif
#
#
from __future__ import absolute_import
import sys
import ... | |
Make sure it isn't already available & selected.
(overlay_set_val, ":conditional_obj", ":status"), # Set it to whatever it was stored as.
(overlay_set_display, ":conditional_obj", 1), # Displays the option.
(assign, ":add_option", 0),
(try_end),
## CONDITIONAL CHECKBOXES end
(try_end),
... | |
else:
char_rows = len(set(_.row for _ in char_pins))
if char_rows == 1:
rep = "{} chars in 1 line".format(len(char_pins))
else:
rep = "{} chars across {} lines".format(len(char_pins), char_rows)
return rep
#
# Stack the I/O of a Terminal
# as TerminalPainter > TerminalShadow > TerminalDriver
#
class Terminal... | |
<reponame>CanonicalBootStack/charm-neutron-openvswitch
# Copyright 2016 Canonical 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... | |
[]
root2clauses = {}
# Separate the clauses
for clause in clauses:
roots = [hashable_path(p) for p in clause.roots]
if len(roots) == 1:
root2clauses.setdefault(roots[0],[]).append(clause)
else:
catchall.append(clause)
# Generate clause blocks
clauseblocks = []
for root,clauses in root2clauses.items():
clau... | |
<reponame>MarcoMernberger/mbf_externals
"""
Many algorithms need prebuild data structures (indices and so on)
which both are too time consuming to build, to big to copy to each
experiment and need to be versioned,
but they can often be shared among versions."""
import socket
from .util import Version, sort_versions, U... | |
<filename>arelle/XmlValidate.py
'''
Created on Feb 20, 2011
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
'''
import os, logging
from lxml import etree
try:
from regex import compile as re_compile
except ImportError:
from re import compile as re_compile
from decimal ... | |
import cloudstorage
import datetime
import json
import logging
from helpers.firebase.firebase_pusher import FirebasePusher
from helpers.match_helper import MatchHelper
from helpers.outgoing_notification_helper import OutgoingNotificationHelper
from models.event import Event
from models.match import Match
from models.s... | |
<reponame>Egida/Ethical-Hacking-Scripts<gh_stars>10-100
import socket, binascii, struct, os, sys, time, threading
from optparse import OptionParser
from scapy.all import *
class OptionParse:
def __init__(self):
self.arg_parse()
def logo(self):
print("""\033[0;31;40m
_____ _ _ _____ _ __ __ __ ___
/ __... | |
# (c) <NAME>, 2010-2022. MIT License.
import pathlib
import numpy as np
import pandas as pd
import pytest
from pytest import approx
from sklearn.cross_decomposition import PLSRegression
from process_improve.multivariate.methods import (
PCA,
PLS,
MCUVScaler,
SpecificationWarning,
center,
epsqrt,
quick_regress... | |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import asyncio
import logging
import time
from contextlib import suppress
from datetime import datetime
from enum import Enum
from typing import Dict, Iterable, NoReturn, Optional, Tuple
from croniter import croniter
from sqlalchemy import... | |
"""
SBtab2SBML
==========
Python script that converts SBtab file/s to SBML.
"""
#!/usr/bin/env python
import re, libsbml
import SBtab
import string
import random
import sys
#all allowed SBtab types
sbtab_types = ['Quantity','Event','Rule']
urns = ["obo.chebi","kegg.compound","kegg.reaction","obo.go","obo.sgd","biomod... | |
| 'auto'
Names of channels or list of indices that should be designated
MISC channels. Values should correspond to the electrodes
in the vhdr file. If 'auto', units in vhdr file are used for inferring
misc channels. Default is ``'auto'``.
scale : float
The scaling factor for EEG data. Unless specified otherwise b... | |
HYPGEOMDIST"
return Function("HYPGEOM_DIST", args)
def HYPGEOMDIST(*args) -> Function:
"""
Calculates the probability of drawing a certain number of successes in a certain
number of tries given a population of a certain size containing a certain number
of successes, without replacement of draws.
Learn more: ht... | |
<filename>tests/cache/tests.py
# -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
import copy
import os
import re
import shutil
import tempfile
import threading
import time
import unittest
import warnings
fr... | |
# Copyright Pincer 2021-Present
# Full MIT License can be found in `LICENSE` at the project root.
from __future__ import annotations
from asyncio import sleep, ensure_future
from dataclasses import dataclass
from enum import IntEnum
from typing import AsyncIterator, overload, TYPE_CHECKING
from .invite import Invite... | |
= SubVector(obj)
self.resize_(obj.dim, _matrix_common.MatrixResizeType.UNDEFINED)
self.copy_(obj)
def __delitem__(self, index):
"""Removes an element from the vector."""
if not (0 <= index < self.dim):
raise IndexError("index={} should be in the range [0,{})."
.format(index, self.dim))
self._remove_element_(in... | |
args['use_passage'] = _dict.get('use_passage')
if 'field' in _dict:
args['field'] = _dict.get('field')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
"""Initialize a ComponentSettingsFieldsShownBody object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Retur... | |
# -*- coding: utf-8 -*-
import torch
from torch import nn
from support_DynamicNet import getActivationList, getPoolingList, convOutputShape
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
class DynamicCNN(nn.Module):
def __init__(self, parameters, print_var = False, tracking_input_dime... | |
import datetime, hashlib, base64, traceback, os, re
import poshc2.server.database.DB as DB
from poshc2.Colours import Colours
from poshc2.server.Config import ModulesDirectory, DownloadsDirectory, ReportsDirectory
from poshc2.server.Implant import Implant
from poshc2.server.Core import decrypt, encrypt, default_respon... | |
"""
Naives and Others Requiring No Additional Packages Beyond Numpy and Pandas
"""
from math import ceil
import warnings
import random
import datetime
import numpy as np
import pandas as pd
from autots.models.base import ModelObject, PredictionObject
from autots.tools import seasonal_int
from autots.tools.probabilistic... | |
#=======================================================================
__version__ = '''0.2.37'''
__sub_version__ = '''20071006153421'''
__copyright__ = '''(c) <NAME> 2003'''
#-----------------------------------------------------------------------
__doc__ = '''\
This module defines an interface definition and enf... | |
Server 12 SP1',
'ID': 'sles',
'ANSI_COLOR': '0;32',
'CPE_NAME': 'cpe:/o:suse:sles:12:sp1'
},
}
expectation = {
'oscodename': 'SUSE Linux Enterprise Server 12 SP1',
'osfullname': "SLES",
'osrelease': '12.1',
'osrelease_info': (12, 1),
'osmajorrelease': 12,
'osfinger': 'SLES-12',
}
self._run_suse_os_grains_... | |
and self.config["testing"]["metrics_on_patches"]:
x_seq_hat = get_patches(x_seq_hat,weights,self.config["data"],test_dataset.weight_value_flow, logger=self.logger)
x_seq_gt = get_patches(x_seq_gt, weights, self.config["data"], test_dataset.weight_value_flow, logger=self.logger)
sigmas_gt = []
ll_loss_dyn = []
rec... | |
b, c, d), a), 'options->lower_flrp{}'.format(s)),
(('~flrp@{}'.format(s), a, ('fmul(is_used_once)', a, b), c), ('fmul', ('flrp', 1.0, b, c), a), 'options->lower_flrp{}'.format(s)),
(('~fadd@{}'.format(s), ('fmul', a, ('fadd', 1.0, ('fneg', c))), ('fmul', b, c)), ('flrp', a, b, c), '!options->lower_flrp{}'.format(s))... | |
Err.append(mean_confidence_interval(H[i]))
plt.errorbar(x=X, y=Y, yerr=Err, fmt="o", color="#7f8c8d", ls='-', label='$=4$',
ecolor='#7f8c8d', marker='p', markersize=10, linewidth=2, elinewidth=0.5, capsize=4)
X = [1, 2, 3, 4, 5, 6, 7, 8]
H = [[] for i in range(8)]
Y = []
Err = []
for i in range(8):
for j in ra... | |
"""Lower-level plotting tools.
Routines that may be of use to users wishing for more fine-grained control may
wish to use.
- ``make_1d_axes``
- ``make_2d_axes``
to create a set of axes and legend proxies.
"""
import numpy as np
import pandas
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
from ... | |
#!/usr/bin/env python2
import datetime as dt
import glob as glob
import os as os
import re
import shutil as shutil
import signal as signal
import subprocess as sp
import sys as sys
from lib import scripts as scripts
def restraints(pose, rest, bb_start, bb_end, weight, stage, mol, comp, bb_equil, sdr_dist, dec_method):... | |
#! /usr/bin/env python3
import sys
import traceback
def error(msg=None):
if msg is None:
sys.stdout.write(traceback.format_exc())
else:
sys.stdout.write('error: '+msg+'\n')
#end if
sys.exit(1)
#end def error
# label descriptions
#
# main classification
# stable - test is expected to pass
# unstable - test m... | |
<reponame>rowanG077/RecurrenceRelationSolver<gh_stars>1-10
#!/usr/bin/env python3
# coding=utf-8
import logging
import re
import sympy
from sympy.solvers.solveset import linsolve
class RecurrenceSolveFailed(Exception):
"""
RecurrenceSolveFailed will be thrown when recurrence relation couldn't be solved fails
"""
d... | |
"""
Created on Wed Jan 15 11:17:10 2020
@author: mesch
"""
from colorama import init, Fore, Back
init(autoreset=True) #to convert termcolor to wins color
import copy
from pyqum.instrument.benchtop import RSA5
from pyqum.instrument.benchtop import PSGA
from pyqum.instrument.modular import AWG
from pyqum.instrument.log... | |
-= joints[:, parents[1:]]
transforms_mat = transform_mat_np(
rot_mats.reshape(-1, 3, 3),
rel_joints.reshape(-1, 3, 1)).reshape(-1, joints.shape[1], 4, 4)
# print(transforms_mat[0][0])
# print(transforms_mat[0][1])
b = joints.shape[0]
n_j = joints.shape[1]
t_1 = time.time()
# transform_jac = np.zeros((b, n... | |
<gh_stars>0
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by <NAME>
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the Li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.