input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import logging
import ipdb
import IPython
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
SOS_ID = 0
EOS_ID = 0
class Attention(nn.Module):
def __init__(self, input_dim, source_dim=None, output_dim=None, bias=False):
super(Attention, self).__init__()
if source_dim... | |
'''
Copyright (c) 2017 <NAME>
This file is part of mac_apt (macOS Artifact Parsing Tool).
Usage or distribution of this software/code is subject to the
terms of the MIT License.
'''
from __future__ import unicode_literals
from __future__ import print_function
from kaitaistruct import __version__ as ks... | |
<gh_stars>0
import numpy as np
from math import sqrt
import itertools
import matplotlib.pyplot as plt
class MDP():
def __init__(self):
# Max time steps.
self.T =15
#Origin at Top left
self.GRID_SIZE_COL = 6
self.GRID_SIZE_ROW = 5
self.reward = 0
'''State'''
# position of player
self.p = (0,0)
# positi... | |
x
for x in gen(0):
yield x
# That works fine, but recursing a level and checking i against len(gs) for
# each item produced is inefficient. By doing manual loop unrolling across
# generator boundaries, it's possible to eliminate most of that overhead.
# This isn't worth the bother *in general* for generators, but c... | |
LON_CTR,
'target_lat': LAT_CTR,
'nrows_blend': HALO_BLEND,
#
# Question:
# For a ESGgrid type grid, what should stretch_fac be set to? This depends
# on how the FV3 code uses the stretch_fac parameter in the namelist file.
# Recall that for a ESGgrid, it gets set in the function set_gridparams_ESGgrid(.sh)
# to... | |
pass
msghandler(m, electronic)
except:
electronic.send_message(441399484, traceback.format_exc())
######################## LENA ###################################################
@lena.message_handler(commands=['control'])
def lenacontrol(m):
config.about(m, lena)
x='le_admins'
adm=admins.find_one({'name'... | |
East Asian ideograph
0x2D502D: (0x7B5D, 0), # East Asian ideograph
0x4C4339: (0x69DE, 0), # East Asian ideograph
0x6F502E: (0xBA5C, 0), # Korean hangul
0x6F5038: (0xBA85, 0), # Korean hangul
0x213A60: (0x5B78, 0), # East Asian ideograph
0x21502F: (0x7BAD, 0), # East Asian ideograph
0x215030: (0x7BC4, 0), # East ... | |
printLog(device, 'Current ' + odStr + ' OverDrive value: ' + str(od) + '%')
print(logSpacer)
def showProfile(deviceList):
""" Display available Power Profiles for a list of devices.
Parameters:
deviceList -- List of devices to display available Power Profile attributes (can be a single-item list)
"""
global RE... | |
<filename>src/core/transform.py<gh_stars>10-100
from .base import *
class TransformMixin:
""" Selection class mix-in """
def __init__(self):
self._obj_root = Mgr.get("object_root")
self._pivot = Mgr.get("selection_pivot")
self._pivot_used = False
self._start_positions = []
self._start_quats = []
self._star... | |
import threading
import shlex
from guppyproxy.util import max_len_str, query_to_str, display_error_box, display_info_box, display_req_context, hostport, method_color, sc_color, DisableUpdates, host_color
from guppyproxy.proxy import HTTPRequest, RequestContext, InvalidQuery, SocketClosed, time_to_nsecs, ProxyThread
fr... | |
<gh_stars>1-10
import copy, pickle, re
from shlex import split as shlexsplit
from . import config
from .helpers import *
from .errors import AssertionError, UnRecognisedCSVFormatError, UnrecognisedFileFormatError, ArgumentError
class _base_genelist:
def __init__(self):
"""
(Internal)
This is the base derived cla... | |
0
while k < noutliers:
r = 0
while r < nrealizations:
y = util.getmeasurements(a, x, noisetype, var, outliers[k]) # get the measurements
# -------- ls solution
xhat = inv.leastsquares(y, a) # solving the problem with ls
error = np.linalg.norm(x - xhat)
averrorls[k] += error
# -------- m estimated scale solutio... | |
<gh_stars>0
"""
todo: Plan to set rules here as to how that HashableClass needs to be
overridden by users .... also do some one time validations here ....
should be done once entire library is loaded
This will solve many piled up todos in code and reduce overhead
Class validation mostly checks CodingErrors:
+ We m... | |
upper decorators).
:return: None
"""
pre_defined_ce, upper_decorator = pre_defined_ce
# Include the registering info related to @task
impl_type = "METHOD"
impl_constraints = {}
impl_io = False
if __debug__:
logger.debug("Configuring core element.")
set_ce_signature = self.core_element.set_ce_signature
set... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utility module that contains useful utilities functions for PySide
"""
from __future__ import print_function, division, absolute_import
import os
import sys
import struct
import logging
import inspect
import contextlib
from tpDcc import dcc
from tpDcc.libs.python i... | |
<reponame>cameron-freshworks/ppr<gh_stars>0
# Copyright © 2019 Province of British Columbia
#
# 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
#
# ... | |
is updatable.
type: list
suboptions:
icmp_options:
description:
- "Optional and valid only for ICMP. Use to specify a particular ICMP type and code
as defined in
L(ICMP Parameters,http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml).
If you specify ICMP as the protocol but omit this object, th... | |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= #
def _parse_directive(self) -> FortielNode:
"""Parse a directive."""
# Parse directive head and proceed to the specific parse function.
directive = self._matches_line(_F... | |
in featureList:
testData.append(np.array(data_dict[data])[:100])
testData = np.array(testData)
predict(model,testData)
init_DataDict()
# for _ in range(100):
# data_dict[data].popleft()
if(self.current_option == self.button_rows-1):
self.current_option = -1
self.next_option()
class MessageSentPage(GridLayo... | |
#!/usr/bin/python3
# run time halt 20,24 sec
# PiJuice sw 1.4 is installed for Python 3
# sudo find / -name "pijuice.py" /usr/lib/python3.5/dist-packages/pijuice.py
#https://feeding.cloud.geek.nz/posts/time-synchronization-with-ntp-and-systemd/
# on systemd apt-get purge ntp to use only systemd-timesyncd.service
#... | |
<reponame>deeso/dhp<filename>src/docker_honey/simple_commands/boto.py
__copyright__ = """
Copyright 2020 Cisco 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.... | |
gateway. Use the ListGateways operation to return a list of gateways for your account and region.
:type AverageUploadRateLimitInBitsPerSec: integer
:param AverageUploadRateLimitInBitsPerSec:
The average upload bandwidth rate limit in bits per second.
:type AverageDownloadRateLimitInBitsPerSec: integer
:param Avera... | |
<filename>sdk/python/pulumi_azure_native/devtestlab/v20150521preview/virtual_machine_resource.py<gh_stars>0
# 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... | |
of
# world, in case of errors, PROXY's return HTML, this function parses
# the error and adds it to the action_result.
if 'html' in response.headers.get('Content-Type', ''):
return self._process_html_response(response, action_result)
# if no content-type is to be parsed, handle an empty response
if not response.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
import pprint
import re
import codecs
import json
"""
Your task is to wrangle the data and transform the shape of the data
into the model we mentioned earlier. The output should be a list of dictionaries
that look like this:
{
"id": "240... | |
# -*- coding: utf-8 -*-
# Copyright (C) 2011 <NAME> <<EMAIL>>
#
# 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 ... | |
from learning_to_adapt.dynamics.core.layers import MLP
from collections import OrderedDict
import tensorflow as tf
import numpy as np
from learning_to_adapt.utils.serializable import Serializable
from learning_to_adapt.utils import tensor_utils
from learning_to_adapt.logger import logger
import time
class MetaMLPDyna... | |
""" metric.py is a small script to turn psuedo-c metric descriptions
into executable c code as needed by zettair. Usage:
metric.py [--debug | --help] metricname.metric
If you want to debug your metric, i suggest you insert printf statements,
as there's nothing stopping you doing so.
Our input format is this:
... | |
<filename>sc_projects/SC101/my_drawing/my_drawing.py
"""
File: my_drawing.py
Name: <NAME>
----------------------
This file print the logo of 'STARWARS' and may the force be with you
"""
from campy.graphics.gobjects import GRect, GPolygon
from campy.graphics.gwindow import GWindow
window = GWindow(width=600, height=... | |
<gh_stars>1-10
"""
`Cargo SQL shortcut functions for creating tables, models, role, etc`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
The MIT License (MIT) © 2015 <NAME>
http://github.com/jaredlunde/cargo-orm
"""
import sys
from cargo.builder.casts import Cast
from cargo.builde... | |
<filename>coco.py
"""
Mask R-CNN
Configurations and data loading code for MS COCO.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
Edited by <NAME>
------------------------------------------------------------
Usage: import the module, or run from the com... | |
self.extrapolation_method = None
self.final_energy_index = None
self.geography = None
self.geography_map_key = None
self.input_type = None
self.interpolation_method = None
self.is_stock_dependent = None
self.other_index_1 = None
self.other_index_2 = None
self.subsector = None
self.unit = None
def set_args(s... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... | |
<filename>app/caffe_detector.py
#!/usr/bin/env python
import argparse
import os
import sys
import time
import glob
import datetime
import numpy as np
import json
import caffe
from caffe.proto import caffe_pb2
import multiprocessing as mp
import gdal
from gdalconst import *
import osr
import logging as log
import re
fro... | |
<filename>uos_statphys/isingModel.py
__all__ = ['IsingModel','IsingMultiAnalyzer']
from .ImportManager import Import_Manager
mm = Import_Manager()
mm.requireAs('ctypes', 'os','gc', np = 'numpy', plt = 'matplotlib.pyplot', globs = globals())
import ctypes, os, gc
import numpy as np
import matplotlib.pyplot as plt
from... | |
#!/usr/bin/env python
"""
Greynir: Natural language processing for Icelandic
Evaluation of spelling and grammar correction
Copyright (C) 2021 <NAME>.
This software is licensed under the MIT License:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated d... | |
return hash(
(
id(self),
)
)
Callback = Callable[[Message, Channel], Union[None, Awaitable[None]]]
class Subscriber(_ExchangeChildModel):
"""A Subscriber consumes relevant Messages published to an Exchange.
Subscribers can invoke a callback when a new Message is published and can be used
as an asynchronous ... | |
"""
Module: Sampler
The sampler module is provides methods exploring the potential functions.
Stochastic Integrators
"""
import numpy as np
import scipy.constants as const
from ensembler.samplers._basicSamplers import _samplerCls
from ensembler.util.ensemblerTypes import Union, List, Tuple, Number
from ensembler.ut... | |
the current matrix until it is in reduced row
echelon form (RREF). The transpose of a matrix has the same RREF as original.
Note: This doesn't change the matrix internally, you will have to assign the
return value to the your matrix variable if you want to change it.
:return: reduced row echelon form of current m... | |
<gh_stars>10-100
import json
import itertools
from datetime import datetime, timedelta
import pandas as pd
from sqlalchemy import select, and_, join
from sqlalchemy.exc import IntegrityError
import copy
from ecoreleve_server.core import RootCore
from ecoreleve_server.core.base_resource import DynamicObjectResource, D... | |
cos(b2) + (
-(1 - cos(a1)) * sin(b1) ** 2 + 1) * sin(a2) * sin(b2) + sin(a1) * sin(b1) * cos(a2)) * sin(
a3) * cos(b3),
- (1 - cos(a3)) * (
-(1 - cos(a1)) * (-(1 - cos(a2)) * cos(b2) ** 2 + 1) * sin(b1) * cos(b1) - (1 - cos(a2)) * (
-(1 - cos(a1)) * sin(b1) ** 2 + 1) * sin(b2) * cos(b2) - sin(a1) * sin(a2) * sin(b... | |
= wgb.point3DListtoMemorySafeCoordList(sb,coordinatesList)
#pg = gbx.BasicSerialization.makegbPlanarGeom(memsafelist)
#namebase = "su-"+str(uniquesurfcount)
namebase = "su-"+surface.name
pg,gbsurfname = wgb.makegbPlanarGeoms(coordinatesList,0,namebase)
#for a all surfaces surface
if isinstance(pg,list... | |
# coding: utf-8
import requests
try:
from sseclient import SSEClient
except ImportError:
SSEClient = None
try:
# Python 3
from urllib.parse import urlencode
except ImportError:
# Python 2
from urllib import urlencode
from .exceptions import HorizonError
HORIZON_LIVE = "https://horizon.stellar.org"
HORIZON_TES... | |
PSM score
temp_result[26] = "XS:f:" + str(
row['search_score']['score'])
#XT: non/semi/tryptic
temp_result[27] = "XT:i:" + str(
enzyme_specificity)
#XU: petide URL
temp_result[28] = "XU:Z:*"
#YA: following 2AA:
temp_result[29] = "YA:Z:" + str(
pre_post_aa[1])
#YB: preceding 2AA
temp_result[30] = "YB:Z:" + s... | |
channels[idx]
def getPreviousChannel(self, currentChannel):
channels = self.getChannelList()
idx = channels.index(currentChannel)
idx -= 1
if idx < 0:
idx = len(channels) - 1
return channels[idx]
def saveChannelList(self, callback, channelList):
self.eventQueue.append([self._saveChannelList, callback, channe... | |
<filename>foliage/change_tab.py
'''
change_tab.py: implementation of the "Change records" tab
Copyright
---------
Copyright (c) 2021-2022 by the California Institute of Technology. This code
is open-source software released under a 3-clause BSD license. Please see the
file "LICENSE" for more information.
'''
from co... | |
thankfully _it is!_
# Rather than the `.corr()`, we will use `.cov()` to get the raw covariance matrix. This is more useful in some respects, since it more clearly shows how much variance there is in the individual parameters. For instance, stellar wind velocity has very low dispersion. Since we have taken log of all... | |
set(self._ids) > set(other._ids)
def __ge__(self, other):
if not isinstance(other, BaseModel) or self._name != other._name:
return NotImplemented
if not other or other in self:
return True
return set(self._ids) >= set(other._ids)
def __int__(self):
return self.id or 0
def __repr__(self):
return "%s%s" % (s... | |
from numpy import dot, sign, zeros, all, isfinite, array, sqrt, any, isnan, pi, sin, arccos, inf, argmax, asfarray
import numpy
from numpy.linalg import norm
class DilationUnit():
#vectorNorm = 0 # TODO: remove it?
#dilationCoeff = 1.0
maxScalarComponentsLength = 2
def __init__(self, vector, dilationCoeff):
... | |
<reponame>rambasnet/MAKE2
#-----------------------------------------------------------------------------
# Name: DBFunctions.py
# Purpose:
#
# Author: <NAME>
#
# Created: 2007/11/10
# RCS-ID: $Id: DBFunctions.py,v 1.11 2008/03/25 03:02:12 rbasnet Exp $
# Copyright: (c) 2007
# Licence: All Rights Reserved.
# ... | |
import logging
import os
import pathlib
import sys
import threading as th
import time
import traceback as tb
import io
import urllib.request as ur
import zipfile
import shutil
from io import open
from os import path
from urllib.error import URLError
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from PyQt5.QtCore imp... | |
import copy
import numpy as np
from spysort.functions import convolution, cut_sgl_evt
from spysort.Events import events
class align_events(events.build_events):
""" Alignment of spike forms after clustering using a Brute-Force method"""
def __init__(self, data, positions, goodEvts, clusters, CSize, win=[],
before=... | |
<reponame>haroonf/azure-cli-extensions<gh_stars>1-10
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------... | |
= self.backtester_engine.get_result_daily()
self.dailytable.set_data(dailyresults)
def process_optimization_finished_event(self, event: Event):
""""""
self.write_log("请点击[优化结果]按钮查看")
self.result_button.setEnabled(True)
def clear_data(self):
full_sym = self.symbol_line.text()
if self.interval_combo.currentText... | |
<filename>agilent_scope.py
from __future__ import with_statement
"""
This is to communicate with an Agilent Windows-based oscilloscope over Ethernet.
This version required a server program named "alinemt_scope_server.py" running
on the Oscilloscope computer.
<NAME>, 6 Sep 2007 - 13 May 2015
"""
import socket # needed... | |
within the ARC corpus, without the need for
developing new approaches or algorithms.
It would have been significantly less effort for me to implement three solve functions of
the same type, than three problems of different type - because I would not have needed
to invent / discover new skills or methods (by s... | |
from asyncio.locks import BoundedSemaphore
import csv
import json
from collections import namedtuple
from typing import Any, List, Tuple, Set, Dict
import asyncio
import httpx
from enum import Enum, auto
from jwcrypto import jwk as _jwk
IssuerEntry = namedtuple('IssuerEntry', 'name iss website canonical_iss')
IssuerEnt... | |
<reponame>ecaroth/blender-mini-base-tools-plugin
bl_info = {
"name": "EC3D Base Tools",
"version": (1, 0, 0),
"blender": (2, 80, 0),
"location": "3D View > Sidebar",
"category": "Object"
}
import bpy, bmesh, math, os, mathutils
from bpy_extras.io_utils import ExportHelper
BOTTOM_TOLERANCE = 0.05
BOTTOM_MERGE_VER... | |
# This file is a part of DeerLab. License is MIT (see LICENSE.md).
# Copyright(c) 2019-2021: <NAME>, <NAME> and other contributors.
import numpy as np
from deerlab.utils import Jacobian, nearest_psd
from scipy.stats import norm
from scipy.signal import fftconvolve
from scipy.linalg import block_diag
from scipy... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#####
Tools
#####
*Created on Thu Jul 2 10:07:56 2015 by <NAME>*
A set of tools to use with the `RDKit <http://rdkit.org>`_ in the IPython notebook.
"""
import time
import sys
import base64
import os
import os.path as op
import random
import csv
import gzip
import m... | |
offset_x, offset_y):
self.center = (self.center[0] + offset_x, self.center[1] + offset_y)
self.start = (self.start[0] + offset_x, self.start[1] + offset_y)
self.end = (self.end[0] + offset_x, self.end[1] + offset_y)
def rotate(self, angle, center=(0, 0)):
self.start_angle += angle
self.end_angle += angle
self.c... | |
"""Primary tests."""
import copy
import functools
import pickle
from typing import Any, Callable, Dict, List, Optional, Tuple
import warnings
import numpy as np
import pytest
import scipy.optimize
from pyblp import (
Agents, CustomMoment, DemographicCovarianceMoment, Formulation, Integration, Iteration, Optimizatio... | |
crashing with minions and bombs!", 45, (40, 430), (255, 0, 0))
setText("5. Points Awarded: 1, 3, 5 and 10 depending up on the kind of egg.", 45, (40, 500), (255, 0, 255))
pygame.draw.rect(instruction_window, (0, 128, 255), (display_width / 2 - 180, 560, 160, 80))
setText("Back", 60, (display_width / 2 - 1... | |
<gh_stars>1-10
"""
A module for simple MPI communication.
The SimpleComm class is designed to provide a simplified MPI-based
communication strategy using the MPI4Py module.
To accomplish this task, the SimpleComm object provides a single communication
pattern with a simple, light-weight API. The communication pattern... | |
'Tooraweenah'},
'61268608':{'en': 'Trangie'},
'61268609':{'en': 'Tyrie'},
'61268610':{'en': 'Bruie Plains'},
'61268611':{'en': 'Parkes'},
'61268612':{'en': 'Parkes'},
'61268613':{'en': 'Alectown'},
'61268614':{'en': 'Bindogundra'},
'61268615':{'en': 'Bogan Gate'},
'61268616':{'en': 'Mandagery'},
'61268617':{'... | |
<filename>skrf/media/media.py
'''
.. module:: skrf.media.media
========================================
media (:mod:`skrf.media.media`)
========================================
Contains Media class.
'''
import warnings
import numpy as npy
from scipy import stats
from scipy.constants import c, inch, mil
from ..fre... | |
#!/usr/bin/env python
from __future__ import print_function
import os
import os.path
import threading
import sentinel2_metadata
bandList = [
'B01',
'B02',
'B03',
'B04',
'B05',
'B06',
'B07',
'B08',
'B8A',
'B09',
'B10',
'B11',
'B12']
bandList_10m = ['B02', 'B03', 'B04', 'B08']
bandList_20m = ['B05', 'B06... | |
import itertools as it
import math
import os
from enum import IntEnum, auto
import numpy as np
import pygame as pg
import pymunk as pm
from gym import spaces
from gym.utils import EzPickle, seeding
from pymunk import Vec2d
from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector, wrappers
from pettin... | |
from csp.decorators import csp_update
from django.utils.decorators import method_decorator
from rest_framework.authentication import SessionAuthentication
from rest_framework_simplejwt.authentication import JWTAuthentication
from django.views.generic import TemplateView, DetailView, FormView
from rest_framework.generic... | |
the number of partitions for the RDD to use.
Returns:
avg_ils: the average user's Intra-List Similarity
"""
temp = y_predicted.map(lambda (u,i,p): (i, (u,p))).join(content_array)
user_ils = temp.map(lambda (i,((u,p),c_a)): (u, (i, c_a))).groupByKey()\
.map(lambda (user, item_list):(calc_user_ILS(list(item_list... | |
<reponame>mcx/pinocchio
from .. import pinocchio_pywrap as pin
from ..utils import npToTuple
from . import BaseVisualizer
import os
import warnings
import numpy as np
from distutils.version import LooseVersion
try:
import hppfcl
WITH_HPP_FCL_BINDINGS = True
except:
WITH_HPP_FCL_BINDINGS = False
def isMesh(geomet... | |
len(all_orfs)
# for the bonferroni correction, we only correct for the number of tests
# we actually consider that is, we only correct for orfs which pass
# the base filter
corrected_significance_level = chisq_alpha / M
msg = "Corrected significance level: {}".format(corrected_significance_level)
logger.debug(... | |
able to parse this type...
# no_type_match_but_ext_match.append(p)
pass
# then the specific
for p in self._specific_parsers:
match, exact_match = p.is_able_to_parse_detailed(desired_type=desired_type,
desired_ext=required_ext,
strict=strict)
if match:
if is_any_type(desired_type):
# special case: dont regist... | |
selector with unquoted value, not '
'matching class attribute not beginning with specified '
'substring',
'selector': '#attr-begins [class^= apple]'},
{
'expect': ['attr-ends-a1', 'attr-ends-a3'],
'level': 3,
'name': 'Attribute ends with selector, matching href attributes '
'ending with specified substring',
'... | |
<gh_stars>0
""" Module providing the Fusion360 CommandBase.
"""
import sys
import os
from collections import deque
import traceback
from typing import List, Dict, Any
import logging
from abc import abstractmethod
import uuid
import adsk.core
import adsk.fusion
from .UiElements import UiItemFactory
from ..utilities i... | |
<filename>bbp/comps/build_workflow.py
#!/usr/bin/env python
"""
Copyright 2010-2019 University Of Southern California
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... | |
= input_uvf
# used to set the mode depending on which input is given to uvf_mode
getattr(uvf, uvf_mode)()
with pytest.raises(ValueError, match=err_msg):
uvf.select(**select_kwargs)
@pytest.mark.filterwarnings("ignore:The uvw_array does not match the expected values")
@cases_decorator_no_waterfall
@pytest.mark.p... | |
},
":older_woman_tone5:": {
"category": "people",
"name": "older woman tone 5",
"unicode": "1f475-1f3ff"
},
":om_symbol:": {
"category": "symbols",
"name": "om symbol",
"unicode": "1f549",
"unicode_alt": "1f549-fe0f"
},
":on:": {
"category": "symbols",
"name": "on with exclamation mark with left right arr... | |
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.38352,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime Dynamic': 3... | |
<gh_stars>1-10
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.mixture import GaussianMixture
from sklearn.utils import check_array
from sklearn.utils.validation import check_is_fitted
from anytree import ... | |
"""
The MIT License (MIT)
Copyright (c) 2018 SML
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish,... | |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
from awkward._v2.tmp_for_testing import v1_to_v2, v1v2_equal
pytestmark = pytest.mark.skipif(
a... | |
color, label
for experiment in exps:
col = 0 if experiment.params['mdp'] == 'bandits' else 1
ax = get_ax(axes, 0, 1, num_columns, col)
params = experiment.params
if args.exclude:
if any(str(params[key]) in args.exclude for key in params.keys()):
continue
means = experiment.means_data
num_iter = len(means[y_v... | |
<filename>nengo/transforms.py
import warnings
import numpy as np
from nengo.base import FrozenObject
from nengo.dists import Distribution, DistOrArrayParam, Uniform
from nengo.exceptions import ValidationError
from nengo.params import (
BoolParam,
EnumParam,
IntParam,
NdarrayParam,
Parameter,
ShapeParam,
)
from... | |
ext_attr_cont """
if len(p) == 3:
p[0] = ListFromConcat(self.BuildExtAttribute(p[1], 'True'), p[2])
if len(p) == 5:
p[0] = ListFromConcat(self.BuildExtAttribute(p[1], p[3]), p[4])
if len(p) == 6:
p[0] = ListFromConcat(self.BuildExtAttribute(p[1], p[3]), p[5])
if self.parse_debug: DumpReduction('ext_attribute_lis... | |
εσωστρέφεια εσωτερίκευση εσωτερικοποίηση
εσωτερικό εσωτερικότης εσωτερικότητα εσωτερισμός εσωτρόπιο εσώρουχο εσώφυλλο
εταίρος εταζέρα εταιρία εταιρεία εταιρισμός εταλονάζ εταλονέρ ετεραρχία
ετεροίωσις ετεροαπασχόληση ετεροβίωτος ετεροβιωματικός ετεροβιωματικότητα
ετερογένεια ετερογένεση ετερογαμία ετερογενές ετερογ... | |
<reponame>hlebuschek/l2
import logging
import threading
import time
import re
from collections import defaultdict
from typing import Optional, Union
from utils.response import status_response
from django.db.utils import IntegrityError
from utils.data_verification import as_model, data_parse
import simplejson as json
... | |
<filename>openstack/cloud/openstackcloud.py
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | |
from collections import OrderedDict
import torch
from torch import nn
from torchvision.ops import MultiScaleRoIAlign
from torchvision.models.utils import load_state_dict_from_url
from torchvision.models.detection.faster_rcnn import FasterRCNN
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone... | |
None currCtr")
if not seqInd in barriersBySeqByCtr:
# FIXME: Error?
logger.warning("getBarrierForSeqCtr got seqInd %s not in barriersBySeqByCtr", seqInd)
return -1
# For a wait, could look it up by the index
# But the wait should be on the ByCtr list too
# if str(currCtr).startswith('with-'):
# # It was a with, s... | |
from xml.etree import ElementTree
import svgwrite
import enum, math
################
# Tree utility functions
#
# For generically handling the various kinds of tree-like things that can be
# passed to this module
################
def treelet_split_str(t):
# treat strings as leaf nodes.
if isinstance(t, str):
retur... | |
import numpy as np
import logging
import emcee
from uncertainties import unumpy, ufloat
import matplotlib
from scipy.interpolate import interp1d, interp2d
from scipy.integrate import trapz
import time
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import corner
import VmaxLumFunc as V
import seaborn... | |
<reponame>ngoylufo/casino-simulator<filename>casino_simulator/roulette/gameObjects.py<gh_stars>0
import random
from ..gameObjects import (Outcome, OutcomeFactory, Bet, Table, Player, Game,
Simulator)
from ..exceptions import InvalidObjectError
class Bin(object):
"""A numbered :class:'Bin' in a roulette wheel contai... | |
subtrees must also be binary search trees.
Example 1:
2
/ \
1 3
Input: root = [2,1,3]
Output: true
Example 2:
Input: root = [5,1,4,null,null,3,6]
Output: false
Explanation: The root node's value is 5 but its right child's value is 4.
"""
def isValidBST(self, root: Optional[TreeNode]) -> bool:
def fn(ro... | |
import os
import numpy as np
import netCDF4
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import matplotlib
import matplotlib.collections as mcollections
import matplotlib.patches as patches
from matplotlib.path import Path
from matplotlib.offsetbox import AnnotationBbox, OffsetImage
from mat... | |
remote profiling of Solr instances
Returns:
hosts - A list of hosts for the SolrCloud cluster.
"""
hosts = _lookup_hosts(cluster, True)
numNodesPerHost = int(nodesPerHost)
totalNodes = numNodesPerHost * len(hosts)
_info('Setting up %d SolrCloud nodes on cluster: %s with hosts: %s' % (totalNodes, cluster, host... | |
both models, check if there was a change insight the nodes
#for a deep comparison, serialize them
newNodeSerialized = json.dumps(newModel[newNodeId],sort_keys=True)
oldNodeSerialized = json.dumps(oldModel[newNodeId],sort_keys=True)
if newNodeSerialized != oldNodeSerialized:
#something is different, so return that ... | |
raise:
- RemoteError if Etherscan is used and there is a problem querying it or
parsing its response
- InputError if the given name is not a valid ENS name
"""
try:
normal_name = normalize_name(name)
except InvalidName as e:
raise InputError(str(e)) from e
resolver_addr = self._call_contract(
web3=web3,
con... | |
<reponame>shidarin/RipMaster
#/usr/bin/python
# Ripmaster.tools
# Module containing tools used by Ripmaster
# By <NAME>, 2013/11/10
"""
Description
-----------
This module contains all the classes that Ripmaster uses to represent the files
and processes on disk.
Classes
-------
AudioTrack
Represents a single audi... | |
= usersDB.addUser(message.author.id)
itemNum = argsSplit[1]
if not bbUtil.isInt(itemNum):
await message.channel.send(":x: Invalid item number!")
return
itemNum = int(itemNum)
if itemNum > len(requestedBBUser.getInactivesByName(item)):
await message.channel.send(":x: Invalid item number! You have " + str(len(req... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.