input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
= len(temp_array) - 1 # Lower bound is 0
# Counter for a, starts at the end this time
j = a[1]
gallop_thresh = min_gallop
while True:
a_count = 0 # number of times a win in a row
b_count = 0 # number of times b win in a row
# Linear merge, taking note of how many times a and b wins in a row.
# If a_count or ... | |
m.x769 - m.x770 - m.x771 - m.x772 - m.x773 - m.x774 - m.x775 - m.x776 - m.x777 - m.x778
- m.x779 - m.x780 - m.x781 - m.x782 - m.x783 - m.x784 + m.x1130 >= 0)
m.c307 = Constraint(expr= - m.x785 - m.x786 - m.x787 - m.x788 - m.x789 - m.x790 - m.x791 - m.x792 - m.x793 - m.x794
- m.x795 - m.x796 - m.x797 - m.x798 - m.x79... | |
#!/usr/bin/env python
import sys, os, binascii, base64, json, re, subprocess
from collections import OrderedDict
try:
import Tkinter as tk
import ttk
import tkFileDialog as fd
import tkMessageBox as mb
from tkFont import Font, families
from tkColorChooser import askcolor as ac
except:
import tkinter as tk
impor... | |
"""
Tensor based implementation of f-statistics to
simultaneously calculate many comparisons.
Works on VCF files.
For memory efficiency, weighted block-jackknifing is
currently done across whole chromosomes.
F-test was compared to previous implementation (which was checked
against Admixtols). Results were extremely... | |
import itertools
import math
import random
import warnings
import numpy as np
from scipy.interpolate import griddata
from sklearn.decomposition import PCA
import src.multi_agent.elements.mobile_camera as mobileCam
from src import constants
from src.multi_agent.elements.target import TargetType
from src.multi_agent.to... | |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestring ... | |
data.preprocess_notesequence(
note_sequence, self._presplit_on_time_changes)
results = []
for ns in note_sequences:
results.append(
super(BaseHierarchicalNoteSequenceConverter, self).to_tensors(ns))
return self._combine_to_tensor_results(results)
def _to_items(self, samples, controls=None):
"""Python method t... | |
{}) # type: Dict[str, Any]
if metadata is not None:
_header_parameters['x-ms-meta'] = _SERIALIZER.header("metadata", metadata, '{str}')
_header_parameters['x-ms-version'] = _SERIALIZER.header("version", version, 'str')
if lease_id is not None:
_header_parameters['x-ms-lease-id'] = _SERIALIZER.header("lease_id", le... | |
# Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | |
<reponame>David-Durst/aetherling<filename>tests/haskell/test_downsampleStencil_big.py<gh_stars>1-10
from aetherling.modules.reduce import ReduceSequential, ReduceParallel, ReducePartiallyParallel, renameCircuitForReduce
from magma.backend.coreir_ import CoreIRBackend
from magma.bitutils import *
from coreir.context imp... | |
# -*- coding: utf-8 -*-
# (c) 2014 <NAME>, MIT licensed
# (c) 2018-2019 <NAME>, MIT licensed
import logging
from collections import OrderedDict
log = logging.getLogger(__name__)
class DwdCdcKnowledge(object):
"""
Knowledge about the data layout on the DWD Climate Data Centers (CDC) server.
"""
class climate:
... | |
model parameters if not already done so.
Parameters
----------
t_eval : numeric type, optional
The times (in seconds) at which to compute the solution. Can be
provided as an array of times at which to return the solution, or as a
list `[t0, tf]` where `t0` is the initial time and `tf` is the final time.
If prov... | |
<gh_stars>1-10
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB authors.
#
# 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 ... | |
fields:
return ast_pb2.MakeCond(
op, fields[possible_field], [], [], phase_name=phase_name)
elif unquoted_value in fields: # Look for that field with any value.
return ast_pb2.MakeCond(op, fields[unquoted_value], [], [])
else: # Look for any label with that prefix.
return ast_pb2.MakeCond(op, fields['label'], [un... | |
2
# finalize
self.filemask = filemask
self.order = order
self.fshape = fshape
self.__setdimandshape__() # set ndim and shape attributes
def __fcopy__(self, order):
"""
Create a copy
"""
n = pipe_3d(self.filemask, order)
return n
def __fgetitem__(self, slices):
"""
Return ndarray of selected values
(s... | |
<gh_stars>0
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... | |
<reponame>subhylahiri/numpy_linalg_extras<filename>numpy_linalg/convert.py
# -*- coding: utf-8 -*-
"""Helpers for writing __array_ufunc__ and __array_function__ methods.
Routine Listings
----------------
Converters that process inputs/`out` parameter in an `__array_ufunc__` method:
conv_in_attr
Process inputs/`out` ... | |
m.b3011 <= 0)
m.c1612 = Constraint(expr= m.x1611 - m.b3011 <= 0)
m.c1613 = Constraint(expr= m.x1612 - m.b3011 <= 0)
m.c1614 = Constraint(expr= m.x1613 - m.b3011 <= 0)
m.c1615 = Constraint(expr= m.x1614 - m.b3011 <= 0)
m.c1616 = Constraint(expr= m.x1615 - m.b3011 <= 0)
m.c1617 = Constraint(expr= m.x1616 - m.b3011 ... | |
sage: p.order_of_rauzy_action('bottom', 'left')
3
"""
winner = interval_conversion(winner)
side = side_conversion(side)
if side == -1:
return self.length(winner) - self._twin[winner][-1] - 1
elif side == 0:
return self._twin[winner][0]
def erase_marked_points(self):
r"""
Returns a permutation equivalent to... | |
# -*- coding: utf-8 -*-
'''
CRISPResso2 - <NAME> and <NAME> 2018
Software pipeline for the analysis of genome editing outcomes from deep sequencing data
(c) 2018 The General Hospital Corporation. All Rights Reserved.
'''
import os
from copy import deepcopy
import sys
import argparse
import re
import traceback
import j... | |
lines[1].split()
vals.append(vals.pop(0))
del vals[-1]
# If chosen, apply initial reference for the protein backbone restraints
if (stage == 'fe' and comp != 'c' and comp != 'w' and comp != 'f'):
if (bb_equil == 'yes'):
shutil.copy('../../../../equil/'+pose+'/assign.dat', './assign-eq.dat')
else:
shutil.copy('... | |
m.x614 + m.x628 - m.x656 + m.x712 + m.x726 - m.x754 + m.x810 + m.x824 - m.x852 + m.x908
+ m.x922 - m.x950 + m.x1006 + m.x1020 - m.x1048 + m.x1104 + m.x1118 - m.x1146 + m.x1202
+ m.x1216 - m.x1244 + m.x1300 + m.x1314 - m.x1342 <= 100)
m.c3981 = Constraint(expr= m.x615 + m.x629 - m.x657 + m.x713 + m.x727 - m.x755 + m.... | |
start_time + duration
expected_duration = TestDuration(start_time, end_time)
case = _test_cases.TestCase('test_method')
handler = QuietTestResultHandler(test_count=1)
result = TestResult.from_test_case(
case, TestCompletionStatus.skipped, expected_duration,
message='reason')
# When
handler(result)
# Then
o... | |
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the Masci-tools package. #
# (Material science tools) #
# #
# The code is hosted on GitHub at ht... | |
return data
def serve_user_properties(self, group_locator, name, **kwargs): # noqa: E501
"""serve_user_properties # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.serve_user_properties(group_locator, name, asyn... | |
<gh_stars>10-100
'''
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 ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you ma... | |
assert data_from_database == [(record[0], record[1]) for record in
[unified_record.split(',') for unified_record in csv_records[:-1]]]
error_msgs = wiretap.error_records
assert 1 == len(error_msgs)
error_record = error_msgs[0]
assert 'hellolargerword' == error_record.field['1']
assert 'JDBC_14' == error_record... | |
<reponame>vincenttran-msft/azure-sdk-for-python<gh_stars>1-10
# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for... | |
from __future__ import division
import numpy, pandas
from scipy.signal import butter
from scipy import interpolate
import scipy
import csv
import click
import sys, os, re, pprint
from scipy.optimize import curve_fit
from scipy.fftpack import fft
from scipy.signal import butter, lfilter, find_peaks_cwt, detrend, periodo... | |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from collections import OrderedDict
from functools import partial
import numpy as np
from numpy.testing import assert_allclose
import pytest
from jax import random
import jax.numpy as jnp
from funsor import Tensor, bint, reals
impor... | |
a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let a = b in a + b +
let... | |
= (-0.1,0.1))
return fig
def correlation_plots(self, df=None, dfuw=None):
"""correlation plots
We assume that the UW sources correponding to 3FHL sources must have detected photons above 10 GeV.
We use the TS for the energy bands above
10 GeV, called TS10 below, as a measure. Out the ~11K sources with TS>10,... | |
value):
self._storage[self._wrap_key(key)] = value
def __delitem__(self, key):
del self._storage[self._wrap_key(key)]
def __len__(self):
return len(self._storage)
def __iter__(self):
for key in self._storage:
yield key.unwrapped
class _ObjectIdentityWeakKeyDictionary(_ObjectIdentityDictionary):
"""Like we... | |
#################################################################################
def getThreePointCombinations(self, unique=False):
"""
-------------------------------------------------------------------------
Return all or only unique 3-point combinations of baselines
Input:
unique [boolean] If set to True,... | |
#!/usr/bin/env python3
"""Logging index verification tool
This script is meant to help verify ElasticSearch indices after generating logs with logtest clusterloader.
It also has a lot of general helper functions for working with ElasticSearch.
To use this script, you should set up a route to ElasticSearch as describ... | |
gk not in igKeys]
return keys1, keys2
def vis_divided_grid(self, gBins, bBins):
'''
gBins: grid bins
bBins: chosen bins
'''
nX, nY = len(self.binList), len(self.binList[0])
plt.ion()
fig = plt.figure()
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
ax3 = fig.add_subplot(223)
im = n... | |
# -*- coding: utf-8 -*-
#Plotting is on python since this will make it much easier to debug and adjsut
#no need to recompile everytime i change graph color....
#needs a serious refactor
from matplotlib import pyplot as plt
import numpy as np
from .nputil import mid, minmax, vector_apply
from util import parse_arg, des... | |
th, phi) +
s**5 * (-20 * Rho(r, th, phi)**4 * QL(r, th)**5 + 10 * 1j * Rho(r, th, phi)**6 * QL(r, th)**6 + Rho(r, th, phi)**8 * QL(r, th)**7) * Eta(r, th, phi)))
# right
# Take left fiber fields and make coordinate changes (x,y,z,d) ->
# (x,-y,-z,d) and amplitude changes (Ex,Ey,Ez) -> (Ex,-Ey,-Ez).
def ZetaR(r, t... | |
<reponame>hanxucn/mongo-upgrade
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2022, SMARTX
# All rights reserved.
import ConfigParser
import logging
import os
import platform
import subprocess
import sys
import textwrap
from time import sleep
X86_VERSION_MAP = {
"2.6": "2.6",
"3.0": "2.6",
"3.2":... | |
*args)
def getElementName(self):
"""getElementName(SedListOfDataGenerators self) -> string"""
return _libsedml.SedListOfDataGenerators_getElementName(self)
def getTypeCode(self):
"""getTypeCode(SedListOfDataGenerators self) -> int"""
return _libsedml.SedListOfDataGenerators_getTypeCode(self)
def getItemTypeCo... | |
<gh_stars>0
# Built-in
import os
import sys
import logging
import subprocess
import traceback
from collections import OrderedDict
import webbrowser
from functools import partial
import time
# External
from Qt import QtWidgets
from Qt import QtGui
from Qt import QtCore
# Internal
import nxt_editor
from nxt_editor impo... | |
import os
import time
import datetime
import random
import pygame
import io
import sys
import builtins
import traceback
import subprocess
import configparser
from subprocess import check_output, call
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import NumericProperty, StringProperty, Objec... | |
as combined NO and NO2
try:
df['NOx'] = df['no_mr'].values + df['no2_mr'].values
except:
print('WARNING: failed to add NOx to flight {}'.format(flight_ID))
# Add a values for H2O
try:
ds = set_flagged_data2NaNs(ds, VarName='NV_LWC1_C',
FlagName='NV_LWC1_C_FLAG')
ds = set_flagged_data2NaNs(ds, VarName='NV_LWC2_... | |
<filename>kernels.py
import numpy as np
import sys
def symmetrize(X): return X + X.T - np.diag(X.diagonal())
def raiseK(K, d):
if (d<1): raise Exception('non-positive power requested!')
if (d==1): return K
Kpower = K**2
for i in range(d-2): Kpower*=K #this is faster than direct power
return Kpower
def sq_dis... | |
network_tools.edge_aware_smoothness_order2(img=s_im1, pred=s_flow_f)
smooth_loss += self.smooth_order_2_weight * network_tools.edge_aware_smoothness_order2(img=s_im2, pred=s_flow_b)
elif self.smooth_type == 'delta':
smooth_loss += self.smooth_order_2_weight * network_tools.flow_smooth_delta(flow=s_flow_f, if_second_... | |
= matches[1].pk
matching_forms[1]["value"] = 800.01
matching_data = create_formset_data(match_form_prefix, matching_forms)
matching_data["match-INITIAL_FORMS"] = 2
data.update(matching_data)
response = self.client.post(url, data)
self.assertEqual(response.status_code, 200)
self.assertContains(
response,
"Valu... | |
<reponame>chiawei-liu/DeepAlignmentNetwork
from __future__ import division
import numpy as np
from functools import partial
import warnings
from menpo.feature import no_op
from menpo.base import name_of_callable
from menpofit.visualize import print_progress
from menpofit.base import batch
from menpofit.builder import... | |
= self.tfms(img)
chunk = torch.stack(chunk, 0).permute(1, 0, 2, 3)
return chunk, label
def __len__(self): return len(self.data)
def rescale_landmarks(landmarks,row_scale,col_scale):
landmarks2 = copy.deepcopy(torch.Tensor(landmarks).reshape((-1,2)))
for lm in landmarks2:
c,r = lm
lm[0] = c*col_scale
lm[1] = ... | |
import re
from typing import List, Dict
import argparse
from pathlib import Path
from pycparser import CParser, c_ast
from autopxd import AutoPxd
# List the includes to the stdlib we are expecting. This is needed to hack
# around them given they are needed for pycparser, but should endup in the pxd
# as `from libc.st... | |
from manim_imports_ext import *
class TrigRepresentationsScene(Scene):
CONFIG = {
"unit_length" : 1.5,
"arc_radius" : 0.5,
"axes_color" : WHITE,
"circle_color" : RED,
"theta_color" : YELLOW,
"theta_height" : 0.3,
"theta_value" : np.pi/5,
"x_line_colors" : MAROON_B,
"y_line_colors" : BLUE,
}
def setup(self... | |
Annotate
xave = np.median(list(cdf['phi']))
yave = np.median(list(cdf['psi']))
ss_label = str(ss)
weight = 'normal'
if ss in mark_important_secondary_structures:
weight = 'bold'
if ss_label in ss_name_to_label:
ss_label = ss_name_to_label[ss_label]
axes[column]['rama'].annota... | |
from the configuration.
Returns:
ApplyResult[(LinkedPATemplateSummaryRoot, int, typing.Dict)]
"""
self.apply_kwargs_defaults(kwargs=kwargs, return_http_data_only=False, async_req=True)
return self.get_linked_pa_templates_endpoint.call_with_http_info(**kwargs)
def get_linked_pa_templates_by_id(
self,
id="012345... | |
1 : the address that was referenced
"""
dif = end - start
called_list = []
func_name = _getFunctionNameAt(start)
for indx in range(0, dif):
addr = start + indx
func_refs_from = XrefsFrom(addr, 1)
for ref in func_refs_from:
if _getFunctionNameAt(ref.to) == func_name:
# skip jumps inside self
continue
calle... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import cPickle
from ConfigParser import ConfigParser
import numpy as np
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
from pylab import Figure
from CoolProp.HumidAirProp import HAProps, HAProps_Aux
from PyQt4.QtGui import (QDialog, QGridLayout,... | |
# coding: utf-8
"""
Workflow Execution Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noq... | |
<filename>pyale/meta.py
# emacs: at the end of the file
# ex: set sts=4 ts=4 sw=4 et:
"""
ALE-related meta-analysis tools.
TODO: Improve conventions.
A few in-function suffix conventions:
- _values: 1d array matching dimensions of prior (211590). Filled with
meaningful values
- _vector: 1d array matching dimensions o... | |
can only add compute to existing"
f" collections."
)
def add_compute(
self,
dataset_name: str,
client: Union[str, FractalClient],
await_result: bool = False,
) -> None:
"""
A method that can add compute to an existing collection, this involves registering the QM settings and keywords
and running the compute... | |
"""Create the Z3 expression `other >= self`.
>>> x, y = Ints('x y')
>>> x >= y
x >= y
>>> y = Real('y')
>>> x >= y
ToReal(x) >= y
"""
a, b = _coerce_exprs(self, other)
return BoolRef(Z3_mk_ge(self.ctx_ref(), a.as_ast(), b.as_ast()), self.ctx)
def is_arith(a):
"""Return `True` if `a` is an arithmetical expre... | |
m4 = MassFunction(*[(x, 1.0/number) for x in random.sample(mediumElements, number)])
m5 = MassFunction(*[(x, 1.0/number) for x in random.sample(mediumElements, number)])
s = format_time("size 10, focals " + str(number) + ", 2 bbas", time_function(nb_iterations, m1.combination_dubois_prade_unsafe, m2, timeout=timeout... | |
<gh_stars>0
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import numpy as np
import pandas as pd
from ..try_numba import try_numba_jit
import warnings
import logging
from ..utils import (validate_tuple, guess_pos_columns, default_pos_columns,
default_size_columns)... | |
#!/usr/bin/env python3
import netCDF4 as nc
import sys
import numpy as np
import matplotlib.pyplot as plt
import argparse
import scipy.ndimage as sn # contains the filters
from plotTools import addImagePlot
from netcdfTools import read3dDataFromNetCDF
from utilities import selectFromList
#============================... | |
<reponame>gfuchedzhy/hyde
# -*- coding: utf-8 -*-
"""
Parses & holds information about the site to be generated.
"""
import os
import fnmatch
import sys
import urlparse
from functools import wraps
from urllib import quote
from hyde.exceptions import HydeException
from hyde.fs import FS, File, Folder
from hyde.model im... | |
# 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>ghanashyamchalla/cis_interface
"""
Small scanf implementation.
Python has powerful regular expressions but sometimes they are totally overkill
when you just want to parse a simple-formatted string.
C programmers use the scanf-function for these tasks (see link below).
This implementation of scanf translates... | |
= prevnext in ["", "0"]
if not should_stop:
self.logger.warning("Unexpected to have prevnext for order tr data.")
def ResponseForOnReceiveChejanData(self, gubun, itemcnt, fidlist):
fids = fidlist.rstrip(";")
fids = fids.split(";") if fids else []
fids = [int(fid) for fid in fids]
assert itemcnt == len(fids)
... | |
<reponame>teddylfwu/AAAI21-Virtual-Conference<filename>miniconf/load_site_data.py
import copy
import csv
import glob
import itertools
import json
import os
from collections import OrderedDict, defaultdict
from datetime import timedelta
# from scripts.dataentry.tutorials import Session
from typing import Any, DefaultDic... | |
<reponame>dcripplinger/rotj
# -*- coding: UTF-8 -*-
from six import string_types
from math import ceil
from datetime import datetime
import os
import time
import pygame
from pygame.locals import *
from constants import BLACK, ITEMS, WHITE
from helpers import is_half_second, load_image
CHARS = {
# numbers
'0': loa... | |
Record 70: Address = 0x3300, Length = 128
0x3300,0x80,
0x9e,0x3,0x7f,0x33,0xfd,0x1c,0x8b,0xc9,0x2,0xed,0x28,0x61,0x19,0xb4,0xf6,0x8d,
0x65,0xd7,0xa,0x4d,0x1b,0xa3,0xc9,0x88,0x47,0x75,0x90,0x32,0x94,0x2d,0x42,0xdd,
0x71,0x1d,0x68,0x10,0xab,0x6f,0x99,0x5f,0x25,0x86,0xf5,0xce,0xac,0x56,0x40,0x29,
0x5f,0xec,0x72,... | |
[]
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/vnd.orcid+xml; qs=5', 'application/orcid+xml; q... | |
#!/usr/bin/python
#
# Perform optical character recognition, usage:
# python3 ./image2text.py train-image-file.png train-text.txt test-image-file.png
#
# Authors: <NAME> (aagond), <NAME> (hatha), <NAME> (saimorap)
# (based on skeleton code by D. Crandall, Oct 2020)
#
from PIL import Image, ImageDraw, ImageFont
import... | |
pass
elif (tuple_idx[0] <= list_start_end_2[-1][0]) & (
tuple_idx[1] >= list_start_end_2[-1][1]
):
list_start_end_2[-1] = tuple_idx
else:
list_start_end_2.append(tuple_idx)
basepalette = [
"#E73F74",
"#7F3C8D",
"#11A579",
"#3969AC",
"#F2B701",
"#80BA5A",
"#E68310",
]
palette = basepalette[: len(methods... | |
that supports the newer
version of the API, you instantiate this class. See :ref:`enumerated
type description page <enumeration_description>`.
"""
orange = None
"""
The service health is degraded. The service might have serious problems.
"""
gray = None
"""
No health data is available for this service.
"""... | |
the same number of 0's and 1's, and all the 0's and all the 1's in these
substrings are grouped consecutively.
Substrings that occur multiple times are counted the number of times they occur.
Example 1:
Input: s = "00110011"
Output: 6
Explanation: There are 6 substrings that have equal number of consecutive 1's... | |
m.x714 == 0)
m.c1044 = Constraint(expr=-m.x26*m.x1171 + m.x715 == 0)
m.c1045 = Constraint(expr=-m.x27*m.x1172 + m.x716 == 0)
m.c1046 = Constraint(expr=-m.x28*m.x1172 + m.x717 == 0)
m.c1047 = Constraint(expr=-m.x29*m.x1172 + m.x718 == 0)
m.c1048 = Constraint(expr=-m.x30*m.x1172 + m.x719 == 0)
m.c1049 = Constraint(... | |
<gh_stars>100-1000
# Create your models here.
import os
import tempfile
import uuid
from datetime import timedelta
from django.contrib.contenttypes.fields import GenericRelation, GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.files import File
from django.core.files.stora... | |
264
-1.094041394294266e-01 -8.494081165558205e-02 -3.401176384013899e-04 0.000000000000000e+00 2.040516518390330e-03 -7.095200000000000e-01 -3.081000000000000e-02 0.000000000000000e+00
-1.992343996060021e-01 -1.121249882337864e-02 2.099237485641801e-04 0.000000000000000e+00 -7.976301500537214e-03 1.273900000000000e-0... | |
<filename>Projects/superhero-dueler/superheroes.py<gh_stars>0
import random
import math
from functools import reduce
class Ability():
def __init__(self, name, attack_strength):
'''
Initiate the abilities class with its name and attack strength
Args:
name (string): a single word discriptor of the ability
attack_... | |
<filename>Source/Source Code/gens.py
# NS2 Script Generator
import os
import math
import datetime
activate_mal=False # do we want malware node?
CNUMER = 10 # Total number of nodes in a cluster
run_time = 10.0 # Runtime in seconds
#Initialisation
if activate_mal:
ns_file_name = "attack.tcl"
else:
ns_file_name = "no... | |
#!/usr/bin/env python
"""Provides class Actor with the function approximator (NN) of the Actor
Actor creates the Neural Network model with Tensorflow and it can train the network online.
The user can decide the number of layers, the number of neurons, the batch size and the number
of epochs and activation functions.
"... | |
import sys
sys.path.insert(0, "/home/hardik/dl_exp/nglod/sdf-net/lib/submodules/libigl/python/")
import pyigl as igl
from decimal import *
import iglhelpers
# import miniball
import math
import numpy as np
from matplotlib import pyplot
from mpl_toolkits.mplot3d import Axes3D
from scipy.stats import gaussian_kde
... | |
# copytrue (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 ... | |
<gh_stars>0
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from skimage.transform import pyramid_gaussian
from PIL import Image
import numpy as np
from struct import unpack
import os
import sys
import re
import gc
import fs_utility
from logger import Logger
log = Logger(__name__... | |
NonCommutativeSymmetricFunctions(QQ).S()
sage: SGA4 = SymmetricGroupAlgebra(QQ, 4)
sage: D4 = DescentAlgebra(QQ, 4).D()
sage: all( S[C].to_symmetric_group_algebra()
....: == SGA4(D4(S[C].to_descent_algebra(4)))
....: for C in Compositions(4) )
True
"""
S = NonCommutativeSymmetricFunctions(self.base_ring()).S()
... | |
<filename>imutils/ml/run_main.py
# import logging
# import os
# import shutil
# from pathlib import Path
# from typing import List
import hydra
from hydra.core.hydra_config import HydraConfig
from icecream import ic
# import omegaconf
import os
from omegaconf import DictConfig, OmegaConf
from rich import print as p... | |
import argparse
import ConfigParser
import cPickle
import csv
import mysql.connector
import time
import sys, os, re
from context import diana
import diana.classes.drug as diana_drug
def main():
options = parse_user_arguments()
design_experiment_dcdb(options)
def parse_user_arguments(*args, **kwds):
"""
Parses ... | |
<reponame>pschou/py-sdf<gh_stars>0
"""
Copyright 2010 <NAME> <<EMAIL>>
Copyright 2008 <NAME>
This file is part of PyCAM.
PyCAM 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 3 of the License, or
... | |
<reponame>Forenzik-1989/Kyty
# Copyright (c) 2014-2020 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 limitation
# the r... | |
ki.getGroup(op.param1)
ki.leaveGroup(op.param1)
else:
ki.acceptGroupInvitation(op.param1)
ginfo = ki.getGroup(op.param1)
if Bmid in op.param3:
if wait["autoJoin"] == True:
if op.param2 not in Bots and op.param2 not in owner and op.param2 not in admin and op.param2 not in staff:
kk.acceptGroupInvitation(op.param... | |
from __future__ import print_function
import glob
import sys
sys.path.append(glob.glob('C:\CARLA\CARLA_0.9.11\PythonAPI\carla\dist\carla-0.9.11-py3.7-win-amd64.egg')[0])
import carla
from carla import ColorConverter as cc
import pygame
import collections
import math
import re
import weakref
import numpy as np
def ... | |
#!/usr/bin/python3
# <---------------------------------------------------------------------------- general imports --->
import os
import sys
import datetime
import configparser
from random import random
import math
# <---------------------------------------------------------------------------- numeric imports --->
imp... | |
#!/usr/bin/env python
import os
import sys
import cookielib
import urllib
import urllib2
import json
import time
import argparse
import pandas as pd
import base64
from tqdm import tqdm
import re
# check that the python version is correct (need 2)
if sys.version_info[0] > 2:
raise "Must be using Python 2! Aborting."
... | |
# 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 ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
devtools: bool = False,
slowMo: timedelta = timedelta(seconds=0),
channel: Optional[str] = None,
) -> str:
"""Create a new playwright Browser with specified options.
See `Browser, Context and Page` for more information about Browser and related concepts.
Returns a stable identifier for the created browser.
`... | |
#!/usr/bin/python
import xml.dom.minidom
import sys
from optparse import OptionParser
import random
from hadoop_conf import *
chunk_size = []
def xml_children(node, children_name):
"""return list of node's children nodes with name of children_name"""
return node.getElementsByTagName(children_name)
def xml_text(... | |
'O local que a pessoa vai, que pode ser genérico (para Relatórios) ou preciso (para exibir em um mapa). Digite alguns caracteres para procurar nos locais disponíveis.',
'The Media Library provides a catalog of digital media.': 'A Biblioteca de mídias fornece um catálogo de mídia digital.',
'The Messaging Module is th... | |
"""
Module contains basic handlers:
* BaseHandler - to be used for custom handlers. For instance - RPC, if you wish.
* ApiHandler - Abstract for API handlers above.
* ApiListHandler - Create (POST), List view (GET).
* ApiItemHandler - detailed view (GET), Update (PUT), Delete (DELETE).
"""
import json
import operator... | |
from util.util import add_dummy_to_tensor
import torch.utils.data as data
import torch
from PIL import Image
import torchvision.transforms as transforms
import numpy as np
import random
class BaseDataset(data.Dataset):
def __init__(self):
super(BaseDataset, self).__init__()
def name(self):
return 'BaseDataset'
... | |
import numpy as np
tss = np.array([[13.25539804, 1413.250347, 2561.9326, 1007.772729, 152.012186],
[255.3217538, 3388.986757, 6639.253742, 5888.099069, 3065.611859],
[-79.8970679, -3209.156273, -5619.538006, -3973.767508, -1546.755417],
[195.001956, 1453.189894, 2106.965705, 1956.082474, 1180.965793],
[-347.692601... | |
<filename>cortex/polyutils.py<gh_stars>0
from collections import OrderedDict
import numpy as np
from scipy.spatial import distance, Delaunay
from scipy import sparse
import scipy.sparse.linalg
import functools
import numexpr as ne
def _memo(fn):
"""Helper decorator memoizes the given zero-argument function.
Really h... | |
"""
Small collection of robust statistical estimators based on functions from
<NAME> (Hughes STX) statistics library (called ROBLIB) that have
been incorporated into the AstroIDL User's Library. Function included are:
* medabsdev - median absolute deviation
* biweightMean - biweighted mean estimator
* mean - robust... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.