input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
#Import all necessary libraries
#Data File Libraries
import csv
import pandas as pd
import glob
import os
#Math Function Libraries
import math
import statistics
#3D Graphing Libraries
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Re... | |
'Liston'},
'61745005':{'en': 'Coondarra'},
'61745004':{'en': 'Chinchilla'},
'61745007':{'en': '<NAME>'},
'61745006':{'en': 'Dalby'},
'61745001':{'en': 'Brigalow'},
'61745000':{'en': 'Bowenville'},
'61745003':{'en': 'Cecil Plains'},
'61745002':{'en': 'Bunya Mountains'},
'61380994':{'en': 'Sunbury'},
'61380995'... | |
loaded. To load it, do `{ctx.prefix}load mod`. You can also install/load the WarnSystem cog.")
msg = copy(ctx.message)
msg.author = ctx.author
msg.channel = ctx.channel
if reason == "not":
msg.content = f"{ctx.prefix}ban {user.id}"
else:
msg.content = f"{ctx.prefix}ban {user.id} {reason}"
ctx.bot.dispat... | |
'y', 'z'], description='Slice plane', disabled=False, layout= widgets.Layout(display='flex', flex_flow='row'))
left_widgets = widgets.VBox([dump, slice_index, quantity, direction], layout=widgets.Layout(width="30%"))
# center widgets in graph settings
value_label = widgets.Label(value="Value Range to Display:")
v... | |
# Copyright (c) 2020 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 required by applicabl... | |
("The work of the authors cited in this review has been supported by FONDECYT grant numbers: 1110352 and 1150200 to MA; 1141088 to JF; DIPOG grant 391340281 to JF; FONDECYT Postdoctoral fellow 3170497 to JC and 3190843 to AE.",
{"entities": []}),
#130
("An earlier onset of OCD symptoms is observed in men compared w... | |
import pandas as pd
import numpy as np
import geopandas as gpd
import math
import fiona
import rasterio
import glob
import os
import pickle
import affine6p
import matplotlib
import time
import datetime
from matplotlib import pyplot as plt
import rasterio.mask as rmask
from rasterio.merge import merge
from rasterio.plo... | |
<reponame>Schevo/schevo<gh_stars>1-10
"""Entity/extent unit tests."""
# Copyright (c) 2001-2009 ElevenCraft Inc.
# See LICENSE for details.
import datetime
import random
from schevo.constant import UNASSIGNED
from schevo import error
from schevo import test
from schevo.test import CreatesSchema, raises
from schevo.t... | |
# 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 ... | |
<filename>chemsep_operation.py
"""ChemSep database operations. Gather serialized XML data,
convert paramaters and add functions"""
import math
import numpy as np
import xml.etree.ElementTree as ET
from pickle import load, dump
class Chemical(object):
def __init__(self, name, lib_index):
self.name = n... | |
= []
decoder_predict_outputs = []
for i in range(self.n_channels):
dense_spec['units'] = self.n_hidden
prev_decoder = Dense(**dense_spec)
dense_spec['units'] = self.n_bins[i]
decoder_dense = Dense(**dense_spec)
train_outputs += [decoder_dense(prev_decoder(decoder_output))]
decoder_predict_outputs += [decoder_d... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# dualPrint v1.2
# A multi-platform aplication that generates print sets for multiple pages per sheet, two-sided, printing.
# By <NAME> <EMAIL>, http://www.sourceforge.net/projects/dualprint
import pygtk
pygtk.require('2.0')
import gobject
import random
import... | |
# Copyright 2019 The Matrix.org Foundation CIC
#
# 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 t... | |
import numpy as np
class Real():
def __init__(self, value: float = 0):
self.value = np.array([value], dtype=float)
def __add__(self, rhs):
out = Real()
if isinstance(rhs, Real):
out.value = self.value + rhs.value
else:
out.value = self.value + rhs
return out
def __radd__(self, lhs):
out = Real()
if isin... | |
S 39702528 cmand
29140 1 0% 0% 0% S 4927488 rotee
29439 1 0% 0% 0% S 4927488 rotee
29452 27708 0% 0% 0% S 4407296 pman.sh
29495 28464 0% 0% 0% S 27250688 emd
29699 27708 0% 0% 0% S 4407296 pman.sh
29704 1 0% 0% 0% S 4927488 rotee
29787 28831 0% 0% 0% S 4294967295 fman_rp
29949 1 0% 0% 0% S 4927488 rotee... | |
logger.debug(f"target book: {book}")
if len(book) > 0:
notable_work = book
item_kind = "book"
logger.debug(f"notable_work: {notable_work}")
# TODO : oh my god
if notable_work:
# body = "So... "
body = ""
prompt = random.choice(this_gossip.REACTION_TO_CREATIVE_WORK[bot_emotion_towards_current_person])
promp... | |
<gh_stars>100-1000
#!/usr/bin/python3
import clang.cindex
from clang.cindex import CursorKind
from clang.cindex import TypeKind
from clang.cindex import TranslationUnit
import sys
from dataclasses import dataclass, field
import subprocess
import logging
logger = logging.getLogger()
logger.setLevel(logging.WARNING)
@da... | |
- start, end, start
def get_cbm_vbm(self, tol: float = 0.001, abs_tol: bool = False, spin: Spin = None):
"""
Expects a DOS object and finds the cbm and vbm.
Args:
tol: tolerance in occupations for determining the gap
abs_tol: An absolute tolerance (True) and a relative one (False)
spin: Possible values are Non... | |
<filename>corems/molecular_id/calc/math_distance.py
import numpy as np
import scipy.stats
'''exploratory module based on Yuanyue Li code at
TODO add GitHub and Paper here'''
def entropy_distance(v, y):
merged = v + y
entropy_increase = 2 * scipy.stats.entropy(merged) - scipy.stats.entropy(v) - scipy.stats.entropy(y... | |
<reponame>pooyamb/aiotg
import os
import re
import logging
import asyncio
from urllib.parse import splitpasswd, splituser, urlparse
import aiohttp
from aiohttp import web
from aiosocksy import Socks4Auth, Socks5Auth, connector as socks_connector
import json
try:
import certifi
import ssl
except ImportError:
certif... | |
<reponame>ratschlab/spladder
import pysam
import re
import numpy as np
import scipy.sparse
import copy
import time
import h5py
import uuid
if __package__ is None:
__package__ = 'modules'
from .utils import *
from .init import *
def get_reads(fname, chr_name, start, stop, strand=None, filter=None, mapped=True, splic... | |
# 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 ... | |
val:
:rtype: PreviewError
"""
return cls('path', val)
def is_path(self):
"""
Check if the union tag is ``path``.
:rtype: bool
"""
return self._tag == 'path'
def is_in_progress(self):
"""
Check if the union tag is ``in_progress``.
:rtype: bool
"""
return self._tag == 'in_progress'
def is_unsupported... | |
from abaqusConstants import *
class GraphicsOptions:
"""The GraphicsOptions object stores settings that control how objects are rendered in all
viewports. GraphicsOptions objects are accessed in one of two ways:
- The default graphics options. These settings are used as defaults when you start a
session and by ... | |
#!/usr/bin/env python
"""
============
Image Target
============
Create continuum and spectral line images for the ALMA targets.
NOTE: Run with `execfile` in CASA to use this script.
"""
from __future__ import (print_function, division)
import os
import glob
import shutil
import datetime
from collections import namedt... | |
Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.369768,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime ... | |
# Copyright 2017 The Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | |
region, as discussed
# in the paper
do_local_betweenness(G, neighborhood, h, operator.neg)
G.delete_edges(edge)
fix_betweennesses(G)
# adds back in local betweennesses after the deletion
do_local_betweenness(G, neighborhood, h, operator.pos)
return check_for_split(G, tup)
def fix_pair_betweennesses(G):
"""
... | |
# query component names from data_stage01_isotopomer_mqresultstable
def get_componentsNames_experimentIDAndSampleID(self,experiment_id_I,sample_id_I,exp_type_I=5):
'''Querry component names that are used and are not IS from
the experiment and sample_id'''
try:
component_names = self.session.query(data_stage01_isot... | |
import time, datetime, argparse
import os, sys
import numpy as np
np.set_printoptions(precision=2)
import matplotlib.pyplot as plt
import copy as cp
import pickle
PROJECT_PATH = '/home/nbuckman/Dropbox (MIT)/DRL/2020_01_cooperative_mpc/mpc-multiple-vehicles/'
sys.path.append(PROJECT_PATH)
import casadi as cas
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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
__author__ = '<EMAIL> @spazvt'
__author__ = '<NAME> @alice_und_bob'
from datetime import datetime
import os
import logging
from pathlib import Path
import simplejson as json
import io
import eth_utils
from numpy.core.defchararray import lower
from subscrape.decode.decode_evm_transaction import decode_tx
from subscrap... | |
<reponame>tseaver/Zope-RFA<filename>src/Shared/DC/xml/ppml.py
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should a... | |
# coding: utf-8
"""
"""
from copy import deepcopy
import datetime
import io
import json
import os
import flask
import flask_login
import itsdangerous
import werkzeug.utils
from . import frontend
from .. import logic
from ..logic import user_log, object_log, comments, object_sorting
from ..logic.actions import Action... | |
Dict[str, str],
runtime: util_models.RuntimeOptions,
) -> cas_models.ListResourceComputertypefamilyResponse:
"""
Description: 查询云服务器规格族列表
Summary: 查询云服务器规格族列表
"""
UtilClient.validate_model(request)
return cas_models.ListResourceComputertypefamilyResponse().from_map(
await self.do_request_async('1.0', 'antcloud... | |
<gh_stars>100-1000
""" Cisco_IOS_XR_sysadmin_clear_asr9k
This module contains definitions
for the Calvados model objects.
This module contains a collection of YANG
definitions for Cisco IOS\-XR SysAdmin configuration.
This module defines the top level container for
all 'clear' commands for Sysadmin.
Copyright(c) 2... | |
careful about edge cases
bounds = bounds[[durations >= minLength]]
maxes = maxes[[durations >= minLength]]
events = events[[durations >= minLength]]
if maxLength is not None and len(events) > 0:
durations = (bounds[:,1] - bounds[:,0] + 1) * ds
# TODO: refactor [durations <= maxLength] but be careful about edge c... | |
max_size_for_optimizer = None
ret_item_list = ret_item_list[0:first_false]
ret_arr['items'] = ret_item_list
if max_size is not None:
ret_arr['maxItems'] = max_size
if max_size_for_optimizer is not None:
if max_size is None or max_size_for_optimizer < max_size:
ret_arr['maxItemsForOptimizer'] = max_size_for_opt... | |
in Python Dash Gallery,
found at: https://github.com/plotly/dash-sample-apps/tree/master/apps/dash-tsne/demo.py
'''
# Callback function for the learn-more button
@app.callback(
[
Output("description-text", "children"),
Output("learn-more-button", "children"),
],
[Input("learn-more-button", "n_clicks")],
)
d... | |
pyxb.utils.utility.Location(u'avm.xsd', 474, 8)
Expression = property(__Expression.value, __Expression.set, None, None)
_ElementMap.update({
__Operand.name() : __Operand
})
_AttributeMap.update({
__Expression.name() : __Expression
})
Namespace.addCategoryObject('typeBinding', u'ComplexFormula', Comp... | |
= expt['nu_line'] / (1. + c['z'])
l = 3e8 / (nu * 1e6) # Wavelength (m)
Ddish = expt['Ddish']
# Calculate FOV (180deg * theta for cylinder mode)
fov = np.pi * (l / Ddish) if 'cyl' in expt['mode'] else (l / Ddish)**2.
# Calculate interferometer baseline density, n(u)
if "n(x)" in list(expt.keys()):
# Rescale... | |
80,
(83, '-'): 80,
(83, '.'): 80,
(83, '/'): 1,
(83, '0'): 80,
(83, '1'): 80,
(83, '2'): 80,
(83, '3'): 80,
(83, '4'): 80,
(83, '5'): 80,
(83, '6'): 80,
(83, '7'): 80,
(83, '8'): 80,
(83, '9'): 80,
(83, ':'): 80,
(83, ';'): 80,
(83, '<'): 80,
(83, '='): 80,
(83, '>'): 80,
(83, '?'): 80,
(83, '@'): 8... | |
0.5*m.x1649 - 0.5*m.x1650 - 0.5*m.x1843 - 0.5*m.x1844 + m.x3575
== 0)
m.c3530 = Constraint(expr= - 0.5*m.x1262 - 0.5*m.x1263 - 0.5*m.x1650 - 0.5*m.x1651 - 0.5*m.x1844 - 0.5*m.x1845 + m.x3576
== 0)
m.c3531 = Constraint(expr= - 0.5*m.x1263 - 0.5*m.x1264 - 0.5*m.x1651 - 0.5*m.x1652 - 0.5*m.x1845 - 0.5*m.x1846 + m.x357... | |
QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
sizePolicyFF = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicyFF.setHorizontalStretch(0)
sizePolicyFF.setVerticalStretch(0)
s... | |
ABOVE
0746 SYRIAC THREE DOTS BELOW
0747 SYRIAC OBLIQUE LINE ABOVE
0748 SYRIAC OBLIQUE LINE BELOW
0749 SYRIAC MUSIC
074A <NAME>
074D SYRIAC LETTER SOGDIAN ZHAIN
074E SYRIAC LETTER SOGDIAN KHAPH
074F SYRIAC LETTER SOGDIAN FE
0750 ARABIC LETTER BEH WITH THREE DOTS HORIZONTALLY BELOW
0751 ARABIC LETTER BEH WITH DOT BELOW A... | |
# -*- coding: utf-8 -*-
"""Windows Registry plugin to parse the AMCache.hve Root key."""
import re
from dfdatetime import filetime as dfdatetime_filetime
from dfdatetime import posix_time as dfdatetime_posix_time
from dfdatetime import time_elements as dfdatetime_time_elements
from dfwinreg import errors as dfwinreg... | |
positive labels
y_polytope = np.copy(y)
# if label is inside of the polytope, the distance is negative and the label is not divided into
y_polytope[y_polytope != idx_outside_polytope] = -1
# if label is outside of the polytope, the distance is positive and the label is clustered
y_polytope[y_polytope == idx_outsid... | |
'''
Do some forced-photometry simulations to look at how errors in
astrometry affect the results. Can we do anything with forced
photometry to measure astrometric offsets? (photometer PSF + its
derivatives?)
'''
from __future__ import print_function
import sys
import os
import numpy as np
import pylab as plt
import fit... | |
<filename>manimlib/mobject/svg/mtex_mobject.py
from __future__ import annotations
import re
import colour
import itertools as it
from types import MethodType
from typing import Iterable, Union, Sequence
from manimlib.constants import WHITE
from manimlib.mobject.svg.svg_mobject import SVGMobject
from manimlib.mobject.... | |
(len(states.shape) == 2)
return self.embedder(states, stop_gradient=stop_gradient)
def fit(self, states, actions,
rewards, discounts,
next_states):
"""Updates critic parameters.
Args:
states: Batch of sequences of states.
actions: Batch of sequences of actions.
rewards: Batch of sequences of rewards.
next_s... | |
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This uses the i2c-pseudo driver to implement a local Linux I2C adapter of a
Servo/DUT I2C bus.
"""
import collections
import errno
import logging
imp... | |
<filename>services/Solver/utils/table.py
import config
from utils.wikidata_util import get_wiki_type
import re
import traceback
from tabulate import tabulate
from audit.audit import Audit
from checkpoint.checkpoint import CheckPoint
class ParsedTable():
def __init__(self, raw, targets):
"""
parse the raw input in... | |
flag')
__repr__ = _swig_repr
NONE = _gskernel.GsBuildingFillSymbol_NONE
r""" 不设置"""
CONSTANTNUM = _gskernel.GsBuildingFillSymbol_CONSTANTNUM
r""" 常数"""
FIELDKEY = _gskernel.GsBuildingFillSymbol_FIELDKEY
r""" 字段"""
AUTOCAL = _gskernel.GsBuildingFillSymbol_AUTOCAL
r""" 脚本计算"""
def __init__(self):
... | |
'''
Train and test bidirectional language models.
'''
import os
import time
import json
import re
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import linalg_ops
from tensorflow.python.ops import math_ops
from horovod.tensorflow.compression import C... | |
amp_mod[pos]*temp_jitt[diff:]
else:
diff = n_samples - (spos - cut_out[0])
gt_source[spos - cut_out[0]:] += amp_mod[pos]*temp_jitt[:diff]
else:
# print('No modulation')
for pos, spos in enumerate(spike_pos):
if spos - cut_out[0] >= 0 and spos - cut_out[0] + len_spike <= n_samples:
gt_source[spos - cut_out[0]:sp... | |
<reponame>CartoDB/bigmetadata
from tasks.base_tasks import (ColumnsTask, TableTask, TagsTask, CSV2TempTableTask, RepoFileUnzipTask,
RepoFileGUnzipTask, RepoFile)
from tasks.eu.geo import NUTSColumns, NUTSGeometries
from tasks.meta import OBSColumn, OBSTag, current_session, GEOM_REF
from tasks.tags import SectionTags, ... | |
from tkinter import *
from threading import Thread
from tkinter.filedialog import askdirectory
from tkinter.filedialog import askopenfilename
from tkinter.filedialog import asksaveasfilename
from tkinter.messagebox import showinfo
from os.path import isdir
from os.path import isfile
import pandas as pd
import numpy as ... | |
<gh_stars>0
import warnings
warnings.filterwarnings("once", category=DeprecationWarning) # noqa: E402
import os
from functools import partial
import shutil
import unittest
import copy
import time
import numpy as np
import pandas as pd
import shapely.geometry as shpg
from numpy.testing import assert_allclose
import pyt... | |
'command': 'image_get_all',
'kwargs': {'limit': 1},
}]
req.body = jsonutils.dump_as_bytes(cmd)
res = req.get_response(self.api)
images = jsonutils.loads(res.body)[0]
self.assertEqual(200, res.status_int)
self._compare_images_and_uuids([UUID4], images)
def test_get_index_limit_marker(self):
"""Tests that the ... | |
def algorithms(self):
"""Returns a list of stemming algorithms provided by the py-stemmer
library.
"""
import Stemmer # @UnresolvedImport
return Stemmer.algorithms()
def cache_info(self):
return None
def _get_stemmer_fn(self):
import Stemmer # @UnresolvedImport
stemmer = Stemmer.Stemmer(self.lang)
stemm... | |
import json
import os
import pytest
from collections import OrderedDict
from rdflib import URIRef
from unittest import mock
from ..commands import generate_ontology as go
from ..commands.owltools import Owler
pytestmark = [pytest.mark.setone, pytest.mark.working]
def test_parse_args_defaults():
args = []
args = ... | |
# -*- coding: utf-8 -*-
import json
import logging
import warnings
from itertools import combinations_with_replacement
from pathlib import Path
import numpy as np
from mff import gp, interpolation, kernels, utility, models
from .base import Model
logger = logging.getLogger(__name__)
class NpEncoder(json.JSONEnc... | |
device, dtype):
from torch.testing._internal.common_utils import random_hermitian_pd_matrix
batchsize = 2
A = random_hermitian_pd_matrix(3, batchsize, dtype=dtype, device=device)
A_triu = A.triu() # fill the lower triangular part with zero
U = torch.cholesky(A_triu, upper=True)
reconstruct_A = U.mH @ U
self.a... | |
address = self.get_ip_address(ip_address)
if address and address.association_id:
self.conn.disassociate_address(ip_address, association_id=address.association_id)
else:
self.conn.disassociate_address(ip_address)
if len(ip_addresses) == 1:
msg = _(u'Successfully disassociated the IP from the instance.')
else:
pr... | |
<reponame>ka05/tdameritrade
import pandas as pd
import os
from .session import TDASession
from .exceptions import handle_error_response, TDAAPIError
from .urls import (
# --ORDERS--
CANCEL_ORDER,
# GET_ORDER,
# GET_ORDERS_BY_PATH,
GET_ORDER_BY_QUERY,
PLACE_ORDER,
REPLACE_ORDER,
STATUS_VALUES,
# --SAVED ORDERS-... | |
<gh_stars>1-10
"""
@Author:
@Date: 10/01/2019
"""
import os
from collections import Counter
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from collections import namedtuple
from utility.json_utils import load_json
import funct... | |
<reponame>pyspace/pyspace<filename>pySPACE/tests/utils/data/test_data_generation.py<gh_stars>10-100
""" Data generation facilities to test algorithms or node chains e.g. in unittests """
import numpy
import pylab
import scipy
import abc
import warnings
from pySPACE.resources.data_types.time_series import TimeSeries... | |
<filename>joint_monophyler.py
import numpy as np
from scipy.special import comb
from collections import Counter
from scipy.linalg import expm
from numpy.linalg import solve
from ete3 import Tree
from discreteMarkovChain import markovChain
import time
import sys
import pandas
import csv
# This function ta... | |
# The copyright in this software is being made available under the BSD License,
# included below. This software may be subject to other third party and contributor
# rights, including patent rights, and no such rights are granted under this license.
#
# Copyright (c) 2015, Dash Industry Forum.
# All rights reserved.
#
... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import os
import json
import time
import torch
import torch.nn as nn
import torch.nn.functional as F
import cv2
import glob2
import argparse
import numpy as np
import copy
import sys
import random
import pandas as pd
import math
from pathlib import Path
import albumentations.pytor... | |
10.0
elif sascore < 1.: sascore = 1.0
return sascore
"""Scores based on an ECFP classifier for activity."""
# clf_model = None
def load_drd2_model():
name = 'oracle/drd2.pkl'
try:
with open(name, "rb") as f:
clf_model = pickle.load(f)
except EOFError:
import sys
sys.exit("TDC is hosted in Harvard Dataverse... | |
###################################################################################
# #
# This is a comprehensive set of analysis methods and tools #
# for the standart output of the Neutron Star Merger simulations #
# done with WhiskyTHC code. #
# #
#####################################################################... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
_
/ | | __ _ __ _
/ | / |_||_|| ||
/ | / | |\ | ||_
/____ |__/\ . | | \|_|\_|
__________________________ .
███████╗██████╗ ██████╗ ██████╗██╗ ██╗
██╔════╝██╔══██╗██╔═══██╗██╔════╝██║ ██║
█████╗ ██████╔╝██║ ██║██║ ███████║
██╔══╝ ██╔═══╝ ██║ ██║██║ ██╔══██║ ... | |
<reponame>XiYe20/VPTR
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader, random_split
from torch.utils.tensorboard import SummaryWriter
import torch.nn.functional as F
import torch.distributed as dist
import torch... | |
0.0029 -0.04173 -1.23600 0.2529 7.5 -0.5096 0.00000 0.0483 6.75 1000 750 2.5 3.2 -0.72744 -0.46341 0.6651 0.3792
0.260 2.48747 0.0029 -0.04768 -1.21882 0.2529 7.5 -0.5096 0.00000 0.0478 6.75 1000 750 2.5 3.2 -0.77335 -0.48705 0.6650 0.3754
0.280 2.38739 0.0029 -0.05178 -1.19543 0.2529 7.5 -0.5096 0.00000 0.0474 6.75 ... | |
import sys
import os
import decimal
import string
import logger
# template configuration: in theory this stuff could be
# modified at runtime, though in practice that seems unlikely
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_DIR = os.path.abspath(THIS_DIR + '/templates')
TEMPLATES = [ '01_header.c_... | |
<reponame>imduffy15/python-androidtv<gh_stars>0
"""Constants used throughout the code.
**Links**
* `ADB key event codes <https://developer.android.com/reference/android/view/KeyEvent>`_
* `MediaSession PlaybackState property <https://developer.android.com/reference/android/media/session/PlaybackState.html>`_
"""
i... | |
"""
The Conductor.
The conductor is responsible for coordinating messages that are received
over the network, communicating with the ledger, passing messages to handlers,
instantiating concrete implementations of required modules and storing data in the
wallet.
"""
import hashlib
import json
import logging
import os... | |
<reponame>GalBenZvi/publication_list_generator
# Copyright 2017-2019, <NAME> and The Tor Project
# See LICENSE for licensing information
"""
Parsing for `Tor Ed25519 certificates
<https://gitweb.torproject.org/torspec.git/tree/cert-spec.txt>`_, which are
used to for a variety of purposes...
* validating the key used... | |
u0 {1,S}
4 Ct u0 {1,S}
5 H u0 {1,S}
6 S2d u0 {2,D}
""",
thermo = None,
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
index = -1,
label = "Cs-C=SC=SC=SH",
group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {5,S}
2 CS u0 {1,S} {6,D}
3 CS u0 {1,S} {7,D}
4 CS u0 {1,S} {8,D}
5 H u0 {1,S}
6 S2d u0 {2,D}
7 S2d u0 {3,D}
8 ... | |
!= len([t for t in notebook_block_types if t == 'cell']):
errwarn('*** error: internal error')
errwarn(' each code block should have a code environment')
_abort()
# Go through tex_blocks and wrap math blocks in $$
# (doconce.py runs align2equations so there are no align/align*
# environments in tex blocks)
labe... | |
36)
# #f0a1a8 合欢红
hex['HEHUANHONG'] = hex['hehuanhong'] = '#f0a1a8'
HEHUANHONG = hehuanhong = (240, 161, 168)
# #f1939c 春梅红
hex['CHUNMEIHONG'] = hex['chunmeihong'] = '#f1939c'
CHUNMEIHONG = chunmeihong = (241, 147, 156)
# #f07c82 香叶红
hex['XIANGYEHONG'] = hex['xiangyehong'] = '#f07c82'
XIANGYEHONG = xiangyehong = (240, ... | |
import random
import json
from inspect import isfunction
import asyncio
"""
This file contains all of the built in Kahoot handlers,
as well as methods to handle said handlers.
"""
ANS_TYPE = 0 # Answer type this instance uses
def get_place(place):
# Method for determining place
if place == 1:
return "st"
if ... | |
<filename>hyperparameter_search_dd2.py
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import time
import os
import numpy as np
import scipy
import scipy.misc
from skopt import gp_minimize
from skopt.space import Categorical
def expansion_number_to_string(e... | |
+ iII111i
if 62 - 62: i11iIiiIii + OoOoOO00 + i1IIi
if 69 - 69: OoOoOO00
if 63 - 63: OoO0O00 / OoOoOO00 * iIii1I11I1II1 . I1Ii111
if 85 - 85: i11iIiiIii / i11iIiiIii . OoO0O00 . O0
if 67 - 67: II111iiii / o0oOOo0O0Ooo . OOooOOo . OoooooooOO
if 19 - 19: IiII . I1ii11iIi11i / OoOoOO00
if 68 - 68: ooOoO0o / Ooooooo... | |
<gh_stars>10-100
import os
from pathlib import Path
from melloddy_tuner import utils
from melloddy_tuner.utils import helper, version
from melloddy_tuner.utils.config import ConfigDict
from melloddy_tuner.utils.standardizer import Standardizer
import time
from argparse import ArgumentParser
import numpy as np
import pa... | |
University"),
("Florida Atlantic University","Florida Atlantic University"),
("Florida Barber Academy","Florida Barber Academy"),
("Florida Career College-Miami","Florida Career College-Miami"),
("Florida Coastal School of Law","Florida Coastal School of Law"),
("Florida College of Integrative Medicine","Florida C... | |
from dai_imports import*
from utils import *
from obj_utils import*
from model import *
from fc import *
from darknet import*
import resnet_unet
import resnet_unet_2
import unet_model
import time
class CNNetwork(Network):
def __init__(self,
model = None,
model_name = 'custom_CNN',
model_type='regressor',
lr=0.02,... | |
possible list
of minimal periods of rational periodic points. Take each point modulo `p` associated to each
of these possible periods and try to lift it to a rational point with a combination of
`p`-adic approximation and the LLL basis reducion algorithm.
See [Hutz]_.
INPUT:
kwds:
- ``prime_bound`` - a pair ... | |
(relevant only to EMM custom region cost_convert).
Returns:
A dict with the same form as base_dict and add_dict, with the
values for the particular census division specified in 'cd'
converted to the custom region 'cz'.
"""
# Extract lists of strings corresponding to the residential and
# commercial building ty... | |
# Copyright (c) 2014 eBay Software Foundation
# Copyright 2015 HP Software, LLC
# 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/LICEN... | |
def enterRule(self, listener:ParseTreeListener):
if hasattr( listener, "enterOperatorDeclaration" ):
listener.enterOperatorDeclaration(self)
def exitRule(self, listener:ParseTreeListener):
if hasattr( listener, "exitOperatorDeclaration" ):
listener.exitOperatorDeclaration(self)
def operatorDeclaration(self):... | |
<filename>astropy/wcs/tests/test_wcs.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from ...extern import six
import os
import sys
import warnings
import numpy as np
from numpy.testing import (
assert_allclose, as... | |
<gh_stars>0
##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.... | |
<filename>rqalpha_mod_vnpy/ctp/api.py
# -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, 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
... | |
m.x407 == 0)
m.c698 = Constraint(expr= m.x406 - m.x408 - m.x410 - m.x412 == 0)
m.c699 = Constraint(expr= m.x407 - m.x409 - m.x411 - m.x413 == 0)
m.c700 = Constraint(expr= m.x416 - m.x422 - m.x424 == 0)
m.c701 = Constraint(expr= m.x417 - m.x423 - m.x425 == 0)
m.c702 = Constraint(expr= m.x420 - m.x426 - m.x428 - m.x... | |
#!/usr/bin/env python
import setpath
import unittest
import os
from bike import testdata
from bike.query.findDefinition import findAllPossibleDefinitionsByCoords
from bike.query.getTypeOf import getTypeOf,resolveImportedModuleOrPackage
from bike.parsing.newstuff import getModuleOrPackageUsingFQN
from bike.parsing.fast... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.411735,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 4.47859,
'S... | |
import numpy as np
from utils import *
from tensorflow import keras
from tensorflow.keras.layers import Conv2D, AvgPool2D, MaxPool2D
from tensorflow.keras.layers import Dense, Flatten, Dropout
from tensorflow.keras.losses import CategoricalCrossentropy, SparseCategoricalCrossentropy
from tensorflow.keras.metrics ... | |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import, unicode_literals
from datetime import datetime, timedelta
import os
import django
from django import forms, temp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.