input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib import gridspec
import parmap
import numpy as np
import pandas as pd
import os
import shutil
import cv2
import scipy.io as sio
import scipy.signal
from Specgram.Specgram import Specgram
import glob2
f... | |
'1615446':{'en': 'Dickson, TN'},
'1615449':{'en': 'Lebanon, TN'},
'1615451':{'en': 'Gallatin, TN'},
'1615452':{'en': 'Gallatin, TN'},
'1615453':{'en': 'Lebanon, TN'},
'1615457':{'en': 'Nashville, TN'},
'1615459':{'en': 'Smyrna, TN'},
'1615460':{'en': 'Nashville, TN'},
'1615463':{'en': 'Nashville, TN'},
'161547... | |
<filename>backend-server/sensors/views.py
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User, Group
from sensors.models import Room, Device, DeviceData, Person, CameraRecord, SensorData, LocationData
import face_recognition
import datetime
from django.db.models.functions i... | |
<gh_stars>1-10
import pyecharts.options as opts
from pyecharts.charts import Line
"""
Gallery 使用 pyecharts 1.1.0
参考地址: https://echarts.baidu.com/examples/editor.html?c=line-aqi
目前无法实现的功能:
1、dataZoom 放大的时候无法固定 Y 轴的上下限
"""
all_data = [
["2000-06-05", 116],
["2000-06-06", 129],
["2000-06-07", 135],
["2000-06-08", ... | |
from cassandra.cluster import Cluster
from cassandra.protocol import NumpyProtocolHandler
from cassandra.auth import PlainTextAuthProvider
from dask.distributed import Client, LocalCluster
import copy
import dask
import dask.dataframe as dd
import logging
import pandas as pd
from sqlalchemy import sql
from sqlalchemy.s... | |
from collections import deque
import numpy as np
from typing import Tuple, Dict, Optional, Any, List
import logging
logger = logging.getLogger('sarbor')
Bounds = Tuple[np.ndarray, np.ndarray]
class Node:
"""
Basic Node datastructure, has basic getter and setter methods
"""
def __init__(self, **kwargs):
"""
n... | |
),
'plt_towlower':( 'int', None, 'cdecl', '*.towlower', (('int', None),) ),
'plt_towupper':( 'int', None, 'cdecl', '*.towupper', (('int', None),) ),
'plt_vdbgprintex':( 'int', None, 'stdcall', '*.vDbgPrintEx', (('int', None), ('int', None), ('int', None), ('int', None)) ),
'plt_vdbgprintexwithprefix':( 'int', None,... | |
<reponame>vvlink/TinyWebIO
__version__ = "TinyWebIO v0.0.8"
__author__ = "<EMAIL>"
__license__ = "http://unlicense.org"
import mpython, music, socket, network, json, gc
from ubinascii import hexlify
from time import time
from urequests import request
from machine import Timer, unique_id
class Request:
def __init__... | |
#!/usr/bin/python
import os
import sys
import copy
import logging
import subprocess
import argparse
import pprint
import shutil
from yggdrasil.constants import LANGUAGES, LANGUAGES_WITH_ALIASES
logger = logging.getLogger(__name__)
package_dir = os.path.dirname(os.path.abspath(__file__))
def githook():
r"""Git hook... | |
import sys
import random
import shutil
import copy
from math import ceil, floor
from os import path, remove, mkdir
from time import sleep
from tkinter import Tk
from tkinter.filedialog import askopenfilename
# the same folder where this program is stored
if getattr(sys, 'frozen', False):
mainFolder = path.dirname(sys... | |
import itertools
import logging
import math
import os
import sys
import time
import warnings
from multiprocessing import Pool
from numba import njit
from pytransit import QuadraticModel
import batman
import ellc
import numpy as np
import astropy.constants as ac
import astropy.units as u
import wotan
from lcbuilder.lcb... | |
# -*- coding: utf-8 -*-
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
# from mpl_toolkits.basemap import Basemap
import xarray as xr
import re
from collections import OrderedDict
from datetime import datetime, timedelta
from scipy.spatial import cKDTree, KDTree
f... | |
TrainingDataset):
"""
Verify that the provided train dataset is of the correct type
"""
pass
@abstractmethod
def _verify_inference_dataset_type(self, inference_dataset: InferenceDataset):
"""
Verify that the provided inference dataset is of the correct type
"""
pass
@abstractmethod
def _verify_predict_sam... | |
#!/user/bin/python
## load core library
import glob
import math
import numpy as np
import pandas as pd
### todo
## why not replace math with np: todo
## organize and split the file into smaller ones
## remove unwanted package
## load auxillary
#import csv
import gzip
#import matplotlib.pyplot as plt
#import matplotl... | |
#!/usr/bin/env python
'''Parse a C source file.
To use, subclass CParser and override its handle_* methods. Then instantiate
the class with a string to parse.
Derived from ANSI C grammar:
* Lexicon: http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
* Grammar: http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
Refe... | |
calculate the attacking loss
if (atype in ['FOA', 'SPFOA']) and (M is not None) and (M == 2):
# -- [orig] ranking attack, M=2
#== configuration for FOA:M=2
M_GT = 5 # sensible choice due to SOP dataset property
XI = float(os.getenv('SP', 10.)) # balancing the "SP" and "QA" component
if 'SP' not in atype:
XI = ... | |
= exhibit.sort_index()
# subtract the premium to get the actual capital
try:
for m in ['EL', 'VaR', 'TVaR', 'ScaledVaR', 'ScaledTVaR', 'EqRiskVaR', 'EqRiskTVaR', 'MerPer', 'coTVaR',
'EPD', 'ScaledEPD', 'EqRiskEPD', 'covar']:
# Q as computed above gives assets not equity...so adjust
# usual calculus: P = (L + ra)/... | |
#!/usr/bin/env python3
"""
Pings each possible IP address in a network to see what hosts are UP
"""
__author__ = "ScottishGuy95"
__license__ = "MIT"
import re
import subprocess
import platform
import ipaddress
import threading
from queue import Queue
import socket
import requests
import time
def get_host_ip():
"""... | |
newitem.update(itemdata, type=self.type.type, hideDeprecated=hideDeprecated, hideAliases=hideAliases, showHidden=showHidden, fieldFilters=fieldFilters):
self.children.append(newitem)
elif isinstance(self.type, das.schematypes.Tuple):
self.typestr = "tuple"
self.resizable = False
self.orderable = True
if self.exi... | |
'tan'
self.float31 = FloatText(value='15.12', step='1', style=style, layout=widget_layout)
units_btn = Button(description='1/min', disabled=True, layout=name_button_layout)
units_btn.style.button_color = 'tan'
row = [self.bool1, name_btn, self.float31, units_btn, ]
box31 = Box(children=row, layout=box_layout)
# ... | |
XXXX XX
XXXXX XXXXX XXXX XXXXXXXXXXXXX XXXX XXX XXXXXXX XXX XXXXXX XXXXXXX XXXX
XXXXXXXXXXXXX XXXXX XX XXXXXX XXXXXXXXX XXXXX XXXXXXXXXXXXXXX XXXXXXXXX XX
XXXXX XX XXX XXXXXXXXX XXXX XXXXXXXX XXXX XXXX XX XXXXXXXXX XX XXXX
XXXXXXXXXXXXX XXXX XXXX XXX XXXX XXXXXXXXXXXX
X XXXX XXXXXXXX XXXXXX XXXXX XX XXX XXXX XXXXXX XX... | |
runner.invoke(cli.cli, self.COMMAND_WITH_API_KEY)
get_patched.assert_called_once_with(self.URL,
headers=EXPECTED_HEADERS_WITH_CHANGED_API_KEY,
json=self.LIST_WITH_FILTER_REQUEST_JSON,
params=None)
assert result.output == self.DETAILS_STDOUT
@mock.patch("gradient.api_sdk.clients.http_client.requests.get")
def t... | |
"Озаску"
},
"OSLO": {
"de_DE": "Oslo",
"es_ES": "Oslo",
"fr_FR": "Oslo",
"it_IT": "Oslo",
"ja_JP": "オスロ",
"ko_KR": "오슬로",
"pl_PL": "Oslo",
"pt_BR": "Oslo",
"ru_RU": "Осло"
},
"OSTERSUND": {
"de_DE": "Östersund",
"es_ES": "Östersund",
"fr_FR": "Östersund",
"it_IT": "Östersund",
"ja_JP": "エステルスンド",
"ko... | |
update=update_renderpath)
rp_greasepencil = BoolProperty(name="Grease Pencil", description="Render Grease Pencil data", default=False, update=update_renderpath)
rp_ocean = BoolProperty(name="Ocean", description="Ocean pass", default=False, update=update_renderpath)
rp_gi = EnumProperty(
items=[('Off', 'Off', 'Off... | |
"001F0E": "Japan Kyastem Co., Ltd",
"001F0F": "Select Engineered Systems",
"001F10": "TOLEDO DO BRASIL INDUSTRIA DE BALANCAS LTDA",
"001F11": "OPENMOKO, INC.",
"001F12": "Juniper Networks",
"001F13": "S.& A.S. Ltd.",
"001F14": "NexG",
"001F15": "Bioscrypt Inc",
"001F16": "Wistron Corporation",
"001F17... | |
import discord
import re
import csv
import random
import os
import datetime
from operator import itemgetter, attrgetter
from .utils import chat_formatting as chat
from .utils.dataIO import dataIO
from cogs.utils import checks
from discord.ext import commands
from . import hook as hook
class MCOCTools:
'''Tools for Ma... | |
from functools import reduce
from typing import List, Tuple, Any, Dict, Optional
from copy import deepcopy
from time import time
from tqdm import tqdm
from torch.utils.tensorboard import SummaryWriter
import numpy as np
import gym
import regym
from regym.rl_algorithms.agents import Agent
from regym.environments.tasks... | |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian
from a2c_ppo_acktr.utils import init
class Flatten(nn.Module):
def forward(self, x):
return x.view(x.size(0), -1)
class Policy(nn.Module):
def __init... | |
import csv
import time
from datetime import timedelta
from decimal import Decimal
from io import BytesIO, StringIO
import tracker.models.fields
from django.contrib import messages
from django.contrib.admin import register
from django.contrib.auth import models as auth
from django.contrib.auth.decorators import permiss... | |
transform the test documents (ignore unknown words)
features_test = vectorizer.transform(words_test).toarray()
# NOTE: Remember to convert the features using .toarray() for a compact representation
# Write to cache file for future runs (store vocabulary as well)
if cache_file is not None:
vocabulary = vectoriz... | |
<gh_stars>0
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils.functional import cached_property
from django.utils.translation import gettext as _
from django_countries.serializers import CountryFieldMixin
from hierarkey.proxy import H... | |
<reponame>gbacco5/fluid
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 5 21:49:54 2018
@author: Giacomo
"""
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
# I define a dummy class for Matlab structure like objects
class structtype():
pass
def psi_fluid(rho,xi,rho0):
return (rho**2 - r... | |
from logisimpy.circuit import Circuit, Wire
from logisimpy.logic import AND, AND3, NOT, OR
class MUX2x1(Circuit):
"""
2x1 Multiplexer logic.
The MUX element has two data inputs, one select input and one data output.
If the select input is 0, the data from the first input is transfered
to the output. Otherwise t... | |
<reponame>Arnukk/FP_RFP_LH<gh_stars>1-10
# vim:fileencoding=utf8
#
# Project: Implementation of the Lemke-Howson algorithm for finding MNE
# Author: <NAME> <<EMAIL>>, 2009
#
"""This module contains a Lemke-Howson algorithm implementation
and various functions that are used in that algorithm.
"""
import matrix
import... | |
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit import prompt
import networkx as nx
import sys
import os
import re
from configurator import Configuration
from configurator import PREFIX_COMMAND_HANDLER, EXIT_COMMANDS, SINGLE_WORD_COMMAN... | |
#from numba import jit
from typing import List, Dict
from skdecide.builders.discrete_optimization.generic_tools.mip.pymip_tools import MyModelMilp
from skdecide.builders.discrete_optimization.vrp.vrp_toolbox import length
import networkx as nx
import os
import random
this_path = os.path.dirname(os.path.abspath(__file_... | |
networks: An array of one or more networks to attach to the
instance. The network object structure is documented below. Changing this
creates a new server.
:param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['InstancePersonalityArgs']]]] personalities: Customize the personality of an instance by
defining one... | |
<gh_stars>1000+
#!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# 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 applicabl... | |
#
# Copyright (c) 2017 Intel Corporation
# SPDX-License-Identifier: BSD-2-Clause
#
"""
This module transforms data-parallel operations such as Numpy calls into
'Parfor' nodes, which are nested loops that can be parallelized.
It also implements optimizations such as loop fusion, and extends the rest of
compiler analysi... | |
'''
From <NAME>
No particular license or rights, you can change it as you feel, just be honest. :)
For python puritain, sorry if this script is not "pythonic".
Significant changes made by <NAME>, August 23, 2020
'''
'''
This script picks up the magnitudes and the spectral type from Simbad website.
*How to use it:
*... | |
boundary_to_smoothing_ratio,
extract_box = extract_box)
def extract_all_maps_around_unique(self,
resolution = None,
solvent_content = None,
sequence = None,
molecular_mass = None,
soft_mask = True,
chain_type = 'PROTEIN',
box_cushion = 5,
target_ncs_au_model = None,
regions_to_keep = None,
keep_low_density... | |
# Copyright (c) 2019-2022 ThatRedKite and contributors
import math
from math import log10, sqrt
import matplotlib.pyplot as plt
from io import BytesIO
import discord
import discord.commands as scmd
from discord.ext import commands
import si_prefix
from random import randint
from thatkitebot.backend import util
from t... | |
(t_points - osp['origin']) / osp['spacing']
# t_border_points_inside = ~np.any([(t_points_pix < 0) ^ ((t_points_pix - osp['size']) > 0)], axis=(0, 2))
# print(iview, 'heyho')
# import pdb;
# pdb.set_trace()
# if all borders inside it could be that the border is close to the edge,
# meaning it has to be consider... | |
setWikiWordAsRoot(self, word):
if not self.requireReadAccess():
return
try:
if word is not None and \
self.getWikiDocument().isDefinedWikiLinkTerm(word):
self.tree.setRootByWord(word)
self.tree.expandRoot()
self.getConfig().set("main", "tree_last_root_wiki_word", word)
except (IOError, OSError, DbAc... | |
"""CFNgin config."""
import copy
import logging
import sys
import warnings
from io import StringIO
from string import Template
import yaml
from schematics import Model
from schematics.exceptions import BaseError as SchematicsError
from schematics.exceptions import UndefinedValueError, ValidationError
from schematics.t... | |
<filename>ooipy/tools/ooiplotlib.py
"""
This modules provides functions for plotting spectrograms and power
spectral density estimates. It extends the matplotlib.pyplot.plot
function.
"""
# Import all dependancies
import datetime
import matplotlib
import matplotlib.dates as mdates
import numpy as np
from matplotlib i... | |
from solution import Solution
class Board:
def __init__(self, rows_):
self.rows_ = rows_
self.draws = []
self.all = self.rows + self.columns
self.won = False
@property
def rows(self):
return self.rows_
@property
def columns(self):
return [list(col) for col in zip(*self.rows_)]
def draw(self, draw):
se... | |
set_resolution(self, resolution):
"""
"""
#TODO verify resolution
self._resolution = resolution
resolution = property(get_resolution, set_resolution)
@classmethod
def from_MIDI_track(cls, meta_track):
"""
Extracts the meta information from a midi track
"""
info = cls()
for e in meta_track:
if isinst... | |
257.9, 271.5, 253.3, 270.8, 273.7, 270.7, 280.3],
[270.4, 262.5, 272.5, 268.6, 282.5, 254.3, 272.1, 280.2],
],
[
[274.4, 290.9, 276.8, 267.3, 274.7, 289.6, 267.5, 292.8],
[260.7, 281.5, 264.6, 272.4, 259.0, 274.3, 279.7, 272.6],
[273.2, 262.4, 269.2, 280.0, 275.7, 270.5, 286.6, 293.1],
[267.2, 277.4, 274.5, 274.... | |
> cajasH[cc, :], cajasH[c, :], cajasH[cc, :])
nuevasL = np.where(cajasL[c, :] < cajasL[cc, :], cajasL[c, :], cajasL[cc, :])
# verifica que solo un tipo de patron este en la caja
res = True
for p in range(patrones.shape[0]):
if patrones[p, dim] != pertenece[c]:
den = True
if True in np.hstack(
(patrone... | |
content-version="1.0" format-version="1.0">
<icFilters>
<icFilter operation="delete">
"""
CE_NC_DELETE_CHANNEL_FILTER_TAIL = """
</icFilter>
</icFilters>
</syslog>
</config>
"""
CE_NC_GET_SERVER_IP_INFO_HEADER = """
<filter type="subtree">
<syslog xmlns="http://www.huawei.com/netconf/vrp" content-version="1.0" ... | |
from logbook import Logger
from mock import patch, create_autospec, MagicMock, Mock
import pandas as pd
from ccxt.base.errors import RequestTimeout
from catalyst.exchange.exchange_errors import ExchangeRequestError
from .base import BaseExchangeTestCase
from catalyst.exchange.ccxt.ccxt_exchange import CCXT
from catal... | |
<gh_stars>10-100
import datetime
from energym.envs.env_fmu_eplus import EnvEPlusFMU
INPUTS_SPECS = {
"Bd_Cooling_onoff_sp": {
"type": "discrete",
"size": 2,
"default": 1,
"description": "Cooling availability on/off setpoint.",
},
"Bd_Heating_onoff_sp": {
"type": "discrete",
"size": 2,
"default": 1,
"descr... | |
#!/usr/bin/env python3
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | |
"""
storing/retrieving of (position-dependent) fields obtained from simulations.
a field is a collection of functions x -> f(x; params), and will be stored
simply as a number of lists with matching lengths, including the list of
positions x, alongside with a name and a uniquely identifying
parameter dict params.
esse... | |
),
"DR1c_16" : ( 34235, 34236 ),
"DR1a_17" : ( 34236, 34240 ),
"DR1a1_17" : ( 34240, 34241 ),
"DR1a2_17" : ( 34241, 34242 ),
"DR1bAgeOns_17" : ( 34242, 34244 ),
"DR1bOns_17" : ( 34244, 34245 ),
"DR1bAgeRec_17" : ( 34245, 34247 ),
"DR1bRec_17" : ( 34247, 34248 ),
"DR1c_17" : ( 34248, 34249 ),
"DR1a_18" : ( 342... | |
# Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
# Created: 2020-07-09 1:20 PM
"""
=========================
Review and correct tracks
=========================
Usage:
::
python -m argos.review
Basic operation
---------------
At startup it will show a window with two empty panes separated in the
middle by three em... | |
<reponame>Marlin-Na/canine<gh_stars>0
import abc
import os
import sys
import typing
import glob
import shlex
import tempfile
import subprocess
import traceback
import shutil
import warnings
import crayons
import re
from uuid import uuid4
from collections import namedtuple
from contextlib import ExitStack, contextmanage... | |
"""Cloudhands DB server functions
This file contains functions which either make direct modifications to the
Cloudhands database, request information from the DB, or bundle a series of
functions which cause a number of DB changes to take effect.
"""
from collections import OrderedDict
#We need everything from the mo... | |
#! /usr/bin/python3
## type hints are provided in 'types/systemctl3.pyi'
from __future__ import print_function
__copyright__ = "(C) 2016-2020 <NAME>, licensed under the EUPL"
__version__ = "1.5.4505"
import logging
logg = logging.getLogger("systemctl")
from types import GeneratorType
import re
import fnmatch
import... | |
from __future__ import print_function
from __future__ import division
from builtins import range
from past.utils import old_div
from future.utils import raise_
import unittest
import copy
import os
import numpy as num
from anuga.coordinate_transforms.geo_reference import Geo_reference
from anuga.geometry.polygon impo... | |
# @title Zurich Instruments HDAWG instrument driver
# @author <NAME>
# @contrib <NAME>, <NAME>, <NAME>
# @date 2020-09-14
# @version v0.835.1
# @other The author of this driver takes no responsibility for
# any and all bugs and frustration caused by Labber and/or
# affiliated Zurich Instruments hardware and soft... | |
self.assertRaises(AssertionError, lambda: MenuUtils.generic_menu(columns=2)) # none rows
# Assert append more widgets than number of rows*columns
column_menu = MenuUtils.generic_menu(columns=2, rows=4, enabled=False)
for _ in range(8):
column_menu.add.button('test', pygame_menu.events.BACK)
self.assertRaise... | |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import os
import numpy as np
from pytorch_transformers.modeling_bert import (
BertPreTrainedModel,
BertCon... | |
the game.
Note that I do store usernames and command usage records in the database for use in feature improvement.
Your username will NEVER be shared with anyone for any reason.
Use !brdybotleave in your channel to remove yourself from my channel list."""
operants = getOperants(username)
commandDict = getCommands(... | |
save(
self.doc, top=False, base_url=self.name, relative_uris=relative_uris
)
if self.type is not None:
r["type"] = save(
self.type, top=False, base_url=self.name, relative_uris=relative_uris
)
if self.outputBinding is not None:
r["outputBinding"] = save(
self.outputBinding,
top=False,
base_url=self.name,
re... | |
520,
560,
618,
640,
697,
728,
654,
744,
702,
683,
633,
525,
568,
477,
390,
420,
410,
350,
382,
387,
397,
502,
566,
695,
677,
266,
203,
207,
223,
203,
217,
171,
217,
210,
192,
195,
755,
522,
335,
253,
255,
214,
257,
216,
230,
229,
243,
543,
1025,
1447,
2843,
3592,
3671... | |
# iterates over all the end matches
for end_match in end_matches:
# retrieves the match start and end values and uses them to
# construct the match value that is going to be used for the
# construction of the match orderer structure to be added
match_start = end_match.start()
match_end = end_match.end()
m... | |
described by
one of the more specific ASCOM exceptions.
The device did not *successfully* complete the request.
Notes:
* If binning is active, value is in binned pixels.
* Defaults to :py:attr:`CameraYSize` with :py:attr:`StartY` = 0
(full frame) on initial camera startup.
Attention:
* No error check is per... | |
from link import Wrapper
from link.utils import list_to_dataframe
from contextlib import closing
import defaults
MYSQL_CONNECTION_ERRORS = (2006, 2013)
class DBCursorWrapper(Wrapper):
"""
Wraps a select and makes it easier to tranform the data
"""
def __init__(self, cursor, query = None, wrap_name = None, args=No... | |
if MQTT_ENABLED == 'true' else 'disabled'}.")
elif len(args) > 1 and args[0] in ['publish', 'unpublish']:
self._mqtt_prop_cmds(args[0], args[1])
else:
print(f"ERROR: Unsupported argument: {args[0]}")
def _mqtt_prop_cmds(self, cmd, prop_name):
global MQTT_PROPERTIES
global mqtt_client
global wp
global wpdef
i... | |
{'type': 'object',
'properties': {'input': {'type': 'string'},
'output': {'type': 'string'}},
'additionalProperties': False}],
'default': False},
'client_of': {'type': 'array', 'items': {'type': 'string'},
'default': []},
'timesync': {
'anyOf': [
{'type': 'boolean'}, {'type': 'string'},
{'type': 'object',
'r... | |
#!/usr/bin/python
#Sorts based on top 50 CMetric, all callPaths - CMetric
#, all call paths - call path count and all samples
from __future__ import print_function
from bcc import BPF, PerfType, PerfSWConfig
from bcc import BPF
import sys
import ctypes as ct # For mapping the 'C' structure to Python
import argparse #... | |
<reponame>hohe12ly/inundation-mapping
#!/usr/bin/env python3
import time
import pandas as pd
import geopandas as gpd
from pathlib import Path
from tools_shared_functions import get_metadata, get_datum, ngvd_to_navd_ft, get_rating_curve, aggregate_wbd_hucs, get_thresholds, flow_data
from dotenv import load_dotenv
import... | |
want other people to decide what you are going to do. You have free will, you have the ability to choose whatever path you want to take.")
raw_input("There is no more text message coming from BOB. You think you are safe now.")
raw_input("You feel tired, after all of the things that have happened today. You sit on the... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import json
import re
from django.conf import settings
from django.conf.urls import url
from django.core.exceptions import ObjectDoesNotExist
from django.core.paginator import InvalidPage, Pa... | |
inputfile1
)
]
],
err_file,
'a'
)
# convert time matrix to dictionary (both time matrices should be identical here)
tdict = matrix2hdict(time1)
tkey = list(tdict.keys())[0]
# convert data matrices to dictionaries
hdict1 = matrix2hdict(mat1)
hdict2 = matrix2hdict(mat2)
# Dictionaries of absolute and rela... | |
RegenerateCount=None, RoundRobinPacketOrdering=None, RouteMesh=None, SrcDestMesh=None, State=None, Suspend=None, TrafficItemType=None, TrafficType=None, TransmitMode=None, TransportLdpPreference=None, TransportRsvpTePreference=None, UseControlPlaneFrameSize=None, UseControlPlaneRate=None, Warnings=None):
"""Finds and... | |
# -*- coding: utf-8 -*-
from PyQt4 import QtTest
from acq4.devices.OptomechDevice import OptomechDevice
from .FilterWheelTaskTemplate import Ui_Form
from acq4.devices.Microscope import Microscope
from acq4.util.SequenceRunner import SequenceRunner
from acq4.devices.Device import *
from acq4.devices.Device import TaskGu... | |
from __future__ import annotations
from typing import Dict, List, Optional, Tuple, Union
import numpy as np
import pandas as pd
from desdeo_problem.Problem import MOProblem
from desdeo_tools.interaction.request import BaseRequest, SimplePlotRequest
from desdeo_tools.scalarization.ASF import AugmentedGuessASF, MaxOfTw... | |
##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | |
elif event.key == 'e':
self.expsub()
elif event.key == 'P': # PCA
self.plotscan(self.scannum,data=efuncs(self.plane),flag=False,logscale=True)
self.PCAflag = True
elif event.key == 'q':
self.close()
elif event.key == 'Q':
self.close(write=False)
elif event.key == '.':
self.maparrow(round(event.xdata),round(e... | |
None , None ] )
if 76 - 76: iII111i % OOooOOo / OoooooooOO . I1IiiI % OoO0O00 % i1IIi
oOo00Oo0o00oo = struct . unpack ( oOo0ooO0O0oo , packet [ : OO00OO ] ) [ 0 ]
packet = packet [ OO00OO : : ]
o00OOo00 -= OO00OO
ii1I1 = lisp_address ( LISP_AFI_NONE , "" , 0 , 0 )
ii1I1 . afi = socket . ntohs ( oOo00Oo0o00oo )
i... | |
from sql server
def get_availability(con):
availability_db = pandas.read_sql('SELECT * FROM "availability"',con,index_col=None)
return availability_db
# read in the availability view
print("Reading in availability view")
availdb = get_availability(con)
# use for fake data / demo purposes to make processing quicker ... | |
<filename>AREM/PeakModel.py
# Time-stamp: <2011-03-01 18:21:42 <NAME>>
"""Description: Emprical model for peak lengths
Copyright (c) 2008,2009 <NAME>, <NAME> <<EMAIL>>
Copyright (c) 2010,2011 <NAME> <<EMAIL>>
This code is free software; you can redistribute it and/or modify it
under the terms of the Artistic License... | |
"""
function used to update the search results from join with one column to join with both this column and time column
:param search_results: list of "DatamartSearchResult"
:return: list of "DatamartSearchResult"
:return:
"""
# find time columns first
# get time ranges on supplied data
time_columns_left = list(... | |
import numpy as np
from chainer import cuda, Function, gradient_check, Variable, optimizers, serializers, utils, initializers
from chainer import Link, Chain, ChainList
import chainer.links as L
import chainer.functions as F
from lib.utils import *
from lib.functions import *
import time
class Darknet19(Chain):
"""
... | |
<reponame>jossef/power-scanner<gh_stars>1-10
__author__ = '<NAME>'
def get_ftp_banner_info(banner):
# Lower the banner's case in order to get case insensitive match
banner = banner.lower()
server = None
operating_system = None
if any(hint for hint, os in ftp_servers.iteritems() if hint in banner):
server, oper... | |
<reponame>VisualComputingInstitute/CROWDBOT_perception<filename>reid/scripts/triplet_reid/datasets/lip.py<gh_stars>1-10
"""
There are multiple folders. One for LIP (What we want), one for Fashion Design (Ac), and one for multiple people (CIHP)
Folder Structure
Testing_images/Testing_images/testing_images: Test images... | |
<filename>api/exporter/views.py
import json
import requests
import base64
import re
import csv
from django.views import View
from django.http import JsonResponse
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q, Max
from django.db import transaction
from django.utils import timezone... | |
<gh_stars>0
import csv
import vamp
import soundfile as sf
import argparse
import pathlib
import sys
import numpy as np
from warnings import warn
from typing import List
import simfile
class SingleBeatTimestampData(object):
def __init__(self, timestamp: float = None, label: str = None):
self.timestamp = timestamp
s... | |
#Misc
import time, os, sys, pdb
from glob import glob
from fnmatch import fnmatch
#Base
import numpy as np
import pandas as pd
#Save
import json
import scipy.io as sio
import h5py
#User
from utilities import *
#Plot
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.gridspec as gridspec
from ma... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | |
HammerDriver, append_error_func: Callable[[str], None]) -> Optional[dict]:
"""Create a full config to run the output."""
power_input_only = HammerDriver.par_output_to_power_input(driver.project_config)
if power_input_only is None:
driver.log.error("Input config does not appear to contain valid par outputs")
return... | |
ee -= 1
global ycL
ycL[order] = ee
self.add(DataText(linenumber, code, todisplay))
line = stream.readLine()
lino += 1
linenumber = lino
todisplay = line
lino -= 1
keepadd = False
elif line.startsWith("TRIBUTARY AREA"): #Tributary area
code = "BLK"
self.add(DataText(linenumber, code, todisp... | |
#!/usr/bin/env python3
# Script to print pictures using the NanoLab Microcontroller
# Microcontroller Model: Micos 1860SMC Basic
# Made 2019, <NAME>
# sunyudong [at] outlook [dot] sg
# github.com/sunjerry019/photonLauncher
from PIL import Image
# Pillow reqs https://pillow.readthedocs.io/en/5.1.x/installation.html
# ... | |
<gh_stars>0
# PyAlgoTrade
#
# Copyright 2011-2018 <NAME>
#
# 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 o... | |
<filename>PlatformAgents/com/cognizant/devops/platformagents/agents/alm/jira/JiraAgent.py<gh_stars>0
#-------------------------------------------------------------------------------
# Copyright 2017 Cognizant Technology Solutions
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use thi... | |
<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, division
import pytz
from calendar import monthrange
from datetime import datetime, timedelta
from decimal import Decimal
from functools import partial
from tzlocal import get_localzone
from django.db.models import Max, Min, Sum
from djang... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.