input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import ctypes
import os
import sys
import logging
from . import timer
from .exit import has_exit_hooks, invoke_exit_callbacks
from .globs import (DEFAULT_BASIC_BLOCK_LIMIT,
DEFAULT_FUZZ_CONSUMPTION_TIMEOUT, DEFAULT_MAX_INTERRUPTS,
FUZZ_MODES, TRIGGER_MODES)
from .mmio_models.wrapper import mmio_access_handler_wrapp... | |
of themselves
y, yfit = [y], [yfit]
found_rv = [found_rv]
# order gen is just set to a list containing the first
# (and only) element
order_gen = [0]
# else if orders is None we get all orders
elif order is None:
order_gen = plotter.plotloop(orders)
# prompt to start looper
plotter.close_plots(loop=True)
# e... | |
# -*- python -*-
from __future__ import division
from professor2.core import *
from professor2.histos import *
from professor2.errors import *
from professor2.sampling import *
def mk_ipolinputs(params):
"""
Make sorted run name and parameter name & value lists, suitable for passing to prof.Ipol
params is a dict... | |
<reponame>l9c/flask-limiter<filename>tests/test_decorators.py
import functools
from functools import wraps
import hiro
import mock
from flask import Blueprint, request, current_app, Flask, g
from werkzeug.exceptions import BadRequest
from flask_limiter import Limiter
from flask_limiter.util import get_ipaddr, get_rem... | |
<filename>boco_survey/survey_analyses.py
from collections import defaultdict, Counter
from typing import Dict, Tuple, List
import pandas as pd
import numpy as np
import scipy.stats
from statsmodels.stats.inter_rater import fleiss_kappa
def fleiss_kappa_self(M):
"""Computes Fleiss' kappa for group of annotators.
:p... | |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: io_ops.cc
"""
import collections
from tensorflow.python import pywrap_tfe as pywrap_tfe
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from tenso... | |
<reponame>blacksurgeon/edr<filename>edr/edvehicles.py
import re
import os
import json
from collections import deque
from edtime import EDTime
import edrconfig
import edrhitppoints
import edmodule
import edmodulesinforeader
import edcargoreader
import edrlog
import edcargo
import utils2to3
EDRLOG = edrlog.EDRLog()
cla... | |
#!/usr/bin/python3
__version__ = '0.0.24' # Time-stamp: <2021-10-16T01:27:09Z>
## Language: Japanese/UTF-8
"""結婚・不倫・扶養・相続などのマッチングのシミュレーション"""
##
## License:
##
## Public Domain
## (Since this small code is close to be mathematically trivial.)
##
## Author:
##
## JRF
## http://jrf.cocolog-nifty.com/soft... | |
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
crnt_exps = exps_df[fields]
crnt_exps = crnt_exps.merge(gene_fit_d['q'][["name","u","short","maxFit","gMean"]])
new_high = high_df.merge(crnt_exps, left_on="expName", right_on="name")
check_bool = [bool(new_high['gMean'].iloc[ix] >= min_gMean and \
new_high['fit'].iloc[ix] >= new_high['maxFit'].iloc[ix] - max_below... | |
style path string into seq of commands.
"""
result = dll.pixie_parse_path(path.encode("utf8"))
if check_error():
raise PixieError(take_error())
return result
def miter_limit_to_angle(limit):
"""
Converts miter-limit-ratio to miter-limit-angle.
"""
result = dll.pixie_miter_limit_to_angle(limit)
return result
... | |
import os
import sys
import time
from PIL import Image
import SBOL_File as sbol
import Logical_Representation as logic
import SBOL_visual as visual
from PyQt5 import QtCore, QtGui, uic, QtWidgets
from PyQt5.QtCore import pyqtSlot, QCoreApplication, QBasicTimer, QThread, pyqtSignal
from PyQt5.QtWidgets import QApplicati... | |
non-random) and random documents do not overlap.
* The range is doubled so that it's possible vary elements in a new
array.
* The left side of range is randomly shifted.
Here is an example of a new random array for seq_id=7, total 100
documents and 10 elements in array:
1) offset is set to 1000.
2) offset is in... | |
Modules for Ray Based Renderer ##################################################
####################################################################################################################################
class RaySampler(nn.Module):
def __init__(self, num_azi, num_polar, interval_polar = 5, mode = 'reflect'... | |
<filename>pyjswidgets/pyjslib.PyJS.py
# Copyright 2006 <NAME> and contributors
#
# 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 requir... | |
= v.replace('_' + vars[n]['kindselector']['kind'], '')
# Again, this will be true if even a single specifier
# has been replaced, see comment above.
is_replaced = len(v) < orig_v_len
if not is_replaced:
if not selected_kind_re.match(v):
v_ = v.split('_')
# In case there are additive parameters
if len(v_) > 1:... | |
flux_lm of fluxed_qubit
nested_mc = q0.instr_nested_MC.get_instr() # device object has no nested MC object, get from qubit object
mc = self.instr_MC.get_instr()
conv_cost_det = det.Function_Detector( get_function=czcf.conventional_CZ_cost_func,
msmt_kw={'device': self, 'FL_LutMan_QR': flux_lm,
'MC': mc,'waveform_... | |
<gh_stars>1-10
import sys
import time
import logging
import binascii
import functools
import idaapi
import idautils
from .api import DisassemblerAPI, DockableShim
from ..qt import *
from ..misc import is_mainthread
logger = logging.getLogger("Lighthouse.API.IDA")
#---------------------------------------------------... | |
= [incidents_widget,
map_widget,
assessments_widget,
activities_widget,
reports_widget,
#comments_widget,
])
# Include a Location inline
location_field = s3db.event_event_location.location_id
# Don't label a single field InlineComponent
location_field.label = ""
represent = S3Represent(lookup="gis_location"... | |
= shared_zone_test_context.shared_zone_vinyldns_client
ok_client = shared_zone_test_context.ok_vinyldns_client
shared_zone = shared_zone_test_context.shared_zone
shared_group = shared_zone_test_context.shared_record_group
shared_zone_name = shared_zone_test_context.shared_zone["name"]
shared_delete_name = generat... | |
assigned managed identity to use when accessing a resource.
:param str user_assigned_identity: The user assigned managed identity's resource identifier to use when accessing a resource.
"""
pulumi.set(__self__, "user_assigned_identity", user_assigned_identity)
@property
@pulumi.getter(name="userAssignedIdentity")... | |
"""
Description :
Generates the train/test/validation data for slot action and slot value prediction model.
Run Command:
python create_slot_data.py -path=<path of input data> -out=<output directory>
"""
#--------------------------------------------
import os
import json
import argparse
import spacy
import pandas as pd... | |
<gh_stars>10-100
# 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 require... | |
0 , 120 , (3, 0, None, None) , 0 , )),
(( 'Copy' , 'ImageFrom' , ), 20, (20, (), [ (9, 0, None, "IID('{F2BCF189-0B27-11D4-B5F5-9CC767000000}')") , ], 1 , 1 , 4 , 0 , 124 , (3, 0, None, None) , 0 , )),
(( 'IsModified' , 'pVal' , ), 21, (21, (), [ (16387, 10, None, None) , ], 1 , 2 , 4 , 0 , 128 , (3, 0, None, None) , ... | |
height, width = matrix.shape[-3:]
row_extent = height - kernel_shape[0] + 1
col_extent = width - kernel_shape[1] + 1
# starting block indices
start_idx = opr.arange(kernel_shape[0])[:, None] * height + np.arange(kernel_shape[1])
start_idx = start_idx.flatten()[None, :]
offset_filter = np.arange(
0, filters * he... | |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-03-12 15:57
from __future__ import unicode_literals
import core.model_fields
import core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '002... | |
= bn3b2_branch2b
res3b2_branch2b_relu = mx.symbol.Activation(name='res3b2_branch2b_relu', data=scale3b2_branch2b , act_type='relu')
res3b2_branch2c = mx.symbol.Convolution(name='res3b2_branch2c', data=res3b2_branch2b_relu , num_filter=512, pad=(0,0), kernel=(1,1), stride=(1,1), no_bias=True)
bn3b2_branch2c = mx.symb... | |
"""Outbound transport manager."""
import asyncio
import json
import logging
import time
from typing import Callable, Type, Union
from urllib.parse import urlparse
from ...connections.models.connection_target import ConnectionTarget
from ...config.injection_context import InjectionContext
from ...core.profile import ... | |
#!/usr/bin/env python3
import configparser
from opcua import Client
from opcua import ua
import paho.mqtt.client as mqtt
import json
import logging
import sys
import time
from pysnmp.hlapi import *
import shelve
## TODO: Add Sphinx
## TODO: Add secure login methods
# TEST TRAVIS
# Handler class for OPC/UA events
class... | |
import secrets
from typing import List
from asyncio import create_task
import re
from discord.ext.commands import Cog, Context
import discord
from lib.status_codes import StatusCodes as sc
from lib.pool_types import PoolType
from lib.config import logger, FAKE_GUILD_IDS
from src.auto_response import GuildAutoResponse... | |
<filename>src/CACSLabeler/CACSLabelerModule/CACSLabelerModule.py
from __main__ import vtk, qt, ctk, slicer
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from slicer.ScriptedLoadableModule import ScriptedLoadableModule
import unittest
import os, sys
import SimpleITK as sitk
import sitkUt... | |
backwards compatibility. It is discouraged to use '
'this parameter unless you know what you are doing',
vals=validators.Anything())
self.add_parameter(
'cases',
set_cmd=self._set_cases,
get_cmd=self._get_cases,
docstring='Configures which combination of readout waveforms to actually '
'download to the instrum... | |
from enum import Enum
import cv2 as cv
import numpy as np
import pyautogui
pyautogui.FAILSAFE = False
pyautogui.PAUSE = 0
mouse_now = pyautogui.position()
SCREEN_SIZE = pyautogui.size()
CURSOR_SPEED_MULTIPLIER = 2
# MAX_DELTA = 20
MIN_DELTA_X = 1
MIN_DELTA_Y = 2
CURSOR_POOL = 5
KEY_WAIT_DURATION = 1
CALIBRATION_D... | |
# This file is part of the pyMOR project (https://www.pymor.org).
# Copyright 2013-2021 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from pymor.core.cache import CacheableObject
from pymor.operators.constructi... | |
##############################################################################
##
# This file is part of Sardana
##
# http://www.tango-controls.org/static/sardana/latest/doc/html/axisex.html
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or mod... | |
<reponame>MorganShorter/drop
# Copyright (c) 2020, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# thi... | |
<gh_stars>10-100
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, <NAME> <<EMAIL>>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_vers... | |
_ctx._thread_local_data
if tld.is_eager:
try:
_result = pywrap_tfe.TFE_Py_FastPathExecute(
_ctx._context_handle, tld.device_name,
"RetrieveTPUEmbeddingAdagradParametersGradAccumDebug", name,
tld.op_callbacks, "table_id", table_id, "table_name", table_name,
"num_shards", num_shards, "shard_id", shard_id, "config"... | |
#!/usr/bin/python
"""
Python class that handles projection calculations, operations and augmentation special effects.
"""
import cv2
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.patches import Polygon
class ProjectionManager:
# Initialize projectionManager
def __init__(self, camCal, keep... | |
<reponame>cgmeyer/gen3sdk-python
import requests, json, fnmatch, os, os.path, sys, subprocess, glob, ntpath, copy, re, operator, statistics, datetime
import pandas as pd
from os import path
from pandas.io.json import json_normalize
from collections import Counter
from statistics import mean
from io import StringIO
from... | |
"""
x----------------------------------------------x
| AFSKmodem - Simple, reliable digital radio. |
| https://jmeifert.github.io/afskmodem |
x----------------------------------------------x
"""
import wave
import struct
import pyaudio
from datetime import datetime
import os
from time import sleep
####################... | |
low to high.
Returns
-------
[quo, rem] : ndarrays
Of coefficient series representing the quotient and remainder.
See Also
--------
polyadd, polysub, polymul, polypow
Examples
--------
>>> from numpy.polynomial import polynomial as P
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> P.polydiv(c1,c2)
(array([ 3.]),... | |
<reponame>mthjwu/ask
################################################################################
# circular binary segmentation implementation
# (ugly max t-statistic searching method,
# might only work for high focal amplification)
# currently input should be absolute copy number
# todo:
# include 1 bin spikes
##... | |
<filename>airport/kube/api.py
from datetime import datetime
from decimal import Decimal
from enum import Enum
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
try:
from yaml import CLoader as YamlLoader
except ImportError:
fro... | |
+ ', '.join([m.get(k, None) for k in self.add_keys])
self.update_statusbar(msg, success=True)
class AddEmail(AddRow):
def __init__(self, parent=None):
super().__init__(parent=parent, window_title='Add Email')
IPF = InputField
self.add_input(field=IPF(text='MineSite', default=gbl.get_minesite()), items=cf.config... | |
#!/usr/bin/python
"""Given a regtest result tree, prints an HTML summary to a file.
See HTML skeleton in tests/regtest.html.
"""
import os
import re
import sys
import numpy as np
import matplotlib.pyplot as plt
SUMMARY_ROW = """\
<tfoot style="font-weight: bold; text-align: right">
<tr>
<td>
%(name)s
</td>
<!--... | |
1 400 401
1 400 2 1 399 401
1 401 0 0
1 402 2 1 403 404
1 403 2 1 402 404
1 404 0 0
1 405 2 1 406 407
1 406 2 1 405 407
1 407 0 0
1 408 2 1 409 410
1 409 2 1 408 410
1 410 0 0
1 411 2 1 412 413
1 412 2 1 411 413
1 413 0 0
1 414 2 1 415 416
1 415 2 1 414 416
1 416 0 0
1 417 2 1 418 419
1 418 2 1 417 419
1 419 0 0
1 420 ... | |
bin)
# exact matches match the first bin
# suffix matches match an arbitrary bin (which is ok, because
# the suffix lists should be disjoint)
if self.needs_domain_exact_match and domain_exact_match_bin is not None:
domain_suffix_match_bin = domain_exact_match_bin
else:
# check for a suffix match
# this is O(N),... | |
= None, on = None, left_on = None, right_on = None, batch_func = None, columns = None, suffix="_right"):
# how many things you might checkpoint, the number of keys in the dict
self.num_states = 2
self.trade = {}
self.quote = {}
self.ckpt_start0 = 0
self.ckpt_start1 = 0
self.columns = columns
self.suffix = suf... | |
from numpy import arctan, zeros, pi, real as re, imag as im, linspace,eye, prod, newaxis
from numpy import array as arr, exp, log, arange, diag, kron, savetxt, cumsum, argmax
from numpy.linalg import det, norm, solve
from scipy.optimize import fsolve
import matplotlib.pyplot as plt
from copy import deepcopy
from ... | |
{}),
("__subclasscheck__", do_issubclass, return_true,
set(("__bases__",)), {}),
("__enter__", run_context, iden, set(), {"__exit__" : swallow}),
("__exit__", run_context, swallow, set(), {"__enter__" : iden}),
("__complex__", complex, complex_num, set(), {}),
("__format__", format, format_impl, set(), {}),
("__... | |
username, bookname):
return folders(request, username, bookname, '')
#TODO: get the snippets' folder?
@login_required
def folders(request, username, bookname, folder_name):
#TODO: don't query the notes if no folder name. Also get rid of using /notes/folders// in url and use /notes/folders/
F = getFolder(username,... | |
the default in Chimera (Petterson et al, 2004);
0.425R the fullwidth half maximum being equal to the resolution, as used by FlexEM (Topf et al, 2008);
0.5R the distance between the two inflection points being the same length as the resolution, an option in Chimera (Petterson et al, 2004);
1R where the sigma va... | |
to plotting units.
:param field_name: Name of radar field (must be accepted by
`radar_utils.check_field_name`).
:return: new_field_name: Same as input, except in plotting units.
"""
radar_utils.check_field_name(field_name)
if field_name in radar_utils.ECHO_TOP_NAMES:
return field_name.replace('_km', '_kft')
... | |
None
return find(self)
def gen_description_doc(self, out):
ds = self.find_aspects('description')
if not ds:
out.gen_text('<NO DESCRIPTION OF %r>' % self.tgtfullname)
else:
for d in ds:
d.gen_doc(out)
def get_id_name(self):
return self.tgtfullname
def get_link_name(self):
return self.tgtfullname
def get... | |
import math
import time
import requests
import pandas as pd
import dask.delayed
from time import sleep
from dask import compute
from bs4 import BeautifulSoup
from datetime import date, datetime
def get_page(url):
"""
returns a soup object that contains all the information of a given webpage
"""
tos = str(datetime... | |
str(num_in_cat), "MCFLIRT_absolute_displacement_maximum_"+file, "mm", "float", "MCFLIRT absolute displacement maximum for "+file, str(abs_displacement_max))
num_in_cat+=1
write_to_IDP_file(subj, "MCFLIRT_abs_disp_median_"+file, "tvb_IDP_MCFLIRT_disp", str(num_in_cat), "MCFLIRT_absolute_displacement_median_"+file, "mm... | |
symbolizer_path = os.path.abspath(os.path.join('src', 'third_party',
'llvm-build', 'Release+Asserts', 'bin', 'llvm-symbolizer'))
disable_sandbox_flag = '--no-sandbox'
if args and 'layout_test_wrapper' in args[0]:
disable_sandbox_flag = '--additional-drt-flag=%s' % disable_sandbox_flag
# Symbolization of sanitizer... | |
<gh_stars>1-10
#!/usr/bin/env python3
"""Tests the stats.py package."""
import unittest
from linkograph import stats # The package under test.
from linkograph import linkoCreate # For creating linkographs.
import math # For the log function.
from collections import Counter # For Counter data structures.
class Test_... | |
sc_idx == 0
block_idx = 0 if sc_idx == 0 else np.max(np.where(np.array([b[0] for b in cv.blocks]) < sc_idx)[0])
block = cv.blocks[block_idx][1]
cv.pos = int(block[0]) + 1 if sc_left else int(block[1])
rcigar = read.cigar[::-1] if cv.cstrand == '-' else read.cigar
idx = len(rcigar) - sc_idx - 1 if cv.cstrand == '... | |
= 0
self.yDataAvailable = 0
self.zDataAvailable = 0
self.zyxDataAvailable = 0
self.xDataOverrun = 0
self.yDataOverrun = 0
self.zDataOverrun = 0
self.zyxDataOverrun = 0
def read(self):
self._manager.read(self)
return self
def getValue(self):
return ((self.xDataAvailable & 0x1) << 0) | ((self.yDataAvailab... | |
in executing the test command encountered" + result + ": FAILED", tid)
else:
log_red(
'Verify that "/" is Read Only type file structure: FAILED', tid)
stdin, stdout, stderr = ssh.exec_command('rm /test')
# Testing "/proprietary"
# if "/dev/mapper/proprietary on /proprietary type ext4 (ro,noatime,data=ordered)" ... | |
#!/usr/bin/env python
__Author__ = "<NAME>"
# ROS import
import rospy
import rospkg
from geometry_msgs.msg import Twist, Vector3Stamped, Pose, PoseWithCovarianceStamped
from sensor_msgs.msg import Imu
#from cv_bridge import CvBridge, CvBridgeError
from std_msgs.msg import Empty
# Required Libraries
import time, csv
i... | |
<reponame>flexera-public/sca-codeinsight-reports-spdx
'''
Copyright 2021 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Tue Apr 27 2021
File : SPDX_license_mappings.py
'''
LICENSEMAPPINGS = {}
# Manual Mappings
LICENSEMAPPINGS["GPL-1.0"]="GPL-1.0-... | |
sample weights
fit_params = fit_params if fit_params is not None else {}
fit_params = dict([(k, _index_param_value(X, v, train))
for k, v in fit_params.items()])
if parameters is not None:
estimator.set_params(**parameters)
start_time = time.time()
X_train, y_train = _safe_split(estimator, X, y, train)
X_tes... | |
<reponame>pyGSTi-Developers/pyGSTi<gh_stars>0
"""
Classes for constructing confidence regions
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract ... | |
<filename>main.py
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | |
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
the library doesn't exist,
the corresponding tuple element will be None. For example, this
dictionary signifies that 'requirements.txt' requires flask with
version 1.0.1 while the 'third_party/python_libs' directory contains
flask 1.1.1:
{
flask: ('1.0.1', '1.1.1')
}
"""
# Handling 5 or more mismatches require... | |
<filename>OltreBot/cogs/music/music.py
import re
import discord
import lavalink
from typing import Union, Dict
from discord.ext import commands
from discord.ext.commands import Cog, Context
from OltreBot.util import get_logger
from OltreBot.util.colors import *
from .lavalink_voice_client import LavalinkVoiceClient
fro... | |
| up]): Current state of protocol session: Not Started - session negotiation not started, the session is not active yet. Down - actively trying to bring up a protocol session, but negotiation is didn't successfully complete (yet). Up - session came up successfully.
"""
return self._get_attribute(self._SDM_ATT_MAP['Se... | |
<gh_stars>0
#!/usr/bin/env python
# KMB 11/06/2008
import distutils
from distutils import util as distutils_util
import os # use os for manipulating path names
import platform
import sys # use sys for parsing command line
import time # use time for setting playback rate
import warnings
import wx
from wx import xrc
im... | |
import json
import logging
import os
import pathlib
import shutil
import traceback
from datetime import datetime, timedelta, timezone
from statistics import mean
import dateutil.parser
import humanize
import pandas as pd
import pytz
from django.conf import settings
from common.notify import Notify
from des.dao import... | |
<filename>object/N2DCEX_target.py<gh_stars>10-100
import argparse
import os, sys
import os.path as osp
import torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import network, loss
from torch.utils.data import DataLoader
from data... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "<NAME> <<EMAIL>>"
import sys
import random
import math as np
import pygame
class PolyObstacle:
"""
Object that represents the an obstacle represented
by a series of points (in the node list) which make up a
set of lines. These lines represent the exter... | |
self.t)
X0 += 0.00000000007 * math.cos(1.59729628741 + 29396.6128544381 * self.t)
X0 += 0.00000000007 * math.cos(4.06632874380 + 22779.6810636773 * self.t)
X0 += 0.00000000009 * math.cos(3.00366222190 + 64741.71416564769 * self.t)
X0 += 0.00000000007 * math.cos(5.95614295602 + 26290.4003542318 * self.t)
X0 += 0.00... | |
<filename>safetypy/safetypy.py
# coding=utf-8
# Author: SafetyCulture
# Copyright: © SafetyCulture 2016
# pylint: disable=E1101
import collections
import json
import logging
import os
import re
import sys
import time
import errno
from builtins import input
from datetime import datetime
import requests
from getpass imp... | |
import os
import csv
import math
import dnaio
import parasail
import editdistance
import re
import logging
import datetime
from .processor import FASTQProcessor, FASTQWorker
from ..fastq_pair import ReadPair
from ..fastq_file import IlluminaFASTQ, BarcodeStatistics
logger = logging.getLogger(__name__)
class Demultipl... | |
<gh_stars>1-10
import pygame
import random
from game.tools.asset_cache import getImage
import game.tools.constants as c
class Level:
"""Create a new level object.
This class should not be called directly. Only call its subclasses.
Attributes:
rubberTilesHorizontal: A list of tuples indicating which columns and... | |
import discord
from discord.ext import commands
import asyncio
import aiohttp
import random
from datetime import datetime, timedelta
import math
import json
# #####################################################################################
# math parser used by $calc
class MathParser:
def __init__(s... | |
specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.
:param str name:... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data
# (c) 07/2017-06/2019 : CNRS UMR 7344 IM2NP
# (c) 07/2019-present : DESY PHOTON SCIENCE
# authors:
# <NAME>, <EMAIL>
try:
import hdf5plugin # for P10, should be imported before h5py or ... | |
if self.showDrop: desc.height = self.height - img.height - dropButton.height - 30
elif self.showBuy: desc.height = self.height - img.height - buyButton.height - 30
elif self.showSell: desc.height = self.height - img.height - sellButton.height - 30
else: desc.height = self.height - img.height - 30
desc.text = self.... | |
#! /usr/bin/env python3
"""
pratt_tdop_parser.py: Parse shell-like and C-like arithmetic.
"""
import sys
import lexer
from lexer import Token
from tree import Node, CompositeNode
#
# Default parsing functions give errors
#
class ParseError(RuntimeError):
pass
def NullError(p, token, rbp):
raise ParseError("%s can... | |
<gh_stars>1-10
import pygame
from word import Word
from hangman import Hangman
from config import *
from button import Button
from bar import Bar
class Game:
def __init__(self):
#Current displaying window booleans
self.menu = True
self.settings = False
self.playing = False
self.help = False
self.pre_play = Fal... | |
# Copyright 2015-2018 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | |
Attribute(
"Use scope as template / content data?",
type="boolean",
required=False,
default=True,
)
def extend_context(self, context):
"""Hook to extend the context."""
@wrap_element_error
def run(self, context):
(content, templates, requires, withscope) = self.get_parameters(
context, "content", "template... | |
fecbgd fgdeac acebgfd gbe bagc afecg fbead begfa | agcbdfe bg fegba badegfc",
"eadbgc edfba bfecdg acfb egfad ba bea dfceb dcaebf beagdcf | ab eafbd abe adcfgbe",
"fbega afdce gd agcebf becgad bgdeaf fbgd gde ebgfdca efgad | cegdab cefbga fbgd geadf",
"cag agfce gfacde gbcdaf ag gead fbgec cdefa bdafcge bdefac | cfead ... | |
break
for line in out.split('\n'):
if line:
words = line.split()
if words[0] == 'mtu':
current_if['mtu'] = words[1]
return interfaces, ips
# AIX 'ifconfig -a' does not inform about MTU, so remove current_if['mtu'] here
def parse_interface_line(self, words):
device = words[0][0:-1]
current_if = {'device': dev... | |
#!/usr/bin/python3
from pkg_resources import parse_version
import json
import sys
import importlib
import traceback
import configparser
import os
import os.path
from websocket import create_connection
from queue import Queue
from sseclient import SSEClient
import appdaemon.conf as conf
import time
import datetime
impor... | |
<gh_stars>0
from ._glib import *
# gobject - C library
libgobject = CDLL(find_library('gobject-2.0'))
#
# GType
#
class GType(gsize): pass
class GTypeInterface(Structure):
_fields_ = [
('g_type', GType),
('g_instance_type', GType),
]
class GTypeClass(Structure):
_fields_ = [
('g_type', GType),
]
class G... | |
# File: office365_connector.py
#
# Copyright (c) 2017-2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
<filename>dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/tests/test_looplifting.py<gh_stars>1000+
from __future__ import print_function, division, absolute_import
import numpy as np
from numba import types, utils
from numba import unittest_support as unittest
from numba.compiler import compile_isolated, Flag... | |
= []
except (InvalidRSEExpression, RSEWriteBlocked) as error:
rule.state = RuleState.STUCK
rule.error = (str(error)[:245] + '...') if len(str(error)) > 245 else str(error)
rule.save(session=session)
# Insert rule history
insert_rule_history(rule=rule, recent=True, longterm=False, session=session)
# Try to update... | |
bytes_reserved=None,
*, appearance_text_params=None,
in_place=False, output=None,
chunk_size=misc.DEFAULT_CHUNK_SIZE)\
-> Tuple[PreparedByteRangeDigest, 'PdfTBSDocument', IO]:
"""
.. deprecated:: 0.9.0
Use :meth:`async_digest_doc_for_signing` instead.
Set up all stages of the signing process up to and includin... | |
<reponame>chigur/pose<gh_stars>0
import os
import re
import sys
import cv2
import math
import time
import scipy
import argparse
import matplotlib
from torch import np
import pylab as plt
from joblib import Parallel, delayed
import util
import torch
import torch as T
import torch.nn as nn
import torch.nn.functional as F... | |
ConfigMapNamespace: ConfigMap命名空间
:type ConfigMapNamespace: str
"""
self.EdgeUnitID = None
self.ConfigMapName = None
self.ConfigMapNamespace = None
def _deserialize(self, params):
self.EdgeUnitID = params.get("EdgeUnitID")
self.ConfigMapName = params.get("ConfigMapName")
self.ConfigMapNamespace = params.get(... | |
from contextlib import contextmanager
import os
from pathlib import Path
import pytest
import trio
from pons import (
abi,
ABIDecodingError,
Address,
Amount,
ContractABI,
DeployedContract,
ReadMethod,
TxHash,
BlockHash,
Block,
Either,
ContractPanic,
ContractLegacyError,
ContractError,
)
from pons._abi_t... | |
face
v_uvz[..., 0] = (v_uvz[..., 0] * 0.5 + 0.5) * depth.shape[2] # [1, num_vertex]
v_uvz[..., 1] = (1 - (v_uvz[..., 1] * 0.5 + 0.5)) * depth.shape[1] # [1, num_vertex]
v_depth = misc.interpolate_bilinear(depth[0, :, :, None], v_uvz[..., 0], v_uvz[..., 1]) # [1, num_vertex, 1]
v_front_mask = ((v_uvz[0, :, 2] - v_de... | |
"""Core implementation of import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing ver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.