input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import warnings
from abc import ABC, abstractmethod
from typing import Dict, Generator, Optional, Union
import numpy as np
import torch as th
from gym import spaces
try:
# Check memory used by replay buffer when possible
import psutil
except ImportError:
psutil = None
from stable_baselines3.common.preprocessing i... | |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
= torch.relu(self.fc1(out))
out = torch.sigmoid(self.fc2(out))
return out, {"x": x, "out1": out1, "out2": out2} if is_summary else None
pass
class CNNEncoderMy4(nn.Module):
def __init__(self):
super().__init__()
self.layer1 = nn.Sequential(nn.Conv2d(3, 16, kernel_size=3, padding=0),
nn.BatchNorm2d(16, moment... | |
import json
import os
import stripe
from django.contrib import messages
from django.conf import settings
from django.contrib.auth import login, logout, authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExis... | |
same length as x
Optional parameters:
funcVal_only: boolean variable, function returns fval only if true
forward_only: boolean variable, the function returns Ax only if true, else
returns both Ax and gradient
"""
if frames_to_process is None:
frames_to_process = range(self.n_frames)
elif (type(frames_to_proces... | |
1]. The level of accuracy in the quantile estimate.
Default is 0.005.
s : float, optional
A float in [0, 1]. The probability of attaining accuracy ``r`` of the
quantile ``q``. Default is 0.95.
axis : int
The axis along which to compute the test. Default is 0, it is computed
for all other axes simultan... | |
ada embedded developer enterprise edition': ['rational ada'],
'rational apex': ['rational'],
'rational application': ['rational'],
'rational application developer': ['rational application'],
'rational application developer for websphere': ['rational application'],
'rational application developer for websphere soft... | |
from Network.component import Component
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow import keras
from Network.component import PerceptionRemovalModelComponent, BidirectionalRemovalComponent, \
MisalignedRemovalComponent, BeyondLinearityComponent, InfoGComponent, EncoderDecoderRemovalCom... | |
<filename>discrete_probability/__init__.py
__version__ = '0.10dev-8f143b8'
from collections import namedtuple
from decimal import Decimal
from math import log
from random import random, randint
from sys import float_info
################################################################################
# Utilities
####... | |
not be read. Skipping ...".format(filename))
if (len(stp) > 0 and not np.isnan(stp[0].time)) or len(stp.ndarray[0]) > 0: # important - otherwise header is going to be deleted
st.extend(stp.container,stp.header,stp.ndarray)
#del stp
if st.length()[0] == 0:
# try to give more specific information why the stream is... | |
= {
"reviewed": 1 if c_msg["sender"] == self.channel else 0,
"text": text,
}
cookies = {"session": self.session}
success = requests.post(url, data=data, cookies=cookies)
try:
success.raise_for_status()
reviewed = "to the database" if c_msg["sender"] == self.channel else "for review"
response = "Your {} has be... | |
Tmins.append(0); Tmaxs.append(self.Tc)
if all((self.Tc, self.Vc, self.omega)):
methods.append(TOWNSEND_HALES)
methods.append(HTCOSTALD)
methods.append(MMSNM0)
if self.CASRN in SNM0_data.index:
methods.append(MMSNM0FIT)
self.SNM0_delta_SRK = float(SNM0_data.at[self.CASRN, 'delta_SRK'])
Tmins.append(0); Tmaxs.app... | |
open(file,'r') as infile:
var = json.load(infile)
if file.lower().endswith(".pickle"):
with open(file,'rb') as infile:
var = pickle.load(infile)
print(file + " successfully loaded!")
return var
def load_dict(custom_dict, file_path):
"""Loads in a dictionary. Adds each entry from the dict at file_path to th... | |
<reponame>bmeares/noaa
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Example script for syncing NOAA weather data
"""
from __future__ import annotations
from meerschaum.utils.typing import SuccessTuple, Dict, List, Any, Optional
__version__ = '1.2.4'
required = [
'requests', 'pytz',
]
def reg... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import argparse
import logging
import os
import platform
import re
import sys
import tempfile
from collections import defaultdict
from contextlib import suppress
from functools import partial
from io import StringIO
from itertools import chain
from operator import itemgett... | |
return [[nabs(v) for v in row] for row in self.to_list()]
def to_standard_list(self):
"""
Return the underlying standard strong tableau as a list of lists.
Internally, for a strong tableau the standard strong tableau and its weight
is stored separately. This method returns the underlying standard part.
OUTPUT:... | |
import requests
import json
import datetime
import azure.functions as func
import base64
import hmac
import hashlib
import os
import logging
import re
from .state_manager import StateManager
customer_id = os.environ['WorkspaceID']
shared_key = os.environ['WorkspaceKey']
slack_api_bearer_token = os.envir... | |
type of message.
"""
def __init__(self, reason, message=None):
"""
:param reason: WAMP or application error URI for aborting reason.
:type reason: unicode
:param message: Optional human-readable closing message, e.g. for logging purposes.
:type message: unicode or None
"""
assert(type(reason) == six.text_typ... | |
%s" % ( len ( id ))))
kembali pilihcrack ( qq )
kecuali Pengecualian sebagai e :
keluar ( p + " \n [" + k + "•" + m + "•" + p + "] Kesalahan : %s" % e )
pasti mengikuti ():
coba :
toket=open("login.txt","r").read()
except IOError:
print((p+"\n ["+k+"•"+m+"•"+p+"] Cookie/Token Invalid"))
os.system("rm -rf ... | |
sent = [str(sent) for sent in nlp(clean_text).sents] #Split the whole text into sentences
#print(len(sent))
#print(sent)
clean_sent = clean_documents(sent) #Apply clean_document function to the sentences
clean_sent = expandContractions(clean_sent) #Apply expandContraction function to expand text contractions
#... | |
<reponame>Chrisys93/IcarusRepoSEND
# -*- coding: utf-8 -*-
from __future__ import division
import time
from collections import deque, defaultdict
import random
import abc
import copy
import numpy as np
from icarus.util import inheritdoc, apportionment
from icarus.registry import register_repo_policy
__all__ = [
'R... | |
there are only two dimensions.
Parameters
----------
field : string
Field name or expression
max_runs : Integer
Number of Runs to visualize at once. Default is 1.
label_maker : Callable, optional
Expected signature::
f(run: BlueskyRun, y: String) -> label: String
needs_streams : List[String], optional
St... | |
% (str(kp1[counterQ][0].pt))
print "imgQ - desc1[counterQ][0] = %s" % (str(desc1[counterQ][0]))
except:
common.DebugPrintErrorTrace()
if len(p1) >= 4:
# p1 and p2 are the matched keypoints
"""
From Section 6.1, page 391, opencv2refman.pdf:
(also http://docs.opencv.org/modules/calib3d/doc/camera_calibration_an... | |
# Copyright 2010 OpenStack Foundation
# 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 l... | |
'/name',
'value': new_dist_vv_name}]
dist_vv_details = self.distvv.patch_distributed_virtual_volume(
dist_vv_name, dist_vv_patch_payload)
LOG.info("Renamed the distributed virtual volume %s to %s",
dist_vv_name, new_dist_vv_name)
LOG.debug("Distributed Virtual Volume Details:\n%s",
dist_vv_details)
return dist_... | |
"""
Alternative implementations of segmented regression routines.
"""
# Author: <NAME>
# License: BSD 3 clause
import numpy as np
from segreg.model.alt import regression_alt, one_bkpt_segreg_alt,\
likelihood_util
try:
from numba import jit
except ImportError as e:
from segreg.mockjit import jit
# cache can fill... | |
bytes out - Buffer<0,5,0>'),
('nn::es::IETicketService', 3, '0 bytes in - 0 bytes out - Buffer<0,5,0>'),
('nn::es::IETicketService', 4, '4 bytes in - 0 bytes out - InRaw<4,4,0>'),
('nn::es::IETicketService', 5, '0 bytes in - 0 bytes out'),
('nn::es::IETicketService', 6, '0 bytes in - 0 bytes out'),
('nn::es::IETic... | |
<gh_stars>0
import numpy as np
import pytest
import est_dir
def test_1():
"""
Test for num_exp_SNR_LS().
"""
f = est_dir.quad_f_noise
f_no_noise = est_dir.quad_f
function_type = 'quad'
m = 100
lambda_max = 1
noise_list = np.array([1, 2])
region = 0.1
num_funcs = 5
cov = np.identity(m)
... | |
<gh_stars>1000+
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20090126093408.1: * @file ./obsolete/wxGui.py
#@@first
'''A plugin to use wxWidgets as Leo's gui.
**Important**: this plugin is largely unfinished.
Do not use thi plugin for production work!
See the "bug list & to-do" section for more details.
'''
... | |
"""
Update encoders (e_c, e_a) and generator weights - accumulate losses, backward
:param opts:
:return:
"""
# update G, Ec, Ea - update with real images
self.opts = opts
self.enc_c_opt.zero_grad()
self.enc_a_opt.zero_grad()
self.gen_opt.zero_grad()
self.backward_EG()
# update G - generator loss on fake gen... | |
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Tuple, Dict, Iterator
import torch
import torchaudio
@dataclass
class StreamReaderSourceStream:
"""StreamReaderSourceStream()
The metadata of a source stream. This class is used when representing streams of
media t... | |
member 'a'",
":11: error: Redefinition of 'MyAction2_path' member 'b'",
":13: error: Redefinition of 'MyAction2_query' member 'a'",
":15: error: Redefinition of 'MyAction2_input' member 'b'"
]
self.assertListEqual(cm_exc.exception.errors, expected_errors)
self.assertListEqual(parser.errors, expected_errors)
def... | |
"""
Miscellaneous matrix functions
"""
# ****************************************************************************
# Copyright (C) 2008 <NAME> <<EMAIL>>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | |
# ==============================================================================
# Copyright 2019 - <NAME>
#
# NOTICE: 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, inclu... | |
self.ctx)
def accessor(self, i, j):
"""In Z3, each constructor has 0 or more accessor. The number of accessors is equal to the arity of the constructor.
>>> List = Datatype('List')
>>> List.declare('cons', ('car', IntSort()), ('cdr', List))
>>> List.declare('nil')
>>> List = List.create()
>>> List.num_construc... | |
not the party leader!',
color = 0xff2929
))
return
if len(cmd) != 1:
del cmd[0]
args = ' '.join(cmd)
for member in self.party.members:
if member.display_name.lower().startswith(args.lower()):
await self.party.hide(member)
await message.channel.send(embed=discord.Embed(
description = f'**{memb... | |
<reponame>Chromico/bk-base
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
----------------... | |
raise exception.InstanceSuspendFailure(reason=reason)
else:
LOG.debug("VM was already in suspended state. So returning "
"without doing anything", instance=instance)
def resume(self, instance):
"""Resume the specified instance."""
vm_ref = vm_util.get_vm_ref(self._session, instance)
pwr_state = self._session._c... | |
a pair request. It searches for the device name, clicks on it and assures
that the initiator device is in the pairing request window (i.e. if pair request window
is not displayed on the screen, it checks if the "Cannot communicate" message is displayed,
and checks device name paired or not to DUT, If paired returns ... | |
<reponame>zequeira/Toxic-Comment-Classification
import re
import string
import itertools
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
from wordcloud import WordCloud, STOPWORDS
from wordsegment import load, segment
load()
plt.style.use("seaborn-pastel")
d... | |
<gh_stars>0
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
import random
import ... | |
<gh_stars>0
"""
Runs a series of maintenance operations on the collection of entry files, updating the table of content files for
each category as well as creating a statistics file.
Counts the number of records each sub-folder and updates the overview.
Sorts the entries in the contents files of each sub folder al... | |
<reponame>ptressel/sahana-eden-madpub
# -*- coding: utf-8 -*-
"""
Messaging module
"""
module = "msg"
if deployment_settings.has_module(module):
# Settings
resourcename = "setting"
tablename = "%s_%s" % (module, resourcename)
table = db.define_table(tablename,
Field("outgoing_sms_handler"),
# Moved to deployme... | |
"h1:/M4H/1G4avsieL6BbUwCOBzulmoeKVP5ux/3mQNnbyI=",
version = "v1.1.0",
)
go_repository(
name = "com_github_masterminds_goutils",
importpath = "github.com/Masterminds/goutils",
sum = "h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=",
version = "v1.1.0",
)
go_repository(
name = "com_github_masterminds_semver_v3... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/11/17 19:51
# @Author : Jun
import random
import numpy as np
import math
from math import sin, cos
import random
import torch
from torch import nn
import torch.nn.functional as F
def aug_look(name, args1=None, args2=None):
if '... | |
: [optional] int
maximum number of iterations, if 'tol' not reached by then, raise error
D_seed : [optional] array
initial seed for overall distribution
pi_seed : [optional] array
initial seed for stationary dist of Pi, if no D_seed
Returns
----------
D : array
steady-state distribution
"""
# first obtain ... | |
wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_SIMPLE )
self.m_panel_partselect_cm1.SetBackgroundColour( wx.Colour( 0, 64, 128 ) )
bSizerPSCM1 = wx.BoxSizer( wx.HORIZONTAL )
self.m_bmToggleBtn_blrlm_camo = wx.BitmapToggleButton( self.m_panel_partselect_cm1, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, w... | |
)
params[key] = val
del params['kwargs']
# verify the required parameter 'namespace' is set
if ('namespace' not in params) or (params['namespace'] is None):
raise ValueError("Missing the required parameter `namespace` when calling `watch_namespaced_secret`")
# verify the required parameter 'name' is set
if ('na... | |
"certificate_key", certificate_key)
if mpns_certificate is not None:
pulumi.set(__self__, "mpns_certificate", mpns_certificate)
if thumbprint is not None:
pulumi.set(__self__, "thumbprint", thumbprint)
@property
@pulumi.getter(name="certificateKey")
def certificate_key(self) -> Optional[str]:
"""
The certific... | |
' + having
return self
def join(self, join):
if isinstance(join, str):
self.joinString += ' INNER JOIN ' + join
elif isinstance(join, (list, tuple)):
if len(join) != 2:
self.throw_exception("join子句的数组参数必须有两个元素")
self.joinString += ' ' + join[1] + ' JOIN ' + join[0]
else:
self.throw_exception("join子句的参数只支持字符串... | |
'ANATOLIAN HIEROGLYPH A143',
83115: 'ANATOLIAN HIEROGLYPH A144',
83116: 'ANATOLIAN HIEROGLYPH A145',
83117: 'ANATOLIAN HIEROGLYPH A146',
83118: 'ANATOLIAN HIEROGLYPH A147',
83119: 'ANATOLIAN HIEROGLYPH A148',
83120: 'ANATOLIAN HIEROGLYPH A149',
83121: 'ANATOLIAN HIEROGLYPH A150',
83122: 'ANATOLIAN HIEROGLYPH A151',
831... | |
1040814000,
"1040814000",
)
for object in objects:
response = render_jinja_tmpl(
"{{ object|strftime }}",
dict(
object=object,
opts=self.local_opts,
saltenv="test",
salt=self.local_salt,
),
)
self.assertEqual(response, "2002-12-25")
response = render_jinja_tmpl(
'{{ object|strftime("%b %d, %Y") }}',
d... | |
<gh_stars>1-10
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from cvi_toolkit.model.mlir_model import MLIRModel
from cvi_toolkit.utils.mlir_shell import mlir_quant, \
mlir_opt, mlir_to_cvimodel, run_cvimodel
from cvi_toolkit.numpy_helper import npz_compare
from cvi_toolkit.transform.onnx_converter import OnnxConverter
f... | |
maxThreat):
import TCVDictionary
potentialImpactStatements = TCVDictionary.PotentialImpactStatements
statements = potentialImpactStatements[elementName][maxThreat]
return statements
def _impactCategoryToThreatLevel(self, impactCategory):
if impactCategory == "catastrophic" or impactCategory == "devastating":
r... | |
along the
latest diagonal.
Parameters
----------
sel: str
The ldf average to select from ``triangle._CumTriangle.a2a_avgs``.
Defaults to "all-weighted".
Returns
-------
pd.DataFrame
"""
ldfs = self._ldfs(sel=sel)
fitted_tri_cum = self.tri.copy(deep=True)
for ii in range(fitted_tri_cum.shape[0]):
iterr... | |
"""Structs and definitions used serialize/deserialize ATOP statistics directly from log files.
Structs are declared in a way that will help provide as close to a 1 to 1 match as possible for debuggability
and maintenance. The _fields_ of every struct match their original name, however the struct names have been update... | |
# Copyright 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwar... | |
<filename>zas_rep_tools/src/classes/reader.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# : XXX{Information about this code}XXX
# Author:
# c(Developer) -> {'<NAME>'}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | |
<reponame>omarkhaled850/photo_shop_for_pros<filename>main.py<gh_stars>0
# Name : <NAME>
import imutils
from PyQt5 import QtCore, QtGui, QtWidgets
import cv2
import numpy as np
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QAction, QFileDialog, QMainWindow, QDialog, QDialogButtonBox, QVBoxLayout... | |
<gh_stars>1-10
"""
This module contains the calculation for the O(r^2) solution
"""
import logging
import numpy as np
from .util import mu0
#logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def calculate_r2(self):
"""
Compute the O(r^2) quantities.
"""
logger.debug('Calculating O(r^2... | |
import typing
from typing import Optional, Callable, Iterable, Iterator, Dict, Union
import dataclasses
import argparse
from functools import partial
import yaml
import os
__all__ = [
'confclass',
'confparam'
]
# A sentinel object to detect if a parameter is supplied or not.
# Use an empty class to give it a uniq... | |
import math
import time
import threading
import json
from app import app
from app.database.database import *
from app.components.mqtt import MQTT_PUBLISH, CHECK_ZIGBEE2MQTT_SETTING
from app.components.email import SEND_EMAIL
""" ################### """
""" led basic functions """
""" ################### """
# This ... | |
self.assertTrue(isinstance(a.inst, Foo))
a.inst = Bar()
self.assertTrue(isinstance(a.inst, Foo))
self.assertRaises(TraitError, setattr, a, 'inst', Foo)
self.assertRaises(TraitError, setattr, a, 'inst', Bar)
self.assertRaises(TraitError, setattr, a, 'inst', Bah())
def test_unique_default_value(self):
class Foo(o... | |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
import math
class GraphConvolutionLayer(nn.Module):
"""
Base graph convolution layer.
"""
def __init__(self):
super(GraphConvolutionLayer, self).__init__()
pass
def forward(self, feat, adj):
"""
... | |
u ook niet doubleren.
Dus als u geen lange klaverkaart heeft, of niet genoeg honneurs is het soms beter gewoon te passen.
'''
if state == 'StaymanPa2SAminMulti':
uitleg = '''
U heeft zowel een vierkaart harten als een vierkaart schoppen.
Met Stayman vroeg uw partner naar uw hoge kleuren, daar antwoordde u 2♥ op... | |
# coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2 # noqa: E501
OpenAPI spec version: 2.0.0
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AutoOrder(object):
"""NOTE: This class is auto generat... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from pathlib import Path
from typing import Optional
import pytest
import torch
import torch.nn.functional as F
from torch import Tensor
from combustion.nn import FCOSDecoder, FCOSLoss
from combustion.util import alpha_blend, apply_colormap
from combustion.visi... | |
from collections import OrderedDict
import copy
import hashlib
import io
import itertools
import logging
import os, os.path
import platform
import random
import shutil
import subprocess
import sys
import struct
import time
import zipfile
from World import World
from Spoiler import Spoiler
from Rom import Rom
from Patc... | |
normalization_info["equivalent_identifiers"]
}
variant_nodes.append(normalized_node)
# assume we don't have a split and store the id for look up
self.node_normalization_lookup[variant_id] = [normalization_info["id"]]
else:
# otherwise an error occurred
error_for_logs = f'{normalization_info["error_type"]}: {norm... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 29 11:48:18 2016
@author: <NAME>
"""
import numpy as np
data_dtypes = {'action': str, 'afectedProperty': str, 'alphanumericRatio': np.float32, 'amount': np.float32,
'badWordRatio': np.float32, 'bracketRatio': np.float32, 'commentTailLength': np.float32,
'containsLangu... | |
import errno
import json
import os
import sys
import zipfile
from datetime import datetime, timezone, timedelta
from dateutil import tz
def main():
[ipDirPath, opDirPath] = getInputOutputFileNames()
# Task 1
aggregateFilesAtDayLevel(ipDirPath=ipDirPath, opDirPath=opDirPath,
# maxFilesToProcess=3,
monthInputSani... | |
initialize=0)
m.x942 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x943 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x944 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x945 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x946 = Var(within=Reals, bounds=(0,10), initialize=0)
m.x947 = Var(within=Reals,... | |
import pyecharts.options as opts
from pyecharts.charts import Line, Grid
"""
From Echarts Gallery: https://www.echartsjs.com/examples/zh/editor.html?c=grid-multiple
"""
timeData = [
"2009/6/12 2:00",
"2009/6/12 3:00",
"2009/6/12 4:00",
"2009/6/12 5:00",
"2009/6/12 6:00",
"2009/6/12 7:00",
"2009/6/12 8:00",
"2... | |
<gh_stars>1-10
# -*- coding:utf8 -*-
# ==============================================================================
# Copyright 2017 lizhaohui.com, 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 ... | |
<reponame>rvalienter90/highway-env<gh_stars>0
import copy
import importlib
import itertools
import math
from typing import Tuple, Dict, Callable, List, Optional, Union, Sequence
import matplotlib.pyplot as plt
from PIL import Image
from PIL import ImageDraw
import numpy as np
# Useful types
Vector = Union[np.ndarray, ... | |
are:", amaxsize, bmaxsize)
sys.stdout.flush()
print("Finding unique sets...")
sys.stdout.flush()
alist, blist, agrplen, bgrplen = set_list(ainds, binds, asize, bsize, joint_folder_path)
# The final act of creating island groups is to clear out any sources too
# close to the edge of the catalogue -- defined by ... | |
isinstance(clause, (tuple, list)):
flattened.extend(clause)
else:
flattened.append(clause)
return flattened
def parse_node(self, node, alias_map):
query = []
query_data = []
for child in node.children:
if isinstance(child, Q):
parsed, data = self.parse_q(child, alias_map)
query.append(parsed)
query_data.ex... | |
__init__(self, /, data: pandas.core.series.Series):
"""
usage.geopandas: 1
"""
...
@overload
def __init__(
self,
/,
data: List[
Dict[
Literal["value1", "geometry"], Union[shapely.geometry.point.Point, int]
]
],
columns: List[Literal["geometry", "value1"]],
):
"""
usage.geopandas: 2
"""
...
@overlo... | |
<gh_stars>1000+
#
# Copyright (c) 2017 Intel Corporation
#
# 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 ... | |
<gh_stars>0
#!/usr/bin/python
# imported libraries
import gzip as gz
import numpy as np
import matplotlib.pyplot as plt
# digt data function 1 of 2
def seperate_data(filename):
'''name: seperate_data
description:
dependencies:
inputs:
outputs:
'''
# get data from the file
with gz.open(filename) as f:
data =... | |
from django.contrib import auth
from .models import *
from django.shortcuts import render, redirect, get_object_or_404
from sitio.forms import FormCreateUser, FormLogin, FormCreateArticle, FormCreateComment
from django.contrib.auth.models import User, Group
from django.contrib.auth.decorators import login_required
from... | |
"""
Notes on wordnet ids:
in KG embeddings, have both synset and lemma nodes:
synsets are keyed by something like able.a.01register("wordnet_mention_generator")
each synset has a number of lemmas, keyed by something like able%3:00:00::
In WSD task, you are given (lemma, pos) and asked to predict the lemma
key, e.... | |
<reponame>sok63/sudoku-1
#
# Medusa based strategy module
#
import itertools
from logger import *
from playbook import *
from sudoku import *
class MedusaBase(Strategy):
def __init__(self, name, simple = True):
Strategy.__init__(self, name)
self.simple = simple
"""
Return the set of links in the graph optional... | |
of the data."""
if not PY2 and isinstance(self.data, bytes):
return BytesIO(self.data)
else:
return StringIO(text_type(self.data))
class StreamHandler(DataHandler):
prop = 'stream'
@property
def stream(self):
"""Return the stream."""
return self._stream
@stream.setter
def stream(self, value):
"""Set the... | |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
-------------------------------------------------... | |
<gh_stars>100-1000
"""Test SegmentationMetricsByPixels and SegmentationMetricsByInstances classes.
Also act as tests for ClassificationMetrics, since it's identical to
SegmentationMetricsByPixels.
Structurally, file consists of four classes, which respectively check:
- basic assembly process (shapes compatibility, con... | |
layer params.')
p.Define(
'model_dim', 512, 'Model dimension that applies to embedding '
'layers and all Transformer layers.')
p.Define('num_trans_layers', 6, 'Number of Transformer layers.')
p.Define('trans_tpl', layers_with_attention.TransformerLayer.Params(),
'Transformer Layer params.')
p.Define('input_dropo... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
This is a simple generalized harness for training a classifier on a coco dataset.
Given a COCO-style dataset data (you can create a sample coco dataset using the
kwcoco CLI), this module trains a classifier on chipped regions denoted by the
coco annotations. These chips are c... | |
ID.
dataset_id (string): BigQuery dataset ID.
project_id (string): BigQuery project ID.
Returns:
list of clustering fields is the table has cluster fields, None otherwise.
"""
table_ref = self.get_table_ref(dataset_id, table_id, project_id=project_id)
clustering_fields = self.client.get_table(table_ref).cluster... | |
k1="0" k2="0" k3="0.6276" k4="0.0" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0.00" phase2="3.141592653589793" phase3="0.00" phase4="3.141592653589793"/>
<Proper type1="C135" type2="C137" type3="C135" type4="H140" k1="0" k2="0" k3="0.6276" k4="0.0" periodicity1="1" periodicity2="2" per... | |
<gh_stars>0
"""
Collection of tests for Ivy modules
"""
# global
import pytest
import numpy as np
# local
import ivy
import ivy_tests.helpers as helpers
class TrainableModule(ivy.Module):
def __init__(self, in_size, out_size, dev=None, hidden_size=64, v=None, with_partial_v=False):
self._linear0 = ivy.Linear(in_... | |
<gh_stars>1-10
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .config import CfgNode as CN
# -----------------------------------------------------------------------------
# Convention about Training / Test specific parameters
# --------------------------------------------------------------... | |
import copy
from .test_constants import GeometryTestCase
from geompy.core.Construction import Construction
from geompy.core.Point import Point
from geompy.core.Line import Line
from geompy.core.PrebuiltConstructions import BaseConstruction
from geompy.core.Angle import Angle
from geompy.cas import sympify
from copy ... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import wx
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import time
import RTyyyy_uidef
import uidef
import uivar
import uilang
sys.path.append(os.path.abspath(".."))
from mem import memcore
from run import RTyyyy_rundef
from run import rundef
from fuse ... | |
a CoreSightComponentID instance.
@param filter Optional filter callable. Must accept a CoreSightComponentID instance and
return a boolean indicating whether to perform the action (True applies action).
"""
for component in self._components:
# Recurse into child ROM tables.
if isinstance(component, ROMTable):
com... | |
k in self.reactions]
if version >= 29:
data['url'] = self.url
else:
data['audio_url'] = self.legacy_url
if version >= 32:
data['external_plays'] = self.external_plays
if version >= 33:
data['external_content_id'] = self.external_content_id
if version >= 35:
data['attachments'] = self.attachments
return data
... | |
<reponame>alexeyche/dnn_old
#!/usr/bin/env python
import numpy as np
import sys
import argparse
import logging
import os
import json
from os.path import join as pj
from StringIO import StringIO as sstream
import subprocess as sub
import uuid
import time
from collections import OrderedDict
import multiprocessing
import... | |
'xlsx'):
import xlrd
content = fobj.read()
workbook = xlrd.open_workbook(filename=None, file_contents=content)
table = workbook.sheets()[0]
for line in xrange(table.nrows):
#前x行跳过
if line in (0,):
continue
lines.append( table.row_values(line) )
idx = 0
if len(lines)>500:
messages.add_message(request, messag... | |
<filename>opentnsim/core.py
"""Main module."""
# package(s) related to time, space and id
import json
import logging
import uuid
# you need these dependencies (you can get these from anaconda)
# package(s) related to the simulation
import simpy
import random
import networkx as nx
import numpy as np
import math
import... | |
# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class Cluste... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.