input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
as call:
# Designate an appropriate return value for the call.
call.return_value = resources.JobTemplate()
call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(
resources.JobTemplate()
)
# Call the method with a truthy value for each flattened field,
# using the keyword arguments to the method.
response =... | |
main.threadID,
name = "getDeviceLinksActiveCount",
args = [dpid])
t.start()
pool.append(t)
i = i + 1
main.threadID = main.threadID + 1
for thread in pool:
thread.join()
linkCountResult = thread.result
#linkCountTemp = re.split( r'\t+', linkCountResult )
#linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32... | |
"""
Utility functions for Jupyter notebook to:
- format data
- transform pandas data structures
- compute common stats
These functions are used for both interactive data exploration and to implement
more complex pipelines. The output is reported through logging.
"""
import datetime
import logging
import math
from ty... | |
numbers.
:param ignore_nodata: Indicates whether no-data values are ignored or not. Ignores them by default. Setting
this flag to `false` considers no-data values so that an array with two `null` values is returned if any
value is such a value.
:return: An array containing the minimum and maximum values for the sp... | |
Create data agreement didcomm crud transaction record
data_agreement_crud_didcomm_transaction_record = DataAgreementCRUDDIDCommTransaction(
thread_id=read_data_agreement_message._thread_id,
message_type=DataAgreementCRUDDIDCommTransaction.MESSAGE_TYPE_READ_DATA_AGREEMENT,
messages_list=[read_data_agreement_message.... | |
<filename>wmt-shared-task/segment-level/segment_level_prism.py
f"""
Shell script tho reproduce results for BERTScores in data from WMT18/19 Metrics Shared task.
"""
import argparse
import hashlib
import logging
import os
import sys
from typing import Any, Dict, Iterator, List
import numpy as np
import pandas as pd
imp... | |
########################################################################################
# Copyright 2019-2021 <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://ww... | |
-0.17805460405137996], [2.5278812537929483, -3.9412959574596886,
-0.1516720332141368, -2.385490768218621], [2.0634420046107511, 3.7303717046166387, -3.7967716979561583,
-0.36579638919369373]], [[-0.89677692789005903, -0.33159623329473931, -2.0783805922287799, 3.3237758621528677],
[1.8764406996924805, 3.8567013916314... | |
extraction
for list_name in extraction:
markup[page_id][list_name]['extract'] = ' '
if list_name not in names:
names[list_name] = []
if 'sequence' in extraction[list_name]:
for sequence_item in extraction[list_name]['sequence']:
if 'sub_rules' in sequence_item:
for item_name in sequence_item['sub_rules']:
if i... | |
<gh_stars>100-1000
# encoding: UTF-8
# 选股引擎
import os
import sys
import logging
import importlib
import traceback
import pandas as pd
import numpy as np
from collections import OrderedDict
from typing import List, Any, Callable
from datetime import datetime, timedelta
from functools import lru_cache
from concurrent... | |
= False
return b_exists
def service_shutDown_check():
"""
Verifies that a docker service can be shutdown.
Should multiple jobs have been scheduled temporally serially
with the same jid/serviceName, then the actual service can
only be shut down once all identical jobs have had their
state stored.
Returns boo... | |
# coding: utf-8
#this script is about the latest news of MENA region
#we scrape different influential media websites, or so-called fake news, lol
#and send only updates to the mailbox for daily newsletter
#in order to do that, we need a db to store all the historical content of websites
#and all the scraping tec... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | |
<reponame>icon-lab/provoGAN<filename>models/networks.py
import torch
import torch.nn as nn
from torch.nn import init
import functools
from torch.autograd import Variable
from torch.optim import lr_scheduler
###############################################################################
# Functions
#####################... | |
in incompatible:
if getattr(args, name):
restart_option = "restart" if args.restart else "start"
_incompatible_with_restart_error(desc, restart_option)
def _check_platform_compatibility(args):
if (
(args.background or args.pidfile)
and util.get_platform() == "Windows"
and os.getenv("FORCE_RUN_IN_BACKGROUND") !... | |
# coding=utf-8
from __future__ import print_function
import sys
from phi.tf.model import *
from phi.control.control import *
from phi.control.iksm import *
def ik(sim, initial_density, target_density, trainable=False):
assert not trainable
with tf.variable_scope("ik"):
optimizable_velocity = ik_resnet(initial_dens... | |
<reponame>Mousegamertank/curso-python
#000
print('Olá Mundo')
n1 = input('Insira o primeiro valor')
n2 = input('Insira o segundo valor')
print(n1 + n2)
#001
#primeiro exercicio
print('Olá, Mundo')
#ou
msg = 'Ol<NAME>'
print(msg)
#-------
# print ('Olá Mundo')
print ('caso haja uma mensagem sem as aspas')
nome = 'ped... | |
communicator
self._color = None
# The group ID associated with the color
self._group = None
def _is_ndarray(self, obj):
"""
Helper function to determing if an object is a Numpy NDArray.
Parameters:
obj: The object to be tested
Returns:
bool: True if the object is a Numpy NDArray. False otherwise,
or if t... | |
instance. If the replacement is done via a callable it'll use it like
unlinking and directly replace the link with the text itself. It only
supports unicode when used by the callable and bytes are not allowed.
If either the section or label should be used the replacement can be a
function which returns a Link inst... | |
# coding=utf-8
#
# Copyright (c) 2013-2015 First Flamingo Enterprise B.V.
#
# 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... | |
<filename>eeg_analyses/BDM.py<gh_stars>0
import os
import mne
import pickle
import random
import copy
import itertools
#import matplotlib
#matplotlib.use('agg') # now it works via ssh connection
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from support.FolderStructure import *
from sklearn.d... | |
the estimation job.
Raises
------
KeyError
Non-unique unknowns are provided.
ValueError
Invalid unknowns shall be estimated.
ValueError
No bounds are provided for use of differential evolution optimizer.
TypeError
A list containing not only Measurement objects is provided.
Warns
-----
User... | |
from pdfminer.utils import PDFDocEncoding
from pdfminer.psparser import PSLiteral
from pdfminer.pdftypes import PDFObjRef
from decimal import Decimal, ROUND_HALF_UP
import numbers
from operator import itemgetter
import itertools
from functools import lru_cache as cache
DEFAULT_X_TOLERANCE = 3
DEFAULT_Y_TOLERANCE = 3
... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import argparse
import io
import nltk
import pickle
import requests
import re
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import os
from os.path import join as pjoin
import json
from itertools import izip
from copy import deepcopy as cp
n... | |
memory_fill_only = False):
""" parallelized implementation of single iteration"""
initial_qv_weights = None
qv_update_launched = False
total_log = None
total_runs = tot_successful_runs = 0
task_lst = [None for _ in self.sim_agents_discr]
iter_traj_stats = []
while True:
self.display_progress()
# 1... | |
<reponame>chellebodnar-google/public-datasets-pipelines
# Copyright 2021 Google LLC
#
# 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 r... | |
<reponame>TJConnellyContingentMacro/northwestern<gh_stars>0
# 1. A famous researcher observed that chimpanzees hunt and eat meat as part of their regular diet.
# Sometimes chimpanzees hunt alone, while other times they form hunting parties. The following table
# summarizes research on chimpanzee hunting parties, givi... | |
<gh_stars>0
#
# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
# This module is free software, and you may redistribute it and/or modify
# under the same terms as Python, so long as this copyright message and
# disclaimer are retained in their original form.
#
# IN NO EVENT SHALL BIZAR SOF... | |
'subsector', 'name', 'min_lifetime', 'max_lifetime', 'source', 'additional_description', 'demand_tech_unit_type', 'unit', 'time_unit', 'cost_of_capital', 'stock_decay_function', 'mean_lifetime', 'lifetime_variance', 'shape', 'max_lead_hours', 'max_lag_hours']
def __init__(self, scenario, linked=None, stock_link_ratio=... | |
width, 4, 5, 6, 7,
8 - width / 2 * 3, 9 - width / 2 * 3]), tr_sur_tv, alpha=0.9, width=width,
hatch='\\', edgecolor='black', label='TR+SUR')
plt.bar(np.array([1, 2, 3, 4 + width, 5 + width, 6 + width, 7 + width,
8 - width / 2, 9 - width / 2]), admm_sur_tv, alpha=0.9, width=width,
hatch='+', edgecolor='black', labe... | |
<gh_stars>1-10
#
# This file is part of PyFOPPL, an implementation of a First Order Probabilistic Programming Language in Python.
#
# License: MIT (see LICENSE.txt)
#
# 20. Feb 2018, <NAME>
# 20. Mar 2018, <NAME>
#
from ..fe_clojure import ppl_clojure_forms as clj
from ..ppl_ast import *
from .ppl_clojure_lexer import ... | |
"昌": 25592,
":0": 25593,
"ALE": 25594,
"AYA": 25595,
"besi": 25596,
"obraz": 25597,
"tsin": 25598,
"zinho": 25599,
"▁Hardware": 25600,
"▁TAN": 25601,
"▁dre": 25602,
"▁flac": 25603,
"▁pretty": 25604,
"▁while": 25605,
"-03-": 25606,
"IKO": 25607,
"IMU": 25608,
"Khmer": 25609,
"dash": 25610,
"have": 256... | |
# Adapted from https://github.com/sergionr2/RacingRobot
# Author: <NAME>
import argparse
import os
import time
import cv2
from threading import Event, Thread
import numpy as np
import pygame
from pygame.locals import *
from stable_baselines.bench import Monitor
from stable_baselines.common.vec_env import VecFrameStack... | |
:
"""""",
}, # column
"multicastVlanStatusTable" : {
"nodetype" : "table",
"moduleName" : "ZYXEL-GS4012F-MIB",
"oid" : "1.3.6.1.4.1.890.172.16.31.10.26.3",
"status" : "current",
"description" :
"""""",
}, # table
"multicastVlanStatusEntry" : {
"nodetype" : "row",
"moduleName" : "ZYXEL-GS4012F-MIB",
"oid" ... | |
"""
===========================================================================
Modelize the static and dynamic behaviour ok an orienteering compass in the
Earth magnetic field
Every parameters are in international system units, angles in radians
=========================================================================... | |
<filename>search/COSP/network.py
import torch
import torch.nn as nn
from torch.nn import DataParallel
from torch.nn.parallel import DistributedDataParallel
from cosp_nas.supernet.blocks import Shufflenet, Shuffle_Xception
import math
from typing import NamedTuple
import numpy as np
import sys
sys.path.append("..")
fr... | |
<filename>genens/gp/types.py
# -*- coding: utf-8 -*-
"""
This module defines the structure of GP primitives.
The GP primitives are nodes with typed edges (parent input and child output types must match) and variable
arity (for a given type, its final arity can be chosen during the evolution process).
A ``GpPrimitive... | |
math.hypot(cl[0][0] - cl[1][0], cl[1][1] - cl[1][1])
if cllen > maxlen:
maxlen = cllen
self.bestcl = cl
# print("cl maxlen %d" % mindif)
self.bestll = None
if curlline is not None:
mindif = 10000
maxlen = 0
for ll in curlline:
lldeg = self.orientation(ll)
if self.lline[2] is not None:
lastlldeg = self.orien... | |
<reponame>Google-Autofuzz/clusterfuzz
# Copyright 2019 Google LLC
#
# 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 applica... | |
+ m.b23 - m.b87 <= 0)
m.c505 = Constraint(expr= - m.b19 + m.b25 - m.b88 <= 0)
m.c506 = Constraint(expr= - m.b21 + m.b23 - m.b89 <= 0)
m.c507 = Constraint(expr= - m.b21 + m.b25 - m.b90 <= 0)
m.c508 = Constraint(expr= - m.b23 + m.b25 - m.b91 <= 0)
m.c509 = Constraint(expr= - m.b26 + m.b27 - m.b37 <= 0)
m.c510 = Con... | |
import numpy as np
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
import collections
from src.utils.constants import PAD
from src.data.pytorch_datasets import pitch_to_ix, ks_to_ix
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
#print("Device: " + s... | |
@pulumi.getter
def version(self) -> pulumi.Input[str]:
"""
Version of MongoDB (either 5.0, 4.4, 4.2 or 4.0).
"""
return pulumi.get(self, "version")
@version.setter
def version(self, value: pulumi.Input[str]):
pulumi.set(self, "version", value)
@property
@pulumi.getter
def access(self) -> Optional[pulumi.In... | |
1.00 22.98 C
ATOM 2161 C ARG A 315 6.921 -38.651 108.687 1.00 22.60 C
ATOM 2162 O ARG A 315 7.532 -38.196 109.653 1.00 22.85 O
ATOM 2163 CB ARG A 315 5.173 -37.516 107.323 1.00 23.23 C
ATOM 2164 CG ARG A 315 4.735 -36.167 107.842 1.00 24.91 C
ATOM 2165 CD ARG A 315 3.231 -36.143 108.070 1.00 28.73 C
ATOM 2166 NE ARG A ... | |
import os, gc, sys
import pygrib
import regionmask
import cartopy
import cartopy.crs as ccrs
import numpy as np
import pandas as pd
import xarray as xr
import geopandas as gpd
import multiprocessing as mp
import matplotlib.pyplot as plt
import matplotlib as mpl
from glob import glob
from numpy import trapz
from scipy... | |
East Asian ideograph
0x21533F: (0x80CE, 0), # East Asian ideograph
0x215340: (0x80DE, 0), # East Asian ideograph
0x215341: (0x80E4, 0), # East Asian ideograph
0x215342: (0x80F0, 0), # East Asian ideograph
0x215343: (0x8102, 0), # East Asian ideograph
0x215344: (0x8105, 0), # East Asian ideograph
0x215345: (0x80F... | |
"relaxant": 1.0,
"agitated": -2.0,
"bastardised": -2.3,
"moronic": -2.7,
"disadvantages": -1.7,
"applaud": 2.0,
"doubtlessness": 0.8,
"mockers": -1.3,
"disadvantaged": -1.7,
"lamentation": -1.4,
"delicate": 0.2,
"weep": -2.7,
"confusedness": -1.5,
"longing": -0.1,
"cheerly": 2.4,
"stealings": -1.9,
"del... | |
API, so just send an empty request.
request = request_type()
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
type(client.transport.get_transition_route_group), "__call__"
) as call:
# Designate an appropriate return value for the call.
call.return_value = transition_ro... | |
# Copyright (c) 2009-2012 testtools developers. See LICENSE for details.
"""Content - a MIME-like Content object."""
__all__ = [
'attach_file',
'Content',
'content_from_file',
'content_from_stream',
'json_content',
'text_content',
'TracebackContent',
]
import codecs
import inspect
import json
import os
impor... | |
<reponame>geo2tag-logistics/main
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User, Group
from django.shortcuts import get_object_or_404
from django.utils import timezone
from rest_framework import status
from rest_framework.authentication import BasicAuthentication... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Build all possible graphs using a Randomised Stepwise Addition Order Algorithm w/ Branch and Bound.
# Usage...
# python -u permute_qpgraph.py 1> permute-std.log 2> permute-err.log
import xml.etree.ElementTree as ElemTree
import re
import sys
import csv
import glob
# TO... | |
# Copyright (c) 2012-2020 Jicamarca Radio Observatory
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
"""API to create signal chain projects
The API is provide through class: Project
"""
import re
import sys
import ast
import datetime
import traceback
import time
imp... | |
= "127.0.0.1")
type: str
targetPort:
desc:
Target port of the server socket link. (Default = 27412)
type: int
listenIP:
desc:
IP address of the client application. (Default is
"127.0.0.1")
type: str
listenPort:
desc:
Listen port of the client socket link. (Default = 27413)
"""
# Check whether all keyw... | |
is 0.0001
:type theTolMax: float
:rtype: void
"""
return _BOPTools.BOPTools_AlgoTools_CorrectCurveOnSurface(*args)
def BOPTools_AlgoTools_CorrectPointOnCurve(*args):
"""
* Provides valid values of tolerances for the shape <theS> in terms of BRepCheck_InvalidPointOnCurve.
:param theS:
:type theS: TopoDS_Shape... | |
vec_shape = torch.zeros(1, 10).float().to(self.device)
v, j, t, _ = self.mano_layer(vec_pose, vec_shape)
v = v.squeeze(0)
return v
@staticmethod
def assemble_pose_vec(gt_idx, gt_pose, var_idx, var_pose):
idx_tensor = torch.cat((torch.Tensor(gt_idx).long(), torch.Tensor(var_idx).long()))
pose_tensor = torch.cat(... | |
OR GREATER THAN 130 DEG F.
*ERROR* TYPE 25 ********************************************************************************
THE INITIAL AIR WET-BULB TEMPERATURE IS LESS THAN 0 OR GREATER THAN THE DRY-BULB TEMPERATURE.
*ERROR* TYPE 26 ********************************************************************************
T... | |
# Authors: <NAME> <<EMAIL>>
# License: Apache 2.0
from PyNomaly import loop
import logging
import numpy as np
from numpy.testing import assert_array_equal
import pandas as pd
import pytest
from sklearn.datasets import load_iris
from sklearn.metrics import roc_auc_score
from sklearn.neighbors import NearestNeighbors
f... | |
None,
end_tangent: "Vertex" = None,
) -> "SplineEdge":
"""Add a :class:`SplineEdge`.
Args:
fit_points: points through which the spline must go, at least 3 fit
points are required. list of (x, y)-tuples
control_points: affects the shape of the spline, mandatory and
AutoCAD crashes on invalid data. list of (x, y... | |
import datetime
import json
import logging
import os
import urllib.error
import urllib.parse
import urllib.request
import requests
from pajbot.managers.emote import EmoteManager
from pajbot.models.emote import Emote
log = logging.getLogger(__name__)
class APIBase:
def __init__(self, strict=False):
self.strict = ... | |
= (resdf.loc['error']/resdf.loc[datavar]).mean()
r2 = (resdf.loc[simvar].corr(resdf.loc[datavar])) ** 2
return maeom, mape, r2
def trunc_log(df):
"""Return log10 of a dataframe, ignoring negative base values"""
df[df <= 0] = np.NaN
return np.log10(df)
def process_results(scriptname, eqtime, earlytime, gof_vars... | |
[owner_account, attacker_account]
else:
raise EthereumError('The account to perform the symbolic exploration of the contract should be "attacker", "owner" or "combo1"')
if contract_account is None:
logger.info("Failed to create contract. Exception in constructor")
self.finalize()
return
prev_coverage = 0
curr... | |
<filename>kolejka/observer/server.py
# vim:ts=4:sts=4:sw=4:expandtab
import cgi
import datetime
import hashlib
import http.server
import json
import logging
from multiprocessing import Process
import os
import re
import signal
import socket
import socketserver
import time
import traceback
from urllib.parse import urlp... | |
you specify a non-empty and unique name in order to make it easier to identify the channels in your project, though this is not enforced. The display name is limited to 512 Unicode characters.
:param pulumi.Input[bool] enabled: Whether notifications are forwarded to the described channel. This makes it possible to dis... | |
<reponame>jiajiaxu123/Orca<filename>orca/core/indexes.py
import abc
import itertools
from typing import Iterable
import dolphindb as ddb
import numpy as np
import pandas as pd
from .common import default_session
from .datetimes import DatetimeProperties
from .internal import _ConstantSP, _InternalFrame, _InternalAcce... | |
<= 0)
m.c692 = Constraint(expr= m.x691 - m.b3007 <= 0)
m.c693 = Constraint(expr= m.x692 - m.b3007 <= 0)
m.c694 = Constraint(expr= m.x693 - m.b3007 <= 0)
m.c695 = Constraint(expr= m.x694 - m.b3007 <= 0)
m.c696 = Constraint(expr= m.x695 - m.b3007 <= 0)
m.c697 = Constraint(expr= m.x696 - m.b3007 <= 0)
m.c698 = Cons... | |
# -*- coding: utf-8 -*-
"""
Module et_micc2.project
=======================
An OO interface to *micc* projects.
"""
from copy import copy
import os, sys, site, subprocess, re
import sysconfig
import shutil
import json
from pathlib import Path
from operator import xor
import requests
from types import SimpleNamespace... | |
MFnDagNode_objectColorIndex(*args, **kwargs):
pass
def MDataHandle_asBool(*args, **kwargs):
pass
def MDagMessage_addChildReorderedCallback(*args, **kwargs):
pass
def MProfiler_swigregister(*args, **kwargs):
pass
def delete_MItDag(*args, **kwargs):
pass
def MFnNurbsCurve_getKnotDomain(*args, **kwargs):
p... | |
from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse
from core.models import *
from datetime import date
from django.contrib.auth.decorators import login_required
from django.contrib import messages
import logging
logger = logging.getLogger(__name__)
from django.forms impo... | |
# -*- coding: utf-8 -*-
import operator
from functools import reduce
from django.conf import settings
from django.contrib.admin import SimpleListFilter
from django.contrib.admin.views.main import ChangeList, ORDER_VAR
from django.contrib.contenttypes.models import ContentType
from django.core.urlresolvers import rever... | |
<reponame>pschmidtke/ccdutils
#!/usr/bin/env python
# software from PDBe: Protein Data Bank in Europe; https://pdbe.org
#
# Copyright 2018 EMBL - European Bioinformatics Institute
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... | |
from collections import OrderedDict
from gradualelixir.gtypes import (
AnyType,
AtomLiteralType,
AtomType,
BooleanType,
ElistType,
FloatType,
FunctionType,
IntegerType,
ListType,
MapKey,
MapType,
NumberType,
TupleType,
TypeEnv,
)
from gradualelixir.pattern import (
AtomLiteralPattern,
BasePatternMatchE... | |
Constraint(expr=m.x3*m.x3 - m.x653*m.b626 <= 0)
m.c655 = Constraint(expr=m.x4*m.x4 - m.x654*m.b626 <= 0)
m.c656 = Constraint(expr=m.x5*m.x5 - m.x655*m.b626 <= 0)
m.c657 = Constraint(expr=m.x6*m.x6 - m.x656*m.b626 <= 0)
m.c658 = Constraint(expr=m.x7*m.x7 - m.x657*m.b626 <= 0)
m.c659 = Constraint(expr=m.x8*m.x8 - m.... | |
= b''
if self.decrypt_packet_num == 0:
logging.info('auth_sha1_v4: over size')
return (b'E'*2048, False)
else:
raise Exception('server_post_decrype data error')
if length > len(self.recv_buf):
break
if struct.pack('<I', zlib.adler32(self.recv_buf[:length - 4]) & 0xFFFFFFFF) != self.recv_buf[length - 4... | |
import math
import numpy as np
import torch
import torch.nn as nn
from ....ops.pointnet2.pointnet2_stack import pointnet2_modules as pointnet2_stack_modules
from ....ops.pointnet2.pointnet2_stack import pointnet2_utils as pointnet2_stack_utils
from ....utils import common_utils
from ...backbones_2d.transformer import ... | |
<reponame>shivharis/pybind
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.ba... | |
"""
Models and functions for tracking XBlog Objects:
- Post
- Author
- Blog
- Category
- Tag
"""
import logging
import os
import string
import bs4
import markdown2
import django.utils.timezone
import random
try:
from urllib.parse import urlparse, urljoin
except ImportError:
from urlparse import urlparse, urljoin
fr... | |
<filename>Sipros/Scripts/sipros_ensemble_filtering.py
'''
Created on Sep 7, 2016
@author: xgo
'''
import getopt, sys, os
import numpy as np
import csv
import math
import re
try:
from sets import Set
except ImportError:
pass
from datetime import datetime, date, time
from collections import namedtuple
from sklearn ... | |
<reponame>elbaum/phys
#!/usr/bin/python
from unit_error import UnitError
from unit_error_types import UnitErrorTypes
from tree_walker import TreeWalker
from symbol_helper import SymbolHelper
import cps_constraints as con
import os.path
from operator import itemgetter
import copy
import cppcheckdata
class ErrorChecke... | |
ypos = []
xneg = []
yneg = []
for x, (_, y) in zip(xdates, data):
y = 0.5 - y.Value
if y > 0:
xpos.append(x)
ypos.append(y)
else:
xneg.append(x)
yneg.append(y)
pyplot.bar(xpos, ypos, color="g", label="Positive")
pyplot.bar(xneg, yneg, color="r", label="Negative")
legend = pyplot.legend(loc=1, fontsize=args... | |
import numpy as np
import math
from constants import *
from utils import deg3_real_roots, intersect, get_sorting
_apply_vectorized = np.vectorize(lambda f, x: f(x), otypes=[np.dtype('float')])
class PiecewiseFunction:
def __init__(self, xs, fns):
self._xs = np.array(xs)
self._fns = np.array(fns)
assert(len(self.... | |
8, 1236: 2, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8
},
{
68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544... | |
0 ],
[ "LD C, x", 0xe, 1 ],
[ "LD D, A", 0x57, 0 ],
# [ "LDD A, [HL]", 0x3a, 0 ],
[ "LD D, B", 0x50, 0 ],
[ "LD D, C", 0x51, 0 ],
[ "LD D, D", 0x52, 0 ],
[ "LD D, E", 0x53, 0 ],
[ "LD [DE], A", 0x12, 0 ],
[ "LD D, H", 0x54, 0 ],
[ "LD D, [HL]", 0x56, 0 ],
# [ "LDD [HL], A", 0x32, 0 ],
[ "LD D, L", 0x55, 0 ],
... | |
# Taken from https://github.com/CompVis/taming-transformers
# pytorch_diffusion + derived encoder decoder
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from fast_pytorch_kmeans import KMeans
from torch import einsum
import torch.distributed as dist
from einops import ... | |
not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative ... | |
"""CUDA target independent of PyCUDA."""
from __future__ import division, absolute_import
__copyright__ = "Copyright (C) 2015 <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 Sof... | |
PIT_ID CHAR(8) COMMENT 'Pitcher',
PIT_HAND_CD CHAR(1) COMMENT 'Pitcher hand',
RESP_PIT_ID CHAR(8) COMMENT 'Result pitcher',
RESP_PIT_HAND_CD CHAR(1) COMMENT 'Result pitcher hand',
POS2_FLD_ID CHAR(8) COMMENT 'Catcher',
POS3_FLD_ID CHAR(8) COMMENT 'First baseman',
POS4_FLD_ID CHAR(8) COMMENT 'Second baseman',
POS... | |
# FIXME: maplike<> and setlike<> should also imply the presence of a
# 'size' attribute.
# Stringifier
if interface.stringifier:
stringifier = interface.stringifier
stringifier_ext_attrs = stringifier.extended_attributes.copy()
if stringifier.attribute:
implemented_as = stringifier.attribute.name
elif stringif... | |
X_train\n }, \n y_train,\n batch_size=BATCH_SIZE,\n epochs=EPOCHS,\n validation_data=(\n {\n FAV: embed_features[FAV]["test"],\n UNFAV: embed_features[UNFAV]["test"],\n "non_embed_inputs": X_test\n },\n y_test\n ),\n callbacks=[tfdocs.modeling.EpochDots(), tensorboard_callback], \n verbose=0,\n sample_weight=sample_wei... | |
or \
last_batch is not None:
raise ValueError("batch_size, shuffle, sampler and last_batch must " \
"not be specified if batch_sampler is specified.")
self._batch_sampler = batch_sampler
self._num_workers = num_workers if num_workers >= 0 else 0
if batchify_fn is None:
if num_workers > 0:
self._batchify_fn = _... | |
from pprint import pprint
import enum
from urllib.parse import urlparse, parse_qs
import sys
import pdsupport
# creating enumerations using class
class States(enum.Enum):
old = 0
unchanged = 1
changed = 2
new = 3
class PyvoSheet:
def __init__(self, name, table, style, template):
self.name = name
self.tab... | |
# Copyright (c) 2018 OpenStack Foundation
# 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 applicab... | |
# Copyright (c) 2016 Jiocloud.com, Inc. or its affiliates. All Rights Reserved
#
# 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... | |
(size_exp + 4)
start = number * size
if start >= len(self.payload):
raise error.BadRequest("Block request out of bounds")
end = start + size if start + size < len(self.payload) else len(self.payload)
more = True if end < len(self.payload) else False
payload = self.payload[start:end]
blockopt = (number, more, ... | |
res = {}
for i in t[0:i2i_sim_limit]:
res[i[0]]=i[1]
sim_item[key] = res
user2recall = {}
for user,qtime in zip(df['user_id'],df['time']):
user2recall[(user,qtime)] = recommend(sim_item,user_item_dict,user_time_dict,user,qtime,0.7,'i2iw10')
if len(user2recall) % 100 ==0:
print(len(user2recall))
... | |
res[1] or False
class stock_production_lot(osv.osv):
def name_get(self, cr, uid, ids, context=None):
if not ids:
return []
reads = self.read(cr, uid, ids, ['name', 'prefix', 'ref'], context)
res = []
for record in reads:
name = record['name']
prefix = record['prefix']
if prefix:
name = prefix + '/' + name
... | |
.. attribute:: brief_pcep_information
Brief PCE protocol information
**type**\: :py:class:`BriefPcepInformation <ydk.models.cisco_ios_xr.Cisco_IOS_XR_infra_xtc_oper.PcePeer.PeerDetailInfos.PeerDetailInfo.DetailPcepInformation.BriefPcepInformation>`
.. attribute:: last_error_rx
Last PCError received
**t... | |
import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import (
Input, LSTM, Dense, Bidirectional,
Layer, Dropout, MultiHeadAttention, LayerNormalization,
Embedding, GlobalAveragePooling2D, GlobalAveragePooling1D
)
from tensorflow.keras import Sequential
from tensorflow.keras.models import Model
fro... | |
"""
#Only can do this if the interactome is big enough
if len(PCSFInputObj.undirEdges) + len(PCSFInputObj.dirEdges) < 50:
sys.exit("Cannot use --randomTerminals with such a small interactome.")
#Make a new PCSFInput object that contains all the same values as the original but empty prizes
newPCSFInputObj = copy.de... | |
5]
self.initialized = True
def setup_pieces_pawn(self, p_data: int, p_tb_size: int, f: int) -> None:
j = 1 + int(self.pawns[1] > 0)
order = self.data[p_data] & 0x0f
order2 = self.data[p_data + 1] & 0x0f if self.pawns[1] else 0x0f
self.files[f].pieces[0] = [self.data[p_data + i + j] & 0x0f for i in range(self.nu... | |
"""Generated client library for toolresults version v1beta3."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.toolresults.v1beta3 import toolresults_v1beta3_messages as messages
class ToolresultsV1beta3(base_api.BaseApiC... | |
collector
pos_Etag=[position[0]+22.5,position[1]-12.5]
pos_Ctag=[position[0]+22.5,position[1]+12.5]
else:
if isNPN:
inkDraw.line.relCoords(elem, [[7,-5],[0,-17]],[position[0]+18,position[1]-3]) # collector
inkDraw.line.relCoords(elem, [[7,5]],[position[0]+18,position[1]+3],lineStyle=lineStyleArrow) # emitter arro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.