input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
# -*- coding: utf-8 -*-
'''
Copyright (c) 2018 by <NAME>
This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY).
:author: <NAME> and <NAME>
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
f... | |
<filename>polus-imaris-parser-plugin/src/extract_ims_data.py
import csv
import gc
import h5py
import logging
import numpy as np
import os
import pandas as pd
import re
import string
import time
class LinkData:
"""Extract data from .ims file
This class locates and extracts needed data from the following
attribute... | |
"4359 4460 4530",
48468: "4359 4460 4531",
48469: "4359 4460 4532",
48470: "4359 4460 4533",
48471: "4359 4460 4534",
48472: "4359 4460 4535",
48473: "4359 4460 4536",
48474: "4359 4460 4537",
48475: "4359 4460 4538",
48476: "4359 4460 4539",
48477: "4359 4460 4540",
48478: "4359 4460 4541",
48479: "4359 44... | |
<filename>dso/dso/controller.py
"""Controller used to generate distribution over hierarchical, variable-length objects."""
import tensorflow as tf
import numpy as np
from dso.program import Program
from dso.memory import Batch
from dso.prior import LengthConstraint
class LinearWrapper(tf.contrib.rnn.LayerRNNCell):
... | |
matrix
coordMap - a 2D matrix defining the X,Y to strip index mapping. Not needed in most cases
rotation - how to rotate when generating the map. Not used if coordMap specified
vert_flip - flips the generated map along the Y axis. This along with rotation can achieve any orientation
"""
super(LEDMatrix, self).__in... | |
tf.stack(out,axis=0)
out = tf.reduce_sum(out,axis=0)
out *= self.variables['sigma']**2 * tf.exp(-np.sqrt(2 * nu) * r) * factorial(self.p) / factorial(2*self.p)
return out
class Periodic(KernelND):
def __init__(self,_hyperparams={'l':1.,'p':1.,'sigma':1.},**kwargs):
super(Periodic,self).__init__(_hyperparams=_hy... | |
<gh_stars>1-10
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.31
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _Xdmf
import new
new_instancemethod = new.instancemethod
try:
_swig_property =... | |
e = self._pendingSubscriptions.get(tup)
if not e:
e = self._pendingSubscriptions[(tup[0], tup[1], tup[2])] = threading.Event()
assert tup[0] and tup[1]
self._channel.write(
ClientToServer.Subscribe(schema=tup[0], typename=tup[1], fieldname_and_value=tup[2], isLazy=tup[3])
)
events.append(e)
if not block:
... | |
7) calculating passing angle in radians
df_passes['a'] = np.arctan(df_passes['vec_x'] / abs(df_passes['vec_y']))
#df_passes['aNew'] = np.arctan(df_passes['vec_x'] / (df_passes['endM_c'] - df_passes['startM_c']))
## 8) calculating shooting angle from initial position
df_passes['aShooting'] = np.arctan(7.32 * df_pas... | |
порядка
# метод наименьших квадратов для параболической регрессии на прямом ходу
features = np.concatenate((np.vstack(np.ones(tmp_n_of_points)),
np.vstack(err_positions),
np.vstack(err_positions**2)), axis = 1)
determinants_pos = np.linalg.lstsq(features, err_pos_array)[0]
print "approx_pos = ", determinants_pos... | |
import json
import os
from tornado.escape import to_basestring
from tornado.web import Application, RequestHandler, authenticated, addslash
from jupyterhub.services.auth import HubAuthenticated
from .backup import database_from_backup
from .config import Config
from .emails import send_published_email, validate_token
f... | |
#!/bin/env python
#
# File: PyMOLVisualizeCryoEMDensity.py
# Author: <NAME> <<EMAIL>>
#
# Copyright (C) 2018 <NAME>. All rights reserved.
#
# The functionality available in this script is implemented using PyMOL, a
# molecular visualization system on an open source foundation originally
# developed by Warren DeLano.
#
... | |
# Copyright 2016 <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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | |
<gh_stars>10-100
from a10sdk.common.A10BaseClass import A10BaseClass
class ServerRequestHeader(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param server_request_header_insert: {"minLength": 1, "maxLength": 127, "type": "string", "description": "Insert a SIP header (Header Con... | |
<gh_stars>10-100
# Copyright (c) 2015, <NAME>
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
import numpy as np
import quaternion
from numpy import *
import pytest
import scri
from scri.waveform_modes import WaveformModes
from conftest import linear_waveform, constant_waveform, ra... | |
0.00282743338823081*m.b217 - 0.00502654824574367*m.b218 - 0.0122718463030851*m.b219
- 0.0176714586764426*m.b220 - 0.0314159265358979*m.b221 - 0.0490873852123405*m.b222
- 0.0706858347057703*m.b223 == 0)
m.c222 = Constraint(expr= m.x106 - 0.00282743338823081*m.b224 - 0.00502654824574367*m.b225 - 0.0122718463030851*m.b... | |
import os
import sys
import json
#############################################################################################################################
#
# This script is used to transform TVM generated GPU code.
#
# For each kernel K, the transformation consists of X steps:
# 1. K will be replaced by a __d... | |
<reponame>DeqiTang/pymatflow<gh_stars>1-10
import os
import copy
import numpy as np
import matplotlib.pyplot as plt
from xml.etree.ElementTree import parse
class post_pdos:
def __init__(self):
pass
def get_vasprun(self, vasprun="vasprun.xml"):
self.vasprun = parse(vasprun)
self.efermi = float(self.... | |
<filename>pfdo_mgz2img/pfdo_mgz2img.py
#!/usr/bin/env python
#
# pfdo_mgz2img ds ChRIS plugin app
#
# (c) 2016-2020 Fetal-Neonatal Neuroimaging & Developmental Science Center
# Boston Children's Hospital
#
# http://childrenshospital.org/FNNDSC/
# <EMAIL>
#
import os
import sys
import importlib.metadata
import pudb
... | |
<filename>lendingclub/__init__.py
#!/usr/bin/env python
"""
The stand-alone python module for interacting with your Lending Club account.
"""
"""
The MIT License (MIT)
Copyright (c) 2013 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation... | |
from tkinter import Tk
from tkinter import Button
from tkinter import Menu
from tkinter import Text
from tkinter import messagebox
from tkinter import filedialog
from tkinter import Entry
from tkinter import Label
from tkinter import StringVar
from ttkthemes import themed_tk as tk
from tkinter import ttk
import numpy a... | |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Tool for automatically creating .nmf files from .nexe/.pexe executables.
As well as creating the nmf file this tool can also fi... | |
POST Query_Correlationevents_E API Function
**Parameters:**:
- **data**: Dictionary containing data to POST as JSON
- **tenant_id**: Tenant ID
- **api_version**: API version to use (default v2.0)
**Returns:** requests.Response object extended with cgx_status and cgx_content properties.
"""
if tenant_id is No... | |
<filename>ratemap_lib.py
"""
Calculates ratemaps.
@author: <NAME>
@modified: JingyiGF
"""
import matplotlib
from scipy import *
import scipy.linalg as linalg
import scipy.ndimage.filters
import scipy.io
import numpy as np
import math
import copy as copycopy
import pickle
from scipy.optimize import minimize
import mat... | |
cirq.Moment([cirq.CZ(a, b)]),
cirq.Moment([cirq.X(a), cirq.X(b)]),
])
# Out of range.
after = original.copy()
with pytest.raises(IndexError):
after.batch_insert_into([(500, cirq.X(a))])
assert after == original
# Collision.
after = original.copy()
with pytest.raises(ValueError):
after.batch_insert_into([(0... | |
<filename>pyrallel/queue.py
import copy
import multiprocessing as mp
import multiprocessing.queues as mpq
from queue import Full, Empty
import pickle
import math
# import uuid
import os
import struct
import sys
import time
import typing
import dill # type: ignore
import zlib
if sys.version_info >= (3, 8):
from multi... | |
'v_6'), ('v_6', 't_2'), ('v_9', 't_2'), ('v_4', 't_3'), ('v_7', 't_2'),
('v_8', 't_3'), ('t_2', 'v_7'), ('c_1', 't_3'), ('t_2', 'v_9')},
'>': {('c_1', 'v_5'), ('t_3', 'v_4'), ('t_3', 'v_8'), ('t_3', 'v_9'), ('t_2', 'v_5'), ('t_2', 'v_6'),
('t_2', 'v_7'), ('c_1', 'v_7'), ('c_1', 'v_6'), ('c_1', 't_3'), ('t_2', 'v_9')... | |
<filename>mysklearn/myutils.py<gh_stars>0
import math
import copy
import random
# gets the column from the table
def get_column(table, header, col_name):
col_index = header.index(col_name)
col = []
for row in table:
if (row[col_index] != "NA"):
col.append(row[col_index])
return col
# gets the frequencies from... | |
= self.get_resource_url("/Receipts/{ReceiptID}/Attachments")
try:
return self.api_client.call_api(
url,
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="Attachments",
response_model_finder=self.get_model_finder(),
auth_settin... | |
<reponame>dperl-sol/cctbx_project<filename>iotbx/mtz/tst.py
from __future__ import absolute_import, division, print_function
import libtbx.load_env
from six.moves import range
from six.moves import zip
if (libtbx.env.has_module("ccp4io")):
from iotbx import mtz
else:
mtz = None
from cctbx.development import debug_uti... | |
<filename>guiamuseos/museos/views.py<gh_stars>0
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.template.loader import get_template
from django.template import Context
from .models import Museo, Comentario, Museo_añadido, Seleccion
from .parser import parserXML
from django... | |
from functools import partial, update_wrapper
from math import exp
import numpy as np
from scipy.sparse import lil_matrix
from scipy.stats import rankdata
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics.pairwise import pairwise_distances, euclidean_distances
from sklearn.neighbors import NearestNei... | |
<filename>Modules/Scripted/EditorLib/Effect.py
from __future__ import print_function
import os
import vtk
import qt
import slicer
from slicer.util import NodeModify
from . import EditOptions
from . import EditUtil
__all__ = ['EffectOptions', 'EffectTool', 'EffectLogic', 'Effect']
###################################... | |
= [y[y != self.ignore_id] for y in ys_pad_src] # parse padded ys_src
ys_zero_pad_src = pad_list(ys_src, self.pad) # re-pad with zero
ys_zero_pad_src = ys_zero_pad_src[:, :max(ilens_mt)] # for data parallel
src_mask_mt = (~make_pad_mask(ilens_mt.tolist())).to(ys_zero_pad_src.device).unsqueeze(-2)
hs_pad_mt, hs_mask... | |
be provided. None
is only a valid value or default if nullable is True.
- In general, nullable means that None is a valid value.
- getattr returns None instead of raising Attribute error
- If in_dump, field is given with null value.
- If default is not None, assigning None clears a previous assignment. Future get... | |
"""
Unit tests for schema.py
"""
import unittest
import os
from nbdb.common.data_point import DataPoint
from nbdb.config.settings import Settings
from nbdb.schema.schema import BATCH_DATASOURCE_PREFIX
from nbdb.schema.schema import Schema, DATASOURCE_SHARD_SEP
from nbdb.schema.schema import ROLLUP_LAST, ROLLUP_SUM
fro... | |
<gh_stars>0
from pipelines import qg_pipeline
from tqdm import tqdm
from pathlib import Path
import pandas as pd
import time
import re
import os
from contextlib import suppress
import json
import urllib.request
import requests
from tika import parser
from bs4 import BeautifulSoup
from pprint import pprint
from epub_c... | |
six.iteritems(infr.internal_feedback):
yield edge, vals
def all_feedback(infr):
all_feedback = ut.ddict(list)
all_feedback.update(infr.all_feedback_items())
return all_feedback
def clear_feedback(infr, edges=None):
""" Delete all edges properties related to feedback """
if edges is None:
edges = infr.graph.e... | |
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import math
# import time
import numpy as np
import cv2
import matplotlib.pyplot as plt
import tensorflow as tf
import progressbar
from waymo_open_dataset.utils import range_image_utils
from waymo_open_dataset.utils import t... | |
- 364.434809700482*m.s1s244
- 528.190788533686*m.s1s245 - 9.11349113439539*m.s1s246 - 17.6144733325531*m.s1s247
- 32.2986551864818*m.s1s248 - 54.4931814987685*m.s1s249 - 105.323928905069*m.s1s250
- 177.698914733437*m.s1s251 - 257.546555368226*m.s1s252 - 7.65172765642961*m.s1s253
- 14.7891900880288*m.s1s254 - 27.118... | |
, 0.5044, 0.1785])
>>> np.around(model.z_stat, decimals=6) #doctest: +SKIP
array([[ 3.84261100e+00, 1.22000000e-04],
[ 1.40839200e+00, 1.59015000e-01],
[ -3.08424700e+00, 2.04100000e-03]])
>>> round(model.sig2,4)
198.5596
"""
def __init__(self, y, x, w,
vm=False, name_y=None, name_x=None,
name_w=None, name_... | |
<filename>dz/dz-03/src/searches/hooke_jeeves.py<gh_stars>0
# Copyright 2020 Yalfoosh
#
# 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 ... | |
34: I1Ii111 % i11iIiiIii / oO0o - i1IIi . o0oOOo0O0Ooo / oO0o
def lisp_remove_eid_from_map_notify_queue ( eid_list ) :
if 68 - 68: I1Ii111 % Ii1I * Oo0Ooo - O0 . IiII
if 1 - 1: I1ii11iIi11i
if 18 - 18: i11iIiiIii % OoO0O00 % OOooOOo . OOooOOo * Ii1I / II111iiii
if 81 - 81: iII111i % IiII / I11i
if 50 - 50: IiII + ... | |
ofilename
ofilewriter = csv.writer(open(ofilename, "wb"), delimiter=' ')
for i in range(len(vals)):
ofilewriter.writerow([bins[i], vals[i] / float(sum(vals))])
def PlotGofR(self, itype, do_time_average=True, cutoff_dist=60.0, particle_density=0.0, binwidth=1.0):
"""public: compute and print simple g(r) for cente... | |
<reponame>Nurzamal/rest_api_docker<gh_stars>0
# -*- coding: utf-8 -*-
# $Id: db.py 70662 2018-01-21 16:28:23Z vboxsync $
"""
Test Manager - Database Interface.
"""
__copyright__ = \
"""
Copyright (C) 2012-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.... | |
def reboot_computer_ex_async(
self,
request: cas_models.RebootComputerRequest,
headers: Dict[str, str],
runtime: util_models.RuntimeOptions,
) -> cas_models.RebootComputerResponse:
"""
Description: 重启computer
Summary: 重启computer
"""
UtilClient.validate_model(request)
return cas_models.RebootComputerResponse(... | |
instr_op == '/=':
assembly_code.add_line('div ' + reg_dest + ', ' + reg_src1)
assembly_code.add_line('mflo ' + reg_dest) # HI
if reg_idx1 != '':
assembly_code.add_line('sw ' + reg_dest + ', ' + reg_idx1 + '(' + reg_temp1 + ')')
return 0
if instr_op == '%=':
assembly_code.add_line('div ' + reg_dest + ', ' + reg_... | |
nomdist),
attrs = dict(
description=hdf['Navigation']['Information']['Heading_description'][0].decode('UTF-8'),
units = hdf['Navigation']['Information']['Heading_units'][0].decode('UTF-8')
)
)
roll = xr.DataArray(
data = hdf['Navigation']['Data']['Roll'][:],
dims = ["time"],
coords = dict(
time = time_dt64,
... | |
<reponame>Paveloki/BangNasdaq
import functions as ft
import data as dt
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import plotly.express as px
from dash.dependencies import Input, Output
from Sentiments_download import get_tweets
import pand... | |
Asian ideograph
0x274C73: (0x75D2, 0), # East Asian ideograph
0x21355E: (0x542E, 0), # East Asian ideograph
0x275A21: (0x8D45, 0), # East Asian ideograph
0x6F4C74: (0xB2EE, 0), # Korean hangul
0x234147: (0x91AD, 0), # East Asian ideograph
0x217D7C: (0x5B56, 0), # East Asian ideograph
0x214C75: (0x7669, 0), # Eas... | |
from itertools import count
import logging
import networkx
import ailment
from claripy.utils.orderedset import OrderedSet
from ...utils.graph import dfs_back_edges, subgraph_between_nodes, dominates, shallow_reverse
from .. import Analysis, register_analysis
from .utils import replace_last_statement
from .structurer... | |
`int`
The minimal amount of options to select. Can be in range [1:15]. Defaults to `1`.
max_values : `int
The maximal amount of options to select. Can be in range [1:25]. Defaults to `1`.
Class Attributes
----------------
type : ``ComponentType`` = `ComponentType.select`
The component's type.
"""
type = Comp... | |
<reponame>mongolab/mongoctl<gh_stars>10-100
__author__ = 'abdul'
import mongoctl.repository as repository
from cluster import Cluster
from mongoctl import users
from base import DocumentWrapper
from mongoctl.utils import *
from bson import DBRef
from mongoctl.config import get_cluster_member_alt_address_mapping
from... | |
# Copyright (c) <NAME>.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory.
""" Numpy based implementation of multi objective
Differential Evolution using either DE/rand/1 or DE/best/1 strategy ('best' refers to the current pareto front').
Can switch t... | |
<reponame>Seongioi/pyfite
# coordinates.py
# Copyright (c) 2020 Applied Research Associates, Inc.
# SPDX-License-Identifier: https://spdx.org/licenses/MIT.html
"""Provides classes for working with varying coordinate reference systems.
Supported types of coordinate reference systems are East-North-Up/Local Tangent Pla... | |
= (observer, task)
@listen.on(Hook.ApplicationPreReconcile)
@listen.on(Hook.ApplicationPreMigrate)
@listen.on(Hook.ApplicationPreDelete)
async def unregister_observer(controller, app, **kwargs):
"""Stop and delete the observer for the given Application. If no observer is
started, do nothing.
Args:
controller (Ku... | |
while str.startswith('0x'):
str, val1 = self.decodeintw(str)
val.append(val1)
self.amp_vals[dir].append(val)
def add_connection(self, line, conn):
line, count = self.decodeintw(line)
if count == -22: # driver was not able to read connections
count = 0
res = 0
if conn.startswith(' '):
conn = conn.strip()
res... | |
<filename>curiosity_mask/train_walker.py
import os
import sys
import warnings
import numpy as np
import tensorflow as tf
from gym.spaces import MultiDiscrete
import stable_baselines.common.walker_action_mask as walker
from stable_baselines import PPO2, A2C
from stable_baselines.common.policies import MlpPolicy
from st... | |
title="",
description=f"Their are no songs in your queue.")
await ctx.send(embed = update_embed)
else:
update_embed = discord.Embed(
colour=discord.Colour.green(),
title="",
description=f"Skipping song.")
await ctx.send(embed = update_embed)
#-----------------------------
await asyncio.sleep(5)
return
exce... | |
img (PIL Image): Image to be scaled.
Returns:
PIL Image: Rescaled image.
"""
return resize(img, self.size, self.interpolation)
class Scale(Resize):
"""
Note: This transform is deprecated in favor of Resize.
"""
def __init__(self, *args, **kwargs):
warnings.warn("The use of the transforms.Scale transform is ... | |
test_fns_fps(self, vgenotypes, matched_tgenotypes, tgenotypes,
expected_fns, expected_fps, expected_tps):
match = haplotype_labeler.HaplotypeMatch(
haplotypes=self.haplotypes,
candidates=[
_test_variant(42, ['A', 'G']),
_test_variant(43, ['G', 'A']),
],
candidate_genotypes=vgenotypes,
truths=[
_test_variant(4... | |
contact_rights: The contact_rights of this PlatformRights. # noqa: E501
:type: ContactRights
"""
self._contact_rights = contact_rights
@property
def diagnostic_rights(self):
"""Gets the diagnostic_rights of this PlatformRights. # noqa: E501
Rights related to diagnostics. # noqa: E501
:return: Th... | |
next_child,
previous_deps, perform_checks):
return False
# Now do our analysis to figure out who we need to wait on locally
if not arrived or not projecting:
if not self.perform_epoch_analysis(op, req, perform_checks,
arrived, previous_deps):
return False
if arrived and not projecting:
# Add ourselves as the ... | |
negligible compared to UNO call. So we do all
# possible checks which can prevent an unnecessary cursor movement.
#
# Generally we need to expand or collapse selection to the desired
# size and move it to the desired position. But both of these actions
# can fail if there is not enough space. For this reason we mu... | |
self.float488, units_btn, ]
box520 = Box(children=row, layout=box_layout)
name_btn = Button(description='fluid_change_rate', disabled=True, layout=name_button_layout)
name_btn.style.button_color = 'tan'
self.float489 = FloatText(value='0.05', step='0.01', style=style, layout=widget_layout)
units_btn = Button(desc... | |
from manim import *
class ManimCELogo(Scene):
def construct(self):
self.camera.background_color = "#ece6e2"
logo_green = "#87c2a5"
logo_blue = "#525893"
logo_red = "#e07a5f"
logo_black = "#343434"
ds_m = MathTex(r"\mathbb{M}", fill_color=logo_black).scale(7)
ds_m.shift(2.25 * LEFT + 1.5 * UP)
circle = Circle... | |
"""Value related classes.
DOM Level 2 CSS CSSValue, CSSPrimitiveValue and CSSValueList are **no longer**
supported and are replaced by these new classes.
"""
__all__ = ['PropertyValue',
'Value',
'ColorValue',
'DimensionValue',
'URIValue',
'CSSFunction',
'CSSCalc',
'CSSVariable',
'MSValue'
]
__docformat__ = 'r... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Name: <NAME>
# Date: October 11, 2019
# Email: <EMAIL>
# Description: Implementation of the continuous rate RNN model
import os, sys
import numpy as np
import tensorflow as tf
import scipy.io
import pickle
np.random.seed(700)
# import horovod.tens... | |
#!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... | |
ssh_private_key_path = os.path.splitext(ssh_public_key_path)[0]
if ssh_private_key_path == ssh_public_key_path:
ssh_private_key_path = ssh_public_key_path + ".private"
# Create path
key_path = os.path.dirname(
os.path.abspath(ssh_private_key_path))
Path(key_path).mkdir(parents=True, exist_ok=True)
# W... | |
import textwrap as tw
import re
###############################################################################
#Supporting Imports
###############################################################################
import numpy as np
import pandas as pd
###################################################################... | |
<reponame>appditto/blaise_wallet_server
#!/usr/bin/env python
import argparse
import asyncio
import ipaddress
import json
import logging
import os
import sys
import time
import datetime
import uuid
from logging.handlers import TimedRotatingFileHandler, WatchedFileHandler
import aiofcm
import uvloop
from aiohttp import... | |
"""Blueprint for a micropub endpoint implementation.
Kept separate from indieauth, but note that it must know of the indieauth token
endpoint in advance, so there is some coupling.
"""
import json
import os.path
import re
import typing
from urllib.parse import unquote
from flask import (
Blueprint,
Request,
curre... | |
'')]
# skip the op itself and the root group which cannot be retrived via name.
for group_name in task_name_to_parent_groups[task.name][1:-1]:
parent_components_and_tasks.append(
(component_utils.sanitize_component_name(group_name),
component_utils.sanitize_task_name(group_name)))
# Reverse the order to make the ... | |
self._confDict['global'].items():
value = self._validateSetting('global', key, value)
setattr(self, key, value)
del self._confDict['global']
if 'default' in self._confDict:
del self._confDict['default']
tempsamples = [ ]
tempsamples2 = [ ]
stanza_map = {}
stanza_list = []
for stanza in self._confDict.keys()... | |
# Copyright 2017-2019 Lenovo
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
#!/bin/python3
'''
Title: build-fortress.py
Purpose: Build the infosec-fortress
Author: <NAME> (DFIRmadness)
Contributors: Check the github page.
Notes: Beta
Version: 0.5
Usage: ./build-fortress.py
Functions:
+ apt update
+ dist upgrade
+ install base packages
+ create /opt/infosec-fortress
+ start log
+ install start... | |
two arms
elif array == 'mwa':
antloc=1e3*n.array([[0,0]])
self.nants = len(antloc)
print 'Initializing nants:', self.nants
blarr = []; u = []; v = []; w = []
for i in range(1, self.nants+1):
for j in range(i, self.nants+1):
blarr.append([i,j])
u.append(antloc[i-1][0] - antloc[j-1][0]) # in meters (like MS, fwi... | |
<filename>statistics/diffNuisances.py
#!/usr/bin/env python
import re
from sys import argv, stdout, stderr, exit
import datetime
from optparse import OptionParser
import HiggsAnalysis.CombinedLimit.calculate_pulls as CP
# tool to compare fitted nuisance parameters to prefit values.
#
# Also used to check for potentia... | |
value=value)
data = assign_params(batch_id=api_iocviewrecord_batch_id, created_by=api_iocviewrecord_created_by, created_timestamp=api_iocviewrecord_created_timestamp, description=api_iocviewrecord_description, expiration_days=api_iocviewrecord_expiration_days, expiration_timestamp=api_iocviewrecord_expiration_timestam... | |
from inspect import signature
import random as rand
def P(S):
T = set()
for i in range(1 << len(S)):
T.add(frozenset(list(S)[s] for s in range(len(S)) if (i & (1 << s))))
return T
class L:
def __init__(self, M):
self.__w = ''
self._M = tuple()
self.__name__ = type(self).__name__
if type(M) in {tuple}:
if le... | |
'-value', 'false')
# Adding overlay 1 for protectionLsp
ovrly = ixNet.add(protectionLspMv, 'overlay')
ixNet.setMultiAttribute(ovrly,
'-count', '1',
'-index', '1',
'-indexStep', '0',
'-valueStep', 'true',
'-value', 'true')
ixNet.commit()
# Adding overlay 2 for protectionLsp
ovrly = ixNet.add(protectio... | |
of mvsfunc matches the specified version requirements.
## For example, if you write a script requires at least mvsfunc-r5, use mvf.CheckVersion(5) to make sure r5 or later version is used.
################################################################################################################################
##... | |
from __future__ import absolute_import
import re
import sys
import copy
import codecs
import itertools
from . import TypeSlots
from .ExprNodes import not_a_constant
import cython
cython.declare(UtilityCode=object, EncodedString=object, bytes_literal=object, encoded_string=object,
Nodes=object, ExprNodes=object, Pyre... | |
CBreakPointsManager:
def __init__(self):
self.m_break_info_manager = CBreakInfoManager()
self.m_active_break_points_by_file = {}
self.m_break_points_by_function = {}
self.m_break_points_by_file = {}
self.m_break_points_by_id = {}
self.m_lock = threading.Lock()
self.m_temp_bp = None
self.m_fhard_tbp = False
... | |
#
0x00, 0x00, #
0x00, 0x00, #
0x07, 0xC0, # OOOOO
0x1F, 0xF0, # OOOOOOOOO
0x3C, 0x78, # OOOO OOOO
0x7B, 0x3C, # OOOO OO OOOO
0x73, 0x9C, # OOO OOO OOO
0xF3, 0x9E, # OOOO OOO OOOO
0xF3, 0x9E, # OOOO OOO OOOO
0xF0, 0x9E, # OOOO O OOOO
0xF8, 0x9E, # OOOOO O OOOO
0xFF, 0x9E, # OOOOOOOOO OOOO
0x7F, 0x3C... | |
in deps:
xctags=deps['compiler'].get('tags','')
if xctags!='':
xctags+=','
xctags+=ctags
deps['compiler']['tags']=xctags
# Check user-friendly deps
for q in preset_deps:
if q in deps:
deps[q]['uoa']=preset_deps[q]
ii={'action':'resolve',
'module_uoa':cfg['module_deps']['env'],
'host_os':hos,
'target_os':... | |
'RT ION PLAN IOD': ['Equipment'],
'X-RAY ANGIOGRAPHIC IMAGE IOD': ['Equipment'],
'CT IMAGE IOD': ['Equipment'],
'VL WHOLE SLIDE MICROSCOPY IOD': ['Equipment'],
'RT ION BEAMS TREATMENT RECORD IOD': ['Equipment'],
'OPHTHALMIC VISUAL FIELD STATIC PERIMETRY MEASUREMENTS IOD': ['Equipment'],
'XA/XRF GRAYSCALE SOFTCOPY... | |
<gh_stars>0
from collections import defaultdict
import numpy as np
from textx import metamodel_from_str
# Grammar for processor's DSL
grammar = """
Program:
lines*=CommandLine[/\r\n|\n/]
;
CommandLine:
commands+=Command[';']
;
Command:
Conditional | Basic | Halt
;
Conditional:
If | While | DoWhile | JumpIf
;
Basic... | |
Check whether there are any (unknown) tags left in the list
if attack_keys:
raise_flag("Unknown tag(s) in section '{0}', subsection '{1}' for task '{2}' of guest '{3}': {4}".format(Storyboard.GUEST_SETTINGS, Storyboard.TASKS, Storyboard.EMULATE_ATTACK, guest_id, attack_keys))
task_keys.remove(Storyboard.EMULATE_ATT... | |
= self.auth_token
if self.product_instance_id is not None:
result['product_instance_id'] = self.product_instance_id
if self.terminal_identity is not None:
result['terminal_identity'] = self.terminal_identity
if self.data_user_identity is not None:
result['data_user_identity'] = self.data_user_identity
if self.da... | |
re.sub('(D)(?![a-z])', '[2H]', formula)
# arithmetic
formula = formula.replace('.', '+')
if '+' in formula:
for match in re.findall(
r'(?:\+|^)((\d+)\*?(.*?))(?:(?=\+)|$)', formula
):
formula = formula.replace(match[0], f'({match[2]}){match[1]}')
formula = formula.replace('+', '')
if '-' in formula:
FormulaE... | |
# 调整离散日期的base_time为现在的上一个日期
def adjust_base_to_previous(self):
if self.base_time > self.now:
self.base_time -= relativedelta(
years=self.period[0],
months=self.period[1],
days=self.period[2],
seconds=self.period[3],
)
# 类似"(年.)月.日"的处理
def parse_input_0(self):
if self.data["year"]:
self.base_time = datetime... | |
each column in <report_cols>.
:param scale_metric: list of {'median_actuals', 'median_preds', 'mean_actuals', 'mean_preds', 'std_actuals', 'std_preds', 'count'},
For each plot (i.e., for each <score_metric>) there will be a scaled line representing one of these values for the <bin_column>. So,
within each bin, what ... | |
augment_imgaug,
'augment_raw': augment_raw}
load_labels_dict = {'per_video': load_labels_video,
'per_frame': load_labels_frame,
'mem': load_labels_mem,
'mem_alpha': load_labels_mem_alpha,
'as_list': load_labels_as_list}
## Reading files to load from txt file
# start=timer()
if has_label_col:
if self.files i... | |
3, 0, 3): (0, 1),
(8, 3, 0, 4): (0, 1),
(8, 3, 0, 5): (0, 1),
(8, 3, 1, -5): (0, 1),
(8, 3, 1, -4): (0, 1),
(8, 3, 1, -3): (0, 0),
(8, 3, 1, -2): (1, 1),
(8, 3, 1, -1): (0, 1),
(8, 3, 1, 0): (-1, 1),
(8, 3, 1, 1): (-1, 1),
(8, 3, 1, 2): (-1, 1),
(8, 3, 1, 3): (-1, 1),
(8, 3, 1, 4): (-1, 1),
(8, 3, 1, 5): (... | |
<reponame>EternalDeiwos/rhodes-hvz<gh_stars>0
from __future__ import division
from django.db import models
from django.db.models import Q
from django.db import transaction
from django.conf import settings
from django.utils import timezone
from geoposition.fields import GeopositionField
from uchicagohvz.overwrite_fs imp... | |
<gh_stars>0
import time
import sys
import copy
from decimal import Decimal
import ujson
import click
from web3 import Web3
from .utils import (
add_0lt,
remove_0x,
to_wei,
pretty_float,
)
class UniswapUtils:
@staticmethod
def _get_change(current, previous):
if current == previous:
return 0
try:
return ro... | |
from neuralintents import GenericAssistant
import speech_recognition as sr
import pyttsx3 as tts
import datetime
import sys
from datetime import datetime
import wikipedia
import webbrowser
import os
import smtplib
from pywikihow import search_wikihow
import time
import requests
from bs4 import BeautifulSoup
from google... | |
<reponame>nickpartner-goahead/resilient-community-apps
# (c) Copyright IBM Corp. 2010, 2021. All Rights Reserved.
# -*- coding: utf-8 -*-
import logging
import sys
if sys.version_info.major >= 3:
from urllib.parse import quote as url_encode
else:
from urllib import quote as url_encode
import datetime
from pytz import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.