input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>flask_generic_views/__init__.py
# -*- coding: utf-8 -*-
"""
flask.ext.generic_views
~~~~~~~~~~~~~~~~~~~~~~~
Flask-GenericViews (FGV) provides view abstraction for common CRUD
operations. Each CRUD operation has its own view for example:
- show details of an object (ShowView)
- create an object (Create... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import tensorflow as tf
import layer_utils
import match_utils
class SentenceMatchModelGraph(object):
"""
Create Natural Language Sentence Matching Models.
-- sentence-sentence pairs
-- question-answer pairs
-- premise-hypothesis pairs
"""
def __init__(self, num_classes, ... | |
indicate an unsupported platform. The user can still
# set up the host using the headless setup flow, where we can at least display
# a warning. See https://gitlab.gnome.org/GNOME/gdm/-/issues/580 for details
# of the bug and fix.
if display_manager_is_gdm():
return False;
# The session chooser expects a Debian-... | |
& e0, SimTK::Vec< 2 >::E const & e1, SimTK::Vec< 2 >::E const & e2, SimTK::Vec< 2 >::E const & e3, SimTK::Vec< 2 >::E const & e4, SimTK::Vec< 2 >::E const & e5, SimTK::Vec< 2 >::E const & e6) -> Vec2
Parameters
----------
e0: SimTK::Vec< 2 >::E const &
e1: SimTK::Vec< 2 >::E const &
e2: SimTK::Vec< 2 >::E const &... | |
<reponame>Natsurii/nicabot-monkee
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Nekozilla 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 ver... | |
"""
Basic visualization of neurite morphologies using matplotlib.
Usage is restricted to morphologies in the sWC format with the three-point soma `standard <http://neuromorpho.org/neuroMorpho/SomaFormat.html>`_
"""
import sys,time
import os, sys
from matplotlib.cm import get_cmap
from Crypto.Protocol.AllOrNothing imp... | |
class LenStringArray(AbstractTemplate):
# def generic(self, args, kws):
# if not kws and len(args)==1 and args[0]==string_array_type:
# return signature(types.intp, *args)
# XXX: should these be exposed?
# make_attribute_wrapper(StringArrayType, 'num_items', 'num_items')
# make_attribute_wrapper(StringArrayType, 'num_... | |
to match input from function
# The second piece of information this script returns is the number of
# genes with >m mutations
for j in range(max_muts_per_gene_to_track):
expectedNumberOfGenesWithNmutations[i,j] = sum( sim_mutspergene >= j+1 ) # +1 due to 0-based
return [expectedNumberGenesMultipleMutations, ex... | |
test_post_ldp_nr(self, rnd_img):
"""
POST a resource with binary payload and verify checksums.
"""
rnd_img['content'].seek(0)
resp = self.client.post('/ldp/', data=rnd_img['content'],
headers={
'slug': 'ldpnr04',
'Content-Type': 'image/png',
'Content-Disposition' : 'attachment; filename={}'.format(
rnd_img['f... | |
m.b264 <= 1)
m.c494 = Constraint(expr= m.b39 - m.b40 + m.b265 <= 1)
m.c495 = Constraint(expr= m.b39 - m.b41 + m.b266 <= 1)
m.c496 = Constraint(expr= m.b39 - m.b42 + m.b267 <= 1)
m.c497 = Constraint(expr= m.b39 - m.b43 + m.b268 <= 1)
m.c498 = Constraint(expr= m.b39 - m.b44 + m.b269 <= 1)
m.c499 = Constraint(expr= ... | |
<reponame>mt-software-de/wodoo<filename>wodoo/lib_module.py
import sys
import threading
import json
import base64
import subprocess
import inquirer
from git import Repo
import traceback
from datetime import datetime
import shutil
import os
import tempfile
import click
from .tools import get_hash
from .tools import get_... | |
from JumpScale import j
import JumpScale.baselib.remote
import sys
# import importlib
import imp
try:
import ujson as json
except:
import json
import JumpScale.baselib.redis
import copy
import time
import JumpScale.baselib.webdis
from fabric.api import hide
import time
redis=j.clients.redis.getRedisClient("127.0.0... | |
'2HG2', 'HG22', 'HG22', 'HG22', 'HG22', 'HG22'],
['HG23', '3HG2', 'HG23', 'HG23', 'HG23', 'HG23', 'HG23'], ['C', 'C', 'C', 'C', 'C', 'C', 'C'],
['CA', 'CA', 'CA', 'CA', 'CA', 'CA', 'CA'], ['CB', 'CB', 'CB', 'CB', 'CB', 'CB', 'CB'],
['CG2', 'CG2', 'CG2', 'CG2', 'CG2', 'CG2', 'CG2'], ['N', 'N', 'N', 'N', 'N', 'N', 'N'... | |
#!/usr/bin/env python3
"""
This module provides IPMI utilities
"""
import argparse
import json
import os
import subprocess
import sys
import traceback
import sqlalchemy
from dateutil.parser import parse
from datamodel import DataModel
from pxlogging import PxLogger
from pxjson import PxJSON
class PxIPMI(object):
"... | |
<reponame>dmquinones/qiskit-terra
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache... | |
<gh_stars>1-10
#Code from https://github.com/zhangyaqi1989/Gcode-Reader
from enum import Enum
import os.path
import pprint
import sys
import numpy as np
import pandas as pd
class LayerError(Exception):
""" layer number error """
pass
class GcodeType(Enum):
""" enum of GcodeType """
FDM_REGULAR = 1
FDM_STRATA... | |
import time, pygame, os, sys, sqlite3
from random import randint
from pygame.constants import MOUSEBUTTONDOWN, QUIT
# inicializa todos os módulos que necessitam de inicialização dentro do pygame.
pygame.init()
#Criando conexão com o banco de dados e definindo o cursor:
banco_de_dados = sqlite3.connect('nome_pontuacao... | |
<reponame>qmonnet/nic-firmware
#!/usr/bin/env python3
##
## Copyright (c) 2017-2018, Netronome Systems, Inc. All rights reserved.
## SPDX-License-Identifier: BSD-2-Clause
"""
This scripts generates troubleshoot init directives in an uc file
"""
import math
import sys
import argparse
class nfp_dump_type :
type_cpp_cs... | |
<filename>data/data_nci.py
import os
import numpy as np
import logging
import gc
import h5py
from skimage import transform
import utils
import config.system_paths as sys_config
import pydicom as dicom
import nrrd
import subprocess
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s')
# Maximum numb... | |
Returns:
Process: The desired process.
Raises:
ValueError: Unknown process key.
"""
if key not in self._processes:
raise ValueError("Unknown process key.")
return self._processes[key]
def get_processes(self, only_alive: bool = False) -> Dict[str, Process]:
"""Get all managed processes or only the alive ones ... | |
self.ax1 = gs.figure.add_subplot(gs[:, 0:-1])
self.ax2 = gs.figure.add_subplot(gs[:, -1])
# self.ax2.get_yaxis().set_visible(False)
# self.ax1 = self.figure.add_subplot(111)
self.figure.subplots_adjust(left=0.05,
bottom=0.12,
right=0.95,
top=0.95,
wspace=None,
hspace=0.6)
self.filters = {'Notch': 'none',
... | |
progress_callback,
current_step,
total_steps,
"Pre-processing image",
wrapper,
)
wrapper.store_image(
wrapper.current_image, "pre_processed_image", force_store=True
)
self._last_wrapper_luid = wrapper.luid
return use_last_result, current_step
def build_target_tools(
self, tools: Union[None, ... | |
<reponame>Amoza-Theodore/Baidu2020
import os
import shutil
import v4l2capture
from ctypes import *
import struct
import array
from fcntl import ioctl
import cv2
import numpy as np
import time
from sys import argv
import getopt
import sys
import select
import termios
import tty
import threading
import paddlemobile as pm... | |
self.type,
self.resource_user_provided_identifiers,
self.inventory_entry,
)
)
class InventoryEntryCreatedMessagePayload(MessagePayload):
"Corresponding marshmallow schema is :class:`commercetools.schemas.InventoryEntryCreatedMessagePayloadSchema`."
#: :class:`commercetools.types.InventoryEntry` `(Named` ``inven... | |
(int,)):
#
# Q: should this be a warning? A user _might_ be trying
# to use an integer as a key. But in practice that's not
# likely.
#
raise PluginError("Access of the n-th extension point is disallowed. This is not well-defined, since ExtensionPoints are stored as unordered sets.")
return self.extensions(all=a... | |
<filename>hyperparameter_hunter/key_handler.py<gh_stars>0
"""This module handles the creation of `cross_experiment_key`\s and `hyperparameter_key`\s for
:class:`hyperparameter_hunter.environment.Environment`, and :class:`hyperparameter_hunter.experiments.BaseExperiment`,
respectively. It also handles the treatment of c... | |
in
# self.input[first_useable: i] can be copied directly to self.processed_input
if not np.any(np.isnan(first_useable)):
self.processed_input[first_useable_i:i, 0:3] = self.input[first_useable_i: i, 0:3]
first_useable = float('nan')
# If last_useable has already been assigned, the current value is somewhere w... | |
<filename>dxm/lib/masking_api/api/reidentification_job_api.py
# coding: utf-8
"""
Masking API
Schema for the Masking Engine API # noqa: E501
OpenAPI spec version: 5.1.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# pytho... | |
<reponame>jacoblb64/pico_rgb_keypad_hid<gh_stars>10-100
# SPDX-FileCopyrightText: 2001-2019 Python Software Foundation
#
# SPDX-License-Identifier: PSF-2.0
"""
`adafruit_itertools`
================================================================================
Python's itertools adapted for CircuitPython by <NAME>
... | |
less snapshots then observation time steps'
if return_copy:
x = self.copy()
else:
x = self
new_list = main_loop(x)
del x[:]
x.extend(new_list)
for A in x:
self.bool_int_matrix(A)
if return_copy:
return x
else:
return
def node_activity_series(self, norm=True):
""" returns the number of active nodes ... | |
range(len(self.keys))], self.length, p=self.probs, replace=True)
settings = [self.keys[i] for i in choices]
settings = [item for item in settings if item[1] != '0' * self.nqubits]
return settings
def evaluate_expectations(self, settings: List[str], params: List[float]):
expectations = []
for sett in settings:
... | |
True
self.ylist_key_names = []
self._child_classes = OrderedDict([])
self._leafs = OrderedDict([
('processed_pkts', (YLeaf(YType.uint64, 'processed-pkts'), ['int'])),
('processed_bytes', (YLeaf(YType.uint64, 'processed-bytes'), ['int'])),
])
self.processed_pkts = None
self.processed_bytes = None
self._segment_... | |
:paramtype trigger_parameter: str
"""
super(ScaleRuleAuth, self).__init__(**kwargs)
self.secret_ref = secret_ref
self.trigger_parameter = trigger_parameter
class Secret(msrest.serialization.Model):
"""Secret definition.
:ivar name: Secret Name.
:vartype name: str
:ivar value: Secret Value.
:vartype value: s... | |
<gh_stars>1-10
import json
import logging
from unittest import mock
import pytest
from requests import RequestException
from elastalert.alerters.httppost2 import HTTPPost2Alerter
from elastalert.loaders import FileRulesLoader
from elastalert.util import EAException
def test_http_alerter_with_payload(caplog):
caplo... | |
<filename>tests/components/hyperion/test_light.py
"""Tests for the Hyperion integration."""
from __future__ import annotations
from datetime import timedelta
from unittest.mock import AsyncMock, Mock, call, patch
from hyperion import const
from homeassistant.components.hyperion import (
get_hyperion_device_id,
lig... | |
<filename>proganomaly_modules/training_module/trainer/losses.py
# Copyright 2020 Google 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/lic... | |
excpt_msgs:
if n == 1:
excpt_msg = "{}, {}".format(n, msg)
else:
excpt_msg = "{}; {}, {}".format(excpt_msg, n, msg)
except:
try:
excpt_msg = response.json()
if excpt_msg is None:
raise Exception()
elif excpt_msg == "":
raise Exception()
except:
excpt_msg = "Unknown error ('{0}'), check url in a web browser... | |
super(AuthInfoUpdateParameters, self).__init__(**kwargs)
self.token_type = token_type
self.token = token
self.refresh_token = refresh_token
self.scope = scope
self.expires_in = expires_in
class BaseImageDependency(Model):
"""Properties that describe a base image dependency.
:param type: The type of the base i... | |
file_bug, '_GetAllCurrentVersionsFromOmahaProxy',
mock.MagicMock(return_value=[]))
def testGet_WithFinish_SingleRevOwner_Clank_Skips(self):
# When a POST request is sent with keys specified and with the finish
# parameter given, an issue will be created using the issue tracker
# API, and the anomalies will be upda... | |
import torch
import torch.nn.functional as F
from torch import nn as nn
from torch.nn.modules.loss import CrossEntropyLoss, _Loss
import math
import numpy as np
from typing import List
from tyche.utils import param_scheduler as p_scheduler
def kullback_leibler(mean, sigma, reduction='mean'):
"""
Kullback-Leibler di... | |
[-1.5162963554188984, -0.969321871044044769, 3.25761385947302129],
[-1.51757954405924744, -0.948487215037029707, 3.18759453339230348],
[-1.51880873597402544, -0.928529358237395464, 3.12052187893353228],
[-1.51998726945227491, -0.909394092834694523, 3.05621371913374107],
[-1.52111821315522922, -0.891031589295950166,... | |
import torch
import torch.nn as nn
from torch.autograd import Variable
from models.modules import build_mlp, SoftAttention, ImageSoftAttention, TextSoftAttention, PositionalEncoding, ScaledDotProductAttention, create_mask, create_mask_for_object, proj_masking, PositionalEncoding, StateAttention, ConfigAttention, Confi... | |
get(self, k):
i = id(k)
try:
return self.by_id[i]
except KeyError:
return self.by_hash.get(self._hash(k))
def __setitem__(self, k, v):
self.by_id[id(k)] = v
self.by_hash[self._hash(k)] = v
def __delitem__(self, k):
i = id(k)
if i in self.by_id:
del self.by_id[i]
del self.by_hash[self._hash(k)]
def items(s... | |
<filename>examples/nist_sre/helpers.py<gh_stars>1-10
from __future__ import absolute_import, division, print_function
import os
import pickle
import shutil
import warnings
from collections import OrderedDict, defaultdict
from enum import Enum
from numbers import Number
import numba as nb
import numpy as np
from scipy... | |
'endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'},
'network_configuration': {'key': 'networkConfiguration', 'type': 'NetworkConfiguration'},
}
def __init__(
self,
*,
provisioning_state: Optional[Union[str, "WorkflowProvisioningState"]] = None,
state: Optional[Union[str, "WorkflowState"]] = None,
... | |
for failure.
instanceIdToken: This is the GCE instance identity token described in
https://cloud.google.com/compute/docs/instances/verifying-instance-
identity where the audience is 'osconfig.googleapis.com' and the format
is 'full'.
instanceSystemId: Required. The unique, system-generated identifier for
the inst... | |
print("")
for punct in keptPunct:
text = text.replace(punct, delim + punct + delim)
for punct in ignoredPunct:
text = text.replace(punct, "")
for punct in delimPunct:
text = text.replace(punct, delim)
text = text.lower()
if config.tokenizer == "stanford":
ret = StanfordTokenizer().tokenize(text)
elif con... | |
B O 1
ATOM 3234 C CB . ALA B 1 197 ? 46.134 -45.681 16.710 1.00 16.70 ? 198 ALA B CB 1
ATOM 3235 N N . LEU B 1 198 ? 45.625 -44.929 19.735 1.00 14.13 ? 199 LEU B N 1
ATOM 3236 C CA . LEU B 1 198 ? 46.159 -44.455 21.041 1.00 14.99 ? 199 LEU B CA 1
ATOM 3237 C C . LEU B 1 198 ? 45.053 -44.448 22.091 1.00 14.98 ? 199 ... | |
<filename>solution.py
import time
import random
from collections import defaultdict
import numpy as np
import copy
import multiprocessing
def process_generate_scratch(schedule_agent, cur_time, job_status, machine_status, coeff_tardiness, makespan_dict, data_ct_dict):
makespan, op_seq_machines, job_seq_machines, sta... | |
<reponame>TiankunZhou/cctbx_project
from __future__ import absolute_import, division, print_function
import os
import iotbx.phil
import libtbx.load_env
import libtbx.phil
import mmtbx.model
from cctbx import crystal
from libtbx.program_template import ProgramTemplate
from libtbx.utils import Sorry
from iotbx.data_ma... | |
import argparse
import math
import random
import os
import numpy as np
import torch
from torch import nn, autograd, optim
from torch.nn import functional as F
from torch.utils import data
import torch.distributed as dist
from torchvision import transforms, utils
from tqdm import tqdm
import time
from d... | |
# Copyright 2020-2021 Cambridge Quantum Computing
#
# 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 agree... | |
<filename>crawler/crawler.py
#!/usr/bin/python3
## --------------------------------------------------------------------------------------------------------------------
import logging # for log
import os # for file handling, exit
import sys # for exit
import multiprocessing # for multiprocessing purpose
import re # f... | |
or how to compute invariants.
return b
def gen(self, i):
"""
Return the i-th generator of self.
INPUT:
- ``i`` -- integer
EXAMPLES::
sage: V = span([[1/2,1,1],[3/2,2,1],[0,0,1]],ZZ); W = V.span([2*V.0+4*V.1, 9*V.0+12*V.1, 4*V.2])
sage: Q = V/W; Q
Finitely generated module V/W over Integer Ring with invar... | |
text/html; charset=UTF-8
set-cookie: WEBSRV=web2; path=/
cache-control: private
10.0.0.27
[root@centos6 ~]#curl -i 10.0.0.7
HTTP/1.1 200 OK
date: Thu, 02 Apr 2020 02:26:15 GMT
server: Apache/2.4.6 (CentOS)
last-modified: Thu, 02 Apr 2020 01:44:13 GMT
etag: "a-5a244f01f8adc"
accept-ranges: bytes
content-length: 10
cont... | |
go into an enemy base.
if len(self.cached_enemies.closer_than(10, position)) > 0:
continue
distance = position.distance_to(possible)
#make sure the enemy is not closer to the point we are going to.
e_distance = enemy.distance_to(possible)
if distance < e_distance:
locations.append([dista... | |
import bisect
import bucket
import cross_bundle_bucket
import pairedread
import copy
import random
import time
class Alignments:
''' A set of reads aligned to a genome '''
def __init__(self, chromosomes, frag_len_cutoff=None, split_discordant=True):
''' Initialize a genome for alignments
chromosomes: A dictionar... | |
a datetime object
# Also clear feature reference column (6) in case the file being read already has some existing data
for row in data[1:]: # skip top row since it's just labels
#print(str(len(row)))
row[1] = datetime.datetime.strptime(row[1], "%Y-%m-%d %H:%M:%S")
# the 7th and 8th column might be empty, if so, ap... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from typing import DefaultDict, Dict, Iterable, List, Optional, Union
from .constants import SECS_IN_DAY, SECS_IN_HR
from .helpers import ConstellationId, get_constellation, get_closest, get_el_az, TimeRangeHolder
from .ephemeris imp... | |
<filename>src/svnwrap.py
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
import atexit
import codecs
import difflib
import errno
import io
import locale
import os
import platform
import re
import shlex
import shutil
import signal
import subprocess
imp... | |
(N, 1444, 4), there are a total 1444 boxes on this feature map
# Predict classes in localization boxes
c_conv3_3 = self.cl_conv3_3(conv3_3_feats) # (N, 4 * n_classes, 150, 150)
c_conv3_3 = c_conv3_3.permute(0, 2, 3,
1).contiguous() # (N, 150, 150, 4 * n_classes), to match prior-box order (after .view())
c_conv3_... | |
# The indirection here is a little confusing:
# we're using the resource path template as the base of a regex,
# with each resource ID segment being captured by a regex.
# E.g., the path schema
# kingdoms/{kingdom}/phyla/{phylum}
# becomes the regex
# ^kingdoms/(?P<kingdom>.+?)/phyla/(?P<phylum>.+?)$
parsing_reg... | |
'Albuquerque, NM'},
'1505730':{'en': 'Albuquerque, NM'},
'1505747':{'en': 'Espanola, NM'},
'1505753':{'en': 'Espanola, NM'},
'1505757':{'en': 'Pecos, NM'},
'1505764':{'en': 'Albuquerque, NM'},
'1505766':{'en': 'Albuquerque, NM'},
'1505768':{'en': 'Albuquerque, NM'},
'1505782':{'en': 'Zuni, NM'},
'1505786':{'en... | |
acolor[0]), None, resolveFilename(SCOPE_SKIN) + SkinName + "/" + png_name)
# if name does not match set it to inactive
else:
currenttheme.set("value", "inactive")
if rootTheme.find("screenthemes") is not None:
themes = rootTheme.find("screenthemes")
for screens in themes.findall("scre... | |
# coding=utf-8
# Copyright 2019 The Google NoisyStudent Team 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 app... | |
*args): #cannot find CLR method
pass
def __str__(self, *args): #cannot find CLR method
pass
HasDefault = None
None = None
Reserved2 = None
Reserved3 = None
Reserved4 = None
ReservedMask = None
RTSpecialName = None
SpecialName = None
value__ = None
class PropertyInfo(MemberInfo, ICustomA... | |
<gh_stars>0
import numpy as np
from math import isfinite, isnan, sqrt, log
from numpy import nan
from numba import jit
def _ref(arr, period):
bc = len(arr)
result = np.full(bc, np.nan)
for i in range(max(0, -period), min(bc, bc - period)):
if not isfinite(arr[i + period]):
# Replace all NaN, Inf, -Inf by NaN!
... | |
\
'<tr>' + \
'<td>Supplies expense</td>' + \
'<td>' + r22c1 + '</td>' + \
'<td>' + r22c2 + '</td>' + \
'<td>' + r22c3 + '</td>' + \
'<td>' + r22c4 + '</td>' + \
'<td>' + r22c5 + '</td>' + \
'</tr>' + \
'<tr>' + \
'<td>Travel expense</td>' + \
'<td>' + r23c1 + '</td>' + \
'<td>' + r23... | |
linker to force
# everything onto the dynamic symbol table. Since this only affects
# object files from sources immediately owned by `cpp_binary` rules,
# this shouldn't have much of a performance issue.
buck_platform = platform_utils.get_buck_platform_for_base_path(base_path)
if (cpp_common.get_link_style() == 's... | |
import math
import numpy as np
import os
import torch
import torch.nn as nn
from torch.nn import Parameter
import torch.nn.functional as F
# import resnet
# from efficientnet.model import EfficientNet
import models.segtran_modified.code.networks.aj_i3d.aj_i3d as aj_i3d
from models.segtran_modified.code.netw... | |
""" This callback will emitted when autodoc has formatted a signature for an object.
It parses and caches the signature arguments for function and classes so it can
be used in the process_docstring_callback callback.
"""
global cached_parameters
global cached_signature
if name.startswith('mitsuba.python.'):
# S... | |
<reponame>cdoolin/labdrivers
# This file is auto-generated. Do not edit!
from collections import namedtuple
_d = {u'AIConv_ActiveEdge': 6227,
u'AIConv_DigFltr_Enable': 11996,
u'AIConv_DigFltr_MinPulseWidth': 11997,
u'AIConv_DigFltr_TimebaseRate': 11999,
u'AIConv_DigFltr_TimebaseSrc': 11998,
u'AIConv_DigSync_Enab... | |
from collections import Iterable
from datetime import datetime
from typing import Any
from flask import Blueprint, Response, jsonify, redirect, render_template, session, url_for
from flask.views import MethodView
from werkzeug.exceptions import default_exceptions
from pysite.constants import ALL_STAFF_ROLES, DEBUG_MO... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import random
import sys
from functools import partial
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import numpy as np
... | |
import os
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.models import load_model
from model.network import AdaptiveInstanceNormalization
from keras.layers import Input, Dense, Flatten
from keras.layers import Lambda, Conv2D
from keras.models import Model
from keras.optimizers i... | |
class="answer">\n')
if pretty_links:
(sup_answer_body,sup_answer_links) = suppify_body(answer['body'])
yield '', join_(' ', escape_(sup_answer_body, True), ' \n')
for key in loop.setup(sup_answer_links.keys()):
yield '', join_(' ', '[', escape_((key), True), '] ', escape_((sup_answer_links[key].replace("&","&"... | |
<reponame>deepneuralmachine/google-research
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
<reponame>future-haus/django-inbox<filename>tests/test_maintenance.py
import uuid
from django.conf import settings
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
from faker import Faker
from freezegun import freeze_time
from inbox import settings as i... | |
# Copyright (c) 2013 <NAME>, <EMAIL>.lucchese at gmail.com
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# in... | |
__str__(self):
return str(self.id)
def clean(self):
return
# Permissions
@staticmethod
@allow_staff_or_superuser
@authenticated_users
def has_read_permission(request):
return True
@allow_staff_or_superuser
@authenticated_users
def has_object_read_permission(self, request):
return True
@staticmethod
@... | |
BUILD_BB_GAMEPLAY_EFFECT_FLOOR_PATTERN_ECO_FOOTPRINT_PLUS1: 'CommonGameTag' = 2306
BUILD_BB_GAMEPLAY_EFFECT_FLOOR_PATTERN_ECO_FOOTPRINT_PLUS2: 'CommonGameTag' = 2307
BUILD_BB_GAMEPLAY_EFFECT_FLOOR_PATTERN_ENVIRONMENT_SCORE_MINUS1: 'CommonGameTag' = 2296
BUILD_BB_GAMEPLAY_EFFECT_FLOOR_PATTERN_ENVIRONMENT_SCORE_MINUS2... | |
<gh_stars>0
import os, sys, math, time
import matplotlib.pyplot as plt
from itertools import cycle
# Farbige Ausgabe auf dem Bildschirm mit print
class c:
PURPLE = '\033[95m'
PURPLEBOLD = '\033[95m\033[1m'
CYAN = '\033[96m'
CYANBOLD = '\033[96m\033[1m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
BLUEB... | |
loc=None, correct_key=True):
"""Evaluates and sets the specified option value in
environment `loc`. Many options need ``N`` to be defined in
`loc`, some need `popsize`.
Details
-------
Keys that contain 'filename' are not evaluated.
For `loc` is None, the self-dict is used as environment
:See: `evalall()`, `_... | |
<gh_stars>0
import os
import re
import copy
import math
import time
import glob
import shutil
import pickle
import pathlib
import warnings
import functools
import importlib
import itertools
from ..utils import _get_fn_name, prod, progbar
from .combo_runner import (
nan_like_result,
combo_runner_core,
combo_runner_t... | |
<reponame>DataCanvasIO/YLearn
from copy import deepcopy
from collections import defaultdict
import numpy as np
from sklearn import clone
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import KFold
from .base_models import... | |
config.config['private_config'].get('ssl_key_file', 'server.key') )
self.ssc_file_prefix = self.getfilepath('server')
self.req_file_prefix = self.getfilepath('request')
def getfilepath(self, name):
path = os.getcwd() + '/' + name
path = path.replace('\\', '/')
log.debug(path)
return path
def json... | |
import pandas as pd
import pytest
from feature_engine.encoding import OneHotEncoder
def test_encode_categories_in_k_binary_plus_select_vars_automatically(df_enc_big):
# test case 1: encode all categories into k binary variables, select variables
# automatically
encoder = OneHotEncoder(top_categories=None, variabl... | |
<reponame>Valisback/hiring-engineers<filename>code/venv/lib/python3.8/site-packages/datadog_api_client/v2/api/users_api.py<gh_stars>0
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.... | |
<gh_stars>0
"""Tracer code to set up training pipeline."""
import glob
import os
import logging
import multiprocessing
import pathlib
import pickle
import sqlite3
import subprocess
import sys
from osgeo import osr
from osgeo import gdal
import numpy
import pygeoprocessing
import png
import retrying
import rtree
import... | |
newly created copy of the source node (i.e. the destination
node). See :meth:`.Node._f_copy` for further details on the
semantics of copying nodes.
"""
obj = self.get_node(where, name=name)
if obj._v_depth == 0 and newparent and not newname:
npobj = self.get_node(newparent)
if obj._v_file is not npobj._v_file:... | |
30.34 C
ATOM 11 N ALA A 23 11.017 19.283 9.723 1.00 27.76 N
ATOM 12 CA ALA A 23 11.998 19.805 10.666 1.00 26.26 C
ATOM 13 C ALA A 23 11.854 19.144 12.033 1.00 23.38 C
ATOM 14 O ALA A 23 11.027 18.251 12.217 1.00 25.31 O
ATOM 15 CB ALA A 23 11.863 21.315 10.790 1.00 27.05 C
ATOM 16 N ALA A 24 12.663 19.590 12.988 1.00 1... | |
<reponame>annac-dima/NLP_Analysis_HarryPotterBooks
#!/usr/bin/env python
# coding: utf-8
# # Harry Potter Books NLP Analysis
#
#
# ***Author: <NAME>***
#
#
# ### Table of Contents
# [1. Data and Preprocessing](#preprocessing)
# [2. Analysis](#analysis)
# [2.1 Word Embeddings](#word-embeddings)
# [2.2 Analysi... | |
<reponame>smarie/python-spawner
import multiprocessing as mp
import os
from logging import Logger
import sys
from pickle import PicklingError
from types import FunctionType
from six import with_metaclass, raise_from
try: # python 3.5+
from typing import Union, Any, List, Dict, Tuple, Type, Iterable, Callable
except... | |
<gh_stars>10-100
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import io
import cv2
import json
import logging
import numpy as np
import tensorflow as tf
from typing import List
from scipy.spatial.transform import Rotation as R
from .. import data as g_data
from .base import BaseDa... | |
from datetime import timedelta
from django.urls import reverse
from rest_framework import status
from internal.tests.base_test import UserModel
from library.models import Artist, Song, SongTag, SongWorkLink, Work
from library.tests.base_test import LibraryAPITestCase
class SongListViewTestCase(LibraryAPITestCase):
... | |
<reponame>lgbouma/cdips-pipeline
# -*- coding: utf-8 -*-
'''
run
$ python TESS_ETE6_reduction.py --help
'''
from __future__ import division, print_function
import os, time
import matplotlib as mpl
mpl.use('AGG')
import numpy as np, pandas as pd, matplotlib.pyplot as plt
import aperturephot as ap, shared_variables as s... | |
look into the distribution of attribution scores for each token across all layers and attribution matrices for each head in all layers in Bert model.
# We do that using one of the layer attribution algorithms, namely, layer conductance. However, we encourage you to try out and compare the results with other algorithms ... | |
yax].fill_between(
sl, ev_mean - ev_std, ev_mean + ev_std, alpha=0.3, color=colour
)
major_ticks = np.arange(0, 101, 20)
minor_ticks = np.arange(0, 101, 5)
axs[xax, yax].set_xticks(minor_ticks / 100.0, minor=True)
axs[xax, yax].set_yticks(major_ticks / 100.0)
axs[xax, yax].set_yticks(minor_ticks / 100.0, minor... | |
<reponame>dcslagel/welly<filename>welly/curve.py
"""
Defines log curves.
:copyright: 2021 Agile Scientific
:license: Apache 2.0
"""
from __future__ import division
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.patches import PathPat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.