input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
the name of the fight winner, and the method of winning. Returns a cleaned pandas table.
Set round_by_round=True to use the round-by-round data. Otherwise, uses full fight stats.'''
def create_aggregated_fight_table(raw_fight_tables):
# Aggregate data from multiple tables
fight_table = process_fight(raw_fight_table... | |
<reponame>omikabir/omEngin<filename>TBOT/mssql.py
import pandas as pd
import pyodbc
from datetime import *
soc = "Driver={SQL Server};SERVER=192.168.88.121;DATABASE=SOC_Roster;UID=sa;PWD=<PASSWORD>&"
#soc = "Driver={SQL Server};SERVER=localhost;DATABASE=SOC_Roster;UID=sa;PWD=<PASSWORD>$"
def chk_exist(qry):
conn = p... | |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 5 16:16:35 2019
@author: Meghana
"""
# import os
# os.environ['JOBLIB_START_METHOD'] = "forkserver"
# export JOBLIB_START_METHOD="forkserver"
from numpy import exp as np_exp
from numpy.random import uniform as rand_uniform
from tqdm import tqdm
from joblib import Parallel... | |
everything.
:param str field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything.
:param bool watch: Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
:param str resource_versio... | |
<reponame>toastisme/cctbx_project<filename>mmtbx/command_line/geometry_minimization.py
# LIBTBX_SET_DISPATCHER_NAME phenix.geometry_minimization
from __future__ import absolute_import, division, print_function
import mmtbx.refinement.geometry_minimization
import mmtbx.utils
from iotbx.pdb import combine_unique_pdb_fil... | |
# @endcode
class Sum (Operation2) :
"""Summation operation
>>> op = Sum ( math.sin , math.cos )
"""
def __init__ ( self , a , b ) :
super(Sum,self).__init__ ( a , b , operator.add , '+' )
# =============================================================================
## @class Sub
# Subtraction operation
# @cod... | |
nest1 and schedule1 with a smaller iteration space size
nest1 = Nest(shape=(16, 10))
i1, j1 = nest1.get_indices()
@nest1.iteration_logic
def _():
C[i1, j1] *= B[i1, j1]
schedule1 = nest1.create_schedule()
# Create a fused schedule: the smaller iteration space (nest1) should
# be automatically end-padded with... | |
m, None)
self._scan_code(m, co, co_ast)
m.code = co
if self.replace_paths:
m.code = self._replace_paths_in_code(m.code)
return m
#FIXME: For safety, the "source_module" parameter should default to the
#root node of the current graph if unpassed. This parameter currently
#defaults to None, thus disconnected mo... | |
_dataflow_plus_data_3;
reg _dataflow_plus_valid_3;
wire _dataflow_plus_ready_3;
assign _dataflow_lut_ready_2 = (_dataflow_plus_ready_3 || !_dataflow_plus_valid_3) && (_dataflow_lut_valid_2 && _dataflow__delay_valid_4);
assign _dataflow__delay_ready_4 = (_dataflow_plus_ready_3 || !_dataflow_plus_valid_3) && (_datafl... | |
# -*- coding:utf-8 -*-
# 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 "Licen... | |
py_attrs:
name = "p->%s" % entry.cname
code.putln("tmp = ((PyObject*)%s);" % name)
if entry.is_declared_generic:
code.put_init_to_py_none(name, py_object_type, nanny=False)
else:
code.put_init_to_py_none(name, entry.type, nanny=False)
code.putln("Py_XDECREF(tmp);")
else:
for entry in py_attrs:
code.putln("Py_... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from pytest import mark
from translate.tools import pomerge
from translate.storage import factory
from translate.storage import po
from translate.storage import xliff
from translate.misc import wStringIO
def test_str2bool():
"""test the str2bool function"... | |
&= ~triangle(0.6, 0.95, 0.6, 0.05, 0.18, 0.5)
_widths['K'] = 0.6
_glyphs['K'] = shape
shape = rectangle(0, 0.5, 0, 1)
shape &= ~triangle(0.1, 1, 0.5, 1, 0.1, 0.45)
shape &= ~triangle(0.36, 0, 0.1, 0, 0.1, 0.25)
shape &= ~triangle(0.6, 1, 0.5, 0.0, 0.18, 0.35)
shape &= ~triangle(0.1, 1, 0.6, 1, 0.6, 0.5)
_widths['k'] ... | |
Client, domain: str, base_score: int) -> int:
"""Analyzing premium subscription.
Args:
client: a client with relationship commands.
domain: the domain to check
base_score: the base score from basic analysis
Returns:
score calculated by relationship.
"""
return self.analyze_premium_scores(
domain,
base_sco... | |
tilts when calculating wavefront RMS
orig_modestart = self.modestart
if self.modestart < 4:
self.modestart = 4
norm_coeffs = self.norm_array
# once coeffs are normalized, the RMS is simply the sqrt of the sum of the squares of the coefficients
rms = np.sqrt(np.sum(norm_coeffs**2))
self.modestart = orig_modestart... | |
also considering provided entry
# return a (l, ll, e, ee) tuple
# break entries into two groups
# 'node' is a full node that we wish to add 'entry' to
# assume 'entry' is well-formed, i.e. it has an mbr and a node pointer
def splitNode(self, node, entry):
"""
if entry.getChild().getParent() != None:
print entry... | |
import sys
import os
import shutil
import gzip
import json
import requests
import uuid
import subprocess
import argparse
import time
from concurrent.futures import ThreadPoolExecutor
from random import randint, choices
from tqdm import tqdm
from zipfile import ZipFile
# support for S3
import S3
# support for SWIFT ob... | |
<reponame>sieniven/spot-it-3d
import cv2
import math
import numpy as np
import time
import queue
from camera_stabilizer import stabilize_frame
from camera_stabilizer import Camera
from filterpy.kalman import KalmanFilter
from filterpy.common import Q_discrete_white_noise
from scipy.spatial import distance
from scipy.o... | |
<filename>flaskbb/management/views.py
# -*- coding: utf-8 -*-
"""
flaskbb.management.views
~~~~~~~~~~~~~~~~~~~~~~~~
This module handles the management views.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import logging
import sys
from celery import __version__ as cel... | |
in Alexa global
'http://www.casadellibro.com/',
# Why: #8495 in Alexa global
'http://www.ixwebhosting.com/',
# Why: #8496 in Alexa global
'http://www.buyorbury.com/',
# Why: #8497 in Alexa global
'http://www.getglue.com/',
# Why: #8498 in Alexa global
'http://www.864321.com/',
# Why: #8499 in Alexa global
'h... | |
"""
Synthetic Generators for labeled random graphs for SSL-H
Inspiration: http://networkx.github.io/documentation/latest/_modules/networkx/generators/random_graphs.html
Author: <NAME>
License: Apache Software License
"""
import random
import warnings
from random import randint
from numpy.random import random_sample,... | |
probability that a person is not allowed to move to other districts
blocked_not_allowed_target_district_index = self.model.params.BLOCK_ALLOWED_PROBABILITY < np.random.random(len(target_district_ids))
# If a person is not allowed to move and target location is on lockdown
blocked_district_index = blocked_target_dist... | |
Input structure.
prev_incar (Incar/string): Incar file from previous run.
mode (str): Supported modes are "STATIC" (default), "DIAG", "GW",
and "BSE".
nbands (int): For subsequent calculations, it is generally
recommended to perform NBANDS convergence starting from the
NBANDS of the previous run for DIAG, and to ... | |
<reponame>qingpeng/khmer
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: <EMAIL>
#
# pylint: disable=missing-docstring,protected-access
import khmer
from kh... | |
<reponame>tupui/rbc
"""Implement Buffer type as a base class to HeavyDB Array and Column types.
HeavyDB Buffer represents the following structure:
template<typename T>
struct Buffer {
T* ptr;
size_t sz;
...
}
that is, a structure that has at least two members where the first is
a pointer to some data type and ... | |
from __future__ import division
from . import _breaks
import itertools
import math
class Classifier(object):
def __init__(self, items, breaks, classvalues, key=None, **kwargs):
self.items = items
if isinstance(breaks, bytes):
algo = breaks
breaks = None
else:
algo = "custom"
breaks = breaks
self.al... | |
<filename>species/analysis/fit_model.py<gh_stars>0
"""
Module with functionalities for fitting atmospheric model spectra.
"""
import os
import math
import warnings
from typing import Optional, Union, List, Tuple, Dict
from multiprocessing import Pool, cpu_count
import emcee
import numpy as np
import spectres
from s... | |
#!/usr/bin/env python
import matplotlib
matplotlib.use('TkAgg')
from numpy import arange, sin, pi,log10,max,min,cos,isnan, meshgrid,sqrt,abs
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import pyPLUTO as pp
import string
import time
fro... | |
<filename>cloudmesh/queue/jobqueue.py
import json
import multiprocessing
import os
import shlex
import sys
import time
import uuid
from dataclasses import dataclass
from datetime import datetime
from datetime import timedelta
# from pathlib import Path
from textwrap import dedent
from typing import List
import oyaml a... | |
<reponame>birknilson/oyster
# -*- coding: utf-8 -*-
"""
Oyster
~~~~~
**A Python parser of shell commands.**
This module strives to support commands executed within the sh, bash
and zsh shells alike. An important limitation to mention is that Oyster
does not support parsing of scripted commands, i.e:
for i in ... | |
'd')
# but that data remains the same
assert tn1['t1'].data is tn2['t1'].data
tn2['t1'].data[:] /= 2
assert_allclose(tn1['t1'].data, tn2['t1'].data)
def test_copy_deep(self):
a = rand_tensor((2, 3, 4), inds='abc', tags='t0')
b = rand_tensor((2, 3, 4), inds='abd', tags='t1')
tn1 = TensorNetwork((a, b))
tn2 = t... | |
from __future__ import annotations
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from logging import Logger, getLogger
from typing import Any, Callable, Iterable, Optional, Tuple, Type
from uuid import UUID
import attr
from sqlalchemy import (
Column, Integer, LargeBinary, Me... | |
import json
import httplib2
import http.client
import base64
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import ssl
import socket
import paramiko
from security.rbacTest import rbacTest
from security.rbacmain import rbacmain
from remote.remote_util import RemoteM... | |
_API_DELETE = "/delrule"
_API_GET = "/showrule"
_API_LIST = "/showrule"
API_INIT_PARAMS = {
"name": "Name",
"pattern": "Pattern"
}
_API_BASE_PARAMS = {
"name": "Name",
"type": "Type",
"pattern": "Pattern"
}
_API_DEFAULT_ATTRIBUTES = {
"name": "Name",
"type": "Type",
"pattern": "Pattern",
"matchtype": "M... | |
<filename>programs/representations/representations.py
#Copyright 2020 DB Engineering
#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 require... | |
<gh_stars>1-10
import playfab.PlayFabErrors as PlayFabErrors
import playfab.PlayFabHTTP as PlayFabHTTP
import playfab.PlayFabSettings as PlayFabSettings
""" API methods for managing multiplayer servers. API methods for managing parties. """
def CancelAllMatchmakingTicketsForPlayer(request, callback, customData = Non... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rtk.hardware.ListBook.py is part of the RTK Project
#
# All rights reserved.
# Copyright 2007 - 2017 <NAME> andrew.rowland <AT> reliaqual <DOT> com
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fo... | |
<reponame>google-cloud-sdk-unofficial/google-cloud-sdk<filename>lib/googlecloudsdk/command_lib/app/staging.py<gh_stars>1-10
# -*- coding: utf-8 -*- #
# Copyright 2016 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | |
#!/usr/bin/env python3
"""This script will take the output of cactus-align-batch (which was run on the output of cactus-graphmap-split). This would be
a set of .vg files, one for each chromosome. It will do the following in order to make a single output graph
- clip unmapped regions out of each graph
- join the ids of... | |
'''pipeline runner'''
import os
import json
import time
import glob
import logging
import tempfile
import datetime
import yaml
import utils.pipeline
import postgres.metrics
import postgres.utils
def filter_list(alist, blist):
'''remove blist from alist'''
return list(set(alist)-set(blist))
def get_cwl_steps(cwlwf)... | |
Literal["BinomialJoshi4ConvertibleEngine"]
] = "BinomialJoshi4ConvertibleEngine"
value: GeneralizedBlackScholesProcess
steps: int
class Futures(BaseModel):
resource_name: Optional[Literal["Futures"]] = "Futures"
class OvernightIndexFuture(BaseModel):
resource_name: Optional[Literal["OvernightIndexFuture"]] = "... | |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
die niet bestaat kijken we of er iets in /etc/hostname staat (computernaam)
# maar dat is niet te testen zonder /etc/hosts aan te passen
assert rhfn.get_tldname() == 'lemoncurry.nl'
def add_to_hostsfile(self): # not really testable (yet)
pass
def add_to_server(self): # not really testable (yet)
pass
def test_... | |
#
# This file is part of LiteX.
#
# Copyright (c) 2019-2020 <NAME> <<EMAIL>>
# Copyright (c) 2020 <NAME> <<EMAIL>>
# Copyright (c) 2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
import os
from migen import *
from migen.fhdl.specials import Tristate
from migen.genlib.resetsync import AsyncResetSynchroni... | |
<reponame>online-ml/creme<filename>river/tree/hoeffding_tree.py
import collections
import functools
import io
import math
import typing
from abc import ABC, abstractmethod
from river import base
from river.utils.skmultiflow_utils import (
calculate_object_size,
normalize_values_in_dict,
)
from .nodes.branch import ... | |
prop
@pulumi.output_type
class KikChannelPropertiesResponse(dict):
"""
The parameters to provide for the Kik channel.
"""
def __init__(__self__, *,
api_key: str,
is_enabled: bool,
user_name: str,
is_validated: Optional[bool] = None):
"""
The parameters to provide for the Kik channel.
:param str api_key: Ki... | |
from __future__ import unicode_literals, print_function
import uuid
from django.test import TestCase
from kong_admin import models
from kong_admin import logic
from kong_admin.factory import get_kong_client
from kong_admin.enums import Plugins
from .factories import APIReferenceFactory, PluginConfigurationReference... | |
"""Module for general matrix class and related unit tests."""
import random
import unittest
import exceptions as exc
__version__ = "0.1"
class Matrix:
"""A class to represent a general matrix."""
def __init__(self, m, n, init=True):
"""Initalise matrix dimensions and contents."""
# initialise matrix dimension... | |
###############################################################################
#
# Package: NetMsgs
#
# File: NetMsgsBase.py
#
"""
NetMsgs Base Data Module
"""
## \file
## \package NetMsgs.NetMsgsBase
##
## $LastChangedDate: 2012-07-23 14:06:10 -0600 (Mon, 23 Jul 2012) $
## $Rev: 2098 $
##
## \brief NetMsgs Base D... | |
pd.DataFrame(frame_data2)
pandas_df2 = pandas.DataFrame(frame_data2)
join_types = ["left", "right", "outer", "inner"]
for how in join_types:
modin_join = modin_df.join(modin_df2, how=how)
pandas_join = pandas_df.join(pandas_df2, how=how)
df_equals(modin_join, pandas_join)
frame_data3 = {"col7": [1, 2, 3, 5, 6,... | |
sg filters
resolved_filters = filters
results = [
# Apply the filters for every single entities for the given entity type.
row for row in self._db[entity_type].values()
if self._row_matches_filters(
entity_type, row, resolved_filters, filter_operator, retired_only
)
]
# handle the ordering of the recordset
... | |
# e means error.
if (self.show_stream and self.augmented) or self.show_stream:
self.mark_object(self.current_frame, ex, ey, ew, eh, 30, 50, (255, 0, 0), 2)
self.target_locker.check_error(ex, ey, ew, eh)
break
if self.__check_loop_ended(stop_thread):
break
self.stop_recording()
self.is_watching = False
def ... | |
# some qsub error, e.g. maybe wrong queue specified, don't have permission to submit, etc...
msg = ('Error in job submission with PBS file {f} and cmd {c}\n'.format(f=script_file, c=cmd) +
'The error response reads: {}'.format(process.stderr.read()))
raise self.Error(msg)
except Exception as exc:
# random error,... | |
| | | as it gives moire’-free results. But when the image |
| | | is zoomed, it is similar to the INTER_NEAREST method. |
+-----+-----------------+-------------------------------------------------------+
|(4) | INTER_LANCZOS4 | Lanczos interpolation over 8x8 pixel neighborhood |
+-----+-----------------+-----------... | |
import time
import argparse
from copy import deepcopy
from progress.bar import IncrementalBar
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import utils as vutils
from itertools import chain
from gan.generator import MuseGenerator
from ... | |
label=ugettext_lazy("Web Apps should use"),
initial=None,
required=False,
choices=(
('stars', ugettext_lazy('Latest starred version')),
('nostars', ugettext_lazy('Highest numbered version (not recommended)')),
),
help_text=ugettext_lazy("Choose whether Web Apps should use the latest starred build or highest numb... | |
peridural, durante o puerpério'),
('O89.6', 'Falha na ou dificuldade de entubação, durante o puerpério'),
('O89.8', 'Outras complicações da anestesia durante o puerpério'),
('O89.9', 'Complicação devida a anestesia, durante o puerpério, não especificada'),
('O90.0', 'Ruptura da incisão de cesariana'),
('O90.1', 'R... | |
self._state_a.change_state(data, False)
if self._pipe_condition_mask:
return condition_mask
return changed
class ChangeStateConditionalTransition(_Transition, ConditionalMixin):
"""
Change a state where external condition is true
Parameters:
name: str
state_a: Union[_State, Tuple[_State, Union[bool,
Callab... | |
Machine.objects.filter(machine_group=machine_group).filter(deployed=deployed)
else:
machines = Machine.objects.none()
# send the machines and the data to the plugin
for plugin in manager.getAllPlugins():
if plugin.name == pluginName:
(machines, title) = plugin.plugin_object.filter_machines(machines, data)
retur... | |
27, 5, -1): (0, 1),
(7, 27, 5, 0): (0, 1),
(7, 27, 5, 1): (0, 1),
(7, 27, 5, 2): (0, 0),
(7, 27, 5, 3): (-1, -1),
(7, 27, 5, 4): (0, 1),
(7, 27, 5, 5): (0, 1),
(7, 28, -5, -5): (0, 1),
(7, 28, -5, -4): (0, 1),
(7, 28, -5, -3): (0, 1),
(7, 28, -5, -2): (0, 1),
(7, 28, -5, -1): (0, 1),
(7, 28, -5, 0): (0, 1),... | |
How widgets are aligned within their cells.
See `set_alignment()` for more details about this option.
"""
custom_default_cell_size = 'expand'
"""
How much space a cell will consume if no size is specified.
See `set_default_cell_size()` for more details about this option.
"""
def __init__(self, default_cell... | |
= 2*np.pi * np.sqrt( (np.clip(a, 0, a)**3)/(GLOB_G*M) ) # Units = sec * pc / km
T = _t * GLOB_SecToYr * GLOB_PcToKm
_OE = OrbitElem(a, e_norm, omega * 180 / np.pi, LAN * 180 / np.pi, i * 180 / np.pi, MeanM * 180 / np.pi, T, nu)
return _OE
def OE_Essentials(_parVec:list) -> OrbitElem:
"""
Only calculate e and ... | |
numpy.
if issubclass(b.dtype.type, numpy.complexfloating):
# if complex roots are all complex conjugates, the roots are real.
roots = numpy.asarray(z, complex)
pos_roots = numpy.compress(roots.imag > 0, roots)
neg_roots = numpy.conjugate(numpy.compress(roots.imag < 0, roots))
if len(pos_roots) == len(neg_ro... | |
# coding: utf-8
"""
Copyright (c) 2021 Aspose.Cells Cloud
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 restriction, including without limitation the rights
to use, copy, modify, merge, ... | |
"""+==========================+========-========*========-========+==========================+
|| Lab11.5: Othello2 ||
|| Name: <NAME> Date: 01/13/15 ||
+==========================+========-========*========-========+==========================+
This program plays a game of Othello using alpha and beta
"""
#######... | |
direction and value of D[7:0] pins
# 8b<value>: 0 - low level, 1 - high level
# 8b<direction>: 0 - input, 1 - output
# Selected direction stays until explicitly changed
# It seems that the value gets written to the pin first and only then it's direction gets written
# Therefore attention needs to be paid when chan... | |
<reponame>cdleong/shiba<gh_stars>10-100
import json
import math
import os
import urllib
from pathlib import Path
from types import SimpleNamespace
from typing import Dict, Optional, Tuple
import torch
from shiba.codepoint_tokenizer import CodepointTokenizer
from shiba.local_transformer_encoder_layer import LocalTrans... | |
"""Base Plotting module."""
from __future__ import annotations
from . import State, units
from CoolProp.CoolProp import PropsSI
import matplotlib.pyplot as plt
import numpy as np
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
@dataclass
class PlottedState:
"""Data class to efficiently s... | |
absoluteFidelity.__class__.__name__
)
raise BaseException(strMessage)
def delAbsoluteFidelity(self):
self._absoluteFidelity = None
absoluteFidelity = property(
getAbsoluteFidelity,
setAbsoluteFidelity,
delAbsoluteFidelity,
"Property for absoluteFidelity",
)
# Methods and properties for the 'relativeFidelit... | |
<filename>cgnet/tests/test_geometry_statistics.py
# Author: <NAME>
# Contributors : <NAME>
import numpy as np
import scipy.spatial
import torch
from cgnet.feature import GeometryFeature, GeometryStatistics
# The following sets up our pseud-simulation data
# Number of frames
frames = np.random.randint(1, 10)
# Numb... | |
far. A list of the on-line status of all generators.
overall_online = [g.online for g in case.generators]
# The objective function value is the total system cost.
overall_cost = solution["f"]
# Best case for this stage.
stage_online = overall_online
stage_cost = overall_cost
# Shutdown at most one generator pe... | |
u('\u6e56\u5357\u7701\u682a\u6d32\u5e02')},
'861586975':{'en': 'Yiyang, Hunan', 'zh': u('\u6e56\u5357\u7701\u76ca\u9633\u5e02')},
'861586976':{'en': 'Yiyang, Hunan', 'zh': u('\u6e56\u5357\u7701\u76ca\u9633\u5e02')},
'861586977':{'en': 'Yiyang, Hunan', 'zh': u('\u6e56\u5357\u7701\u76ca\u9633\u5e02')},
'861586978':{'... | |
<reponame>Apteco/apteco-api<gh_stars>1-10
# coding: utf-8
"""
Apteco API
An API to allow access to Apteco Marketing Suite resources # noqa: E501
The version of the OpenAPI document: v2
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Co... | |
other
elif other%2 == 1: # odd power
powL = self.__lo ** other
powH = self.__hi ** other
elif other < 0:
if other%2 == 0: # even power
if self.__lo >= 0:
powL = self.__hi ** other
powH = self.__lo ** other
elif self.__hi < 0:
powL = self.__lo ** other
powH = self.__hi ** other
else: # interval contains zero... | |
child."""
def doFit():
size = self.GetBestChildSize()
if size == self.ManagedChild.Size: return
self.ManagedChild.Size = size
self.AdjustToSize(size)
self.Parent.ContainingSizer.Layout()
self._fit = True
doFit()
wx.CallLater(1, doFit) # Might need recalculation after first layout
def GetBestChildSize(self)... | |
<gh_stars>10-100
import base64
import datetime
import jsonschema
import os
import pymongo
import traceback
import webapp2
from .. import util
from .. import config
from ..types import Origin
from ..auth.authproviders import AuthProvider
from ..auth.apikeys import APIKey
from ..web import errors
from elasticsearch impo... | |
<filename>xcs_soxs/spectra.py
from __future__ import division
import numpy as np
import subprocess
import tempfile
import shutil
import os
from xcs_soxs.utils import soxs_files_path, mylog, \
parse_prng, parse_value, soxs_cfg, line_width_equiv, \
DummyPbar
from xcs_soxs.lib.broaden_lines import broaden_lines
from xc... | |
configuration of the "
f"reader {get_full_module_name(reader)} cannot be serialized "
"in JSON. To resolve this issue, you can consider implementing"
" a JSON serialization for that parameter type or changing the"
" parameters of this reader. Note that in order for the reader"
" to be serialized in JSON, all the v... | |
dbgDict = self.calcRewardAndCheckDone(debug)
#observation of current state
obs = self.getObs()
if (self.checkBestState) and (rwd > self.bestStRwd):
self.bestStRwd = rwd
self.bestState = self.state_vector()
#ob, reward, done, infoDict
return obs, rwd, done, d, dbgDict
#calculate the distance between the COm p... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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... | |
de Configuración: Repositorio</h5>
<ul>
<li> <b>Repositorio:</b> Repositorio de inversores dispuestos por PVlib.</li>
<li> <b>Fabricantes:</b> Lista de fabricantes del repositorio seleccionado.</li>
<li> <b>Inversores:</b> Lista de equipos disponibles en el repositorio según el fabricante seleccionado.</li>
</ul>
... | |
threading.Event().wait(2)
final_message = "Finished with 3 errors"
completed = True
all_ok = False
else:
custom_env = os.environ.copy()
custom_env["LC_ALL"] = "C"
pipe = subprocess.Popen(
(
"sudo",
"-n",
"badblocks",
"-w",
"-s",
"-p",
"0",
"-t",
"0x00",
"-b",
"4096",
dev,
),
stderr=subprocess.PI... | |
<gh_stars>0
import cv2
import numpy as np
import scipy.misc
import imageio
import os
import warnings
from helper_code.registration_funcs import model_arena
from helper_code.processing_funcs import speed_colors, register_frame
def visualize_escape(self):
''' Generate and save escape video clip and dlc tracking clip ''... | |
<gh_stars>0
from http import HTTPStatus
from typing import List, Optional
from fastapi import APIRouter, Depends, Header, Query, Response
from sqlalchemy.orm import Session
import mlrun.api.crud
import mlrun.api.utils.auth.verifier
import mlrun.api.utils.singletons.project_member
import mlrun.errors
import mlrun.feat... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Function:
Implementation approach of Noisy Input Gaussian Processing (NIGP); also the Paper implementation :
"Gaussian Process Training with Input Noise"
Direct calculate the posterior mean and covariance of GP, even the posterior distribution is unknown
Parameters:
var_... | |
<= header_size): continue
star_X_coord = self.find_star_info(line, star_X_coord_column)
star_Y_coord = self.find_star_info(line, star_Y_coord_column)
## avoid empty lines by checking if the X and Y coordinates exist
if not star_X_coord:
continue
if not star_Y_coord:
continue
counter += 1
star_coord = (int(f... | |
<gh_stars>1-10
from __future__ import annotations
__all__ = ('StateBase', 'State', 'StateCollection')
import abc
import asyncio
import collections
import itertools
from typing import (
Any,
AsyncIterable,
AsyncIterator,
Awaitable,
Callable,
cast,
Collection,
Coroutine,
Final,
Generator,
Generic,
Iterator,... | |
np.isfinite(u_xsum)
bg_tcp = interpolate.splrep(np.arange(nx)[u_xsum_ok],
np.asarray(u_xsum)[u_xsum_ok], s=smo1)
# representative background profile in column
u_x = interpolate.splev(np.arange(nx), bg_tcp, )
return u_xsum, u_x, u_std
def findBackground(extimg,background_lower=[None,None], background_upper=... | |
bool)
def initialize(self, infr=None, use_image=False, init_mode='rereview',
review_cfg=None):
print('[viz_graph] initialize')
self.init_mode = init_mode
print('self.init_mode = %r' % (self.init_mode,))
if review_cfg is None:
mode = 'filtered' if self.init_mode == 'split' else 'unfiltered'
self.preset_config... | |
# -*- coding: utf-8 -*-
"""This file contains the Windows NT time zone definitions.
The Windows time zone names can be obtained from the following
Windows Registry key:
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones
"""
# Dictionary to map Windows time zone names to Python equivalent... | |
from __future__ import absolute_import, print_function, division, unicode_literals
import six
from sys import version_info
import pytest
import requests
import responses
from requests.exceptions import ConnectionError
from responses import matchers
def assert_response(resp, body=None, content_type="text/plain"):
a... | |
<gh_stars>0
# -*- coding: utf-8 -*-
#!/usr/bin/python
import math
import numpy as np
import os
# Please cite https://tc.copernicus.org/articles/9/1797/2015/
# for original source --
#@Article{tc-9-1797-2015,
#AUTHOR = {<NAME>}<NAME>.},
#TITLE = {Inter-comparison and evaluation of sea ice algorithms: towards further i... | |
numeric_fields is not None:
assert isinstance(numeric_fields, list)
for col in numeric_fields:
unlabeled_data[col] = unlabeled_data[col].apply(lambda x: x if x == "" else float(x))
if empty_str_to_none:
for col in unlabeled_data.columns.tolist():
empty_str_bool = (unlabeled_data[col] == "")
print("converting {... | |
= Var(within=Reals,bounds=(0,None),initialize=0.0016)
m.x1237 = Var(within=Reals,bounds=(0,None),initialize=0.0016)
m.x1238 = Var(within=Reals,bounds=(0,None),initialize=0.0016)
m.x1239 = Var(within=Reals,bounds=(0,None),initialize=0.0016)
m.x1240 = Var(within=Reals,bounds=(0,None),initialize=0.0016)
m.x1241 = Var(with... | |
<filename>MonkeyBusiness/elilik.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'm1.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5.QtGui import QImage, QPixmap, QPainter, QBrush, QColor
from PyQt5.QtGui import QPale... | |
, "year_filter":"and h.year <= %s" % (year)
, "gp_filter":150
, "grouping":"h.year, h.league, h.player_name"
, "ordering":"year, league, score"
, "ranking_bool":"@yr != year OR @lg != league"
}
, {"table_type": "historical_stats"
, "year_rename": ", h.year_span as year"
, "trophy_type_add":"_OverallLeader"
, "... | |
= np.asarray(node_status).reshape(-1)
if np.prod(shape) != node_status.size:
raise ValueError(
"node status array does not match size of grid "
"(%d != %d)" % (np.prod(shape), len(node_status))
)
# status_at_link_start = node_status.flat[node_id_at_link_start(shape)]
# status_at_link_end = node_status.flat[nod... | |
"""This module contains the classes used for constructing and conducting an Experiment (most
notably, :class:`CVExperiment`). Any class contained herein whose name starts with "Base" should not
be used directly. :class:`CVExperiment` is the preferred means of conducting one-off experimentation
Related
-------
:mod:`hy... | |
# Copyright (c) 2016-present, <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the BSD license. See the LICENSE file for details.
"""Python interface to the Zstandard (zstd) compression library."""
from __future__ import absolute_import, unicode_literals
# This sho... | |
bbox_to_anchor=(0.5, 1.3), fontsize=12, frameon=False)
ax1.text(6, -15, 'Chemical Shift (ppm)', fontsize=16)
ax0.set_ylabel('Intensity', fontsize=16)
ax1.set_ylabel('Intensity', fontsize=16)
# add the relevant labels for species
# butenedial:
ax0.text(5.9, 60, r'\textbf{BD}', fontsize=10)
ax0.text(6.2, 90, r'\textbf{B... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.