input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
sess.run(variables.global_variables_initializer())
sess.run(infeed_queue.initializer)
report_json.parse_log()
sess.run(r, {c: 10.01})
losses_pipeline = sess.run(outfeed_op)
self.assertAllClose(losses_pipeline, [
410.01, 730.01, 650.01, 570.01, 890.01, 410.01, 730.01, 650.01,
570.01, 890.01, 410.01, 730.01
])
r... | |
# Copyright 2019 Nokia
# Copyright 2020 ENEA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | |
<reponame>akuala/REPO.KUALA
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 <NAME>(liris)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the ... | |
.. attribute:: traceroute_cache
Information about a particular traceroute operation
**type**\: list of :py:class:`TracerouteCache <ydk.models.cisco_ios_xr.Cisco_IOS_XR_ethernet_cfm_oper.Cfm.Global.TracerouteCaches.TracerouteCache>`
"""
_prefix = 'ethernet-cfm-oper'
_revision = '2017-10-06'
def __ini... | |
wait
"""
operation_result = None
try:
operation_result = self.client.delete_security_assessment(security_assessment_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait... | |
<reponame>CDAT/vcs<filename>vcs/animate_helper.py
import vcs
import copy
import warnings
import numpy
import os
import time
import _thread
import threading
import glob
from .error import vcsError
def showerror(msg):
raise Exception(msg)
#############################################################################
... | |
import os
import copy
import datetime
import numpy as np
import xarray as xr
import pandas as pd
from collections import Counter
from ahh.ext import (round_to, get_order_mag, report_err, lonw2e)
from ahh.sci import get_stats, get_norm_anom, get_anom, get_norm
from ahh.era import td2dict
import matplotlib as mpl
import ... | |
m in mode
for l in level
for t in tstart
for v in version
]
else:
fnames = ['_'.join((s, i, m, l, o, t, 'v'+v+'.cdf'))
for s in sc_ids
for i in instr
for m in mode
for l in level
for o in optdesc
for t in tstart
for v in version
]
return fnames
def construct_path(*args, data_type='science', **kwargs):
... | |
import argparse
from abc import abstractmethod
import copy
from tsut.api import SyncUserAndGroups
from tsut.model import UsersAndGroups
from tsut.io import UGXLSWriter, UGXLSReader
"""
Converts from non-TS DDL to TS DDL. $ convert_ddl.py --help for more details.
Copyright 2017-2018 ThoughtSpot
Permission is hereby ... | |
-1
return q
@staticmethod
def Euler2Rodrigues(euler):
"""Compute the rodrigues vector from the 3 euler angles (in degrees).
:param euler: the 3 Euler angles (in degrees).
:return: the rodrigues vector as a 3 components numpy array.
"""
(phi1, Phi, phi2) = np.radians(euler)
a = 0.5 * (phi1 - phi2)
b = 0.5 * ... | |
<filename>pysimplemp/map.py<gh_stars>0
#! /usr/bin/env python3
# Copyright (c) 2020 <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 limitation ... | |
# PBNT: Python Bayes Network Toolbox
#
# Copyright (c) 2005, <NAME>
# 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 the above copyright
... | |
+ " Changing active User on next reboot to: " + user)
self.agent_object.send("application " + self.module_name + " " + str(self.window_id) + " busy")
subprocess.call(["CMD", "/c", "reg", "ADD", logon_path, "/v", "AutoAdminLogon", "/t", "REG_SZ", "/d", "1", "/f"])
subprocess.call(["CMD", "/c", "reg", "ADD", logon_pat... | |
import numpy as np
from astropy import units as u
from einsteinpy import constant, metric
from einsteinpy.coordinates.conversion import (
BoyerLindquistConversion,
CartesianConversion,
SphericalConversion,
)
from einsteinpy.coordinates.utils import v0
from einsteinpy.utils import CoordinateError
_c = constant.c.va... | |
<filename>conda_build/api.py
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
"""
This file defines the public API for conda-build. Adding or removing f... | |
"""
This module contains the `PostProcessor` class.
It contains all advanced postprocessing functionalities that require Python 3.x packages like NumPy and Matplotlib.
"""
from __future__ import absolute_import # noreorder
import math
import os
import time
import warnings
from pyaedt.generic.general_methods import i... | |
\
(1 - self.beta_2 ** (self.iterations + 1))
bias_cache_corrected = layer.bias_cache / \
(1 - self.beta_2 ** (self.iterations + 1))
# Vanilla SGD parameter update + normalization
# with square rooted cache
layer.weights += -self.current_learning_rate * \
weight_momentums_corrected / \
(np.sqrt(weight_cache_cor... | |
<filename>python/sxlParser.py
# Generated from sxl.g4 by ANTLR 4.7
# encoding: utf-8
from antlr4 import *
from io import StringIO
from typing.io import TextIO
import sys
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\63")
buf.write("\u00e4\4\2\t\2\4\3\t\... | |
"""
SiliconLife Eyeflow
WS-Edge client functions
Author: <NAME>
"""
import os
from subprocess import call
from pathlib import Path
import datetime
import json
import cv2
import requests
import tarfile
import jwt
from eyeflow_sdk.log_obj import CONFIG, log
from eyeflow_sdk.img_utils import resize_image_scale
# ------... | |
<gh_stars>1-10
''' This module contains classes that implement various
objects for storing solutions.
Attributes:
_solution_id (int): global variable used for generating
solution IDs.
'''
from pulp import LpStatus, LpStatusOptimal
import pickle
import os
from pyDEA.core.utils.dea_utils import is_efficient, TMP_F... | |
<gh_stars>0
"""
Lunchable Plugin for Splitwise
"""
import datetime
import logging
from math import floor
from os import getenv
from random import shuffle
from textwrap import dedent
from typing import Any, Dict, List, Optional, Tuple, Union
from lunchable import __lunchable__, LunchMoney
from lunchable.exceptions imp... | |
l = getattr(pkt, self.fld)
# l = (l*8)-self.shift
# i = self.m2i(pkt, s[:l])
# return s[l:],i
# class _AHICVStrLenField(StrLenField):
# def i2len(self, pkt, x):
# class IPv6ExtHdrAH(_IPv6ExtHdr):
# name = "IPv6 Extension Header - AH"
# fields_desc = [ ByteEnumField("nh", 59, ipv6nh),
# _AHFieldLenField("len", Non... | |
outliers_3d_arr_for_i)]
outliers_explanation_arr = [x + y for x, y in zip(outliers_explanation_arr, outliers_explanation_arr_for_i)]
column_combos_checked += column_combos_checked_for_i
#print("outliers_3d_arr_for_i: ", outliers_3d_arr_for_i.count(0), outliers_3d_arr_for_i.count(1))
else:
for i in range(num_cols):... | |
<reponame>dbuscombe-usgs/XBD-hurricanes<gh_stars>1-10
# Written by Dr <NAME>, Marda Science LLC
#
# MIT License
#
# Copyright (c) 2020, Marda Science LLC
#
# 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 ... | |
= ' + '
else:
joiner = ', '
matchers = joiner.join(repr(m) for m in self.matchers)
args = ['{matchers}'.format(matchers=matchers)]
if self.separated_by is not None:
args.append('sep={self.separated_by!r}'.format(self=self))
args.extend(super(AutoSequence, self).__repr__(args_only=True))
if args_only:
return a... | |
o rfi = r<
label(X,Z,rp) :- label(X,Y,rp), label(Y,Z,rfi).
% rp o rm = r<
label(X,Z,rp) :- label(X,Y,rp), label(Y,Z,rm).
% rp o rmi = r< d s m o
label(X,Z,rp) | label(X,Z,rd) | label(X,Z,rs) | label(X,Z,rm) | label(X,Z,ro) :- label(X,Y,rp), label(Y,Z,rmi).
% rp o ro = r<
label(X,Z,rp) :- label(X,Y,rp), label(Y,Z,ro... | |
<reponame>luci/luci-py
#!/usr/bin/env vpython3
# Copyright 2013 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
from __future__ import print_function
from __future__ import unicode_literals
import base64
import... | |
# Copyright 2021 The FastEstimator 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 applicab... | |
<gh_stars>0
##
# File: MMseqsUtils.py
# Author: <NAME>
# Date: 26-Oct-2020
#
# Updates:
#
##
"""
./mmseqs/bin/mmseqs easy-search adalimumab.fasta db/db_pdb_entity entityResult.txt tmp
--min-seq-id 0.75
--format-output "query,target,pident,evalue,qlen,tlen,alnlen,taxid,taxname"
# ---
./mmseqs/bin/mmseqs createdb ./FAST... | |
(tmp1 + tmp2)
# # tmp1 = dic1[ii+1] + dic1[ii]
# # term1 = term1 + 1/(2*h) * (dic1[ii+1] - dic1[ii])**2 + h/2 * (1 - tmp1**2)**2
# term2 = 0.0
# for ii in np.arange(int(args.input_dim/2),int(args.input_dim),1):
# term2 = term2 + 1*dic1[ii]**2/2
# H = term1 + term2
#******** nD <NAME> #********
# dic1 = np.spli... | |
Position'
else:
okTxt = 'Ok for loaded Positions'
okButton = widgets.okPushButton(okTxt)
okButton.setToolTip(
'Save metadata only for current positionh'
)
okButton.setShortcut(Qt.Key_Enter)
self.okButton = okButton
if ask_TimeIncrement or ask_PhysicalSizes:
okAllButton = QPushButton('Apply to ALL Positions')... | |
<reponame>AngCamp/Stienmetz2019Reanalyzed
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 3 23:08:38 2022
@author: angus
YET TO BE RUN TAKES A VERY LONG TIME, MAY NEED TO BE CHANGED TO REPORT WHICH TESS ARE
BEING PASSED
Please Note all functions here assume all times tested will be within trial
intervals w... | |
# Copyright 2019 The Glow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | |
import numpy as np
import pandas as pd
import collections
from . import arrops
from .region import parse_region, regions_add_name_column
_rc = {
'colnames':{
'chrom':'chrom',
'start':'start',
'end':'end'
}
}
def _get_default_colnames():
return _rc['colnames']['chrom'], _rc['colnames']['start'], _rc['colnames'... | |
<filename>tests/test_views.py
# -*- coding: utf-8 -*-
"""Tests for core functions."""
import datetime
import json
import logging
import os
import re
import sys
import time
from io import BytesIO
from itertools import product
from unittest.mock import MagicMock, Mock, patch
from urllib.parse import parse_qs, quote, url... | |
<filename>f5/bigip/tm/security/test/functional/test_nat.py
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | |
the ground truth
fg_mask = tf.reduce_max(iou, axis=1) >= config.fastrcnn_fg_thres # 0.5
# [K_FG] # index of fg_mask true element
fg_inds = tf.reshape(tf.where(fg_mask), [-1])
num_fg = tf.minimum(
int(config.fastrcnn_batch_per_im * fg_ratio), tf.size(fg_inds))
# during train time, each time random sample
# so the... | |
<filename>larch/wxxas/exafs_panel.py<gh_stars>0
#!/usr/bin/env python
"""
Linear Combination panel
"""
import os
import time
import wx
import numpy as np
from functools import partial
from collections import OrderedDict
from larch.math import index_of
from larch.wxlib import (BitmapButton, FloatCtrl, FloatSpin, Togg... | |
height=3)
GoToNCCounties_OP25.grid(row=0, column=5, sticky=tk.W+tk.E+tk.N+tk.S, padx=9, pady=5)
Button_Bath = tk.Button(master=back, text='Bath', command=CMD_Bath, width=14, height=3)
Button_Bath.grid(row=1, column=1, sticky=tk.W+tk.E+tk.N+tk.S, padx=9, pady=5)
Button_Chocowinity = tk.Button(master=back, text='Choc... | |
dir_name = os.path.join(self.model_dir, dir_names[-1])
# Find the last checkpoint
checkpoints = next(os.walk(dir_name))[2]
checkpoints = filter(lambda f: f.startswith("mmid"), checkpoints)
checkpoints = sorted(checkpoints)
if not checkpoints:
import errno
raise FileNotFoundError(
errno.ENOENT, "Could not find w... | |
<reponame>MarcoFerrari128/Portfolio<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import ode
import FLC
import pyprind
from numpy.linalg import eig
import pandas as pd
def impulse(lenght):
i = 0
Impulse = []
while i < lenght:
if i == 99:
Impulse.append(1)
else:
Impulse.appe... | |
<reponame>shazz/shazzam
from shazzam.optimizer.MemorySegment import MemorySegment
from shazzam.optimizer.Part import Part
from shazzam.optimizer.Bank import Bank
import copy
from enum import Enum
from typing import List, Tuple
import logging
class Heuristics():
def __init__(self, segments: List[MemorySegment], par... | |
"▁Así": 37752,
"▁BRU": 37753,
"▁Eldre": 37754,
"▁Gottes": 37755,
"▁Grecia": 37756,
"▁Grön": 37757,
"▁Kuva": 37758,
"▁Libri": 37759,
"▁Mikro": 37760,
"▁Prva": 37761,
"▁Rumah": 37762,
"▁Sozial": 37763,
"▁Sumatera": 37764,
"▁Tekst": 37765,
"▁Theorie": 37766,
"▁accessori": 37767,
"▁chanson": 37768,
"▁collo... | |
<gh_stars>0
#!/usr/local/bin/python3
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import scipy
from scipy.optimize import leastsq
import datetime
# from matplotlib import pyplot
from scipy.stats import chisquare
# import os
import sys
sys.path.append('../..')
from covid_fit.fit_functions.fun... | |
# @date 2018-08-08
# @author <NAME>, All rights reserved without prejudices.
# @license Copyright (c) 2018 Dream Overflow
# Trader position
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Union
if TYPE_CHECKING:
from .trader import Trader
from .market import Market
from common.keyed... | |
<reponame>evfredericksen/StardewBot
# import time
import re
import functools
import async_timeout
import contextlib
import traceback
import weakref
import functools
import queue
import sys
import asyncio
import threading
import uuid
import json
import server
from dragonfly import *
from srabuilder import rules
import ... | |
yZero startX
self.ctx.close_path()
self.ctx.clip()
def consolidateDataPoints(self):
numberOfPixels = self.graphWidth = (
self.area['xmax'] - self.area['xmin'] - (self.lineWidth + 1))
for series in self.data:
numberOfDataPoints = self.timeRange / series.step
minXStep = float(self.params.get('minXStep', 1.0))
d... | |
plans could be made.
"""
class TaskPlanner(AbstractClass):
"""Produces plans to control execution of a paired task."""
class Error(Exception):
"""Indicates an error creating a product plan for a subject."""
@classmethod
def iter_configured_dependencies(cls, subject):
"""Return an iterator of the given subjec... | |
<reponame>brunosmmm/hdltools<gh_stars>1-10
"""High-level coding using python syntax to build HDL structures."""
import inspect
import ast
import textwrap
import sys
import re
from collections import deque
from hdltools.abshdl import HDLObject
from hdltools.abshdl.expr import HDLExpression
from hdltools.abshdl.signal i... | |
# Copyright (c) 2020 <NAME>
# Licensed under the MIT License
import datetime
import json
import os
import re
from urllib.parse import unquote
import aiohttp
import asyncpg
from bs4 import BeautifulSoup as Bs4
GAME_YEAR_OFFSET = 1286
async def upgrade():
old_settings = await fetch_settings()
try:
old = old_setti... | |
repository and then a file
# external into that.
ext = "^/A/D A/D-copy\n" + \
"^/A/B/E/beta A/D-copy/G/beta\n"
change_external(wc_dir, ext)
# Bring the working copy up to date and check that the file the file
# external is switched to still exists.
svntest.actions.run_and_verify_svn(None, None, 'svn: E205011: '... | |
specific pgp roles are
defined, we try to send encrypted mail to *all* users
*including* cc, bcc, cc_emails and bcc_emails and this might
fail if not all the keys are available in roundups keyring.
"""
encrypt = self.db.config.PGP_ENABLE and self.db.config.PGP_ENCRYPT
pgproles = self.db.config.PGP_ROLES
if msgid... | |
<reponame>SDRAST/Data_Reduction
# -*- coding: utf-8 -*-
"""
Classes for GAVRT mysql database
Example
=======
DBPlotter (from Data_Reduction.DSN.GAVRT.Mysql.plotter) is used to reduce data
stored in the LCER GAVRT MySQL database. The following example gets the
coordinate data for a map made during a given session::
... | |
for instrument in [parts3[0],
parts3[0].replace("-"," "),
parts3[0].replace(" ","-")]:
if instrument not in GM_PERCUSSIVE_NAMES:
if instrument in GM_NONSTANDARD_PERCUSSIVE_NAMES:
notenum = GM_PERCUSSIVE_NAMES.index(GM_NONSTANDARD_PERCUSSIVE_NAMES[instrument])+27
else:
continue
else:
notenum = GM_PERCUSSIVE_NA... | |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
Register 30 : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
Register 31 : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
After exec... | |
<reponame>veatch/great_expectations
import os
from typing import Dict, List
import pandas as pd
import pytest
try:
sqlalchemy = pytest.importorskip("sqlalchemy")
except ImportError:
sqlalchemy = None
from ruamel.yaml import YAML
import great_expectations.exceptions as ge_exceptions
from great_expectations.core.ba... | |
da.assign_attrs().long_name})
return_anomaly.rename(da.name)
return return_anomaly
def remove_duplicate_list(mylist: list) -> list:
"""
Remove Duplicates From a Python list
:param mylist:
:return:
"""
list_return = list(dict.fromkeys(mylist))
return list_return
def plot_geo_subplot_map(geomap, vmin, vm... | |
<reponame>oscovida/oscovida
import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pytest
import oscovida as c
import oscovida.plotting_helpers as oph
def assert_oscovida_object(ax, cases, deaths):
assert isinstance(ax, np.ndarray)
assert isinstance(cases, (pd.Series, pd.DataF... | |
"""
A helper module containing a class to keep track of vectors in different
coordinate systems.
"""
from typing import Any, List, Optional, Sequence, Type, TypeVar, Union
import numpy as np
from typing_extensions import Literal
NormOrder = Union[None, float, Literal["fro"], Literal["nuc"]]
T = TypeVar("T", bound="... | |
'''
INN: Inflated Neural Networks for IPMN Diagnosis
Original Paper by <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>
(https://link.springer.com/chapter/10.1007/978-3-030-32254-0_12, https://arxiv.org/abs/1804.04241)
Code written by: <NAME>
If you use significant portions of this code or the ideas from ... | |
%s") % str(e))
return local_hostname
def get_mate_controller_hostname(hostname=None):
if not hostname:
try:
hostname = socket.gethostname()
except Exception as e:
raise exception.InventoryException(_(
"Failed to get the local hostname: %s") % str(e))
if hostname == k_host.CONTROLLER_0_HOSTNAME:
mate_hostnam... | |
<gh_stars>1-10
# coding: utf-8
"""
DocuSign Click API
DocuSign Click lets you capture consent to standard agreement terms with a single click: terms and conditions, terms of service, terms of use, privacy policies, and more. The Click API lets you include this customizable clickwrap solution in your DocuSign integr... | |
<reponame>konradotto/TS
############################################################################
# Copyright (c) 2011-2014 Saint-Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
############################################################################
from libs import qconfig... | |
<filename>contagion/state_machine.py
# -*- coding: utf-8 -*-
"""
Name: state_machine.py
Authors: <NAME>, <NAME>, <NAME>
Base implementation of states, conditions, transitions and the state machine.
"""
from __future__ import annotations
import abc
from collections import defaultdict
from copy import deepcopy
import ... | |
= pygame.Color(*color_args)
new_color_obj = pygame.Color(color_obj)
self.assertIsInstance(new_color_obj, pygame.Color)
self.assertEqual(new_color_obj, color_obj)
self.assertEqual(new_color_obj.r, color_args[0])
self.assertEqual(new_color_obj.g, color_args[1])
self.assertEqual(new_color_obj.b, color_args[2])
se... | |
# Copyright 2015 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
An input.
op (str): 'sum' or 'mean'.
Note:
This is deprecated. Use ``mean`` or ``sum`` instead.
"""
import warnings
warnings.warn(
"Deprecated API. Use ``sum`` or ``mean`` instead.", DeprecationWarning)
from .function_bases import reduce_sum, reduce_mean
if op == 'sum':
return reduce_sum(x)
elif op == 'mea... | |
<filename>app/app/services/entry.py
import os
import shutil
from datetime import datetime
from logging import getLogger
from os import makedirs
from os.path import isdir, isfile, join
from typing import Dict, List, Optional, Union, Literal, Set
from uuid import UUID
from PIL import Image
from fastapi import UploadFile... | |
self._in_repo.cmd(release.rm_rf_cmd("html"))
def _make_test_step(self, env, **kwds):
test_cmd = self._make_test_cmd(**kwds)
def test_step(log):
env.cmd(test_cmd)
return test_step
def _make_easy_install_test_cmd(self, **kwds):
test_cmd = self._make_test_cmd(**kwds)
test_cmd.extend(["discover", "--start-directo... | |
# -*- coding: utf-8 -*-
import csv
import mimetypes
import time
from math import ceil
from urllib.parse import urljoin, urlparse
from sqlalchemy import func, Table
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm import aliased
from sqlalchemy.sql.expression import desc
from werkzeug import secure_filena... | |
self._check_for_injections(repo)
all_repos = self.list_repos()
if repo not in all_repos:
raise LookupError('Invalid repository name: %s' % (repo))
query = ('SELECT table_name FROM information_schema.tables '
'WHERE table_schema = %s '
'AND table_type = \'VIEW\';')
params = (repo,)
res = self.execute_sql(que... | |
from collections import OrderedDict
import os
import re
from xml.etree import ElementTree as ET
import openmc.checkvalue as cv
from openmc.data import NATURAL_ABUNDANCE, atomic_mass, \
isotopes as natural_isotopes
class Element(str):
"""A natural element that auto-expands to add the isotopes of an element to
a ma... | |
<gh_stars>0
# Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator Authors
# licensed under the Apache license, Version 2.0
# cf. 3rd-party-licenses.txt file in the... | |
2), (2, 3), (3, 3))
paddingsizes = ((2, 2), (2, 1), (2, 2))
# average_inc_pad and average_exc_pad do not
# support grad with padding
for mode in ['max', 'sum']:
for i in range(len(imgsizes)):
imgsize = imgsizes[i]
imval = rng.rand(1, 1, imgsize[0], imgsize[1]) * 10.0
maxpoolsize = maxpoolsizes[i]
stridesize = ... | |
file
temp_prefix = "dss-test-operations-iam-aws-list-users-temp-output"
f, fname = tempfile.mkstemp(prefix=temp_prefix)
iam_client.get_paginator.return_value = MockPaginator_UserPolicies()
kwargs = _get_aws_list_policies_kwargs(group_by="users", output=fname, force=True)
iam.list_policies([], argparse.Namespace(**... | |
"""
A simple music bot in Python using disnake-ext-music library
"""
import disnake
import argparse
import asyncio
import os
import youtube_dl
from typing import Any, Dict, Tuple, Union
from youtube_search_requests import AsyncYoutubeSearch, AsyncYoutubeSession
from disnake.ext import commands
from disnake.ext.music.v... | |
<reponame>reed9999/slowgames<filename>few_acres_of_snow/few_acres_classes.py
# vim: set fileencoding=utf-8 :
"""History and Analyzer classes specific to A Few Acres of Snow
"""
import time
from enum import Enum
import logging
import pprint
from game_controller import GameController, Fw1GameHistory
logging.basicConfig... | |
<reponame>jmschrei/discern<filename>analysis/synthetic_analyses.py
# synthetic_analyses.py
# Contact: <NAME>
# <EMAIL>
'''
These tests will show the difference between DISCERN, ANOVA, and LNS
on pairs of synthetic Bayesian networks. You can build your own Bayesian
networks by hand (three examples shown below) and then... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
encoding = "utf-8"
import os
import sys
import random
import datetime
import time
import gc
from future.builtins import input
import pickle as pickle
# import shelve
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize
from textblob import TextB... | |
r21c14 + '</td>' + \
'<td>' + r21c15 + '</td>' + \
'<td>' + r21c16 + '</td>' + \
'<td>' + r21c17 + '</td>' + \
'</tr>' + \
'<tr>' + \
'<td>Total budget income</td>' + \
'<td>' + r22c1 + '</td>' + \
'<td>' + r22c2 + '</td>' + \
'<td>' + r22c3 + '</td>' + \
'<td>' + r22c4 + '</td>' + \
'<... | |
same dimensional output
Returns
-------
TensorVariable
symbolically applied operator
"""
raise NotImplementedError
def __call__(self, f=None):
if self.has_test_function:
if f is None:
raise ParametrizationError('Operator %s requires TestFunction' % self)
else:
if not isinstance(f, TestFunction):
f = Test... | |
<filename>frb/halos/hmf.py
import warnings
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as IUS
from astropy import units
from astropy.cosmology import Planck15 as cosmo
from astropy import constants
from astropy.cosmology import z_at_value
from astropy.table import Table
from frb.hal... | |
<reponame>Sweepertank/AutoSky
import os.path
import sys
import json
import PyVMF_for_AutoSky.src.PyVMF as PyVMF
import builtinmodelreplace
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.messagebox as messagebox
import tkinter.filedialog as filedialog
import time
import threading
import traceback
#The ap... | |
from typing import List, Dict, Optional, Union
import os
import re
import sys
import json
import shutil
import tempfile
from pathlib import Path
from subprocess import Popen, PIPE
from types import SimpleNamespace
from bs4 import BeautifulSoup
from common_pyutil.system import Semver
from .components import (title_file... | |
import os
import numpy as np
import pandas as pd
import warnings
warnings.filterwarnings('ignore',
message='PyTorch is not compiled with NCCL support')
import torch
import torch.optim as optim
import matplotlib.pyplot as plt
from time import time
from datetime import datetime
from torch import nn
from sklearn.me... | |
from collections import defaultdict
from typing import Dict, List, Set, Callable, TYPE_CHECKING
from copy import copy
from vnpy.trader.object import (
TickData, TradeData, OrderData, ContractData, BarData
)
from vnpy.trader.constant import Direction, Status, Offset, Interval, OrderType
from vnpy.trader.utility import... | |
from ..util import cached, search, llist, WeakRefProperty, SourceError
from ..containers.basereader import Track
import threading
import numpy
from collections import OrderedDict
from itertools import count
from copy import deepcopy
import weakref
def notifyIterate(iterator, func):
for item in iterator:
func(item)
... | |
<gh_stars>100-1000
# coding=utf-8
# Author: <NAME> Cruz <<EMAIL>>
#
# License: BSD 3 clause
import numpy as np
from deslib.base import BaseDS
from deslib.util.aggregation import majority_voting_rule
from deslib.util.diversity import negative_double_fault, Q_statistic, \
ratio_errors, compute_pairwise_diversity
cl... | |
if stderr:
logfile.error(stderr)
sys.exit(1)
def evmGFFvalidate(input, evmpath, logfile):
Validator = os.path.join(evmpath, 'EvmUtils', 'gff3_gene_prediction_file_validator.pl')
cmd = ['perl', Validator, os.path.realpath(input)]
logfile.debug(' '.join(cmd))
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
... | |
"Select"))
self.ss7i70in_42.setText(_translate("mainWindow", "Select"))
self.ss7i70in_43.setText(_translate("mainWindow", "Select"))
self.ss7i70in_44.setText(_translate("mainWindow", "Select"))
self.ss7i70in_45.setText(_translate("mainWindow", "Select"))
self.ss7i70in_46.setText(_translate("mainWindow", "Select"))... | |
KinesisDataAnalyticsApp:
current_state = None
changed = False
def __init__(self, module):
self.module = module
if not HAS_BOTO3:
self.module.fail_json(msg="boto and boto3 are required for this module")
self.client = boto3.client("kinesisanalytics")
@staticmethod
def _define_module_argument_spec():
return di... | |
tmp2372 = (1 if action2_1 else tmp2373)
tmp2371 = (1 if action3_1 else tmp2372)
tmp2370 = (tmp2371 if action4_1 else 0)
tmp2378 = (1 - (1 if action1_1 else 0))
tmp2377 = (tmp2373 if action2_1 else tmp2378)
tmp2379 = (1 if action2_1 else tmp2378)
tmp2376 = (tmp2377 if action3_1 else tmp2379)
tmp2375 = (1 if actio... | |
<filename>samples/rock/rock_coco_eval.py<gh_stars>0
__author__ = 'tsungyi'
import copy
from collections import defaultdict
import datetime
import numpy as np
import time
from pycocotools.cocoeval import COCOeval
from pycocotools import _mask
def bbox_to_ellipse(bbox):
xmin, ymin, xmax, ymax, ang = bbo... | |
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
their distance along the boundary.
edge_things = []
# Get the boundary as a LineString of the correct orientation
# so we can compute distances along it.
if is_ccw:
boundary = self.ccw_boundary
else:
boundary = self.cw_boundary
def boundary_distance(xy):
return boundary.project(sgeom.Point(*xy))
# Squash a... | |
<gh_stars>0
# coding=utf-8
# Copyright 2022 The HuggingFace Team The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | |
'GET' or request.method == 'POST':
sign_record = signRecord.SignRecord()
sign_records = sign_record.find_by_attr("link_id", link_id)
if not sign_records:
records_len = 0
else:
records_len = len(sign_records)
return render_template('view_sign_records.html', error=error, sign_records=sign_records,
records_len=re... | |
calibration such that more than x (e.g. 1) active neuron on a layer will inhibit the layer
In_h = []
if(inhibitionAlgorithmBinary):
Nactive = {} #effective bool [1.0 or 0.0]; whether neuron is active/inhibited
if(learningAlgorithmIndependenceReset):
Bindependent = {} #independent neurons previously identified #ef... | |
# [ms_Vals[aind], ms_const] = np.polyfit(Pinf_ms, Einf_1stderiv_ms, deg=1)
# Pcrit_norm = Pcrit / (mI * nu)
# Pcrit_tck = interpolate.splrep(aIBi_Vals, Pcrit_norm, s=0, k=3)
# aIBi_interpVals = np.linspace(np.min(aIBi_Vals), np.max(aIBi_Vals), 5 * aIBi_Vals.size)
# Pcrit_interpVals = 1 * interpolate.splev(aIBi_int... | |
: ( 34670, 34671 ),
"DR23a1" : ( 34671, 34672 ),
"DR23a2" : ( 34672, 34673 ),
"DR23a3" : ( 34673, 34674 ),
"DR23a4" : ( 34674, 34675 ),
"DR23a5" : ( 34675, 34676 ),
"DR23a6" : ( 34676, 34677 ),
"DR23a6_specify" : ( 34677, 34757 ),
"DR23AgeOns" : ( 34757, 34759 ),
"DR23Ons" : ( 34759, 34760 ),
"DR23AgeRec" : (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.