input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
"""
defines some methods for cleaning up a model
- model = remove_unused(bdf_filename, remove_nids=True, remove_cids=True,
remove_pids=True, remove_mids=True)
"""
from pyNastran.bdf.bdf import BDF, read_bdf
#from pyNastran.bdf.mesh_utils.bdf_renumber import bdf_renumber
def remove_unused(bdf_filename, remove_nids=T... | |
# type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('CollectionOfDirectoryObject3', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return d... | |
the data type, and the value is the data itself.
For more information, see `Data Types <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes>`__ in the *Amazon DynamoDB Developer Guide* .
- **NULL** *(boolean) --*
An attribute of type Null. For ex... | |
from .AAA3A_utils.cogsutils import CogsUtils # isort:skip
if CogsUtils().is_dpy2:
from .AAA3A_utils.cogsutils import Buttons # isort:skip
else:
from dislash import ActionRow, Button, ButtonStyle # isort:skip
from redbot.core import commands # isort:skip
from redbot.core.i18n import Translator, cog_i18n # isor... | |
= self._img_array[indices]
_dts.append(dl.Dataset(data=data, target=targets))
return dl.Datasets.from_list(_dts)
def load_all(self):
from scipy.ndimage import imread
from scipy.ndimage.interpolation import rotate
_cls = self.info["classes"]
_base_folder = self.info["base_folder"]
_id = 0
flat_data = []
fl... | |
bases %d " % len(strand.tour))
self._logger.debug("Scaffold %d " % strand.is_scaffold)
base_conn = strand.dna_strand.dna_structure.base_connectivity
base = base_conn[strand.tour[0]-1]
self._logger.debug("Start helix %d position %d" % (base.h, base.p))
first_atomID_out = first_atomID_in
# max_atom_per_base = 40
n... | |
print("median specificity signle lasso", np.median(np.asarray(specificity_list_single_task_selective)))
print("median sensitivity single lasso2", np.median(np.asarray(sensitivity_list_single_task_selective2)))
print("error selective", np.median(np.asarray(test_error_list)))
print("error naive", np.median(np.asarray... | |
#
# Copyright 2017-2021 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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 r... | |
assign _dataflow__delay_ready_19 = (_dataflow__delay_ready_20 || !_dataflow__delay_valid_20) && _dataflow__delay_valid_19;
reg [1-1:0] _dataflow__delay_data_14;
reg _dataflow__delay_valid_14;
wire _dataflow__delay_ready_14;
assign _dataflow__delay_ready_13 = (_dataflow__delay_ready_14 || !_dataflow__delay_valid_14)... | |
<reponame>ttyrone/duboku_downloader<gh_stars>0
# -*- coding: utf-8 -*-
# The MIT License (MIT)
# Copyright (c) 2019 <EMAIL>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... | |
<gh_stars>1-10
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.... | |
#FP LDOS, Data Loaders
import os, sys
import numpy as np
import timeit
#import torch.nn as nn
#import torch.nn.functional as F
import torch
import torch.multiprocessing as mp
#import torch.utils.Dataset
import torch.utils.data.distributed
import torch.utils.data
import torch.utils
import horovod.torch as hvd
sys.pa... | |
)
self.render(
"datamodel_view.html",
page_title = app_main_texts["main_title"],
site_section = self.site_section,
datamodel_custom = data_model_custom,
datamodel_core = data_model_core,
error_msg = self.error_msg,
user = self.current_user,
is_user_connected = self.is_use... | |
"""This module contains these classes: `Hfss3dLayout` and `SweepString`."""
from __future__ import absolute_import
import os
from .application.Analysis3DLayout import FieldAnalysis3DLayout
from .desktop import exception_to_desktop
from .modules.SolveSetup import Setup3DLayout
from .generic.general_methods import gene... | |
m.x1505 + m.x1506 + m.x1507 + m.x1508 + m.x1509
+ m.x1510 + m.x1511 + m.x1512 + m.x1513 + m.x1514 + m.x1515 + m.x1516 + m.x1517 + m.x1518
+ m.x1519 + m.x1520 + m.x1521 + m.x1522 + m.x1523 + m.x1524 + m.x1525 + m.x1526 + m.x1527
+ m.x1528 + m.x1529 + m.x1530 + m.x1531 + m.x1532 + m.x1533 + m.x1534 + m.x1535 + m.x1536... | |
# winspec.py, class for reading/writing winspec SPE files
# <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later ve... | |
<filename>pyserver/planner/routed_p2/route_finder.py
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# BUG nnnn: 2012.09.26: Search for a route from DT Mpls to DT St Paul (i.e.,
# the 94) at 9 AM and you may have to bike to a slow bus -- why
# isn't the ex... | |
system to use with `x` date data.
xgap
Sets the horizontal gap (in pixels) between bricks.
xperiod
Only relevant when the axis `type` is "date". Sets the
period positioning in milliseconds or "M<n>" on the x
axis. Special values in the form of "M<n>" could be
used to declare the number of months. In this case `n... | |
<reponame>politbuero-kampagnen/onegov-cloud
from cached_property import cached_property
from collections import OrderedDict
from onegov.core.orm import Base
from onegov.core.orm.mixins import ContentMixin
from onegov.core.orm.mixins import content_property
from onegov.core.orm.mixins import TimestampMixin
from onegov.c... | |
<reponame>LucasBorges-Santos/docker-odoo<filename>odoo/base-addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import unittest
from odoo.addons.stock_landed_costs.tests.common import TestStockLandedCostsC... | |
from browser import document, console, alert
import turtle
import time
# import winsound
time_limit = 45
score_limit = 10
score_a = 0
score_b = 0
ball_speed_x = .4
ball_speed_y = .4
ifTwoBalls = False
ifThreeBalls = False
if_paused = False
running = True
game_state = "splash"
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600... | |
<filename>share/smack/frontend.py
import os
import sys
import re
import json
from .utils import temporary_file, try_command, temporary_directory,\
llvm_exact_bin, smack_root, smack_header_path, smack_headers,\
smack_lib
from .versions import RUST_VERSION
# Needed for cargo operations
try:
import toml
except ImportE... | |
#!/usr/bin/env python3
#<NAME>, 22-MAR-2018
#this command can run multiple times for a stack
#example command
#../../code/s1_select_ion.py -dir . -sn 34/38.5 -nr 5
import os
import sys
import glob
import shutil
import zipfile
import argparse
import datetime
import numpy as np
import xml.etree.ElementTree as ET
cla... | |
<gh_stars>0
'''
Includes:
* Functions to decode and filter raw SSD model output. These are only needed if the
SSD model does not have a `DecodeDetections` layer.
* Functions to perform greedy non-maximum suppression
Copyright (C) 2018 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not... | |
<reponame>WangPeng-Lab/scGCO_0910
import math
import random
import parmap
import itertools
from itertools import repeat
from scipy.spatial import distance
import operator
from tqdm import tqdm
from functools import reduce
from sklearn import mixture
import statsmodels.stats.multitest as multi
import networkx as nx
imp... | |
HTML tag with its attributes and contents.
"""
def __call__(self, *args, **kwargs):
"""
Calling a tag like a function is the same as calling its
findAll() method. Eg. tag('a') returns a list of all the A tags
found within this tag.
"""
pass
def __contains__(self, x):
pass
def __delitem__(self... | |
from sampled points
x_sampled_opt = sampled_opt_traj_nodes_[:, 0]
y_sampled_opt = sampled_opt_traj_nodes_[:, 1]
# all optimal x,y trajectory pairs
x = full_opt_traj_states[:, 0]
y = full_opt_traj_states[:, 1]
# plot goal
x1mingoal = GOALAREA[0]
x1maxgoal = GOALAREA[1]
y1mingoal = GOALAREA[2]
y1maxgoal = GOA... | |
import storage as func
import tablaDGA as TS
import reportError as errores
import mathtrig as mt
import hashlib
from datetime import date
from reportTable import *
from variables import cont
from variables import tabla
from variables import NombreDB
from procedural import llamadaF
#VARIABLES GLOBALES
resultadotxt ... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Image4Layer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2017 <NAME>.
:license: MIT, see LICENSE for details.
"""
# noinspection PyPackageRequirements
from PIL import Image, ImageMath # noqa
try:
from itertools import zip_longes... | |
template arguments. Empty strings
will be added for any omitted arguments. The vector will include the last
non-empty supplied argument, but not values beyond it."""
assert isinstance(config, WiktionaryConfig)
vec = []
for i in range(1, 20):
v = t_arg(config, t, i)
vec.append(v)
while vec and not vec[-1]:
vec... | |
<reponame>oasis-open/cti-stix-elevator<filename>stix2elevator/convert_stix.py
# Standard Library
from datetime import datetime
# external
from cybox.core import Observable
from lxml import etree
import pycountry
import stix
from stix.campaign import Campaign
from stix.coa import CourseOfAction
from stix.common.identit... | |
<filename>emg3d/simulations.py
"""
A simulation is the computation (modelling) of the electromagnetic responses
due to a given model and survey.
The simulation module combines the different pieces of ``emg3d`` providing
a high-level, specialised modelling tool for the end user.
"""
# Copyright 2018-2022 The emsig comm... | |
import argparse
import json
import logging
import os
import sys
from typing import Dict, Optional
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.model_selection import KFold
from transformers import BertModel, BertTokenizer
from common import ControllerBase, NeuralCoref... | |
<reponame>rtpsw/ibis
import datetime
import pickle
import re
import pandas as pd
import pytest
from pytest import param
import ibis
import ibis.common.exceptions as com
import ibis.config as config
import ibis.expr.analysis as L
import ibis.expr.api as api
import ibis.expr.datatypes as dt
import ibis.expr.operations ... | |
. auth_len = map_register . auth_len
ooOo00 . nonce = map_register . nonce
ooOo00 . nonce_key = lisp_hex_string ( ooOo00 . nonce )
ooOo00 . etr . copy_address ( oooooO0oO0o )
ooOo00 . etr_port = map_register . sport
ooOo00 . site = parent . site
i1II1IiiIi = ooOo00 . encode ( oo00oO0ooo , parent . site . auth_key... | |
is worth doing
min_input_size_for_parallel = 45
# print data.__class__, data.dtype, data.shape
# print data
# print data_params
# if memory_save:
# node_cache_read = None
# signal_cache_read = None
# node_cache_write = None
# signal_cache_write = None
# indicates whether node_data and node_params are valid
... | |
if el[0] in ['увы', 'странно', 'удивительно', 'надеюсь', 'думаю', 'полагаю', 'пожалуй', 'думается', 'конечно',
'разумеется', 'бесспорно', 'действительно', 'положим', 'предположим', 'допустим', 'признаюсь']:
if i + 1 < len(t):
next_el = t[i + 1]
if i == 0 and next_el[0] == ',':
flag = True
if i > 0:
prev_el = t[i... | |
<gh_stars>0
# -*- coding: UTF-8 -*-
"""
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | | | \ analysis
___/ | | | | ___/ of speech
http://www.sppas.org/
Use of this software is governed by the... | |
# Copyright (c) 2016 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... | |
from typing import Any, Dict, Tuple, Union, Callable, Optional, Sequence
from typing_extensions import Literal
from copy import deepcopy
from types import MappingProxyType
from pathlib import Path
from anndata import AnnData
from cellrank import logging as logg
from cellrank._key import Key
from cellrank.ul._docs imp... | |
dict_merge(process_cfg, ref_config, inplace=True)
else:
raise BadRequest("config_ref %s exists but not dict" % config_ref)
except NotFound as nf:
log.warn("config_ref %s - object not found" % config_ref)
raise
else:
log.error("Container missing OBJECT_STORE capability to resolve process config ref %s" % config_r... | |
legend=legend,
plot_kws=kwargs,
ax=ax,
)
return ax
ecdfplot.__doc__ = """\
Plot empirical cumulative distribution functions.
An ECDF represents the proportion or count of observations falling below each
unique value in a dataset. Compared to a histogram or density plot, it has the
advantage that each observatio... | |
ready to send more requests.
In addition to connection-level checks, this method also is used to
block additional requests from being sent during a metadata refresh.
Arguments:
node_id (int): id of the node to check
Returns:
bool: True if the node is ready and metadata is not refreshing
"""
# if we need to u... | |
<filename>sentinelPot/preprocess_level3.py<gh_stars>1-10
"""
This is a chunk which includes all steps for
harmonic regression of sentinel-1 GRD.
Author: <NAME> and <NAME>
Maintainer: <NAME> (<EMAIL>)
"""
import copy
import logging
import math
import os
import re
import shutil
import sys
import multiprocessing as mp
fr... | |
from __future__ import print_function
from __future__ import division
__author__ = """Alex "<NAME>""" ## double-quotes will be silently removed, single quotes will be left, eg, O'Connor
import numpy as np
import itertools #to calculate all subsets
from copy import deepcopy
from math import atan, pi, cos, sin, sqrt, cei... | |
<reponame>mheppner/djenealogy
from django.db import models
from django.utils import timezone
import codecs
from dateutil.parser import parse as parse_date
'''
TODO
Source
Repository
Submisison
Address?
'''
''' Abstract models '''
class TimestampBase(models.Model):
class Meta:
abstract = True
created_on = mod... | |
in_h - 1) for i in [y0, y1]]
x0, x1 = [tf.clip_by_value(i, 0, in_w - 1) for i in [x0, x1]]
# get pixel values
indices = [[y0, x0], [y0, x1], [y1, x0], [y1, x1]]
p0, p1, p2, p3 = [DeformableConv2D._get_pixel_values_at_point(inputs, i) for i in indices]
# cast to float
x0, x1, y0, y1 = [tf.cast(i, 'float32') fo... | |
import json
import pytest
from datetime import datetime
from django.db import connection
from model_mommy import mommy
from rest_framework import status
from usaspending_api.search.tests.test_mock_data_search import non_legacy_filters, legacy_filters
from usaspending_api.awards.v2.lookups.lookups import all_award_typ... | |
of the circles indicate the size of (ncs_err - no_ncs_err). It is blue
when the strict_ncs refinement make the (r_work - r_free) smaller.
"""
rec_num = self.sort_inp
# Collect data points that have results with and without strict_ncs
x_ncs = []; y_no_ncs =[]
x2 = []; y2 = []
time_ncs = []; time_no_ncs = []
pdb_... | |
information for 'universal unary functions (unary ufuncs).'
These are functions of a single tensor with common properties like:
- they are elementwise functions
- the input shape is the output shape
- they typically have method and inplace variants
- they typically support the out kwarg
- they typically have NumP... | |
are great examples of this!
# %% [markdown]
# ## 4. Combining Labeling Function Outputs with the Label Model
# %% [markdown]
# This tutorial demonstrates just a handful of the types of LFs that one might write for this task.
# Many of these are no doubt suboptimal.
# The strength of this approach, however, is that th... | |
<filename>verily/bigquery_wrapper/bq_test.py
# Copyright 2019 Verily Life Sciences Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | |
import os
os.environ['MKL_THREADING_LAYER'] = 'GNU'
import context
import torch
import argparse
import config as cfg
from ipeps.ipeps_kagome import *
from ctm.generic.env import *
from ctm.generic import ctmrg
# from ctm.generic import transferops
from models import kagome
import unittest
import numpy as np
import pick... | |
p : array of shape = [n_samples, n_classes]
The class log-probabilities of the input samples. The order of the
classes corresponds to that in the attribute `classes_`.
"""
proba = self.predict_proba(X)
return np.log(proba)
def staged_predict_proba(self, X):
"""Predict class probabilities at each stage for X.
... | |
`'append'` -> which will
add this visualization to an existing `startup.json` (or create a
new one), this is the default option, or `False` -> which will not
add an entry to `startup.json`.
`max_npart_per_file=10000` - The maximum number of particles saved per file,
don't use too large a number or you will have t... | |
<reponame>yixin0711/Covid-Testing-System-GaTech
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 21 16:02:18 2020
@author: dengqingyuan
"""
# include main_part1.py
import re
import time
import pymysql
from hashlib import md5
from datetime import datetime
from flask import Flask, request, session... | |
size
s = img.size # (width, height)
try:
rotation = dict(img._getexif().items())[orientation]
if rotation == 6: # rotation 270
s = (s[1], s[0])
elif rotation == 8: # rotation 90
s = (s[1], s[0])
except:
pass
return s
def xyxy2xywh(x):
# Convert nx4 boxes from [x1, y1, x2, y2] to [x, y, w, h... | |
= self.SQLRETURN
self.ODBC_DRIVER.SQLConnectA.argtypes = (self.SQLHDBC, ctypes.POINTER(self.SQLCHAR), self.SQLSMALLINT, ctypes.POINTER(self.SQLCHAR), self.SQLSMALLINT, ctypes.POINTER(self.SQLCHAR), self.SQLSMALLINT,)
self.SQLConnectA = self.ODBC_DRIVER.SQLConnectA
else:
self.SQLConnectA = self.UnimplementedSQLFunct... | |
<filename>gazer/ensembler.py
from __future__ import print_function
import os, sys, time, copy, glob, random, warnings
from operator import itemgetter
import numpy as np
from sklearn.externals import joblib
from tqdm import tqdm_notebook as tqdm
from .metrics import get_scorer
from .sampling import Loguniform
from .c... | |
<reponame>glennhickey/cactus
#!/usr/bin/env python
#Copyright (C) 2009-2011 by <NAME> (<EMAIL>)
#
#Released under the MIT license, see LICENSE.txt
import unittest
import os
import sys
import random
import time
import shutil
import filecmp
from sonLib.bioio import system
from sonLib.bioio import logger
from sonLib.bio... | |
#A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* copyright 1998-2000 by <NAME> of DeLano Scientific.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright... | |
<gh_stars>10-100
#
# -*- coding: utf-8 -*-
# Copyright 2019 Cisco and/or its affiliates.
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The nxos_telemetry class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as ... | |
<gh_stars>1-10
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2010 California Institute of Technology. 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 obta... | |
import sys
from Bio import pairwise2
from operator import itemgetter
def compress(all_a_words, all_a_ids, all_b_words, all_b_ids, window_size, recursive=True, verbose=False):
print("Compressing, #words in A: "+str(len(all_a_words))+", #words in B: "+str(len(all_b_words)), file=sys.stderr)
# Compress long trivial ma... | |
operation_id = echo.config.operation_ids.PROPOSAL_CREATE
proposal_create_props = self.get_operation_json("proposal_create_operation")
proposed_ops = [op[:2] for op in proposed_ops]
proposal_create_props.update({
"fee_paying_account": fee_paying_account,
"expiration_time": expiration_time,
"proposed_ops": proposed... | |
064A",
64805: "<final> 0634 062C",
64806: "<final> 0634 062D",
64807: "<final> 0634 062E",
64808: "<final> 0634 0645",
64809: "<final> 0634 0631",
64810: "<final> 0633 0631",
64811: "<final> 0635 0631",
64812: "<final> 0636 0631",
64813: "<initial> 0634 062C",
64814: "<initial> 0634 062D",
64815: "<initial> ... | |
option_invoke not in [Register.INVOKE_SINGLE, Register.INVOKE_FIRST, Register.INVOKE_LAST, Register.INVOKE_ROUNDROBIN, Register.INVOKE_RANDOM]:
raise ProtocolError("invalid value {0} for 'invoke' option in REGISTER".format(option_invoke))
invoke = option_invoke
if u'concurrency' in options:
options_concurrency =... | |
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
This file contains manual modifications.
"""
from xml.dom import minidom
from xml.dom import Node
from xml.parsers.expat import ExpatError
from . import compoundsuper as supermod
from .compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenTy... | |
to complete request
:raise: ``PermissionDenied`` -- authorization failure
*compliance: mandatory -- This method must be implemented.*
"""
return # osid.commenting.CommentList
@abc.abstractmethod
def get_book_ids_by_comment(self, comment_id):
"""Gets the list of ``Book`` ``Ids`` mapped to a ``Comment``.
:par... | |
is too large
month -= 1
preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)
n -= preceding
assert 0 <= n < _days_in_month(year, month)
# Now the year and month are correct, and n is the offset from the
# start of that month: we're done!
return year, month, n + 1
class timedelta:
"""A timedelta obj... | |
#!/usr/bin/env python
# coding: utf-8
# # Das Internet
#
# Nach {cite:ps}`internet2021`
#
# ## Was ist das Internet?
#
# Das Internet ist das beliebteste Computernetz der Welt.
# Es begann als akademisches Forschungsprojekt im Jahr 1969 und wurde in den 1990er Jahren zu einem globalen kommerziellen Netz.
# Heute wi... | |
# -*- coding: utf-8 -*-
"""
Utility functions used by other scripts
Created on Tue Jun 18 23:09:08 2019
@author: lbechberger
"""
from math import sqrt
# distance functions to use in compute_correlations
distance_functions = {'InnerProduct': {'precompute': lambda x, y: [-1 * x_i * y_i for x_i, y_i in zip(x, y)],
'... | |
<reponame>prufrax/boto
# Copyright (c) 2011 <NAME> http://garnaat.org/
# Copyright (c) 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the So... | |
variables upper bound (nx x 1), |
| | | default +inf. |
+---------------+--------+-------------------------------------------------+
| NLPSOL_LBG | lbg | Constraints lower bound (ng x 1), default -inf. |
+---------------+--------+-------------------------------------------------+
| NLPSOL_UBG | ubg | Constraints u... | |
<reponame>zssherman/ACT<gh_stars>10-100
"""
Here we define the methods for performing the tests and putting the
results in the ancillary quality control varible. If you add a test
to this file you will need to add a method reference in the main
qcfilter class definition to make it callable.
"""
import numpy as np
imp... | |
(Stop): What to do after coming to a standstill.
wait (bool): Wait for the motor to reach the target
before continuing with the rest of the
program.
"""
pass
def run_until_stalled(self, speed, then=Stop.COAST, duty_limit=None):
"""Runs the motor at a constant speed until it stalls.
Arguments:
speed (:ref:`sp... | |
start by saying \"%s\" first, and can only be accessed by operators. To get more information on the command/function, use \"help <command>\"." % (
len(operator_cmds), revar.bot_nick) + '\n'
return retrn + "These are the ones available: " + ', '.join(operator_cmds.keys())
if len(msgs) > 0 and msgs[0] == 'save'... | |
ipv6 is False:
environ['REMOTE_ADDR'] = '1.1.1.1'
else:
environ['REMOTE_ADDR'] = '::1'
environ['SERVER_NAME'] = 'localhost'
return DummyRequest(environ, cookie=cookie)
def _cookieValue(self, cookie):
items = cookie.value.split('/')
D = {}
for item in items:
k, v = item.split('=', 1)
D[k] = v
return D
def... | |
<filename>changerequest/models.py
"""django-changerequest models"""
import logging
import threading
from django.conf import settings
from django.core.cache import cache
from django.core.serializers.json import DjangoJSONEncoder
from django.db import models
from django.urls import reverse
from django.utils.encoding im... | |
<filename>test/distributed/fsdp/test_fsdp_optim_state.py<gh_stars>0
# Owner(s): ["oncall: distributed"]
import bisect
import sys
from enum import Enum, auto
from typing import Any, Dict, List, Tuple, Type
import torch
from torch import distributed as dist
from torch.distributed.fsdp import FullyShardedDataParallel as... | |
#
# furl - URL manipulation made simple.
#
# <NAME>
# grunseid.com
# <EMAIL>
#
# License: Build Amazing Things (Unlicense)
import sys
import urllib
if sys.version_info[0] >= 2 and sys.version_info[1] >= 7:
import unittest
else:
import unittest2 as unittest
import urlparse
import warnings
from itertools import izip
f... | |
<reponame>aletuf93/logproj<filename>logproj/ml_dimensionalityReduction.py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import itertools
#machine learning packages
from sklearn import preprocessing
from sklearn.decomposition import PCA
from sklearn import linear_model
from sklearn.ensemble i... | |
from enum import Enum
import socket
from typing import Dict
import airtouch3.constants as const
from airtouch3.helper import (
calculate_checksum,
bit8_in_byte_on,
bit7_in_byte_on
)
class AT3AcMode(Enum):
AUTO = 0
HEAT = 1
DRY = 2
FAN = 3
COOL = 4
def __str__(self):
if self == AT3AcMod... | |
# This software is distributed under the 3-clause BSD License.
# Started 12 April by DLW
# Replace baseparsers.py and enhance functionality.
# The vision is that global_config ConfigDict can be accessed easily
# by all code.
# NOTE: at first I am just copying directly from baseparsers.py
# TBD: reorganize some of this.... | |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google 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/LICENSE-2.0
#
# Unless required ... | |
not None:
remote_user += "@" + settings.SSO_APPEND_DOMAIN
return remote_user
# Make sure we flush the UserProfile object from our remote cache
# whenever we save it.
post_save.connect(flush_user_profile, sender=UserProfile)
class PreregistrationUser(models.Model):
# Data on a partially created user, before the c... | |
your time. Aim to have a job, career, or profession where your inputs don’t match your output."
"Successful people have a strong action bias."
"Productize yourself."
"Aim to become so good at something, that luck eventually finds you. Over time, it isn’t luck; it’s destiny."
"The 5 most important skills are rea... | |
such as AD and AF:
>>> mf = pymaf.MafFrame.from_vcf(vf, keys=['AD', 'AF'])
>>> mf.df
Hugo_Symbol Entrez_Gene_Id Center NCBI_Build Chromosome Start_Position End_Position Strand Variant_Classification Variant_Type Reference_Allele Tumor_Seq_Allele1 Tumor_Seq_Allele2 Protein_Change Tumor_Sample_Barcode AD AF
0 MTOR 2... | |
<reponame>KhronosGroup/COLLADA-CTS<gh_stars>10-100
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limita... | |
<gh_stars>1-10
import abc
import dataclasses as dc
import enum
import types as pytypes
from collections import Counter
from functools import wraps, partial
from typing import Sequence, Callable, Type as PyType, Dict, Any, Optional
import networkx as nx
import statey as st
from statey import resource, task, exc
from s... | |
),
},
'PlatformInventory.Racks.Rack.Slots.Slot.Cards.Card.SubSlots.SubSlot.Module.Attributes.FruInfo.LastOperationalStateChange' : {
'meta_info' : _MetaInfoClass('PlatformInventory.Racks.Rack.Slots.Slot.Cards.Card.SubSlots.SubSlot.Module.Attributes.FruInfo.LastOperationalStateChange',
False,
[
_MetaInfoClassMemb... | |
<reponame>avirtopeanu/module-ansible
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
import copy
import re
import traceback
import yaml
from uuid import (uuid4,... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import sys
import shutil
from casa_distro import six
from casa_distro.command import command, check_boolean
from casa_distro.defaults import default_download_url
from casa_distro.environment import (casa_distro_dir... | |
#!/usr/bin/env python
# coding: utf-8
# <h1><center> Training of a closure for the uncertainty ropagation in the Burgers equation</center></h1>
# <center>
# <NAME> <br>
# </center>
# <div class="math abstract">
# <p style="text-align:center"><b>Abstract</b></p>
# <p>
# Estimation of the closure for the uncertainty pr... | |
cluG
def consensus(cluG, k=5, f=1.0, p=100):
'''
create a more parsimonious results from the cluster graph
Parameters
----------
cluG: hidef_finder.ClusterGraph
k: int
delete components with lower size than this threshold. The 'chi' parameter in the paper
f: float
take this fraction of clusters (ordered by d... | |
from flask import Flask, request
from flask import jsonify,make_response
import json
import re
import base64
from io import BytesIO
from io import StringIO,TextIOWrapper
from PIL import Image
import time
import argparse
import torch.backends.cudnn as cudnn
#from dataset_gen import *
from model import *
f... | |
<reponame>edwardjhu/Megatron-LM
# coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. 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/license... | |
<filename>vwoptimizelib/third_party/networkx/classes/digraph.py
"""Base class for directed graphs."""
# Copyright (C) 2004-2015 by
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# All rights reserved.
# BSD license.
from copy import deepcopy
from ...networkx.classes.graph import Graph
from ...networkx.excepti... | |
to delete at, if this is not supplied, it will delete all data found
:type effective_at: str
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. ... | |
import jax.numpy as jnp
from jax import random as jrdm
from jax import jit, vmap, grad, value_and_grad, tree_multimap, lax
import numpy as np
import random
import matplotlib.pyplot as plt
import time
import pycof as pc
from .initializations import init_params
from .losses import mean_squared_error, binary_cross_entro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.