input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>ceciliaccwei/CMPUT291-proj1<filename>project.py
import sqlite3
import getpass
import time
import os
import sys
if len(sys.argv) != 2:
print("Please run with: python PROJECT.py DATABASE.db")
quit()
db_file_path = sys.argv[1]
if not (os.path.exists(db_file_path)):
print("File does not exist!")
quit()
conn... | |
<filename>tests/001_theoretical/test_004_datetime_blueprint.py
#!/bin/false
# Copyright (c) 2022 <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. Redistributions of source code must ret... | |
options detected ' +
'for databases {0} and {1}, same pid {2}, skipping {0}'.format(instance, duplicate_instance, pid))
pgcon.close()
return True
# now we have all components to create a cluster descriptor
desc = make_cluster_desc(name=instance, version=dbver, workdir=work_directory,
pid=pid, pgcon=pgcon, conn=co... | |
<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-2.0
#
# Unless required by ... | |
from itertools import chain
from typing import Optional, Iterable, Set, Union, TYPE_CHECKING
import logging
import pyvex
import claripy
from ...storage.memory_mixins.paged_memory.pages.multi_values import MultiValues
from ...engines.light import SimEngineLight, SimEngineLightVEXMixin, SpOffset
from ...engines.vex.cla... | |
# 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... | |
true if t is an anagram of s, and false otherwise.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all
the original letters exactly once.
Example 1:
Input: s = "anagram", t = "nagaram"
Output: true
Example 2:
Input: s = "rat", t = "car"
Output: fa... | |
{ref['href'].split('/')[-1]: ref['attr'].ae_num
for ref in pi_refs}
# verify all AE-IDs allocated per prouter are unique
self.assertEqual(len(set(ae_ids[vpg_name].keys())), len(pi_refs))
self.assertEqual(len(set(ae_ids[vpg_name].values())), 1)
# verification at Physical Routers
pr_ae_ids = get_zk_ae_ids()
self.... | |
memory banks downgraded
ADL_XFIREX_STATE_DOWNGRADEMEMBANKS = Constant(1 << 22).set_string('CrossfireX cannot be enabled unless memory banks downgraded')
# Notification that memory banks are currently downgraded
ADL_XFIREX_STATE_MEMBANKSDOWNGRADED = Constant(1 << 23).set_string('Notification that memory banks are curren... | |
``x.shape + (order,)``, where
:math:`order = (deg[0]+1)*(deg([1]+1)*(deg[2]+1)`. The dtype will
be the same as the converted `x`, `y`, and `z`.
See Also
--------
polyvander, polyvander3d. polyval2d, polyval3d
Notes
-----
.. versionadded:: 1.7.0
"""
ideg = [int(d) for d in deg]
is_valid = [id == d and id ... | |
= _messages.StringField(6)
resourceVersion = _messages.StringField(7)
watch = _messages.BooleanField(8)
class AnthoseventsCustomresourcedefinitionsGetRequest(_messages.Message):
r"""A AnthoseventsCustomresourcedefinitionsGetRequest object.
Fields:
name: The name of the CustomResourceDefinition being retrieved. ... | |
"""The Basic Model Interface."""
__version__ = '0.2'
class BmiBase(object):
"""Methods that control model execution.
These BMI functions are critical to plug-and-play modeling because they
give a calling component fine-grained control over the model execution.
"""
def initialize(self, filename):
"""Perform ... | |
= True
else:
self._alphabet_list = alphabet
if probabilities:
probabilities[0] += (1.0 - sum(probabilities))
self._alphabet = list(self._alphabet_list)
self._probabilities = probabilities
@classmethod
def build(cls, builder: Builder, spec):
alphabet = None
probabilities = None
if isinstance(spec, (tuple, li... | |
WHEN DELETE_ACTION = 1 THEN 'NO ACTION'
WHEN DELETE_ACTION = 2 THEN 'CASCADE'
ELSE 'SET NULL' END AS VARCHAR2(9)) AS DELETE_RULE,
CASE WHEN A.ENABLE_FLAG = 1 THEN CAST('ENABLED' AS VARCHAR2(8))
ELSE CAST('DISABLED' AS VARCHAR2(8)) END AS STATUS,
CAST('NOT DEFERRABLE' AS VARCHAR2(14)) AS DEFERRABLE,
CAST('IMMEDIAT... | |
<reponame>stolau/oty_ilmo
from werkzeug.security import generate_password_hash, check_password_hash
from flask import Flask, render_template, url_for, redirect, request, flash, send_from_directory, session
from flask_httpauth import HTTPBasicAuth
from app import app, db
from flask_mail import Mail, Message
from datetim... | |
model_names
col_names = [f"({i + 1})" for i in range(len(model_names))]
return col_names, col_groups
def _customize_col_groups(default_col_groups, custom_col_groups):
"""Change default (inferred) column group titles using custom column groups.
Args:
default_col_groups (list or NoneType): The inferred column gr... | |
<filename>smt/applications/tests/test_mixed_integer.py
import unittest
import numpy as np
import matplotlib
matplotlib.use("Agg")
from smt.applications.mixed_integer import (
MixedIntegerContext,
MixedIntegerSamplingMethod,
FLOAT,
ENUM,
ORD,
GOWER,
check_xspec_consistency,
unfold_xlimits_with_continuous_limit... | |
: double or iter-of-doubles, optional
Specifies an offset for each channel in the input data. The final input
data is set after applying scaling and subtracting the specified offsets.
Default: (103.939, 116.779, 123.68)
pre_trained_weights : bool, optional
Specifies whether to use the pre-trained weights trained o... | |
unknown application
with pytest.raises(RPCError) as exc:
rpc.stop_application('appli')
assert exc.value.args == (Faults.BAD_NAME, 'appli')
assert mocked_check.call_args_list == [call()]
assert mocked_stop.call_count == 0
assert mocked_progress.call_count == 0
mocked_check.reset_mock()
# test RPC call with stopp... | |
in training split, including label.
-Future: is it useful to specify the size of only test for unsupervised learning?
"""
samples = JSONField()
sizes = JSONField()
supervision = CharField()
has_test = BooleanField()
has_validation = BooleanField()
bin_count = IntegerField(null=True)
featureset = ForeignKeyFi... | |
TABLE IF EXISTS %s' % table_name)
access.execute_query(CreateTableQuery(if_not_exists=True,
table_or_subquery=table_name,
column_name=(['pk'] if include_pk else []) + columns,
column_constraint=column_constraint,
table_constraint="PRIMARY KEY (pk)" if include_pk else None))
with Process('Saving %s' % self._name, ... | |
: 2D array
Specify the matrix that will be used to multiply the vector of
subsystem outputs to obtain the vector of subsystem inputs.
"""
# Make sure the connection map is the right size
if connect_map.shape != self.connect_map.shape:
ValueError("Connection map is not the right shape")
self.connect_map = connec... | |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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, merg... | |
# -*- coding: utf-8 -*-
"""
we test .agg behavior / note that .apply is tested
generally in test_groupby.py
"""
from __future__ import print_function
import pytest
from datetime import datetime, timedelta
from functools import partial
import numpy as np
from numpy import nan
import pandas as pd
from pandas import... | |
<filename>src/puliclient/jobs.py
'''
Created on Jan 11, 2010
@author: <NAME>
'''
import sys
import site
import traceback
import logging
import subprocess
try:
import simplejson as json
except ImportError:
import json
#
# Errors specific to command execution
#
class TimeoutError (Exception):
''' Raised when help... | |
import numpy as np
import pandas as pd
import statsmodels.api as sm
import statsmodels.formula.api as smf
from stargazer.stargazer import Stargazer
from IPython.core.display import HTML
from IPython.core.interactiveshell import InteractiveShell
from statsmodels.sandbox.regression.gmm import IV2SLS
def create_table1... | |
not None:
_dict['imported'] = self.imported
if hasattr(self, 'parameter_sets_total') and self.parameter_sets_total is not None:
_dict['parameter_sets_total'] = self.parameter_sets_total
if hasattr(self, 'pending') and self.pending is not None:
_dict['pending'] = self.pending
if hasattr(self, 'renamed') and self.r... | |
map from the field to the index of the significant filters
index_map = {
"te": 0,
"rna": 1,
"ribo": 2
}
index = index_map[field]
if significant_only:
index += 3
return filters[index]
@ribo_deprecated
def get_up_and_down_masks(condition_1, condition_2, pval_df):
""" This function finds all of the transcript... | |
56,
timeout = '0', ),
query_log_file = '0',
remote_read = [
kubernetes.client.models.com_coreos_monitoring_v1_prometheus_spec_remote_read.com_coreos_monitoring_v1_Prometheus_spec_remoteRead(
bearer_token = '0',
bearer_token_file = '0',
name = '0',
oauth2 = kubernetes.client.models.com_coreos_monitoring_v1... | |
"amino_acid_position": "196"
},
{
"gene": "TP53",
"chromosome_position": "7578406",
"amino_acid_wildtype": "R",
"mutation_type": "Missense_Mutation",
"patient_id": "TCGA-14-4157",
"dna_change": "C->T",
"amino_acid_mutation_detail": "R175H",
"uniprot_id": "P04637",
"_id": "53a20770ab47b322147f1a42",
"amino_a... | |
import yaml
import papermill as pm
import math
import pkg_resources
from jinja2 import Environment, FileSystemLoader
import yaml
import argparse
import json
import glob
import shutil
import sys
import os
#_________________________________________________________________________________________________
# open htnl tem... | |
# File: threatminerapi_connector.py
#
# Copyright (c) 2019 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | |
<filename>docker_stuff/site-packages/partedit.py<gh_stars>0
#!/usr/bin/env python
# pylint:disable=C0302
"""
An interactive spreadsheet for viewing, editing, and saving
partio (bgeo) files.
Usage:
% partedit [FLAGS] [bgeoFile]
Supported FLAGS:
-h/--help: Print this help message
"""
# TODO:
# Support for fixed at... | |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | |
<filename>PYTHON/get_era5.py
#!/usr/bin/python
# Code to read in years of hourly high resolution ERA5 t, td and land_sea_mask data
# Converts to q, RH, e, tw and DPD
# Aggregates to daily average
# Regrids to 1by1 degree and shifts to -179.5 ot 179.5 and 180 lats from 89.5 to -89.5 (was 181 lats!!!)
# Outputs as netCD... | |
import os
import logging
import numpy as np
from typing import Optional
import torch
from torch.utils.data import DataLoader
from ..eval import Metric
from .dataset import CHMMBaseDataset
from .dataset import collate_fn as default_collate_fn
logger = logging.getLogger(__name__)
OUT_RECALL = 0.9
OUT_PRECISION = 0.8
... | |
'Longreach'},
'617750002':{'en': 'Lynd Range'},
'617750003':{'en': 'Macalister'},
'617750004':{'en': 'Maranoa'},
'617750005':{'en': 'Meandarra'},
'617750006':{'en': 'Miamba'},
'617750007':{'en': 'Miles'},
'617750008':{'en': 'Millmerran'},
'617750009':{'en': 'Mitchell'},
'617750010':{'en': 'Moonie'},
'61775001... | |
# 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 ... | |
- CROP3]
else:
Z_dir = linearized[: len(linearized) - CROP3]
return Z_dir, Z_direction
def location_slices(self, txtnslices):
"""Define the location of the slice you are interested"""
global location_slices
location_slices = round(float(txtnslices.get()), 2) # Export the locations of slice from the GUI
return ... | |
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
import io
import os
import os.path as osp
import tempfile
import xml.etree.ElementTree as ET
import zipfile
from collections import defaultdict
from glob import glob
from io import BytesIO
import copy
from shutil import copyfile
import itertools
... | |
#!/usr/bin/env python3
import netcdf4_functions as nffun
import socket, os, sys, csv, time, math, numpy
import re, subprocess
from optparse import OptionParser
#from Numeric import *
#runcase.py does the following:
#
# 1. Call routines to create surface and domain data (makepointdata.py)
# 2. Use create_newcase to b... | |
# by default, all!
# Ensure column names are unicode
df.columns = [unicode(cleanup_name(x, normalize=False, clean_nonletters=False), errors='ignore') for x in df.columns]
# By default, take all columns
cols = df.columns
# Calculate total number of items
if progress_bar:
pbar_total = 0
for col in cols:
pbar_tot... | |
# -*- coding: utf-8 -*-
import logging
import functools
from collections import OrderedDict
from fabric2.runners import Result
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.utils.text import camel_case_to_spaces
from django.dispatch import Sig... | |
fetch_subtract_a(self):
data = self.fetch()
# 1 cycle
self.compare_a_simple(data) # 1 cycle
self.a.sub(data, False)
def compare_a(self, getCaller, setCaller=None):
# 1 cycle
self.compare_a_simple(int(self.a.get() - getCaller.get()))
def compare_a_simple(self, s):
s = s & 0xFF
self.f.reset()
self.f.n_flag ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fsfs-reshard.py REPOS_PATH MAX_FILES_PER_SHARD
#
# Perform an offline conversion of an FSFS repository between linear (format
# 2, usable by Subversion 1.4+) and sharded (format 3, usable by Subversion
# 1.5+) layouts.
#
# The MAX_FILES_PER_SHARD argument specifies the ... | |
[] for k in direction}
bounding_box = {k: [] for k in direction}
for idx, plane in enumerate(direction):
slices[plane] = list(range(limits[idx][0], limits[idx][1]+1, 1))
imat[plane], fitvolume[plane] = self.resample_CTplanes(hd_trajectories, plane, lead_model, resolution=.35)
span_vector = [sample_width, 0, 0] i... | |
## Copyright (c) 2001-2009, <NAME>
## August 2009
#-----------------------------------------------------------------------
# Notes: This file defines a "base class" for CSDMS "process"
# components. Many of these functions are implementations
# of methods defined in "topoflow3.IRFPort.sidl". They are
# therefore req... | |
linewidth=linewidth, c=color)
ax.errorbar(sigmas[1:-1], averages[1:-1], yerr=stds[1:-1],fmt='o',
capthick=linewidth, elinewidth=linewidth, capsize=linewidth*6,markersize=10, c=color)
sns.despine(offset=10)#, trim=True);
ax.set_aspect(0.5)
ax.set_yscale("log")#, nonposy='clip')
ax.set_xscale("log")#, nonposy=... | |
could still contain
# importable submodules (e.g., the non-package `os` module containing
# the `os.path` submodule). In this case, these submodules are already
# imported by this target module's pure-Python code. Since our import
# scanner already detects these imports, these submodules need *NOT* be
# reimported... | |
for workers.
:vartype allowed_worker_sizes: str
:ivar maximum_number_of_machines: Maximum number of VMs in the App Service Environment.
:vartype maximum_number_of_machines: int
:ivar vip_mappings: Description of IP SSL mapping for the App Service Environment.
:vartype vip_mappings: list[~azure.mgmt.web.v2016_09_01... | |
the file
is: n_scales xsec_scale_central xsec_scale1 ... n_pdf
xsec_pdf0 xsec_pdf1 ...."""
scales=[]
pdfs=[]
for i,evt_file in enumerate(evt_files):
path, evt=os.path.split(evt_file)
with open(pjoin(self.me_dir, 'SubProcesses', path, 'scale_pdf_dependence.dat'),'r') as f:
data_line=f.readline()
if "scale vari... | |
from tfumap.load_datasets import load_CIFAR10, load_MNIST, load_FMNIST, mask_labels
import tensorflow as tf
from tfumap.paths import MODEL_DIR
import numpy as np
pretrained_networks = {
"cifar10_old": {
"augmented": {
4: "cifar10_4____2020_08_09_22_16_45_780732_baseline_augmented", # 15
16: "cifar10_16____2020_08... | |
self.read_reg(self.REG_AXES_ENABLE, 1)
if modes == self.INTERRUPUT_LATCH_DISABLE:
self.__txbuf[0] = rslt[0] & 0xFD
else:
self.__txbuf[0] = rslt[0] | 0x02
self.write_reg(self.REG_AXES_ENABLE, self.__txbuf)
def set_threshold_interrupt(self, mode, threshold, polarity, channel_x = INTERRUPT_X_ENABLE, channel_y = I... | |
activity_number = request.POST.get('activity_number').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
intra_community_vat_number = request.POST.get('intra_community_vat_number').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
president = request.POST.get('president').replace('\t', ' ').replace('\n',... | |
<reponame>guillaume-florent/PyGeM
"""
Utilities for reading and writing parameters files to perform FFD
geometrical morphing.
"""
try:
import configparser as configparser
except ImportError:
import ConfigParser as configparser
import os
import numpy as np
from OCC.Bnd import Bnd_Box
from OCC.BRepBndLib import brepbnd... | |
= pd.DataFrame(con_df[con_df.columns[2]]).astype('float')
con_df.columns = [3]
syn_df = pd.DataFrame(syn_df[syn_df.columns[2]]).astype('float')
syn_df.columns = [4]
df = pd.concat([head_df, wei_df, con_df, syn_df],axis=1)
return df
def save(save_to=None):
if not save_to:
save_to = filename.get()
d... | |
len(daids) == 1 and daids[0] == qaids[0]
flags.append(flag)
if len(flags) > 0 and all(flags):
raise AssertionError('No need to compute a query against itself')
cfgdict, review_cfg = back.confirm_query_dialog2(
species2_expanded_aids,
query_msg=query_msg,
query_title=query_title,
cfgdict=cfgdict,
review_cfg=re... | |
+ L_dash_w_d_t + L_dash_b1_d_t + L_dash_b2_d_t + L_dash_ba1_d_t
f = L_dash_d_t > 0
L_dashdash_ba1_d_t[f] = L_dash_ba1_d_t[f] - L_sun_d_t[f] * (L_dash_ba1_d_t[f] / L_dash_d_t[f])
return L_dashdash_ba1_d_t
def get_L_dashdash_ba2_d_t(L_dash_ba2_d_t):
"""1時間当たりの浴槽追焚時における太陽熱補正給湯負荷 (MJ/h) (4g)
Args:
L_dash_ba2_d_t(... | |
Per context we keep track of one current program.
"""
if self._handle != self._parser.env.get('current_program', False):
self._parser.env['current_program'] = self._handle
gl.glUseProgram(self._handle)
def deactivate(self):
"""Avoid overhead in calling glUseProgram with same arg.
Warning: this will break if glU... | |
import unittest
import numpy
try:
import scipy.sparse
scipy_available = True
except ImportError:
scipy_available = False
import cupy
import cupy.sparse
from cupy import testing
def _make(xp, sp, dtype):
data = xp.array([0, 1, 2, 3], dtype)
row = xp.array([0, 0, 1, 2], 'i')
col = xp.array([0, 1, 3, 2], 'i')
#... | |
<reponame>petebachant/Nortek-Python
# contains C-style struct definitions and associated methods for various Nortek instruments
# The base class is "NortekDataStructure" which is itself a subclass of ctypes.Structure
# Individual data structures (e.g. velocity header) are a subclass of NortekDataStructure
# They will i... | |
"""
Utilities for fitting stacked (drizzled) spectra
"""
from collections import OrderedDict
from imp import reload
import astropy.io.fits as pyfits
import astropy.units as u
import numpy as np
from . import utils
from .utils import GRISM_COLORS, GRISM_MAJOR, GRISM_LIMITS, DEFAULT_LINE_LIST
from .fitting import Gro... | |
"""Definitions of ground truth NSRTs for all environments."""
import itertools
from typing import List, Sequence, Set, cast
import numpy as np
from predicators.src.envs import get_or_create_env
from predicators.src.envs.behavior import BehaviorEnv
from predicators.src.envs.behavior_options import grasp_obj_param_sam... | |
<reponame>xiaofengxie128/Proteomic-Data-Manager
from django.db import models
from django.conf import settings
from datetime import date
import datetime
import xmltodict
from django_currentuser.db.models import CurrentUserField
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models i... | |
z1])
val.append(annot_img[x2, y1, z2])
val.append(annot_img[x2, y2, z1])
val.append(annot_img[x2, y2, z2])
val = val[1:]
labels.append(max(set(val), key = val.count))
# print(labels)
labels_name = []
for label in labels:
with open(lookup_table, 'r') as f:
lines = f.readlines()
rows = len(lines)
for row in... | |
)
class DATAFILEPARAMETER(Base, EntityHelper, metaclass=EntityMeta):
__tablename__ = "DATAFILEPARAMETER"
__singularfieldname__ = "datafileParameter"
__pluralfieldname__ = "datafileParameters"
__table_args__ = (
Index("UNQ_DATAFILEPARAMETER_0", "DATAFILE_ID", "PARAMETER_TYPE_ID"),
)
id = Column("ID", BigIntege... | |
before function.
"trigger": "enable_auto_rollbacks_button_clicked",
"unless": [self.auto_rollbacks_enabled],
"before": self.enable_auto_rollbacks,
}
yield {
"source": "*",
"dest": None, # Don't actually change state, just call the before function.
"trigger": "disable_auto_rollbacks_button_clicked",
"conditions... | |
= None # type: Q
child_connector = QConn.C_AND # Type: QConn
def __init__(self, field: str, operator: QOper=QOper.O_EQUAL, value=None, *args):
self._field = field
self._field_operator = operator
self._value = value
if operator == QOper.O_BETWEEN:
if len(args) == 1:
self._between_value = args[0]
else:
raise ... | |
#!/usr/bin/env python
#
# Copyright 2016 MIT Lincoln Laboratory, Massachusetts Institute of Technology
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with
# the License.
#
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses... | |
<reponame>atreebangalore/jaltol
import os
#import numpy as np
#import pandas as pd
#import matplotlib.pyplot as plt
#from matplotlib.figure import Figure
#from matplotlib import axes
from pathlib import Path
import sys
import time
import json
import math
import inspect
import qgis.core
from qgis.core import (
Qgis,
Q... | |
<filename>train_rguo/train_code/predict_rguo_part2.py
from __future__ import print_function, division, absolute_import
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
import numpy as np
import pandas as pd
from tqdm import tqdm
import os
import cv2
im... | |
import re
import csv
import gzip
import json
import logging
import itertools
import requests
from typing import List, Tuple, Optional, Union
from functools import lru_cache
import xml
from xml.etree import ElementTree
from urllib.error import HTTPError
from protmapper.resources import resource_manager, feature_from_jso... | |
<filename>utils.py
#!/usr/bin/env python3
# coding=utf-8
import io
import os
import re
import sys
import ssl
import glob
import time
import shlex
import signal
import subprocess
has_filter = False
has_progress = False
has_winreg = False
has_certifi = False
is_cygwin = sys.platform == 'cygwin'
is_win32 = sys.platform... | |
{'table': table3_name, 'id': 3, 'name': '<NAME>'}]
INPUT_DATA = '\n'.join(json.dumps(rec) for rec in ROWS)
pipeline_builder = sdc_builder.get_pipeline_builder()
pipeline = _create_jdbc_producer_pipeline(pipeline_builder, 'JDBC Producer Multitable Insert', INPUT_DATA,
"${record:value('/table')}", 'INSERT')
# JDBC... | |
import os
import time
import json
import logging
import binascii
import networkx as nx
from copy import deepcopy
from networkx import NetworkXNoPath
from itertools import islice
from threading import Thread, Event
from flask import Flask, request, Response, abort
from riemann import tx
from bitcoind_mock.rpc_errors i... | |
<gh_stars>1-10
#
# (C) Copyright 2003-2007 Hewlett-Packard Development Company, L.P.
# (C) Copyright 2006-2007 Novell, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# vers... | |
"""Generated message classes for sqladmin version v1beta3.
Creates and configures Cloud SQL instances, which provide fully-managed MySQL
databases.
"""
# NOTE: This file is autogenerated and should not be edited by hand.
from googlecloudsdk.third_party.apitools.base.protorpclite import message_types as _message_types... | |
# -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import unicode_literals, absolute_import
import json
import logging
from oauthlib import common
from oauthlib.uri_validate import is_absolute_uri
from .base import GrantTypeBase
from .. import err... | |
:param certificate_authority: certificate authority's X509 certificate.
:return: None
.. versionadded:: 0.10
"""
if not isinstance(certificate_authority, X509):
raise TypeError("certificate_authority must be an X509 instance")
add_result = _lib.SSL_CTX_add_client_CA(
self._context, certificate_authority._x509
... | |
<reponame>Mvmo/acton
# Copyright (C) 2019-2021 Data Ductus AB
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the f... | |
0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(85, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush)
brush = QtGui.QBrush(QtGui.QColor(113, 0, 0))
... | |
<rdf:li s\
tEvt:action=\x22sav\
ed\x22 stEvt:instan\
ceID=\x22xmp.iid:ca\
cc91ae-fbba-df42\
-baea-899bdb2018\
e0\x22 stEvt:when=\x22\
2020-05-02T17:59\
:52-03:00\x22 stEvt\
:softwareAgent=\x22\
Adobe Photoshop \
21.0 (Windows)\x22 \
stEvt:changed=\x22/\
\x22/> </rdf:Seq> <\
/xmpMM:History> \
</rdf:Descriptio\
n> </rdf:... | |
from __future__ import absolute_import
from past.builtins import basestring
import os
import tempfile
import stat
import time
import logging
import errno
import json
import re
from tqdm import tqdm
from zipfile import ZipFile, BadZipfile
import os.path as op
import shutil
from arcana.utils import JSON_ENCODING
from arc... | |
to account for the
wave transformation at the most remote point of the relaxation zone.
Parameters
----------
Tstart : float
Start time
Tend : float
End time
x0 : numpy.ndarray
Position vector of the time series
fname : string
Filename for timeseries file
Lgen : Optional[numpy.ndarray]
Length vector of re... | |
metadata does not have field 'other_properties'.",
"Collection 'foobar' metadata does not have field 'properties'.",
}
def test_normalize_collection_metadata_minimal_100(self, caplog):
assert _normalize_collection_metadata({"id": "foobar"}, api_version=ComparableVersion("1.0.0")) == {
'id': 'foobar',
'stac_versi... | |
14400
data[var[k]][~Samp_Good_Sonic] =data[var[k]]+'1'
data[var[k]][Samp_Good_Sonic] = data[var[k]]+'0'
if 'Fc_samples_Tot' in df.columns: # Check if enough samples in Fc column (80%) coverage
Samp_Good_IRGA = df['Fc_samples_Tot'].astype(float)>14400
data[var[k]][~Samp_Good_IRGA] = data[var[k]]+'1'
data[var[k]][... | |
<filename>salt/cloud/clouds/nova.py
# -*- coding: utf-8 -*-
'''
OpenStack Nova Cloud Module
===========================
OpenStack is an open source project that is in use by a number a cloud
providers, each of which have their own ways of using it.
The OpenStack Nova module for Salt Cloud was bootstrapped from the Op... | |
import re
from django.contrib.auth import authenticate
from rest_framework import serializers, exceptions
from rest_framework.exceptions import ValidationError
from .models import User
from .social.google_token_validator import GoogleValidate
from .social.facebook_token_validator import FacebookValidate
from .social.tw... | |
self.show_quota_left is None:
return self.event.settings.show_quota_left
return self.show_quota_left
def tax(self, price=None, base_price_is='auto', currency=None, invoice_address=None, override_tax_rate=None, include_bundled=False):
price = price if price is not None else self.default_price
if not self.tax_rule... | |
import dill
from munch import Munch
import numpy as np
import os
from .core_record import CoreRecord
from .utils import load_test, read_pred_file, tokenize, \
sequence_tasks, DataShape, is_1d_list, is_2d_list, ACCUMULATED_STR, \
TOKENIZATION_DICT
from .tests import AbstractTest, BasicClassificationMetrics, BasicSeqM... | |
as separator
ta = t.split('-')
# Make sure there are no singletons or private use flags
for tg in ta:
if len(tg) < 2:
return False
# If we got here, tag checks out
return True
# Check whether the given parameter is a string that is a case-sensitive
# match for one of the valid category names.
#
# Parameters... | |
'''
BreezySLAM: Simple, efficient SLAM in Python
algorithms.py: SLAM algorithms
Copyright (C) 2014 <NAME>
This code is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (... | |
[195, 195, 102, 102, 60, 60, 24, 24],
57732: [24, 24, 60, 60, 102, 102, 195, 195],
57733: [0, 0, 0, 16, 0, 0, 0, 0],
57734: [0, 63, 63, 63, 63, 63, 63, 0],
57735: [0, 252, 252, 252, 252, 252, 252, 0],
57736: [0, 84, 42, 84, 42, 84, 42, 0],
57737: [0, 0, 24, 60, 60, 126, 126, 126],
57738: [126, 126, 126, 60, 60, ... | |
#!/usr/bin/env python
# coding:utf-8
import os
import sys
import time
import signal
import getpass
import logging
import argparse
import threading
from . import dag
from .job import *
from .config import load_config, print_config
from .qsub import myQueue, QsubError
from .sge import ParseSingal
from .version import ... | |
if mode == 'add':
array[ind] = self.ndarray[ind] + function[0]['f'+key](functimearray)
elif mode == 'sub':
array[ind] = self.ndarray[ind] - function[0]['f'+key](functimearray)
elif mode == 'values':
array[ind] = function[0]['f'+key](functimearray)
elif mode == 'div':
array[ind] = self.ndarray[ind] / function[0][... | |
= np.array(state_considered)[-1 - delay]
if list(new_relevant_state) == self.target_point:
reward += 1.0
reward *= self.reward_scale
noise_in_reward = self.reward_noise(self.np_random) if self.reward_noise else 0
# #random ###TODO Would be better to parameterise this in terms of state, action and time_step as wel... | |
<reponame>Joshuaalbert/bayes_tec<gh_stars>0
import matplotlib
matplotlib.use('Agg')
import numpy as np
import os
from concurrent import futures
from ..datapack import DataPack
from ..frames import UVW
from ..logging import logging
import astropy.coordinates as ac
import astropy.time as at
import astropy.units as au
fro... | |
metadata.
:param filepath: savepath of the OME-TIFF stack
:type filepath: str
:param imgarray: multi-dimensional image array
:type imgarray: NumPy.Array
:param metadata: metadata dictionary with the required information
to create an correct OME-TIFF file
:type metadata: dict
:param reader: string (aicsimagio o... | |
"""Implementation of GraphTensor data type.
"""
import abc
from typing import Any, Dict, Mapping, Optional, Union
import tensorflow as tf
from tensorflow_gnn.graph import graph_constants as const
from tensorflow_gnn.graph import graph_piece as gp
# pylint: disable=g-direct-tensorflow-import
from tensorflow.python.fr... | |
<reponame>CandyHuiZhang/deep-reinforcement-learning-pytorch<gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import random
import time
import math
import torch
from torch.autograd import Variable, grad, backward
import torch.nn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.