input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
#!/usr/bin/env python
""" ngc - n-grams count
License: 3-clause BSD (see https://opensource.org/licenses/BSD-3-Clause)
Author: <NAME>
"""
import getopt
import logging
import os
import re
import string
import sys
import unicode2ascii
# Version string used by the what(1) and ident(1) commands:
ID = "@(#) $Id: ngc - n-... | |
<reponame>vovanz/invoke
import json
import os
import sys
from invoke.util import six
from mock import patch, Mock, ANY
import pytest
from pytest import skip
from pytest_relaxed import trap
from invoke import (
Program, Collection, Task, FilesystemLoader, Executor, Config,
UnexpectedExit, Result,
)
from invoke impor... | |
<reponame>ProfFan/maestral
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
This module provides user configuration file management and is mostly copied from the
config module of the Spyder IDE.
"""
import ast
... | |
State',
semantic_manager=semantic_manager)
"""
A Relationship Identifying The Type Of State Of A Device
"""
Has_Typical_Consumption: RelationField = RelationField(
name='Has_Typical_Consumption',
rule='only (Energy or Power)',
semantic_manager=semantic_manager)
"""
A Relationship Identifying The Typical ... | |
import re
import warnings
import json
import os
import nltk
import itertools
import chardet
import pickle
from chardet.universaldetector import UniversalDetector
from nltk.stem.wordnet import WordNetLemmatizer
from coordinate_map import CoordinateMap
from nltk.tag.stanford import StanfordNERTagger
import subprocess
imp... | |
messages_on_stage = get_messages(request)
organization_id = convert_to_int(organization_id)
all_is_well = True
organization_on_stage_found = False
organization_on_stage = Organization()
try:
organization_on_stage = Organization.objects.get(id=organization_id)
organization_on_stage_found = True
except Organizati... | |
"""
if annotation not in self.sub_embedded_mapping:
return None, False
grouping = self.sub_embedded_mapping[annotation]
if grouping in self.variant_schema['properties']:
return grouping, True
elif grouping in self.variant_sample_schema['properties']:
return grouping, False
else:
raise VCFParserException('Sub_e... | |
' + str(num)
# as long as name+num is allready taken, count up num
while name in namelist:
num = num + 1
name = 'Drawing ' + str(num)
return name
def gpencil_paint_mode():
"""Gpencil has to be selected! activates DRAW mode / GPENCIL_PAINT mode, unless it's already active
"""
if not bpy.context.mo... | |
"""
cancel out the basic system load and replace it with a convex combination of bids
note: the demand_module (or some subsidiary module) may store calibration data
at the module level (not in the model), so this module should only be used with one
model at a time. An alternative approach would be to receive a calibr... | |
<filename>rec.py
from typing import Dict, List, Optional, Tuple, Union
import re
SYNTAX_ERROR = "SyntaxError"
RUNTIME_ERROR = "RuntimeError"
class Number:
def __init__(self, value: int) -> None:
self.value = value
def run(self, variables: Dict[str, int]) -> int:
return self.value
class Operator:
def __init... | |
'''
kwargs = self._setup_fitter_kwargs(
{'A': 1, 'mu':0, 'sigma': 1, 'c': 0,},
kwargs
)
Fitter.__init__(self, *args, **kwargs)
self._box_str_format = '{:5}: {:7.3g} $\\pm$ {:6.1g}\n'
def fit_func(self, x, A, mu, sigma, c):
"""Guassian function
A: amplitude
mu: position
sigma: std deviation
c : offset
"... | |
text: %s', source_text)
except UnicodeDecodeError:
is_binary = True
logging.debug('Template file is binary. Templating disabled.')
compiled = None
context = None
if is_binary or not self.custom_response.use_templating:
compiled = source_text
else:
compiled, context = self.common_template_renderer(template_eng... | |
Basic.__new__(cls, name, tensortype, is_up)
obj._name = name
obj._tensortype = tensortype
obj._is_up = is_up
return obj
@property
def name(self):
return self._name
@property
def tensortype(self):
return self._tensortype
@property
def is_up(self):
return self._is_up
def _pretty(self):
s = self._name
... | |
the empirical precision matrix given the data.
Args:
X (array[N,D]): data matrix of shape NxD where N is the number of samples, and D is the dimensionality
of a data point
axis (int): axis along which the precision is computed
bessels_correction (bool): if True, it will compute the precision using `1/N-1` instead... | |
import pprint
import time
from .constant import (
AIR_QUALITY_KEY,
AUTOMATION_PATH,
CONNECTION_KEY,
DEFAULT_MODES,
DEFINITIONS_PATH,
HUMIDITY_KEY,
MODE_ID_TO_NAME_KEY,
MODE_IS_SCHEDULE_KEY,
MODE_KEY,
MODE_NAME_TO_ID_KEY,
MODE_UPDATE_INTERVAL,
MODEL_BABY,
MODEL_ESSENTIAL,
MODEL_GO,
MODEL_PRO_3_FLOODLIGHT... | |
self.json_data["active"] = self.active
self.json_data["users"] = self.users
self.json_data["old"] = self.old
# Same practice as constructor
self.json_handler.pack_data(self.json_data)
self.json_data = self.json_handler.unpack_data()
self.users = (self.json_data["users"]
if "users" in self.json_data else dict()... | |
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
import pandas as pd
from .bilateral import Bilateral
from .utils import HDFMixin, fast_binomial_pmf
class MidlineBilateral(HDFMixin):
"""Model a bilateral lymphatic system where an additional risk factor can
be provided in the data: Whether or... | |
# Copyright (c) 2016-2019 Cloudify Platform Ltd. 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 appl... | |
flight_ID=flight_ID)
df['flight_ID'] = flight_ID
dfs_obs[flight_ID] = df
# Model
# dfs_mod = {}
# for flight_ID in flight_IDs:
# df = get_GEOSCF4flightnum(flight_ID=flight_ID)
# df = add_derived_FAAM_flags2df4flight(df=df, flight_ID=flight_ID)
# df['flight_ID'] = flight_ID
# dfs_mod[flight_ID] = df
# Model - GEOS-C... | |
text: '噬嗑'
font_size: 60
font_name: './yahei.ttf'
on_release:
root.manager.current = 'menu'
root.manager.transition.direction = 'right'
Button:
background_normal: ''
background_color: 0,0,0,0
text: '运拙如同身受饥\\n幸得送饭又送食\\n适口充腹心欢喜\\n忧愁从此渐消移'
font_name: './yahei.ttf'
BoxLayout:
Image:
id: 21
source: '21.... | |
+ cj.trailing_spaces(16, IRTE, 0) + " | IRTE: water routing method 0=variable travel-time 1=Muskingum" + \
"\n" + cj.trailing_spaces(16, MSK_CO1, 3) + " | MSK_CO1 : Calibration coefficient used to control impact of the storage time constant (Km) for normal flow" + \
"\n" + cj.trailing_spaces(16, MSK_CO2, 3) + " | MSK... | |
Rey"),
("Dewey University-Juana D�az","Dewey University-Juana D�az"),
("Dewey University-Manati","Dewey University-Manati"),
("Dewey University-Yabucoa","Dewey University-Yabucoa"),
("DiGrigoli School of Cosmetology","DiGrigoli School of Cosmetology"),
("Diablo Valley College","Diablo Valley College"),
("Diamond ... | |
from django.shortcuts import render, get_object_or_404
from joblistings.models import Job
from jobapplications.models import JobApplication, Resume, CoverLetter, Education, Experience, Ranking
from jobapplications.forms import ApplicationForm, resumeUpload, FilterApplicationForm
from django_sendfile import sendfile
imp... | |
import re
import sys
import copy
import random
import datetime
from six import iteritems
from pandajedi.jedicore.MsgWrapper import MsgWrapper
from pandajedi.jedicore.SiteCandidate import SiteCandidate
from pandajedi.jedicore import Interaction
from pandajedi.jedicore import JediCoreUtils
from .JobBrokerBase import J... | |
rot, scale, rms, n))
fp.close()
def table_to_radec(table, output='coords.radec'):
"""Make a DS9 region file from a table object
"""
if 'X_WORLD' in table.colnames:
rc, dc = 'X_WORLD', 'Y_WORLD'
else:
rc, dc = 'ra', 'dec'
table[rc, dc].write(output, format='ascii.commented_header',
overwrite=True)
def ... | |
Inventory Adjustments """
if r.representation == "html" and r.name == "adj":
record = r.record
if record:
T = current.T
tabs = [(T("Edit Details"), None),
(T("Items"), "adj_item"),
(T("Photos"), "image"),
]
rheader_tabs = s3_rheader_tabs(r, tabs)
table = r.table
rheader = DIV(TABLE(
TR(TH("%s: " % tabl... | |
#! /usr/bin/python
#
# Copyright (c) 2013 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | |
record.
dns_name: Name for an NSEC record in punycode format.
dns_next_owner_name: Name of the next owner in punycode format.
last_queried: The time of the last DNS query in Epoch seconds
format.
name: The name of the NSEC record in FQDN format.
next_owner_name: Name of the next owner that has authoritative data
... | |
<filename>kolibri/utils/options.py
"""
This module is intended to allow customization of Kolibri settings with the
options.ini file.
The settings can be changed through environment variables or sections and keys
in the options.ini file.
The following options are supported:
[Cache]
CACHE_BACKEND
CACHE_TIMEOUT
CACHE_MAX... | |
freqstop,
step_size,
sweepname=None,
save_fields=True,
save_rad_fields_only=False,
sweep_type="Interpolating",
interpolation_tol_percent=0.5,
interpolation_max_solutions=250,
use_q3d_for_dc=False,
):
"""Create a sweep with the specified frequency step.
Parameters
----------
setupname : str
Name of the se... | |
NetworkSerializer.get_by_domain_install(domain=asset['parent'])
else:
network_serializer = NetworkSerializer.get_by_asset_vlan(domain=asset['parent'], vlan=asset['provision']['vlan'])
parent_asset = AssetSerializer.get(service_tag=asset['parent'])
si, vcenter, datacenter, cluster = connect_hypervisor_vmware(parent_... | |
is listening
self.isActive = False #Is this the current patch?
# Has this channel been disabled?
# Usually should only happen if another channel is
# listening for a new trigger/fader
self.isDisabled = False
self.errmsg = None #Returns message if something goes wrong
# Various Tk frames to get the UI elem... | |
#!/usr/bin/env python
"""create.py - create the world.
"""
from __future__ import print_function
import argparse
from builtins import input
import codecs
from munch import DefaultMunch
import os
import sys
import yaml
from utils import io, templater
# Environment variable used to hold the OKD admin and developer ... | |
request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
"""
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([na... | |
= (1,)#TODO Review /home/mcfletch/OpenGL-dev/pyopengl/src/khronosapi/extensions/ARB/ARB_sample_locations.txt # GL_SAMPLE_LOCATION_ARB
_m[0x8E50] = (1,)#TODO Review /home/mcfletch/OpenGL-dev/pyopengl/src/khronosapi/extensions/NV/NV_sample_locations.txt # GL_SAMPLE_LOCATION_NV
_m[0x933F] = (1,)#TODO Review /home/mcfletch... | |
# Copyright 2018 The MACE Authors. 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 law or... | |
header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['*/*'])
# Authentication setting
auth_settings = []
response = self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=files... | |
= secret_store_id
self.egress_filter = egress_filter
self.hostname = hostname
self.username = username
self.password = password
self.database = database
self.port_override = port_override
self.port = port
self.override_database = override_database
def __repr__(self):
return '<sdm.AuroraPostgres ' + \
'id: '... | |
# Copyright (c) 2017 Intel Corporation. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import os
import logging
import settings
import threading
from chroma_core.lib.storage_plugin.base_resource import BaseStorageResource
from chroma_core.se... | |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""main module."""
import logging
import os
import pathlib
import platform
import pprint
import shutil
import traceback
from logging.handlers import TimedRotatingFileHandler
from tempfile import NamedTemporaryFile
from typing import Any, Dict, Iterator, List, Optional, Tu... | |
# Copyright (c) 2007-2019 The Psi4 Developers.
# Copyright (c) 2014-2018, The Psi4NumPy Developers.
# 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... | |
<reponame>fzi-forschungszentrum-informatik/P3IV
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)
import numpy as np
import math
import matplotlib.i... | |
######################################################
# File: fitch.py #
# Author: <NAME> (<EMAIL>) #
# Project: Fitch Proof Automation with State-Search #
# Final Project for CS221: Artificial Intelligence #
######################################################
import util
import random
########################
# ... | |
<filename>Model/LowLevelFunctions.py
import json
import mysql.connector
import copy
import ast
import datetime
import Database_credentials as dc
import os
import traceback
import bz2
from Item import Item
import pandas as pd
from threading import Thread
class LowLevelFunctions:
def __init__(self, resources, map_info... | |
<filename>morph_tools.py
import logging
import os.path
import numpy as np
from morphing import Morph
import cv2
from nilt_base.NILTlogger import get_logger
logger = get_logger("NILTlogger.morph_tool")
COLOR_LOOKUP = {"black": [0, 0, 0],
"white": [255, 255, 255],
"red": [255, 0, 0],
"green": [0, 255, 0],
"blue": ... | |
self.certificate is not None and self.certificate._has_data():
return True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_crypto_sam_oper as meta
return meta._meta_table['Sam.Devices.Device']['meta_info']
@property
def _common_path(self):
return '/Cisco... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.10065,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 3.45472,
'Su... | |
################################################################################
# (c) [2013] The Johns Hopkins University / Applied Physics Laboratory All Rights Reserved.
# Contact the JHU/APL Office of Technology Transfer for any additional rights. www.jhuapl.edu/ott
#
# Licensed under the Apache License, Version 2... | |
P2[0:int(L/2+1)]
P11 = P1[:]
P1[1:-1] = 2*P11[1:-1]
f = freq*np.linspace(0, int(L/2), num=int(L/2)+1,endpoint = True)/ L
plt.figure(figsize=(5,3))
plt.plot(f,P1)
font=15
plt.title('Single-sided amplitude spectrum',fontsize = font)
plt.xlabel('frequncy (Hz)', fontsize = font)
plt.ylabel('|P1(f)|', font... | |
<gh_stars>0
""" Module with functionalities for blocking based on a dictionary of records,
where a blocking function must return a dictionary with block identifiers
as keys and values being sets or lists of record identifiers in that block.
"""
# =================================================================... | |
ix not in idx]
m_idx = self._sort_indexer_as_codes(m_idx, group)
if exp == 'after':
names.extend(name)
names.extend([c for c in group])
combines.append(
np.concatenate([vec, self.matrix[:, m_idx]], axis=1))
else:
names.extend([c for c in group])
names.extend(name)
combines.append(
np.concatenate([self.matrix... | |
<filename>mm_scripting_util/util.py
import logging
import os
import sys
import numpy as np
import shutil
import platform
import getpass
import traceback
import corner
import matplotlib.pyplot as plt
import matplotlib
import inspect
import enum
import collections
import scipy.stats
import tabulate
import... | |
# Sprite classes for platform game
import pygame as pg
from settings import *
from random import choice, randint, uniform
vec = pg.math.Vector2
def gimme_gibs(game, pos, qty):
for i in range(qty):
impulse = randint(-GIB_IMPULSE, GIB_IMPULSE)
#print(impulse)
Gib(game, pos, impulse)
def gimme_player_gibs(game, pos)... | |
-
(9554264*mbkin**2*(1 - mckin/mbkin)**10)/(1964655*mckin**2) -
(64688*mbkin*(1 - mckin/mbkin)**10)/(76545*mckin) +
(64688*mckin*(1 - mckin/mbkin)**10)/(76545*mbkin) -
(9554264*mckin**2*(1 - mckin/mbkin)**10)/(1964655*mbkin**2) +
(577664*(1 - mckin/mbkin)**11)/56133 -
(288832*mbkin**2*(1 - mckin/mbkin)**11)/(5613... | |
<reponame>apivideo/api.video-python
import click, json, os, re, csv
import apivideo
from apivideo.apis import VideosApi
from apivideo.apis import UploadTokensApi
from apivideo.apis import LiveStreamsApi
from apivideo.apis import CaptionsApi
from apivideo.apis import PlayerThemesApi
from apivideo.apis import RawStatist... | |
# -*- coding: utf-8 -*-
# Copyright (c) 2017 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed ... | |
"Special",
"pp": 25,
"priority": 0,
"flags": {"protect", "mirror"},
"secondary": {
"chance": 10,
"status": 'brn'
},
"target": "normal",
"type": "Fire"
},
"encore": {
"accuracy": 100,
"basePower": 0,
"category": "Status",
"pp": 5,
"priority": 0,
"flags": {"protect", "reflectable", "mirror", "authentic"}... | |
#!/usr/bin/python
"""
This module has the classes associated with parsing XTAF parititions
To use this class try something like:
from partition import *
xtafpart = Partition('/mnt/data/201010.bin')
"""
import sys
import mmap
import struct
from threading import Lock
from cStringIO import StringIO
# TODO: Option... | |
different LC ages.
"""
fig = p.gcf()
Nax = len(bands)
if Nax > 25 : Nrow, Ncol = 5,6
elif Nax > 20 : Nrow, Ncol = 5,5
elif Nax > 16 : Nrow, Ncol = 4,5
elif Nax > 12 : Nrow, Ncol = 4,4
elif Nax > 9 : Nrow, Ncol = 3,4
elif Nax > 6 : Nrow, Ncol = 3,3
elif Nax > 4 : Nrow, Ncol = 2,3
elif Nax > 3 : Nrow, Nco... | |
"""
Created on Jan 09 2021
<NAME> and <NAME>
database analysis from
https://data.gov.il/dataset/covid-19
Israel sities coordinates data
https://data-israeldata.opendata.arcgis.com/
"""
import json
import requests
import sys
import extract_israel_data
from Utils import *
import time
import pandas as pd
import os
impor... | |
# -*- coding: utf-8 -*-
#===============================================================================
# returns the maximum possible size of a payload
def getPayloadSizeMax(message_size_max):
payload_size_max = message_size_max
payload_size_max -= 8 # NetworkID
payload_size_max -= 1 # ParentCount
payload_size_m... | |
import numpy as np
import cv2
import glob
import math
from sklearn.linear_model import LinearRegression
from scipy.cluster.hierarchy import ward, fclusterdata
from scipy.spatial.distance import pdist
import copy
import matplotlib
from matplotlib import pyplot as plt
def cal_curvature_2nd(x, coefs):
return np.power(1... | |
# -*- coding: utf-8 -*-
# Copyright 2011 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | |
"""
The base classes for inverse problem solving.
See :mod:`geoist.inversion` for examples, regularization, and more.
This module defines base classes that are used by the rest of the
``inversion`` package:
* :class:`~geoist.inversion.base.MultiObjective`: A "container" class that
emulates a sum of different object... | |
return FAILURE
if self.kib is None:
return WARNINGS # not sure how 'du' could fail, but whatever
return SUCCESS
def getText(self, cmd, results):
if self.kib is not None:
return ["treesize", "%d KiB" % self.kib]
return ["treesize", "unknown"]
class SetProperty(ShellCommand):
name = "setproperty"
renderables =... | |
'E': 'Signals', 'F': 'Other', 'O': 'Other'}),
'G': ('Turning versus same direction',{'A': 'Rear of left turning vehicle', 'B': 'Left turn side swipe', 'C': 'Stopped or turning from left side', 'D': 'Near centre line', 'E': 'Overtaking vehicle', 'F': 'Two turning', 'O': 'Other'}),
'H': ('Crossing (no turns)',{'A': 'Ri... | |
+ m.b134 - m.b192 <= 0)
m.c3285 = Constraint(expr= - m.b127 + m.b135 - m.b193 <= 0)
m.c3286 = Constraint(expr= - m.b127 + m.b136 - m.b194 <= 0)
m.c3287 = Constraint(expr= - m.b127 + m.b137 - m.b195 <= 0)
m.c3288 = Constraint(expr= - m.b127 + m.b138 - m.b196 <= 0)
m.c3289 = Constraint(expr= - m.b127 + m.b139 - m.b1... | |
<gh_stars>10-100
"""legacy_starting_point
Revision ID: 8995c5200c07
Revises:
Create Date: 2020-08-30 06:48:48.958520+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.schema import DropTable
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.dialects import postgresql
# revision i... | |
dist <= sight_range:
self.once_in_sight_range_opponent_team_2[i][
t_id] = True
if 1 < action__ < 6:
if move_in_sight_not_counted:
self.move_in_sight_range_team2[i] += 1
move_in_sight_not_counted = False
x_diff = new_pos_team_2[i][0] - t_unit.pos.x
y_diff = new_pos_team_2[i][1] - t_unit.pos.y
if action__ == 2:
... | |
not in all_authors:
if not etal_json:
all_authors[author_group_type] = []
if etal_json:
all_authors[author_group_type] = etal_json
else:
all_authors[author_group_type].append(author_json)
return all_authors
def references_json_authors(ref_authors, ref_content):
"build the authors for references json here for... | |
"""Main FLOWER simulation logic"""
import collections
import logging
import warnings
from typing import List
import matplotlib.pyplot as plt
import numpy as np
from wsnsims.core import segment
from wsnsims.core.cluster import closest_nodes
from wsnsims.core.comparisons import much_greater_than
from wsnsims.core.envi... | |
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xe4, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0... | |
#-----------------------------------------------------------------------------
# Name: Reports
# Purpose:
# Author: <NAME>
# Created: 1/26/2018
# License: MIT License
#-----------------------------------------------------------------------------
"""Reports is a module dedicated to generating reports after data collect... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/fitting/pdf_ops.py
# PDF multiplication via operators: easy wrappers for class RooProdPdf
# @see RooProdPdf
# @see ostap.fitting.basic.PDF
# @see ostap.fitting.fit2d.PDF2
# @see ... | |
if hold_arr is not None:
tomos_exp[tkey][lkey] = hold_arr
for npi in range(tomos_np[tkey][lkey]):
lists_exp[lkey].append(hold_arr)
if ana_global:
print('\t\t\t\t\t-Simulating univariate second order metrics...')
hold_arr_1, hold_arr_2 = ltomo.simulate_uni_2nd_order(p_nsims, ModelCSRV, part_vtp,
ana_rg_v, thick=... | |
+ 1):
s = pickle.dumps(a, proto)
b = pickle.loads(s)
self.assertEqual(b.year, 2003)
self.assertEqual(b.month, 2)
self.assertEqual(b.day, 7)
def test_pickling_subclass_datetime(self):
args = 6, 7, 23, 20, 59, 1, 64**2
orig = SubclassDatetime(*args)
for pickler, unpickler, proto in pickle_choices:
g... | |
-1, -1, 0, 1, 1]
safeguard 1.6 0.4899 [2, 2, 1, 1, 1, 2, 2, 2, 2, 1]
safeguarded 1.5 0.92195 [1, 2, 2, 0, 2, 0, 3, 1, 2, 2]
safeguarding 1.1 0.7 [2, 1, 1, 0, 1, 0, 2, 1, 1, 2]
safeguards 1.4 0.66332 [1, 2, 1, 1, 0, 2, 2, 2, 2, 1]
safekeeping 1.4 0.66332 [3, 1, 1, 2, 1, 1, 2, 1, 1, 1]
safelight 1.1 1.22066 [0, 3, 0, 2, ... | |
3), padding="same")(conv7)
conv7 = Activation("relu")(fun(conv7))
up8 = concatenate(
[
Conv3DTranspose(64, (2, 2, 2), strides=(2, 2, 2), padding="same")(conv7),
conv1,
],
axis=4,
)
conv8 = Conv3D(64, (3, 3, 3), padding="same")(up8)
conv8 = Activation("relu")(fun(conv8))
conv8 = Conv3D(64, (3, 3, 3), padding... | |
TransDParams:
"""This class defines the hyperameters and its ranges for tuning TranD algorithm.
TransDParams defines all the possibel values to be tuned for the algorithm. User may
change these values directly for performing the bayesian optimization of the hyper-parameters
Args:
learning_rate (list): List of fl... | |
from flask import Flask, render_template, request, redirect, jsonify, \
url_for, flash
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Category, Book, User
from flask import session as login_session
import random
import string
import urll... | |
constructs "
f"spanning axes {names}"
)
if log:
logger.info("\n".join(log))
if not _return_axis_map:
return False
else:
# Map item axes in the two instances
axes0_to_axes1[axes0] = axes1
for axes0, axes1 in axes0_to_axes1.items():
for axis0, axis1 in zip(axes0, axes1):
if axis0 in axis0_to_axis1 and axis1 ... | |
<gh_stars>1-10
#!/usr/bin/env python
"""A variety of methods to solve first order ordinary differential equations.
AUTHOR:
<NAME> <<EMAIL>>
Gordon College
Based Octave functions written in the spring of 1999
Python version: March 2008, October 2008
"""
import numpy
#---------------------------------------------... | |
import pygame
class Board:
def __init__(self):
self.turn = 0
self.check = 0
self.checkmate = False
self.stalemate = False
self.draw = False
self.last_move = None
self.promotion = False
self.black_promotion = pygame.image.load(".\\Pieces\\black_promotion.png")
self.white_promotion = pygame.image.l... | |
- {'.notdef'})
return [g for g in diff[:] if g != '.notdef']
class NbspAndSpaceSameWidth(Fixer):
def get_shell_command(self):
return "fontbakery-fix-nbsp.py {}".format(self.fontpath)
def getGlyph(self, uchar):
for table in self.font['cmap'].tables:
if not (table.platformID == 3 and table.platEncID in [1, 10])... | |
import tkinter
from abc import ABC, abstractmethod
from tkinter import *
import math
class ConvexPolygon(ABC):
@abstractmethod
def __init__(self, fill_color, outline_colour):
self.fill_colour = fill_color
self.otuline_colour = outline_colour
super(ConvexPolygon, self).__init__()
@abstractmethod
def area(self)... | |
# coding:utf-8
'''
@author = super_fazai
@File : sql_utils.py
@Time : 2016/7/14 14:36
@connect : <EMAIL>
'''
"""
sql utils
"""
import better_exceptions
better_exceptions.hook()
from gc import collect
import sqlite3
# from pymssql import *
from pymssql import connect as pymssql_connect
from pymssql import IntegrityE... | |
import sqlalchemy
from uuid import UUID
import json
from datetime import datetime
from systemcheck.models.meta.systemcheck_choices import InclusionChoice, ComponentChoice, OperatorChoice
from inspect import isclass
from sqlalchemy import ForeignKey, Table, DateTime, Integer, CHAR, inspect, String, Date, Time
from sqlal... | |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this fi... | |
0, -1, -1, -1, -1]
carelessness -1.4 0.4899 [-2, -1, -1, -2, -1, -2, -1, -1, -2, -1]
carelessnesses -1.6 1.11355 [-4, -2, -2, -3, -1, 0, -1, -1, -1, -1]
cares 2.0 0.7746 [2, 3, 1, 3, 1, 2, 2, 2, 3, 1]
caring 2.2 0.4 [2, 3, 2, 2, 2, 2, 2, 3, 2, 2]
casual 0.8 0.74833 [1, 1, 0, 1, 0, 2, 0, 1, 2, 0]
casually 0.7 1.00499 [1... | |
# coding: utf-8
# Plotting script for TREACTMECH files written by <NAME> - hr0392 at bristol.ac.uk
#
# Run the script within the directory containing the flowdata, flowvector, stress strain, displacement files. Output by default is within same directory.
#
# Displacement gives the corner nodes, everything else gives ... | |
<filename>general/apero-drs/database_test/database/test_calibdb.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2020-05-21
@author: cook
"""
from astropy.table import Table
import numpy as np
import pandas as pd
import sqlite3
import sys
import shutil
class ... | |
left_strat,
right_sym,
right_strat,
right_is_scalar,
res_name,
data,
):
left = data.draw(left_strat, label=left_sym)
right = data.draw(right_strat, label=right_sym)
res = func(left, right)
assert_binary_param_dtype(func_name, left, right, right_is_scalar, res, res_name)
if not right_is_scalar:
# TODO: gene... | |
TAG_SEQ_CHIP_NAME,
"flows": TAG_SEQ_FLOWS,
"libraryKitName": TAG_SEQ_LIB_KIT_NAME,
"libraryReadLength": TAG_SEQ_LIBRARY_READ_LENGTH,
"reference": TAG_SEQ_REFERENCE,
"sampleGrouping": TAG_SEQ_SAMPLE_GROUPING,
"sequencekitname": TAG_SEQ_SEQ_KIT_NAME,
"templatingKitName": TAG_SEQ_TEMPLATE_KIT_NAME,
"planStatus": P... | |
current_domain["AdvancedOptions"][
"rest.action.multi.allow_explicit_index"
]
if not current_domain["AdvancedOptions"]:
del current_domain["AdvancedOptions"]
# Compare current configuration with provided configuration
config_diff = salt.utils.data.recursive_diff(current_domain, target_conf)
if config_diff:
act... | |
<gh_stars>1-10
from pathlib import Path
import numpy as np
from struct import unpack
import xarray as xr
from datetime import datetime
from glob import glob
def yyyymmddhhmmss_to_datetime(yyyymmdd: int, hhmmss: int) -> datetime:
""" Convert an integer pair of yyyymmdd and hhmmss to a useful time format.
"""
return... | |
#!/usr/bin/env python3
"""This module is used to operate with archives."""
import os # filesystem read
import tarfile # txz/tbz/tgz/tar compression
import zipfile # zip compresssion
from bbarchivist import barutils # zip tester
from bbarchivist import bbconstants # premade stuff
from bbarchivist import decorators # t... | |
last establishment sn = esn
#create receipt msg stream
res = bytearray()
# Event 0 Inception Transferable (nxt digest not empty)
serder = incept(keys=[coeSigners[esn].verfer.qb64],
nxt=Nexter(keys=[coeSigners[<KEY>)
assert sn == int(serder.ked["s"], 16) == 0
coepre = serder.ked["i"]
assert coepre == '<KEY>'
... | |
(opt_isDefault <= recurring) {
action(value, opt_isDefault);
if (!value.children) {
return;
}
/** @type {number} */
var i = 0;
var codeSegments = value.children;
for (;i < codeSegments.length;i++) {
this.eachLevel(codeSegments[i], opt_isDefault + 1, recurring, action);
}
}
},
/**
* @param {?} opt_attribut... | |
(2 * np.prod(PQ), 2 * np.prod(PQ)), dtype = tf.complex64)
SG['S11'] = tensor_utils.expand_and_tile_tf(SG_S11, batchSize, pixelsX, pixelsY)
SG_S12 = tf.eye(num_rows = 2 * np.prod(PQ), dtype = tf.complex64)
SG['S12'] = tensor_utils.expand_and_tile_tf(SG_S12, batchSize, pixelsX, pixelsY)
SG_S21 = tf.eye(num_rows = 2... | |
import numbers
from collections.abc import Iterable
from copy import deepcopy
import numpy as np
from qutip.qobjevo import QobjEvo
from qutip.qip.operations import expand_operator
from qutip.qobj import Qobj
from qutip.operators import sigmaz, destroy, num
from qutip.qip.pulse import Pulse
__all__ = ["Noise", "Decoh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.