input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>riptable/rt_itemcontainer.py
__all__ = [ 'ItemContainer', ]
import numpy as np
import warnings
import re
from riptable.rt_enum import ColumnAttribute
ATTRIBUTE_LABEL = "Label"
ATTRIBUTE_SUMMARY = "Right"
ATTRIBUTE_FOOTER = "Footer"
ATTRIBUTE_MARGIN_COLUMN = "MarginColumn"
ATTRIBUTE_NUMBER_OF_FOOTER... | |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import boto3
import json
import re
from datetime import datetime, date
from botocore.config import Config
from botocore.parsers import ResponseParserError
import urllib3.util
# Disable insecure warnings
urllib3.disable... | |
'ref', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'title': {'key': 'title', 'type': 'str'},
'items': {'key': 'items', 'type': 'SwaggerSchema'},
'properties': {'key': 'properties', 'type': '{SwaggerSchema}'},
'additional_properties': {'key': 'additionalProperties', 'type': 'object'},
'required': {'key... | |
return None
return self.cursor.fetchone()[0]
def get_HEAD(self, group_name, id):
forum_id = self.get_forum(group_name)
prefix = settings.phpbb_table_prefix
stmt = """
SELECT
A.post_id,
C.username,
C.user_email,
CASE WHEN A.post_subject = '' THEN CONCAT('Re: ', E.topic_title) ELSE A.post_subject END,
A.post_... | |
<reponame>lucasb-eyer/DeepFried
#!/usr/bin/env python3
import DeepFried.util as _u
import numpy as _np
import theano as _th
import theano.tensor as _T
class StreaMiniOptimizer(object):
"""
This is an optimizer that works through minibatches of the dataset, each
minibatch being uploaded onto the GPU each time.
... | |
driver_add(self):
'''
'''
pass
def driver_remove(self):
'''
'''
pass
def get(self):
'''
'''
pass
def is_extended(self):
'''
'''
pass
def is_property_hidden(self):
'''
'''
pass
def is_property_overridable_library(self):
'''
'''
pass
def is_property_readonly(self):
'''
'''
p... | |
<filename>deprecated/PPO_network.py
import random
import os
import time
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from collections import deque
from torch.distributions import Categorical
# import matplotlib.pyplot as plt
def convert_state_to_tensor(state):
state_representat... | |
<filename>tests/ethereum/EVM/test_EVMEXP.py
import struct
import unittest
import json
from manticore.platforms import evm
from manticore.core import state
from manticore.core.smtlib import Operators, ConstraintSet
import os
class EVMTest_EXP(unittest.TestCase):
_multiprocess_can_split_ = True
maxDiff = None
def _... | |
<gh_stars>1-10
# coding=utf-8
# Copyright 2022 The Fiddle-Config Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
chats_all = {}
bot = self.info
if isinstance(bot, BotInfo):
bot = ChatMember(
description=bot.description, user_id=bot.user_id, name=bot.name, username=bot.username,
is_bot=bot.is_bot, last_activity_time=bot.last_activity_time,
avatar_url=bot.avatar_url, full_avatar_url=bot.full_avatar_url,
last_access_time=0, i... | |
<reponame>hyan15/proxyscrape
# MIT License
#
# Copyright (c) 2018 <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 us... | |
import os
import sys
import json
import functools
from traceback import format_exc
import mimetypes
import time
import itertools
from urllib.parse import urljoin
from .helpers import (
cached_property, WSGIFileWrapper, parse_range_header,
parse_date, html_escape, tob
)
from .radirouter import RadiRouter
from .reques... | |
<reponame>liamchalcroft/nitorch
# -*- coding: utf-8 -*-
"""Spatial deformations (i.e., grids)."""
import torch
from nitorch.core import utils, linalg
from nitorch.core.utils import expand, make_vector
from nitorch.core.py import make_list, prod
from nitorch._C.spatial import BoundType, InterpolationType
from nitorch._... | |
central_longitude=0.0, central_latitude=0.0,
false_easting=0, false_northing=0, globe=None,
sweep_axis=None):
proj4_params = [('proj', projection), ('lon_0', central_longitude),
('lat_0', central_latitude), ('h', satellite_height),
('x_0', false_easting), ('y_0', false_northing),
('units', 'm')]
if sweep_axis:
... | |
k in range(nlay):
# for i in range(self.nrow):
# for j in range(self.ncol):
# if ibound[k, i, j] == 0:
# continue
#
# ivert = []
# pts = self.get_vertices(i, j)
# pt0, pt1, pt2, pt3, pt0 = pts
#
# z = bot[k, i, j]
#
# verts[ipoint, 0:2] = np.array(pt1)
# verts[ipoint, 2] = z
# ivert.append(ipoint)
# ipoi... | |
bool]:
'''
Takes an 4x2 array with UV coordinates of 4 points (left bottom,
right bottom, right top, left top) and checks if they're mapped to
rectangular shape. The rectangle can have any width and height (
including negative values) but can't be rotated.
Returns 3 flags:
1. Whether the object is a cuboid.
-... | |
<gh_stars>0
# engineer_number module
#
# Copyright (c) 2012-2017 梅濁酒(umedoblock)
#
# This software is released under the MIT License.
# https://github.com/umedoblock/engineer_number
import os, sys, math
import unittest
from test import support
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
fr... | |
<reponame>Pe8er/dotfiles
#!/usr/bin/env python3
#
# fusée gelée
#
# Launcher for the {re}switched coldboot/bootrom hacks--
# launches payloads above the Horizon
#
# discovery and implementation by @ktemkin
# likely independently discovered by lots of others <3
#
# this code is political -- it stands with those who figh... | |
any processes.', msgs)
# Give user explicit permissions to list
await core.addUserRule(bond.iden, (True, ('task', 'get')))
# Match all tasks
msgs = await alist(prox.storm(f"ps.kill ''"))
self.stormIsInErr('Provided iden matches more than one process.', msgs)
msgs = await alist(prox.storm('ps.list'))
self.stor... | |
50*m.x176 + m.x316 <= 0)
m.c2319 = Constraint(expr= - 50*m.x177 + m.x317 <= 0)
m.c2320 = Constraint(expr= - 50*m.x178 + m.x318 <= 0)
m.c2321 = Constraint(expr= - 50*m.x179 + m.x319 <= 0)
m.c2322 = Constraint(expr= - 50*m.x180 + m.x320 <= 0)
m.c2323 = Constraint(expr= - 50*m.x181 + m.x321 <= 0)
m.c2324 = Constrain... | |
XXXXXXXXXX XX XXXXXXXXXXXXXXXXXXXXX XXXXXXXX XXXX XXXXXXXX
XXX XXXXX XX XXX XXXX XX XX XXXXXXXX XXXXX XXXXXX XXXXXXXX XX XXXXXXXXX XXXXX
XXXX XXXX XXXXXXXXXX XXXXXXXXXXXXXX XXX XXXX XX XXXXXXXXXXXXXXXX XX XXXXXX
XXXXXXXXXXXXX XX XXXXXXXXXXXXXXXXXX
XXXXX XXXXXXXXXXXXXXX XXXXX XXXX X XXXX XXXXXXXXXX XXXX XXXXXXXXX XXXXX... | |
<reponame>gurlinthewurld/eden
# -*- coding: utf-8 -*-
""" Sahana Eden Deployments Model
@copyright: 2011-2013 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in... | |
<gh_stars>0
# MINLP written by GAMS Convert at 08/20/20 01:30:49
#
# Equation counts
# Total E G L N X C B
# 394 46 316 32 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 215 155 60 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 1004 914 ... | |
import PythonQt
from PythonQt import QtCore, QtGui
import director.objectmodel as om
import director.visualization as vis
from director import affordanceitems
from director import callbacks
from director import cameracontrol
from director import splinewidget
from director import transformUtils
from director.debugpolyda... | |
command)
# and return the answer
rawanswer = session.recvmessage(serversocket)
serversocket.close()
return rawanswer
def parse_manifest(rawmanifestdata):
"""
<Purpose>
Given raw manifest data, returns a dictionary containing a manifest
dictionary.
<Arguments>
rawmanifestdata: a string containing the ... | |
FTPMockFactory.create("doaj")
job = models.BackgroundJob()
url = "ftp://upload"
file_upload = models.FileUpload()
file_upload.set_id()
file_upload.upload("testuser", url, status="exists")
file_upload.set_schema("doaj")
upload_dir = app.config.get("UPLOAD_DIR")
path = os.path.join(upload_dir, file_upload.loc... | |
contactgroup = next((cg for cg in cgroups if cg.get("name") == Config.guild_contact_channel_group), None)
if contactgroup is None:
log.debug("Can not find a group '%s' for guild contacts. Skipping.", contactgroup)
else:
for c in contacts:
with self.dbc.lock:
accs = [row[0] for row in self.dbc.cursor.execute("SEL... | |
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import pylab
import cv2
import math
# import Polygon as plg
# from tqdm import tqdm
from pycocotools.coco import COCO
from .custom import CustomDataset
from .custompolarmask import CustomDatasetpolarmask
from ... | |
"metadataonly",
("prop", "1954:98"): "metadataonly",
("prop", "1954:99"): "metadataonly",
("prop", "1955:10"): "metadataonly",
("prop", "1955:101"): "metadataonly",
("prop", "1955:102"): "metadataonly",
("prop", "1955:104"): "metadataonly",
("prop", "1955:105"): "metadataonly",
("prop", "1955:106"): "metadataon... | |
<reponame>tomdoherty/salt
"""
Test case for the consul execution module
"""
import logging
import pytest
import salt.modules.consul as consul
import salt.utils.http
import salt.utils.json
import salt.utils.platform
from salt.exceptions import SaltInvocationError
from tests.support.mock import MagicMock, patch
log =... | |
<reponame>HanseMerkur/nitro-python<gh_stars>1-10
#
# Copyright (c) 2008-2015 Citrix Systems, 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 of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | |
import ast
import re
from math import ceil, floor
import simpleeval
from simpleeval import DEFAULT_NAMES, EvalWithCompoundTypes, IterableTooLong, SimpleEval
from api.avrae.cogs5e.funcs.dice import roll
from api.avrae.cogs5e.models.errors import ConsumableException, EvaluationError, FunctionRequiresCharacter, InvalidA... | |
####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
from django.db.mode... | |
#!/usr/bin/env python3
import datetime
import deconzapi
import docker
import logging
import os
import requests
import sh
import subprocess
import sys
import telegram
import voluptuous as vol
import yaml
from logging.handlers import RotatingFileHandler
from nsenter import Namespace
"""
requirements.txt:
docker==4.2.0... | |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: base_doc.py
# License: LICENSE.TXT
#
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
import re
from definition_ite... | |
rpm for each motor
rpm = super().before_step(action)
# Determine disturbance force.
disturb_force = None
passive_disturb = "dynamics" in self.disturbances
adv_disturb = self.adversary_disturbance == "dynamics"
if passive_disturb or adv_disturb:
disturb_force = np.zeros(2)
if passive_disturb:
disturb_force = se... | |
"""
depends = []
"""List of other action classes to be executed before this one.
The ``depends`` class attribute contains a list of other action
classes that need to be executed before this one is. Actions which
depend on another will be executed after those actions are
executed.
Omit if you don't care about... | |
<gh_stars>1-10
#!/usr/bin/env python3
# coding=utf-8
"""
@author: guoyanfeng
@software: PyCharm
@time: 18-12-25 下午3:56
"""
import atexit
from collections.abc import MutableMapping, MutableSequence
from typing import Dict, List, Optional, Tuple, Union
import aelog
# noinspection PyProtectedMember
from bson import Obj... | |
of the sequence to find.
http://www.nslc.wustl.edu/elgin/genomics/bio4342/1archives/2006/AccReference.pdf
*keyword args*
**savetofile**, true or false to save the gb file in the same directory as sms for future use
'''
Entrez.email = "<EMAIL>"
Entrez.tool = 'SingleMoleculeSimulator'
er = False
try:
h... | |
#!/usr/bin/env python3
from __future__ import print_function
import sys
import time
import argparse
import threading
try:
import readline
except:
pass
import mufsim.stackitems as si
import mufsim.gamedb as db
import mufsim.utils as util
from mufsim.logger import log, warnlog, set_output_command
from mufsim.compil... | |
of size
n_triplets x ... x n_win x (nchan+npad) x n_t.
'lag_corr_length'
[numpy array] It is the correlation timescale (in
pixels) of the subband delay spectra. It is
proportional to inverse of effective bandwidth. It
is of size n_win. The unit size of a pixel is
determined by the difference between adjacent... | |
'''
Originally part of the pynbody package. Modified to support pymses units
'''
import numpy as np
import weakref
import os
from pynbody import units
_units = units
# from .backcompat import property
from pynbody.backcompat import fractions
import atexit
import functools
# from seren3.utils.constants import unit_str... | |
#/*
# * Copyright (c) 2019,2020 Xilinx Inc. All rights reserved.
# *
# * Author:
# * <NAME> <<EMAIL>>
# *
# * SPDX-License-Identifier: BSD-3-Clause
# */
import copy
import struct
import sys
import types
import unittest
import os
import getopt
import re
import subprocess
import shutil
from pathlib import Path
from path... | |
num_zero_pad)
lm_label_ids.extend([self.pad_id] * num_zero_pad)
return [input_ids, segment_ids, input_mask, is_random_next, lm_label_ids]
def get_random_token_id(self):
return self.tokenizer.get_random_token_id()
def __str__(self):
name, _ = os.path.splitext(os.path.basename(self.dataset_path))
return name
... | |
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
from torch.distributions.utils import log_sum_exp
from torch import optim
from torch.autograd import Variable
import util
import coref_ops
import conll
import metrics
import scipy.misc as sp
class CorefModel(nn.Module):
def __in... | |
most the number of
elements in the array.
Returns
-------
indices : array
The indices in which the array should be split.
Notes
-----
Solution from https://stackoverflow.com/a/54024280
"""
array = np.atleast_1d(array).ravel()
if parts > array.size:
raise ValueError(
"Cannot partition an array of size {} in... | |
##############################################################################
# Copyright (C) 2008 Novell Inc. All rights reserved.
# Copyright (C) 2008 SUSE Linux Products GmbH. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the... | |
def p_assumed_shape_spec_1(p):
'assumed_shape_spec : COLON'
pass
def p_assumed_shape_spec_2(p):
'assumed_shape_spec : lower_bound COLON'
pass
def p_assumed_shape_spec_list(p):
'''assumed_shape_spec_list : explicit_shape_list COMMA assumed_shape_spec
| explicit_shape
'''
if len(p) < 4: p[0] = [p[1]]
else:
... | |
"""Support for HomeMatic devices."""
from datetime import timedelta, datetime
from functools import partial
import logging
import voluptuous as vol
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
CONF_HOST,
CONF_HOSTS,
CONF_PASSWORD,
CONF_PLATFORM,
CONF_SSL,
CONF_USERNAME,
CONF_VERIFY_SSL,
EVEN... | |
"'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find('\n') == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
def get_all_text_(node):
if node.text is not None:
text = node.text
else:
text = ''
for child in node:
if child.tail is not None:
text += chil... | |
<reponame>gomez-addams/USD<gh_stars>1-10
#!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Tra... | |
"""
Base class for generic `p`-adic polynomials
This provides common functionality for all `p`-adic polynomials, such
as printing and factoring.
AUTHORS:
- <NAME> (2013-11-22): initial version, split off from other
files, made Polynomial_padic the common base class for all p-adic
polynomials.
"""
#**************... | |
<gh_stars>0
'''
Author: <NAME>
Project 10 for CIS 322
Fall 2017
Flask redirect with arguments from: https://stackoverflow.com/questions/17057191/flask-redirect-while-passing-arguments
Info on obtaining a google user's email address from: https://stackoverflow.com/questions/24442668/google-oauth-api-to-get-users-email-a... | |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 7 23:15:48 2020
@author: shiri
"""
import matplotlib.pyplot as plt
import numpy as np
import sklearn
from pandas import DataFrame
from sklearn import metrics
from sklearn.model_selection import validation_curve
from sklearn.linear_model import LinearRegression... | |
<reponame>Cheaterman/garden.cefpython
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
The CEFBrowser Widget actually displays the browser. It displays ONLY the
browser. If you need controls or tabs, check out the `examples`
"""
import ctypes
from functools import partial
import json
import os
import random
import ti... | |
1, 0, 0, 0, 1, 0],
[1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0],
[0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0... | |
not None:
pulumi.set(__self__, "http_get", http_get)
if tcp_socket is not None:
pulumi.set(__self__, "tcp_socket", tcp_socket)
@property
@pulumi.getter(name="exec")
def exec_(self) -> Optional['outputs.SeldonDeploymentSpecPredictorsComponentSpecsSpecEphemeralContainersLifecyclePostStartExec']:
"""
One and only... | |
experiments to measure the T2 star or T2 echo decay time of 1 or more qubits.
:param qc: The QuantumComputer to run the experiment on
:param t2_experiment: A pandas DataFrame containing: time, T2 program
:param detuning: The additional detuning frequency about the z axis.
:return: pandas DataFrame containing T2 re... | |
percentage_change: float = field(metadata=config(field_name="percentageChange"))
show_num_invites: bool = field(metadata=config(field_name="showNumInvites"))
show_fire: bool = field(metadata=config(field_name="showFire"))
tooltip_markdown: str = field(metadata=config(field_name="tooltipMarkdown"))
class FSStatusCo... | |
calling `project_project_id_tasks_post`") # noqa: E501
# verify the required parameter 'project_id' is set
if ('project_id' not in params or
params['project_id'] is None):
raise ValueError("Missing the required parameter `project_id` when calling `project_project_id_tasks_post`") # noqa: E501
collection_formats =... | |
<gh_stars>0
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from datetime import datetime
from typing import Any, AsyncIterable, Optional, Dict
from azure.core.exceptions import ResourceExistsError, ResourceNotFoundE... | |
-1.7254034675761418], [-1.689109989351012, -5.6713946772780321, -1.7192311513713561,
-7.5505076188691662], [-0.9221994157609279, -3.5401612884317997, 0.80850427916708423, 1.0199139822616425]]],
[[[-7.7451841209074272, -3.3370280271940906, -5.4640503616346594, 0.4768178331451427], [-3.0941833085426742,
-8.36059368224... | |
<filename>testSpot.py
#_*_coding:utf-8_*_
import copy
import os
import random
from enum import Enum
from math import floor, log, sqrt
from sys import float_info
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import numpy as np
import cv2
import pywt
from imgSim import AirySpot
from tifffile impo... | |
################################################################
# -*- coding: utf-8 -*-
# Title: Buscaminas
# Developed by: <NAME>
# SavedVariables: board, match
# Notes: Minesweeper game that supports different size games.
# It can save game on files and load them later.
# TODO: Support several languages
############... | |
in same directory as this program.
file = os.path.dirname(os.path.realpath(__file__)) + os.sep + "opcodetable.csv"
with open(file, newline='') as csvfile:
table = list(csv.DictReader(csvfile))
# Do validity check on table entries and calculate bitmask and value
# for each opcode so we can quicky test opcode for mat... | |
Share(self, *args):
"""
:param ent:
:type ent: Handle_StepRepr_MaterialDesignation &
:param iter:
:type iter: Interface_EntityIterator &
:rtype: None
"""
return _RWStepRepr.RWStepRepr_RWMaterialDesignation_Share(self, *args)
__swig_destroy__ = _RWStepRepr.delete_RWStepRepr_RWMaterialDesignation
RWStepRepr_RW... | |
# route_padded = route + [tail] * lookahead
# weight_padding = 0
# # elif killcollide ...
# # route_padded += [tail] * lookahead
# # weight_padding = 0
# else:
route_padded, weight_padding = bo.routePadding(route, snakes, foods, depth=lookahead, method=routepadding_method)
# (4) Check target, rout... | |
flow", None))
#if QT_CONFIG(tooltip)
self.actionPTDF_time_series.setToolTip(QCoreApplication.translate("mainWindow", u"PTDF based time series power flow", None))
#endif // QT_CONFIG(tooltip)
self.actionShow_color_controls.setText(QCoreApplication.translate("mainWindow", u"Show color controls", None))
self.actionAdd_... | |
'''
'''
pass
def prepend(self, draw_func):
'''
'''
pass
def property_overridable_library_set(self):
'''
'''
pass
def property_unset(self):
'''
'''
pass
def remove(self, draw_func):
'''
'''
pass
def type_recast(self):
'''
'''
pass
def values(self):
'''
'''
pass
class VIEW3... | |
not a special case
right_type = 0 # not a special case
if IsStr(t0):
left_type = 1
elif (isinstance(t0, UnionType) and len(t0.items) == 2 and
IsStr(t0.items[0]) and isinstance(t0.items[1], NoneTyp)):
left_type = 2
if IsStr(t1):
right_type = 1
elif (isinstance(t1, UnionType) and len(t1.items) == 2 and
IsStr(... | |
"0.2.6.0",
sha256 =
"f526d97cdab851f24e215e346f6d54d3a504a6ac5d9264f580c4f72d606178c5",
),
"rethinkdb-client-driver":
struct(
version = "0.0.25",
sha256 =
"0f9dc156cd61b866b847b1b1a60a2345b4b5556b8b75a9e8499b0514e7f98996",
),
"retry":
struct(
version = "0.7.7.0",
sha256 =
"3ccbc27a08ad0c7291342140f417cef1... | |
<gh_stars>0
# Copyright (c) 2003-2015 by <NAME>
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of c... | |
# Copyright 2021 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | |
(([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])\\.){3}([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])(%[\\p{N}\\p{L}]+)?
.. attribute:: local_port
Local port
**type**\: int
**range:** 0..65535
.. attribute:: remote_port
Remote port
**type**\: int
**range:** 0..65... | |
import logging
import os
from abc import ABC, abstractmethod
from collections import namedtuple
from datetime import datetime, timezone
import yaml
from github import Github
from tqdm import tqdm
from .generator import ExtractorGenerator
from .models.model_manager import ModelManager
from .scanners.file_scanner impor... | |
<filename>sampler/gpflow-files/model.py
# Copyright 2016 <NAME>, <NAME>, <NAME>, alexggmatthews, fujiisoup
#
# 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/L... | |
= ''
outstr = ''
for line in str.split('\n')+['\n']:
if _PROMPT_RE.match(line):
if pyout:
outstr += ('<span class="py-output">%s</span>\n\n' %
pyout.strip())
pyout = ''
pysrc += line+'\n'
else:
if pysrc:
# Prompt over-rides other colors (incl string)
pysrc = _DOCTEST_RE.sub(_doctest_sub, pysrc)
pysrc = _PR... | |
# -*- coding: utf-8 -*-
import wxmpl
import numpy
import matplotlib
import layeritem
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import\
NavigationToolbar2WxAgg as ToolBar
from matplotlib.figure import Figure
import wx.lib.agw.flatnotebook
imp... | |
local_job_q,
local_result_q,
local_fail_q,
const_arg,
c,
m,
reset_pbc,
njobs,
emergency_dump_path,
# job_q_get_timeout,
host,
port,
authkey):
"""
the wrapper spawned nproc times calling and handling self.func
"""
global log
log = logging.getLogger(__name__+'.'+progress.get_identifier(name='worker{}'.for... | |
<gh_stars>0
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you... | |
7040521458 9534814523 3534291147 2996242113
5543378696 9835321543 4105543752 0239981628 8226117291
1558210513 6860962288 0523876804 6449418784 9960586710
1463691780 7107942661 7689234821 5918325023 4297297489
3722249521 0857346873 4180933569 3734054818 3762028499
4222993156 3544855869 4140433376 5912217555 8881009... | |
<filename>tests/authorization/test_ranger.py
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, V... | |
<filename>src/live_data/live_odds_retrieval.py<gh_stars>0
# Places to retrieve live lineups
# https://www.rotowire.com/basketball/nba-lineups.php
# https://www.nba.com/players/todays-lineups
# stats api here - https://stats.nba.com/js/data/leaders/00_active_starters_20210128.json
import json
import re
from datetime im... | |
we don't want the 'Source WKT has been cleaned by Shapely" warning
location["id"] = location_id = ltable.insert(**location)
set_record_owner(ltable, location, owned_by_user=user_id)
s3db_onaccept(ltable, location, method="create")
# Create Facility
ftable = s3db.org_facility
facility_name = organisation if organ... | |
from mutation import *
from evolocity_graph import *
import evolocity as evo
np.random.seed(1)
random.seed(1)
def parse_args():
import argparse
parser = argparse.ArgumentParser(description='Flu NP sequence analysis')
parser.add_argument('model_name', type=str,
help='Type of language model (e.g., hmm, lstm)')
par... | |
<filename>hityper/typeobject.py
import re
from hityper.stdtypes import stdtypes, exporttypemap, inputtypemap, typeequalmap
from hityper import logger
logger.name = __name__
class TypeObject(object):
def __init__(self, t, category, added = False):
self.type = t
#categories: 0 - builtins
#1 - standard libraries
#... | |
which were added only for
# GET server APIs not for rebuild. GET server and Rebuild share the
# same view builder method SHOW() to build the response, So make sure
# attributes which are not supposed to be included for Rebuild
# response are not present.
body = {
"rebuild": {
"imageRef": self.image_uuid,
},
}... | |
list(values)
})
if dbg_prnt:
print('premrg1')
print(premrg1)
mrg1 = pairs[names].merge(premrg1, left_on=names[0], right_on="Gene1")
if dbg_prnt:
print('mrg1')
print(mrg1)
premrg2 = pd.DataFrame.from_dict({
"Gene2": list(locusIds),
"value2": list(values)
})
if dbg_prnt:
print('premrg2')
print(premrg2)... | |
订购周期对象,当商品是周期订阅类型时,必填
self.duration = duration
# 优惠券ID
self.coupon_id = coupon_id
# 数量,不填默认1
self.quantity = quantity
# 商品订购属性,开通型商品部需要填写
self.commodity_attrs = commodity_attrs
# 履约选项
self.fulfillment_options = fulfillment_options
# 支付选项
self.pay_options = pay_options
def validate(self):
self.validate_req... | |
deleteList:
self.box_modifier_hide()
#now the new ones
createdTimeAnnos = []
if not differential:
annosToIterate = newAnnotations
else:
#take on the the nodes from the incoming
annosToIterate = arg["data"]["_eventInfo"]["new"]
annosToIterate.update(arg["data"]["_eventInfo"]["modify"])
self.logger.debug(f... | |
1)] for j in range(i + 1)]
for j in range(i + 1):
for k in range(i + 1):
if j + k == i:
coeff[j][k] = binomial(i, j)
sol = 0
for j in range(i + 1):
for k in range(i + 1):
sol += coeff[j][k]* y0_self[j] * y0_other[k]
y0.append(sol)
return HolonomicFunction(sol_ann, self.x, self.x0, y0)
else:
raise NotImple... | |
from typing import Dict, Union, Tuple, Pattern, List
from apscheduler.schedulers.blocking import BlockingScheduler
from socket import gethostname
from pathlib import Path
from time import sleep
from manager import Manager
from datetime import datetime
from datetime import timedelta
import exceptions
import argparse
imp... | |
<gh_stars>1-10
#get a dataframe and rank features
#output: (1) inside ig_tuner and corr_tuner, save [#selected features,acc] in each step
# and print the whole list of x and list of y
# (2) save top features in a csv file with parent node in bgr in left col and the child in right col and importance score in third c... | |
hearing_impaired_date_collected = Column(DateTime(timezone=False))
marital_status = Column(Integer)
marital_status_date_collected = Column(DateTime(timezone=False))
non_ambulatory = Column(Integer)
non_ambulatory_date_collected = Column(DateTime(timezone=False))
residential_status = Column(Integer)
residential_st... | |
self.x0 = x0
return
def update_ev_cum(self, x2, x1):
ev_cum_x1, ev_cum_x2 = self.ev_cum[x1], self.ev_cum[x2]
if ev_cum_x1[0] > 0:
ev_cum_x1[0] -= 1
else:
ev_cum_x1[1] -= 1
if ev_cum_x2[1] < 0:
ev_cum_x2[1] += 1
else:
ev_cum_x2[0] += 1
logger.enter("normalize")
state = State(m, x, eps, seed)
T = identity... | |
days of the week and hours that maintenance will be performed.
"""
pulumi.set(__self__, "preference", preference)
if days_of_weeks is not None:
pulumi.set(__self__, "days_of_weeks", days_of_weeks)
if hours_of_days is not None:
pulumi.set(__self__, "hours_of_days", hours_of_days)
if lead_time_in_weeks is not None... | |
<filename>networking_cisco/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
# Copyright 2014 Cisco Systems, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License... | |
# AUTOGENERATED! DO NOT EDIT! File to edit: 04_carion2020end.ipynb (unless otherwise specified).
__all__ = ['coco_vocab', 'bb_pad', 'ParentSplitter', 'box_cxcywh_to_xyxy', 'box_xyxy_to_cxcywh', 'TensorBBoxWH',
'TensorBBoxTL', 'ToWH', 'ToXYXY', 'ToTL', 'box_area', 'all_op', 'generalized_box_iou', 'DETRLoss', 'DETR',
... | |
<filename>tests/encryption_test.py
# -*- coding: utf-8 -*-
import copy
import json
import os
import pytest
from olm import Account, OlmMessage, OlmPreKeyMessage, OutboundGroupSession
from nio.crypto import (DeviceStore, GroupSessionStore, InboundGroupSession,
Olm, OlmDevice, OutboundSession, OutgoingKeyRequest,
Se... | |
<filename>DNN_base.py
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.training import moving_averages
#
# 用于最中执行batch normalization的函数
# tf.nn.batch_normalization(
# x,
# mean,
# variance,
# offset,
# scale,
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.