input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
if yk != 1111
lbf dec -434 if aao != -1344
kg dec -837 if f >= -1593
f inc 513 if eri <= -2804
fk dec -925 if fk >= -2756
t inc 280 if kg != 2100
lx dec 328 if dy < 3880
t inc -359 if j < -1103
es inc 289 if ada < -1203
x dec -414 if gk >= -574
aao dec 710 if dy == 3873
es dec -70 if ada <= -1187
ada dec 883 if j == -1... | |
<reponame>XLPRUtils/pyxllib<gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author : 陈坤泽
# @Email : <EMAIL>
# @Date : 2020/05/30
import collections
import filecmp
import os
import pathlib
import random
import re
import shutil
import tempfile
import humanfriendly
# 大小写不敏感字典
import pyxllib.stdlib.zi... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# COPYRIGHT (C) 2014-2020 <NAME>.
# This software is released under the MIT License.
# https://github.com/konsan1101
# Thank you for keeping the rules.
import sys
import os
import time
import datetime
import codecs
import glob
import json
import queue
impo... | |
"""tests for the IsoSurfGeom module"""
from os import listdir, remove, getcwd, mkdir
from os.path import isfile, isdir, join
import pytest
from pymoab import core, types
import numpy as np
import itertools
import warnings
from IsogeomGenerator import isg, ivdb
# Set up test files and expected results
test_dir = getcw... | |
==2 \
and now_hand_card[line][row+1] ==1: #889,打出9
print('打出的牌是{}'.format(self._get_card_str(line, row+1)))
print('打出牌的行列是:line = {}, row = {}'.format(line, row+1))
self._conv_req_mess('Discard双边6678', self._get_card_str(line, row+1), '') # 889打出9
return
elif row == 7 and now_hand_card[line][row-2] == 0 and now_h... | |
#!/usr/bin/env python3
import argparse
import glob
import json
import os
import re
from collections import defaultdict
from datetime import date, timedelta, datetime
OVERVIEW_COUNT = 10
# Common things ---------------------------------------------------------------
# See main at bottom
class ManualChange:
"""
Appl... | |
buildlogs, with the
given phase metadata. If the job reaches a completed state, update_job_phase also update the
queue and cleanups any existing state and executors.
"""
try:
job_data = self._orchestrator.get_key(job_id)
job_data_json = json.loads(job_data)
build_job = BuildJob(AttrDict(job_data_json["job_queue_... | |
- 1:
next_level = list_array[index + 1]['level']
next_cont = list_array[index + 1]['cont']
else:
next_level = None
next_cont = None
# Output
if prev_level is None or level > prev_level:
start = 0 if prev_level is None else prev_level
for current in range(start, level):
gen.append(' ' * current + f'<{starter}>... | |
import os
import platform
import shutil
import tempfile
import warnings
from collections import Counter
from os.path import join as pjoin
from typing import MutableMapping, Optional
import lmdb
import configparser
from . import constants as c
from . import __version__
class TxnRegisterSingleton(type):
_instances =... | |
int
AutoCADOfflineHelpNotInstalled_UseOnlineHelpButon: int
AutoCADOnlineHelpNotAccessible: int
AutoCADOnlineHelpNotAccessible_TryConnectInternetButon: int
AutoCADOnlineHelpNotAccessible_UseOfflineHelpButon: int
AutoCADParametricExpression: int
AutoCADParametricExpression_ParametricExpression_CancelButon: int
Aut... | |
# C2SMART Lab, NYU
# NCHRP 03-137
# @file DRAC_Calculation_Offline.py
# @author <NAME>
# @author <NAME>
# @date 2020-10-18
import pandas as pd
import numpy as np
from shapely.geometry import Polygon
import math
import time
import multiprocessing as mp
from itertools import repeat
from scipy import spatial
def frange(... | |
<gh_stars>0
import os
from datetime import date
from datetime import datetime as dt
import time # performance test
import subprocess
from subprocess import CalledProcessError
import uuid
import psutil
from netCDF4 import Dataset
from numpy import squeeze
from pywps import Process
from pywps import LiteralInput, Lite... | |
from __future__ import division, print_function
import sys
import os
import time
import enum
import numpy as np
from mpi4py import MPI
import h5py
from .finite_differences import SOR_step, apply_operator
from scipy.fftpack import fft2, ifft2
def format_float(x, sigfigs=4, units=''):
"""Returns a string of the float ... | |
<reponame>maayane/PhotoFit
"""*******************************************************
This module has functions converting distances
*****************************************************
"""
#print __doc__
import astropy
import math
from SOPRANOS import distances_conversions
from SOPRANOS import extinction
import nu... | |
* @param {number} h=fh - высота для рисования
# * @returns {self}
# '''
# drawGelFragment(name, fx, fy, fw, fh, x, y, w = fw, h = fh) { // TODO: Проверить
# // self.ctx.drawImage(self.Gel[name], fx, fy, fw, fh, x, y, w, h)
# return self
# },
# ''' Создает текстуру из геля
# * @param {string} gelname - Имя геля
# * @pa... | |
<= 1.:
dp_over_p = (M ** 2. / 5. + 1.) ** 3.5 - 1.
else:
dp_over_p = (F * M ** 7.) / (7. * M ** 2. - 1.) ** 2.5 - 1.
return dp_over_p
# #############################################################################
#
# conversions between cas, mach and altitude
#
# pick any two values, and find the third
#
# ####... | |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# webull: wrapper around unofficial webull APIs
# https://github.com/tedchou12/webull.git
# Copyright 2019-2021 vin8tech
#
# 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... | |
vertex_ys = []
bounding_confidences = []
bounding_importance_fracs = []
dominant_blues = []
dominant_greens = []
dominant_reds = []
dominant_pixel_fracs = []
dominant_scores = []
label_descriptions = []
label_scores = []
nf_count = 0
nl_count = 0
for pet in test_data['PetID'].values:
try:
with open('../in... | |
['AIR_WAYBILL', 'CERTIFICATE_OF_ORIGIN', 'COMMERCIAL_INVOICE', 'NAFTA_CERTIFICATE_OF_ORIGIN', 'PRO_FORMA_INVOICE']
if value not in enumerations:
lineno = self.gds_get_node_lineno_()
self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on EnterpriseDocumentType' % {"... | |
GMT 2020'),
('2020-01-01 10:00:00', 'DATE', 'text', 'Wed Jan 01 10:00:00 GMT 2020'),
('2020-01-01 10:00:00', 'DATE', 'blob', b'Wed Jan 01 10:00:00 GMT 2020'),
# Time
('2020-01-01 10:00:00', 'TIME', 'date', datetime.date(2020, 1, 1)),
('2020-01-01 10:00:00', 'TIME', 'datetime', datetime.datetime(2020, 1, 1, 10, 0))... | |
<filename>jobman/runner.py
import os
import sys
import time
import tempfile
import inspect
import shutil
import optparse
from optparse import OptionParser
from .tools import DD, expand, format_help, resolve, UsageError
from .channel import StandardChannel
from . import tools
from . import workdirgen
################... | |
RegisterForm(request.form)
if request.method == 'POST' and form.validate():
username = form.username.data
folder = os.path.exists(app.root_path + r"\static\uploads\users\{}".format(username))
if folder == True:
flash('Folder Name Already Exists', 'warning')
return redirect(url_for('user_register'))
cur = mysql... | |
<gh_stars>1-10
# A CAN message.
import binascii
from copy import deepcopy
from .signal import NamedSignalValue
from ..utils import format_or
from ..utils import start_bit
from ..utils import encode_data
from ..utils import decode_data
from ..utils import create_encode_decode_formats
from ..errors import Error
from .... | |
% key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'registration_id' is set
if ('registration_id' not in params) or (params['registration_id'] is None):
raise ValueError("Missing the required parameter `registration_id` when calling `get_registration_instance_launch_history`")
# verif... | |
<reponame>KLordy/flink<gh_stars>0
################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright owne... | |
= self.get_extended_attention_mask(attn_mask)
extended_attention_mask = self.get_extended_attention_mask(input_ids, token_type_ids, attention_mask)
if input_ids.size(1)>len_vis_input:
img_embed_out = self.img_embeddings(input_ids[:, :len_vis_input+2], img, img_pos, token_type_ids[:, :len_vis_input+2]) # img_embed_o... | |
<gh_stars>0
from testutils import assert_raises
x = [1, 2, 3]
assert x[0] == 1
assert x[1] == 2
# assert x[7]
y = [2, *x]
assert y == [2, 1, 2, 3]
y.extend(x)
assert y == [2, 1, 2, 3, 1, 2, 3]
assert x * 0 == [], "list __mul__ by 0 failed"
assert x * -1 == [], "list __mul__ by -1 failed"
assert x * 2 == [1, 2, 3, 1... | |
#! /usr/bin/python
## SIMULATION OF A SYSTEM AT CONSTANT TEMPERATURE
##### PLEASE READ ALL THE COMMENTS!!!!
#### REMEMBER THAT IN PYTHON INDEX BEGINS IN 0 !!!
###################################################################
## If initial forces are set to zero because the initial geometry #
## is a stationar... | |
has_negation( feeling_match.group(1))
and
(re.search( r"(^|\W)(i|we)\W", feeling_match.group(1))
or re.search( r"^\W*$", feeling_match.group(1)))
):
return_value = True
return return_value
#######
# ###### ## #####
# # # # # #
##### ##### # # # #
# # ###### #####
# # # # # #
# ###### # # # #
fe... | |
col in cols[2:]:
for i in range(2, lnth):
cell = "{}{}".format(col, i)
part1 = '=IFERROR(New_Builds!{}*VLOOKUP(Lookups!$A$11, Lookups!$A$9:Lookups!$B$24, 2, FALSE), "-")'.format(cell)
ws[cell] = part1
ws['M1'] = 'Income Group'
for i in range(2,lnth):
cell = "M{}".format(i)
ws[cell] = "=IFERROR(INDEX(Options!$J... | |
# Imports
import os
import jinja2
import webapp2
import logging
import json
import urllib
import MySQLdb
import math
import numpy as np
from datetime import timedelta, datetime
#import pandas as pd
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
extensions=['jinja2... | |
mapping of runner names to job runner
instances.
For example:
::
ppl.run(runners={ 'my_runner': SpecialJobRunner() })
Any runner names that don't have associated job runner
instances will use the default runner defined via the
``default_runner`` argument.
Dynamically setting number of CPUs/threads via job runners... | |
from .api.functions import *
import posixpath
import csv
def attributes():
"""Output file attributes."""
lexical = [
'num_dot_url', 'num_hyphen_url', 'num_underline_url',
'num_bar_url', 'num_question_url', 'num_equal_url',
'num_atsign_url', 'num_ampersand_url', 'num_exclamation_url',
'num_space_url', 'num_tilde_... | |
# 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 ... | |
def users(self):
self._users_value = None
self._users_present = False
@property
def doc_owner(self):
"""
The Paper doc owner. This field is populated on every single response.
:rtype: sharing.UserInfo
"""
if self._doc_owner_present:
return self._doc_owner_value
else:
raise AttributeError("missing required... | |
import os
import sys
#import pip.utils.logging
#import pip
import socket
import tempfile
import threading
import subprocess
import xmlrpclib
import re
from cStringIO import StringIO
import sys
import shutil
import time
#import zipfile
from distutils.version import LooseVersion
if __name__ == "__main__":
import docass... | |
default = {"value": value}
attr = cls._attributes(field, default, **attributes)
select_items = []
for option in options:
if isinstance(option[1], dict):
items = [(v, k) for k, v in option[1].items()]
if not items:
continue
items.sort()
opts = [OPTION(v, _value=k) for v, k in items]
select_items.append(OPTGRO... | |
<reponame>aditya95sriram/td-slim
# coding=utf-8
import argparse
import os
import sys
import time
import networkx as nx
import subprocess
from operator import itemgetter
from networkx.drawing.nx_agraph import *
import matplotlib.pyplot as plt
import signal
from typing import Union
# optional dependency pysat+rc2
PYS... | |
# Establish that the underlying gRPC stub method was called.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0] == serviceusage.EnableServiceRequest()
# Establish that the response is the type that we expect.
assert isinstance(response, future.Future)
@pytest.mark.asyncio
async def test_... | |
is not expected",
'3.4.6.1.map_variables_with_map_variables':
"Element 'cellml:map_variables': This element is not expected",
'3.4.6.1.map_variables_with_model':
"Element 'cellml:model': This element is not expected",
'3.4.6.1.map_variables_with_reaction':
"Element 'cellml:reaction': This element is not expected"... | |
from types import DictType
from types import ListType
import com.ibm.ws.scripting
import logging
import os
import re
import sys
import wdr.app
import wdr.config
import wdr.task
(
AdminApp, AdminConfig, AdminControl, AdminTask, Help
) = wdr.WsadminObjects().getObjects()
logger = logging.getLogger('wdr.manifest')
_ge... | |
# Copyright 2019 U.C. Berkeley RISE Lab
#
# 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 wr... | |
<gh_stars>0
# py-motmetrics - Metrics for multiple object tracker (MOT) benchmarking.
# https://github.com/cheind/py-motmetrics/
#
# MIT License
# Copyright (c) 2017-2020 <NAME>, <NAME> and others.
# See LICENSE file for terms.
"""Obtain metrics from event logs."""
# pylint: disable=redefined-outer-name
from __futur... | |
on an entry
:return: Tuple with the job counts (used for stats)
and glidein counts (used for glidein_max_run)
Both are dictionaries keyed by glidename (entry)
"""
out_job_counts = {}
out_glidein_counts = {}
# Get the frequency of each running on
job_running_on_counts = dict(jobs["RunningOn"].value_counts())
... | |
common.WARNING("--popstr-max-call-DP must be >= --popstr-min-call-DP")
return False
if args.popstr_require_support is not None:
if args.popstr_require_support < 0:
common.WARNING("--popstr-require-support must be >= 0")
return False
assert "AD" in format_fields
return True
def CheckFilters(format_fields: Set[st... | |
import datetime
import inspect
import linecache
import logging
import os
import queue
import shlex
import sys
import threading
import time
import traceback
import uuid
from collections import OrderedDict, defaultdict
from itertools import chain, takewhile
from traceback import FrameSummary
from typing import (
Any,
C... | |
<reponame>Polidea/SiriusObfuscator
#!/usr/bin/env python
# build_script.py - Build, install, and test XCTest -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library E... | |
<reponame>qxcv/jiminy-cricket<filename>src/jiminy_cricket/annotated_env.py
import re
import os
import csv
import copy
import numpy as np
from jericho import FrotzEnv
from jiminy_cricket.game_info import game_info
class AnnotatedEnv():
def __init__(self, game_folder_path, seed=1, starting_percentage=0, log_dir=None):
... | |
self.total_stress_mean
self.ApplyLateralPressure(self.Pressure, self.XLAT, self.XBOT, self.XTOP, self.XBOTCORNER, self.XTOPCORNER,self.alpha_top,self.alpha_bot,self.alpha_lat)
def PrintGraph(self, time):
for smp in self.rigid_face_model_part.SubModelParts:
if smp[TOP]:
self.mesh_nodes = smp.Nodes
if(self.grap... | |
import warnings
import numpy as np
import pandas as pd
import networkx as nx
import statsmodels.api as sm
def probability_to_odds(prob):
"""Converts given probability (proportion) to odds
Parameters
----------
prob : float, array
Probability or array of probabilities to convert to odds
"""
return prob / (1 - ... | |
and a subdir
svntest.main.run_svn(None, 'propset', 'red', 'rojo', D_path)
svntest.main.run_svn(None, 'propset', 'black', 'bobo', E_path)
svntest.main.run_svn(None, 'propset', 'black', 'bobo', wc_dir)
# Create expected output tree.
expected_output = svntest.wc.State(wc_dir, {
'A/D' : Item(verb='Sending'),
'A/B/E... | |
import datetime
from functools import wraps
import json
import logging
import re
import signal
import sys
import argh
import flask
import gevent
import gevent.backdoor
from gevent.pywsgi import WSGIServer
import prometheus_client
import psycopg2
from psycopg2 import sql
import common
from common import database
from ... | |
"""
DSC20 WI22 HW05
Name: <NAME>
PID: A16679845
"""
# begin helper methods
def ceil(x):
"""
Simulation to math.ceil
No doctest needed
"""
if int(x) != x:
return int(x) + 1
return int(x)
def log(x):
"""
Simulation to math.log with base e
No doctests needed
"""
n = 1e10
return n * ((x ** (1/n)) - 1)
# end ... | |
"""<div class="bc-white padding302020">%s</div>"""
IMAGE_VIEW_TEMPLATE = """
<div class="marginT30 marginB10 text-center"><img src="%s" class="img-responsive" style="display:inline"></div>
"""
VIDEO_VIEW_TEMPLATE = """
<div class="marginT30 marginB10 text-center"><video src="%s" preload="auto" autoplay controls class=... | |
blocked by filter.
"""
my_event_callback = Mock()
protocol = SBE16Protocol(Prompt, NEWLINE, my_event_callback)
driver_capabilities = Capability.list()
test_capabilities = Capability.list()
# Add a bogus capability that will be filtered out.
test_capabilities.append("BOGUS_CAPABILITY")
# Verify "BOGUS_CAPABILI... | |
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to me... | |
OOooOOo . Oo0Ooo + Oo0Ooo % Oo0Ooo % O0
if 8 - 8: iII111i . Ii1I - i1IIi % OoO0O00 / I11i
if 13 - 13: Oo0Ooo / OoOoOO00 . I1ii11iIi11i . OOooOOo
ooooO0OO0O = 0
for IiIIi1IiiIiI in range ( 0 , IiI11 , 8 ) :
ii1i1I1111ii = byte_swap_64 ( struct . unpack ( "Q" , packet [ IiIIi1IiiIiI : IiIIi1IiiIiI + 8 ] ) [ 0 ] )
o... | |
<reponame>millerda/seaborn<filename>seaborn/tests/test_statistics.py
import numpy as np
import pandas as pd
try:
import statsmodels.distributions as smdist
except ImportError:
smdist = None
import pytest
from numpy.testing import assert_array_equal, assert_array_almost_equal
from .._statistics import (
KDE,
Hist... | |
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='Step')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespaceprefix_='', name_='Step', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespaceprefi... | |
import numpy as np
import click
import time
import pygame
import pygame.locals as pyloc
import librosa as lr
import ffmpeg
import logging
import re
import pyaudio
import subprocess
import json
import os
import signal
import pdb
logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__)
playlog = log.ge... | |
)
torch.save(self.model.state_dict(), path)
# Moving average of the loss for early stopping
if loss_term_ema and loss_flow_ema:
loss_term_ema = (
self.ema_alpha * losses[1] + (1.0 - self.ema_alpha) * loss_term_ema
)
loss_flow_ema = (
self.ema_alpha * losses[2] + (1.0 - self.ema_alpha) * loss_flow_ema
)
if (
... | |
RMS value
"""
return np.sqrt(np.mean(np.square(self.sig), axis))
def plot(self, fn=None, offset=0, scale=1, xlim=None, ylim=None, **kwargs):
"""Display signal graph
Parameters
----------
fn : func or None
Keyword or function (Default value = None)
offset : int or float
Offset each channel to create a stacke... | |
self.dflink[self.dflink.disSim <= 1 - self.ccReq]
# sort putting highest links in cluster on top
dfcl.sort_values(by='disSim', inplace=True, ascending=False)
dfcl.reset_index(inplace=True, drop=True)
dftemp = dfcl.copy()
clustlinks = {}
clustEvents = {}
clnum = 0
while len(dftemp) > 0:
ser = dftemp.iloc[0]
nd... | |
'yù',
0x9D28: 'yā',
0x9D29: 'dié',
0x9D2A: 'yù',
0x9D2B: 'tián',
0x9D2C: 'yīng',
0x9D2D: 'duī',
0x9D2E: 'wū',
0x9D2F: 'ér',
0x9D30: 'guā',
0x9D31: 'ài',
0x9D32: 'zhī',
0x9D33: 'yàn',
0x9D34: 'héng',
0x9D35: 'xiāo',
0x9D36: 'jiá',
0x9D37: 'liè',
0x9D38: 'zhū',
0x9D39: 'yáng',
0x9D3A: 'yí',
0x9D3B: 'h... | |
alert.
"""
return pulumi.get(self, "details")
@property
@pulumi.getter
def tags(self) -> Optional[Sequence[str]]:
"""
Tags of the alert.
"""
return pulumi.get(self, "tags")
@pulumi.output_type
class ServiceIncidentRuleIncidentRuleIncidentPropertyStakeholderProperty(dict):
def __init__(__self__, *,
message... | |
iris.analysis.MEAN)
CCCmaSMHI_50_S = CCCmaSMHI_50_S.aggregated_by('day_of_year', iris.analysis.MEAN)
CNRM_50_S = CNRM_50_S.aggregated_by('day_of_year', iris.analysis.MEAN)
CNRMSMHI_50_S = CNRMSMHI_50_S.aggregated_by('day_of_year', iris.analysis.MEAN)
CSIRO_50_S = CSIRO_50_S.aggregated_by('day_of_year', iris.ana... | |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 <NAME> (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Parsing of Netflix Website
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, division, unicode_literals
import js... | |
result.
:param title: A title of the field.
:param desc: A description of the field.
:param value: A values used to make radio buttons. Values must be
sequence of pairs, such as (('Female', 1), ('Male', 2), ('Gay', 3))
:param args: Arguments to be rendered in response.
:param objects: Files such as css, js to be ... | |
= op.v_max
x_eq = op.x_eq
y_eq = op.y_eq
z_eq = op.z_eq
else:
assert(ob)
u_min = ob.pov.u_min
u_max = ob.pov.u_max
v_min = ob.pov.v_min
v_max = ob.pov.v_max
x_eq = ob.pov.x_eq
y_eq = ob.pov.y_eq
z_eq = ob.pov.z_eq
#keep object rotation and location for the updated object
obloc = ob.location
obrot = ob.... | |
<filename>colte.py
def colte(sid,logg,feh,gg,bp,rp,j2,h2,k2,ebv,DR2=False,DR3=False,bprp_ex=False,pmod=False,COD=False,outfile=False,MC=False,trials=False,wato=False,elogg=[],efeh=[],egg=[],ebp=[],erp=[],ej2=[],eh2=[],ek2=[],eebv=[]):
'''
PURPOSE:
Compute stellar effective temperatures using colour-Teff relations ... | |
from pathlib import Path
from datetime import datetime, timedelta, tzinfo, timezone
from itertools import *
from influxdb import InfluxDBClient, DataFrameClient
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections.abc import Sequence
from scipy import integrate
class DBQuery():
""... | |
"hughie",
"dany",
"shaven",
"tombstones",
"usin",
"customized",
"auditing",
"dodds",
"covent",
"purvis",
"suss",
"doting",
"misato",
"jiggling",
"çetin",
"christensen",
"rotated",
"appendectomy",
"chorizo",
"ballpoint",
"artsy",
"okayed",
"lali",
"rainforests",
"dialects",
"matlock",
"lightest... | |
(405405*mckin) + (25328*mckin*np.pi**2*(1 + 14*np.log(2) +
14*np.log(1 - mckin/mbkin)))/(5265*mbkin) -
(25328*mckin**2*np.pi**2*(1 + 14*np.log(2) + 14*np.log(1 - mckin/mbkin)))/
(1485*mbkin**2) + (177296*mckin**3*np.pi**2*(1 + 14*np.log(2) +
14*np.log(1 - mckin/mbkin)))/(4455*mbkin**3) -
(25328*mckin**4*np.pi**2*(... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
In this module you find the worklfow 'fleur_convergence' for a self-consistency
cylce of a FLEUR calculation with AiiDA.
"""
#TODO: more info in output, log warnings
#TODO: make smarter, ggf delete broyd or restart with more or less iterations
# you can use the patter... | |
})
@login_required
@require_http_methods(['GET'])
def organization_applications(request, organization_id):
organization = get_object_or_404(models.Organization, pk=organization_id)
return render(request, 'boh/organization/applications.html', {
'organization': organization,
'active_top': 'applications',
'active_... | |
whether the System.Windows.UIElement that is
associated with this System.Windows.Automation.Peers.UIElementAutomationPeer is
required to be completed on a form. This method is called by
System.Windows.Automation.Peers.AutomationPeer.IsRequiredForForm.
Returns: A boolean that contains the value that i... | |
= reshape_fr(ELag,f.m)
E[k] = post_process(E[k],infl,rot)
stats.assess(k,kObs,'a',E=E[k])
for k in progbar(range(chrono.K+1),desc='Assessing'):
stats.assess(k,None,'u',E=E[k])
return assimilator
@DA_Config
def EnRTS(upd_a,N,cntr,infl=1.0,rot=False,**kwargs):
"""
EnRTS (Rauch-Tung-Striebel) smoother.
Ref: Ra... | |
"""doc
# leanai.data.dataset
> A generic implementation for a dataset based on parsers and file providers.
Leanai Datasets generally work by you providing an input and an output type and the implementation of the
dataset filles these fields using getters and parsers.
A simple example for 2d object detection using a ... | |
__author__ = 'hofmann'
__version__ = '0.0.6'
import os
import random
import numpy.random as np_random
import tempfile
from scripts.MetaDataTable.metadatatable import MetadataTable
from scripts.StrainSimulationWrapper.strainsimulationwrapper import StrainSimulationWrapper
from scripts.StrainSelector.strainselector impo... | |
<filename>src/data/data_studio.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# ============================================================================ #
# Project : Airbnb #
# Version : 0.1.0 #
# File : data_classes.py #
# Python : 3.8.0 #
# -----------------------------------------------------------... | |
<reponame>BensonRen/AEM_DIM_Bench
"""
The class wrapper for the networks
"""
# Built-in
import os
import time
import sys
sys.path.append('../utils/')
# Torch
import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
# from torchsummary import summary
from torch.optim import lr_s... | |
ATOM 3051 C CB . PRO B 1 173 ? 63.703 -38.258 -7.994 1.00 20.61 ? 174 PRO B CB 1
ATOM 3052 C CG . PRO B 1 173 ? 64.106 -36.916 -7.588 1.00 20.83 ? 174 PRO B CG 1
ATOM 3053 C CD . PRO B 1 173 ? 65.009 -37.122 -6.428 1.00 19.83 ? 174 PRO B CD 1
ATOM 3054 N N . GLY B 1 174 ? 62.846 -41.367 -6.700 1.00 20.27 ? 175 GLY ... | |
import operator
import functools
from math import ceil
from itertools import chain
from elasticmagic import agg
from elasticmagic.attribute import AttributedField
from elasticmagic.cluster import MAX_RESULT_WINDOW
from elasticmagic.compat import text_type, string_types, with_metaclass
from elasticmagic.expression impo... | |
# Copyright 2011 <NAME> <<EMAIL>>
#
# 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... | |
<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import namedtuple
import rrc_evaluation_funcs
import importlib
import sys
import math
def evaluation_imports():
"""
evaluation_imports: Dictionary ( key = module name , value = alias ) with python modules used in the evaluation.
""... | |
# coding=utf-8
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... | |
matched terms in this passage
score = sum(t.boost for t in f.matches)
# Favor diversity: multiply score by the number of separate
# terms matched
score *= (len(f.matched_terms) * 100) or 1
return score
# Fragment sorters
def SCORE(fragment):
"Sorts higher scored passages first."
return 1
def FIRST(fragmen... | |
<filename>tests/asp/gringo/modelchecker.035.test.py<gh_stars>10-100
input = """
% This used to generate incorrect results (models were missing) and was
% provided by the Potsdam group.
p14|p6|p6|p24:-not p14,p23.
p14|p6|p6|p24:-p22,p23.
p14|p6|p6|p7:-not p14,p23.
p14|p6|p6|p7:-p22,p23.
p14|p6|p9|p24:-not p14,p23. ... | |
<gh_stars>0
"""Settings to yield control to the user."""
import os
from warnings import warn
from yaml import safe_load
from serpentTools import messages, __path__
__all__ = ['defaultSettings', 'rc']
ROOT_DIR = __path__[0]
SETTING_HEADER_CHAR = '-'
SETTING_DOC_FMTR = """.. _{tag}:
{header}
``{name}``
{header}
{d... | |
<reponame>expz/insight<gh_stars>1-10
"""
These functions implement machine translation model training.
"""
from datetime import datetime
from fastai.basic_data import DataBunch
from fastai.callbacks import LearnerCallback, SaveModelCallback
from fastai.callbacks.tensorboard import LearnerTensorboardWriter
from fastai.... | |
<reponame>exoticDFT/drms<filename>drms/json.py
import json as _json
from urllib.parse import urlencode, quote_plus
from urllib.request import urlopen
from .config import ServerConfig, _server_configs
from .utils import _split_arg
__all__ = ['const', 'HttpJsonRequest', 'HttpJsonClient']
class JsocInfoConstants:
"""... | |
from abc import ABCMeta, abstractmethod
from collections import namedtuple
from contextlib import ContextDecorator
import datetime
import json
import logging
import re
import time
from enum import IntEnum, unique
import redis
from util import slash_join
from util.expiresdict import ExpiresDict
logger = logging.ge... | |
be somehow achieved by the
# same (weird) mechanism that LexMySQL auto increments when inserting a new word?
# Kind of a lex.next_available_idn() method or something?
unix_epoch = Pythonic.unix_epoch_now()
num = Number(unix_epoch)
word.set_idn_if_you_really_have_to(num)
else:
try:
unix_epoch = float(idn)
excep... | |
size=226368493,
auto_download=auto_download,
),
WikidatedV1_0SortedEntityStreamsFile(
archive_path=dataset_dir / (prefix + "p58454174-p58655598.7z"),
page_ids=range(58454174, 58655599),
darus_id=95142,
sha1="e9318db4ec4c086ea06e41116709a7607c24f388",
size=279661929,
auto_download=auto_download,
),
WikidatedV... | |
<gh_stars>1-10
"""Fields used for forming more complex structures with other fields."""
import collections.abc
import typing
from typing import Any
from typing import BinaryIO
from typing import Callable
from typing import Iterable
from typing import List
from typing import Optional
from typing import Tuple
from typin... | |
<reponame>CalebF98/tbcc-moonkin-dps-simulator<filename>app/simulation.py
import numpy
import pandas as pd
import sys
import logging
logging.basicConfig(
stream=sys.stdout,
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
def compute_avg_dps(num_fights, intellect, crit_score, hit_score, spel... | |
<gh_stars>10-100
import os
import time
import shutil
from tqdm import trange
import torch
from torch import nn
import torch.nn.parallel
from torch.autograd import Variable
from model import DenseNet
from tensorboard_logger import configure, log_value
class Trainer(object):
"""
The Trainer class encapsulates all th... | |
or "window" keyword arguments must be given and not None.'
error(msg,'gwf.taper')
#
wfarr = this.wfarr
wfarr[:,1] = window * this.wfarr[:,1]
wfarr[:,2] = window * this.wfarr[:,2]
# NOTE that objects cannot be redefined within their methods, but their properties can be changed. For this reason, the line below us... | |
#!/usr/bin/env python
import sys
import os
from matplotlib import transforms
from matplotlib.colors import get_named_colors_mapping
import matplotlib.pyplot as plt
from matplotlib.pyplot import figure, get
import numpy as np
from matplotlib.patches import Circle
from pandas.core import algorithms
from scipy import clu... | |
'zh': u('\u5c71\u4e1c\u7701\u5fb7\u5dde\u5e02')},
'861856214':{'en': 'Dezhou, Shandong', 'zh': u('\u5c71\u4e1c\u7701\u5fb7\u5dde\u5e02')},
'861856215':{'en': 'Dezhou, Shandong', 'zh': u('\u5c71\u4e1c\u7701\u5fb7\u5dde\u5e02')},
'861856216':{'en': 'Yantai, Shandong', 'zh': u('\u5c71\u4e1c\u7701\u70df\u53f0\u5e02')},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.