input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
= preds[query_index_]
query_labels = np.array(dataset['labels'])[query_index_]
query_ndcg.append(ndcg(query_labels[np.argsort(-query_pred_)], at=at))
return error_rate_, np.array(group_error_rate_), np.array(
query_error_rate), np.array(query_ndcg)
return error_rate_helper
def create_ranking_model(features, di... | |
'grey59': (150, 150, 150),
'grey6': (15, 15, 15),
'grey60': (153, 153, 153),
'grey61': (156, 156, 156),
'grey62': (158, 158, 158),
'grey63': (161, 161, 161),
'grey64': (163, 163, 163),
'grey65': (166, 166, 166),
'grey66': (168, 168, 168),
'grey67': (171, 171, 171),
'grey68': (173, 173, 173),
'grey69': (176, ... | |
numpy.all(t.type.broadcastable)]
if len(scalars) == 0:
# Nothing to optimize here
return
non_scalars = [t for t in terms if not numpy.all(t.broadcastable)]
# Perform the op only on the non-scalar inputs, if applicable
if len(non_scalars) == 0:
new_op_input_nb_elements = 1
new_op_output = 1
elif len(non_scal... | |
# noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = ['LMv1'] # noqa: E501
return self.api_client.call_api(
'/report/reports', 'POST',
path_params,
query_... | |
OOooOOo
oO0oO0OO0oOO = ( O0ooOO in ( 0x12 , 0x16 , 0x17 , 0x22 ) )
if ( oO0oO0OO0oOO == False ) :
ooI1Iii = "{} ({})" . format ( O0ooOO , igmp_types [ O0ooOO ] ) if igmp_types . has_key ( O0ooOO ) else O0ooOO
if 32 - 32: oO0o
lprint ( "IGMP type {} not supported" . format ( ooI1Iii ) )
return ( [ ] )
if 52 - 52:... | |
Must be one of the CJK or Base-14 set, else
the rectangle is returned unchanged.
fsize: the fontsize
Returns:
A rectangle to use instead of the annot rectangle.
"""
if not text:
return annot_rect
try:
text_width = getTextlength(text, font, fsize)
except ValueError: # unsupported font
return annot_rect
line_... | |
# %%
import os
import sys
from collections import Counter
from datetime import datetime, timedelta
from glob import glob
from pathlib import Path
from zipfile import ZipFile
# data wrangling
import geopandas as gpd
import pandas as pd
import numpy as np
import requests
from urllib.error import HTTPError
# data maniupl... | |
<reponame>ruohoruotsi/pyro
from __future__ import absolute_import, division, print_function
import numbers
from abc import ABCMeta, abstractmethod
from collections import OrderedDict, defaultdict
import torch
from six import add_metaclass
import pyro.poutine as poutine
from pyro.distributions import Categorical, Emp... | |
"""
Observe class.
Notes:
IPython config needs:
c.InteractiveShellApp.gui = 'qt'
c.InteractiveShellApp.pylab = 'qt'
"""
import os
import time
from tkinter import E
import azcam
class ObserveCommon(object):
"""
The ObserveCommon class which implements observing scripts.
"""
def __init__(self, tool_id="observ... | |
import unittest
import quarkchain.db
from quarkchain.cluster.root_state import RootState
from quarkchain.cluster.shard_state import ShardState
from quarkchain.cluster.tests.test_utils import get_test_env
from quarkchain.core import Address
from quarkchain.core import CrossShardTransactionList
from quarkchain.diff impo... | |
"""Functions for training and running group classification."""
import math
import os
import time
import datetime
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.utils.extmath import softmax
from scipy.special import expit
from sklearn.metrics import f1_score, fbeta_score, classif... | |
import glob
import os.path
import shutil
import sys
import tempfile
import re
from types import ModuleType
from typing import List, Tuple
from mypy.test.helpers import Suite, assert_equal, assert_string_arrays_equal
from mypy.test.data import DataSuite, DataDrivenTestCase
from mypy.errors import CompileError
from myp... | |
<gh_stars>1-10
import sys
sys.path.append('..')
import dolphindb as ddb
import numpy as np
from datetime import datetime
from dolphindb import session
from dolphindb import *
# from xxdb_server import HOST, PORT
HOST = "172.16.95.128"
PORT = 8921
if __name__ == '__main__':
conn = ddb.session()
success = conn.con... | |
{bar} {n_fmt}/{total_fmt} [{elapsed}]'},
**tqdm_opts,
}
# Ensure no kwargs left.
if kwargs:
raise TypeError(f"Unexpected **kwargs: {list(kwargs.keys())}.")
# Check the grid if one was explicitly provided.
if gridding == 'same':
meshes.check_mesh(self.model.grid)
elif gridding == 'input':
meshes.check_mesh(s... | |
= Constraint(expr= m.x590 - m.b808 <= 0)
m.c592 = Constraint(expr= m.x591 - m.b808 <= 0)
m.c593 = Constraint(expr= m.x592 - m.b808 <= 0)
m.c594 = Constraint(expr= m.x593 - m.b808 <= 0)
m.c595 = Constraint(expr= m.x594 - m.b808 <= 0)
m.c596 = Constraint(expr= m.x595 - m.b808 <= 0)
m.c597 = Constraint(expr= m.x596 ... | |
(orgPID == '310108196011191241' and cpy_PID == '4C654D1A9BA641A2B07138827E75DDDE') or \
(orgPID == '310108196309290429' and cpy_PID == '2D8E3099583741E28959B99A7BC51384') or \
(orgPID == '310105195810290437' and cpy_PID == 'A1464847BCB84703BC536F7084B2376D') or \
(orgPID == '31022219640615363X' and cpy_PID == '7D... | |
from __future__ import annotations
import inspect
import textwrap
from inspect import Parameter, Signature, cleandoc
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from spec_classes.types import MISSING
from spec_classes.utils.type_checking import type_label
class MethodBuilder:
"""
Bu... | |
import sys
import traceback
import textwrap
import warnings
import attr
__all__ = ["MultiError"]
################################################################
# MultiError
################################################################
def _filter_impl(handler, root_exc):
# We have a tree of MultiError's, lik... | |
IECore.InternedStringVectorData( [ "1", "2" ] ) )
self.assertEqual( b.readAttribute( IECore.LinkedScene.timeLinkAttribute, 0 ), IECore.DoubleData( 0 ) )
d = a.child( "4" )
self.assertFalse( d.hasAttribute( IECore.LinkedScene.linkAttribute ) )
self.assertFalse( d.hasAttribute( IECore.LinkedScene.fileNameLink... | |
import numpy as np
from numpy import pi
import logging
import h5py
from numpy import pi
import logging, os
from .Diagnostics import *
from .Saving import *
class Model(object):
""" Python class that represents the barotropic quasigeostrophic
pseudospectral model in a doubly periodic domain. Physical parameters
obs... | |
<filename>test/user4_time.py
from roundup import date
def import_data_4 (db, user) :
dr = db.daily_record.create \
( user = user
, date = date.Date ('2012-06-18')
)
dr = db.daily_record.create \
( user = user
, date = date.Date ('2012-06-19')
)
dr = db.daily_record.create \
( user = user
, date = date.Date ... | |
import logging
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
from django.conf import settings
from .map_table_tmplate import reading_2_5, indexes_dict
# from .models import MapStudentProfile, MapProfileExtResults, MapTestCheckItem
log = logging.getLogger("map_profile")
def draw_map_table(map_... | |
"OCL":
if problemType["UseBeta"]:
s += "%scl_kernel kernelBetaOnly = betaZero ? kernel_%s : kernel_%s;\n" \
% (t, kernelNamesBetaOnly[0], kernelNamesBetaOnly[1])
else:
#s += "%sbool betaZero = true;\n" % (t)
s += "%scl_kernel kernelBetaOnly = kernel_%s;\n" \
% (t, kernelNamesBetaOnly[0])
argIdx = 0
s += "%ssta... | |
<filename>tests/test_partial.py
# Licensed under Apache License Version 2.0 - see LICENSE
import collections
import copy
import pickle
import sys
import weakref
import pytest
import iteration_utilities
from iteration_utilities import partial
from iteration_utilities._utils import IS_PYPY
import helper_funcs as _hf
... | |
#!/usr/bin/env python
#
# Public Domain 2014-2018 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... | |
in the
format: 'projects/<project>/locations/<location>/queues/<queue>'
"""
def __init__(self, relative_path):
"""Initializes the instance and sets the relative path."""
self._relative_path = relative_path
def RelativeName(self):
"""Gets the string representing the full path for a queue.
This is the only fun... | |
LETTER EF
0425 CYRILLIC CAPITAL LETTER HA
0426 CYRILLIC CAPITAL LETTER TSE
0427 CYRILLIC CAPITAL LETTER CHE
0428 CYRILLIC CAPITAL LETTER SHA
0429 CYRILLIC CAPITAL LETTER SHCHA
042A CYRILLIC CAPITAL LETTER HARD SIGN
042B CYRILLIC CAPITAL LETTER YERU
042C CYRILLIC CAPITAL LETTER SOFT SIGN
042D CYRILLIC CAPITAL LETTER E
0... | |
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
import unittest
from gremlin_python.structure.graph import Path, Edge, Vertex
from gremlin_python.process.traversal import T
from graph_notebook.network.EventfulNetwork import EVENT_ADD_NODE
from graph_notebo... | |
################################################################################
self.SQL_OAC_NONE = 0x0000
self.SQL_OAC_LEVEL1 = 0x0001
self.SQL_OAC_LEVEL2 = 0x0002
################################################################################
####SQLGetInfo - SQL_ODBC_INTERFACE_CONFORMANCE####################... | |
import json
import os
import re
import sys
from collections import defaultdict
from runez.file import ls_dir, parent_folder, to_path
from runez.http import RestClient, urljoin
from runez.program import is_executable, run
from runez.system import _R, abort, cached_property, flattened, joined, ltattr, resolved_path, sho... | |
the feature.
**EXAMPLE**
>>> img = Image("lenna")
>>> kp = img.findKeypoints()
>>> c = kp[0].meanColor()
"""
#generate the mask
if( self._avgColor is None):
mask = self.image.getEmpty(1)
cv.Zero(mask)
cv.Circle(mask,(int(self.x),int(self.y)),int(self._r),color=(255,255,255),thickness=-1)
temp = cv.Avg(sel... | |
data["info"]["gene_metadata"]["cloning"]["cloning_enzyme"] == "BtgZI":
ortho_pair = get_pair(data["gene_id"])
fragments = FG_standard_fragment(data["sequence"]["optimized_sequence"],part_type,data["info"]["gene_metadata"]["cloning"]["cloning_enzyme"], ortho_pair)
print(fragments)
print(data["gene_id"])
gene_id = d... | |
NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36""")
if homepage is None or homepage == "":
raise Exception("Get userid failed.")
self.homepage = homepage
# {"USER_ID":"100027859862248","ACCOUNT_ID":"100027859862248","NAME":"<NAME>","SHORT_NAME":"<NAME>","IS_MESSENGER_... | |
# Internal
import os
import subprocess
from sys import exit
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
import tkinter.ttk as ttk
import webbrowser
# User lib
from osu_extractor.GetData import getSubFolder, getAllItemsInFolder, getFolderName, extractFiles, createPathIfNotExist, ... | |
# -------------------------------------------------------------------------
# convert_raw_file
#
# Converts a RAW file into JPG. Also copies tags from RAW file.
# Uses external exiftool.
#
def convert_raw_file(self, a_dirpath, a_fname, a_fext, a_fbasename):
""" convert_raw_file
a_dirpath = dirpath folder for f... | |
import argparse
import os, errno
import random as rnd
import string
import sys
import csv
import cv2
from tqdm import tqdm
from string_generator import (
create_strings_from_dict,
create_strings_from_file,
create_strings_from_wikipedia,
create_strings_randomly
)
from data_generator import FakeTextDa... | |
from precomputed cumulative sums and aggregate
x = x[num_candidates - 1] - np.log(num_candidates)
return np.exp(x.sum())
@parse_docdata
class InverseGeometricMeanRank(RankBasedMetric):
"""The inverse geometric mean rank.
---
link: https://arxiv.org/abs/2203.07544
description: The inverse of the geometric mean ... | |
CONTEXT_LENGTH]
label = a[j + CONTEXT_LENGTH]
self.ids.append(sample_id)
self.input_images.append(img)
self.partial_sequences.append(context)
self.next_words.append(label)
@staticmethod
def indexify(partial_sequences, voc):
temp = []
for sequence in partial_sequences:
sparse_vectors_sequence = [... | |
import sqlalchemy
from sqlalchemy import BigInteger
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Date
from sqlalchemy import DateTime
from sqlalchemy import delete
from sqlalchemy import Float
from sqlalchemy import ForeignKey
from sqlalchemy i... | |
<filename>qiita_db/metadata_template/base_metadata_template.py
r"""
Metadata template objects (:mod: `qiita_db.metadata_template)
=============================================================
..currentmodule:: qiita_db.metadata_template
This module provides the MetadataTemplate base class and the subclasses
SampleTem... | |
evaluate likelihood at initial parameters provided"
)
except Exception as e:
raise e
# maximize ln(L) (NOTE: this is set up to match the R version)
opt_options = {"maxiter": 100000}
if self.ignore_uncertainties:
# Coarse binning when x_err is None requires different solver that
# doesn't use jacobian.
method ... | |
<reponame>crcresearch/daspos-umbrella<gh_stars>1-10
# This file is part of the daspos-umbrella package.
#
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/crcresearch/daspos-umbrella
#
# Licens... | |
"""
Extended docstrings for functions.py
"""
pi = r"""
`\pi`, roughly equal to 3.141592654, represents the area of the unit
circle, the half-period of trigonometric functions, and many other
things in mathematics.
Mpmath can evaluate `\pi` to arbitrary precision::
>>> from mpmath import *
>>> mp.dps = 50; mp.pret... | |
<filename>quedex_api/user_stream.py
import json
import pgpy
class UserStreamListener(object):
def on_ready(self):
"""
Called when UserStream is ready to start receiving messages and sending commands. Immediately
after this method is called you will receive a "welcome pack" of messages to this listener which
wil... | |
{}".format(instance_name, region))
instance_type = cls.get_instance_type(instance_name, boto_config)
global_availability_zone = boto_config.get('availability_zone', None)
local_availability_zone = instance_config.get('availability_zone', None)
availability_zone = local_availability_zone if local_availability_zone ... | |
"""
PrevPerm(TStrV self) -> bool
Parameters:
self: TVec< TStr,int > *
"""
return _snap.TStrV_PrevPerm(self)
def GetPivotValN(self, *args):
"""
GetPivotValN(TStrV self, int const & LValN, int const & RValN) -> int
Parameters:
LValN: int const &
RValN: int const &
"""
return _snap.TStrV_GetPivotValN(sel... | |
is None:
game_config = GameConfig(num_layers=4, num_servers_per_layer=5, num_attack_types=10, max_value=9)
game_config.set_initial_state(defense_val=2, attack_val=0, num_vulnerabilities_per_node=1, det_val=2,
vulnerability_val=0, num_vulnerabilities_per_layer=5)
if initial_state_path is not None:
game_config.set_l... | |
#-------------------------------------------------------------------------------
# Copyright (C) 2017 <NAME> (cguZZman) <EMAIL>
#
# This file is part of Cloud Drive Common Module for Kodi
#
# Cloud Drive Common Module for Kodi is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... | |
errors), available as an
`actions` property on the exception instance.
:type actions: list[ActionResponse]
"""
self.actions = actions or []
def __str__(self):
errors_string = '\n'.join(['{a.action}: {a.errors}'.format(a=a) for a in self.actions])
return 'Error calling action(s):\n{}'.format(errors_string)
# B... | |
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from abc import ABC, abstractmethod
class Indicator(ABC):
# abstract Indicator class
# outlines functions required by indicator classes
def __init__(self, ax, xlims):
# All indicators have these attributes initialized
# Make sure the indicator c... | |
return None
# time to map the tags to the namespace now
for tag_id in tags_id_list:
# First check if tags mappings exists
try:
t_map_id = look_exist_tag_map(tag_id)
if t_map_id:
tags_mappings_id_list.append(t_map_id)
else:
raise TypeError
except TypeError:
c = cls.execute('INSERT INTO tags_mappings(namespac... | |
<filename>modules/toplist.py
from audiovisuaali import send
from config import OWNER_ID as owners
from mysqlfiles import users_get_top_xp
from discord.utils import get as duget
from config import COMMAND_START as starter
from mysqlfiles import points_stats_get_win_high
from mysqlfiles import points_stats_get_lo... | |
"""
# Requirement may contain extras - parse to lose those
# from what's passed to the matcher
r = parse_requirement(req)
scheme = get_scheme(self.metadata.scheme)
try:
matcher = scheme.matcher(r.requirement)
except UnsupportedVersionError:
# XXX compat-mode if cannot read the version
logger.warning('could not... | |
<reponame>cpeisert/vertizee<filename>vertizee/algorithms/paths/tests/test_single_source_shortest_paths.py
# Copyright 2020 The Vertizee 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... | |
= Constraint(expr= m.b618 + m.b621 <= 1)
m.c1544 = Constraint(expr= m.b619 + m.b621 <= 1)
m.c1545 = Constraint(expr= m.b620 + m.b621 <= 1)
m.c1546 = Constraint(expr= m.b622 + m.b623 <= 1)
m.c1547 = Constraint(expr= m.b622 + m.b624 <= 1)
m.c1548 = Constraint(expr= m.b622 + m.b625 <= 1)
m.c1549 = Constraint(expr= m... | |
<filename>AMBER/amber/utils/simulator.py
from __future__ import print_function
from collections import defaultdict
import matplotlib.pyplot as plt
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
class BaseSimulator:
def __init__(self, n, p, *args, **kwargs):
"""
Args:
n:
p:
*args:
**k... | |
<reponame>haiphanNJIT/StoBatch<filename>CIFAR10/more_attack.py
import numpy as np
from six.moves import xrange
import tensorflow as tf
from cleverhans.attacks_tf import fgm, fgsm
from build_utils import batch_adv
def model_loss(y, model, mean=True):
"""
FROM cleverhans/utils_tf
Define loss of TF graph
:param y: ... | |
from results.
itervalues = getattr(differences, 'itervalues', differences.values)()
filtered = (x for _, x in itervalues if x is not NOVALUE)
description = next(filtered, None)
# Format dictionary values and finalize description.
for key, value in IterItems(differences):
diffs, desc = value
differences[key] = d... | |
<reponame>evgind/lojax_uefi_rootkit_checker
#!/usr/bin/env python3
#<EMAIL> V0.1
#This script performs firmware checks for only ProLiant DL180 and ProLiant DL360.
import sys, os, argparse, subprocess, re, pkg_resources, json, contextlib, time
from struct import pack, unpack
_BaseModule = 'BaseModule'
PAYLOAD = '''
[... | |
print('====================================================================================================')
print('== NCS ๋ฌธ์ 1. ์๋์ ์คํฌ๋ฆฝํธ๋ฅผ ํ
์คํธํด๋ณด๋ฉด x ์ ์์๊ฐ out ์ ์์๋ก ๋ณ๊ฒฝ๋์์ ๊ฒ์ด๋ค.'
'๋ค์ ํ
์คํธํ ๋ x ์ ์์๊ฐ out ์ ์์๋ก ๋ณ๊ฒฝ๋์ง ์๊ฒ ํ๋ ค๋ฉด ์ด๋ป๊ฒ ํด์ผํ๋๊ฐ?')
print('=================================================================================... | |
"""Class definitions for Montreal Forced Aligner models"""
from __future__ import annotations
import os
from shutil import copy, copyfile, make_archive, move, rmtree, unpack_archive
from typing import TYPE_CHECKING, Any, Collection, Dict, Optional, Union
import yaml
from .exceptions import (
LanguageModelNotFoundEr... | |
asBool(*args, **kwargs):
"""
Retrieves the plug's value, as a boolean.
"""
pass
def asChar(*args, **kwargs):
"""
Retrieves the plug's value, as a single-byte integer.
"""
pass
def asDouble(*args, **kwargs):
"""
Retrieves the plug's value, as a double-precision float.
"""
pass
def asFloa... | |
<reponame>NobleNetworkCharterSchools/award-letters<filename>modules/basedata.py
#!python3
"""
Module for working with raw csv inputs and creating a 'clean' set of tables
to push Google Docs (before adding what's already in those docs
"""
import numpy as np
import pandas as pd
# The following functions are ... | |
"DEB":1, "GAM":1, "GUI":0, "HEA":0, "INQ":0, "ING":0, "INP":0, "INM":0, "JUM":0, "LAN":0, "LEG":0, "LOR":0,
"MIM":0, "OBS":1, "PER":0, "PRS":0, "RAN":1, "RID":0, "RUN":0, "SEA":0, "SRC":0, "SIE":0, "SMI":0, "STE":0, "STO":0, "SUR":0, "SWI":0, "TEA":0, "TRA":0, "UNA":0,
"WEA":0
}.items())),
"PRO":collections.OrderedDic... | |
"""Manage images.
We make an important design decision: Importing images requires root
privilege; unlike rkt, which does not. We make this decision for the
simplicity of implementation. To not require root privilege, rkt has to
split import into two steps:
* The first step, the ``fetch`` command, merely copies a tar ... | |
"""
Public controllers for the User Account module.
This file is subject to the terms and conditions defined in file 'LICENSE',
which is part of this source code package.
"""
# pylint: disable=no-member
import re
from datetime import datetime, timedelta
import time
import os
import hashlib
import bcrypt
from flask i... | |
"""
Copyright (C) 2010 - 2013 TopCoder Inc., All Rights Reserved.
This module specifies configurable details of the parser including
numerical/logical/textual attribute names and CMS codes, numerical
operators, digits, and characters.
This module also specifies how numerical operators are translated to SQL.
@version... | |
'2090-5769',
'1755-8743': '1755-8735',
'2211-9140': '2211-9132',
'2075-1354': '2070-0733',
'2165-3364': '2165-3356',
'1958-9190': '1634-2941',
'0025-6307': '0748-1756',
'2160-7001': '1071-121X',
'2052-4307': '0969-4900',
'2224-4662': '1565-9801',
'2160-8776': '2160-8741',
'1558-1195': '1049-3301',
'2168-202... | |
(0x20cbc30, 0, 'wcsncasecmp', 'libc_2_27'),
(0x20cbca0, 0, '__wcscasecmp_l', 'libc_2_27'),
(0x20cbca0, 0, 'wcscasecmp_l', 'libc_2_27'),
(0x20cbd00, 0, '__wcsncasecmp_l', 'libc_2_27'),
(0x20cbd00, 0, 'wcsncasecmp_l', 'libc_2_27'),
(0x20cc650, 0, '__isoc99_wscanf', 'libc_2_27'),
(0x20cc830, 0, '__isoc99_vwscanf', '... | |
= ContextFlags.COMPOSITION
# FIX 5/28/20
# context.execution_phase = ContextFlags.PREPARING
# context.replace_flag(ContextFlags.IDLE, ContextFlags.PREPARING)
if scheduler is None:
scheduler = self.scheduler
if termination_processing is None:
termination_processing = self.termination_processing
else:
new_cond... | |
'status': 'S'},
'15126': {'five_min': '0%',
'five_sec': '0%',
'name': 'nfsd',
'one_min': '0%',
'ppid': 2,
'size': 0,
'status': 'S'},
'15127': {'five_min': '0%',
'five_sec': '0%',
'name': 'nfsd',
'one_min': '0%',
'ppid': 2,
'size': 0,
'status': 'S'},
'15128': {'five_min': '0%',
'five_sec': '0%',
'name':... | |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
import pandas as pd
import numpy as np
from copy import deepcopy
import warnings
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.model_selection import cross_val_predict
from sklearn.model_selection import KFold, StratifiedKFold
from sklearn.externals.joblib import Parallel, delayed
from gravity_l... | |
1
if 0 < max_len <= counter:
# Hit limit on returned users: stop iterating
return
# Return users with full names matching the prefix
q = cls.query(UserModel.name_lc >= prefix).order(UserModel.name_lc)
for ud in list_q(q, lambda um: um.name_lc or ""):
yield ud
counter += 1
if 0 < max_len <= counter:
# Hit li... | |
\n00ใใ23ใฎๆฐๅคใๅ
ฅๅใใฆใใ ใใใ"
Ary['MOSEN22030'] = "AD้ฃๆบใฟใคใใผใฎ่จญๅฎใซๅคฑๆใใพใใใ"
Ary['MOSEN22031'] = "ใกใผใซ้็ฅ็จฎๅฅใ้ธๆใใฆใใ ใใใ"
Ary['MOSEN22032'] = "ใญใฐใคใณIDใไธๆญฃใงใใไฟฎๆญฃใใฆใใ ใใใ"
Ary['MOSEN22033'] = "AD้ฃๆบ่งฃ้คใ่กใฃใฆใใพใใ"
Ary['MOSEN22034'] = "ๅฆ็ใ็ตไบใใพใใใ"
Ary['MOSEN22035'] = "ใทในใใ ่จญๅฎใไฟๅญใใใพใใใ"
Ary['MOSEN22036'] = "ๅญๅจใใชใใญใฐใคใณIDใๅ
ฅๅใใใฆใใพใใ(%(ids)s) ไฟฎๆญฃใใฆ... | |
<filename>agdc/abstract_ingester/tile_contents.py
#!/usr/bin/env python
# ===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitte... | |
behaviour of where to merge the
'merge_my_result' stream. Only supports NONE or OUTPUT (only used
in protocol 2.1)
:param merge_previous: Controls the behaviour of where to merge the
previous Output and Error streams that have been unclaimed
:param merge_error: The merge behaviour of the Error stream
:param merge... | |
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
#from builtins import str
from builtins import range
from quantities.quantity import Quantity
import sciunit
from sciunit import Test,Score
try:
from sciunit import ObservationError
except:
from sciunit.errors... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ 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
#
# ... | |
<reponame>anjalp/Project-Ultra-Backup
import os
import json
import shutil
import copy
import time
import random
import string
import createSimple as cS
ver_control = 0
software_name = 0
creator = 0
def globalVariable(ver="v1.1.0", soft_name="Project Ultra Backup", author="Anjal.P"):
global ver_control, software_nam... | |
**kwargs):
self._subjected = sbj
self._verbed = self._subjected.lex.root_lex[vrb] # TODO: Move to ... (?)
self._args = list(args)
self._kwargs = kwargs
def __setitem__(self, key, value):
"""
Square-bracket sentence insert (the C in CRUD).
Finish handling the expression:
lex[s](v)[o] = n,t
Specifically, th... | |
kit_item in kit_items:
# How much of this supply_item is required per kit?
one_kit = kit_item.quantity * packs[kit_item.item_pack_id]
# How much is required for all Kits?
required = one_kit * quantity
# What stock do we have for this item?
ritem_id = kit_item.item_id
rows = wh_items.find(lambda row: row["inv_i... | |
<gh_stars>0
import sys, os, time, subprocess, getpass
from datetime import date
from subprocess import Popen, PIPE, STDOUT
import loadStudents
import argparse
import scorehistory
import javaRun
from shutil import copyfile
# Stuff we need, joy.
PARSER = argparse.ArgumentParser()
PARSER.add_argument("project", help="Gi... | |
8, 3, 5): (0, 1),
(8, 8, 4, -5): (0, 1),
(8, 8, 4, -4): (0, 1),
(8, 8, 4, -3): (0, 1),
(8, 8, 4, -2): (0, 1),
(8, 8, 4, -1): (0, 1),
(8, 8, 4, 0): (0, 1),
(8, 8, 4, 1): (0, 1),
(8, 8, 4, 2): (0, 1),
(8, 8, 4, 3): (0, 1),
(8, 8, 4, 4): (0, 1),
(8, 8, 4, 5): (0, 1),
(8, 8, 5, -5): (0, 1),
(8, 8, 5, -4): (0, ... | |
lambda bot, s: (bot.position, s)
parsed_l0 = layout.parse_layout(l0)
for bot in (0, 2):
game_state = setup_game([stopping, stopping], layout_dict=parsed_l0)
game_state['turn'] = bot
# get position of bots 1 (and 3)
kill_position = game_state['bots'][1]
assert kill_position == game_state['bots'][3]
new_state =... | |
unique identifier that you can use to query the export status.
(string) --
:type maxResults: integer
:param maxResults: The maximum number of results that you want to display as a part of the query.
:type nextToken: string
:param nextToken: A token to get the next set of results. For example, if you specify 10... | |
<gh_stars>100-1000
import torch
import math
import numpy as np
from utils import LeastSquares
def split_coeff(coeff):
# input: coeff with shape [1,257]
id_coeff = coeff[:, :80] # identity(shape) coeff of dim 80
ex_coeff = coeff[:, 80:144] # expression coeff of dim 64
tex_coeff = coeff[:, 144:224] # texture(albedo... | |
chi2
chi2 = format_number(chisqr, True)
self.tcChi.SetValue(chi2)
self.tcChi.Refresh()
else:
self.tcChi.SetValue("-")
# Hide error title
if self.text2_3.IsShown() and not self.is_mac:
self.text2_3.Hide()
try:
if self.enable_disp.GetValue():
if hasattr(self, "text_disp_1"):
if self.text_disp_1 is not None ... | |
<filename>nixysa/js_utils.py
#!/usr/bin/python2.4
#
# Copyright 2008 Google 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
#
# Unless requ... | |
#!/usr/bin/python
# Copyright (c) 2019 PaddlePaddle 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 req... | |
print('\t\tJJS : ', tree)
_JJS = tree.leaves()[0][0]
self.condition_object['JJS'] = tree.leaves()[0][0]
for tree in result.subtrees(filter=lambda x: x.label() == 'Target'):
# print('\t\tTarget : ', tree)
_Target = tree.leaves()[0][0]
self.condition_object['condition_target'] = _Target
phrase_to_be_filtered = _... | |
newLike = Parallel(n_jobs = nJobs)(delayed(log_dens_like)(new_theta[subj,run[subj,:]], data[data['subj'] == subject], params) for subj, subject in enumerate(np.unique(data['subj'])))
for subj in xrange(nSubj): new_like[subj,run[subj,:]] = newLike[subj]
new_weight = prior + new_like
#find all chains to be accepted
... | |
self.edges, self.adjacency = self.storagedriver(result.nodes, result.edges)
return self
def __iter__(self):
"""
Implement class __iter__
Iterate over nodes using iternodes
:return: single node Graph
:rtype: :graphit:Graph
"""
return self.iternodes()
def __len__(self):
"""
Implement class __len__
... | |
<filename>beartype_test/a00_unit/data/hint/pep/proposal/_data_pep585.py
#!/usr/bin/env python3
# --------------------( LICENSE )--------------------
# Copyright (c) 2014-2021 Beartype authors.
# See "LICENSE" for further details.
'''
Project-wide :pep:`585`-compliant **type hint test data.**
'''
# ...................... | |
<filename>pyeccodes/defs/grib1/localConcepts/efkl/name_def.py
import pyeccodes.accessors as _
def load(h):
def wrapped(h):
table2Version = h.get_l('table2Version')
indicatorOfParameter = h.get_l('indicatorOfParameter')
if table2Version == 253 and indicatorOfParameter == 228:
return 'Instantaneous Wind Speed i... | |
<gh_stars>0
#!/usr/bin/env python
import glob
import logging
import os
import platform
import re
import shutil
import stat
import sys
import tempfile
import time
from pathlib import Path
import requests
from localstack import config
from localstack.config import is_env_true
from localstack.constants import (
DEFAULT... | |
<reponame>agladstein/RNA-Seq-in-the-Cloud
#!/usr/bin/env python
import csv
import gzip
import re
import sys
import os
from collections import defaultdict, OrderedDict
import argparse
# See http://stackoverflow.com/questions/14207708/ioerror-errno-32-broken-pipe-python
from signal import signal, SIGPIPE, SIG_DFL
signa... | |
import math
from random import *
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from matplotlib import animation
def main():
global m_ani
######################################################################
'''
The balls get sent to the translation matrix, which moves the ba... | |
__author__ = 'Reid'
import os
import sys
from tkinter import *
from media.documents import *
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Project.settings')
import os
from Project.SecureWitness.models import Report, UserProfile, Upload
from django.contrib.auth.models import User
from datetime import datetime
f... | |
import math
import unittest
import numpy as np
from quasarnp.layers import (batch_normalization, conv1d, dense, flatten,
linear, relu, sigmoid)
class TestActivations(unittest.TestCase):
def test_linear(self):
# Test the liner activation for integers, positive and negative
self.assertEqual(linear(0), 0)
self.as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.