input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>CoeGSS-Project/SN4SP
# Copyright (C) 2018 by
# <NAME> <<EMAIL>> HLRS
# <NAME> <<EMAIL>> IMT
# All rights reserved.
#
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
"""Base class for similarity networks.
"""
from __future__ import division, absolute_import, print_function
from sn4sp import parallel
# TODO: s... | |
from __future__ import print_function
from __future__ import with_statement
from os.path import exists
from twisted.python import log, failure
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, error
from txtorcon import TorControlProtocol, TorProtocolFactor... | |
= np.zeros((DNB_NUM_Y - 3) * (DNB_NUM_X - 3))
i = 0
for y in range(2, DNB_NUM_Y - 1):
left_x = float(DNB_NUM_Y - y) / DNB_NUM_Y * vertices_x[0] \
+ float(y) / DNB_NUM_Y * vertices_x[3]
left_y = float(DNB_NUM_Y - y) / DNB_NUM_Y * vertices_y[0] \
+ float(y) / DNB_NUM_Y * vertices_y[3]
right_x = float(DNB_NUM_Y - y... | |
<reponame>saroudant/Percolate
import torch, os
import numpy as np
from copy import deepcopy
from sklearn.model_selection import GridSearchCV, KFold
from sklearn.neighbors import KNeighborsRegressor
from sklearn.pipeline import Pipeline
from sklearn.kernel_ridge import KernelRidge
from sklearn.preprocessing import Stand... | |
def sqrt(n):
ans = n ** 0.5
return ans
def factorial(n):
k = 1
for i in range(1, n+1):
k = i * k
return k
def degrees(x):
pi = 3.14159265359
y=x/pi*180.0
return y
def radians(x):
pi = 3.14159265359
y=x/180.0*pi
return y
def sin(x):
pi = 3.14159265359
#n = 180 / int(d) # 180 degrees = pi radians
#x ... | |
out_map_obj = MapParser('')
out_map_obj.copy_header(in_map)
out_map_obj.data = final
if mask_path is not None:
mask_ob = MapParser('')
mask_ob.copy_header(in_map)
mask_ob.data = mask
mask_ob.write_map(mask_path)
if out_map is not None:
out_map_obj.write_map(out_map)
return out_map_obj
@staticmethod
def ... | |
import pandas as pd
import os
import numpy as np
import argparse
import json
import sys
import shutil
import argparse
import numpy as np
import glob
from lxml import etree
def write_voc_file(fname, labels, coords, img_width, img_height):
"""
Writes label into VOC (XML) format.
Args:
fname - full file path to lab... | |
<gh_stars>0
########
# Copyright (c) 2013 GigaSpaces Technologies 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
#
# U... | |
logical_name = _attributes.AttributeViString(1050305)
'''Type: str
Contains the logical name you specified when opening the current IVI session.
You can pass a logical name to the __init__ method. The IVI Configuration utility must contain an entry for the logical name. The logical name entry refers to a method sec... | |
VBA object.
"""
# Get all the functions called in the VBA object.
call_visitor = function_call_visitor()
item.accept(call_visitor)
func_names = call_visitor.called_funcs
# Get all of the 0 argument functions called in the VBA object.
tmp_context = Context(context=context, _locals=context.locals, copy_globals=T... | |
sys_updatestat('SOTAWATCH',E_NONE)
conn2 = sqlite3.connect(alert_db)
cur2 = conn2.cursor()
r.reverse()
for item in r:
if item['comments'] is None:
item['comments'] = ""
ts = item['timeStamp']
ts = ts[:ts.find('.')]
spot_time = int(datetime.strptime(ts,'%Y-%m-%dT%H:%M:%S').strftime("%s"))
spot_end= spot_ti... | |
S_StartDrunk__Fv()")
del_items(0x80068BF0)
SetType(0x80068BF0, "void StartStore__Fc(char s)")
del_items(0x80068EE0)
SetType(0x80068EE0, "void DrawSText__Fv()")
del_items(0x80068F20)
SetType(0x80068F20, "void DrawSTextTSK__FP4TASK(struct TASK *T)")
del_items(0x80068FE8)
SetType(0x80068FE8, "void DoThatDrawSText__Fv()")
... | |
# Copyright (C) 2015-2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... | |
one of this program's text fields." ),
8: ( 'A quick and easy way to view file structures relating to a given texture is to use '
'the "Show in Structural Analysis" feature, found by right-clicking on a texture.' ),
9: ( "You don't have to close this program in order to run your disc in Dolphin "
'(thou... | |
# Copyright (c) 2015-2021 <NAME> and contributors.
# mc3 is open-source software under the MIT license (see LICENSE).
__all__ = [
'sample',
]
import os
import sys
import importlib
import multiprocessing as mpr
from datetime import date
import numpy as np
import matplotlib as mpl
if os.environ.get('DISPLAY', '') ==... | |
result = thread.get()
:param async_req bool: execute request asynchronously
:param str owner: Owner of the namespace (required)
:param V1Organization body: Organization body (required)
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Defa... | |
# -*- coding: utf-8 -*-
"""
Automatic Colour Conversion Graph
=================================
Defines the automatic colour conversion graph objects:
- :func:`colour.describe_conversion_path`
- :func:`colour.convert`
"""
import inspect
import numpy as np
import textwrap
from collections import namedtuple
from copy ... | |
== 1:
ydata, xdata = np.meshgrid(ydata, xdata)
if xdata:
surface = axes.plot_surface(xdata, ydata, image, **kwargs)
else:
surface = axes.plot_surface(image, **kwargs)
axes.axis(axlim)
return surface
def create_html_page(body_lines=(), header_lines=()):
"""Create html page"""
css = """<style>
.ScanBox {
bo... | |
# Standard libraray imports
from __future__ import print_function
from collections import deque
import json
import multiprocessing
import os
import shlex
import shutil
import subprocess
import sys
import time
# External module imports.
import psutil
def _make_command_list(command):
if not isinstance(command, (list... | |
0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0],
[0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, ... | |
# ref: https://github.com/bitcoin-core/HWI/blob/master/hwilib/serializations.py
from collections import OrderedDict
from .transaction import Transaction, TransactionOutput, SIGHASH
from . import compact
from . import bip32
from . import ec
from . import hashes
from .script import Script, Witness
from . import script
... | |
<reponame>HiroakiMikami/DeepCoder-Utils
#!/usr/bin/env python2
"""
Usage:
generate_io_samples.py [options] PROGRAM_TEXT
Example:
$ ./generate_io_samples.py "a <- [int] | b <- int | c <- TAKE b a | d <- COUNT isEVEN c | e <- TAKE d a"
Options:
-h --help Show this screen.
-N --number NUM Number of I/O examples to g... | |
<filename>models/official/detection/modeling/architecture/spinenet_mbconv.py
# Copyright 2020 The TensorFlow 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
#
# ... | |
<reponame>MrFelixU/ks5-edexcel<filename>oink/simpletal/simpleTAL.py
""" simpleTAL Interpreter
Copyright (c) 2009 <NAME> (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are m... | |
import numpy as np
import pandas as pd
import os
import logging
import random
import pywt
import time
from multiprocessing import Pool
import sys
import tensorflow as tf
import datetime
import argparse
from sklearn.metrics import mean_squared_error, mean_absolute_error
sys.path.append("../")
from core import WANN
# co... | |
<reponame>nexB/extractcode
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/extractcode for support or download.
# See https://abo... | |
<reponame>torfsen/sbl2py
#!/usr/bin/env python
# vim:fileencoding=utf8
# Copyright (c) 2014 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | |
Washington",37185),
("Parkwood CDP, Washington",6700),
("Pasco city, Washington",71858),
("Pateros city, Washington",601),
("Peaceful Valley CDP, Washington",4032),
("Pe Ell town, Washington",531),
("Picnic Point CDP, Washington",8976),
("Pine Grove CDP, Washington",122),
("Point Roberts CDP, Washington",1191),
("Pomer... | |
<gh_stars>0
import os
import os.path
import sys
import h5py
import numpy as np
from numpy.lib.function_base import hamming
import ASCAD_test_models
import tensorflow as tf
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layers import Flatten, Dense, Dropout, Input, Conv1D, MaxPooling1D, Gl... | |
of SubRipItems.
target_file_path {string} -- The path to the exported subtitle file.
frame_rate {float} -- The frame rate for frame-based subtitle formats {default: 25.0}.
encoding {str} -- The encoding of the exported subtitle file {default: None}.
"""
encoding = Utils.detect_encoding(source_file_path) if encodi... | |
<gh_stars>100-1000
#!/usr/bin/env python
"""
Generates an AXI crossbar wrapper with the specified number of ports
"""
import argparse
from jinja2 import Template
def main():
parser = argparse.ArgumentParser(description=__doc__.strip())
parser.add_argument('-p', '--ports', type=int, default=[4], nargs='+', help="nu... | |
moving list
move_files.append((oldroot, newroot))
dirlist.remove('_root.sds')
if skip:
flatten_fail.append(dirpath)
continue
# strip .sds for renaming
prefix = dirpath
if sds_endswith(prefix):
prefix = dirpath[:-4]
prefix = prefix + '!'
# move all .sds files to base directory
for fname in di... | |
plantri
sage: [u for u in list(gen)] # optional plantri
[Graph on 4 vertices,
Multi-graph on 3 vertices,
Multi-graph on 2 vertices,
Looped multi-graph on 2 vertices,
Looped multi-graph on 1 vertex,
Looped multi-graph on 1 vertex]
The cycle of length 4 is the only 2-connected bipartite planar graph
on 4 vertic... | |
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import remove_hairs
from remove_hairs import remove_hairs as remove_hairs_fn
from remove_hairs import remove_hairs_decorator
from .serializer import MARCX... | |
the caller's system
"""
# Ensure that StatePoint.read_results() was called first
if self.mean is None or self.std_dev is None:
msg = 'The Tally ID="{0}" has no data to return. Call the ' \
'StatePoint.read_results() method before using ' \
'Tally.get_pandas_dataframe(...)'.format(self.id)
raise KeyError(msg)
... | |
#
# Author : <NAME>
#
from pyqtside.QtGui import QWidget, QLabel, QGroupBox, QComboBox, QSizePolicy, QButtonGroup
from pyqtside.QtCore import QObject, Qt, SIGNAL, Signal, Slot
import views
class JigWidget(QObject):
def __init__(self, key ,title, desc):
QObject.__init__(self)
self._key = key
self._title = title
s... | |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: all_in_one.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List
import betterproto
@dataclass
class Data(betterproto.Message):
"""通用消息"""
proto: int = betterproto.int32_field(1)
bin: bytes = betterproto.b... | |
"""Represent interactions between context and item layers."""
import numpy as np
from scipy import stats
import h5py
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from cymr import operations
def save_patterns(h5_file, items, **kwargs):
"""
Write patterns and similarity matrices to hdf5.
... | |
<filename>evolve_soft_2d/result/analyse.py
## Functions used for obtaining and inspecting results
# Imports
import csv
import fileinput
import linecache
import numpy
import pandas
from scipy.optimize import curve_fit
from scipy.spatial.distance import directed_hausdorff
from evolve_soft_2d import plotting, utility
f... | |
<gh_stars>1-10
"""
Title: Masked image modeling with Autoencoders
Author: [<NAME>](https://twitter.com/arig23498), [<NAME>](https://twitter.com/RisingSayak)
Date created: 2021/12/20
Last modified: 2021/12/21
Description: Implementing Masked Autoencoders for self-supervised pretraining.
"""
"""
## Introduction
In deep ... | |
u1 = User(id=1, name="u1")
a1 = Address(id=1, user_id=1, email_address="a2")
sess.add_all([u1, a1])
self.assert_sql_execution(
testing.db,
sess.flush,
CompiledSQL(
"INSERT INTO users (id, name) VALUES (:id, :name)",
{"id": 1, "name": "u1"},
),
CompiledSQL(
"INSERT INTO addresses (id, user_id, email_address)... | |
tag for an XML element.
Args:
has_contents: Boolean indicating if the element has
sub-elements or text.
"""
if has_contents:
self.write_to_xmlfile(">")
self.indent_level += 1
else:
self.write_to_xmlfile(" />")
def display_cpu_time(self, start):
"""
Displays the elapsed CPU time since the start time.
Arg... | |
just a nice shortcut method to something I seemed to do a lot
return -- unicode
'''
return 'http{}://{}.com'.format(
's' if random.choice([True, False]) else '',
get_ascii()
)
def get_str(str_size=0, chars=None):
'''
generate a random unicode string
if chars is None, this can generate up to a 4-byte utf-8 ... | |
1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0, 1.0], [1.0,
1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0, 1.0, 1.0,
1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]], [[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]], [[1.0,
... | |
# -*- coding: utf-8 -*-
"""Aula_Python_8.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1wdj-lQTeUJ8_6rHRe5B1DXqY6O_PRltP
#Funções, variáveis globais e classes
"""
a = 5. # esta é uma variável global
if a > 0:
b = 10. # esta é outra variável glo... | |
<filename>scripts/us_bls/cpi/generate_csv_mcf.py<gh_stars>10-100
# Copyright 2020 Google LLC
#
# 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
#
#... | |
/= temperature
with timings("dec.sample"):
local_order_idxs = Categorical(logits=filtered_logits).sample()
all_local_order_idxs.append(local_order_idxs)
with timings("dec.order_idxs"):
# skip clamp_and_mask since it is handled elsewhere and is slow
global_order_idxs = local_order_idxs_to_global(
local_order_id... | |
= _splom_part_boxes(
box, n,
x, col, x_tickvals, x_ticktext, x_range,
y, row, y_tickvals, y_ticktext, y_range,
background_opacity=0.05,
)
for s in shapes:
fig.add_shape(s)
if refpoint is not None:
shapes = _splom_part_ref_point(
n,
x, x_range, x_t... | |
"""DHCPv6 Relay Agent"""
# pylint: disable=invalid-name,line-too-long
import pytest
import srv_control
import misc
import srv_msg
import references
@pytest.mark.v6
@pytest.mark.dhcp6
@pytest.mark.relay
@pytest.mark.kea_only
def test_v6_relay_interface_local_and_relay_interface_in_the_same_subnet():
misc.test_set... | |
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
from typing import Dict, List
class GetPropertyInfoHeaders(TeaModel):
def __init__(
self,
common_headers: Dict[str, str] = None,
x_acs_dingtalk_access_token: str = None,
):
self.common_headers = common_h... | |
<filename>contrapartes/views.py
from django.shortcuts import render
from .models import *
from .forms import *
from notas.models import *
from notas.forms import *
from agendas.models import *
from agendas.forms import *
from foros.forms import *
from publicaciones.models import *
from publicaciones.forms import *
from... | |
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from tkinter import scrolledtext
from tkinter import messagebox
from PIL import ImageTk, Image
import requests
import pickle
import numpy as np
import base64
from io import BytesIO
import json
import matplotlib.pyplot as plt
import matplotlib
... | |
<reponame>pyansys/pyaedt
# Setup paths for module imports
from __future__ import division # noreorder
import math
from _unittest.conftest import BasisTest
from pyaedt.application.Variables import decompose_variable_value
from pyaedt.application.Variables import Variable
from pyaedt.generic.general_methods import isclo... | |
if isess.state:
isess.reset_state()
serialize_isession_and_close_db_session(isess)
return build_json_response({}, 204)
# Set identity at this moment for the interactive session
@app.route(nis_api_base + "/isession/identity", methods=["PUT"])
def interactive_session_set_identity():
# Recover InteractiveSession
#... | |
crop the feature map to the same size as the x_f2 after upsamling
# 360//32
# print('After upsample:', x_f2.size(), x_f3.size(), x_f4.size())
# h
h_min = min(x_f2.size(2), x_f3.size(2), x_f4.size(2))
ds2 = x_f2.size(2) - h_min
ds3 = x_f3.size(2) - h_min
ds4 = x_f4.size(2) - h_min
# print(ds3//2, x_f2.size(2)-(... | |
0.148462793867),
(-0.521379367272, 0.148410003095),
(-0.527231998581, 0.148356510878),
(-0.533078164867, 0.148302308467),
(-0.538917769111, 0.148247386912),
(-0.54475071301, 0.148191737075),
(-0.550576896933, 0.148135349642),
(-0.556396219867, 0.148078215134),
(-0.562208579378, 0.148020323917),
(-0.56801387155... | |
#!/usr/bin/env python
'''
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"); ... | |
self.old_context = None # Mapping filename
# headers corresponding to the new context
self.new_headers = headers.HeaderGenerator(None,None,None) # Abstract for pylint, replaced later
# comparison variables
self.compare_prior = None # bool
self.old_headers = headers.HeaderGenerator(None,None,None) # Abstract for ... | |
{ self.model_name}.')
cur_stats = self.latest_round.get_curation_stats()
self.json_stats['curation_summary'] = cur_stats
def make_changes_over_time(self):
"""Add changes to model over time to json_stats."""
logger.info(f'Comparing changes over time for {self.model_name}.')
self.json_stats['changes_over_time'] = ... | |
this code has been
# compiled into the module it is possible to get
# an IOError that doesn't match the IOError from
# Python parse time resulting in an IOError
# exception being raised. Consequently we just
# catch all exceptions.
pass
except ImportError:
pass
try:
while True:
self._input_descriptions=[]
... | |
import numpy as np
import torch
import unittest
from itertools import combinations
import os
import heat as ht
from .test_suites.basic_test import TestCase
class TestStatistics(TestCase):
def test_argmax(self):
torch.manual_seed(1)
data = ht.random.randn(3, 4, 5)
# 3D local tensor, major axis
result = ht.argma... | |
<reponame>AnythingTechPro/toontown-otp-original
"""
* Copyright (C) <NAME> - All Rights Reserved
* Written by <NAME> <<EMAIL>>, August 17th, 2017
* Licensing information can found in 'LICENSE', which is part of this source code package.
"""
import random
from panda3d.direct import DCPacker
from realtime import io,... | |
16-bit (half) sort."""
ctx = _get_ctx(ctx)
return FPSortRef(Z3_mk_fpa_sort_half(ctx.ref()), ctx)
def Float32(ctx=None):
"""Floating-point 32-bit (single) sort."""
ctx = _get_ctx(ctx)
return FPSortRef(Z3_mk_fpa_sort_32(ctx.ref()), ctx)
def FloatSingle(ctx=None):
"""Floating-point 32-bit (single) sort."""
ctx = ... | |
<gh_stars>0
# 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... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
microwave_fov_figures.py
Created on Tue Oct 26 16:11:23 2021
@author: thayer
"""
import pandas as pd
import matplotlib.pyplot as plt
import os
import numpy as np
import vtk
from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk
import sys
sys.path.append('/ho... | |
<reponame>EnjoyLifeFund/macHighSierra-py36-pkgs
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fo... | |
<reponame>Haiiliin/PyAbaqus<gh_stars>1-10
from abaqusConstants import *
from .AreaStyle import AreaStyle
from .LineStyle import LineStyle
class Area:
"""The Area object is used to display a rectangular area in an XYPlot. The Area object has
no constructor. Area objects are automatically created whenever a XYPlot, C... | |
not support Index from Snapshot",
1572: "Storage unit must be specified for this operation",
1573: "Backup image cannot be expired because its SLP processing is not yet complete",
1574: "Data Classification name cannot be 'Any' while creating new data classification",
1575: "Data Classification auto creation failed",
1... | |
width;
:param `ySize`: if not ``None``, the new L{ImageBar} height.
"""
if not isinstance(colour, wx.Colour):
colour = wx.NamedColour(colour)
if self._hasBitmap:
bitmap = self._hasBitmap
else:
bitmap = zoombackgrey.GetImage()
if xSize is not None:
self._size = wx.Size(xSize, ySize)
bitmap.Rescale(self._s... | |
<reponame>automl/nes<gh_stars>10-100
import os
import argparse
import dill as pickle
import matplotlib.pyplot as plt
import matplotlib
import pandas as pd
import numpy as np
from math import pi
from matplotlib.ticker import FormatStrFormatter
from pathlib import Path
import seaborn as sns
from nes.ensemble_selection.c... | |
self.common_headers is not None:
result['commonHeaders'] = self.common_headers
if self.x_acs_dingtalk_access_token is not None:
result['x-acs-dingtalk-access-token'] = self.x_acs_dingtalk_access_token
return result
def from_map(self, m: dict = None):
m = m or dict()
if m.get('commonHeaders') is not None:
self.... | |
= gate.calc_proj_ineq_constraint()
# Assert
expected_choi = np.array(
[[0, 0, 0, 0], [0, 1, 1, 0], [0, 1, 1, 0], [0, 0, 0, 0]]
)
npt.assert_almost_equal(actual.to_choi_matrix(), expected_choi, decimal=14)
expected_hs = np.array(
[[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, -1]]
)
npt.assert_almost_eq... | |
val)
def add_sub_time(time_name, sub_name, val):
tindex = time_dict[time_name]
if sub_name not in tindex:
tindex[sub_name] = (0, 0)
cur_val = tindex[sub_name]
tindex[sub_name] = (cur_val[0] + 1, cur_val[1] + val)
# --------------- Global variables to hold timings of parts of Ramba -------------
def matmul(a,... | |
import pprint
from collections import Counter
import json
import sys
from nl4dv.utils import constants, error_codes, helpers
import os
import pandas as pd
import requests
class DataGenie:
"""
Pre-process data attributes into different categories
"""
def __init__(self, nl4dv_instance):
# nl4dv instance
self.nl4... | |
import conf
import numpy
import random
from Shake import *
def CALC(IPN,NVAC,KGAS,LGAS,ELECEN,ISHELL,ICON):
# IMPLICIT #real*8(A-H,O-Z)
# IMPLICIT #integer*8(I-N)
# SCR=""\
# SCR1=""
global IFIRST,ESHK,ELECN,JVAC,R1
ESHK=0.0
JVAC=0.0
def get_globals():
NDVEC=conf.NDVEC
MSUM=conf.MSUM
MCOMP=conf.MCOMP
MRAYL=... | |
dynamic_descriptor):
self._tags["dynamic_descriptor"] = dynamic_descriptor
self._order.append("dynamic_descriptor")
class Track2PurchaseCorrection(mpgTransaction):
def __init__(self, order_id, txn_number):
self._Request = "us_track2_purchasecorrection"
self._tags = {"order_id" : order_id, "txn_number... | |
from __future__ import print_function
import collections
import math
import os
import pickle
import sys
import time
import numpy
import torch
from sklearn.utils import compute_class_weight
from torch.nn.utils import clip_grad_norm
from torch.utils.data import DataLoader
from nldrp.dnn.config import DNN_BASE_PATH
from ... | |
from .stage01_isotopomer_peakSpectrum_postgresql_models import *
from SBaaS_LIMS.lims_experiment_postgresql_models import *
from SBaaS_LIMS.lims_sample_postgresql_models import *
from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update
from SBaaS_base.sbaas_base_query_drop import sbaas_base_query_drop
fr... | |
<reponame>sensen1/sage
r"""
Unique Representation
Abstract classes for cached and unique representation behavior.
.. SEEALSO::
:class:`sage.structure.factory.UniqueFactory`
AUTHORS:
- <NAME> (2008): Original version.
- <NAME> (2013-02): Separate cached and unique representation.
- <NAME>. King (2013-08): Extended... | |
<reponame>jeffbass/yin-yang-ranch
"""data_tools: data tools including classes, methods and attributes
Provides a variety of classes to hold, transfer, analyze, transform and query
the various data in the data library and in the imagehubs accessible to the
librarian.
Copyright (c) 2018 by <NAME>.
License: MIT, see LIC... | |
# This software was developed by employees of the National Institute of
# Standards and Technology (NIST), an agency of the Federal Government.
# Pursuant to title 17 United States Code Section 105, works of NIST employees
# are not subject to copyright protection in the United States and are
# considered to be in the ... | |
= profile_df[profile_df.z > -3.0]
if (profile_df.z.min() < datum) & (profile_df.z.max() > datum):
site_profiles.append(profile_df)
# If list of profiles contain valid data
if len(site_profiles) > 0:
# Combine individual profiles into a single dataframe
profiles_df = pd.concat(site_profiles)
# Reproject coord... | |
get locked out message
response = self.client.get(ADMIN_LOGIN_URL)
self.assertEqual(response.status_code, 302)
self.assertEqual(response["Location"], "http://localhost/othe/login/")
@patch("defender.config.LOCKOUT_URL", "/o/login/")
def test_failed_login_redirect_to_url_local(self):
""" Test to make sure that af... | |
offset_to_section: FileOffset
) -> None:
i_offset = (4 - (offset_to_section)) % 4
self.proto_ids: List[DexProtoId] = [
DexProtoId(
shorty=self.strings[self._parse_uint(data[i : i + 4])],
return_type=self.type_ids[self._parse_uint(data[i + 4 : i + 8])],
parameters=self.type_lists[
cast(FileOffset, self._parse_ui... | |
#!/usr/bin/python
"""
(C) Copyright 2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
from logging import getLogger
from ClusterShell.NodeSet import NodeSet
class TelemetryUtils():
# pylint: disable=too-many-nested-blocks
"""Defines a object used to verify telemetry information."""
ENGINE_... | |
nan ],
[ 810, 27.8132, 0.1891, 33.0672, 0.1590, 36.2760, 0.1450, 6.2147, 0.8461, 2.16e-15, 1.98e-15, 2.11e-15, nan ],
[ 820, 28.2188, 0.1910, 33.6859, 0.1600, 36.1652, 0.1490, 6.2148, 0.8671, 2.23e-15, 2.21e-15, 2.10e-15, nan ],
[ 830, 28.7670, 0.1919, 34.5118, 0.1600, 37.0519, 0.1490, 6.1770, 0.8938, 2.17e-15, 2.30... | |
<filename>dev/lum_eff.py
import numpy as np
import matplotlib.pyplot as plt
from dev.output import getO
from wmpl.PythonNRLMSISE00.nrlmsise_00_header import *
from wmpl.PythonNRLMSISE00.nrlmsise_00 import *
from wmpl.Utils.TrajConversions import jd2Date, jd2LST
from wmpl.MetSim.MetSimErosionCyTools import *
from wmp... | |
import tensorflow as tf
import numpy as np
from utils import unroll_data
import keras
from keras.models import Sequential
from keras.layers import Dense, Activation, SimpleRNN, GRU, Dropout, LSTM, LeakyReLU, Lambda
from keras.initializers import glorot_uniform # Or your initializer of choice
from keras import regulariz... | |
All inherited terms by all these terms will be added in this function
using the provided ontology object so that each node will be represented by the union of all
the terms inherited by the terms annotated to it. After that step, the term IDs are simply
treated as words in a vocabulary, and the same approach as w... | |
{
atomicAdd(&(NNZ_EACH_ROW[m_c+1]), 1);
FLAGS[i+1] = 1;
C_DATA = (C)(A_DATA[i_a] * B_DATA[i_b]);
C_INDICES = n_c;
}
''',
'cupy_multiply_by_csr_step1',
preamble=_GET_ROW_ID_ + _FIND_INDEX_HOLDING_COL_IN_ROW_
)
@cupy._util.memoize(for_each_device=True)
def cupy_multiply_by_csr_step2():
return cupy.Elementwise... | |
<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/courseware/tests/test_access.py
"""
Test the access control framework
"""
import datetime
import itertools
from unittest.mock import Mock, patch
import pytest
import ddt
import pytz
from ccx_keys.locator import CCXLoc... | |
from build.management.commands.base_build import Command as BaseBuild
from build.management.commands.build_homology_models_zip import Command as UploadModel
from django.db.models import Q
from django.conf import settings
from protein.models import Protein, ProteinConformation, ProteinAnomaly, ProteinState, ProteinSegm... | |
<reponame>ttagu99/naver_hack<filename>main_secls.py<gh_stars>1-10
# -*- coding: utf_8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import argparse
import time
import nsml
import numpy as np
from nsml import DATASET_PATH
import keras
from k... | |
<filename>emd_waveform_fig345.py
#!/usr/bin/python
# vim: set expandtab ts=4 sw=4:
# %% -----------------------------------------------------
#
# This script runs the simulations and analysis of the noisy 12Hz oscillator
# seen in figures 3, 4 and 5. The oscillation is generated and some general EMD
# and wavelet fre... | |
, _ ("dec") : 12, _ ("december") : 12, 12 : "dec"
}
_Type = datetime.date
_default_format = "%Y-%m-%d"
_kind = "date"
_init_arg_names = ("year", "month", "day")
_timetuple_slice = lambda s, tt : tt [:3]
date_pattern = Multi_Regexp \
( r"(?P<year> \d{4,4})"
r"([-/]?)"
r"(?P<month> \d{2,2})"
r"\2"
r"(?P<day... | |
<reponame>hitliaomq/pyemto<filename>pyemto/latticeinputs/latticeinputs.py
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 3 14:25:06 2014
@author: <NAME>
@author: <NAME>
"""
import sys
import numpy as np
import pyemto.common.common as common
class Latticeinputs:
"""Class which is used to communicate with the Bmdl,... | |
<filename>tilings/strategies/requirement_placement.py
import abc
from collections import defaultdict
from functools import reduce
from itertools import chain, product
from typing import Dict, Iterable, Iterator, List, Optional, Set, Tuple, cast
from comb_spec_searcher import DisjointUnionStrategy, StrategyFactory
from... | |
<reponame>jfarrimo/lol-logwatcher
#!/usr/bin/env python
'''
Copyright (c) 2012 Lolapps, 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 copy... | |
", MOmega0, " and peak duration ", nrwf.internal_EstimatePeakL2M2Emission[key[0]][key[1]])
except:
good_sim = good_sim_list[0] # pick the first one. Note we will want to reduce /downselect the lookup process
group = good_sim[0]
param = good_sim[1]
else:
group = NR_group
param = NR_param
print(" Identified match... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.