input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
#!/usr/bin/env python
"""
This module defines the ``SageBinaryData`` class. This class interfaces with the
:py:class:`~sage_analysis.model.Model` class to read in binary data written by **SAGE**.
The value of :py:attr:`~sage_analysis.model.Model.sage_output_format` is generally
``sage_binary`` if it is to be read with ... | |
from collections import deque
import numpy as np
import os
from abc import ABCMeta, abstractmethod
import random
random.seed(42)
from common import config, VehicleState
from helper import Helper
INFO = """Average merging time: {} s
Traffic flow: {} vehicle/s
Average speed: {} km/h
Average fuel consumptio... | |
# Copyright 2020 The SQLFlow 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 o... | |
<reponame>NazarethCollege/heweb2017-devops-presentation<gh_stars>0
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | |
<reponame>ismail4040/DeepLeanirngJazz
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: interval.py
# Purpose: music21 classes for representing intervals
#
# Authors: <NAME>
# <NAME>
# <NAME>
# <NAME>
#
# Copyright: Copyright © 2009-2012, 2015 <NAME> and th... | |
'''
测试样例:
明文:1000011110000111100001111000011110000111100001111000100000000000
0000000100100011010001010110011110001001101010111100110111101111
1000010111101000000100110101010000001111000010101011010000000101
[1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
################################################################################
# LexaLink Copyright information - do not remove this copyright notice
# Copyright (C) 2012
#
# Lexalink - a free social network and dating platform for the Google App Engine.
#
# Original author: ... | |
<gh_stars>0
from pprint import pprint
import helpers
import pdb
#Custom Modules
import modules.readConfig as config
from modules.datamodelClassDefinitions import (Agent, Aspect, Asset, AssetType,
DataPointMapping,
DeviceConfiguration,
HardwareDataPoint, ImportStatus,
LibDataPoint, LibDataSource,
Networ... | |
<gh_stars>1-10
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import input, str
import re
import logging
import uuid
import codecs
import sys
import os
import time
import importlib
from functools import wraps
from future.moves.itertools import zip... | |
# -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""Backend for the JKU C++ simulator."""
import itertools
import json
import logging
import operator
import os
import platfo... | |
= [1, "Entity Properties", testResult, expectedResult, [notes]]
resultSet.append(results)
return resultSet
def testServerAPIGetClusterMembers(serverURL):
"""
Test Getting Cluster Members.
Create 6 entities of type Graphyne.Generic.
Chain four of them together: E1 >> E2 >> E3 >> E4
Connect E4 to a ... | |
be
# updated again. If a future iteration this plan is still
# selected, it'd get the same -1 label from the cache, ensuring
# that has_timeouts below would be set to True correctly.
self.query_execution_cache.Put(key=(node.info['query_name'],
hint_str),
value=result_tup,
latency=real_cost)
self.timeout_control... | |
== 0x36: # $36/54 ROL zp,X
self.ROL(OperandRef(LOC_VAL, self.zeropage_x()))
self.pc += 1
return 1
if instruction == 0x2e: # $2E/46 ROL abs
self.ROL(OperandRef(LOC_VAL, self.absolute()))
self.pc += 2
return 1
if instruction == 0x3e: # $3E/62 ROL abs,X
self.ROL(OperandRef(LOC_VAL, self.absolute_x()))
self.pc ... | |
<filename>ivy/ivy_module.py
#
# Copyright (c) Microsoft Corporation. All Rights Reserved.
#
import ivy_utils as iu
import ivy_logic as il
import ivy_logic_utils as lu
import ivy_solver
import ivy_concept_space as ics
import ivy_ast
from collections import defaultdict
import string
import functools
###################... | |
0, 0, 0, 0],
[1949, 0.382404, 0, 9999, -9999, 1.0, 100, 1, 10.193229, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1950, 0.039377, 0, 9999, -9999, 1.0, 100, 1, 0.866493, 0.0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[1951, 0.186631, 0, 9999, -9999, 1.0, 100, 1, 7.917597, 0.0, 0, 0, 0, 0, 0, 0, 0... | |
"""
Created on Apr 4, 2014
@author: <NAME>
In this module you can find the :class:`MyStorage`. It inherits
from :class:`base.base.Storage`.
This class represents the base layer. It manages the project files,
the data loading and the data writing.
The data loading is called in the :class:`Task` which is a thread.
""... | |
are!",
"I would sit still and blithely watch how you, the devil, and your sausages and your tripes vainly fret and torment yourselves, and blubber and writhe, achieving nothing except to make us laugh and make you own case worse. Indeed, I would like to see you say aloud what you write, for if you did, people would ga... | |
<reponame>NVE/varsomdata<filename>varsomscripts/incidentandforecast.py
# -*- coding: utf-8 -*-
"""At request we make data for people needing information on incidents in regions over a period, on incidents
in regions mapped to danger levels og avalanche problems forecasted or observed. Sometimes incidents raw from
regOb... | |
\xa7 b \u2020 c', 'a-b-c'),
('1', ''), ('1abc', 'abc'),
]
ids_unicode_all = [
(u'\u00f8 o with stroke', 'o-o-with-stroke'),
(u'\u0111 d with stroke', 'd-d-with-stroke'),
(u'\u0127 h with stroke', 'h-h-with-stroke'),
(u'\u0131 dotless i', 'i-dotless-i'),
(u'\u0142 l with stroke', 'l-l-with-stroke'),
(u'\u0167 t... | |
no more samples than pixels exist
if samples > n:
samples = n
pixels = image.pixels
for i in range(samples):
pos = int(i/samples*n)*4
averagecolor += image.pixels[pos:pos+3]
averagecolor = averagecolor / samples
if True in numpy.isnan(averagecolor):
averagecolor[:] = [0,0,0]
# adjust satu... | |
# coding: utf-8
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and pyth... | |
# coding: utf-8
"""
"""
import collections
import datetime
import sqlalchemy as db
import sqlalchemy.dialects.postgresql as postgresql
__author__ = '<NAME> <<EMAIL>>'
class VersionedJSONSerializableObjectTables(object):
"""
A class for storing JSON-serializable objects without deletes and with versioned updates.... | |
X=0
0) # 32bit
bor(r0, r0, r1)
rotate(broadcast, r3, -NROWS_IDX)
mov(r1, r5)
rotate(broadcast, r3, -ROW_IDX)
isub(r1, r1, r5)
shl(r1, r1, 7)
bor(vpmvcd_wr_setup, r0, r1)
rotate(broadcast, r3, -NROWS_IDX)
mov(r1, r5)
rotate(broadcast, r3, -ROW_IDX)
isub(r1, r1, r5)
rotate(broadcast, r2, -C_CUR_IDX)
mov(r0,... | |
<filename>pyqtree.py
"""
# Pyqtree
Pyqtree is a pure Python spatial index for GIS or rendering usage.
It stores and quickly retrieves items from a 2x2 rectangular grid area,
and grows in depth and detail as more items are added.
The actual quad tree implementation is adapted from
[Matt Rasmussen's compbio library](htt... | |
"unicode": "1f1ef"
},
":regional_indicator_k:": {
"category": "regional",
"name": "regional indicator symbol letter k",
"unicode": "1f1f0"
},
":regional_indicator_l:": {
"category": "regional",
"name": "regional indicator symbol letter l",
"unicode": "1f1f1"
},
":regional_indicator_m:": {
"category": "regi... | |
Initializing OpenCL
self.context = cl.create_some_context()
self.queue = cl.CommandQueue(self.context)
# Print out device info
output_device_info(self.context.devices[0])
# Build the OpenCL program from file
kernelsource = open(pathlib.Path(__file__).parent.absolute() / "kernels/opencl_heun_euler_optimised.cl"... | |
profile_name)))
for disk in disks:
dev_path = disk.get('path')
# Convert disk size from GiB to MiB
dev_size = int(disk.get('size')) * 1024
dev_func = disk.get('volumeFunc')
if dev_func and dev_func in prohibitedFuncs:
return ("Error", _('error: Local Storage profile %s is invalid') %
profile_name, _('dev_func... | |
print(self.__text)
elif self.__password == '':
print('XXXX __fiber__::sendFiberVendorMeasurementToDatabase: Test mode... DATA WILL NOT BE SENT TO THE DATABASE')
return 2
else:
print("XXXX __fiber__::sendFiberVendorMeasurementToDatabase: Fiber Fiber Local Measurment Transmission: Failed!!!")
print(self.__code)
pr... | |
<filename>compass/tests/db/api/test_host.py<gh_stars>1-10
# Copyright 2014 Huawei Technologies Co. Ltd
#
# 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... | |
Returns
---------
Coor : numpy array of real (dimension Natoms x 3)
Coordinates of every atom in the system in ANGSTROMS
AtType : list of string
Atom types for every atom in the system e.g. ['C','F','H','C',...]
Notes
----------
Applicability of this function will be extended in future according to
... | |
# BSD 3-Clause License
# Copyright (c) 2019, regain authors
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# list ... | |
array (1D), the order number for each valid FP
peak
xpeak: numpy array (1D), the central position each gaussain fit
to valid FP peak
ewpeak: numpy array (1D), the FWHM of each gaussain fit
to valid FP peak
vrpeak: numpy array (1D), the radial velocity drift for each
valid FP peak
llpeak: numpy array (1D), the d... | |
NIFGEN_VAL_OUTPUT_ARB.
When used during streaming, this attribute specifies the number of times to repeat the streaming waveform (the onboard memory allocated for streaming). For more information about streaming, refer to the Streaming topic.
''',
},
},
1150329: {
'access': 'read-write',
'channel_based': 'False',
... | |
<reponame>zhz44/mindspore<gh_stars>1-10
# Copyright 2019-2022 Huawei Technologies Co., Ltd
#
# 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
#
# U... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 24 19:16:51 2019
@author: mostafamousavi
last update: 06/06/2020
"""
from __future__ import division, print_function
import numpy as np
import h5py
import matplotlib
matplotlib.use('agg')
from tqdm import tqdm
import os
# os.environ['KERAS_BACKEND']... | |
import copy
import datetime
import logging
from typing import Dict, List
from dateutil.relativedelta import relativedelta
from django.conf import settings
from django.db import IntegrityError, models, transaction
from django.db.models.functions import window
from django.utils.translation import ugettext_lazy as _
from... | |
= PlotConfig({**self.get_defaults(mode), **self.ANNOTATION_DEFAULTS})
if config is not None:
self.config.update(config)
for layer_index, layer_data in enumerate(data):
layer_config = self.config.filter(index=layer_index)
layer = Layer(self, mode=mode, index=layer_index, config=layer_config, data=layer_data)
self... | |
temp_offspring_N
b['Parent_SD'] = temp_parent_STD
b['Offspring_SD'] = temp_offspring_STD
b.to_csv(savePath + saveFileName + '.csv')
plt.close(fig)
plt.clf()
## Mean of the metric
fig,b = dabest.plot(df, x = 'Status_Sex_Satiety_Intensity_Wind_LT', y = metric + '_Mean' ,
color_col= 'Genotype', custom_palette =... | |
* Cs u0 {2,S} {3,S} {4,S} {8,S}
2 Cd u0 {1,S} {5,D}
3 Cd u0 {1,S} {6,D}
4 Cd u0 {1,S} {7,D}
5 Cdd u0 {2,D} {9,D}
6 Cdd u0 {3,D} {10,D}
7 Cdd u0 {4,D} {11,D}
8 Cs u0 {1,S}
9 C u0 {5,D}
10 C u0 {6,D}
11 C u0 {7,D}
""",
thermo = u'Cs-(Cds-Cds)(Cds-Cds)(Cds-Cds)Cs',
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
... | |
-
(17664064*mcMS**10)/(9*mbkin**11) + (168649664*mcMS**11)/
(231*mbkin**13) + (3372993280*mcMS**11)/(2079*mbkin**12) -
(502020*mcMS**12)/mbkin**14 - (1115600*mcMS**12)/mbkin**13 +
(1426048*mcMS**13)/(5*mbkin**15) + (5704192*mcMS**13)/(9*mbkin**14) -
(60257056*mcMS**14)/(455*mbkin**16) - (241028224*mcMS**14)/
... | |
"""
This module contains information about the way the cluster expansion is implemented in the package.
"""
import functools
import operator
import warnings
import numpy as np
from pycce.sm import _smc
try:
from mpi4py import MPI
mpiop = {'imul': MPI.PROD,
'mul': MPI.PROD,
'prod': MPI.PROD,
'iadd': MPI.SUM,
'a... | |
'act_1', 'data', 'fc_0', 'fc_1', 'softmax']
mon_result_counts = [0, 0, 0, 0, 0, 0]
assert(len(res) == 21)
for n, k, v in res:
for idx, key in enumerate(keys):
if k.startswith(key):
mon_result_counts[idx] += 1
break
assert(mon_result_counts == [2, 2, 1, 6, 6, 4])
@with_seed()
def test_executor_group():
def get... | |
* uk_128
+ 1007855 * uk_129
+ 1623008 * uk_13
+ 1092727 * uk_130
+ 339488 * uk_131
+ 1198817 * uk_132
+ 2387025 * uk_133
+ 1092727 * uk_134
+ 105472 * uk_135
+ 372448 * uk_136
+ 741600 * uk_137
+ 339488 * uk_138
+ 1315207 * uk_139
+ 5731247 * uk_14
+ 2618775 * uk_140
+ 1198817 * uk_141
+ 5214375 * uk_14... | |
cookielib.LWPCookieJar()
if USE_SSL == '0':
scheme = 'http://'
ipaddr = ipaddr
port = '8080'
if(port == APISVC_PORT):
authsvcPort = '7443'
elif(port == LB_API_PORT):
authsvcPort = LB_API_PORT
# Variables
FAKE_URL='https://www.fake.com'
FAKE_URL_PATTERN='www.fake.com'
FORM_LOGIN_FAKE_URL=scheme+ipaddr+':'+p... | |
or all.
heading_type: Use response codes, long or abbreviated titles.
response_type: Export long or short text responses.
from_response_id: First response to export.
to_response_id: Last response to export.
fields: Which response fields to export. If none, exports all fields.
Returns:
Bytes length written to fi... | |
import numpy as np
from rnn_utils import *
def rnn_cell_forward(xt, a_prev, parameters):
"""
Implements a single forward step of the RNN-cell as described in Figure (2)
Arguments:
xt -- your input data at timestep "t", numpy array of shape (n_x, m).
a_prev -- Hidden state at timestep "t-1", numpy array of shape... | |
30
ERRR = 40
CRIT = 50
def __str__(self):
return super().__str__()[6:] # chopping i.e. "LGLVL.DBUG", to "DBUG"
# DSS runs in a daemonic thread with this name.
_DSS_THREAD_NAME = 'data_sink_service'
# A queue for the data sink service, dss runs on its own thread and will consume this queue, app threads can
# pro... | |
<reponame>amcclead7336/Enterprise_Data_Science_Final<filename>venv/lib/python3.8/site-packages/azureml/history/_tracking.py
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import logg... | |
# -*- coding: utf-8 -*-
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | |
#!/usr/bin/python
# coding: utf-8
import logging
import tensorflow as tf
import pickle
import time
import numpy as np
from .adaptive_nn import ActiveNeuralNetwork, compute_score, TrueActiveNN
from ..visualize_database import (plot_advancement_qdb_search,
random_advancement_plot,
plot_advancement_uncertainty_search,... | |
<filename>sweeper.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
import time
import random
import requests as req
from tqdm import tqdm
from bs4 import BeautifulSoup as bsoup
from urllib.parse import urlparse
import cloudscraper
from selenium import webdriver
from selenium.webdriver.s... | |
<filename>tap_qualtrics/__init__.py
#!/usr/bin/env python3
import os
import io
import json
import re
import time
import pandas as pd
import backoff
import zipfile
import requests
from datetime import datetime, timedelta
import singer
from singer import utils, metadata
from singer.catalog import Catalog, CatalogEntry
... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""Detect let and do forms, and destructure them writably.
Separate from letdo.py for dependency reasons.
Separate from util.py due to the length.
"""
from ast import Call, Name, Subscript, Index, Compare, In, Tuple, List, Str, BinOp, LShift
import re
from macropy.core import Capt... | |
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-MSDTC
GUID : 719be4ed-e9bc-4dd8-a7cf-c85ce8e4975d
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parse... | |
self.sh_entsize, = struct.unpack(endian + ptr_type, file.read(sz_ptr))
# Lower priority == post processed earlier so that those
# with higher priority can assume already initialized.
if self.sh_type == SHT_STRTAB:
self.priority = 0
else:
self.priority = 1
def postprocess(self, elffile, file):
ptr_type = elffil... | |
<filename>tests/migrations/test_executor.py
from django.apps.registry import apps as global_apps
from django.db import connection
from django.db.migrations.exceptions import InvalidMigrationPlan
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import MigrationGraph
from django... | |
<filename>src/Ot2Rec/main.py
# Copyright 2021 Rosalind Franklin Institute
#
# 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... | |
<gh_stars>10-100
import re
from datetime import datetime, timedelta
import numpy as np
import pandas.compat as compat
import pandas as pd
from pandas.compat import u, StringIO
from pandas.core.base import FrozenList, FrozenNDArray, PandasDelegate, DatetimeIndexOpsMixin
from pandas.util.testing import assertRaisesRegexp... | |
associated to the cusp form q + a1*q^2 - a1*q^3 + (-a1 + 2)*q^5 + O(q^6), a1=1.41421356237310
We compute with the L-series of the Eisenstein series `E_4`::
sage: f = ModularForms(1,4).0
sage: L = f.lseries()
sage: L(1)
-0.0304484570583933
sage: L = eisenstein_series_lseries(4)
sage: L(1)
-0.0304484570583933
... | |
<reponame>myoung301/pyaedt
from __future__ import absolute_import # noreorder
import math
import time
from pyaedt.edb_core.EDB_Data import EDBNetsData
from pyaedt.generic.constants import CSS4_COLORS
from pyaedt.generic.general_methods import generate_unique_name
from pyaedt.generic.general_methods import is_ironpyth... | |
from pandas.api.types import is_numeric_dtype
from niaclass.feature_info import _FeatureInfo
from niaclass.rule import _Rule
from niapy.task import Task
from niapy.problems import Problem
from niapy.util.factory import get_algorithm
import numpy as np
from sklearn.metrics import accuracy_score, precision_score, f1_scor... | |
tags = newtag + "," + line[tag_start_delim + 11 : tag_end_delim]
else:
tags = newtag
parse_tags([tags])
yield (url, title, delim_wrap(tags), None, 0, True, False)
def import_org(filepath: str, newtag: Optional[str]):
"""Parse bookmark org file.
Parameters
----------
filepath : str
Path to org file.
newta... | |
"""
Low-level database routines.
This is a thin wrapper around Psycopg2 for database access, adding niceties like logging,
transaction handling, simple DSN strings, as well as simple commands
(for new users, schema creation, etc.)
For a description of the connection string, take inspiration from:
https://www.postgres... | |
for base,height in pos:
if base != '-':
item.append((base,height))
seq_bits[key].append(item)
self.seq_bits = seq_bits
elif self.height_algorithm in ['bits','bits_without_correction']:
self.seq_bits = compute_bits(self.groups, self.probs, seq_type=self.sequence_type,no_correction=self.height_algorithm=='bits_wit... | |
<reponame>gregoirehertz/MAPIE
from __future__ import annotations
from typing import Optional, Union, Iterable, Tuple, List, Any, cast
import numpy as np
from joblib import Parallel, delayed
from sklearn.utils import check_X_y, check_array
from sklearn.utils.validation import check_is_fitted
from sklearn.base import cl... | |
connection lost")
else:
self.lastActivityTimestamp = time.time()
self.buf = b''.join([self.buf, read])
self.onIncomingData()
# Check inactivity timeout
elif self.inactivityTimeout:
if time.time() - self.lastActivityTimestamp > self.inactivityTimeout:
if self.proxyAddress is not None:
raise EOFError(
"Inactiv... | |
# 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... | |
<reponame>wgzhao/trino-admin
# -*- coding: utf-8 -*-
#
# 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 ag... | |
<reponame>henriktao/pulumi-azure<gh_stars>100-1000
# 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,... | |
"""余额类型类型"""
THOST_FTDC_BLT_CurrentMoney = 48
"""当前余额"""
THOST_FTDC_BLT_UsableMoney = 49
"""可用余额"""
THOST_FTDC_BLT_FetchableMoney = 50
"""可取余额"""
THOST_FTDC_BLT_FreezeMoney = 51
"""冻结余额"""
class TThostFtdcGenderType(Enum):
"""性别类型"""
THOST_FTDC_GD_Unknown = 48
"""未知状态"""
THOST_FTDC_GD_Male = 49
"""男"""
... | |
# run Bayesian ensembles on UCI benchmarks
import numpy as np
from numpy import linalg as LA
import torch
from tqdm import tqdm
from tqdm import trange
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import grad
from torch.autograd import Variable
import pickle
im... | |
<reponame>maximumo/django-pgtrigger
import contextlib
import copy
import hashlib
import logging
import threading
import django.apps
from django.conf import settings
from django.db import connections
from django.db import DEFAULT_DB_ALIAS
from django.db import models
from django.db import router
from django.db.models.e... | |
# Copyright 2020 The TensorFlow 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 ... | |
>>> Could not save file with Q-scores - molecule was not opened from file?"
print ""
return
molPath, molExt = os.path.splitext(mol.openedAs[0])
mapName = os.path.splitext(dmap.name)[0]
if hasattr ( mol, 'cif' ) and molExt == '.cif' :
import mmcif
reload ( mmcif )
fout = molPath + "__Q__" + mapName + ".cif"
m... | |
<reponame>satorchi/pyoperators<gh_stars>1-10
from __future__ import division
import itertools
import numpy as np
import operator
from numpy.testing import assert_equal, assert_raises
from pyoperators import (
AdditionOperator, BlockDiagonalOperator, CompositionOperator,
ConstantOperator, DiagonalOperator, DiagonalNu... | |
want to discard all unpushed changes on this branch?"
body = """There is a shortcut in case you want to discard all changes made \
on this branch since you have last pushed or in any event, to make your local branch \
identical to "upstream". Upstream, for local tracking branches, is the place you \
get history from w... | |
<filename>src/synapse/azext_synapse/vendored_sdks/azure_mgmt_synapse/models/_models_py3.py
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# l... | |
restrictions
on the ``o`` asymmetry parameters.
Examples
--------
>>> from arch.univariate import APARCH
Symmetric Power ARCH(1,1)
>>> aparch = APARCH(p=1, q=1)
Standard APARCH process
>>> aparch = APARCH(p=1, o=1, q=1)
Fixed power parameters
>>> aparch = APARCH(p=1, o=1, q=1, delta=1.3)
Notes
-----... | |
from typing import List, Union, Optional, Set, TYPE_CHECKING
if TYPE_CHECKING:
from s2and.data import NameCounts
import re
import warnings
import numpy as np
from numpy import inner
from numpy.linalg import norm
from collections import Counter
from text_unidecode import unidecode
import fasttext
import pycld2 as cl... | |
m.x263 - m.x342 - m.x343 - m.x344 - m.x345 == 0)
m.c381 = Constraint(expr= m.x264 - m.x346 - m.x347 - m.x348 - m.x349 == 0)
m.c382 = Constraint(expr= m.x265 - m.x350 - m.x351 - m.x352 - m.x353 == 0)
m.c383 = Constraint(expr= m.x266 - m.x354 - m.x355 - m.x356 - m.x357 == 0)
m.c384 = Constraint(expr= m.x267 - m.x358 ... | |
<reponame>ohcpaull/refnx
"""
refnx is distributed under the following license:
Copyright (c) 2015 <NAME>, ANSTO
Permission to use and redistribute the source code or binary forms of this
software and its documentation, with or without modification is hereby
granted provided that the above notice of copyright, these t... | |
* 0.25 * LEFT + FRAME_HEIGHT * 0.5 * UP + dc_title.get_height() * 0.5 * DOWN + 0.2 * DOWN)
dc_underline = Line(LEFT, RIGHT) \
.match_width(dc_title) \
.scale(1) \
.next_to(dc_title, DOWN, SMALL_BUFF)
self.add(dc_title, dc_underline)
# ac title
ac_title = TextMobject("Alternating Current", "(AC)")\
.scale(1.25)... | |
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source ... | |
requested for general PDE."%name)
def getFunctionSpaceForCoefficient(self,name):
"""
Returns the `FunctionSpace` to be used for
coefficient ``name``.
:param name: name of the coefficient enquired
:type name: ``string``
:return: the function space to be used for coefficient ``name``
:rtype: `FunctionSpace`
:r... | |
port = ET.SubElement(pvstp, "port")
designated_port_id = ET.SubElement(port, "designated-port-id")
designated_port_id.text = kwargs.pop('designated_port_id')
callback = kwargs.pop('callback', self._callback)
return callback(config)
def get_stp_brief_info_output_spanning_tree_info_spanning_tree_mode_pvstp_pvstp_... | |
<filename>vispy/util/tests/test_event_emitter.py
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import unittest
import copy
import functools
from vispy.util.event import Event, EventEmitter
from vispy.testin... | |
<reponame>TaoSunVoyage/renku-python<filename>tests/service/jobs/test_datasets.py
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apa... | |
IHS for all variants. To exclude variants
below a given minor allele frequency, filter the input haplotype array
before passing to this function.
This function computes IHS comparing the reference and alternate alleles.
These can be polarised by switching the sign for any variant where the
reference allele is der... | |
inputs],
hparams=hparams,
ffn_layer_type="dense_relu_dense",
name="rnn",
activation=tf.tanh,
pad_remover=pad_remover)
new_state = attention_unit(state)
elif hparams.inputs_states_combination == "mh_attention_dense":
state = attention_unit(state)
new_state = _ffn_layer_multi_inputs(
[state, inputs],
hparams... | |
<filename>multiple_instance_post_process.py
#!/usr/bin/python
# Copyright (c) 2016 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/LICEN... | |
h = cvx.matrix(np.zeros((V,1), dtype=np.float64))
# call a constrained nonlinear solver
solution = solvers.cp(F, G=G, h=h)
if solution['status'] in ['optimal','unknown']:
optimized = True
else:
optimized = False
x_final = np.array(solution['x']).reshape(x_init.shape)
x_final[x_final<=0] = x_init[x_final<=0]
... | |
<filename>toontown/estate/houseDesign.py
from direct.directtools.DirectSelection import *
from direct.directtools.DirectUtil import ROUND_TO
from direct.directtools.DirectGeometry import LineNodePath
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.showbase.DirectObject import DirectObject
from... | |
# normalise path to suit operating system
df['simap_filename_base'] = df['simap_filename_base'].apply(lambda x: os.path.normpath(x))
# create filenames for simap output
df['SIMAP_tar'] = df.simap_filename_base + '_SIMAP.tar.gz'
df['SIMAP_feature_table_XML_path'] = df.simap_filename_base + '_feature_table.xml'
df[... | |
<gh_stars>10-100
# coding: utf-8
"""
Xero Payroll AU API
This is the Xero Payroll API for orgs in Australia region. # noqa: E501
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
class PayRun(BaseModel):
"""NOTE: This class is ... | |
#!/usr/bin/env python
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
dr... | |
38' 28.63"
REVISION HISTORY:
Written, <NAME> October, 1992
Vectorized, <NAME> February, 1994
Treat case where proper motion not known or exactly zero November 1994
Handling of arrays larger than 32767 <NAME>, march, 1995
Converted to IDL V5.0 <NAME> September 1997
Fixed bug where A term not initialized for vect... | |
<reponame>josephmje/niworkflows<gh_stars>10-100
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | |
# Python 3
# coding: utf-8
import sys
from socket import *
import threading
import time
import datetime as dt
# Read port number and number of failed attempt from sys argv
serverPort = sys.argv[1]
nb_failed = sys.argv[2]
serverPort = int(serverPort)
nb_failed = int(nb_failed)
# The nb of failed attempt ... | |
import argparse
import json
import logging
import os
# noinspection PyCompatibility
import urllib.parse as parse
# noinspection PyCompatibility
from urllib.request import url2pathname
from collections import OrderedDict
import re
import ontospy
import requests
import unicodecsv as csv
# global namespace lookup
with op... | |
<gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# -... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.