input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import numpy as np
from tqdm.autonotebook import tqdm
import gc
import warnings
import sklearn.utils
_remove_cache = {}
def remove_retrain(nmask, X_train, y_train, X_test, y_test, attr_test, model_generator, metric, trained_model, random_state):
""" The model is retrained for each test sample with the important feat... | |
import numpy as np
import torch
import torch.nn.functional as F
import os
from skimage.io import imsave
import cv2
from PIL import Image
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
def dict2obj(d):
if isinstance(d, list):
d = [dict2obj(x) for x in d]
if not isinstance(d, dict):
ret... | |
# Copyright (c) 2014, <NAME>
#
# See the LICENSE file for legal information regarding use of this file.
"""Implementation of the TLS Record Layer protocol"""
import socket
import errno
from .utils import tlshashlib as hashlib
from .constants import ContentType, CipherSuite
from .messages import RecordHeader3, RecordH... | |
<filename>rig/rigbase.py
'''Rig base classes.
These classes outline a build process that consists of a preparation phase
(begin), the building of the rig (build), and a cleanup (end) phase. They also
implement all the helper methods required to make that process consistent,
while allowing you to customize rig setup... | |
depth4 else tmp687)
tmp724 = (tmp725 if depth3 else tmp699)
tmp723 = (tmp724 if depth2 else tmp699)
tmp722 = (tmp723 if depth1 else tmp719)
tmp717 = (tmp718 if s0 else tmp722)
tmp730 = (tmp700 if depth4 else tmp694)
tmp729 = (tmp730 if depth3 else tmp699)
tmp728 = (tmp729 if depth2 else tmp720)
tmp727 = (tmp728... | |
* x: (L, 14, D)
* mask: boolean mask of (L, 14)
Returns unit vectors and norm.
"""
x = x - x[:, 1].unsqueeze(1)
norm = torch.norm(x, dim=-1, keepdim=True)
x_norm = x / (norm+eps)
if mask:
return x_norm[mask], norm[mask]
return x_norm, norm
def orient_aa(x, mask=None, eps=1e-7):
""" Calculates unit vectors ... | |
<filename>vermouth/tests/test_edge_tuning.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 University of Groningen
#
# 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:/... | |
<gh_stars>0
"""App views module."""
from datetime import datetime
from flask import (
Blueprint,
abort,
current_app,
jsonify,
make_response,
redirect,
render_template,
request,
)
from flask_jwt_extended import (
create_access_token,
get_jwt_identity,
jwt_optional,
jwt_required,
)
from werkzeug.datastructur... | |
{
if( isnan(fy) ) {
IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
return IKPI_2;
}
else if( isnan(fx) ) {
return 0;
}
return atan2(fy,fx);
}
inline float IKsign(float f) {
if( f > 0 ) {
return float(1);
}
else if( f < 0 ) {
return float(-1);
}
return 0;
}
inline d... | |
<reponame>moule3053/mck8s<gh_stars>10-100
import kopf
import yaml, pandas as pd
from utils import findPossibleClusters, getFogAppLocations, getCloudCluster, \
createDeployment, createService, deleteDeployment, deleteService, patchDeployment, patchService, createJob, \
deleteJob, patchJob, getMaximumReplicas, findNear... | |
<reponame>tcsvn/pyadlml<filename>pyadlml/model_selection.py
import numbers
import time
import warnings
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from contextlib import suppress
from functools import partial
from traceback import format_exc
import numpy as np
import pandas as pd
from j... | |
"""
Linux on Hyper-V and Azure Test Code, ver. 1.0.0
Copyright (c) Microsoft Corporation
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-... | |
stepper.finalize()
if i == 0 or i == 1 or i == 3 or i == 4:
self.assertAllClose(24.0, result[0])
self.assertAllClose(10.0, result[1][0])
self.assertAllClose(-4.0, result[1][1])
elif i == 2 or i == 5:
self.assertAllClose(24.0, result["e"])
self.assertAllClose(10.0, result["fz"]["f"])
self.assertAllClose(-4.0, re... | |
not isinstance(mac_address_, (bytes, str)):
raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_)))
if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)):
raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_)))
self.i... | |
# -*- coding: utf-8 -*-
# SendHub Python bindings
import logging
import re
import platform
import sys
import urllib
import urlparse
import textwrap
import datetime
import requests
from version import VERSION
import simplejson as json
try:
import cStringIO as StringIO
except ImportError:
import StringIO
_httplib = ... | |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicable l... | |
sani = aim_utils.sanitize_display_name
scope = self._scope_name_if_common
d_name = self._display_name(l3out)
filter_name = scope(l3out.tenant_name, 'EXT-%s' % l3out.name)
fltr = resource.Filter(
tenant_name=l3out.tenant_name,
name=filter_name,
display_name=sani(scope(l3out.tenant_name, 'EXT-%s' % d_name)))
entr... | |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | |
{} -g {} -k '{}'"
.format(edge_device_ids[1], LIVE_HUB, LIVE_RG, content_path), checks=[self.check('length([*])', 3)])
self.cmd("iot edge set-modules -d {} -n {} -g {} --content '{}'"
.format(edge_device_ids[1], LIVE_HUB, LIVE_RG, '{generic_content}'), self.check('length([*])', 3))
# With connection string
self.... | |
[]
self.speedlines = []
self.accellines = []
for idx, cut in enumerate(self.spacetimeslits):
text = self.axes_dspec.text(cut['cutslit']['xcen'][-1], cut['cutslit']['ycen'][-1],
'{}'.format(idx), color=self.color, transform=self.axes_dspec.transData,
ha='left', va='bottom')
self.slitlines_text.append(text)
slitl... | |
#
# Copyright (c) 2014, 2016, 2018, 2020 LexisNexis Risk Data Management Inc.
#
# This file is part of the RadSSH software package.
#
# RadSSH is free software, released under the Revised BSD License.
# You are permitted to use, modify, and redsitribute this software
# according to the Revised BSD License, a copy of wh... | |
"""
Implements modification of human attributes at different levels.
###################### Quarantining / Behavior change logic ########################
Following orders takes care of the person faced with multiple quarantining triggers (each trigger has a suggested duration for quarantine) -
(i) (not app-based) QU... | |
import numpy as np
import random,sys
import scipy
from scipy.spatial.distance import pdist,squareform,cdist
#from scipy.spatial import distance_matrix
import matplotlib.pyplot as plt
import scipy
### "for loop" version
### faster than "matrix version"
### because only need to consider points within h_k
### for loop ... | |
import numpy as np
import copy
import cv2
import os
import PIL.Image as Image
from PIL import ImageDraw
import lmdb
from tqdm import tqdm
import carla
from collect_pm import CollectPerspectiveImage, InversePerspectiveMapping
config = dict(
env=dict(
simulator=dict(
disable_two_wheels=True,
waypoint_num=32,
planne... | |
import torch
import torch.nn as nn
import numpy as np
class ScaledDotProductAttention(nn.Module):
''' Scaled Dot-Product Attention '''
def __init__(self, attn_dropout=0.5):
super().__init__()
self.dropout = nn.Dropout(attn_dropout)
self.softmax = nn.Softmax(dim=2)
def forward(self, q, k, v, mask=None):
tempe... | |
from common.diagrams import Diagram
from common.definitions import G_PROTEIN_SEGMENTS
from residue.models import Residue
from residue.models import ResidueGenericNumber
from residue.models import ResidueNumberingScheme
from django.utils.safestring import mark_safe
from math import cos, sin, pi, floor,sqrt
from datet... | |
len(args) == 3:
return args[:2]
else:
raise TypeError("Wrong number of arguments")
return self._array_converter(self.sip.pix2foc, None, *args)
sip_pix2foc.__doc__ = """
Convert pixel coordinates to focal plane coordinates using the
`SIP`_ polynomial distortion convention.
`Paper IV`_ table lookup distortion co... | |
to ignore zeros points caused by stopped/aborted scans
new_v_shape = len(channel_data) // datashape[1]
new_data = np.vstack(channel_data)
new_data = new_data.astype(np.float32, copy=False) # Change representation to np.float32
new_data = new_data[: new_v_shape * datashape[1], :]
new_data = new_data.reshape([new_... | |
a dictionary with
NumSPIBytesTransferred and SPIBytes.
"""
if not isinstance(SPIBytes, list):
raise LabJackException("SPIBytes MUST be a list of bytes")
numSPIBytes = len(SPIBytes)
oddPacket = False
if numSPIBytes%2 != 0:
SPIBytes.append(0)
numSPIBytes = numSPIBytes + 1
oddPacket = True
command = [ 0 ]... | |
the default of `align_corners` was ``None``, and it becomes ``True``
if `mode` is linear, otherwise ``False``.
.. warning::
Up to the version 1.8.0, the nearest `mode` interpolation corresponds to
the nearest `mode` and `half_pixel_for_nn` = ``True`` after the version 1.8.0.
'''
from .function_bases import inte... | |
"""
Copyright: <NAME>
eMail: <EMAIL>
License: MIT
File which handles Network connections.
We have 5 different classes in this File. Decide the class you need:
NetServer: Simple TCP server with an update method and callbacks.
NetClient: Handles clients of a NetServer with receive and send method.
NetworkServer: TCP ... | |
start: str or Link, optional
:raises ValueError: link not known or ambiguous
:raises ValueError: [description]
:raises TypeError: unknown type provided
:return: end-effector link, base link, and tool transform of gripper
if applicable
:rtype: Link, Elink, SE3 or None
Helper method to find or validate an end-effe... | |
Backup. If set to true, cloud_backup must also be set to true.
"""
return pulumi.get(self, "pit_enabled")
@pit_enabled.setter
def pit_enabled(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "pit_enabled", value)
@property
@pulumi.getter(name="projectId")
def project_id(self) -> Optional[pulumi.In... | |
# Copyright (c) 2020, MD2K Center of Excellence
# - <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, th... | |
<filename>rstfinder/tree_util.py
"""
Classes and functions pertaining to syntactic (constituency) trees.
:author: <NAME>
:author: <NAME>
:organization: ETS
"""
import re
from nltk.tree import ParentedTree
TREE_PRINT_MARGIN = 1000000000
_ptb_paren_mapping = {'(': r"-LRB-",
')': r"-RRB-",
'[': r"-LSB-",
']': r"-RS... | |
<reponame>kos-kaggle/pytorch_advanced
"""
第2章SSDで実装した内容をまとめたファイル
"""
# パッケージのimport
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
from torch.autograd import Function
import torch.utils.data as data
import torch
import cv2
import numpy as np
import os.path as osp
from itertools impo... | |
<gh_stars>100-1000
from __future__ import annotations
import logging
from types import TracebackType
from typing import Optional, Tuple, Type, Union
from typing_extensions import Protocol
from .effect import Depends, Success, add_repr, depend, from_io_bound_callable
from .either import Right
from .functions import c... | |
#!/usr/bin/env python2
# Copyright 2016 <NAME>. 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
"""
builtins.py - Metadata fo... | |
},
"outputs": [
{
"data": {
"text/plain": [
"[(1, 'Aliquid iste optio reiciendi', 0, 0, 10, 1, 1, 1, 1),\n",
" (2, 'Optio dolorem ex a', 0, 0, 10, 1, 1, 1, 1),\n",
" (3, 'Minus c', 0, 0, 10, 1, 1, 1, 1),\n",
" (4, 'Sit ut repr', 0, 0, 10, 1, 1, 1, 1),\n",
" (5, 'At id recusandae expl', 0, 0, 10, 1, 1, 1, 1),\n... | |
self.cmbSegments.clear()
seasonOn = 1
if (self.cmbSeries.currentIndex() != 0):
series = self.cmbSeries.currentText()
episodes = self.d.getEpisodesBySeries(series)
for segment in self.d.getSegments():
name = segment[0]
length = segment[1]
if (name == 'Sleep'):
toAdd = name + " - " + str(length / 60) + " hours... | |
<gh_stars>10-100
import glob
import math
import os.path as osp
import pickle
import random
import gin
import numpy as np
import torch
import torch.nn.functional as F
from absl import flags
from skimage.measure import regionprops
from torch.utils.data import Dataset
from . import image_utils
from . import transformati... | |
<gh_stars>0
import os
import sys
import time
import lxml.etree
import Bcfg2.Server
import Bcfg2.Server.Plugin
from mock import Mock, MagicMock, patch
# add all parent testsuite directories to sys.path to allow (most)
# relative imports in python 2.4
path = os.path.dirname(__file__)
while path != "/":
if os.path.basen... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import os,sys
import re
import inspect
import codecs
import cpp_header_parser as chp
import glob
import json
import fnmatch
#import CppToPyUtil #
import copy
######
def get_chp(filename,declspec_list=[]):
result=None
try:
result=chp.CppHeader(filename,declspec_list=dec... | |
# This module contains functions required to produce the figures associated with Formulation_I in
# Wild et al. (in review)
from __future__ import division # This ensures result of quotient of two integers will be a float, not an integer.
import sys
import pysedsim
import numpy as np
import processing_reference_set
fr... | |
#!/usr/bin/env python
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from numpy import *
import pickle
import sys,os,string
from astropy.io import ascii
from myplotlib import PanelPlot
import config
import STANstats
import get_data
import sigfig
try:
import corner
except:
corner = None
def ... | |
and b}
self.paths = self.set_height()
self.data_dict = {a: b for a, b in zip(pref.menu_e, self.paths)}
self.plot_dict = {a:b for a,b in self.data_dict.items() if self.plot_path[a] and b}
def _verify_temp(self,value):
if is_str_float(value.replace(",",".")):
if float(value) <= -273.15:
self.span_worthy ... | |
None, lambda self: None
) # default
"""Indicates whether the event is being cancelled.
When the event is cancellable, set the property to True to cancel it.
Get: Cancel(self: RevitEventArgs) -> bool
Set: Cancel(self: RevitEventArgs) = value
"""
Cancellable = property(
lambda self: object(... | |
<filename>tiktalik_cli/command/instance.py
"""Module tiktalik_cli.command.instance"""
# Copyright (c) 2013 Techstorage sp. z o.o.
#
# 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 res... | |
# -*- coding: utf-8 -*-
"""
Redis 操作类
Redis是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库。
Redis支持数据的持久化。
Redis支持简单的key-value类型,还提供list,set,zset,hash等数据结构的存储。
Redis支持数据的备份,即master-slave模式的数据备份。
Redis读的速度是110000次/s,写的速度是81000次/s
Redis的所有操作都是原子性的,同时Redis还支持对几个操作全并后的原子性执行。
"""
import functools
from redis import StrictRedis
def w... | |
<reponame>picsag/NLP
#!/usr/bin/env python
# coding: utf-8
# # Assignment 3: Question Answering
#
# Welcome to this week's assignment of course 4. In this you will explore question answering. You will implement the "Text to Text Transfer from Transformers" (better known as T5). Since you implemented transformers from... | |
dict()
if self.req_msg_id is not None:
result['req_msg_id'] = self.req_msg_id
if self.result_code is not None:
result['result_code'] = self.result_code
if self.result_msg is not None:
result['result_msg'] = self.result_msg
result['cpf_list'] = []
if self.cpf_list is not None:
for k in self.cpf_list:
result['c... | |
may have less dimension labels.
"""
return _process('filter_temporal', data=data, extent=extent, dimension=dimension)
def first(data, ignore_nodata=UNSET) -> ProcessBuilder:
"""
First element
:param data: An array with elements of any data type.
:param ignore_nodata: Indicates whether no-data values are ignore... | |
<filename>PAW_lib.py<gh_stars>10-100
"""PAW_lib.py: Written by <NAME> and <NAME>, OHSU.
Library of support functions and classes for PAW pipeline programs.
The MIT License (MIT)
Copyright (c) 2017 <NAME> and OHSU
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software an... | |
import sys
import typing
import bpy_types
class PhysicButtonsPanel:
bl_context = None
''' '''
bl_region_type = None
''' '''
bl_space_type = None
''' '''
def poll(self, context):
'''
'''
pass
class PHYSICS_PT_softbody(PhysicButtonsPanel, bpy_types.Panel,
bpy_types._GenericUI):
COMPAT_ENGINES = None
... | |
definition.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The resource id.
:vartype id: str
:ivar name: Gets the resource name.
:vartype name: str
:ivar type: Gets the resource type.
:vartype type: str
:param location: The resource location.
:type location:... | |
<reponame>sail-sg/mugs
# Copyright 2022 Garena Online Private Limited
#
# 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 app... | |
('+str(self.byhandz.get())+\
') could not be converted to float. Using -99.'
zbyhand = zbyhand+str(int(self.varsliderzqual.get()))
# v v v v v v v v v v v v v v v v v v v v 1st PA v v v v v v v v v v v v v v v v v v v v
resultstr = ' '+str("%.5d" % self.currentobj)+' '+str("%.3d" % self.PAs[0])
defaultstr = result... | |
<reponame>leeomara/webrecorder
import os
import re
import base64
import hashlib
import json
import redis
import requests
from datetime import datetime
from collections import OrderedDict
from os.path import expandvars
from getpass import getpass
from string import ascii_lowercase as alpha
from bottle import template... | |
"""GUI for object detection with tensorflow and distance calculation."""
__version__ = "1.0.0"
__author__ = "<NAME>"
__email__ = "tim.ros<EMAIL>z:stud.uni-frankfurt.de"
__credits__ = "Special thanks to The Anh Vuong who came up with the original idea."
# Description:
# This program uses a TensorFlow Lite mode... | |
<filename>tests/apollo/test_skvbc_chaotic_startup.py<gh_stars>0
# Concord
#
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache 2.0 license (the "License").
# You may not use this product except in compliance with the Apache 2.0 License.
#
# This product may incl... | |
<filename>cogs/kickban.py
import discord
import time
import datetime
from discord.ext import commands
from typing import Optional, Union
from utils import utils, crud
from utils.checks import is_staff, check_bot_or_staff
class KickBan(commands.Cog):
"""
Kicking and banning users.
"""
def __init__(self, bot):
s... | |
# Update token for user
token = tokens.token_show_by_id(context, data_dict)
data_dict['user_id'] = token['user_id']
# removed because it is saved in next step. User is allowed to click on /validate link several times
# get_action('user_extra_update')(context, data_dict)
except NotFound:
return OnbUserNotFound
ex... | |
import sys, os
import time
import cv2
import numpy as np
import math
from scipy.signal import convolve2d
from scipy.ndimage import label,sum
from scipy.misc import imrotate
from matplotlib import pyplot as plt
from skimage import morphology
from skimage.segmentation import slic
from bwmorph import bwmorph_thin
from co... | |
in range(len(legend_list)):
# identify the current battery
cur_bat = legend_list[i]
line, = ax[v].plot(pack_data[self.dict_bat_to_code[cur_bat]]['time'],
pack_data[self.dict_bat_to_code[cur_bat]][var_list[v]][self.dict_bat_to_packindex[cur_bat]],
color_list[i])
handle_list.append(line)
# plotting behavior for... | |
<gh_stars>0
# Copyright The PyTorch Lightning team.
#
# 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... | |
rezervaci cekajicich na ockovani (kalendar pro 1. davky)
rezervace_cekajici_1_zmena_den = Column(Integer) # pocet rezervaci cekajicich na ockovani (kalendar pro 1. davky) - zmena za den
rezervace_cekajici_1_zmena_tyden = Column(Integer) # pocet rezervaci cekajicich na ockovani (kalendar pro 1. davky) - zmena za tyden... | |
)
def test_particles_m003_particles_m003_v(mode, save_output, output_format):
"""
TEST :3.9.1 The Particle Schema Component [ check length of element
information items ] : Particle Derivation OK (Elt:Sequence -
RecurseAsIfGroup) element R drived by restriction from (Sequence) B :
B's parent is choice, B's minOcc... | |
<gh_stars>0
# Generated with love
import typing
from vkbottle.types import responses
from .access import APIAccessibility
from .method import BaseMethod
class FriendsAdd(BaseMethod):
kwargs: dict = {}
access_token_type: APIAccessibility = [APIAccessibility.USER]
async def __call__(
self, user_id: int = None, tex... | |
<reponame>alexkreidler/scholarphi<filename>data-processing/entities/definitions/model/trainer.py
import logging
import os
import shutil
from collections import Counter
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
import torch
from torch.utils.data import DataLoader, RandomSampler, SequentialS... | |
"""Class to fit PEtab problem via time discretization in Julia
:Author: <NAME> <<EMAIL>>
:Date: 2020-04-15
:Copyright: 2020, <NAME>
:License: MIT
"""
import importlib
import libsbml
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import petab
import re
import sys
import warnings
import... | |
archive_path=dataset_dir / (prefix + "p999758-p1020138.7z"),
page_ids=range(999758, 1020139),
darus_id=94139,
sha1="c471eae156fc86c8e2388165906b4cea62789b4b",
size=163440175,
auto_download=auto_download,
),
WikidatedV1_0EntityStreamsFile(
archive_path=dataset_dir / (prefix + "p1020139-p1038943.7z"),
page_ids=r... | |
<filename>pyhanko/sign/validation.py
import hashlib
import logging
import os
from collections import namedtuple
from dataclasses import dataclass
from dataclasses import field as data_field
from datetime import datetime
from enum import Enum, unique
from typing import IO, Iterator, Optional, Type, TypeVar, Union
from ... | |
from typing import Dict
from typing import List
from treasury.session import FederalTreasurySession
class TreasuryReportsOnReceivables():
"""
## Overview:
----
The Treasury Report on Receivables and Debt Collection Activities
(TROR) is the federal government's primary means for collecting
data on the status of... | |
f"{fillet_area=:.3f}, {fillet_perimeter=:.3f}")
return fillet_area, fillet_perimeter
# Fab_Fillet.get_geometries():
def get_geometries(self) -> Tuple[Fab_Geometry, ...]:
geometries: List[Fab_Geometry] = []
if self.Line:
geometries.append(self.Line)
if self.Arc:
geometries.append(self.Arc)
return tuple(geometr... | |
32 bits must be in the range\n'
'\t \t * -2^31 to 2^31 - 1. See\n'
'\t \t * http://www.example.com/integers/this-website-is-too-'
'long-for-one-line\n'
'\t \t * for more details.\n'
'\t \t * \n'
'\t \t* Integers are not the same thing as natural numbers, as '
'the latter must be nonnegative.\n'
' * \t \tNor are... | |
<reponame>YSabarad/monopyly
__author__ = 'Cedric'
# each information will be used to sort the properties for the given policy
import random
from monopyly import *
from .Memory import *
from .Policy import *
class VSSmartBuyerInvertGaussFocusAI(PlayerAIBase):
'''
'''
def __init__(self):
'''
ctor
'''
# memory i... | |
#!/usr/bin/python
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# Usage:
#
# $ ./bike_facilities_populate.py --help
#
# Also:
#
# $ ./bike_facilities_populate.py |& tee 2013.05.11.bike_facil_pop.txt
#
# BUG nnnn: Populate new /byway/cycle_route from by... | |
<gh_stars>0
# Copyright 2013, Red Hat, 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 applic... | |
''' Defines exceptions used to report errors in parsing and execution
of macros.
'''
import exceptions
from macro.interpret.txt_token import TxtToken
from macro.util import NULL_POSITION, NULL_TOKEN_ID
# Base exception class with a shared rendering method.
class MacroError():
''' Base class for macro exceptions cont... | |
import numpy as np
from scipy.stats import norm, ks_2samp
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
###############################################################################
# Plot formatting
#------------------------------------------------------------------------------
#plt.rc('t... | |
value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, intVector, name)
__repr__ = _swig_repr
def iterator(self):
return _robotsim.intVector_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
return _robotsim.intVector___nonzero__(self)
def __bool... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.468568,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime ... | |
<reponame>mycyzs/fta
# coding: utf-8
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file... | |
in six.iteritems(local_var_params['kwargs']):
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_mixin6" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'name' is set
if self.api_client.client_side_valida... | |
core.internals only has to worry
# about 2D cases.
df = self.to_frame()
result = df.quantile(q=q, interpolation=interpolation, numeric_only=False)
if result.ndim == 2:
result = result.iloc[:, 0]
if is_list_like(q):
result.name = self.name
return self._constructor(result, index=Float64Index(q), name=self.name)... | |
# Copyright (C) 2018-2021
# Author: <NAME>
# Contact: <EMAIL>
"""Tag Functions.
The following functions give you access to interact with Ignition Tags.
"""
from __future__ import print_function
__all__ = [
"browse",
"browseHistoricalTags",
"browseTags",
"browseTagsSimple",
"configure",
"copy",
"deleteAnnotat... | |
config.MODEL_DIR + 'ft_{0}_sg_300_neg5_it2.model'.format(config.MODEL_NAME)
self.ft_model = self.load_ft_model(self.ft_fname)
def load_ft_model(self, fname):
"""
class FastText(sentences=None, sg=0, hs=0, size=100, alpha=0.025, window=5, min_count=5, max_vocab_size=None,
word_ngrams=1, sample=0.001, seed=1, worke... | |
bool, default = False
Determines whether NaN values are allowed
in the input/output of the transformer.
random_state : int, RandomState instance, default=None
The seed of the pseudo random number generator.
Random number generator is not directly used by the Deduper;
however, the parameter is present for co... | |
= ' \\multicolumn{2}{c||}{Map Error} '
# for seqId in sequences:
# rowString += ' & {0:.2f}m '.format(1000.0*seqStats[seqId]['mapErr'])
# rowString += ' & {0:.2f}m \\\\\n'.format(1000.0*seqErrAvg)
# fid.write(rowString)
for (mmI,mmName) in enumerate(motionModels):
fid.write('\\hline\n'*2)
if len(motionModels) > 1:
... | |
glob-patterns.
rmany:a.csv,b*.csv - read a.csv and all b-csv's into 1 dataframe.
rmany:a,b* - same thing, .csv extension is tested for as well
Note that strange things may happen if the csv-files have different
column names.
For convenience, the abbreviation r: is an alias for rmany.
'''
# sanity check lhs, r... | |
2.3960170377866*m.b557 >= -3.49462932645471)
m.c1732 = Constraint(expr= m.x106 - m.x107 - 2.3960170377866*m.b558 >= -3.49462932645471)
m.c1733 = Constraint(expr= m.x107 - m.x108 - 2.3960170377866*m.b559 >= -3.49462932645471)
m.c1734 = Constraint(expr= m.x109 - m.x110 - 2.28868218782505*m.b549 >= -3.38729447649316)
... | |
<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import pprint
from subprocess import Popen, PIPE
import os
from future.tests.base import CodeHandler, unittest
class TestFuturizeSimple(CodeHandler):
"""
This class contains snippets of Python 2 code (invalid Pyth... | |
body)
self.assertIn(b"last project", body)
class SeleniumTest(MyHTTPTestCase):
def setUp(self):
super(SeleniumTest, self).setUp()
from selenium import webdriver
if os.environ['TAGUETTE_TEST_WEBDRIVER'] == 'firefox':
self.driver = webdriver.Firefox()
elif os.environ['TAGUETTE_TEST_WEBDRIVER'] == 'chromium':
... | |
'</td>' + \
'<td>' + r13c17 + '</td>' + \
'<td>' + r13c18 + '</td>' + \
'<td>' + r13c19 + '</td>' + \
'<td>' + r13c20 + '</td>' + \
'<td>' + r13c21 + '</td>' + \
'<td>' + r13c22 + '</td>' + \
'<td>' + r13c23 + '</td>' + \
'<td>' + r13c24 + '</td>' + \
'<td>' + r13c25 + '</td>' + \
'<td>' +... | |
RfmtFormatter(CodeFormatter):
"""Formatter for:
rfmt: A code formatter for R.
(https://github.com/google/rfmt)
"""
shortname = 'rfmt'
configfilename = '.rfmtrc'
language_exts = [['R', REXTS]]
def __init__(self, exe, cache=None):
super(RfmtFormatter, self).__init__(exe, cache=cache)
def register_options(sel... | |
yt - np.cos(Angles[i]) * dr
i += 1
maskx = np.logical_and(x > np.min(xb)-5, x<np.max(xb)+5)
masky = np.logical_and(y > np.min(yb)-5, y<np.max(yb)+5)
mask = np.logical_and(maskx, masky)
ptop = griddata(np.vstack((x[mask], y[mask])).transpose(),
p[mask], top)
pbot = griddata(np.vstack((x[mask], y[mask])).tran... | |
<reponame>ob/remote
import logging
import re
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime
from functools import wraps
from pathlib import Path
from typing import List, Optional, Union
import click
from .configuration import WorkspaceConfig
from .configurati... | |
import sys
import time as time_lib
import os
from bin import spl_memory as mem
def replace_bool_none(string: str):
"""
Returns a str with 'None', 'True', and 'False' replaced with 'null', 'true', and 'false'.
This function also removes quotes generated by spl String object.
:param string: the str object to be r... | |
logger.info(self.metar.raw)
self.reset_update_time()
if ignore_updated:
updated = True
if updated and (self.on_main or force_main):
self.draw_main()
elif force_main and not updated:
self.error_no_data()
def new_station(self):
"""
Update the current station from ident and display new main screen
"""
logger.... | |
elif self.model.estimator_type == "clusterer":
self._send_table_description("cluster")
# Debug information is printed to the terminal and logs if the paramater debug = true
if self.model.debug:
self._print_log(4)
return self.response
# If the function was called through a chart expression we return a Series... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.