input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""
********************************************************************************
* Name: gen_commands.py
* Author: <NAME>
* Created On: 2015
* Copyright: (c) Brigham Young University 2015
* License: BSD 2-Clause
********************************************************************************
"""
import os
import st... | |
possible values are ``host-header`` and ``path-pattern`` .
- **Values** *(list) --*
The condition value.
If the field name is ``host-header`` , you can specify a single host name (for example, my.example.com). A host name is case insensitive, can be up to 128 characters in length, and can contain any of the followin... | |
from the original dataset and returns a transformed version.
:param target_transform: A function/transform that takes in the target
and transforms it.
:param transform_groups: A dictionary containing the transform groups.
Transform groups are used to quickly switch between training and
eval (test) transformations.... | |
all the differences between connected nodes of the graph.
penalty_start : Non-negative integer. The number of columns, variables
etc., to be exempt from penalisation. Equivalently, the first index
to be penalised. Default is 0, all columns are included.
"""
def __init__(self, l=1.0, A=None, penalty_start=0):
s... | |
<filename>src/keri/app/agenting.py<gh_stars>0
# -*- encoding: utf-8 -*-
"""
KERI
keri.app.agenting module
"""
import random
from hio.base import doing
from hio.core import http
from hio.core.tcp import clienting
from hio.help import decking
from . import httping
from .. import help
from .. import kering
from ..app i... | |
<reponame>ciresdem/noslib<filename>noslib.py
#!/usr/bin/env python
### noslib.py
##
## Copyright (c) 2012, 2013, 2014, 2016, 2017, 2018 <NAME> <<EMAIL>>
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
#... | |
helper for :func:`convertFromString` that adds attributes from ``m21Attr`` to the
appropriate elements in ``documentRoot``. The input is a :class:`MeiToM21Converter` with data
about the file currently being processed. This function reads from ``theConverter.m21Attr`` and
writes into ``theConverter.documentRoot``.
... | |
<filename>captum/attr/_core/occlusion.py
#!/usr/bin/env python3
import torch
import numpy as np
from .._utils.common import (
_format_input,
_format_and_verify_strides,
_format_and_verify_sliding_window_shapes,
)
from .feature_ablation import FeatureAblation
class Occlusion(FeatureAblation):
def __init__(self,... | |
atomName1="NE2" atomName2="HE21"/>
<Bond atomName1="NE2" atomName2="HE22"/>
<Bond atomName1="C" atomName2="O"/>
<ExternalBond atomName="N"/>
<ExternalBond atomName="C"/>
</Residue>
<Residue name="GLU">
<Atom charge="-0.5163" name="N" type="N238"/>
<Atom charge="0.2936" name="H" type="H241"/>
<Atom charge="0.03... | |
is present.")
print(f"If the needed {object_type} is missing, please create it.")
print("Once the issue has been resolved, re-attempt execution.\n")
sys.exit(0)
else:
print("\nA configuration error has occurred!\n")
print(f"The provided {object_type} named '{object_name}' was not "
"found.")
print(f"No ... | |
<filename>hvac/api/secrets_engines/kv_v2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""KvV2 methods module."""
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
DEFAULT_MOUNT_POINT = 'secret'
class KvV2(VaultApiBase):
"""KV Secrets Engine - Version 2 (API).
Reference: https... | |
<reponame>sugatoray/alibi-detect
import numpy as np
from typing import Any, Callable, List, Optional, Union
from alibi_detect.cd.base_online import BaseUniDriftOnline
from alibi_detect.utils.misc import quantile
import numba as nb
from tqdm import tqdm
import warnings
class CVMDriftOnline(BaseUniDriftOnline):
def __... | |
<reponame>rjderosa/ImPlaneIA
#! /usr/bin/env python
# Mathematica nb from Alex & Laurent
# <EMAIL> major reorg as LG++ 2018 01
# python3 required (int( (len(coeffs) -1)/2 )) because of float int/int result change from python2
import numpy as np
import scipy.special
import numpy.linalg as linalg
import sys
from scipy.... | |
<filename>interlib/example.py
from interlib.utility import print_line
'''
. This keyword file is an exmaple keyword that will show
you how you can implement your own keyword to Pseudo.
What you will need to know is the interpret_state's
data, how to add to it before executing the interpretation
on the GUI/IDE,... | |
<reponame>gerow/hostap
# wpa_supplicant control interface
# Copyright (c) 2014, Qualcomm Atheros, Inc.
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import subprocess
import time
import hostapd
import hwsim_utils
fro... | |
import os
import time
import cStringIO
import subprocess
import signal
import libqtile
import libqtile.layout
import libqtile.bar
import libqtile.command
import libqtile.widget
import libqtile.manager
import libqtile.config
import libqtile.hook
import libqtile.confreader
import utils
from utils import Xephyr
from nose.... | |
is None:
r = (
radius
+ max(old_distance, self.distance) * (self.n - 1) * 0.5
+ max(old_w, self.w)
)
number_of_points = max(
6,
2
+ 2
* int(
0.5
* abs(final_angle - initial_angle)
/ numpy.arccos(1 - tolerance / r)
+ 0.5
),
)
pieces = (
1
if max_points == 0
else int(numpy.ceil(number_of_points / floa... | |
</span><span style=\" font-style:italic; color:#ff0000;\">φ</span><span style=\" color:#ff0000;\"> are in rad; </span><span style=\" font-style:italic; color:#ff0000;\">t</span><span style=\" color:#ff0000;\"> is in seconds</span></p></body></html>"))
self.ledt_phaseBMag.setToolTip(_translate("MainWindow", "The magnit... | |
<gh_stars>10-100
import random
import cv2
import imgaug.augmenters as iaa
import imgaug.parameters as iap
import numpy as np
import six.moves as sm
from PIL import Image, ImageEnhance, ImageOps
from scipy import ndimage
from torchvision.models.resnet import resnet34
class RotateCropResize(iaa.meta.Augmenter):
'''Cla... | |
<filename>cool/views/mixins.py
# encoding: utf-8
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils.translation import gettext as _, gettext_lazy
from rest_framework import fields
from rest_framework.exceptions import ValidationError as RestValidationError
from rest_... | |
<filename>python/pygame-1.9.1release/test/sprite_test.py
#################################### IMPORTS ###################################
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name ==... | |
<gh_stars>1-10
import unittest
import os
from operator import __mul__
import numpy as np
import cv2
from matplotlib import pyplot as plt
from pathlib import Path
import numpy as np
import json
from pybx import anchor
from pybx import vis
from pybx.basics import *
def test_all_nbs():
# !/usr/bin/env python
# coding:... | |
# -*- coding: utf-8 -*-
# Copyright CERN since 2018
#
# 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 agr... | |
dt): pass
b = BetterTry()
t = cls(1, 1, 1, tzinfo=b)
self.assertIs(t.tzinfo, b)
def test_utc_offset_out_of_bounds(self):
class Edgy(tzinfo):
def __init__(self, offset):
self.offset = timedelta(minutes=offset)
def utcoffset(self, dt):
return self.offset
cls = self.theclass
for offset, legit in ... | |
#!/usr/bin/env python3
import time
from matrix_client.client import MatrixClient
from matrix_client.api import MatrixRequestError
from requests.exceptions import ConnectionError, Timeout
import argparse
import random
from configparser import ConfigParser
import re
import traceback
import urllib.parse
import logging
imp... | |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Mapping, Optional, Sequence, Type, cast
from uuid import uuid4
from intelliflow.core.application.context.traversal import ContextVisitor
fr... | |
<reponame>Standard-Cognition/recursive-bayesian-filtering
'''
Statistics tools for tracking.
MIT License
Copyright (c) 2018 Standard Cognition
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 wit... | |
tar file.
Access to container metadata.
"""
def __init__(self, localrepo, container_id=None):
self.localrepo = localrepo
self.container_id = container_id
self.tag = ""
self.imagerepo = ""
def get_container_attr(self):
"""Get container directory and JSON metadata by id or name"""
if Config.location:
contain... | |
<reponame>godlovesdavid/Impulcifer
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.mlab import specgram
from matplotlib.ticker import LinearLocator, FormatStrFormatter, FuncFormatter
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unuse... | |
<filename>onlinejudge_command/subcommand/test.py<gh_stars>0
import argparse
import concurrent.futures
import contextlib
import enum
import json
import os
import pathlib
import platform
import subprocess
import tempfile
import threading
import traceback
from logging import getLogger
from typing import *
import onlineju... | |
from storage
"""
raise NotImplementedError
def start_full_verification(self) -> None:
""" Save full verification on storage
"""
self.add_value(self._running_full_verification_attribute, '1')
def finish_full_verification(self) -> None:
""" Remove from storage that the full node is initializing with a full veri... | |
# ================================================================
# Blue Gecko BLE API BGLib code generator: Python3 platform
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# ----------------------------------------------------------------
#
# CHANGELOG:
# 2020-08-03 - Ported to Blue Gecko (Kris Young)
# 2017-06-26 - Moved to ... | |
"k": "<KEY>"}
E_A3_vector = \
"<KEY> \
"6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ." \
"AxY8DCtDaGlsbGljb3RoZQ." \
"KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY." \
"U0m_YmjN04DJvceFICbCVQ"
E_A3_ex = {'key': jwk.JWK(**E_A3_key),
'protected': base64url_decode(E_A3_protected).decode('utf-8'),
'plaintex... | |
<gh_stars>100-1000
#/usr/bin/python
# -*- coding: utf-8 -*-
"""
.. currentmodule:: pylayers.antprop.radionode
.. autosummary::
:members:
"""
from __future__ import print_function
import doctest
import os
import glob
import os
import sys
import doctest
import numpy as np
if sys.version_info.major==2:
import ConfigP... | |
<gh_stars>0
"""
Class that applies the LIME framework to a collective classification task.
"""
import os
import random
import pandas as pd
from scipy.spatial.distance import pdist
from sklearn.linear_model import LinearRegression
import networkx as nx
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as... | |
general_questionnaires.exclude(visibility=Questionnaire.Visibility.HIDDEN)
contributor_questionnaires = contributor_questionnaires.exclude(visibility=Questionnaire.Visibility.HIDDEN)
general_questionnaires_top = [
questionnaire for questionnaire in general_questionnaires if questionnaire.is_above_contributors
]
g... | |
<reponame>kushckwl/TWLight<gh_stars>0
# -*- coding: utf-8 -*-
import json
import os
from jsonschema import validate
from jsonschema.exceptions import ValidationError as JSONSchemaValidationError
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from djang... | |
v.undef = self.undef
v.tcount = t
if self.dtype != 'station':
v.ycount = y
v.xcount = x
# if v.storage in ['99', '0']:
if v.storage in ['99', '0', '00', '000', '1', '11', '111']:
v.strPos = vs.zcount * self.zRecLength + vs.strPos
type1 = True
elif v.storage == '-1,20':
v.strPos = vs.zcount * self.zRecLeng... | |
<reponame>hmarko75/netapp-dataops-toolkit
"""NetApp DataOps Toolkit for Traditional Environments import module.
This module provides the public functions available to be imported directly
by applications using the import method of utilizing the toolkit.
"""
import base64
import functools
import json
import os
import ... | |
<gh_stars>1-10
#!/usr/bin/env python
#coding: utf-8
# === Back-end server for Pline web application ===
# http://plineapp.org/pline
# Compatible with Python 2.7+ and Python 3+
# <NAME> (andres.veidenberg[at]helsinki.fi), University of Helsinki, 2019
# Distributed under the MIT license [https://opensource.org/licenses/... | |
"""
A program to generate a set of mapping tiles from GMT.
Usage: make_gmt_tiles [-t] [-s <size>] [-v] <tile_dir> <stop_level> [<start_level>]
where <size> is the tile width/height in pixels (default 256)
<tile_dir> is the tile directory to create
<stop_level> is the maximum level number to create
<start_level> is... | |
<filename>client.py<gh_stars>0
#!/usr/bin/env python
from dotenv import load_dotenv
from requests.auth import HTTPBasicAuth
import argparse
import datetime
import errno
import requests
import signal
import sys, json, os
import time
import yaml
import re
#import pdb
load_dotenv()
# Remove proxy if set (as it might bl... | |
optimized by a Graph model is
the sum of all loss functions over the different outputs.
Inherits from `containers.Graph`.
'''
def compile(self, optimizer, loss, sample_weight_modes={}):
'''Configure the learning process.
# Arguments
optimizer: str (name of optimizer) or optimizer object.
See [optimizers](opti... | |
@property
def center(self):
return Vector.centroid(self.dots)
def concat(self):
return Vector(x_val=[xx for xx in self.x], y_val=[yy for yy in self.y])
def __str__(self):
st = '<Vector>'
for ss, vv in [
['x_val', self.x_val],
['y_val', self.y_val],
['dots', self.dots],
]:
st += f'\n\t.{ss}: {vv}'
st += '... | |
<filename>python/paddle_fl/mpc/data_utils/data_utils.py
# Copyright (c) 2020 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.o... | |
<filename>array_problems/Solutions.py
import collections
import heapq
from typing import List
def merge(intervals: List[List[int]]) -> List[List[int]]:
if not intervals:
return intervals
queue = [intervals[0]]
intervals.sort(key=lambda x: x[0])
index = 1
while index != len(intervals):
if intervals[index][0]... | |
# bulk_data_extraction/unbounce_connection.py
#*************************************************************************************
# Programmer: <NAME>
# Class Name: UnbounceConnection
# Super Class: None
#
# Revision Date Release Comment
# -------- ---------- ---------------------------------------------------------... | |
<gh_stars>1-10
"""
Models the proteome (non-pride) object.
"""
import json
import logging
import os
import string
from cutlass.iHMPSession import iHMPSession
from cutlass.Base import Base
from cutlass.aspera import aspera
from cutlass.Util import *
# pylint: disable=W0703, C1801
# Create a module logger named after ... | |
"""
Base settings to build other settings files upon.
"""
from datetime import timedelta
from pathlib import Path
import environ
from config.huey_app import huey
ROOT_DIR = Path(__file__).parents[2]
# boundlexx/)
APPS_DIR = ROOT_DIR / "boundlexx"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV... | |
assert_is_type(positive_response, bool)
assert_is_type(seed, int, None)
assert_is_type(seed_for_column_types, int, None)
check_frame_id(frame_id)
if randomize and value:
raise H2OValueError("Cannot set data to a `value` if `randomize` is true")
if (categorical_fraction or integer_fraction) and not randomize:
r... | |
self.datFile.write("%12.5e %12.5e %12.5e %12.5e \n" % (xtmp[1],xtmp[2],
vtmp[1]/scale,vtmp[2]/scale))
self.datFile.write("\n \n")
cmd = "set term x11 %i; plot \'%s\' index %i with vectors title \"%s\" \n" % (self.windowNumber(),
self.datFilename,
self.plotNumber(),
title+" max=(%s,%s,%s) " % (max_u,max_v,max_w)+... | |
# -*- coding: utf-8 -*-
import os
import time
import unittest
import inspect
from mock import patch
import requests
from configparser import ConfigParser
from kb_Amplicon.kb_AmpliconImpl import kb_Amplicon
from kb_Amplicon.kb_AmpliconServer import MethodContext
from installed_clients.authclient import KBaseAuth as _KB... | |
"bleach_scan_number",
0x40000014: "trigger_in",
0x40000015: "trigger_out",
0x40000016: "is_ratio_track",
0x40000017: "bleach_count",
0x40000018: "spi_center_wavelength",
0x40000019: "pixel_time",
0x40000021: "condensor_frontlens",
0x40000023: "field_stop_value",
0x40000024: "id_condensor_aperture",
... | |
- string of command to issue
# cur_idx - index of the current column
# new_idx - index of the new column
base_response = self._createBaseTable()
table = self._getTableFromResponse(base_response)
column = table.columnFromIndex(cur_idx)
column_name = column.getName(is_global_name=False)
num_rows = table.numRows()
... | |
"ref" in spec:
value = self.generate(
spec["ref"],
expected_type=type_,
spec_name_stack=spec_name_stack,
value_constraint=value_constraint
)
elif "oneOf" in spec:
# value of the "oneOf" property should be a list of specs.
sub_spec = random.choice(spec["oneOf"])
value = self.generate_from_spec(
sub_spec,
ex... | |
/alfacase_definitions/list_of_unit_for_length.txt
.. include:: /alfacase_definitions/list_of_unit_for_pressure.txt
.. include:: /alfacase_definitions/list_of_unit_for_dimensionless.txt
"""
reference_coordinate: Scalar = attr.ib(default=Scalar(0.0, "m"))
positions: Array = attr.ib(default=Array([], "m"))
fraction... | |
<reponame>pshchelo/vampy<gh_stars>1-10
#!/usr/bin/env python
'''Top frame of the VamPy application
'''
import glob, os
import wx
from numpy import empty
import matplotlib as mplt
mplt.use('WXAgg', warn=False)
from matplotlib import cm
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Fig... | |
<reponame>kavanase/DefectsWithTheBoys
"""
This module is Freysoldt correction for isotropic systems
1) Freysoldt correction for isotropic systems.
includes
a) PC energy
b) potential alignment by planar averaging.
If you use the corrections implemented in this module, cite
Freysoldt, Neugebauer, and <NAME>, Phys. Rev... | |
UUID and their human-readable label, creating a Credential
object to hold the UUID if necessary.
"""
username = authorization_data.get("username")
password = authorization_data.get("password")
if username and not password:
# The absence of a password indicates the username might
# be a persistent authdata token ... | |
# Copyright 2018,2019,2020,2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# 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
#
# U... | |
<reponame>kimgiftww/cs<filename>callbacks.py
from requirements import *
import plotly.express as px
import plotly.graph_objects as go
region_c = pd.read_pickle('data/hdg.pickle').region_c.dropna().unique()
region_c = np.sort(region_c)
region_cd = [{'label': i, 'value': i} for i in region_c]
rcl = list(region_c) # + ['A... | |
# %% [markdown]
# # Overview
# The notebook shows how to extract the segmentation map for the ships, augment the images and train a simple DNN model to detect them. A few additional tweaks like balancing the ship-count out a little better have been done.
# %% [markdown]
# ## Model Parameters
# We might want to adjust ... | |
__copyright__ = "Copyright (C) 2019 <NAME>"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | |
from utils.graph_utils import *
from copy import deepcopy
import random
# Generate the mask based on the valences and adjacent matrix so far
# For a (node_in_focus, neighbor, edge_type) to be valid, neighbor's color < 2 and
# there is no edge so far between node_in_focus and neighbor and it satisfy the valence constr... | |
<filename>WORC/WORC.py
#!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the... | |
ContainerBroker(fresh_db_path, account=acct, container=cont)
check_sharding_db_files(broker)
# force_db_file can be used to open db_path specifically
forced_broker = ContainerBroker(db_path, account=acct,
container=cont, force_db_file=True)
self.assertEqual(forced_broker.db_file, db_path)
self.assertEqual(forced... | |
<reponame>chrico7/data515_project
""" Performs King County real estate analysis.
Collects, cleans, aggregates, and visualizes King County real estate data
based on user-defined zip code and time window of interest. Data on the
parcels, buildings, and sales history is from the King County Assessor's
website while ... | |
the given STIX-2 Indicator to a VAST-compatible IoC and ingests it
via a VAST matcher.
@param vast_binary The vast binary command to use with PyVAST
@param vast_endpoint The endpoint of a running vast node ('host:port')
@param indicator The STIX-2 Indicator to query VAST for
"""
global logger, matcher_name
vast_... | |
<filename>opac/tests/test_interface_menu.py
# coding: utf-8
from flask import url_for, current_app
from flask_babelex import lazy_gettext as __
from .base import BaseTestCase
from . import utils
class MenuTestCase(BaseTestCase):
# Collection Menu
def test_alpha_link_is_selected_for_list_alpha(self):
"""
Verfi... | |
<gh_stars>10-100
# Copyright 2021 san kim
#
# 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 ... | |
# -*- coding: utf-8 -*-
import re
def File_NetOut(f, netno, name, net, total) :
for i, w in enumerate(net) :
if i > 0 :
f.write(', ')
if (i // 8) > 0 and (i % 8) == 0 :
f.write('\n')
f.write(w)
f.write('\n')
str = "##### NET No.{0:6d}, Name:{1:10s}, Parts:{2:6d}, Total:{3:8d} #####\n".format(netno, name, len(n... | |
fac.UpdateInstruction(cc_0, True) ]))
st_0._set_transitionSet(transitions)
return fac.Automaton(states, counters, True, containing_state=None)
DocumentedType._Automaton = _BuildAutomaton_()
def _BuildAutomaton_2 ():
# Remove this helper function from the namespace after it is invoked
global _BuildAutomaton_2
d... | |
from __future__ import division
import numpy as np
from numpy import pi, sqrt, exp, power, log, log10
import os
import constants as ct
import particle as pt
import tools as tl
##############################
# Preparing SKA configurations
##############################
def initialize():
"""This routine is suppose... | |
#!/usr/bin/env python
from __future__ import print_function, division
import os
import tarfile
import pandas as pd
import numpy as np
import gzip
import shutil
import itertools
import multiprocessing as mp
import astropy.units as u
from astropy.table import Table
from astropy.coordinates import SkyCoord
from astropy.... | |
#!/bin/bash/python
#==========================================
# QUANTIFICATION OF TURNOVER ALONG GRADIENTS
# By <NAME>
# Version 08-June-2018
# Built under python 2.7.11
# April 10th, 2017
#==========================================
##### TO DELETE####
# Not checked yet:
# changed taxaTable and metadata ... | |
terminate_parser = subparsers.add_parser('stop-ad',
description=terminate_commanddesc,
help=terminate_commanddesc)
terminate_parser.add_argument('id_prefix', metavar='ID', nargs='?', default=None,
help=('id of target workspace deployment'
' (can be unique prefix)'))
terminate_parser.add_argument('-f', '--force', ... | |
<filename>src/support.py
"""
Discord Pybot Support
~~~~~~~~~~~~~~~~~
Support File with stuff
:copyright: (c) 2021-2021 M2rsho
:license: MIT, see LICENSE for more details.
"""
if __name__ == "__main__":
print("Huh?")
exit
from datetime import datetime
from colorama import *
import yaml
from rand... | |
return pulumi.get(self, "swagger_uri")
@property
@pulumi.getter(name="aadAuthEnabled")
def aad_auth_enabled(self) -> Optional[bool]:
"""
Whether or not AAD authentication is enabled.
"""
return pulumi.get(self, "aad_auth_enabled")
@property
@pulumi.getter(name="appInsightsEnabled")
def app_insights_enabled(... | |
"""distutils.fancy_getopt
Wrapper around the standard getopt module that provides the following
additional features:
* short oraz long options are tied together
* options have help strings, so fancy_getopt could potentially
create a complete usage summary
* options set attributes of a dalejed-in object
"""
zaimpo... | |
<reponame>seawander/nmf_imaging
from NonnegMFPy import nmf
import numpy as np
import os
from astropy.io import fits
def columnize(data, mask = None):
""" Columnize an image or an image cube, excluding the masked out pixels
Inputs:
data: (n * height * width) or (height * width)
mask: height * width
Output:
column... | |
if board.arBoard[tcord] == EMPTY:
if (color == BLACK and 2 * 8 <= tcord < 3 * 8) or (
color == WHITE and 5 * 8 <= tcord < 6 * 8
):
flag = ENPASSANT
else:
raise ParsingError(
san,
_("pawn capture without target piece is invalid"),
board.asFen(),
)
else:
if not notat[-2:] in cordDic:
raise ParsingError(
san... | |
<gh_stars>1-10
# pylint: disable=all
# pylint: disable=missing-docstring
# flake8: noqa
import os
import tempfile
import unittest
import numpy as np
import tensorflow as tf
import tf_encrypted as tfe
from tf_encrypted.protocol.aby3 import ABY3
from tf_encrypted.protocol.aby3 import ARITHMETIC
from tf_encrypted.proto... | |
<reponame>sawway/skia-pathops<filename>tests/pathops_test.py
from pathops import (
Path,
PathPen,
OpenPathError,
OpBuilder,
PathOp,
PathVerb,
FillType,
bits2float,
float2bits,
ArcSize,
Direction,
simplify,
)
import pytest
class PathTest(object):
def test_init(self):
path = Path()
assert isinstance(pa... | |
+
(8*mckin**6)/mbkin**6 - mckin**8/mbkin**8 -
(12*mckin**4*np.log(mckin**2/mbkin**2))/mbkin**4))/(27*mckin) -
(640*np.pi**2*(1 - (8*mckin**2)/mbkin**2 + (8*mckin**6)/mbkin**6 -
mckin**8/mbkin**8 - (12*mckin**4*np.log(mckin**2/mbkin**2))/mbkin**4))/
27 - (131072*(1 - mckin/mbkin)**5*(np.log(2) + np.log(1 - mckin/mb... | |
target_ip, starting_port, ending_port):
#Default ports file reading
port_read_file = open('default_port/default_ports.txt', 'r')
some_read_port = port_read_file.read().split()
port_read_file.close()
#Default ports banner reading
banner_read_file = open('default_port/default_port_version.txt','r')
some_read_ba... | |
<gh_stars>1-10
# Copyright (c) 2012 Spotify AB
#
# 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 t... | |
[[1, 2, 3, 5], [1, 2, 3, 4]], [[1, 3], [1, 2]],
[[1, 2, 3, 5], [5, 3, 1, 2]])
outputs = ([2], [2], [0], [0], [4])
question_list.append(Question(readme, inputs, outputs, index=[0, 2],
id='wrong position'))
readme = 'Given a list of unique numbers, write a function to return ' \
'the position \nindex of the smalle... | |
% self.map['usUnits']['field_name']
raise WeeImportFieldError(_msg)
# we have a value but is it valid
if _raw_units in unit_nicknames:
# it is valid so use it
_units = _raw_units
else:
# the units value is not valid so raise an error
_msg = "Invalid unit system '%s'(0x%02x) mapped from data source. " \
"Check ... | |
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------
# Vulkan CTS
# ----------
#
# Copyright (c) 2015 Google Inc.
#
# 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 ... | |
<reponame>venaturum/piso
import numpy as np
import pandas as pd
import pytest
import piso
import piso.intervalarray as piso_intervalarray
from piso import register_accessors
register_accessors()
def get_accessor_method(self, function):
return {
piso_intervalarray.union: self.piso.union,
piso_intervalarray.inters... | |
<gh_stars>1-10
# Copyright (c) 2016 Civic Knowledge. This file is licensed under the terms of the
# MIT License, included in this distribution as LICENSE.txt
""" Code generation for processing columns
"""
import ast
def file_loc():
"""Return file and line number"""
import sys
import inspect
try:
raise Excepti... | |
<filename>library/genome_selection/strategy.py
"""
Genome selection strategies.
:Authors:
<NAME> <<EMAIL>>
"""
import os
import pickle
import sys
from collections import Counter, defaultdict
from itertools import accumulate, chain
from random import random, shuffle
import numpy as np
from sklearn.cluster import Agg... | |
tabla " + nodo.id + " ya existe. \n"
def AlterDatabase(nodo, tablaSimbolos):
global consola
if nodo.rename:
b = jBase.alterDatabase(nodo.id.valor, nodo.idnuevo)
if b == 0:
base = tablaSimbolos.renameBase(nodo.id.valor, nodo.idnuevo)
if base:
for fk in listaFK:
if fk.idbase == nodo.id.valor:
fk.idbase = nodo.... | |
+ o0oOOo0O0Ooo - Oo0Ooo
iII1iI1IIiI . request_nonce_sent = None
lisp . lprint ( "Stop request-nonce mode for {}" . format ( lisp . red ( iII1iI1IIiI . rloc_str , False ) ) )
if 27 - 27: OoO0O00 + OoOoOO00 * ooOoO0o
iII1iI1IIiI . last_good_echo_nonce_rcvd = lisp . lisp_get_timestamp ( )
else :
o0o = "none"
if ( i... | |
save_nifti = True if options['debug'] is True else False
t1 = test_scan(model,
test_x_data,
options,
save_nifti=save_nifti, cuda=cuda)
# second network
options['test_name'] = options['experiment'] + '_prob_1.nii.gz'
model= models[1]
t2 = test_scan(model,
test_x_data,
options,
save_nifti=True,
candidate_m... | |
**kwargs): # noqa: E501
"""Unbookmark run # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.unbookmark_run(owner, entity, uuid, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request a... | |
import pygame
import random
import yaml
import os
import Objects
OBJECT_TEXTURE = os.path.join("texture", "objects")
ENEMY_TEXTURE = os.path.join("texture", "enemies")
ALLY_TEXTURE = os.path.join("texture", "ally")
def create_sprite(img, sprite_size, mmp_tile):
icon = pygame.image.load(img).convert_alph... | |
<reponame>theislab/disent
import os
from random import shuffle
import anndata
import numpy as np
import scanpy as sc
from matplotlib import pyplot as plt
from scipy import sparse
from sklearn import preprocessing
import pandas as pd
def data_remover(adata, remain_list, remove_list, cell_type_key, condition_key):
""... | |
# MIT License
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | |
import io
from PIL import Image
import logging
import os
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.dependencies import Input, Output, State
from demo_dash import header_v3 as header
from database import query_database, query_reid... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.