input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import logging
import os
import re
import time
from threading import Event, Lock, Thread
import cook.util as cu
class ProgressSequenceCounter:
"""Utility class that supports atomically incrementing the sequence value."""
def __init__(self, initial=0):
self.lock = Lock()
self.value = initial
def increment_and_ge... | |
interval - these are the NOGs that we are
defining as colitis-responsive
'''
R('''dat <- read.csv("%s", header = T, stringsAsFactors = F, sep = "\t")''' % infile)
# just get those signficant in either DNA or RNA or both
R('''genes <- dat$gene''')
# regression model
R('''mod1 <- lm(dat$rna~dat$dna)''')
# pred... | |
lon/lat timeseries
nrep_smooth = nrep - smooth_win + 1 # length of series after smoothing
lon_smooth = np.empty(nrep_smooth)
lon_smooth[:] = np.nan
lat_smooth = np.empty(nrep_smooth)
lat_smooth[:] = np.nan
hrs_smooth = np.empty(nrep_smooth)
hrs_smooth[:] = np.nan
try:
for i in range(0, nrep_smooth):
lon_smoot... | |
is_little_endian=True, ),
Attribute(
name="Veedramon Deck Rookie1",
addresses=[0x26a5782,0x26a5784,0x26a5786],
number_of_bytes=2,
possible_values=[New_Veedramon_Deck[4]],
is_little_endian=True, ),
Attribute(
name="Veedramon Deck Rookie2",
addresses=[0x26a5788,0x26a578a,0x26a578c],
number_of_bytes=2,
possible... | |
#!/usr/local/bin/python2.7
import os
import web
import urllib2
import urllib
import json
import time
from datetime import datetime
web.config.debug=False
curPath = os.path.dirname(__file__)
urls = (
'/','Index',
'/login/','Login',
'/logout/','Logout',
'/signup/','Signup',
'/confirmuser/(.+)/(.+)','ConfirmUser',... | |
hashlib.sha256(encrypted_password).hexdigest()
print(encrypted_password)
speak(f"your decrypted password is {encrypted_password}")
"""listen to the user"""
def listenss():
speak("listening")
os.system("start chrome https://www.google.com/")
time.sleep(4)
speak("what do you want to search for?")
search = take... | |
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP
#
# 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... | |
to large differences in value as the latter elements change sign.
# This also means that the first element of the quaternion is not expectation zero.
# The SO(3) rotation representation would be a good replacement here,
# since it smoothly varies between values in all directions (the property we want),
# but right ... | |
<reponame>avik-pal/social-driving<filename>sdriving/environments/highway.py<gh_stars>100-1000
import math
from collections import deque
from itertools import product
import numpy as np
import torch
from gym.spaces import Box, Discrete, Tuple
from sdriving.environments.base_env import BaseMultiAgentDrivingEnvironment
... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.247044,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 4.43246,
'S... | |
"dest_link": {
"r1-link4": {"next_hop_self": False}
}
}
}
}
},
},
},
]
}
}
result = create_router_bgp(tgen, topo, input_dict_4)
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
step(
"Verify that within vrf instances, BGP best path selection"
" algorithm remains intac... | |
import numpy as np
import torch
import torch.nn as nn
import functools
import open3d
from torch.autograd import Function
from .base_model import BaseModel
from ...utils import MODEL
from ..modules.losses import filter_valid_label
from ...datasets.augment import SemsegAugmentation
if open3d.core.cuda.device_count() > ... | |
"""
DATAQ 4108 driver level code
author: <NAME>
"""
from numpy import nan, mean, std, asarray, array, concatenate, \
delete, round, vstack, hstack, zeros, transpose, split
from time import time, sleep
import sys
if sys.version_info[0] == 3:
if sys.version_info[1] <= 7:
from time import gmtime, strftime... | |
'''
Created on Feb 20, 2013
@author: <NAME>
@author: <NAME>
@author: <NAME>
'''
from wmf import dump
from difflib import Differ
from time import time
from structures.Revision import Revision
from structures.Paragraph import Paragraph
from structures.Sentence import Sentence
from structures.Word import Word
from s... | |
<filename>python/tseval/collector/ExperimentsAnalyzer.py<gh_stars>0
import collections
import itertools
import random
import stat
import tempfile
from pathlib import Path
from typing import *
import numpy as np
import pandas as pd
import seaborn as sns
import torch
from matplotlib import pyplot as plt
from recordclass... | |
rev_eds = _parser(_lexer(fmt))
self.assertEqual(result, _input(eds, rev_eds, inp))
@attr(platform='9-1_linux_intel')
@attr('input')
@attr(ed='G')
def test_g_ed_input_580(self):
inp = '''0.1E+200'''
fmt = '''(G2.1E5)'''
result = [0.0000000000000000e+00]
eds, rev_eds = _parser(_lexer(fmt))
self.assertEqual(res... | |
<gh_stars>0
"""
xarray extensions (accessors).
"""
from collections import defaultdict
import warnings
import attr
import numpy as np
from xarray import as_variable, Dataset, register_dataset_accessor
from .drivers import XarraySimulationDriver
from .model import get_model_variables, Model
from .utils import Frozen,... | |
collections to which variables (if any
will be created) are added.
trainable: If `True` also add variables to the graph collection
`GraphKeys.TRAINABLE_VARIABLES` (see ${tf.get_variable}).
"""
pass
def _create_categorical_column_weighted_sum(
column, builder, units, sparse_combiner, weight_collections, trainabl... | |
@property
def merge_target(self):
"""Return the gRPC stub for :meth:`ResultStoreUploadClient.merge_target`.
Applies a merge update to the target identified by the given proto's
name. For primitive and message fields, replaces them with the ones in the
given proto if they are covered under the field mask paths. Fo... | |
range(len(atoms)):
if atoms[j][2] == planes[i]:
temp_plane.append(atoms[j]) # z-coordinate removed for convenience
result.append(temp_plane)
result = np.array(result)
return result
# =============================================================================
# %% A useful function to get the [x y z] coordinate... | |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import gdspy
import picwriter.toolkit as tk
class Ring(tk.Component):
""" Ring Resonator Cell class.
Args:
* **wgt** (WaveguideTemplate): WaveguideTemplate object
* **radius** (float): R... | |
return a 'dry run' training op,
used normally only for oracle tracing.
use_moving_average: Whether or not to read from the moving
average variables instead of the true parameters. Note: it is not
possible to make gradient updates when this is True.
advance_counters: Whether or not this loop should increment t... | |
<filename>veritastool/metrics/tradeoff.py<gh_stars>1-10
import numpy as np
import sklearn.metrics as skm
from .fairness_metrics import FairnessMetrics
from .modelrates import *
from ..config.constants import Constants
from scipy.ndimage.filters import gaussian_filter
class TradeoffRate(object):
"""
Class to compute ... | |
ndf], axis=1),
self.petab_problem.observable_df,
self.petab_problem.parameter_df)
if not ('objectivePriorType' in self.petab_problem.parameter_df.columns
or 'objectivePriorParameters' in self.petab_problem.parameter_df.columns):
if not np.isclose(self._results['fval'],
self._results_all['objective_value'][self._b... | |
self._g('set yrange[*:*]')
self._g('set zrange[*:*]')
elif mode == 'manual':
# (some) axis limits are frozen
xmin = ax.getp('xmin')
xmax = ax.getp('xmax')
if xmin is not None and xmax is not None:
# set x-axis limits
self._g('set xrange[%g:%g]' % (xmin, xmax))
else:
# let plotting package set x-axis limits or... | |
<filename>asteroids/whatsobservable.py
import datetime
import ephem
import os.path
import os
import numpy as np
import pdb
from pandas import DataFrame
__version__ = '0.1.2'
class Error(Exception):
pass
def _convert_datetime_to_pyephem_date_string(in_datetime):
return in_datetime.strftime('%Y/%m/%d %H:%M:%S')
... | |
in settings:
dev_num = settings["eqid"]
elif "shuntcapacitorid" in settings:
dev_num = settings["shuntcapacitorid"]
else:
dev_num = None
capacitor_data = None
if dev_num is not None:
if dev_num in self.capacitors:
capacitor_data = self.capacitors[dev_num]
# Reactance
try:
api_capacitor.reactance = float(c... | |
<reponame>HarperDB/harperdb-sdk-python
import datetime
import responses
import harperdb
import harperdb_testcase
class TestHarperDBWrapper(harperdb_testcase.HarperDBTestCase):
def setUp(self):
""" This method is called before each test.
"""
self.db = harperdb.wrappers.HarperDBWrapper(self.URL)
def test_harper... | |
import sys
sys.path.append("../src/")
from DEVS import CoupledDEVS, AtomicDEVS, RootDEVS, directConnect
from infinity import INFINITY
from collections import defaultdict
from util import allZeroDict, addDict
from statesavers import PickleHighestState as state_saver
from message import NetworkMessage
from messageSchedu... | |
<reponame>JoanAzpeitia/lp_sg<gh_stars>0
# Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this ... | |
import numpy as np
import openmdao.api as om
import wisdem.commonse.utilities as util
import wisdem.pyframe3dd.pyframe3dd as pyframe3dd
import wisdem.commonse.utilization_dnvgl as util_dnvgl
import wisdem.commonse.utilization_constraints as util_con
from wisdem.commonse import NFREQ, gravity
from wisdem.floatingse.memb... | |
<filename>dulwich/protocol.py
# protocol.py -- Shared parts of the git protocols
# Copyright (C) 2008 <NAME> <<EMAIL>>
# Copyright (C) 2008-2012 <NAME> <<EMAIL>>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0... | |
self.setters:
del self.setters[name]
# Remove setters and secrets from self that are defined by scope.
for name in scope.get('must', dict()).keys():
del_setter(name)
for name in scope.get('default', dict()).keys():
del_setter(name)
self.secret = list(set(self.secret) - set(scope.get('secret', list())))
for na... | |
#!/usr/bin/env
# -*- coding: utf-8 -*-
"""
This program is used to schmooze formats from firefox and add new ones
"""
import os
import subprocess
import json
def getFirefoxProfilePath(osUser=None,profileId=None):
"""
get the path to a firefox profile
:property osUser: user on the os to find (default=current user)
... | |
'<NAME>', 'zh': u('\u4e91\u5357\u7701\u7ea2\u6cb3\u54c8\u5c3c\u65cf\u5f5d\u65cf\u81ea\u6cbb\u5dde')},
'861590874':{'en': '<NAME>', 'zh': u('\u4e91\u5357\u7701\u66f2\u9756\u5e02')},
'861590875':{'en': '<NAME>', 'zh': u('\u4e91\u5357\u7701\u4fdd\u5c71\u5e02')},
'861590876':{'en': '<NAME>', 'zh': u('\u4e91\u5357\u7701\... | |
pass
def MAttributePattern_attrPatternCount(*args, **kwargs):
pass
def MNamespace_relativeNames(*args, **kwargs):
pass
def MFnUint64SingleIndexedComponent_getCompleteData(*args, **kwargs):
pass
def MFnMesh_subdivideFaces(*args, **kwargs):
pass
def delete_MUint64Array(*args, **kwargs):
pass
def MFnTrans... | |
* (1 - alpha) * np.log(2 *
# np.pi * sn2) - 0.5 * np.log(alpha)
alpha_term = - 0.5 * alpha * np.log(2 * np.pi * sn2)
const_term = - 0.5 * np.log(1 + alpha * (v_t + v_prop) / sn2)
logZ = exp_term + const_term + alpha_term
if m_prop.ndim == 2:
logZ = scale * np.sum(logZ)
dvt = scale * (-0.5 / v_sum + 0.5 * m_diff... | |
<filename>rec/recommender/dml/sampler.py<gh_stars>1-10
import random
import sys, os
from collections import Counter
from time import time
from typing import List
import numpy as np
import psutil
from rec.utils import tb
import torch
import tqdm
from rec.dataset.dataset import Dataset
from rec.recommender.dml.dml impo... | |
<gh_stars>10-100
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.framework import ops
from tensorflow.python.training import optimizer
import tensorflow as tf
import numpy as np
class Grad(optimizer.Optimi... | |
#!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for commands. Needs to be run inside of chroot for mox."""
import copy
import itertools
import mox
import os
import s... | |
Bereiche nur einmal anzeigen
if not folder_is_protected and item_container.container.is_protected():
postfix = PROJECT_ICON
return this_link + d_info + postfix
# -----------------------------------------------------
def show_more ( url, url_extern, info='Mehr ...' ) :
""" erzeugt einen Verweis fuer "mehr ..." """
... | |
<filename>tests/v2_validation/cattlevalidationtest/core/test_storage_nfs_driver.py
from common_fixtures import * # NOQA
from cattle import ApiError
if_test_rancher_nfs = pytest.mark.skipif(
not os.environ.get('TEST_NFS'),
reason='Rancher NFS test not enabled')
volume_driver = "rancher-nfs"
@if_test_rancher_nfs
def... | |
cluster_ci = self.cluster_cis.get(res_pool['owner'])
if cluster_ci:
res_pool_ci = __ci__.create('vSphereRP', _encode(res_pool['name']))
res_pool_ci['properties'] = {'vm_num': len(res_pool['vm'])}
__ci__.createrelationship(
cluster_ci['cid'], res_pool_ci['cid'], 'Inlines')
def discover_host_network(
self, host_c... | |
'vz', 'radius', 'status', 'charge', 'pdgId', 'pass'],
dtype={
'particle_id': np.int64,
'px': np.float32,
'py': np.float32,
'pz': np.float32,
'pt': np.float32,
'eta': np.float32,
'vx': np.float32,
'vy': np.float32,
'vz': np.float32,
'radius': np.float32,
'status': np.int64,
'charge': np.float32,
'pdgId': n... | |
member["name"]
return members_names_by_tag
async def get_clandata_by_tag(self, clan_tag):
if clan_tag[0] != '#':
clan_tag = "#" + clan_tag
clans = await self.config.clans()
for clan in clans:
if clan["tag"] == clan_tag:
return clan
return None
@commands.command(name="refresh")
@checks.mod_or_permissions()... | |
<reponame>silkyanteater/quickparse
import sys
try:
from collections.abc import Iterable, Sequence
except ImportError:
from collections import Iterable, Sequence
from .lib import (
validate_commands_config,
validate_options_config,
humblecall,
get_arg_type,
get_equivalent_commands,
get_options_equivalency,
exp... | |
zero.
w = pw and width / pw or 1
h = ph and height / ph or 1
t.scale(w, h)
t.translate(-pw / 2 - px, -ph / 2 - py)
return t.map(shape)
def fit_to(shape, bounding, keep_proportions):
"""Fit a shape to another shape."""
if shape is None: return None
if bounding is None: return shape
bx, by, bw, bh = list(boun... | |
<gh_stars>1-10
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import random
import json
from datetime import datetime
from datetime import timedelta
from sklearn.metrics import confusion_matrix, classification_report
import numpy as np
import itertools
import igraph
from collections import Co... | |
<filename>napari/utils/colormaps/standardize_color.py
"""This module contains functions that 'standardize' the color handling
of napari layers by supplying functions that are able to convert most
color representation the user had in mind into a single representation -
a numpy Nx4 array of float32 values between 0 and 1... | |
"""
file name: run.py
author: <NAME>
created: 7. May 2021
brief: This file contains the script for plotting the packet reception for the framework. Used for the report. Not recommended to use
it for actual data plotting.
"""
"""
Import statement
"""
import csv
import os
import struct
import numpy as np
... | |
other, hierarchies):
def delta_refinement(dself, dother):
# Polarities are either equal
if dself['polarity'] == dother['polarity']:
pol_refinement = True
# Or this one has a polarity and the other doesn't
elif dself['polarity'] is not None and dother['polarity'] is None:
pol_refinement = True
else:
pol_refinem... | |
import numpy as np
from scipy import constants
from scipy.optimize import curve_fit
import os
from numpy.polynomial import polynomial as poly
from scipy.special import lambertw
# use absolute file path so tests work
path_const = os.path.join(os.path.dirname(__file__), '..', 'constants')
def AM15G_resample(wl):
'''
... | |
TopicRuleErrorActionElasticsearch.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
TopicRuleErrorActionElasticsearch.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
endpoint: str,
id: str,
index: str,
role_arn: str,
type: str):
... | |
newmask = ndimage.morphology.binary_erosion(newmask, iterations=iterations)
newmask = ndimage.morphology.binary_dilation(newmask, iterations=iterations)
return newmask
#This is an alternative to the ma.notmasked_edges
#Note: probably faster/simpler to contour the mask
def contour_edges(a):
import matplotlib.pyplot ... | |
|dry_run| is False.
"""
_LOGGER.info('Deleting checkout directory: %s', path)
if dry_run:
return
_Shell('rmdir', '/S', '/Q', path, dry_run=False)
def _GenerateSparseCheckoutPathAndContents(repo):
"""Generates the path to the sparse checkout file, and the desired
contents. Returns a tuple of (path, contents). |... | |
# Copyright (C) 2006 <NAME>, Science and Technology Facilities Council,
# Daresbury Laboratory.
# All rights reserved.
#
# Developed by: <NAME>
# Science and Technology Facilities Council
# Daresbury Laboratory
# Computational Science and Engineering Department
# Computational Chemistry Group
# http://www.cse.clrc.ac.u... | |
or argument types from this cursor
}
) # tuple of (str, dict)
else: # this is a type param
res = (
type_spelling, {
"type_size": sizeof_type, # int or NoneType
"is_type_alias": False, # bool
"is_type_param": True, # bool
"is_array": False, # bool
"is_pointer": False, # bool
"is_function": False, # bool
"typ... | |
filename
content += "\r\n"
content += value + "\r\n"
content += "--" + BOUNDARY + "--\r\n"
content += "\r\n"
content_type = "multipart/form-data; boundary=%s" % BOUNDARY
return content_type, content
def debug(s):
"""
Prints debugging information if post-review was run with --debug
"""
if options and opti... | |
of arguments, just in case
self.arguments = list(arguments)
self.location = location
def _getDependentObjects(self):
deps = set(self.arguments)
deps.add(self.returnType)
return deps
class IDLMethod(IDLInterfaceMember, IDLScope):
Special = enum(
'Getter',
'Setter',
'Creator',
'Deleter',
'LegacyCaller',
b... | |
"""
Collection of tests asserting things that should be true for
any index subclass. Makes use of the `indices` fixture defined
in pandas/tests/indexes/conftest.py.
"""
import re
import numpy as np
import pytest
from pandas._libs.tslibs import iNaT
from pandas.core.dtypes.common import is_period_dtype, needs_i8_conv... | |
msg, client, contact_type, contact_mail, role = None, callback = None, **k):
import msn.AddressBook as MSNAB
messengerService = client.address_book.SelectTargetService(MSNAB.ServiceFilters.Messenger)
msg.ServiceHandle = msg.new_serviceHandle()
msg.ServiceHandle.Id = 0 #messengerService.id
msg.ServiceHandle.Type = ... | |
crv_p = None
crv = crv.replace(rplStr[0], rplStr[1])
parents = pm.ls(crv_parent)
# this will try to find the correct parent by checking the top node
# in situations where the name is reapet in many places under same
# hierarchy this method will fail.
if len(parents) > 1 and model:
for p in parents:
if model.nam... | |
- ar Arabic
- cs Czech
- da Danish
- de German
- en English
- en_us English (US)
- es Spanish
- fi Finnish
- fr French
- he Hebrew
- hr Croatian
- hu Hungarian
- it Italian
- ja Japanese euc-j
- ja_v1 Japanese euc-j
- ja_jp.pck Japanese PCK (sjis)
- ja_jp.932 Japanese cp932
- ja_jp.pck_v2 Japanese PCK ... | |
font=("Helvetica", 13),
variable=__relatorio_corr,
value=False,
bg="light goldenrod",
command=__relatorio_corr.set(False)
>>>>>>> 7de809c (relatório e perdas)
)
_correntes_false.grid(row=4, column=3, sticky=tk.W)
# MOSTRAR FLUXO: True ou False
__relatorio_fluxo = tk.BooleanVar()
_fluxo_true = tk.Radiobutton(... | |
import types
import numpy as np
import torch
import math
from torch import nn, optim
import torch.nn.functional as F
from torch.autograd.variable import Variable
CROSS_ENTROPY_ONE_HOT_WARNING = False
def to_categorical(y, num_classes=None, dtype='float32'):
"""Converts a class vector (integers) to binary ... | |
import argparse
import random
from copy import deepcopy
from datetime import datetime
from pprint import pprint
import numpy as np
import torch
import trimesh
from liegroups import SO3
from manopth.anchorutils import anchor_load, get_rev_anchor_mapping, masking_load_driver
from manopth.manolayer import ManoLayer
from ... | |
#!/usr/bin/python
"""
MIT License
Copyright (c) 2020 <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 limitation the rights
to use, copy, mod... | |
<gh_stars>10-100
'''
Copyright (C) 2020 FireEye, Inc. All Rights Reserved.
Python implementation to pase PE .NET metadata. Unfortunatley, I can not find
any thing in Python to do that.
This is a work in progress. Currently, the module only parse upto the
MethodDef table, and only save the content of the Method... | |
<reponame>uwhvz/uwhvz<filename>app/views/moderator.py
from django.conf import settings
from django.contrib import messages
from django.shortcuts import redirect, render, get_object_or_404
from django.utils.decorators import method_decorator
from django.views import View
from django.core.mail import EmailMultiAlternativ... | |
"half-open", so
only the top and left boundary edges are considered part of the box. If
the line only intersects the box in a point, we consider this a no
intersection.
:param start: Pair `(x,y)` of the start of the line segment
:param end: Pair `(x,y)` of the end of the line segment
:param box_bounds: `(xmin, y... | |
label',
segment_based_fscore='Seg. F1',
segment_based_er='Seg. ER',
event_based_fscore='Evt. F1',
event_based_er='Evt. ER',
)
output += " {event_label:<17s} + {segment_based_fscore:7s} + {segment_based_er:7s} + {event_based_fscore:7s} + {event_based_er:7s} + \n".format(
event_label='-' * 17,
segment_based_fscor... | |
"trafficker",
"trafficking",
"tragedian",
"tragedienne",
"tragedy",
"tragic",
"tragically",
"tragicomedy",
"tragicomic",
"trail",
"trailblazer",
"trailblazing",
"trailer",
"train",
"trainable",
"trained",
"trainee",
"trainer",
"training",
"trainload",
"trainman",
"traipse",
"trait",
"traitor",
"... | |
'pink4' : np.array([0.55, 0.39, 0.42]),
'LightPink1' : np.array([1.00, 0.68, 0.73]),
'LightPink2' : np.array([0.93, 0.64, 0.68]),
'LightPink3' : np.array([0.80, 0.55, 0.58]),
'LightPink4' : np.array([0.55, 0.37, 0.40]),
'PaleVioletRed1' : np.array([1.00, 0.51, 0.67]),
'PaleVioletRed2' : np.array([0.93, 0.47, 0.62... | |
from __future__ import division, print_function
#!/usr/bin/env python
# encoding: utf-8
"""
EyeLinkSession.py
Created by <NAME> on 2016-04-27.
Copyright (c) 2011 __MyCompanyName__. All rights reserved.
"""
import os, sys, datetime, pickle, re
import math
import numpy as np
import scipy as sp
import scipy.stats as s... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Python software for Tenma 72-7735 multimeter
http://fr.farnell.com/tenma/72-7735/multimetre-numerique/dp/7430590
Serial protocol: http://www.element14.com/community/docs/DOC-42352/l/software-for-tenma-72-7735-for-windows7-rs232-protocol-information-flie
This softwar... | |
<reponame>211tbc/synthesis
from .interpretpicklist import Interpretpicklist
from . import dateutils
from datetime import datetime
from . import xmlutilities
from synthesis.exceptions import DataFormatError#, SoftwareCompatibilityError
from . import logger
#from sys import version
from . import dbobjects
from .writer im... | |
| 3679.41 0.0 497 0 | 1.86 0.19 36.89 0.02
3 1.52e+06 4969.29 | 4962.11 2734.9 652 348 | 1.88 0.19 37.78 0.02
3 1.53e+06 4969.29 | 2338.43 0.0 305 0 | 1.86 0.19 36.17 0.02
3 1.55e+06 4969.29 | 2442.01 0.0 309 0 | 1.81 0.19 36.69 0.02
3 1.56e+06 4969.29 | 4154.86 2039.7 522 250 | 1.85 0.19 37.91 0.02
3 1.58e+06 4969.29 ... | |
#!/usr/bin/env python
"""This modules contains tests for VFS API handlers."""
from grr.gui import api_test_lib
from grr.gui.api_plugins import vfs as vfs_plugin
from grr.lib import access_control
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import flags
from grr.lib import flow
from grr.li... | |
<gh_stars>10-100
# coding=utf-8
"""
Adapted from
https://github.com/tblaschke/reinvent-memory
"""
import abc
import json
import logging
import numpy as np
import pandas as pd
from rdkit import Chem
from rdkit import DataStructs
from rdkit.Chem import AllChem
from rdkit.Chem.AtomPairs import Pairs
from rdkit.Chem.Scaf... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
<filename>pytorch_ares/third_party/hydra/symbolic_interval/interval.py<gh_stars>100-1000
'''
Interval class definitions
** Top contributor: <NAME>
** This file is part of the symbolic interval analysis library.
** Copyright (c) 2018-2019 by the authors listed in the file LICENSE
** and their institutional affiliations.... | |
from hashlib import sha256
from sys import version_info as pyVersion
from binascii import hexlify, unhexlify
import pickle
if pyVersion.major == 3:
# py3 constants and conversion functions
xrange = range
stringTypes = (str,)
intTypes = (int, float)
def toString(string):
return string.decode("latin-1")
d... | |
import sys
import urllib
import base64
import json
import time
from contextlib import closing
import urllib.request
import urllib.parse
import urllib.error
GP_JOB_TAG = 'GenePattern Python Client'
class GPServer(object):
"""
Wrapper for data needed to make server calls.
Wraps the server url, username and passwo... | |
# MINLP written by GAMS Convert at 04/21/18 13:54:29
#
# Equation counts
# Total E G L N X C B
# 1053 45 224 784 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc si
# Total cont binary integer sos1 sos2 scont sint
# 421 261 160 0 0 0 0 0
# FX 0 0 0 0 0 0 0 0
#
# Nonzero counts
# Total const NL DLL
# 2581 2525 56 0
#
... | |
from __future__ import annotations
import hashlib
import logging
import os
import re
import socket
import threading
import typing
from asyncio import Event
from asyncio import PriorityQueue
from asyncio import create_task
from asyncio import get_event_loop
from asyncio import iscoroutinefunction
from functools import ... | |
*FindPal__13PalCollectionUsUsi(struct PalCollection *this, unsigned short SourceClut, unsigned short PixVal, int NumOfCols)")
del_items(0x8008E0DC)
SetType(0x8008E0DC, "struct PalEntry *NewPal__13PalCollectionUsUsi(struct PalCollection *this, unsigned short SourceClut, unsigned short PixVal, int NumOfCols)")
del_items(... | |
<gh_stars>0
# Importing
from tkinter import *
from threading import Thread
import time
import random
import winsound
# Making the main program "root"
root = Tk()
# Telling all the armor text labels that they are in fact text labels
label_knife_amount_text = StringVar()
label_kps_text = StringVar()
label_... | |
than 0.")
to_delete = versions[:-n]
if days is not None:
if days <= 0:
raise ValueError("Argument days is {days}, but must be greater than 0.")
date_cutoff = datetime.today() - timedelta(days=days)
to_delete = [v for v in versions if v.created < date_cutoff]
# message user about deletions ----
# TODO(questio... | |
<reponame>zfang-slim/PysitForPython3<gh_stars>0
import sys
import time
import copy
import numpy as np
import scipy.io as sio
__all__=['OptimizationBase']
__docformat__ = "restructuredtext en"
class OptimizationBase(object):
""" Base class for descent-like optimization routines.
These are stateful algorithms. ... | |
<reponame>xida2020/scikit-fem
from unittest import TestCase
from pathlib import Path
import numpy as np
import pytest
from scipy.spatial import Delaunay
from numpy.testing import assert_array_equal, assert_almost_equal
from skfem.mesh import (Mesh, MeshHex, MeshLine, MeshQuad, MeshTet, MeshTri,
MeshTri2, MeshQuad2, ... | |
<reponame>wbiker/rules_dotnet
load("@io_bazel_rules_dotnet//dotnet/private:rules/nuget.bzl", "nuget_package")
def dotnet_repositories_nuget():
### Generated by the tool
nuget_package(
name = "microsoft.netcore.platforms",
package = "microsoft.netcore.platforms",
version = "1.1.0",
sha256 = "15e338d24b5c39b409938... | |
+','+ sampled_normals[i,0] +','+ sampled_normals[i,1] +','+ sampled_normals[i,2] + '\n')
# sample points for bigger polygons
step = 1
indices = np.linspace(0,numFaces-1,numFaces, dtype = int)
bool_indices = area>(i*area_step_width)
while np.any(bool_indices):
indices = indices[bool_indices]
numPts = len(indic... | |
type(edlist) == 'ndarray':
edlist = edlist.tolist()
elif type(edlist) == int:
edlist = [edlist]
# printndlist
nx.draw_networkx_nodes(
self.Gs, self.Gs.pos, node_size=size, nodelist=edlist)
if dlabels:
dicopos = {}
dicolab = {}
for n in ndlist:
# dicopos[n]=tuple(np.array(self.Gs.pos[n])+np.array((0.8,0.2)))... | |
"""
uri_params = {}
if new_revision:
uri_params['new-revision'] = 'true'
if update_metadata and media is None:
uri = atom.http_core.parse_uri(entry.GetEditLink().href)
uri.query.update(uri_params)
return super(DocsClient, self).update(entry, **kwargs)
else:
uploader = gdata.client.ResumableUploader(
self, m... | |
{
result = arguments[2];
}
if (result === null) {
pos = 1;
result = list[0];
}
for(i=pos;i<list.length;i++) {
result = fn(result,list[i]);
}
return result;
}
$pj.zip = function() {
if (arguments.length === 0) {
return [];
}
var results = [];
var pos = -1;
var i = 0;
var cont = true;
while(cont... | |
4:
conLine.move_line(temp[X]+5,temp[Y]+5)
self.param4Con.pos = tuple(temp)
#**********************************Connector 5
temp = list(self.param5Con.pos)
if moveX:
temp[X] = touch.pos[0] + 45
if moveY:
temp[Y] = touch.pos[1] + 0
for conLine in self.conLines: #move connected lines
if conLine.start_block == s... | |
counts)
progressbar = vaex.utils.progressbars(progress)
limits = self.limits(binby, limits, delay=True, shape=shape)
stats = [self._first_calculation(expression, order_expression, binby=binby, limits=limits, shape=shape, selection=selection, edges=edges, progressbar=progressbar) for expression in expressions]
var =... | |
None.
nfev (int):
Number of evaluations of the right-hand side.
njev (int):
Number of evaluations of the jacobian.
nlu (int):
Number of LU decomposition.
status (int):
Reason for algorithm termination:
- -1: Integration step failed.
- 0: The solver successfully reached the end of `tspan`.
- 1: A termination ... | |
import argparse
import collections
import inspect
import re
import os
import signal
import sys
from datetime import datetime as dt
import pickle
import nltk
import traceback
from copy import deepcopy as deepcopy
import numpy as np
import unidecode as unidecode
from IPython import embed
import torch
from functools imp... | |
_build(self, obj, stream, context, path):
stream2 = io.BytesIO()
buildret = self.subcon._build(obj, stream2, context, path)
data = stream2.getvalue()
data = self._encode(data, context, path)
stream_write(stream, data)
return obj
def _sizeof(self, context, path):
raise SizeofError
def _decode(self, data, cont... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.