input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
self.apply(input_cols, self.F.to_integer, func_return_type=int,
output_cols=output_cols, meta_action=Actions.TO_INTEGER.value, mode="map")
def to_boolean(self, input_cols="*", output_cols=None):
return self.apply(input_cols, self.F.to_boolean, func_return_type=int,
output_cols=output_cols, meta_action=Actions.TO_B... | |
import os
import io
import security.JWT
import json
import boto3
import time
import hashlib
from flask import Blueprint, request, send_file, Response
from services.data.DBConn import db
from bson import Binary
user_api = Blueprint('user_api', __name__)
userDB = db.users
@user_api.route("", methods=['PUT'])
def crea... | |
"""
Routines for mode coupling calculation. For more details on computation of the matrix see
https://pspy.readthedocs.io/en/latest/scientific_doc.pdf.
"""
from copy import deepcopy
import healpy as hp
import numpy as np
from pspy import pspy_utils, so_cov, sph_tools
from pspy.mcm_fortran.mcm_fortran import mcm_comp... | |
np.asarray(rmatrix),
order=order, scale=scale,
image_center=np.flipud(pixel_center),
recenter=recenter, missing=missing,
use_scipy=use_scipy).T
if recenter:
new_reference_pixel = pixel_array_center
else:
# Calculate new pixel coordinates for the rotation center
new_reference_pixel = pixel_center + np.dot(rmat... | |
import numpy as np
from PyTE.ContextOfPastMeasureCalculatorDiscrete import *
from array import *
import torch
class TEWindow:
def __init__(self,
clean_window = True,
MA_window = 0,
base = 2,
destHistoryEmbedLength = 1,
destEmbeddingDelay = 1,
sourceHistoryEmbeddingLength = 1,
sourceEmbeddingDelay = 1,
delay... | |
<gh_stars>1-10
from __future__ import absolute_import
import StringIO
import logging
import requests
from lxml import etree
from simplejson import JSONDecodeError
from six.moves.urllib.parse import urljoin
from clims.models.workunit import WorkUnit, ExternalWorkUnit
from .api import CamundaApi, UnexpectedHttpResponse... | |
# coding: utf-8
import pprint
import re
import six
class ListBackupsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
sensitive_list = []
openapi_types... | |
the resources that match the entire 'displayName' given.
"""
return pulumi.get(self, "display_name")
@property
@pulumi.getter
def fqdn(self) -> str:
"""
A three-label Fully Qualified Domain Name (FQDN) for a resource.
"""
return pulumi.get(self, "fqdn")
@property
@pulumi.getter(name="freeformTags")
def fr... | |
nat_gateway_id, async_req=True)
>>> result = thread.get()
:param datacenter_id: The unique ID of the data center. (required)
:type datacenter_id: str
:param nat_gateway_id: The unique ID of the NAT Gateway. (required)
:type nat_gateway_id: str
:param pretty: Controls whether the response is pretty-printed (with ... | |
= np.multiply(np.multiply(Xind,Yind),Zind)
#self.XYZind is built during the construction of the YY grid and follows
#the good index for the field read here (= readFlag in index)
#Functions for the 3D spherical YY grids
def rectangular2YY(x,y,z,rcmb):
"""Returns the geometry of the two cartesian blocks correspondi... | |
<filename>pnc_cli/swagger_client/models/build_record.py<gh_stars>0
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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/l... | |
<gh_stars>0
"""This requires CGAL mesher applied to series of surfaces. See readme.txt for details.
"""
from __future__ import print_function
# Use FEniCS for Finite Element
import fenics as d
# Useful to import the derivative separately
from dolfin import dx
# Useful numerical libraries
import numpy as N
import ma... | |
#!/usr/bin/env python3
# coding: utf-8
import unittest
import testgres
import string
import random
from .base_test import BaseTest
from .base_test import ThreadQueryExecutor
from .base_test import generate_string
from .base_test import wait_stopevent
from .base_test import wait_checkpointer_stopevent
from testgres.e... | |
<reponame>abailie3/TravelingIntelligence
"""
Copyright (c) 2018 <NAME>, All rights reserved.
"""
import inspect
import math
import types
from typing import Tuple, List, TypeVar, Dict
from abc import ABC
__VarCOMB__ = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"]
class MachineInterface(object):
"""
An int... | |
<reponame>hughbg/healvis<filename>healvis/observatory.py
# -*- mode: python; coding: utf-8 -*
# Copyright (c) 2019 Radio Astronomy Software Group
# Licensed under the 3-clause BSD License
import numpy as np
import multiprocessing as mp
import sys
import resource
import warnings
import time
import copy
from astropy_hea... | |
<reponame>CowherdChris/droidlet
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import numpy as np
from .memory_filters import get_property_value
# attribute has function signature list(mems) --> list(value)
class Attribute:
def __init__(self, memory):
self.memory = memory
def __call__(self, mems):
rais... | |
value of T
two tail = 0.95:
:param conf_level:
:param dof:
:return:
"""
print(conf_level)
T_value = [
12.71, 4.303, 3.182, 2.776, 2.571, 2.447, 2.365, 2.306, 2.262, 2.228,
2.201, 2.179, 2.160, 2.145, 2.131, 2.120, 2.110, 2.101, 2.093, 2.086,
2.080, 2.074, 2.069, 2.064, 2.060, 2.056, 2.052, 2.048, 2.045, 2.0... | |
<filename>convoy/crypto.py
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
#
# MIT License
#
# 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 with... | |
detailed structure of the queues can be found in parse_counter_info/parse_irig_info.
If unexpected data length found, this will output some messages:
Error 0: data length is shorter than the header size (4 bytes)
Error 1: data length is shorter than the encoder counter info
even though the encoder packet header is... | |
>>> cols = ["real", "bool", "stringNum", "string"]
>>> df = spark.createDataFrame(data, cols)
>>> hasher = FeatureHasher()
>>> hasher.setInputCols(cols)
FeatureHasher...
>>> hasher.setOutputCol("features")
FeatureHasher...
>>> hasher.transform(df).head().features
SparseVector(262144, {174475: 2.0, 247670: 1.0, ... | |
"""
A module of deep feature selection based on multilayer perceptrons.
This module applies a deep structure with not too many hidden layers.
Thus, stochastic gradient descent (back-prop) is used in optimization.
Copyright (c) 2008-2013, Theano Development Team All rights reserved.
<NAME>
CMMT, UBC, Vancouver
Sep 23... | |
#!/usr/bin/env python3
from __future__ import print_function
from builtins import range
import ROOT
from array import array
from Validation.RecoTrack.plotting.ntuple import *
import analysis
from math import sqrt, copysign, sin, cos, pi
class EventPlotter(object):
def __init__(self):
self.plots_2D = []
self.plo... | |
<gh_stars>10-100
import warnings
import numpy as np
from math import fsum
from matplotlib import rcParams
import matplotlib.pyplot as plt
from MulensModel.fitdata import FitData
from MulensModel.mulensdata import MulensData
from MulensModel.model import Model
from MulensModel.coordinates import Coordinates
from Mulens... | |
i in range(size):
conv.append(float(np.mean(temp_gradient_x[i:])))
d_conv = []
for i in range(len(conv) - 1):
temp = np.abs(conv[i + 1] - conv[i])
d_conv.append(temp)
noise_floor_vals = d_conv[2:size / 2] # these are rough bounds that should work
plt.plot(d_conv)
noise_floor = np.mean(noise_floor_vals)
x_floor... | |
&)
* * (matches 0 or more characters)
* ? (matches exactly 1 character)
- *(string) --*
- **HostHeaderConfig** *(dict) --*
- **Values** *(list) --*
- *(string) --*
- **PathPatternConfig** *(dict) --*
- **Values** *(list) --*
- *(string) --*
- **HttpHeaderConfig** *(dict) --*
- **HttpHeaderName... | |
range(nbins[j]):
f.write('{:>6} '.format('%.3f'%(corr_young[k])))
f.write('\n')
f.write('{:<8} '.format('corr_old'))
for k in range(nbins[j]):
f.write('{:>6} '.format('%.3f'%(corr_old[k])))
f.write('\n')
f.write('{:<8} '.format('bins_gmc'))
for k in range(nbins[j]):
f.write('{:>6} '.for... | |
import __init__paths
import attr
import spacy
from nltk.corpus import wordnet as wn
from tools import str2seq, read_text_test_data
from config import config_device, config_pwws_use_NE, \
config_data, config_dataset, model_path, config_pww_NNE_attack, BertConfig
import numpy as np
from get_NE_list import NE_list
from f... | |
# BSD 3-Clause License
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright... | |
<gh_stars>1-10
import sys
import os
import subprocess
import shutil
import struct
import configparser
import locale
import fsb5
# PySide bindings
import PySide
from PySide.QtGui import *
from PySide.QtCore import *
from PySide.QtOpenGL import *
from PySide.QtMultimedia import *
from OpenGL.GL import *... | |
self.assertEqual(self._callFUT(IException), True)
def test_is_IException_subinterface(self):
from pyramid.interfaces import IException
class ISubException(IException):
pass
self.assertEqual(self._callFUT(ISubException), True)
class TestMultiView(unittest.TestCase):
def _getTargetClass(self):
from pyramid.confi... | |
be
sent along with the request as metadata.
Returns:
google.cloud.security.privateca_v1.types.CaPool:
A [CaPool][google.cloud.security.privateca.v1.CaPool] represents a group of
[CertificateAuthorities][google.cloud.security.privateca.v1.CertificateAuthority]
that form a trust anchor. A
[CaPool][google.cloud.se... | |
import time
import pytest
from dvslib.dvs_common import wait_for_result
L3_TABLE_TYPE = "L3"
L3_TABLE_NAME = "L3_TEST"
L3_BIND_PORTS = ["Ethernet0"]
L3_RULE_NAME = "L3_TEST_RULE"
class TestNat(object):
def setup_db(self, dvs):
self.app_db = dvs.get_app_db()
self.asic_db = dvs.get_asic_db()
self.config_db = dvs.g... | |
import numpy as np
from qtpy import QtWidgets, QtCore, QtGui
import flika
from flika import global_vars as g
from flika.window import Window
from flika.utils.io import tifffile
from flika.process.file_ import get_permutation_tuple
from flika.utils.misc import open_file_gui
import pyqtgraph as pg
import time
import os
f... | |
审核帐号不能与创建帐号相同
raise serializers.ValidationError("审核帐号不能与创建帐号相同'")
try:
auditor = User.objects.get(username=value)
except Exception as e:
raise serializers.ValidationError("指定的审核账号不存在")
if not auditor.has_perm('plan.admin_semifinishedmanageplanmodel'):
raise serializers.ValidationError("指定的审核账号不具备审核权限")
... | |
import numpy as np
import pandas as pd
import torch
import warnings
import numba
import rpy2.robjects as robjects
import scipy.integrate as integrate
from dataclasses import InitVar, dataclass, field
from Evaluations.custom_types import NumericArrayLike
def check_and_convert(*args):
""" Makes sure that the given in... | |
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
#
# Copyright (C) 2014-2018 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
# <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... | |
#### PATTERN | DB ##################################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2010 University of Antwerp, Belgium
# Author: <NAME> <<EMAIL>>
# License: BSD (see LICENSE.txt for details).
# http://www.clips.ua.ac.be/pages/pattern
###########################... | |
# From https://github.com/snap-stanford/GraphRNN/blob/1ef475d957414d7c0bf8c778a1d44cb52dd7829b/utils.py
import networkx as nx
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
from torch.autograd import Variable
import matplotlib.pyplot as plt
import torch.nn.functional as F
from torch ... | |
#
# Copyright 2015 Naver Corp.
#
# 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... | |
i in range(n - 1):
x_1 = pol_xy[i, 0]
y_1 = pol_xy[i, 1]
x_2 = pol_xy[i + 1, 0]
y_2 = pol_xy[i + 1, 1]
pol_updates.append((x_1, y_1))
dist = np.sqrt((x_1 - x_2) ** 2 + (y_1 - y_2) ** 2)
if dist > dist_param:
n_inter = int(dist // (dist_param / 2))
inter = addMiddlePoints((x_1, y_1), (x_2, y_2), n_inter)
... | |
completion
assert runner._pairs[0][0].jobs[0].start_workflow.workflow_type == "HelloWorkflow"
assert (
runner._pairs[-1][-1]
.successful.commands[0]
.complete_workflow_execution.result.data
== b'"Hello, Temporal!"'
)
@workflow.defn
class ContinueAsNewWorkflow:
@workflow.run
async def run(self, past_run_ids: ... | |
"""
Author: <NAME>
Defines the ExportManager class
"""
import logging
from enum import Enum as PythonEnum
import ee
from gee_tools.datasources.generic_datasources import GenericSingleImageDatasource
from gee_tools.datasources.interface import SingleImageDatasource
from gee_tools.exports.task_scheduler import TaskSch... | |
"""
PBC changed.
"""
if self.PBCYCheckBox.isChecked():
self.PBC[1] = 1
else:
self.PBC[1] = 0
def PBCZChanged(self, val):
"""
PBC changed.
"""
if self.PBCZCheckBox.isChecked():
self.PBC[2] = 1
else:
self.PBC[2] = 0
def getCurrentStateIndexes(self):
"""
Return indexes of states that are currently s... | |
from thespian.actors import ActorAddress, ActorSystemConventionUpdate
from thespian.system.messages.convention import (ConventionRegister,
ConventionDeRegister,
ConventionInvite)
from thespian.system.admin.convention import (LocalConventionState, LostRemote,
HysteresisCancel,
CONVENTION_REREGISTRATION_PERIOD,
CONV... | |
<reponame>CGATOxford/cgat
'''bam2stats.py - compute stats from a bam-file
===============================================
:Tags: Genomics NGS Summary BAM
Purpose
-------
This script takes a bam file as input and computes a few metrics by
iterating over the file. The metrics output are:
+------------------------+---... | |
and outputs is
a Tensor, and another is a Tensor list/tuple, then the Jacobian will
be a tuple of Tensors. If both of inputs and outputs are Tensor
list/tuple, then the Jacobian will be a tuple of tuple of Tensors
where ``Jacobian[i][j]`` will contain the Jacobian matrix of the
linearized ``i``th output and ``j``t... | |
`image_shape` is required.
raise ValueError("Argument `image_shape` must be provided for NUFFT.")
image_shape = tf.TensorShape(image_shape)
image_shape.assert_has_rank(rank)
if multicoil is None:
# `multicoil` defaults to True if sensitivities were passed; False
# otherwise.
multicoil = sensitivities is not Non... | |
projects
variable = PY.Word(PY.alphanums + "_", PY.alphanums + "_")
message_key = PY.Literal("MessageId") + PY.Literal("=") + PY.Optional(PY.Optional(PY.Literal("+")) + variable)
severity = PY.Literal("Severity") + PY.Literal("=") + variable
facility = PY.Literal("Facility") + PY.Literal("=") + variable
symbolic_n... | |
<reponame>cdondrup/teaching
#
# This file is part of pyperplan.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Th... | |
# Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# 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 applicab... | |
"""
Model Classes
<NAME>, January 21, 2020
"""
import golly as g
import model_parameters as mparam
import random as rand
import numpy as np
import copy
"""
Make a class for seeds.
"""
#
# Note: Golly locates cells by x (horizontal) and y (vertical) coordinates,
# usually given in the format (x, y). On t... | |
)
o0oo0 . print_notify ( )
if 32 - 32: OoO0O00 / I1Ii111 / I1Ii111
if 45 - 45: iII111i + O0 % i11iIiiIii * I1ii11iIi11i + I1Ii111 / OOooOOo
if 55 - 55: OoooooooOO % iIii1I11I1II1 . ooOoO0o
if 10 - 10: O0 * iIii1I11I1II1 . OOooOOo
i1IIiI1iII = o0oo0 . nonce_key
if ( lisp_map_notify_queue . has_key ( i1IIiI1iII ) ... | |
axis=1))) == 1
assert len(np.where(np.all(patch_indices == np.asarray([0, 0, 3]), axis=1))) == 1
# Make sure we skipped over this one, we want maximum spaced patches
# So this one should not be in there
assert 3 not in patch_indices[:, 2]
assert len(np.where(np.all(patch_indices == np.asarray([0, 5, 0]), axis=1)))... | |
#!/bin/python
'''
script to plot ABC
'''
import os
import sys
import h5py
import getpass
import numpy as np
import corner as DFM
# -- abcpmc --
import abcpmc
# -- galpopfm --
from galpopfm import dustfm as dustFM
from galpopfm import dust_infer as dustInfer
from galpopfm import measure_obs as measureObs
# -- p... | |
# -*- coding: utf-8 -*-
from wakatime.main import execute
from wakatime.packages import requests
import logging
import os
import time
import shutil
import sys
import uuid
from testfixtures import log_capture
from wakatime.compat import u, is_py3
from wakatime.constants import (
API_ERROR,
AUTH_ERROR,
MAX_FILE_SIZ... | |
" \
f"{set(self._successor)}, left adjacency {self._adj_left} with " \
f"{'same' if self._adj_left_same_direction else 'opposite'} direction, and " \
f"right adjacency with {'same' if self._adj_right_same_direction else 'opposite'} direction"
def __repr__(self):
return f"Lanelet(left_vertices={self._left_vertices... | |
no fix is yet
available.
packageType: The type of package (e.g. OS, MAVEN, GO).
"""
class EffectiveSeverityValueValuesEnum(_messages.Enum):
r"""Output only. The distro or language system assigned severity for this
vulnerability when that is available and note provider assigned severity
when it is not available.... | |
<filename>utils/map_features_utils.py
"""This module is used for computing map features for motion forecasting baselines."""
from typing import Any, Dict, List, Tuple, Sequence
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from shapely.geometry import LineString, Point, Polygon
from shapely.o... | |
# -*- coding: utf-8 -*-
import os
import re
import tempfile
# Form implementation generated from reading ui file 'frontend_1.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from difflib import get_close_matches
from pikepdf import _cpphelpers
import webbrowse... | |
# Driver for Rhode & Schwartz VNA ZNB40
# <NAME> <<EMAIL>>, 2014
# <NAME> <<EMAIL>>, 2015
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your ... | |
<reponame>thunlp/OHRE
import numpy as np
from copy import deepcopy
import networkx as nx
import community
def find_close(M):
s_index, l_index = 0, 0
min_list = np.zeros([len(M)], dtype=np.float32)
min_index_list = np.zeros([len(M)], dtype=np.int32)
for i, item in enumerate(M):
if len(item):
temp_min = min(item)... | |
This changes hyphen to + to match width of math mode minus sign.
if param:
text = text.replace('-', '+')
f = 0 if fontsize == self._style['fs'] else 1
sum_text = 0.0
for c in text:
try:
sum_text += self._char_list[c][f]
except KeyError:
# if non-ASCII char, use width of 'c', an average size
sum_text += self.... | |
import numpy as np
import scipy
import scipy.io
import pickle
from scipy.special import lpmv, spherical_jn, spherical_yn
class Directivity:
def __init__(self, data_path, rho0, c0, freq_vec, simulated_ir_duration, measurement_radius, sh_order, type, sample_rate=44100, **kwargs):
'''
This script enco... | |
#!/usr/bin/env python3
#
# Script to manage S3-stored backups
#
# Copyright (c) 2009-2013 <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, including without limit... | |
the mote has a typical RF output power of -2 dBm when the PA is disabled, then set the txPower parameter to -2 to turn off the PA. This command may be issued at any time and takes effect at the next mote boot. To change the transmit power immediately, use the write RAM option of this command, which can also be used at ... | |
the outfit of the client to Checkered Renegade.",
help="Sets the outfit of the client to Checkered Renegade.\n"
"Example: !checkeredrenegade"
)
async def checkeredrenegade(self, ctx: fortnitepy.ext.commands.Context) -> None:
skin_variants = self.bot.party.me.create_variants(
material=2
)
await self.bot.party.m... | |
#!/usr/local/bin/python3.4
#
# fetch.py
#
# <NAME> and <NAME>, Climate Code Foundation.
# Copyright (C) 2008-2010 Ravenbrook Limited.
# Copyright (C) 2011 Climate Code Foundation.
# <NAME>, Revision 2017-07-28
"""
fetch.py [--help] [--list] [--force] [--store <dir>] [--config <file>] [pattern] ...
Script to fetch (do... | |
<reponame>marioantao/Text_Analytics_Project-_SA
from src.features.process_text.patterns import get_contraction_dict, get_special_characters_pattern,\
get_end_characters_pattern, get_hyperlink_pattern, get_apostrophe_pattern, get_whitespace_pattern, get_number_pattern, \
get_abbreviation_dict, get_emoticon_dict
from s... | |
+ m.b69 - m.b90 <= 0)
m.c2851 = Constraint(expr= - m.b49 + m.b50 - m.b91 <= 0)
m.c2852 = Constraint(expr= - m.b49 + m.b51 - m.b92 <= 0)
m.c2853 = Constraint(expr= - m.b49 + m.b52 - m.b93 <= 0)
m.c2854 = Constraint(expr= - m.b49 + m.b53 - m.b94 <= 0)
m.c2855 = Constraint(expr= - m.b49 + m.b54 - m.b95 <= 0)
m.c2856... | |
<reponame>greggius9891/transient-algorithm
# ###########################################################################
# Author: <NAME>
# Github: ...
# Email: <EMAIL>, <EMAIL>
# This is a machine learning project able to detect where notes are played
# in audio tracks.
# If you are interested in it please please be... | |
* best / total)
if b < a:
b += 1
while b < N - 1 and getsum(a, b, total, totalsum) >= getsum(a, b + 1,
total, totalsum):
b += 1
return best
def func_1691ea258a804e008ed80b0b27bfe0b0(infile):
T, = line(infile)
for T in xrange(1, T + 1):
N, p, q, r, s = line(infile)
A = [((i * p + q) % r + s) for i in xrange(... | |
import logging
import random
import asyncio
import time
from typing import Union
import discord
from discord.ext import commands
from discord.ext.commands import Cog, Bot, Context, BucketType
from tools import embeds, record
from tools.bank import Bank
import constants
log = logging.getLogger(__name__)
class Chanc... | |
<reponame>yaskh/EvalAI
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import contextlib
import importlib
import json
import logging
import os
import requests
import signal
import shutil
import sys
import tempfile
impo... | |
# -----------------------------------------------------------------------------
# (c) 2005 by Basler Vision Technologies
# Section: Vision Components
# Project: GenApiTest
# Author:
# $Header:
# -----------------------------------------------------------------------------
from genicam import *
import unittest
from gen... | |
<gh_stars>1-10
"""Tests for the presentation module."""
import logging
import sys
import pytest
from pydicom import __version__
from pydicom._uid_dict import UID_dictionary
from pydicom.uid import UID
from pynetdicom import AE, _config
from pynetdicom._globals import DEFAULT_TRANSFER_SYNTAXES
from pynetdicom.pdu_pr... | |
#
# Copyright 2018 Analytics Zoo 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 ... | |
#
# # * SegmentIO no longer takes an ordinary IO to access the physical file.
# # Instead, it takes a LineReadIO instance. LineReadIO is an interface.
# # To implement it, one needs to provide a function that reads lines.
# #
# # * SegmentIO implements LineReadIO, providing a function to read lines
# # of a vi... | |
None, date_range_end: str = None, csv_delimiter: str = 'comma',
decimal_char: str = None, return_type: str = 'flat', data_format: str = 'json',
error_format: str = 'json', *args, **kwargs) -> dict:
"""This method allows you to export a set of records for a project.
:param records: An array of record names specifyi... | |
brush)
brush = QtGui.QBrush(QtGui.QColor(108, 255, 63, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush)
brush = QtGui.QBrush(QtGui.QColor(29, 127, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPale... | |
self.count = 0
self.log = log
# NOTE: For some reason tree items have to have a data object in
# order to be sorted. Since our compare just uses the labels
# we don't need any real data, so we'll just use None below for
# the item data.
if self.MainFrame.isPremium == True:
self.RootParentID = "Artifact class... | |
"""
- EMOS 'computer.py' Source Code -
(C) Cubeflix 2021 (EMOS)
"""
# Imports
from .misc import *
from .memory import *
class FileSystem:
"""A hard drive managed by the OS."""
def __init__(self, computer, outfile):
"""Create the hard drive.
Args: computer -> the computer the hard drive is attached to
... | |
<filename>madgraph/fks/fks_helas_objects.py
################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman di... | |
is preety amazing i like the way she move i mean work',
]
word = lst[random.randint(0, len(lst) - 1)]
speak(word)
elif exist(['my friends', 'my friend']):
speak("I know one of your friend. Her name is Elva. Oh wow Its me.")
elif exist(['weather', 'mosam', 'outside', 'city']):
weather.weather("indore")
b... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import numpy as np
from tqdm import tqdm
from models import utils
class Model(object):
def __init__(self,
cfg,
model_arch,
restore_vars_dict=None):
self.cfg = cfg
self.batch_s... | |
0., np.inf)
validate(companion+'_rsuma', None, 0., np.inf)
validate(companion+'_cosi', 0., 0., 1.)
validate(companion+'_epoch', 0., -np.inf, np.inf)
validate(companion+'_period', 0., 0., np.inf)
validate(companion+'_sbratio_'+inst, 0., 0., np.inf)
validate(companion+'_K', 0., 0., np.inf)
validate(companion+'_f_s... | |
#!/usr/bin/env python
import sys
import os
import socket
import argparse
import subprocess
import signal
import fcntl
import stat
criu_bin = '../../criu/criu'
sk_type_s = {
socket.SOCK_STREAM: "S",
socket.SOCK_DGRAM: "D",
}
# Actions that can be done by test. Actions are not only syscall
# names to call, but also... | |
<gh_stars>0
#!/usr/bin/env python3
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2018
# [] International Business Machines Corp.
#
#
# 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... | |
#!/usr/bin/env python3
# we're using python 3.x style print but want it to work in python 2.x,
from __future__ import print_function
import os
import argparse
import sys
import subprocess
import shutil
import threading
# from collections import defaultdict
# from subprocess import CalledProcessError
# make sure scrip... | |
self.gamebattle.team2poslist, self.gamebattle.allunitindex,
# self.gamebattle.enactment)
# self.gamebattle.eventlog.addlog([0, str(self.leader[0].name) + "'s parentunit surrender"], [0, 1])
# self.gamebattle.setuparmyicon()
# ^ End retreat function
# v Rotate Function
if self.angle != self.new_angle and self.cha... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/10/31 10:02
# @Author : kimmy-pan
# @File : GET_TAPD.py
import requests
import tablib
from io import BytesIO
from requests.auth import HTTPBasicAuth
from model.util.PUB_DATABASEOPT import *
from model.util.PUB_LOG import *
from model.FUNC.ENUM_OP... | |
base pointer registers."
print(tty_colors.red() + self.reportexploitable + tty_colors.default())
else:
print(tty_colors.red()+"Exploitable = %s"%self.is_exploitable+tty_colors.default())
if self.access_type in ("read", "write"):
self.reportexploitable = "Crash "+self.access_type+"'g invalid address."
else:
self... | |
<reponame>freakinhippie/ansible-pan<gh_stars>0
#!/usr/bin/env python
# Copyright 2017 Palo Alto Networks, 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/licens... | |
<gh_stars>10-100
# Copyright 2021 Red Hat, 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 ... | |
return 'You have no current accepted jobs in your queue.'
raw_jobs = [j.job_tag for j in job_records]
responder = ListOutputResponder(cmd_object.cmdspec,
parse_sms_message_body,
single_item_noun='accepted job',
plural_item_noun='accepted jobs')
return responder.generate(command_object=cmd_object,
string_list=... | |
4
)
if self.options['verbose']: print('WGAN Discriminator Input Created')
# Discriminator layers for the projection of the text embedding
self.d_projector = nn.Sequential(
nn.Linear(in_features=self.options['caption_vec_len'], out_features=self.options['t_dim']),
nn.BatchNorm1d(num_features=self.options... | |
<gh_stars>1-10
"""
Core VM-related functionality for executing programs
Timer and VM are implemented here.
"""
from collections import namedtuple
from copy import copy
from typing import Tuple, List, ByteString, Iterable, Union, Dict
from random import randrange
from eightdad.core.bytecode import (
PATTERN_IXII,
P... | |
<gh_stars>1-10
#!/usr/bin/python3
#--------------------------------------------------------------------
# Automation of Stickney Observatory pt 2 -
# auto_dome.py - A program written to allow the use of a user -
# interface to control the dome's motion. -
# Author(s): <NAME>, <NAME>, <NAME>, <NAME> -
# THIS CODE DOES ... | |
last_x >= _first_x
roots += 1
hP.roots = roots
fork_.append(hP) # P-connected hPs will be converted to segments at each _fork
if _x > x: # x overlap between hP and next P: hP is buffered for next scan_P_, else hP included in a blob segment
buff_.append(hP)
elif roots != 1:
frame, _frame = form_blob(hP, frame, _... | |
import os
import numpy as np
import tensorflow as tf
import cv2
import time
import sys
import pickle
import ROLO_utils as util
class YOLO_TF:
fromfile = None
tofile_img = 'test/output.jpg'
tofile_txt = 'test/output.txt'
imshow = True
filewrite_img = False
filewrite_txt = False
disp_console = True
weights_file... | |
args.target = target
args.enablement = enablement
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
def recv_setNotificationsEnabled(self):
iprot = self._iprot
(fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
x.rea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.