input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>lib/kb_JobStats/core/UJS_CAT_NJS_DataUtils.py
import time
import datetime
import dateutil.parser
import pytz
import json
import os
import re
import copy
import uuid
import shutil
import sys
from pprint import pprint, pformat
from urllib2 import Request, urlopen
from urllib2 import URLError, HTTPError
import u... | |
m.x474 - m.x478 - m.x482 - m.x486 == 0)
m.e831 = Constraint(expr= m.x95 - m.x475 - m.x479 - m.x483 - m.x487 == 0)
m.e832 = Constraint(expr= m.x96 - m.x476 - m.x480 - m.x484 - m.x488 == 0)
m.e833 = Constraint(expr= m.x121 - m.x505 - m.x509 - m.x513 - m.x517 == 0)
m.e834 = Constraint(expr= m.x122 - m.x506 - m.x510 - m.x5... | |
<reponame>Brym-Gyimah/mmdetection
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import pytest
import torch
from mmdet.core import BitmapMasks, PolygonMasks
def dummy_raw_bitmap_masks(size):
"""
Args:
size (tuple): expected shape of dummy masks, (H, W) or (N, H, W)
Return:
ndarray: dummy ma... | |
m, max(n - m, 0), -1):
fact_mpn_div_fact_mmn *= i
return 2.0/(2*n + 1)*fact_mpn_div_fact_mmn
def Get_Int_Pm2muPmnu(m, mu, nu):
if m + 2 > mu or m > nu:
return 0
if mu < nu:
return 0.0
elif mu == nu:
fact_div = 1.0
for i in range(nu + m, max(nu - m - 2, 0), -1):
fact_div *= i
return -2.0/(2.0*nu + 1)*fact_d... | |
9.22],
'Split 1_Peptide 2': [9.3, 5.03, 0.379, 0.517],
'Split 1_Peptide 1': [9.81, 4.37, 1.0, 3.4],
'Split 1_Peptide 3': [5.42, 9.75, 9.19, 8.33]}, dtype=object),
'Analyte X': pd.DataFrame({'Plate': ['tests/Test_plates/Test_plate_16.xlsx'],
'Analyte': ['Analyte X'],
'Split 1_Peptide 4': [4.32],
'Split 1_Peptide ... | |
self.hostname)
else:
output = self.send_command_timing(
"copy sftp startup-config " + sftp_server_ip + " " + filename
)
output += self.send_command_timing("y")
output += self.send_command_timing("\n")
print("Rebooting ", self.hostname)
def sftp_load_firmware(
self,
sftp_server_ip,
filename,
boot_image,
us... | |
"""
Module that contains the ChunkGrid class
"""
import functools
import operator
from typing import (
Any,
Callable,
Generic,
Iterable,
Iterator,
List,
Optional,
Sequence,
Set,
Tuple,
Type,
TypeVar,
overload,
SupportsAbs,
)
import numpy as np
import numpy.typing as npt
from voxly.iterators import Slic... | |
from numpy import array
def ldfesadictionary():
return ({1: array([[ 0.2097691065 , 0.2097691065 , 0.9549836878 ,
0.339836909477261],
[ 0.9549836878 , 0.2097691065 , 0.2097691065 ,
0.339836909477261],
[ 0.2097691065 , 0.9549836878 , 0.2097691065 ,
0.339836909477261],
[ 0.5773502692 , 0.5773502692 , 0.5773502692 ... | |
<gh_stars>0
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Restaurant20to50, obj[7]: Direction_same, obj[8]: Distance
# {"feature": "Coupon", "instances": 8147, "metric_value": 0.9848, "depth": 1}
if obj[2]>1:
# {"feature": "Dista... | |
<filename>wigpy/wig.py
import multiprocessing as mp
import os
import pdb
from collections import OrderedDict, defaultdict
from datetime import datetime
from functools import partial
from operator import itemgetter
import numpy as np
import pandas as pd
import spacy
import torch
from gensim.models import Word2Vec
# fro... | |
<filename>coddiwomple/openmm/propagators.py
"""
OpenMM Propagator Adapter Module
"""
#####Imports#####
from coddiwomple.propagators import Propagator
from openmmtools.mcmc import BaseIntegratorMove
from simtk import unit
import simtk.openmm as openmm
import os
import numpy as np
import logging
from copy import deepcop... | |
convertors=convertors),
dumps(value, encoding, beautiful, ind, convertors=convertors)))
if i<len(a.items())-1:
if beautiful:
s.append(',\n')
# s.append(indent_char * indent)
else:
s.append(', ')
if beautiful:
s.append('\n')
s.append(indent_char*indent)
s.append('}')
elif isinstance(a, str):
t = a
for i in... | |
v._pos._x, v._pos._y
if ( Pos ( x, y ) ):
return self._mat [ x ][ y ]
else:
return None
def __setitem__ ( self, v, val ):
if ( isinstance ( v, Pos ) ):
x, y = v._x, v._y
if ( isinstance ( v, tuple ) ):
x, y = v
if ( isinstance ( v, Piece ) ):
x, y = v._pos._x, v._pos._y
if ( Pos ( x, y ) ... | |
<reponame>roadnarrows-robotics/rnr-sdk<filename>Fusion/modules/Fusion/Gui/GuiXYGraph.py
################################################################################
#
# GuiXYGraph.py
#
""" Graphical User Interface X-Y Graph Module.
Graphical User Interface (GUI) Tkinter simple x-y graphing module.
Author: <NAME>... | |
que un\n" \
"valor muy alto (autolimitado) tomaría a\n" \
"todo el bache (entreno sin mini-baches)."
elif id == 40: # entreno - SGD - alfa
res = "Digite valor de parámetro encargado de la\n" \
"modificación de los pesos sinápticos en\n" \
"cada paso (alfa), obedece a la ecuación\n" \
"para cada peso:\n\n"... | |
<reponame>Algorithmic-Alignment-Lab/openTAMP<gh_stars>1-10
from opentamp.core.util_classes.common_predicates import ExprPredicate
from opentamp.core.util_classes.openrave_body import OpenRAVEBody
import opentamp.core.util_classes.transform_utils as T
import opentamp.core.util_classes.common_constants as const
from open... | |
'builtins.object':
return
# Plausibly the method could have too few arguments, which would result
# in an error elsewhere.
if len(typ.arg_types) <= 2:
# TODO check self argument kind
# Check for the issue described above.
arg_type = typ.arg_types[1]
other_method = nodes.normal_from_reverse_op[method]
if isins... | |
'r') as f:
for idx, image_id in enumerate(df_test.ImageId.tolist()):
im = np.array(f.get_node('/' + image_id))
im = np.swapaxes(im, 0, 2)
im = np.swapaxes(im, 1, 2)
X_val.append(im)
X_val = np.array(X_val)
y_val = []
fn_mask = FMT_VALTEST_MASK_STORE.format(prefix)
with tb.open_file(fn_mask, 'r') as f:
for id... | |
'''
Base driver class
'''
import pandas as pd
import requests
import json
from copy import deepcopy
import pyperclip
import math
import re
import inspect
import yaml
import itertools
from datetime import datetime
import warnings
import functools
from textwrap import dedent
from datapungi_fed import generalSettings #N... | |
import math
import re
from collections import Counter, OrderedDict, defaultdict
from enum import IntEnum
from fractions import Fraction
from itertools import groupby, combinations, permutations
from numbers import Real
from typing import FrozenSet
from typing import Iterable, Tuple, List, Dict, TypeVar, Optional, Set, ... | |
import math
import mxnet as mx
from mxnext.tvm.decode_bbox import decode_bbox
def _bbox_encode(F, ex_rois, gt_rois, means=[0., 0., 0., 0.], stds=[1., 1., 1., 1.]):
""" decode bbox
inputs:
F: symbol or ndarray
ex_rois: F, (#img, ..., 4)
gt_rois: F, (#img, ..., 4)
means: list, (4,)
stds: list, (4,)
outputs:
ta... | |
<gh_stars>1-10
#! /usr/bin/env python3
#
# Copyright 2020 California Institute of Technology
#
# 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
#
#... | |
<reponame>CarycaKatarzyna/pytest<filename>src/_pytest/config/__init__.py
""" command line options, ini-file and conftest.py processing. """
import argparse
import copy
import enum
import inspect
import os
import shlex
import sys
import types
import warnings
from functools import lru_cache
from types import TracebackTyp... | |
XML control characters,
# and semicolon for good measure (as the closer for escaped characters)
index += 1
else:
break
if index == 127:
print('PTX:WARNING: Could not find delimiter for verbatim expression')
return '!Could not find delimiter for verbatim expression.!'
else:
response_text += item.replace(origina... | |
which means the docs have to be written that way.
# Maybe someday in the future it should be expanded to handle
# @see foo(), bar(), etc., but I don't have time right now to do it.
docstring = re.sub('(@see\s+)([\w:.]+)\(', r'\1#\2(', docstring)
# Remove the '*' character that Javadoc doesn't want to see in @see'... | |
<gh_stars>1-10
import base64
import datetime
import logging
import json
import os
import time
import uuid
import typing
import semver
import aiohttp
from asyncio import shield
from marshmallow.exceptions import ValidationError
from aries_cloudagent.config.injection_context import InjectionContext
from aries_cloudage... | |
:param Type: 触发器类型,目前支持 cos 、cmq、 timer、 ckafka、apigw类型
:type Type: str
:param TriggerDesc: 触发器对应的参数,可见具体[触发器描述说明](https://cloud.tencent.com/document/product/583/39901)
:type TriggerDesc: str
:param Namespace: 函数的命名空间
:type Namespace: str
:param Qualifier: 函数的版本
:type Qualifier: str
:param Enable: 触发器的初始是能状态 OP... | |
"""Master which prepares work for all workers.
Evaluation of competition is split into work pieces. One work piece is a
either evaluation of an attack on a batch of images or evaluation of a
defense on a batch of adversarial images.
Work pieces are run by workers. Master prepares work pieces for workers and
writes the... | |
<reponame>macetheace96/metalearn
""" Contains unit tests for the Metafeatures class. """
import inspect
import json
import jsonschema
import math
import os
import random
import time
import unittest
import pandas as pd
import numpy as np
from metalearn import Metafeatures
from test.config import CORRECTNESS_SEED, META... | |
body = self[BODY_INDEX]
if body is None:
return
target = body[BODY_TARGET_INDEX]
if target is None:
return
if isinstance(target, PostureSpecVariable):
return target.name
elif target.is_part:
return target.part_owner
return target
@property
def _body_target_with_part(self):
body = self[BODY_INDEX]
if body... | |
<gh_stars>1-10
from copy import deepcopy
from time import time, strftime, sleep
from threading import Thread
from math import floor
class Node(object):
def __init__(self, data, next=None, previous=None):
self.data = data
self.next = next
self.previous = previous
def set_next(self, next):
self.next = next
def... | |
#!/usr/bin/env python
# coding: utf-8
"""
This script has to be executed after hi_freq_data_to_csv.py and get_interval.py have succesfully run.
This script should be called with 1 (or 2) arguments.
The 1st mandatory argument is the ABSOLUTE path of the top directory for the flight campaign.
/media/spectors/HDD32... | |
not None and len(user_ids) > 100:
raise ValueError('user_ids can only be 100 entries long')
param = {
'broadcaster_id': broadcaster_id,
'user_id': user_ids,
'after': after,
'first': first
}
url = build_url(TWITCH_API_BASE_URL + 'moderation/moderators/events', param, remove_none=True, split_lists=True)
result =... | |
to be priced.
expiries: A real `Tensor` of same dtype and compatible shape as
`volatilities`. The expiry of each option. The units should be such that
`expiry * volatility**2` is dimensionless.
spots: A real `Tensor` of any shape that broadcasts to the shape of the
`volatilities`. The current spot price of the und... | |
val in r]
for r in row_info])
return design
def _get_design(self, num_grobs=None):
"""
create a design matrix if not explicit design has been provided
"""
if self.__design is not None:
return self.__design
if num_grobs is None:
if self.num_grobs is None:
raise ValueError("unclear number of grobs in layou... | |
"""
# ensure it doesn't exist
self.assertNotIn(self.module_key, self.loader)
self.update_module()
self.assertNotIn("{}.test_alias".format(self.module_name), self.loader)
self.assertTrue(
inspect.isfunction(self.loader["{}.working_alias".format(self.module_name)])
)
@slowTest
def test_clear(self):
self.asser... | |
<gh_stars>0
import pytest
import hls4ml
import tensorflow as tf
import numpy as np
from tensorflow.keras import optimizers
from tensorflow.keras.layers import Input, Dense, Activation, Conv1D, Conv2D, \
Reshape, ELU, LeakyReLU, ThresholdedReLU, \
PReLU, BatchNormalization, Add, Subtract, \
Multiply, Average, Maximu... | |
for p,s in selected_prefix_var}]
selected_vars.value = new_selection
# print(f"{new_selection=}{current_suffix=}{g['old']=}")
else:
selected_vars.value = [selected_prefix_var[0][1]]
if len(prefix_dict):
selected_prefix = SelectMultiple(value=[select_prefix[0][1]], options=select_prefix,
layout=Layout(wid... | |
<filename>aioheos/aioheoscontroller.py
#!/usr/bin/env python3
"""Heos python lib."""
import asyncio
import json
import logging
from concurrent.futures import CancelledError
from . import aioheosgroup
from . import aioheosplayer
from . import aioheosupnp
_LOGGER = logging.getLogger(__name__)
HEOS_PORT = 1255
GET_PL... | |
found in the"
print self.keyerror[e]
continue
# if there exist a startmarker in the wdef resolve to id
if wdef.startmarker != None:
try:
startid = self.data_client.markerids[wdef.startmarker]
except KeyError, e:
e=str(e)
if not self.keyerror.has_key(e):
self.keyerror[e]=wdef
print
print "windowdef warning:... | |
"""This module contains all the classes relating to Checks."""
from json import dumps
from . import decorators
from . import models
class CheckPullRequest(models.GitHubCore):
"""Representation of a Pull Request returned in Checks APIs.
.. versionadded:: 1.3.0
.. note::
Refreshing this object returns a :class:... | |
<reponame>Umlamulankunzi/Zim_ID_Codes<filename>main.py
"""Main Script of Zim Code Application
Main module script imports relevant modules and launches the
application
"""
import os
import difflib
from tkinter import *
from tkinter import ttk, messagebox
import database_init
__author__ = "<NAME> (<NAME>)"
__copyri... | |
import ROOT as root
import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
from uncertainties.unumpy import nominal_values as noms
from uncertainties.unumpy import std_devs as stds
from array import array
import sys
############### Readout command line argument
try:
name_of_folder = s... | |
<filename>ino/commands/build.py
# -*- coding: utf-8; -*-
import re
import os.path
import inspect
import subprocess
import platform
import jinja2
import shlex
from jinja2.runtime import StrictUndefined
import ino.filters
from ino.commands.base import Command
from ino.environment import Version
from ino.filters impor... | |
#
# ENVISIoN
#
# Copyright (c) 2017-2021 <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# <NAME>, <NAME>, <NAME>, <NAME>,
# <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... | |
params.get('hideLegend', len(self.data) > 10):
elements = []
hideNull = params.get('hideNullFromLegend', False)
for series in self.data:
if series.name:
if not(hideNull and all(v is None for v in list(series))):
elements.append((
unquote_plus(series.name),
series.color,
series.options.get('secondYAxis')))
if ... | |
except StopIteration:
tst.assertEqual(0, i)
else:
tst.assertEqual("(Unavailable because no Python graph has been loaded)",
next(line_iter))
def check_syntax_error_output(tst, out, command_prefix):
"""Check RichTextLines output for valid command prefix but invalid syntax."""
tst.assertEqual([
"Syntax error for... | |
search).splitlines()
# Find the Server Entry for the given name and list the ports
for entry in entries:
if entry.startswith(name + "("):
namedEndPoints = AdminConfig.list("NamedEndPoint", entry).splitlines()
for namedEndPoint in namedEndPoints:
endPoint = AdminConfig.showAttribute(namedEndPoint, "endPoint" )
... | |
dim but when multiple clusters are being
binned it will be 2 dim.
In that case np.apply_along_axis functionality is applied.
The spike weights in that case might be created like so:
>>> spk_W = np.zeros(shape=[len(trial.nClusters), trial.npos])
>>> for i, cluster in enumerate(trial.clusters):
>>> x1 = trial.get... | |
<filename>apps/challenges/forms.py
from datetime import datetime
from django import forms
from django.db.models import Q
from django.forms import widgets
from django.forms.formsets import BaseFormSet
from django.forms.models import inlineformset_factory, ModelChoiceField, BaseInlineFormSet
from django.forms.util impor... | |
busy; %i/%i jobs complete\r" %
(time.ctime(), nbusy, (WQ.stats.total_workers_joined - WQ.stats.total_workers_removed),
WQ.stats.total_tasks_complete, WQ.stats.total_tasks_dispatched), newline=False)
if time.time() - wq_reactor.t0 > newline_time:
wq_reactor.t0 = time.time()
logger.info('')
if task:
exectime = tas... | |
<reponame>ipashchenko/jetsim
import math
import numpy as np
mas_to_rad = 4.8481368 * 1E-09
rad_to_mas = 1. / mas_to_rad
# Parsec [cm]
pc = 3.0857 * 10 ** 18
# Mass of electron [g]
m_e = 9.109382 * 10 ** (-28)
# Mass of proton [g]
m_p = 1.672621 * 10 ** (-24)
# Charge of electron [C]
q_e = 1.602176 * 10 ** (-19)
# Ch... | |
<reponame>kiranmusze/deutschland<filename>deutschland/jobsuche/model/job_search_response_aggregierungen_plzebene2.py<gh_stars>0
"""
Bundesagentur für Arbeit: Jobsuche API
Die größte Stellendatenbank Deutschlands durchsuchen, Details zu Stellenanzeigen und Informationen über Arbeitgeber abrufen. <br><br> Die Authenti... | |
<reponame>hellojoko/autoparse<filename>autoparse/automaton_fitter.py
import networkx as nx
import matplotlib.pyplot as plt
from autoparse.automaton import preprocess, Automaton
class Transition:
def __init__(
self,
word: str,
state_in,
state_out,
transition_ids=[],
weight: int = 1,
variables={},
):
self.wo... | |
import sys, os
import re
import math
import datetime as dt
import numpy as np
from scipy import stats
import urepr
from loguniform import LogUniform, ModifiedLogUniform
from kumaraswamy import kumaraswamy
# CONSTANTS
mjup2mearth = 317.8284065946748 # 1 Mjup in Mearth
template_setup = """
[kima]
GP: false
GP_kerne... | |
<reponame>sidorenkom/specter-diy<filename>src/apps/wallets/manager.py
from app import BaseApp
from gui.screens import Menu, InputScreen, Prompt, TransactionScreen
from .screens import WalletScreen, ConfirmWalletScreen
import platform
import os
from binascii import hexlify, unhexlify, a2b_base64
from bitcoin import scr... | |
from math import ceil
from pathlib import Path
import random
import numpy as np
import pandas as pd
def _samples_per_set_size(split, n_samples, n_set_sizes):
"""evenly divide samples for dataset split across visual search set sizes"""
# below, divide by two for target present / absent
samples_per_set_size = (n_sa... | |
<gh_stars>0
#author: <NAME>
#guid: 2210049p
#!/usr/bin/env python
#coding: utf-8
#
# In[1]
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import norm
from scipy.stats import stats
import math
import random
from matplotlib import pyplot as ... | |
"""Used by the CLI or any UI to deliver services to our lovely users
"""
from functools import wraps
import logging
from dodola.core import (
apply_bias_correction,
build_xesmf_weights_file,
xesmf_regrid,
standardize_gcm,
xclim_remove_leapdays,
apply_downscaling,
apply_wet_day_frequency_correction,
train_quanti... | |
3)
trans_num = N.array([-1,-1,-1])
trans_den = N.array([2,2,2])
transformations.append((rot, trans_num, trans_den))
rot = N.array([0,1,0,1,0,0,0,0,1])
rot.shape = (3, 3)
trans_num = N.array([-1,-1,-1])
trans_den = N.array([2,2,2])
transformations.append((rot, trans_num, trans_den))
sg = SpaceGroup(135, 'P 42/m b c', tr... | |
snippetsAddSnippet(info, word, abbr)
completion['abbr'] = abbr
completion['menu'] = menu
completion['info'] = info
completion['dup'] = 1
# Replace the number that represents a specific kind with a better
# textual representation.
completion['kind'] = kinds[result.cursorKind]
return completion
class Complete... | |
return True
def stationCount(self):
return len(self.line.stations)
def clearLineStationInfo(self):
self.line.clear()
def stationExisted(self, name: str)->bool:
return self.line.stationExisted(name)
def addStationDict(self, info: dict):
self.line.stations.append(info)
def adjustLichengTo0(self):
if self.i... | |
on a node in the node pool.
name: The name of this resource. Node pool names are formatted as
`projects//locations//awsClusters//awsNodePools/`. For more details on
Google Cloud resource names, see [Resource
Names](https://cloud.google.com/apis/design/resource_names)
reconciling: Output only. If set, there are cur... | |
"""
Python Tests for the ETCD Model Base Class
MIT License
(C) Copyright [2020] Hewlett Packard Enterprise Development LP
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, inc... | |
the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)
# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)
# Done; return the response.
return response
async def updat... | |
import gym
from gym.utils import seeding
import numpy as np
import pybullet as pb
import pybullet_data
import os
import yaml
import time
import matplotlib.pyplot as plt
class AslaugBaseEnv(gym.Env):
metadata = {
'render.modes': ['human', 'rgb_array']
}
def __init__(self, version, params, gui=False, init_seed=None... | |
<filename>Cryptogram.py
import os
import colorama
from termcolor import colored
# Replaces letters in cryptogram and records if they should be considered changed or not
def replacer(old, new, changed=False, red=False):
print()
for i in range(len(cryptogram)):
# Ensures letters of only one category (change... | |
duration(self):
"""
Returns a ``string`` of the game's duration in the format 'H:MM'.
"""
return self._duration
@property
def time_of_day(self):
"""
Returns a ``string`` constant indicated whether the game was played
during the day or at night.
"""
if 'night' in self._time_of_day.lower():
return NIGHT
ret... | |
print('\nconfiguration file: %s\n' % fn)
f = open(fn, 'r')
s = f.read()
f.close()
return s
else:
print('\nconfiguration file not found: %s' % fn)
return ''
#@+node:ekr.20160317054700.130: *4* msf.init_parser
def init_parser(self, s):
'''Add double back-slashes to all patterns starting with '['.'''
if not s... | |
"item 14",
"item 15",
"item 16",
],
manager=default_ui_manager,
container=test_container,
allow_multi_select=True,
anchors={
"left": "left",
"right": "left",
"top": "top",
"bottom": "top",
},
)
selection_list.set_position((20, 20))
assert selection_list.relative_rect.topleft == (10, 10)
assert selectio... | |
- timedelta(minutes=5):
request.user.profile.Refiner_Illuminator_TagPostCounter += 1
request.user.profile.save()
TagBadge.objects.get_or_create(
awarded_to_user=request.user,
badge_type="BRONZE",
tag_name="Explainer",
bade_position="BADGE")
PrivRepNotification.objects.get_or_create(
for_user=request.user,
typ... | |
<gh_stars>0
from data_generation import *
from plots import *
from em import *
from sklearn.model_selection import train_test_split
import json
NUM_SAMPLES = 1000
NUM_COMPONENTS_M1 = 3
NUM_COMPONENTS_M2 = 4
NUM_COMPONENTS_M3 = 8
TexFigure.configure_plots()
tex_figure = TexFigure('./images')
def plot_and_save_data()... | |
GetCustomerHeaders(TeaModel):
def __init__(
self,
common_headers: Dict[str, str] = None,
x_acs_dingtalk_access_token: str = None,
):
self.common_headers = common_headers
self.x_acs_dingtalk_access_token = x_acs_dingtalk_access_token
def validate(self):
pass
def to_map(self):
_map = super().to_map()
if _ma... | |
helpful in ONE of the following case:
- UAC is disabled, account is admin OR SeCreateSymbolicLinkPrivilege was
manually granted.
- UAC is enabled, account is NOT admin AND SeCreateSymbolicLinkPrivilege was
manually granted.
If running Windows 10 and the following is true, then enable_symlink() is
unnecessary.
-... | |
[BMT__Hash__HPS]>]
>>> sorted (ET_Rat.children)
[]
>>> prepr (sorted (apt.etypes))
['BMT.Beaver', 'BMT.Location', 'BMT.Mouse', 'BMT.Otter', 'BMT.Person', 'BMT.Person_owns_Trap', 'BMT.Person_sets_Trap', 'BMT.Rat', 'BMT.Rodent', 'BMT.Rodent_in_Trap', 'BMT.Rodent_is_sick', 'BMT.Supertrap', 'BMT.Trap', 'MOM.An_Entity'... | |
states include waiting, flight, and memory
* **who_has**: ``{dep: {worker}}``
Workers that we believe have this data
* **has_what**: ``{worker: {deps}}``
The data that we care about that we think a worker has
* **pending_data_per_worker**: ``{worker: [dep]}``
The data on each worker that we still want, prioritize... | |
<filename>tests/test_edgeql_ddl.py
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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 ... | |
<reponame>mrtop/TiledMapReadWritePy
# coding:utf-8
# TMX library
# Copyright (c) 2016 wboy <<EMAIL>>
#
# 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/LICENS... | |
import os
import pandas as pd
import numpy as np
import datetime as dt
import sys
from datetime import datetime
import rasterio
import geopandas as gpd
pkg_dir = os.path.join(os.path.dirname(__file__),'..')
sys.path.insert(0, pkg_dir)
from ela.textproc import *
from ela.spatial import *
from ela.classification impor... | |
__setattr__(self, name, value):
self._perform_setattr(OcBgp.BgpRib.AfiSafiTable.Ipv4Unicast.OpenConfigNeighbors.OpenConfigNeighbor.AdjRibInPre.Routes.Route.ExtAttributesList.UnknownAttributes, ['attribute_type', 'attribute_length', 'attribute_value'], name, value)
@staticmethod
def _meta_info():
from ydk.models.ci... | |
from gfracture.functions import convert_geo_list_to_geoseries
from gfracture.functions import make_vertical_segments
from gfracture.functions import make_horizontal_segments
from gfracture.functions import make_polygon_from_tuple
import geopandas as gpd
import pandas as pd
import numpy as np
import matplotlib.pyplot as... | |
pnp.Vendor("Microcom", "MNP", datetime.date(1996, 11, 29)),
"MDX": pnp.Vendor("MicroDatec GmbH", "MDX", datetime.date(1999, 9, 13)),
"MRD": pnp.Vendor("MicroDisplay Corporation", "MRD", datetime.date(2007, 6, 14)),
"MDY": pnp.Vendor("Microdyne Inc", "MDY", datetime.date(1996, 12, 18)),
"MFG": pnp.Vendor("MicroField... | |
r"""*Direct expect-good API tests for* ``sphobjinv``.
``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.
**Author**
<NAME> (<EMAIL>)
**File Created**
20 Mar 2019
**Copyright**
\(c) <NAME> 2016-2020
**Source Repository**
http://www.github.com/bskinn/sphobjinv
**Documentat... | |
<reponame>DiffEqML/neurodiffeq<filename>neurodiffeq/monitors.py
import math
import torch
import warnings
import matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.tri as tri
import seaborn as sns
from abc import ABC, abstractmethod
from ._version_utils import deprecated... | |
#!/usr/bin/python
# Copyright (c) 2018 Cohesity Inc
# Apache License Version 2.0
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
import os
import shutil
import time
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_bytes... | |
<gh_stars>10-100
from numbers import Number
from pathlib import Path
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Set
from typing import Tuple
from typing import Union
import attr
import numpy as np
from attr.validators import in_
from attr.... | |
# TODO merge common tests and Natural Language ones
# default libraries
import os
# user interface
import tkinter as tk
from datetime import datetime
from tkinter import filedialog
from msvcrt import getch
import random
import numpy as np
from scipy.io.wavfile import read, write
from .ABC_weighting import a_weight
#... | |
<gh_stars>0
# Copyright 2014 Facebook, Inc.
# 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 notice,
# this list of conditions a... | |
rpushx(self, tr, key:NativeType, value:NativeType) -> int:
""" Append a value to a list, only if the list exists """
return self._query(tr, b'rpushx', self.encode_from_native(key), self.encode_from_native(value))
@_query_command
def llen(self, tr, key:NativeType) -> int:
""" Returns the length of the list stored ... | |
if depth5 else tmp4371)
tmp4369 = (tmp4099 if depth4 else tmp4370)
tmp4368 = (tmp4099 if depth3 else tmp4369)
tmp4367 = (tmp4099 if depth2 else tmp4368)
tmp4360 = (tmp4361 if depth1 else tmp4367)
tmp4378 = (tmp4073 if depth7 else tmp4104)
tmp4377 = (tmp4378 if depth6 else tmp4119)
tmp4376 = (tmp4377 if depth5 el... | |
import os
import platform
import subprocess
import warnings
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from urllib.parse import quote
import astropy, astropy.wcs, astropy.visualization
import astropy.io.fits as fits
import astropy.coordinates as coords
i... | |
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
import ctypes, enum
from qiling.os.macos.structs import POINTER64
base_event_normal = 0
class AutoNumberNormalEvent(enum.Enum):
def __new__(cls):
value = len(cls.__members__) + base_event_normal
obj = object._... | |
<filename>notebooks/__code/normalization/normalization_with_simplify_selection.py
import os
import collections
import numpy as np
from ipywidgets import widgets
from IPython.core.display import display, HTML
from enum import Enum
from NeuNorm.normalization import Normalization
from __code import file_handler
from __c... | |
def check_storage_configuration(self, cfgspec=None):
rsp = self.wc.grab_json_response(
'/api/function/raid_conf?params=raidlink_GetStatus')
if rsp['items'][0]['status'] != 2:
raise pygexc.TemporaryError('Storage configuration unavailable in '
'current state (try boot to setup or '
'an OS)')
if not cfgspec:
retu... | |
<reponame>JackKelly/neuralnilm_prototype
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer
from neuralnilm.net i... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 23:47:57 2021
@author: guo.1648
"""
# final version.
# referenced from NN_getDist_testCode_forBiggan.py and
# NN_getRepThreshPairImg_testCode_forBiggan.py.
# This code does the following:
# (1) generate a 32x32 sample sheet from images in dir ..... | |
"""
Gameplay aids for 'Attack Vector: Tactical'.
Functions:
avt.movement(vector_string)
Get 'pretty-formatted' string for movement grid.
avt.shellstar(
Vector_to_target,
crossing_Vector,
muzzle_velocity,
segment=0)
Generate seeker shellstar info.
Classes:
Vector
"""
from math import floor, pi, sin, sqrt
f... | |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -----------------------------------------------------------------------... | |
'Medford, OR'},
'1541988':{'en': 'Springfield, OR'},
'1541994':{'en': 'Lincoln City, OR'},
'1541995':{'en': 'Harrisburg, OR'},
'1541996':{'en': 'Lincoln City, OR'},
'1541997':{'en': 'Florence, OR'},
'1541998':{'en': 'Junction City, OR'},
'1548':{'en': 'Ontario'},
'1551':{'en': 'New Jersey'},
'1559':{'en': 'Cal... | |
import datetime
import pathlib
import pickle
from io import BytesIO
from unittest.mock import MagicMock, patch
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytest
import yaml
from sklearn.base import BaseEstimator, RegressorMixin
from sklearn.dummy import DummyClassifier
from sklearn.e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.