input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
0)
m.c2526 = Constraint(expr= m.x2525 - m.b3017 <= 0)
m.c2527 = Constraint(expr= m.x2526 - m.b3017 <= 0)
m.c2528 = Constraint(expr= m.x2527 - m.b3017 <= 0)
m.c2529 = Constraint(expr= m.x2528 - m.b3017 <= 0)
m.c2530 = Constraint(expr= m.x2529 - m.b3017 <= 0)
m.c2531 = Constraint(expr= m.x2530 - m.b3017 <= 0)
m.c2... | |
<gh_stars>10-100
""" Contains various functions for mathematical/geological transforms. """
from math import isnan, ceil
from warnings import warn
import numpy as np
try:
import cupy as cp
CUPY_AVAILABLE = True
except ImportError:
cp = np
CUPY_AVAILABLE = False
import bottleneck
import numexpr
from numba import nj... | |
<gh_stars>1-10
import os
import pickle
import re
import sys
list_destparam_0_cpyapi = ['sprintf', 'gets', 'fgets', '_memccpy', '_mbscpy', '_strncpy', 'wmemset', 'vasprintf', 'asprintf', 'wcsncpy', 'lstrcpy', '_wcsncpy', '_snprintf', 'memcpy', 'memmove', '_tcscpy', '_snwprintf', 'strcpy', 'CopyMemory', 'wcsncat', 'vspr... | |
= False
it_since_step_all[~complete] = it_since_step + 1
if it > 0:
batch_complete = ((diff < tol) & ((alp_diff < tol) | (alp_new < tol))) | xp.isnan(diff) | step_stop
# batch_complete = ((diff < tol) & (alp_diff < tol)) | xp.isnan(diff) | step_stop
# ignore stepsize if last values met tol (so var_beta is consi... | |
# Copyright 2017 The Abseil 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | |
<reponame>abosoar/camel_tools
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright 2018-2020 New York University <NAME>
#
# 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, ... | |
"""
Generates plots / figures when run as a script.
Plot files are placed in the :file:`plots` directory.
By default, simply running ``python -m src.plots`` generates **ALL** plots,
which may not be desired. Instead, one can pass a list of plots to generate:
``python -m src.plots plot1 plot2 ...``. The full list of pl... | |
for all in k6_beschreibung:
x = eval("self.cb_k6_" + all)
x.setChecked(False)
def btn_k7_pressed(self):
if self.cb_k7_dr.isChecked() == False:
for all in k7_beschreibung:
x = eval("self.cb_k7_" + all)
x.setChecked(True)
elif self.cb_k7_dr.isChecked() == True:
for all in k7_beschreibung:
x = eval("self.cb_k7_... | |
"""
Module containing functions and classes related to Spectra calculation and
manipulation
Spectra are calculated from the windowed, decimated time data. The inbuilt
Fourier transform implementation is inspired by the implementation of the
scipy stft function.
"""
from loguru import logger
from pathlib import Path
fr... | |
import argparse
import os
import pickle
import sys
from pathlib import Path
from collections import OrderedDict
from typing import Union
import numpy as np
import scipy.signal
import scipy.stats
from matplotlib import collections as collections
from matplotlib import pyplot as mpl
from matplotlib import rc
from matplo... | |
nday_average)
large_df = df.reindex(large_index.dayofyear)
smoothed_df = large_df.rolling(window=nday_average, min_periods=0).mean()
return smoothed_df / divisor
def _line_name(date_index):
start = date_index[0].year
end = date_index[-1].year
if start == end:
return str(start)
else:
return '{start}-{end}'.f... | |
patient """
# Temperature
aggregated_df['temp_SIRS'] = 0
aggregated_df.loc[aggregated_df['223762'] < 10, '223762'] = float("NaN")
aggregated_df.loc[aggregated_df['223762'] > 50, '223762'] = float("NaN")
aggregated_df.loc[aggregated_df['223761'] < 70, '223761'] = float("NaN")
aggregated_df.loc[aggregated_df['22376... | |
<filename>vumi/persist/fields.py
# -*- test-case-name: vumi.persist.tests.test_fields -*-
"""Field types for Vumi's persistence models."""
from datetime import datetime
from vumi.message import VUMI_DATE_FORMAT
from vumi.utils import to_kwargs
class ValidationError(Exception):
"""Raised when a value assigned to a... | |
#!/usr/bin/python
import argparse
import copy
import getpass
import io
import os
from ruamel.yaml import (YAML, YAMLError, )
import socket
import sys
import unittest
import fsl_sub.cmdline
from unittest.mock import patch
YAML_CONF = '''---
method: sge
modulecmd: /usr/bin/modulecmd
thread_control:
- OMP_NUM_THREADS
-... | |
if image_base:
os.environ['ALRB_CONT_UNPACKEDDIR'] = image_base
paths = [os.path.join(image_base, os.path.basename(self.imagename)),
os.path.join(image_base, self.imagename)]
local_path = get_valid_path_from_list(paths)
if local_path:
self.imagename = local_path
#if image_base and not os.path.isabs(self.imagenam... | |
return _gui.Gui_class_info()
Gui_class_info = _gui.Gui_class_info
def Gui____class_destructor__(instance, is_array):
return _gui.Gui____class_destructor__(instance, is_array)
Gui____class_destructor__ = _gui.Gui____class_destructor__
class GuiResource(base.CoreBaseType):
__swig_setmethods__ = {}
for _s in [base.Co... | |
a compatibility measure, allowing a checkpointable
object to add dependencies on variables created in a block of code which is
not aware of object-based saving (and instead uses variable names
heavily). This is how `Template` objects add dependencies on variables and
sub-`Template`s. Where possible, use `tf.make_te... | |
"readonly": False},
{"prefix": "TEC", "id": 6004, "name": "ObjMeasADCCalibGain", "type": float, "mepar_type": MeParType.FLOAT32, "readonly": False},
{"prefix": "TEC", "id": 6005, "name": "ObjMeasSensorTypeSelection", "type": int, "mepar_type": MeParType.INT32, "readonly": False},
{"prefix": "TEC", "id": 6010, "na... | |
cmd, *args):
"""
Builder for simple commands
@param cmd The command to build
@param args Unused arguments
@retval Returns string ready for sending to instrument
"""
return "%s%s" % (cmd, self._newline)
def _build_keypress_command(self, cmd, *args):
"""
Builder for simple, non-EOLN-terminated commands
@par... | |
if tableRowValues is None:
self.tableRowValues = []
else:
self.tableRowValues = tableRowValues
def factory(*args_, **kwargs_):
if TableType.subclass:
return TableType.subclass(*args_, **kwargs_)
else:
return TableType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_tableColumnTypes(self): return se... | |
= cursor.fetchone()
if result:
try:
if listener:
low = result['Roll_low']
high = result['Roll_high']
listener.item_rolled(purpose, low, high, strength)
except IndexError as ex:
return None
else:
#print('No result for roll', roll)
return None
if ENABLE_CACHE:
if self.cache_style == 1:
line = {}
line['low... | |
<filename>plugins/hg4idea/testData/bin/hgext/graphlog.py
# ASCII graph log extension for Mercurial
#
# Copyright 2007 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''command to view revision graphs from a shell... | |
= Tools.timeToIndex(spks, self.dt)
# Compute adaptation current (sum of eta triggered at spike times in spks)
eta_sum = np.array(np.zeros(int(p_T + 1.1*p_eta_l + p_Tref_i)), dtype="double")
for s in spks_i :
eta_sum[s + 1 + p_Tref_i : s + 1 + p_Tref_i + p_eta_l] += p_eta
eta_sum = eta_sum[:p_T]
# Set initia... | |
i, e in enumerate(c2l):
#e1 = e; #.copy();
e.append(i);
c2lSorted.append(e);
c2lSorted.sort();
#common.DebugPrint("unique(): c2lSorted = %s" % str(c2lSorted));
c2lSortedIndex = [];
for e in c2lSorted:
c2lSortedIndex.append(e[2]);
#common.DebugPrint("unique(): c2lSortedIndex = %s" % str(c2lSortedIndex));
#qu... | |
a `time` attribute. They do not need to be sorted. This
parameter is needed to numerically estimate the time derivative of
the `c` coefficient of the time evolution vectors (used only in
option 4, see below).
@param steps
How many curves in the future and past of this curve to consider
from `curves`. Default is `... | |
_validation = {
'command_line': {'required': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'command_line': {'key': 'commandLine', 'type': 'str'},
'container_settings': {'key': 'containerSettings', 'type': 'TaskContainerSettings'},
'resource_files': {'key': 'resourceFiles', 'type': '[ExtendedRe... | |
mv(ow,12)
yield from align.m1pit
yield from m3_check()
#FIX E-SCANS
yield from mv(pgm.en,EA)
yield from sleep(5)
yield from scan([sclr,qem12],cryo.t,6,23,ow,12,46,86, md = {'reason':'Reflectivity @ 526.3 eV'})
yield from mv(pgm.en,EB)
yield from sleep(5)
yield from scan([sclr,qem12],cryo.t,23,6,ow,46,12,86, md... | |
<gh_stars>1-10
# coding: utf-8
import sys
from python_environment_check import check_packages
import numpy as np
import os
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
# # Machine Learning with PyTorch and Scikit-Learn
# # -- Code Examples
# ## Package version ch... | |
<reponame>appleseedhq/cortex
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# ... | |
"""
Django model definitions (database schema).
## django-peeringdb
peeringdb_server uses the abstract models from django-peeringdb.
Often, it makes the most sense for a field to be added to the abstraction
in django-peeringdb, so it can be available for people using local snapshots of the databases.
Generally spea... | |
1424.647927352167, 2676217.667872637, 5151840.492070999,
6253461.142118783, 11.605501217123276, 0.016034774278074274, 1.670666167191741e-06],
[1172.1322901571223, 1261.353970231427, 1424.647927352167, 2643981.980613781, 5539495.081817166,
6122658.492254281, 11.426790838912128, 0.014402352374322306, 1.746960716329272... | |
'# clequ1Ph3x2x3x3'],
[3, 3, 1, 1, format(angle(scaled_wc('lequ1_3311')), '.6e'), '# clequ1Ph3x3x1x1'],
[3, 3, 1, 2, format(angle(scaled_wc('lequ1_3312')), '.6e'), '# clequ1Ph3x3x1x2'],
[3, 3, 1, 3, format(angle(scaled_wc('lequ1_3313')), '.6e'), '# clequ1Ph3x3x1x3'],
[3, 3, 2, 1, format(angle(scaled_wc('lequ1_3... | |
<filename>vaccination_level.py
#!/usr/bin/env python
# 1. Get request from developer tools in chrome based browser
# 2. https://curl.trillworks.com/
import sys
import requests
import sqlite3
import time
import hashlib
import signal
import argparse
from datetime import datetime, date, timedelta
import math
headers... | |
<gh_stars>1-10
# -*- coding: UTF-8; indent-tabs-mode:nil; tab-width:4 -*-
# This file is part of DITA DTD Generator.
#
# Copyright 2009 <NAME> <http://www.elovirta.com/>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | |
(inet:ip-address-no-zone)
YANG Description: When an IP next-hop is specified in the next-hop field,
packets matching the match criteria for the forwarding rule
should be forwarded to the next-hop IP address, bypassing any
lookup on the local system.
"""
return self.__next_hop
def _set_next_hop(self, v, load=False... | |
# Copyright 2021 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 by applicable law or agree... | |
<filename>benchmarking/driver/benchmark_driver.py
#!/usr/bin/env python
##############################################################################
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of ... | |
a colection of things.
Especially useful for representing a collection of related variables."""
def __init__(self, **keywords):
self.__dict__.update(keywords)
def __repr__(self):
return self.toString()
def ivars(self):
return sorted(self.__dict__)
def keys(self):
return sorted(self.__dict__)
def toStrin... | |
import argparse
import datasets as nlp
import sys
import os
import openai
import csv
import random
import time
from tqdm import tqdm
import ast
from datetime import datetime
import git
import copy
import itertools
import jsonlines
"""
Usage: python get_cose_gpt3_completion_accuracy.py [task_type] [model_engine] [num_s... | |
2, 1, 9, 7],
[2, 5, 7, 9, 4, 8, 5, 7],
[6, 8, 10, 0, 4, 9, 8, 10],
],
dtype=np.float32,
)
elif flow.env.get_rank() == 3:
np_arr = np.array(
[
[9, 4, 5, 8, 9, 6, 5, 8],
[7, 2, 9, 5, 4, 1, 7, 2],
[6, 3, 9, 2, 5, 2, 9, 2],
[3, 7, 5, 8, 9, 3, 7, 5],
],
dtype=np.float32,
)
device = flow.device(in_device)
te... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
from onmt.models.transformer_layers import PositionalEncoding, PrePostProcessing
from onmt.models.transformer_layers import EncoderLayer, DecoderLayer
from onmt.models.transformers import TransformerEncoder, TransformerDecoder, Transformer, Transformer... | |
target, GLenum format, GLenum type, void *row, void *column, void *span);
void glDeleteProgram(GLuint program);
void glColor4bv(const GLbyte *v);
void glRasterPos2f(GLfloat x, GLfloat y);
void glNamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit);
void glLoadIdentity();
void ... | |
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import re
import sys
import shutil
import copy
import socket
import ruamel.yaml
import six
from ordereddict_ba... | |
dump_memory=False, quiesce=False):
"""Create a snapshot for a given machine"""
return self.connection.ex_create_snapshot(
node, snapshot_name, description,
dump_memory=dump_memory, quiesce=quiesce)
def _revert_machine_to_snapshot(self, machine, node,
snapshot_name=None):
"""Revert a given machine to a previous ... | |
<reponame>simonpf/gprof_nn
"""
==================
gprof_nn.bin.train
==================
This sub-module implements the 'train' sub-command of the
'gprof_nn' command line application, which trains
networks for the GPROF-NN retrieval algorithm.
"""
import argparse
import logging
from concurrent.futures import ProcessPoo... | |
<reponame>sailxjx/DI-engine
"""
This implementation of ResNet is a bit modification version of `https://github.com/rwightman/pytorch-image-models.git`
"""
from typing import List
import math
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from .nn_module import Flatten
def to_2tuple(item):
i... | |
= MatrixSymbol('T', 3, 3)
>>> P(Eq(YS[3], 2), Eq(YS[1], 1) & TransitionMatrixOf(YS, TS))
T[0, 2]*T[1, 0] + T[1, 1]*T[1, 2] + T[1, 2]*T[2, 2]
>>> P(Eq(Y[3], 2), Eq(Y[1], 1)).round(2)
0.36
Probabilities will be calculated based on indexes rather
than state names. For example, with the Sunny-Cloudy-Rainy
model wit... | |
import datetime
import io
import json
import logging
import os
import random
import uuid
from datetime import datetime as datetime_constructor
from datetime import timezone
import matplotlib
matplotlib.use("Agg")
import cv2
import matplotlib.pyplot as plt
import pandas as pd
import psycopg2
import pytz
from django.co... | |
Specify the Security Group category name. (required)
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It ... | |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | |
# -*- encoding: utf-8 -*-
from __future__ import print_function
import sys
from copy import deepcopy
from collections import defaultdict
from itertools import chain, izip
import jsparser
def pairs(iterable):
it = iter(iterable)
e1 = next(it)
for e2 in it:
yield e1, e2
e1 = e2
def childs(node... | |
]
pie_left_list = [
'left',
'frontleft',
'front',
'frontright',
'right',
'backright',
'back',
'backleft',
]
pie_right_list = [
'right',
'backright',
'back',
'backleft',
'left',
'frontleft',
'front',
'frontright',
]
viewpoint_tag_dict = {
'zebra_grevys': pie_right_list,
'zebra_plains': pie_left_l... | |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.estimators.estimator_base i... | |
* 9 * 10, dtype=np.uint8).reshape((5, 7, 9, 10))
dataXCorrect, dataYCorrect, patchIndicesCorrect = \
reference_extract_patched_all_data_without_empty_4d(data, (3, 4, 3, 5), (1, 1, 2, 1), 15)
dataXActual, dataYActual, patchIndicesActual = \
patching_tools.extract_patched_all_data_without_empty_4d(data, (3, 4, 3, 5)... | |
+ "p42881275-p43008824.7z"),
page_ids=range(42881275, 43008825),
darus_id=93586,
sha1="e3d370bd1c9cf81348eee7d97ac567018f2598d9",
size=441514920,
auto_download=auto_download,
),
WikidatedV1_0EntityStreamsFile(
archive_path=dataset_dir / (prefix + "p43008825-p43151391.7z"),
page_ids=range(43008825, 43151392),
... | |
range(14):
ROM.write(BubbleLead[y])
Pointer += 1
elif weapons[x] == Quickbyte:
Pointer = Palette[x]
Seek = ROM.seek(Pointer,0)
for y in range(14):
ROM.write(QuickBoomerang[y])
Pointer += 1
elif weapons[x] == Heatbyte:
Pointer = Palette[x]
Seek = ROM.seek(Pointer,0)
for y in range(14):
ROM.writ... | |
<reponame>IntegralDefense/ACE<gh_stars>10-100
# vim: sw=4:ts=4:et
import logging
import os, os.path
import pickle
import re
import shutil
import signal
import tarfile
import tempfile
import threading
import time
import unittest
import uuid
from multiprocessing import Queue, cpu_count, Event
from queue import Empty
i... | |
#/usr/bin/env python
"""
globiconfig/Main.py - globifest Config Main Application
Copyright 2018-2019, <NAME>, Garmin Ltd, or its subsidiaries.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Re... | |
**self.policy_data['policy'])
with mock.patch('neutron.objects.qos.policy.QosPolicy.get_object',
return_value=_policy):
setattr(_policy, "rules", [])
self.assertRaises(
qos_exc.QosRuleNotFound,
self.qos_plugin.update_policy_packet_rate_limit_rule,
self.ctxt, self.pps_rule.id, self.policy.id,
self.rule_data)
d... | |
<filename>main.py
import os
import random
from csv import reader
from json import dumps, load, loads, dump
from os import getpid
from sys import argv
from threading import Thread, current_thread
from time import sleep, time
from PyQt5.QtGui import QFontDatabase
import psutil
from PyQt5 import QtCore, QtWidgets
from Py... | |
<gh_stars>0
#Linear SVM for Two-class Problem
#.......................................................................IMPORTS
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
import numpy as np
from sklearn.svm import LinearSVC
from sklearn.metrics import confusion_matri... | |
<gh_stars>1-10
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, <NAME> and <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistribution... | |
total, outp = self.parse_xml(_id, ship, table, raw)
if total:
await bot.say(outp)
else:
print("WARNING: ###############################################")
print("WARNING: Didn't find anything to lookup, skipping lookup.")
print("WARNING: ###############################################")
await bot.say("<@{}> {}{... | |
copy of atoms object from last calculation
self.results = {} # calculated properties (energy, forces, ...)
self.parameters = None # calculational parameters
if restart is not None:
try:
self.read(restart) # read parameters, atoms and results
except ReadError:
if ignore_bad_restart_file:
self.reset()
else:
ra... | |
From dictionaries, plots average activity across gabor orientations or
brick directions per ROI for a single session and optionally a single
quintile. (Single figure type)
Required args:
- fig_type (str) : type of figure to plot, i.e., "byplot", "byreg",
"byfir" or "by{}{}" (ori/dir, deg)
- analyspar (dict):... | |
in enumerate(case) \
if c == '1' and control_qubits[i] not in control_qubits_by_case]
# control_qubits_by_case += [control_qubits[i] for i,c in enumerate(case) if c == '1']
# sort selected control qubits according to readout (feedline) order
# qb_ro_order = np.sum([ list(self._acq_ch_map[key].keys()) for key in se... | |
<gh_stars>0
import copy
import logging
import os
import re
import subprocess
import tempfile
import uuid
from collections import OrderedDict
from functools import partial
from io import BytesIO
import bleach
from django.conf import settings
from django.contrib.staticfiles import finders
from django.dispatch import rec... | |
unless the user or an admin has
# deactivated their account. The name comes from Django; this field
# isn't related to presence or to whether the user has recently used Zulip.
#
# See also `long_term_idle`.
is_active: bool = models.BooleanField(default=True, db_index=True)
is_billing_admin: bool = models.Boolean... | |
<gh_stars>10-100
import logging
import os
import numpy as np
from openff.units import unit as pint_unit
from parmed.structure import Structure as ParmedStructureClass
from paprika.build.dummy import extract_dummy_atoms
from paprika.restraints.utils import get_bias_potential_type, parse_window
from paprika.utils impor... | |
@property
def symbolDimensions(self) -> Tuple[str, ...]:
"""Set of fields that determine database table name."""
return self.__symbolDimensions
@symbolDimensions.setter
def symbolDimensions(self, value: Tuple[str, ...]):
self.__symbolDimensions = value
self._property_changed('symbolDimensions')
@property
de... | |
<reponame>occamLab/invisible-map-generation
"""Some helpful functions for visualizing and analyzing graphs.
"""
from enum import Enum
from typing import Union, List, Dict, Tuple, Any
import g2o
from matplotlib import pyplot as plt
from matplotlib import cm
import numpy as np
from g2o import SE3Quat, EdgeProjectPSI2UV,... | |
# ~/dev/py/fieldz/msgImpl.py
# import sys # for debugging
from wireops.enum import FieldTypes, PrimTypes
from wireops.raw import(length_as_varint, field_hdr_len, read_field_hdr,
write_raw_varint, read_raw_varint,
write_field_hdr)
from wireops.typed import T_GET_FUNCS, T_LEN_FUNCS, T_PUT_FUNCS
from fieldz import... | |
<reponame>markortleb/asset_data_analysis
from datetime import datetime, timedelta
from pymongo import MongoClient
import requests
import argparse
import json
import yaml
import os
import pandas as pd
import math
import matplotlib.pyplot as plt
import matplotlib
import mplfinance as mpl
def get_daily_candles_from_min... | |
<reponame>cloudysunny14/faucet<gh_stars>1-10
#!/usr/bin/env python
#
# Copyright 2014 cloudysunny14.
#
# 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... | |
<reponame>TheV1rtuoso/debuggingbook<filename>docs/code/StatisticalDebugger.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# "Statistical Debugging" - a chapter of "The Debugging Book"
# Web site: https://www.debuggingbook.org/html/StatisticalDebugger.html
# Last change: 2022-01-24 10:47:23+01:00
#
# Copyright (c) 2... | |
<reponame>WLPhoenix/stackdio<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2014, Digital Reasoning
#
# 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... | |
import pygame
import numpy as np
import math
import gym
import torch
import random
import featureExtractor
import os
from nn import Neural_net as NN
random.seed(4)
_screen_height = 100
_screen_width = 100
_stripobsx = 0
_stripobsy = 20
_stripgoalx = 70
_stripgoaly = 20
_stripagentx = 80
_stripagenty = 10
_max_agent_spe... | |
"""
Simultaneous Machine Translateion
"""
from .nmt_uni import *
from .reward import return_reward
import time
import sys
timer = time.time
# utility functions
def _seqs2words(caps, idict):
capsw = []
for cc in caps:
ww = []
for w in cc:
if w == 0:
break
ww.append(idict[w])
capsw.append(' '.join(ww))
ret... | |
#!/usr/bin/python2.4
# -*- coding: iso-8859-15 -*-
import sys, os
import traceback
import re
from time import sleep
import getpass
from datetime import datetime
from string import join
from klab.fs.fsio import read_file
# Database import functions
# Use oursql if available; it's more up to date
try:
import oursql a... | |
io, filename=name, content_type='application/octet-stream')
return form, contains_attachments
def add_file_to_message_data(message_data, file, contains_content, is_edit):
"""
Adds files to the message data creating a form data if applicable.
Parameters
----------
message_data : `dict` of (`str`, `Any`)... | |
noqa: E501
"""Finds Pets by status # noqa: E501
Multiple status values can be provided with comma separated strings # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.find_pets_by_status_with_http_info(status, as... | |
<filename>src/utils/hdf5_getters.py
"""
<NAME> (2010) Columbia University
<EMAIL>
This code contains a set of getters functions to access the fields
from an HDF5 song file (regular file with one song or
aggregate / summary file with many songs)
This is part of the Million Song Dataset project from
LabROSA (Columbia ... | |
<reponame>RathmoreChaos/intficpy<filename>intficpy/things.py
import copy
from .actor import Actor, Player
from .thing_base import Thing
from .daemons import Daemon
class Holder(Thing):
"""
An item that can hold or contain another item.
This is the base class for Surfaces, Container,
UnderSpaces, etc.
"""
con... | |
<filename>notebooks/Chap08PineSolns.py
# ---
# jupyter:
# jupytext:
# cell_metadata_filter: all
# formats: ipynb,py:percent
# notebook_metadata_filter: all,-language_info,-toc,-latex_envs
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.1
# kernelspec:
# dis... | |
fac.UpdateInstruction(cc_9, True) ]))
transitions.append(fac.Transition(st_10, [
fac.UpdateInstruction(cc_9, False) ]))
transitions.append(fac.Transition(st_11, [
fac.UpdateInstruction(cc_9, False) ]))
st_9._set_transitionSet(transitions)
transitions = []
transitions.append(fac.Transition(st_10, [
fac.U... | |
value.
:vartype value: int
:ivar storage_limit: Storage limit.
:vartype storage_limit: ~azure.mgmt.sql.models.MaxSizeCapability
:ivar status: The status of the capability. Possible values include: "Visible", "Available",
"Default", "Disabled".
:vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus
:para... | |
<gh_stars>0
#!/usr/bin/env python3
# author: d.koch
# coding: utf-8
# naming: pep-0008
# typing: pep-0484
# docstring: pep-0257
# indentation: tabulation (4 spc)
""" enamlx-api.py
API list in copy/paste friendly format
"""
# How to use this file
# This file is *not* runnable
# This file is *not* an exhaustive docum... | |
# Boeing_737.py
#
# Created: Feb 2017, <NAME> (taken from data originally in B737/mission_B737.py, noise_optimization/Vehicles.py, and Boeing 737 tutorial script
# Modified: Jul 2017, <NAME>
# Mar 2020, <NAME>
# Oct 2021, <NAME>
""" setup file for the Boeing 737 vehicle
"""
# ----------------------------------------... | |
tp == "\0"):
# ok
pass
else:
raise ValueError("invalid type with ','")
return False
def _calc_padding(self, string, length):
"""compute left and right padding, return total width of string"""
if self._width != -1 and length < self._width:
total = self._width
else:
total = length
align = self._align
if ali... | |
u"contributes. This assumes failure "
u"times are exponentially "
u"distributed."))
self.cmbAssembly.set_tooltip_text(_(u"Selects and displays the "
u"assembly associated with the "
u"data set."))
self.cmbDistribution.set_tooltip_text(_(u"Selects and displays the "
u"statistical distribution "
u"used to fit th... | |
<filename>src/romt/toolchain.py
#!/usr/bin/env python3
# coding=utf-8
import argparse
from pathlib import Path
import re
import shutil
from typing import (
List,
Set,
Tuple,
)
from romt import base
from romt import common
from romt import dist
from romt import error
from romt import integrity
from romt import sign... | |
IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid
:param pulumi.Input['FallbackRoutePropertiesArgs'] fallback_route: The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. ... | |
return [xxh(value).hexdigest() for value in values]
def chunks(l, n):
"""Yield successive n-sized chunks from l."""
return [l[i:i + n] for i in range(0, len(l), n)]
def sos_pair_input(value):
'''Input must be a list of two lists,
the lists are ordered such that the length of the
2nd list is always multiples of... | |
décevrai", "tu décevras", "il décevra", "elle décevra",
"nous décevrons", "vous décevrez", "ils décevront", "elles décevront",),
"découvrir": ("je découvrirai", "tu découvriras", "il découvrira", "elle découvrira",
"nous découvrirons", "vous découvrirez", "ils découvriront", "elles découvriront"),
"déduire": ("je d... | |
<reponame>deepcrime-tool/DeepCrime
import ast
from copy import deepcopy
from utils import mutation_utils as mu
from utils.logger_setup import setup_logger
import utils.properties as props
logger = setup_logger(__name__)
class Mutation():
applyOnce = True
mutationName = None
def get_model_params_td(self, elem):
... | |
'''Perform optimizations on an AST.
The optimize_tree function is the main interface to the optimizer, which will
optimize an AST in place. The function can optimize at two different levels.
Level 1: Minimal optimization is performed.
Level 2: More extensive optimization is performed that may produce code tha... | |
of Green Vegetation",
"needed_bands": ["PV_PC_50"],
"color_ramp": [
{
'value': 0,
'color': '#ffffcc'
},
{
'value': 25,
'color': '#c2e699'
},
{
'value': 50,
'color': '#78c679'
},
{
'value': 75,
'color': '#31a354'
},
{
'value': 100,
'color': '#006837'
}
],
"pq_masks": [
{
"flags": {
'sea': True... | |
<reponame>nannancy/graph-generation
# an implementation for "Learning Deep Generative Models of Graphs"
from main import *
class Args_DGMG():
def __init__(self):
### CUDA
self.cuda = 2
### model type
self.note = 'Baseline_DGMG' # do GCN after adding each edge
# self.note = 'Baseline_DGMG_fast' # do GCN only aft... | |
from datetime import datetime, timedelta, time
from pyiso.base import BaseClient
import copy
import re
from bs4 import BeautifulSoup
import time
import pdb
# PRC_LMP
# PRC_HASP_LMP
# PRC_RTPD_LMP
# PRC_INTVL_LMP
# PRC_AS - All Ancillary Services for Region and Sub-Regional Partition. Posted hourly in $/MW for the DAM ... | |
else:
# If item is already inside another selected item,
# remove that selection
super_selection = self._selected_super_item(item)
if super_selection:
self._remove_selection(super_selection)
# Remove selections this selection will override.
sub_selections = self._selected_sub_items(item)
for sub in sub_select... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.