input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import os
from collections import OrderedDict
import numpy as np
from pathlib import Path
from qtpy import compat
from qtpy.QtCore import Signal
from qtpy.QtWidgets import QWidget, QLineEdit, QMessageBox, QPlainTextEdit, QPushButton
from qtpy.uic import loadUi
from glue.core import message as msg
from glue.core impor... | |
})
data["groups"] = list()
for group in self.groups:
data["groups"].append({
"id": group.id,
})
return data
@staticmethod
def request_persona(persona_id):
"""Return a Persona profile, loading it from Glia if neccessary
Args:
persona_id (String): ID of the required Persona
Returns:
Persona: If a record... | |
import sys
import pefile
from collections import OrderedDict
class dotNet_Header:
def __init__(self, full_bytes, p_cli_metadata_header, p_diff_va_rva, p_rebased_offset):
self.pe_content = full_bytes
self.RESOURCE_MAGIC_NUMBER = 0xBEEFCACE
self.set_dotNet_directory(p_rebased_offset)
self.set_meta_header(p_cli_met... | |
<filename>nova/auth/ldapdriver.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not us... | |
#!/opt/libreoffice5.4/program/python
# -*- coding: utf-8 -*-
# 一覧シートについて。import pydevd; pydevd.settrace(stdoutToServer=True, stderrToServer=True)
import os, unohelper, glob
from itertools import chain
from indoc import commons
from com.sun.star.awt import MouseButton, MessageBoxButtons, MessageBoxResults # 定数
from com.... | |
:param list posteriors: list of numpy.ndarray with shape (y_bins, x_bins)
:param spatial_window: :py:attr:`SpatialRatemap.spatial_window`
:param matplotlib.axes._subplots.AxesSubplot ax: if provided, `ax.imshow` is used instead.
:param tuple color_start: (R, G, B) mapping of first array in `posteriors`
:param tuple... | |
""" eletronic structure routines modules
"""
import sys
import importlib
import autofile
import automol
import elstruct
from mechanalyzer.inf import thy as tinfo
from mechanalyzer.inf import rxn as rinfo
from mechanalyzer.inf import spc as sinfo
from mechroutines.es._ts import findts
from mechroutines.es._routines imp... | |
pick a
# good value that won't have false positives under load - see IMPALA-8222.
timeout = maxint
report = query_runner.run_query(query, mem_limit, timeout_secs=timeout,
should_cancel=should_cancel)
LOG.debug("Got execution report for query")
if report.timed_out and should_cancel:
report.was_cancelled = True
q... | |
"""
STARBURST ACC/FEANTA GeoBrick Worker
Author: <NAME>
Email: <EMAIL>
"""
import i_worker
import socket
import struct
# Description of the GeoBrick device. Currently hard-coded.
BRICK_HOSTNAME = 'geobrickanta.solar.pvt'
BRICK_PORT = 1025
BRICK_TIMEOUT = 0.5
# Program spaces that can be used in the GeoBrick.
COMM... | |
from core.util_classes import robot_predicates
from sco_py.expr import Expr, AffExpr, EqExpr, LEqExpr
from core.util_classes.pr2_sampling import (
ee_reachable_resample,
resample_bp_around_target,
)
import core.util_classes.pr2_constants as const
from collections import OrderedDict
from openravepy import DOFAffine
im... | |
for: ipam_trap_settings
use_lease_scavenge_time: Use flag for: lease_scavenge_time
use_logic_filter_rules: Use flag for: logic_filter_rules
use_mgm_private: Use flag for: mgm_private
use_nextserver: Use flag for: nextserver
use_options: Use flag for: options
use_pxe_lease_time: Use flag for: pxe_lease_time
use_r... | |
False
dirname: bool = False
strip: bool = False
edited_version: bool = False
export_dir: Optional[str] = None
dest_path: Optional[str] = None
filepath: Optional[str] = None
quote: bool = False
exportdb: Optional[ExportDB_ABC] = None
class PhotoTemplateParser:
"""Parser for PhotoTemplate"""
# implemented as... | |
import numpy as np
import matplotlib.pyplot as plt
import pickle
from pathlib import Path
import torch
from google.protobuf import text_format
from second.utils import simplevis
from second.pytorch.train import build_network
from second.protos import pipeline_pb2
from second.utils import config_tool
import time
import ... | |
EdgeBtwH: TIntPrFltH &
NodeFrac: double const &
GetBetweennessCentr(PUNGraph const & Graph, TIntPrFltH & EdgeBtwH)
Parameters:
Graph: PUNGraph const &
EdgeBtwH: TIntPrFltH &
GetBetweennessCentr(PUNGraph const & Graph, TIntFltH & NIdBtwH, TIntPrFltH & EdgeBtwH, double const & NodeFrac=1.0)
Parameters:
Graph:... | |
(node.upper is not None):
high = self.visit(node.upper)
else:
high = None
if (node.step is not None):
step = self.visit(node.step)
else:
step = None
return Slice(low, high, step, None)
def visit_Expr(self, node):
return self.visit(node.value)
def python_type_to_lp_type(p_type, const=False):
if (p_type is ... | |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# import tensorflow as tf
import numpy as np
import pickle
from reco_utils.recommender.deeprec.io.iterator import BaseIterator
from reco_utils.recommender.newsrec.newsrec_utils import word_tokenize, newsample
__all__ = ["MI... | |
= "isDefault"
LINKS = "links"
PAGES_URL = "pagesUrl"
PAGES = "pages"
PARENT_NOTEBOOK = "parentNotebook"
PARENT_SECTION_GROUP = "parentSectionGroup"
class Enum897(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
ASTERISK = "*"
PAGES = "pages"
PARENT_NOTEBOOK = "parentNotebook"
PARENT_SECTION_GROUP = "par... | |
<filename>training_structures/gradient_blend.py
import sklearn.metrics
import torch
from torch import nn
import copy
from torch.utils.data import DataLoader, Subset
from eval_scripts.performance import AUPRC, f1_score, accuracy
from eval_scripts.complexity import all_in_one_train, all_in_one_test
from eval_scripts.robu... | |
"""
Copyright 2003 Mitsubishi Electric Research Laboratories All Rights
Reserved. Permission to use, copy and modify this software and its
documentation without fee for educational, research and non-profit
purposes, is hereby granted, provided that the above copyright
notice and the following three paragraphs app... | |
i in mod_roles])}"
)
return await ctx.send(f"No managers set. `Manage Message` permissions {statement}")
return await ctx.send(
"The following roles can manage giveaways:\n"
+ "\n".join(f"<@&{i}>" for i in settings.manager)
+ "\n"
+ "\n".join(i.mention for i in mod_roles)
)
@gset_manager.command(name="add")
... | |
"""
Utility functions to generate and modify certain classes of networkx Graphs and
DiGraphs.
random_dag-- Generate a random DAG with specified number of nodes and edges.
poisson_ditree-- Generate directed rooted tree with Poissonian offspring.
directify-- Turn tree into directed rooted tree relative to specified root... | |
for a radiobutton
one;
:param `checked`: ``True`` if the control is marked, ``False`` if it is not;
:param `enabled`: ``True`` if the control is enabled, ``False`` if it is not;
:param `x`: the width of the bitmap, in pixels;
:param `y`: the height of the bitmap, in pixels.
"""
bmp = wx.EmptyBitmap(x, y)
mdc ... | |
self.__data_set_id = value
@property
def field(self) -> str:
"""The field for data set, e.g. rate"""
return self.__field
@field.setter
def field(self, value: str):
self._property_changed('field')
self.__field = value
@property
def results_field(self) -> str:
"""The source field in the results, e.g. valu... | |
'PE_results_path': PE_results_path, 'behavExp': PE_result.reservation_for_pe_result.experiment.uuid})
@user_passes_test(lambda u: u.is_superuser)
@login_required
def errors_review(request):
if request.method == 'POST':
uuid = request.POST.get("uuid", "")
print 'uuid'
status = request.POST.get("status", "")
error_... | |
<gh_stars>0
"""
Visual computational geometry and viewpoint path constrained optimization.
<NAME>, <NAME>, <NAME>
University of Nevada Reno
CS791 Special Topics (Robotics)
Instructor: <NAME>
Fall 2020
"""
# Imports
from os.path import exists
import os
import numpy as np
from scipy.spatial.transform.rotation import Rot... | |
validation dataset.
n_valid : int
Number of validation points to sample.
use_descriptor : list
List containing the name of the descriptor to use.
sig : int
Hyper-parameter (kernel length scale).
lam : float, optional
Hyper-parameter lambda (regularization strength).
use_sym : bool, optional
True: include symm... | |
"""Parametrizing conditional raising.
Different options for test IDs:
Indirect parametrization: https://docs.pytest.org/en/latest/example/parametrize.html
Markers: https://docs.pytest.org/en/6.2.x/example/markers.html
writing hooks: https://docs.pytest.org/en/latest/how-to/writing_hook_functions.html
pytest hooks: wri... | |
<filename>steam_cli.py
#!/usr/bin/env python3
"""
Usage:
steam-cli login [options]
steam-cli install [options] (--id=<id>|--name=<name>)
steam-cli execute [options] (--id=<id>|--name=<name>)
steam-cli show [options] (--id=<id>|--name=<name>)
steam-cli list [options] [--installed] [--disk-usage]
steam-cli downloa... | |
from cassandra.cluster import Cluster
import numpy as np
import matplotlib.pyplot as plt
from pprint import pprint
from colorclass import Color, Windows
from terminaltables import SingleTable
import random
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
def sigmoid_derivative(x):
return sigmoid(x) * (1.0 - sigmoid(... | |
},
{
"created": "2020-03-23T17:06:40.286Z",
"authority_provided_id": "ae429ab421090994b6c261f422e905044c1d3984",
},
{
"created": "2020-03-23T17:24:15.892Z",
"authority_provided_id": "8ef7bff11133f9805cace3eae58a2ccf57c638e3",
},
{
"created": "2020-03-23T17:43:31.709Z",
"authority_provided_id": "d00b322b41d0e... | |
A is written in any basis for which the
first element is the normalized identity (e.g., the pp or gm
bases), The unital submatrix of A is the matrix obtained when the
top row and left hand column is removed from A.
Parameters
----------
A : array or gate
The gate for which the unitarity is to be computed.
mxB... | |
is this value')
parser.add_argument('--uniform_dep', type=float, default=0.0, metavar='', help='multiply act x by random uniform in [x/a, ax] range, where a is this value')
parser.add_argument('--normal_ind', type=float, default=0.0, metavar='', help='add random normal with 0 mean and variance = a to each act x where... | |
switch:
while switch:
p1 = switch[0][0]
p2 = switch[0][1]
self.switch(p1, p2)
teams["blue"].append(p1)
teams["red"].append(p2)
teams["blue"].remove(p2)
teams["red"].remove(p1)
switch = self.suggest_switch(teams, gt)
avg_red = self.team_average(teams["red"], gt)
avg_blue = self.team_average(teams["blue"], gt)... | |
import uuid
import importlib
from CCAPython.gov.cca import AbstractFramework
from CCAPython.gov.cca import Port
from CCAPython.gov.cca.ports import BuilderService
from CCAPython.gov.cca.ports import EventType
from CCAPython.framework.info.connectioninfo import ConnectionID
from CCAPython.framework.info.componentinfo i... | |
for range of thetaStart-thetaStop and phiStart-phiStop
Returning a numpy array of form - fields[phiDeg][thetaDeg] = eField
W......Width of patch (m)
L......Length of patch (m)
h......Substrate thickness (m)
Er.....Dielectric constant of substrate
"""
fields = np.ones((PhiStop, ThetaStop)) # Create initial array... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Image utility functions"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
from astropy.units import Quantity
from astropy.coordinates import Angle
from astropy.io import fits
from ast... | |
# Work isValidSolution() into stage 1 not stage 0... May not work because I need to know which blue_paths are a valid start -- which involves doing all the work anyways.
from collections import deque
from time import time
class Path():
def __init__(self, path):
if isinstance(path, list):
self.path = path
elif isi... | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright (c) 2019, Eurecat / UPF
# 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 sou... | |
write_eq(dPri_dT_prifac_sym, dPri_dT_prifac)
write_eq(dPri_dT_noprifac_sym, dPri_dT_noprifac)
write_eq(dPri_dnj_fac_sym, dPri_dnj_fac)
write_eq(dPri_de_prifac_sym, dPri_de_prifac)
write_eq(dPri_de_noprifac_sym, dPri_de_noprifac)
return dPri_dT, dPri_dT_prifac, dPri_dT_prifac_sym, dPri_dT_noprifac,\
dPri_dT_nopri... | |
<gh_stars>1-10
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 t... | |
<filename>src/datasets.py
import csv
import glob
import os
import random
from abc import ABC, abstractmethod
from typing import List, Callable, Union, Dict
import numpy as np
import pandas as pd
import torch
import tqdm
from PIL import Image
from torch.utils.data import Dataset, DataLoader
from torch.nn import functio... | |
<filename>src/linesieve/cli.py
import os.path
import re
import subprocess
from functools import wraps
import click
from click import echo
from click import style
import linesieve
from .parsing import make_pipeline
# references for common command-line option names:
# https://www.gnu.org/prep/standards/html_node/Opti... | |
file_list.extend(recurse_file_list(entry.path))
else:
# No files, so append dir to list
file_list.append(entry.path)
except NotADirectoryError:
return []
except PermissionError:
return []
except OSError:
return []
except TypeError:
return []
return file_list
# For each drive in file list buffer, recurse i... | |
""" CSeq C Sequentialization Framework
module stubs
written by <NAME>, University of Southampton.
CSeq's Translator modules are
built on top of pycparser, BSD licensed, by <NAME>,
pycparser embeds PLY, by <NAME>,
maintained by <NAME>, University of Southampton.
Naming conventions for introduced variables (use... | |
<reponame>82ndAirborneDiv/BMGAP
#! /bin/env python3
###
##by <NAME>
## April 24, 2015, script_version 0.3
SCRIPT_VERSION = 1
SCRIPT_SUBVERSION = 23
#pylint: disable=global-statement, broad-except
import re
import pandas as pd
from Bio import SeqIO, SeqRecord
import os
import sys
# import gzip
# import zlib
# impor... | |
from datetime import datetime
from typing import Tuple
import pytest
from cn2date import parse
now = datetime.now()
print("now", now)
now_year = now.year
now_month = now.month
now_day = now.day
date_testdata = [
# 完整的日期格式
("2017-7-23", (datetime(2017, 7, 23), datetime(2017, 7, 24))),
("2017/7/23", (datetime(201... | |
= FMT_VALTRAIN_MUL_STORE.format(prefix)
logger.info("Prepare image container: {}".format(fn))
with tb.open_file(fn, 'w') as f:
for image_id in tqdm.tqdm(df_train.index, total=len(df_train)):
im = get_resized_raster_8chan_image(
image_id, band_rgb_th, band_mul_th)
atom = tb.Atom.from_dtype(im.dtype)
filters = tb.... | |
#!/usr/bin/python3
from spotify import Spotify
#from youtube import Youtube
from editor import TagEditor
from lastfm import LastFM
<<<<<<< HEAD
from apple import AppleMusic
from deezer import Deezer
import sys, getopt, shutil
import os, re, random
import notify2
from pygame import mixer
=======
from deezer import Deeze... | |
<gh_stars>1-10
import numpy as np
import scipy.signal as signal
import logging
import os
from copy import deepcopy
import logging
log = logging.getLogger(__name__)
def import_iir(filename):
"""
imports csv files generated with Mathematica notebooks of the form
a1_0,b0_0,b1_0
a1_1,b0_1,b1_1
a1_2,b0_2,b1_2
.
.
.... | |
from doxpy.misc.doc_reader import DocParser
from doxpy.misc.adjacency_matrix import AdjacencyMatrix
from doxpy.misc.graph_builder import get_root_set, get_concept_set, get_predicate_set, get_object_set, get_connected_graph_list, get_ancestors, filter_graph_by_root_set, tuplefy, get_concept_description_dict, get_between... | |
entities[4].entity.type == 'option'
assert entities[4].span == Span(35, 39)
assert entities[4].parent == entities[2]
assert entities[4].children == (entities[3],)
assert entities[5].text == 'Philz'
assert entities[5].entity.type == 'store'
assert entities[5].span == Span(46, 50)
assert entities[5].child... | |
* m.x171 == 0)
m.e32 = Constraint(expr= m.x32 - 0.7 * m.x172 == 0)
m.e33 = Constraint(expr= m.x33 - 0.7 * m.x173 == 0)
m.e34 = Constraint(expr= m.x34 - 0.7 * m.x174 == 0)
m.e35 = Constraint(expr= m.x35 - 0.7 * m.x175 == 0)
m.e36 = Constraint(expr= m.x36 - 0.7 * m.x176 == 0)
m.e37 = Constraint(expr= m.x37 - 1.2 * m.x177... | |
import os, time, torch, sys, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
import numpy as np
import pandas as pd
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
from pathlib ... | |
<gh_stars>0
import time
import struct
import socket
import threading
import numpy as np
from .BCIDecoder import generate_simulation_data
from . import logger
simulationMode = True
maxLength = 3600 # Seconds
class SimulationDataGenerator(object):
''' Generate simulation data '''
def __init__(self)... | |
(also using 0x99 as
the first octet).
"""
if subject.is_primary:
_s = subject.subkeys[self.signer].hashdata
else:
_s = subject.hashdata
_data += b'\x99' + self.int_to_bytes(len(_s), 2) + _s
if self.type in {SignatureType.KeyRevocation, SignatureType.SubkeyRevocation, SignatureType.DirectlyOnKey}:
"""
The s... | |
import random
import bisect
import math
import partitioning as Part
import itertools
import csv
import time
import numpy as np
import test_set
import numpy.random as npr
from seidel_tree import Segment, Line, to_line
from collections import deque
from geometric import approx_eq
def horizontal_split_vertices(points, ... | |
# Easy to use metadata on Debian and Ubuntu releases.
#
# Author: <NAME> <<EMAIL>>
# Last Change: September 15, 2021
# URL: https://apt-mirror-updater.readthedocs.io
"""
Easy to use metadata on Debian and Ubuntu releases.
This module started out with the purpose of reliable `end of life`_ (EOL)
detection for Debian a... | |
def to_dict(self):
result = {'message_id': self.message_id} if self.message_id is not None else {}
result['channel_id'] = self.channel_id
if self.guild_id is not None:
result['guild_id'] = self.guild_id
return result
to_message_reference_dict = to_dict
def flatten_handlers(cls):
prefix = len('_handle_')
handl... | |
import random
import logging
import numpy as np
from typing import Union, List, Tuple, Generator
from .judger import compare_hands, compare_rankings, eval_hand
from .cards import Card, create_default_deck
from .enums import PokerMoves, PlayerState, HandRanking
class Game:
""" A Texas Hold'em game
Usage
-----
``... | |
2)}, boundary="reflect", dtype=x.dtype
)
def test_map_overlap():
x = da.arange(10, chunks=5)
y = x.map_overlap(lambda x: x + len(x), depth=2, dtype=x.dtype)
assert_eq(y, np.arange(10) + 5 + 2 + 2)
x = da.arange(10, chunks=5)
y = x.map_overlap(lambda x: x + len(x), depth=np.int64(2), dtype=x.dtype)
assert all(... | |
<filename>src/sentry/web/frontend/accounts.py
"""
sentry.web.frontend.accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from functools import partial, updat... | |
<reponame>thedevlayer/panabara
import pandas as pd
from django.apps import AppConfig
import FinanceDataReader as fdr
import pyupbit as pu
import datetime
import os
import json
import urllib.request
# def get_kor_stock_all_list(request):
# dfstockcode = pd.read_html('http://kind.krx.co.kr/corpgeneral/corpList.do?meth... | |
import torch
from hypergrad.utils import custom_grad as torch_grad
from torch import Tensor
from hypergrad import CG_torch
from typing import List, Callable
from hypergrad.utils import custom_grad
# noinspection PyUnusedLocal
def reverse_unroll(params: List[Tensor],
hparams: List[Tensor],
outer_loss: Callable[[List... | |
<reponame>andrei8782/spikeinterface
"""
This gather some function usefull for some clusetring algos.
"""
import numpy as np
from ..toolkit import check_equal_template_with_distribution_overlap
def _split_waveforms(wfs_and_noise, noise_size, nbefore, n_components_by_channel, n_components, hdbscan_params, probabil... | |
Is this rule redundant with existing blanket http->https rule?
# 1 case; *.svn.sourceforge.net
ruleset._rules = ONLY_FORCE_HTTPS_RULE_COMPILED
return True
elif len(rules) == 1:
if ruleset._single_wildcard_domain:
# ~65 cases
ruleset._rules = ONLY_FORCE_HTTPS_RULE_COMPILED
return True
ruleset._rules = rules
r... | |
#!/usr/bin/env python
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ).
#
# 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/lic... | |
# A YOLO-V2 network performing object detection. Ported to Keras(YAD2K), pretrained on COCO dataset.
# It will load the model with the pretrained weights, print its layers,
# try to detect objects on the given image and save the image with the predicted
# boxes in the "/output/" path.
import argparse
import os
import m... | |
typeforce not in validtypes:
raise RuntimeError("Cannot force objects to be an invalid type")
# Create buffers for column data
nrows = len(tgdata["TARGETID"][:])
# Arrays needed by C++
d_targetid = np.zeros(nrows, dtype=np.int64)
d_type = np.zeros(nrows, dtype=np.uint8)
d_nobs = np.zeros(nrows, dtype=np.int32)
... | |
names of tables that are created.
- **Schedule** *(dict) --*
For scheduled crawlers, the schedule when the crawler runs.
- **ScheduleExpression** *(string) --*
A ``cron`` expression used to specify the schedule (see `Time-Based Schedules for Jobs and Crawlers <http://docs.aws.amazon.com/glue/latest/dg/monitor-dat... | |
+ "v" + toGuess[3:]
if word[3] == "V" or word[3] == "v" :
toGuess = toGuess[:3] + "v" + toGuess[4:]
if word[4] == "V" or word[4] == "v" :
toGuess = toGuess[:4] + "v" + toGuess[5:]
if word[5] == "V" or word[5] == "v" :
toGuess = toGuess[:5] + "v" + toGuess[6:]
if word[1] != "V" and word[1] != "v"... | |
from pines_analysis_toolkit.utils import pines_dir_check, short_name_creator
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.coordinates import EarthLocation, AltAz
from astropy.time import Time
from astropy.utils.data import clear_download_cache
from astropy.constants import R_ear... | |
= precision
T1 = Mt2 * Mw2 * Mb2
T2t = np.zeros((n, nc))
T2w = np.zeros((p, nc))
T2Block = np.zeros((NBlocks, nc))
# Transpose M by block once for all
M2 = np.zeros((p, n0))
Mfit = np.zeros((n, p0))
if n_Mmis > 0:
denomt = np.zeros(n)
denomw = np.zeros(p)
denomBlock = np.ones((NBlocks, nc))
MxMmis2 = np.z... | |
import ROOT,os,random
import shipunit as u
import rootUtils as ut
from ShipGeoConfig import ConfigRegistry
from array import array
pdg = ROOT.TDatabasePDG()
mu = pdg.GetParticle(13)
Mmu = mu.Mass()
Mmu2 = Mmu * Mmu
rnr = ROOT.TRandom()
#eospath = "root://eoslhcb//eos/ship/data/"
eospath = "/media/Data/HNL/ShipSoft/d... | |
# Copyright (c) 2016 EMC 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-2.0
#
# Unless required by applicable la... | |
* t_values[0]))
+ (R2 / (1 + w * 1j * t_values[1]))
+ (R3 / (1 + w * 1j * t_values[2]))
+ (R4 / (1 + w * 1j * t_values[3]))
+ (R5 / (1 + w * 1j * t_values[4]))
+ (R6 / (1 + w * 1j * t_values[5]))
+ (R7 / (1 + w * 1j * t_values[6]))
+ (R8 / (1 + w * 1j * t_values[7]))
+ (R9 / (1 + w * 1j * t_values[8]))
+ (R10 ... | |
<reponame>egg0001/telegram-e-hentaiDL-bot
#!/usr/bin/python3
import os
import subprocess
import requests
import time
import json
import re
import random
from . import config
from . import dloptgenerate
from . import datafilter
from . import usermessage
from . import regx
from .theLogger import loggerGene
from concurre... | |
# Authors: <NAME>, <NAME> and <NAME>
# Date Submitted: Apr 2nd, 2020
# Milestone #3, P8
# Description: All filter functions for the ECOR1051 project.
# Team Identifier: 16
# Imports
from Cimpl import choose_file, create_color, create_image, get_color,\
set_color, show, copy, save_as, load_image, get_width,\
... | |
#############################################################################
#
# PyExperimentSuite
#
# Derive your experiment from the PyExperimentSuite, fill in the reset() and
# iterate() methods, and define your defaults and experiments variables
# in a config file.
# PyExperimentSuite will create directories, run ... | |
# Copyright (C) 2013-2014 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
import os
import traceback
import signal
import select
import time
import copy
import errno
import socket
import json
from ctypes import *
from datetime import datetime, timedelta
from ave.handset.profile ... | |
<gh_stars>1-10
import asyncio
import contextlib
import logging
import socket
import threading
import time
import httpx
import pytest
from tests.response import Response
from tests.utils import run_server
from quanshu import serve
from quanshu.config import Config
SIMPLE_GET_REQUEST = b"\r\n".join([b"GET / HTTP/1.1"... | |
for _ in range(self.D_iter):
self.D_opt.zero_grad()
D_loss = 0
for i in range(self.subdivisions):
latents, latent_labels = self.prior_generator(
multi_latent_prob=self.style_mix_prob)
reals, real_labels = self._get_batch()
loss, _ = self.D_loss(
G=self.G,
D=self.D,
latents=latents,
latent_labels=latent_labe... | |
<filename>ietf/doc/views_search.py<gh_stars>1-10
# Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved. Contact: <NAME> <<EMAIL>>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met... | |
<filename>Labelling tool - WS1/cookiecutter/main.py
# Cookiecutter tool
#
# Copyright (C) Dr. <NAME> 2020 Rolls-Royce Deutschland Ltd & Co KG
# Made on behalf of Emergent Alliance Ltd
#
# Notice to users: This is a Minimum Viable Product designed to elicit user requirements. The code
# quality is write-once, reuse only... | |
import collections
import numpy as np
from copy import copy
from robosuite.utils import RandomizationError
from robosuite.utils.transform_utils import quat_multiply
from robosuite.models.objects import MujocoObject
class ObjectPositionSampler:
"""
Base class of object placement sampler.
Args:
name (str): Name ... | |
#
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
... | |
from abc import ABCMeta, abstractmethod
import sys
import numpy as np
from scipy import linalg
from scipy import stats
import pandas as pd
from vmaf.core.mixin import TypeVersionEnabled
from vmaf.tools.misc import import_python_file, indices
from vmaf.mos.dataset_reader import RawDatasetReader
__copyright__ = "Copyr... | |
self.scatterers()
self.erase_scatterers()
self.add_scatterers(scatterers = scatterers)
def apply_rigid_body_shift_obj(self,
sites_cart,
sites_frac,
rot,
trans,
selection,
unit_cell,
atomic_weights):
return ext.apply_rigid_body_shift(sites_cart = sites_cart,
sites_frac = sites_frac,
rot = rot,
trans = tra... | |
True},
'username': {'readonly': True},
}
_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'username': {'key': 'username', 'type': 'str'},
'passwords': {'key': 'passwords', 'type': '[Password]'},
}
def __init__(
self,
*,
passwords: Optional[List["Password"]] = None,
**kwargs
):
super(Re... | |
force limited value:
else:
self._CheckValid()
ret = True
## dbg('ret:', ret, indent=0)
return ret
def GetMin(self, as_string = False):
"""
Gets the minimum value of the control.
If None, it will return None. Otherwise it will return
the current minimum bound on the control, as a wxDateTime
by default, or as... | |
45: ooOoO0o + II111iiii % iII111i
if 55 - 55: ooOoO0o - oO0o % I1IiiI
def get_nonce ( self ) :
return ( self . first_long & 0xffffff )
if 61 - 61: ooOoO0o
if 22 - 22: iIii1I11I1II1 / ooOoO0o / I1IiiI - o0oOOo0O0Ooo
if 21 - 21: oO0o . i11iIiiIii * I11i . OOooOOo / OOooOOo
class lisp_echo_nonce ( ) :
def __init__ ... | |
import shapefile
class Cangkuang:
def __init__(self):
self.kelurahan = shapefile.Writer(
'kelurahan_cangkuang', shapeType=shapefile.POLYGON)
self.kelurahan.shapeType
self.kelurahan.field('kelurahan_di_cangkuang', 'C')
self.kantor = shapefile.Writer(
'kantor_kelurahan_cangkuang', shapeType=shapefile.POINT)
se... | |
# Barbooth 1.1 by Ano
# Copyright © 2018 <NAME>
# This game is probably illegal in some places but that does not matter
# as this is only a personal project. It takes two player names, rolls
# two random dices and prints out the winner. There are three game modes:
# "highs" designates the highst dice as the winner; "l... | |
and a value on success.
.. function:: peek_licensed_qsfp_port_members()
Reads the value assigned to licensed-qsfp-port-members in the
object.
:rtype: None on error and a value on success.
.. function:: peek_qsfp_port_base_switch_members()
Reads the value assigned to qsfp-port-base-switch-members in the
ob... | |
import time
import calendar
from collections import OrderedDict
from copy import deepcopy
import difflib
import json
import os
import pprint
import sys
import uuid
from builtins import str
from symphony import RequestStates, MachineStates, MachineResults, SymphonyRestClient
import cluster
from capacity_tracking_db im... | |
a number of accumulations,
that is, the number of raw spectra to make up one integration. It then
calculates the number of spectra to make up a scan.
"""
n_accums = math.ceil(scan_time / integration_time)
el_offset = self.info["boresight"]["offset_el"]
xel_offset = self.info["boresight"]["offset_xel"]
self.log... | |
import pytest
@pytest.fixture
def procfs_timeline():
"""
Timeline of procfs report for the tests
"""
return [
{
"timestamp": "2021-09-14T12:37:37.168817",
"sensor": "formula_group",
"target": ["firefox_cgroup", "emacs_cgroup",
"zsh_cgroup", "mongo_cgroup"],
"usage": {
"firefox_cgroup": 8.36,
"emacs_cgrou... | |
<reponame>hotenov/playlist-along<filename>tests/unit/test_cli.py
"""Unit-tests for the console module."""
from pathlib import Path
import platform
from textwrap import dedent
from unittest.mock import Mock
from click.testing import CliRunner, Result
from mutagen import MutagenError
import pytest
from pytest_mock impor... | |
#! /usr/bin/env python
# call roscore
# $ roscore
#
# If start in manual
# $ rosrun cbf_ros cbf_controller.py
import rospy
import sys
import argparse
import re
import numpy as np
from scipy.integrate import odeint
from sympy import symbols, Matrix, sin, cos, lambdify, exp, sqrt, log
import matplotlib.pyplot as plt
imp... | |
"""Base Garage Environment API."""
import abc
from dataclasses import dataclass
from typing import Dict
import akro
import numpy as np
# Can't use naive garage import, or Sphinx AutoAPI breaks.
from garage._dtypes import StepType
@dataclass(frozen=True)
class InOutSpec:
"""Describes the input and output spaces of... | |
with ThreadPoolExecutor() as executor:
futures = []
for k in self.parameters:
futures.append(executor.submit(self._serialize_object, k))
wait(futures)
else:
# Sequential:
for k in self.parameters:
self._serialize_object(k)
# Threaded: (somehow takes more time than sequential?)
# threads = []
# # Serialize ea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.