text stringlengths 1 927k |
|---|
#!/usr/bin/env python
import rospy
import math
from sensor_msgs.msg import Imu
import tf
import tf2_ros
import tf2_geometry_msgs
import geometry_msgs.msg
lastPub = 0
lastClean = 0
def callbackRaw(imu_in):
global lastPub, lastClean
if (lastClean != 0 and lastClean > rospy.Time.now() - rospy.Duration(1)):
return #... |
import numpy as np
from scipy.ndimage import uniform_filter1d
from scipy.signal import detrend
def find_peaks_original(x, scale=None, debug=False):
"""Find peaks in quasi-periodic noisy signals using AMPD algorithm.
Automatic Multi-Scale Peak Detection originally proposed in
"An Efficient Algorithm for A... |
#Monthly
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.mlab as ml
import datetime
from dateutil.relativedelta import relativedelta
import re
import numpy as np
from math import sin, cos, atan2, radians, sqrt
import scipy.interpolate
import gc
import pdb
import imp
imp.load_source('GenMe... |
import pandas as pd
import numpy as np
from utils import *
from sklearn.preprocessing import StandardScaler
from collections import defaultdict
import re
def format_labels(file_path, timelines, mapping):
most_recent = mapping.sort_values(["subject_id", "ordering_date"], ascending=False).drop_duplicates("subject_id", ... |
from output.models.ms_data.datatypes.facets.non_negative_integer.non_negative_integer_min_exclusive004_xsd.non_negative_integer_min_exclusive004 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
] |
import sys
from typing import Any
from typing import Dict
from typing import Hashable
from typing import Type
from typing import TYPE_CHECKING
from weakref import ref as weakref
from deprecated import deprecated
from markupsafe import Markup
from lektor.markdown.controller import ControllerCache
from lektor.markdown.... |
# pylint: disable=W0622,E1101
"""
A basic object-oriented interface for Galaxy entities.
"""
import abc
import json
from collections.abc import (
Iterable,
Mapping,
Sequence,
)
from typing import Tuple
import bioblend
from bioblend.util import abstractclass
__all__ = (
'Wrapper',
'Step',
'W... |
def main():
n = get_positive_int()
def get_positive_int():
while True:
n = int(input("Enter a positive number: "))
if n > 0:
return n
main() |
import datetime
import pytest
from flask import url_for
from brewlog.ext import db
from brewlog.models import Brew
from . import BrewlogTests
class BrewViewTests(BrewlogTests):
@pytest.fixture(autouse=True)
def set_up(self, user_factory, brewery_factory):
self.public_user = user_factory(
... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
# 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... |
# print(int("a"))
print(int(995.23)) # отбрасывание дробной части
print(float(42)) # приведение к виду с плавающей точкой
print(2 ** 2018) # поддержка длинной арифметики
pow = str(2 ** 2018) # количество цифр
print(pow)
# for i in pow:
# print(pow(i))
print(len(pow))
print("Yin" + " " + "Yang")
print("because ... |
import time
import string
import random
import os
from termcolor import colored
from collections import Counter
clean_the_screen = ("cls" if os.name == "nt" else "clear")
# Function for listing books with their full information.
def listBooks():
file = open("books.txt", "r")
lines = file.readlines()
file.close()
... |
from bsm import Manager, Episode, EpisodeGroup
from dotenv import load_dotenv
import os
load_dotenv()
ID = os.environ.get("ID")
TOKEN = os.environ.get("TOKEN")
manager = Manager(ID, TOKEN)
print(manager.test_api())
ep = Episode(**{'title': "test upload"})
res = manager.post_episode(ep, 'testfile.mp3', None)
print(... |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019-2021 The Matrix.org Foundation C.I.C.
#
# 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.o... |
from dataclasses import fields
from warnings import warn
__all__ = ['dataslots', 'with_slots']
def with_slots(*args, **kwargs):
warn("Use dataslots decorator instead of with_slots", category=PendingDeprecationWarning, stacklevel=2)
return dataslots(*args, **kwargs)
def dataslots(_cls=None, *, add_dict=Fals... |
# qubit number=4
# total number=33
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... |
# -*- coding: utf-8 -*-
"""This module implements a number of popular two-dimensional complex valued residual blocks."""
# Authors: Qinggang Sun
#
# Reference:
# Allen Goodman, Allen Goodman, Claire McQuin, Hans Gaiser, et al. keras-resnet
# https://github.com/broadinstitute/keras-resnet
# pylint:disab... |
import requests
class KongClient:
def __init__(self, url):
self._endpoint = url
self._session = requests.session()
def create_service(self, name, upstream_url):
url = "{}/services".format(self._endpoint)
payload = {
"name": name,
"url": upstream_url,
... |
#!/usr/bin/env python
try:
from pyFILTERSD import FILTERSD
__all__ = ['FILTERSD']
except:
__all__ = []
#end |
r"""HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPConnection(... |
import os
import csv
import copy
import json
DIR = os.path.dirname(__file__)
def rel(*p): return os.path.normpath(os.path.join(DIR, *p))
CENSUS_DATA = rel('nst-est2019-alldata.csv')
OUT_JSON = rel('state_data.json')
def main():
state_data = copy.deepcopy(STATE_DATA)
state_name_ind = {} # { name: ind of ... |
import itertools
import shutil
import os
from os import listdir
from os.path import isfile, join
from tqdm import tqdm
import numpy as np
import scipy
from scipy.io.wavfile import write, read
from scipy.fftpack import fft
from scipy import signal
from scipy.fft import fftshift
import matplotlib.pyplot as plt
from sklea... |
import pymongo
class DbClient:
"""Creates an instance of pymongo client and stores it in a private variable.
The instance of this class is injected as a dependency for request validators and processors.
Attributes:
database (Database): The database object.
collection_list (list): List of ... |
from unittest import TestCase
from littlelambocoin.types.blockchain_format.program import Program, INFINITE_COST
from littlelambocoin.util.byte_types import hexstr_to_bytes
from littlelambocoin.wallet.puzzles.load_clvm import load_clvm
DESERIALIZE_MOD = load_clvm("littlelambocoinlisp_deserialisation.clvm", package_or... |
import discord
from discord.ext import commands
import json
#vamos abrir o setup json para pegar as informaçoes
with open('bot_setup.json') as vagner:
bot_settings =json.load(vagner)
#lista de comandos
# cmds.info o cmds que dizer o nome da pastar e o info o nome do arquivo
#pode fazer tbm cmds.adm.ban caso qu... |
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="robotframework-djangorobotlibrary",
version="19.1a0",
description="A Robot Framework l... |
from django.contrib import admin
from .models import Logs
# Register your models here.
@admin.register(Logs)
class TextAdmin(admin.ModelAdmin):
list_display = ('files', 'vocabulary', 'vectors') |
import os
from enums import Status
class FakeFS:
def __init__(self, base_dir="/var/fake_fs"):
self.base_dir = base_dir
def get_chunk(self, path):
full_path = self.base_dir + path
if not os.path.isfile(full_path):
return {'status': Status.not_found}
data = None
... |
#Match socks to pant colour.
import numpy as np
from PIL import Image
import urllib.request
import os
directory = 'layers/layers_for_art_engine/Pant'
for filename in os.listdir(directory):
image = os.path.join(directory, filename)
pant = Image.open(image)
socks = Image.open('layers/socks.png') #change the ... |
# Copyright (c) 2011 Chris AtLee
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... |
#!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the resolution of forks via avalanche."""
import random
from test_framework.mininode import P2PInterface, m... |
"""
This module is the geometrical part of the ToFu general package
It includes all functions and object classes necessary for tomography on Tokamaks
"""
# Built-in
import sys
import os
import warnings
import copy
# Common
import numpy as np
import scipy.interpolate as scpinterp
import scipy.stats as scpstats
import... |
from buttonlist.app import main
if __name__ == '__main__':
main().main_loop() |
import glob
import uuid
import json
import requests
import copy,time
import os
import cv2
import numpy as np
from time import sleep
import pandas as pd
import logging
from collections import Counter
import pytesseract
from pytesseract import Output
#from pytesseract import pytesseract
from difflib import SequenceMatche... |
#!/usr/bin/env python
'''This script converts from any image type supported by
Python imaging library to the RLE-encoded format used by
NxWidgets.
'''
from PIL import Image
def get_palette(img, maxcolors = 255):
'''Returns a list of colors. If there are too many colors in the image,
the least used are removed.
... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... |
from django.test import TestCase, Client
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
'''
Test that creating a user with an email is successful
'''
email = 'test@gmail.com'
password = '456@3... |
# Generated by Django 2.2.10 on 2020-03-10 20:10
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
def migrate_speakers(apps, schema_editor):
Talk = apps.get_model("talk", "Talk")
TalkPublishedSpeaker = apps.get_model("talk", "Tal... |
import math
import torch
import torch.nn as nn
from torch.cuda.amp import autocast
from torchreid.losses import AngleSimpleLinear
from torchreid.ops import Dropout, EvalModeSetter, rsc
from .common import HSigmoid, HSwish, ModelInterface, make_divisible
import timm
from torchreid.integration.nncf.compression import ... |
from setuptools import setup, find_packages
__version__ = '4.3.0'
if __name__ == '__main__':
setup(
name='pdpyras',
description="PagerDuty REST API client",
long_description="A basic REST API client for PagerDuty based on Requests' Session class",
py_modules=['pdpyras'],
ve... |
import os
from .BaseConfig import BaseConfig
from .BaseTest import BaseTest
from .Env import env
from .Run import Run
__all__ = ['BaseConfig', 'BaseTest', 'Run', 'env', 'all']
def all(config, cfg_dir):
if not os.path.exists(cfg_dir):
os.makedirs(cfg_dir)
cfg_list = list()
for file in sorted(os... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open("VERSION", "r") as fversion:
version = fversion.read()
setuptools.setup(
name="trdb2py",
version=version,
author="Zerro Zhao",
author_email="zerrozhao@gmail.com",
description="tradingdb2 for py... |
import os
"""
configuration file includes all related multi-omics datasets
"""
root_data_folder = './data'
raw_data_folder = os.path.join(root_data_folder, 'raw_dat')
preprocessed_data_folder = os.path.join(root_data_folder, 'preprocessed_dat')
gex_feature_file = os.path.join(preprocessed_data_folder, 'uq1000_gex_fea... |
from abc import ABCMeta
from uuid import UUID
import jsonschema
from dateutil.parser import parse as dateparse
from uptimer.events import SCHEMATA_PATH
from uptimer.events.cache import schema_cache
from uptimer.helpers import to_bool, to_none
class EventDefinitionError(ValueError):
pass
class EventMeta(ABCMet... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Gcp methods module."""
import json
import logging
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
from hvac.constants.gcp import ALLOWED_SECRETS_TYPES, SERVICE_ACCOUNT_KEY_ALGORITHMS, SERVICE_ACCOUNT_KEY_TYPES
DEFAULT_MOUNT_POINT = '... |
# From Python
# It requires OpenCV installed for Python
import sys
import cv2
import os
from sys import platform
import argparse
# Import Openpose (Windows/Ubuntu/OSX)
dir_path = os.path.dirname(os.path.realpath(__file__))
try:
# Windows Import
if platform == "win32":
# Change these variables to point ... |
# Lint as: python3
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# 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 ... |
import flickrapi
import flickr_api
import urllib.request
import os
import sys
if __name__ != "__main__":
print("File 'flickr.py' not meant for transcendings and imports, direct use only")
sys.exit(0)
#functions
def url_list_maker(uiv):
count = 0
photos = flickr.walk_user(user_id = uiv, per_page = 100,... |
from matplotlib.pyplot import figure, show
import numpy as npy
from numpy.random import rand
if 1: # picking on a scatter plot (matplotlib.collections.RegularPolyCollection)
x, y, c, s = rand(4, 100)
def onpick3(event):
ind = event.ind
print('onpick3 scatter:', ind, npy.take(x, ind), npy.ta... |
'''
Classes from the 'IOAccelerator' framework.
'''
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
IOAccelMTLEvent = _Class('IOAccelMTLEvent') |
from django.urls import path
from .views import BookDetailView, BookListView
app_name = 'books'
urlpatterns = [
path('', BookListView.as_view(), name='list'),
path('<int:pk>/', BookDetailView.as_view(), name='detail')
] |
# -*- coding: utf-8 -*-
from cwr_validator.app import create_app
"""
CWR Data API Validator WS
~~~~~~~~~~~~~~~~~~~~~~~~~
Validator Web Service for Common Works Registrations.
:copyright: (c) 2015 by WESO
:license: MIT, see LICENSE for more details.
"""
__version__ = '0.0.1'
__license__ = 'MIT' |
'''OpenGL extension EXT.texture_type_2_10_10_10_REV
This module customises the behaviour of the
OpenGL.raw.GLES2.EXT.texture_type_2_10_10_10_REV to provide a more
Python-friendly API
Overview (from the spec)
This extension adds a new texture data type, unsigned 2.10.10.10 ABGR,
which can be used with RGB or RGB... |
from debugprov.navgiation_strategy import NavigationStrategy
from debugprov.node import Node
from debugprov.validity import Validity
class SingleStepping(NavigationStrategy):
def navigate(self):
self.recursive_navigate(self.exec_tree.root_node)
self.finish_navigation()
return self.exec... |
import gym
import numpy as np
from igibson.robots.robot_locomotor import LocomotorRobot
class JR2(LocomotorRobot):
"""
JR2 robot (no arm)
Reference: https://cvgl.stanford.edu/projects/jackrabbot/
Uses joint velocity control
"""
def __init__(self, config):
self.config = config
... |
import sqlite3
from datetime import datetime
from os import listdir
import os
import re
import json
import shutil
import pandas as pd
from application_logging.logger import App_Logger
class Raw_Data_validation:
"""
This class shall be used for handling all the validation done on the Raw Training ... |
AUTHENTICATION_BACKENDS = (
"django_pam.auth.backends.PAMBackend",
"django.contrib.auth.backends.ModelBackend",
) |
# ##############################################################################
# Usage: python get_S_norm.py Subj I1 I2
# Time: ~ 20s
# Ref:
# ##############################################################################
# 20220118, In Kyu Lee
# No version suffix
# ##################################################... |
from FaceID import faceID
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
img1 = cv.imread('nabeel.jpg',0) # queryImage
img2 = cv.imread('nabeel_train.jpg',0) # trainImage
print(img1.shape)
rec = faceID()
print("constructor finished")
# crop_img_2 = getCroppedImage(rec,crop_img_2) ... |
test = {
'name': 'Problem 9',
'points': 4,
'suites': [
{
'cases': [
{
'answer': 'restaurant names',
'choices': [
'restaurant names',
'restaurants',
'restaurant ratings'
],
'hidden': False,
'locked': False,
... |
# coding: utf-8
import random
import time
from pygithub import Github
# Ref:
# https://pygithub.readthedocs.io/en/latest/introduction.html#very-short-tutorial
# If you are using an access token to circumvent 2FA, make sure you have
# enabled "repo" scope
g = Github("username", "password")
me = g.get_user()
starred = ... |
# Aim: Mostly for phenix users and those don't like using Miniconda
# 1. wget url_to_tar_file.tar
# 2. tar -xf url_to_tar_file.tar
# 3. source amber17/ambersh
# 4. Just it
""" Usage example: python pack_non_conda.py ambertools-17.0.1-py27_1.tar.bz2
Note: You can use file pattern
This script will unpack that bz2 file... |
'''
这段代码源于网上
原文请见 https://my.oschina.net/hechunc/blog/3020284
'''
import RPi.GPIO as GPIO
import time
# 这个类表示单个的SG90模块
class Rotation:
frequency=50 #脉冲频率(Hz)
delta_theta=0.2 #步进转动间隔(度)
min_delay=0.0006 #转动delta_theta的理论耗时(s)
max_delay=0.4 #从0转到180的耗时(s)
def __init__(self,channel,min_theta,max_thet... |
import os
import math
import argparse
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from PIL import Image
import data_loader
from mau_ml_util.train_logger import TrainLogger
#from mau_ml_util.metric import SegmentationMetric... |
"""This module contains the general information for CommSyslogClient ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class CommSyslogClientConsts():
ADMIN_STATE_DISABLED = "disabled"
ADMIN_STA... |
# Copyright 2021 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import sys
import builtins
import importlib
import inspect
import pkgutil
import traceback
from ast import AST
from funcparserlib.parser import NoParseError
from hy._compat import PY3_8... |
'''
code by TaeHwan Jung(@graykode)
Original Paper and repository here : https://github.com/openai/gpt-2
GPT2 Pytorch Model : https://github.com/huggingface/pytorch-pretrained-BERT
'''
import copy
import torch
import math
import torch.nn as nn
from torch.nn.parameter import Parameter
def gelu(x):
retu... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Graba video leido desde la arducam
# Se le debe indicar el archivo de video a grabar y
# la duración de la captura en segundos.
# SINTAXIS: python capturar_video.py VIDEO TIEMPO
# 1- Ruta del video
# 2- Tiempo de grabacion en segundos
from ctypes import *
import ct... |
# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# 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 requir... |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# 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 requ... |
"""
=========
highiq.io
=========
.. currentmodule:: highiq.io
This module contains the I/O methods for loading data into and saving data from HighIQ analyses.
.. autosummary::
:toctree: generated/
load_arm_netcdf
"""
from .arm_data import load_arm_netcdf |
"""
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... |
# coding: utf-8
"""
VPlex REST API
A definition for the next-gen VPlex API # noqa: E501
OpenAPI spec version: 0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RuleSet(object):
"""NOTE: This class is auto gen... |
import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
import numba
import time
from scipy.integrate import odeint
# a sample differential equation dy/dx = (x-y)/2
# def dydx(x,y):
# return ((x-y)/2)
# # find the value of y for a given x using step size h
# # and an initial value y0 at x0
# ... |
"""Fill journal and character hidden/friends-only columns
Revision ID: e2bedd00b085
Revises: 1fbcfecd195e
Create Date: 2021-07-26 05:43:43.742595
"""
# revision identifiers, used by Alembic.
revision = 'e2bedd00b085'
down_revision = '1fbcfecd195e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy impor... |
"""Run Alleyoop utrrates tool on Slamdunk results."""
import os
from plumbum import TEE
from resolwe.process import (
Cmd,
DataField,
FileField,
IntegerField,
Process,
StringField,
)
class AlleyoopUtrRates(Process):
"""Run Alleyoop utrrates."""
slug = "alleyoop-utr-rates"
proces... |
from pony.orm import *
from datetime import datetime
from model.contact import Contact
from model.group import Group
from pymysql.converters import decoders
class ORMFixtue:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column='group_id')
name... |
from cereal import car
from common.conversions import Conversions as CV
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.chrysler.values import DBC, STEER_THRESHOLD
class CarState(CarStateBase):
def __init__(se... |
from .BertVectorizer import BertVectorizer |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modifications for Guinet et al.
import io
import warnings
import numpy as np
import argparse
from utils import *
from query_aux import *
#Disable warnings for Meta-features
warnings.filterwarnings("ignore")
# to use bool for parsing
def str2bool(v):
"""Parse Str... |
# coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate Deep Se... |
import unittest
import unittest.mock
import os
from py_compile import compile
import sys
import random
import time
import tempfile
from filecmp import cmp
def make_random_string(length=25, lower=0, upper=255):
return "".join(chr(random.randint(lower,upper)) for i in range(length))
def tempname():
(handle, nam... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 1 22:17:20 2019
@author: Wei
"""
#from dash_app import default_log as log
import pandas as pd
import numpy as np
#import pytz
from datetime import datetime, tzinfo,timedelta
from pm4py.statistics.traces.log import case_statistics
from pm4py.algo.filtering.log.attribute... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... |
# io.py
# Contact: Jacob Schreiber
# jmschr@cs.washington.edu
'''
This script focuses on data input and output, and currently supports the
following files:
* FastA
'''
from seq import *
class FastA( object ):
'''
This is a FastA file. It can contain many DNA, RNA, or Protein
sequences in it. This can be... |
# Copyright (C) 2019-2021 HERE Europe B.V.
# SPDX-License-Identifier: Apache-2.0
"""This module will test platform api module."""
import pytest
from requests_oauthlib import OAuth1
from here_location_services.platform.apis.aaa_oauth2_api import AAAOauth2Api
from here_location_services.platform.apis.api import Api as P... |
#!/usr/bin/python3
###############################################################################
#
# Copyright (c) 2015-2020, Intel Corporation
# Copyright (c) 2019-2020, University of Utah
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
# -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Efficiently compute the approximate statistics over an SArray.
"""
from __future... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from os.path import abspath
from bravado.client import SwaggerClient
from jsonschema import ValidationError
from six.moves.urllib.parse import urljoin
from six.moves.urllib.requ... |
"""
This example shows three different ways to perform this task.
Please examine all three to find a method you like.
If you ask me: I prefer the first.
"""
import asyncio
import hondana
# Create your client, you must be authorised to upload a chapter.
client = hondana.Client(username="my username", password="my... |
class Solution:
def waterOverflow(self, K, R, C):
if R <= 0 or C <= 0 or C > R :
return 0
table = [[K]]
i = 0
while True :
table.append([0]*(i+2))
flag = True
for j in range(i+1) :
if table[i][j] > 1 :
... |
#看看文件内容有多少列
if __name__ == "__main__":
fp = open("../data/lr_coef")
count = 0
for line in fp:
item = line.strip().split(",")
print (len(item)) |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-20 14:32
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependenc... |
from cereal import car
from selfdrive.car import dbc_dict
from common.params import Params
Ecu = car.CarParams.Ecu
# Steer torque limits
class SteerLimitParams:
STEER_MAX = 280 # 409 is the max, 255 is stock
STEER_DELTA_UP = 5
STEER_DELTA_DOWN = 5
STEER_DRIVER_ALLOWANCE = 50
STEER_DRIVER_MULTIPLIER = 2
S... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... |
import helper
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def plot_gpa_scatter():
"""Plotting scatterplot of grades expected and grade received, using the general department list
"""
# obtaining data
department_df = helper.generate_depts_df(helper.general_dept_list)
comp... |
"""
MIT License
Copyright (c) 2019 tcdude
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
import os
import uuid
import yaml
from sceptre_template_fetcher.cli import setup_logging
def before_all(context):
if context.config.wip:
setup_logging(True)
context.uuid = uuid.uuid1().hex
context.project_code = "sceptre-integration-tests-{0}".format(
context.uuid
)
context.scept... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.