text stringlengths 1 927k |
|---|
#!/usr/bin/python3
import os
from sys import argv
if os.name == 'nt':
python = "python"
else:
python = "python3"
try:
experiment_id = int(argv[1])
except Exception:
experiment_id = 63
def command(video1, video2, chessboard):
return "{} ../../Main.py --video1={} --video2={} --chessboard={}".forma... |
# -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Render curved 4d polychoron examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script draws uniform polychoron whose vertices lie
on the unit sphere S^3 by using stereographic projection
to map them into 3d space.
:copyright (c) 2018 by Zhao Liang.
"""
... |
import sys
import os
import pkg_resources
import warnings
import numpy as np
import netCDF4
import pooch
from .. import cube
from .. import utils
# deltametrics version
__version__ = utils._get_version()
# enusre DeprecationWarning is shown
warnings.simplefilter("default")
# configure the data registry
REGISTRY ... |
# Copyright 2020 The Cirq Developers
#
# 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 ... |
# -*- coding: utf-8 -*-
#
# Author: Timur Gilmullin
# This module initialize standard python logging system.
import sys
import logging.handlers
# initialize Main Parent Logger:
UniLogger = logging.getLogger("UniLogger")
formatString = "%(filename)-20sL:%(lineno)-5d%(levelname)-8s[%(asctime)s] %(message)s"
formatte... |
print("To print the sum of numbers using recursion")
def calculatatesum(num):
if(num):
a=num+calculatatesum(num-1)
return a
else:
return 0
n=int(input("Enter the Number value:"))
print("The Sum of numbers is,",calculatatesum(n)) |
"""
optoanalysis
============
Package of functions for the Matter-Wave Interferometry
group for handling experimental data.
"""
# init file
import os
_mypackage_root_dir = os.path.dirname(__file__)
_version_file = open(os.path.join(_mypackage_root_dir, 'VERSION'))
__version__ = _version_file.read().strip()
# th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Crap class
but make code more compact. lmao
WARNING! WARNING!
HIGH CONCENTRATION OF SHIT!
and in future here will be adding more and more methods and classes
but i'm not shure
"""
import os
def success(message):
return '<div class="alert... |
# module application.py
#
# Copyright (c) 2015 Rafael Reis
#
"""
application module - Main module that solves the Prize Collecting Travelling Salesman Problem
"""
from pctsp.model.pctsp import *
from pctsp.model import solution
from pctsp.algo.genius import genius
from pctsp.algo import ilocal_search as ils
from pkg_... |
# 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 ... |
# Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from troposphere import Tags
from . import AWSObject, AWSProperty
from .validators import boolean, integer... |
#!/usr/bin/env python
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot/blob/master/LICENSE
import pytest
import mock
HTTPError = pytest.importorskip('requests.exceptions').HTTPError
import uproot
FILE = "foriter"
LOCAL = "tests/samples/{FILE}.root".format(FILE=FILE)
URL = "http://scikit-hep.org/upro... |
# Generated by Django 3.2.5 on 2021-08-27 09:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0035_alter_event_code'),
]
operations = [
migrations.AlterField(
model_name='event',
name='submission_type',... |
def start_dialog(text):
if text is None:
text = recognize_by_google()
if text is None:
return
logging.debug( "You said: " + text )
c = Confirm(text)
state = c.get_state( sentence=text )
logging.debug(type(state))
logging.debug(state)
if(( state == 0) or (state ... |
"""
script to distribute repos from repo_data.py
"""
import urllib3
import pulp_operations
from repo_data import repo_data
#disable ssl warnings for now
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#release latest version of the repo to distribution 'latest'
for os in repo_data:
for repo i... |
from __future__ import print_function
import time
import math
import thread
# Dk imports
from pymavlink import mavutil
from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative
# Mux and TOF imports
import I2CMultiplexer
import VL53L1X
# CV imports
import cv2
import numpy as np
from picamer... |
from django.conf.urls import url, include, patterns
from rest_framework import routers
from . import views
# this gets our Foo model routed
router = routers.DefaultRouter()
router.register(r'foo', views.FooViewSet)
urlpatterns = patterns(
'',
url(r'^', include(router.urls)), # Foo REST urls
url(r'^api-a... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field, Fieldset
from crispy_forms.bootstrap import InlineField
class ContactForm(forms.Form):
subject = forms.CharField (required... |
# DO NOT MODIFY THIS FILE DIRECTLY. THIS FILE MUST BE CREATED BY
# mf6/utils/createpackages.py
# FILE created on February 18, 2021 16:23:05 UTC
from .. import mfpackage
from ..data.mfdatautil import ListTemplateGenerator
class ModflowGwtsrc(mfpackage.MFPackage):
"""
ModflowGwtsrc defines a src package within... |
import numpy as np
import matplotlib.pyplot as plt
from ..easy_casino import Casino
from ..hmm_multinoulli import HMMMultinoulli
hmm = HMMMultinoulli(Casino.A, Casino.PX, Casino.INIT)
# generate sequence
seq_length = 300
batch_size = 500
xs_batch = []
zs_batch = []
for j in range(batch_size):
casino = Casino()... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
then reload it on st... |
#!/usr/bin/env python
import contextlib
import docker
import subprocess
import os.path
import sys
import time
import urllib2
SERVERS = {
'bjoern': ['python', '-m', 'wsgi_benchmark.bjoern_server'],
'cheroot': ['python', '-m', 'wsgi_benchmark.cheroot_server'],
'cheroot_high_concurrency': ['python', '-m', 'ws... |
"""
Netlist Example Analysis
--------------------------------------------
# This Example shows how to Import Netlist in AEDT Nexxim
Netlists supported are HSPICE and, partially, Mentor
"""
import sys
import os
#########################################################
# Import Packages
# Setup The local path to the... |
def hashable(x):
try:
hash(x)
return True
except TypeError:
return False
def transitive_get(key, d):
""" Transitive dict.get
>>> d = {1: 2, 2: 3, 3: 4}
>>> d.get(1)
2
>>> transitive_get(1, d)
4
"""
while hashable(key) and key in d:
key = d[key]
... |
# This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import object
import dpaycli as stm
class SharedInstance(object):
"""Singelton for the DPay Insta... |
#!/usr/bin/python
#
# Copyright 2015 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 b... |
"""Validate requirements."""
from __future__ import annotations
from collections import deque
import json
import operator
import os
import re
import subprocess
import sys
from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
from stdlib_list import stdlib_list
from tqdm import tqdm
from homeassistant.con... |
######################################################################
# Author: Jose Zapata Meza
# Username: zapatamezaj
# Assignment: A02: Loopy Turtle, Loopy Languages
# Purpose: Practice using the turtle library and loops
######################################################################
# Acknowledgements:
#... |
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2021 The Anvil Extras project team members listed at
# https://github.com/anvilistas/anvil-extras/graphs/contributors
#
# This software is published at https://github.com/anvilistas/anvil-extras
import anvil.js
from anvil import HtmlPanel as _HtmlPanel
from ..utils._co... |
# Generated by Django 3.0.3 on 2020-08-22 15:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('twitter', '0003_auto_20200822_2127'),
]
operations = [
migrations.AlterUniqueTogether(
name='follow',
unique_together=set(),... |
import torch
import torch.nn as nn
class ImprovedSNL(nn.Module):
def __init__(self, in_channels, transfer_channels, stage_num=2):
super(ImprovedSNL, self).__init__()
self.in_channels = in_channels
self.transfer_channels = transfer_channels
self.stage_num = stage_num
self.tr... |
from typing import Dict, List
import torch
import torch.nn.functional as F
def compute_loss(states: torch.Tensor,
actions: torch.Tensor,
next_states: torch.Tensor,
log_probs_old: torch.Tensor,
ext_returns: torch.Tensor,
ext_advant... |
# coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ClusterCert:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is att... |
# Generated by Django 3.1.6 on 2021-02-01 16:02
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name=... |
# 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! ***
# Export this package's modules as members:
from .get_entity import *
from .get_hierarchy_setting import *
from .get_management_group import *
from .ge... |
import os
import sys
import numpy as np
import streamlit as st
from stable_baselines3 import PPO
from vimms.ChemicalSamplers import UniformRTAndIntensitySampler, GaussianChromatogramSampler, \
UniformMZFormulaSampler
from vimms.Common import POSITIVE
from vimms_gym.common import METHOD_PPO, METHOD_TOPN
sys.path.... |
import requests
from bs4 import BeautifulSoup as b
from pymongo import MongoClient
import time
from multiprocessing import Pool
url = "http://www.alexa.com/siteinfo/"
file = open("filtered-domains.txt",'r')
client = MongoClient(connect=False)
db = client.alexa
keyword = db.keyword
bcolors={
"HEADER" : '\033[95m',
... |
#!/usr/bin/env python
"""
Written by nickcooper-zhangtonghao
Github: https://github.com/nickcooper-zhangtonghao
Email: nickcooper-zhangtonghao@opencloud.tech
Note: Example code For testing purposes only
This code has been released under the terms of the Apache-2.0 license
http://opensource.org/licenses/Apache-2.0
"""... |
# Copyright (C) 2014 Optiv, Inc. (brad.spengler@optiv.com), Updated 2016 for cuckoo 2.0
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class AntiAVSRP(Signature):
name = "antiav_srp"
d... |
########## 6.6.1. O lema de Johnson-Lindenstrauss ##########
# O principal resultado teórico por trás da eficiência da projeção aleatória é o lema de Johnson-Lindenstrauss (citando a Wikipedia):
# Em matemática, o lema de Johnson-Lindenstrauss é um resultado sobre embeddings de baixa distorção de pontos de ... |
# Copyright 2019 The DDSP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
import backtrader as bt
import backtrader.analyzers as bta
from datetime import datetime
import matplotlib.pyplot as plt
import yfinance
class MaCrossStrategy(bt.Strategy):
# signal generator
def __init__(self):
ma_fast = bt.ind.SMA(period = 10)
ma_slow = bt.ind.SMA(period = 20)
sel... |
from lxml import html
from datetime import datetime, timedelta, date
from dateutil.rrule import DAILY, rrule
from selenium.common.exceptions import NoSuchElementException
from juriscraper.AbstractSite import logger
from juriscraper.OpinionSiteWebDriven import OpinionSiteWebDriven
class Site(OpinionSiteWebDriven):
... |
import time
import pytest
import random
import string
from helpers.test_tools import TSV
from helpers.test_tools import assert_eq_with_retry
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
def get_random_array():
return [random.randint(0, 1000) % 1000 for _ in range(random.ran... |
import math
import scipy.integrate as integrate
ncalls = 0
def f(x):
global ncalls
ncalls +=1
return math.log(x)/math.sqrt(x)
result = integrate.quad(f,0,1)
print("result=", result, "ncalls =",ncalls) |
#positional formatting
print('to {}.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry sstandard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries... |
import json
from typing import Sequence
from bentoml.adapters.json_output import JsonOutput
from bentoml.types import InferenceError, InferenceResult, InferenceTask
from bentoml.utils.dataframe_util import PANDAS_DATAFRAME_TO_JSON_ORIENT_OPTIONS
def df_to_json(result, pandas_dataframe_orient="records"):
import p... |
# -*- coding: utf-8 -*-
# Copyright 2022 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 applicable law or... |
# Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import warnings
from abc import ABCMeta, abstractmethod
from joblib imp... |
from re import X
from flask import Flask,render_template,url_for,request
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras import models
import numpy as np
import pickle
french_tokenizer = pickle.load(open('french_tokenize... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from corral import run
from ..models import PawprintXTile
class PreparePawprintToSync(run.Step):
model = PawprintXTile
conditions = [
PawprintXTile.status == "raw",
PawprintXTile.tile.has(status="loaded"),
PawprintXTile.pawprint.has(stat... |
from mysite.common_settings import *
SECRET_KEY = "aje#lg$7!t!tc5*i%ittn(to%5#5%vjvi*oc=ib25wx%+##_b+"
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "game_cor... |
# flake8: noqa
from typing import Any, Dict, List
import logging
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch.utils.data import DataLoader
from catalyst.callbacks import CheckpointCallback, CriterionCallback, OptimizerCallback
from catalyst.core.runner import IRunner
from c... |
import os
import unittest
from contextlib import redirect_stdout, redirect_stderr
from io import StringIO
from pyshex.shex_evaluator import evaluate_cli
data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data'))
validation_dir = os.path.join(data_dir, 'validation')
rdffile = os.path.join(valida... |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... |
# 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 ... |
# No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... |
import typing
from marshmallow.base import SchemaABC
if typing.TYPE_CHECKING:
from commercetools.client import Client
class AbstractService:
def __init__(self, client: "Client") -> None:
self._client = client
self._schemas: typing.Dict[str, SchemaABC] = {}
def _serialize_params(self, pa... |
""" Ensure that the models work as intended """
import json
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from pinpayments.models import (
ConfigError,
CustomerToken,
PinErr... |
# 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
from... |
from antglob import ant_glob
import json
import sys
import os
import ntpath
from xml.sax.saxutils import escape, quoteattr
description = "Generates MSBuild fragments for embedding content."
# Hide from "go help" for now: not relevant to most projects.
command_hidden = True
usage_text = """
Creates XML to insert in ... |
#!/usr/bin/env python
# Copyright 2020 Jian Wu
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
Adopt from my another project: https://github.com/funcwj/setk
See https://github.com/funcwj/setk/tree/master/doc/data_simu for command line usage
"""
import argparse
import numpy as np
from aps.loader... |
import wexpect
import unittest
import sys
import os
import time
from tests import PexpectTestCase
@unittest.skipIf(wexpect.spawn_class_name == 'legacy_wexpect', "legacy unsupported")
class TestCaseParametricPrinter(PexpectTestCase.PexpectTestCase):
def test_all_line_length (self):
here = os.path.dirname(o... |
#!/usr/bin/env python3
# Copyright (c) 2013-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... |
# -*- coding: utf-8 -*-
from yandex_checkout.domain.common.type_factory import TypeFactory
from yandex_checkout.domain.models.payment_data.payment_data_class_map import PaymentDataClassMap
class PaymentDataFactory(TypeFactory):
"""
Factory for payment data objects
"""
def __init__(self):
supe... |
from typing import Any, Dict, Tuple
from ee.clickhouse.models.property import get_property_string_expr
from ee.clickhouse.queries.event_query import ClickhouseEventQuery
from posthog.constants import AUTOCAPTURE_EVENT, PAGEVIEW_EVENT, SCREEN_EVENT
from posthog.models.filters.path_filter import PathFilter
class PathE... |
#!/usr/bin/env python
from manim import *
# To watch one of these scenes, run the following:
# python --quality m manim -p example_scenes.py SquareToCircle
#
# Use the flag --quality l for a faster rendering at a lower quality.
# Use -s to skip to the end and just save the final frame
# Use the -p to have preview of... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
import time
import tkinter as tk
from tkinter import *
import tkinter.filedialog as filedialog
from tkinter.filedialog import askopenfilename
import utils.utils as util
import utils.similarity_measures as sm
import SMAP.MatrixProfile as mp
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import torch.autograd as autograd
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
import torch.optim as optim
import os
import argparse
class ResNetLayer(nn.Module):
... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'web_server_moex.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... |
# encoding: UTF-8
import json
import traceback
import shelve
import parser
import re
from vnpy.event import Event
from vnpy.trader.vtFunction import getJsonPath, getTempPath
from vnpy.trader.vtEvent import (EVENT_TICK, EVENT_TRADE, EVENT_POSITION,
EVENT_TIMER, EVENT_ORDER)
from vnpy.... |
import geojson
import datetime
import dateutil.parser
from server import db
from sqlalchemy import desc, text
from server.models.dtos.user_dto import UserDTO, UserMappedProjectsDTO, MappedProject, UserFilterDTO, Pagination, \
UserSearchQuery, UserSearchDTO, ProjectParticipantUser, ListedUser
from server.models.post... |
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import numpy as np
from mmdet.core import INSTANCE_OFFSET
from mmdet.core.visualization import imshow_det_bboxes
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .single_stage import SingleStageDetector
@DETECTORS.register_module... |
# -*- coding: utf-8 -*-
"""The source code classes."""
import collections
from yaldevtools import definitions
class EnumDeclaration(object):
"""Enumeration type declaration.
Attributes:
name (str): name.
constants (dict[str, str]): constant values per name.
"""
def __init__(self, name):
"""Ini... |
from django.contrib import admin
from .models import Student, Subject
class SubjectInline(admin.TabularInline):
model = Subject
insert_after = 'name'
class StudentAdmin(admin.ModelAdmin):
fields = (
'name',
'department',
'gender',
)
inlines = [
SubjectInline,
... |
# Copyright 2016 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
from locust import HttpUser, TaskSet, task, between
from common_flows import flow_ial2_proofing, flow_sign_up, flow_helper
class IAL2SignUpLoad(TaskSet):
# Preload drivers license data
license_front = flow_helper.load_fixture("mont-front.jpeg")
license_back = flow_helper.load_fixture("mont-back.jpeg")
... |
#!/usr/bin/env python
import pdbtools.ligand_tools as ligand_tools
def main():
import argparse
title_line = 'convert pdbqt to pdb using reference pdb file'
parser = argparse.ArgumentParser(description=title_line)
parser.add_argument('-i', '--input_file', required=True,
help='i... |
#
# PySNMP MIB module CISCO-HARDWARE-IP-VERIFY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-HARDWARE-IP-VERIFY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:59:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... |
#!/usr/bin/env python
# coding:utf-8
#
"""
Copyright (c) 2017 LandGrey (https://github.com/LandGrey/taoman)
License: MIT
"""
import urllib
import requests
from lib.fun import crawl_link_handle
from lib.config import baidu_base_url, get_head, timeout, baidu_first_pattern, self_pattern, intranet_ip_pattern, \
ip_sim... |
"""Hash your files for easy identification."""
import hashlib
import logging
import os
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from typing import Dict
from flexget import plugin
from flexget.event import event
from flexget.logger import FlexGetLogger
from .cunit import IECUnit... |
import sys
sys.path.append("..")
from common import *
def parse(d):
temp = d.strip().split("\n")
first = tuple([int(n) for n in temp[0].strip().split(",")])
second = []
temp2 = []
print(temp)
for r in temp[1:]:
# print(r)
if(len(r) == 0):
second.append(tuple(temp2))... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... |
from typing import Callable, Dict
import rediscluster
import rediscluster.exceptions
import redgrease.client
import redgrease.data
import redgrease.utils
class RedisCluster(rediscluster.RedisCluster):
"""RedisCluster client class, with support for gears features
Behaves exactly like the rediscluster.RedisC... |
import tensorflow as tf
import numpy as np
def switch_case_cond(cases, default_case):
if cases:
condition, effect = cases[0]
return tf.cond(condition, effect, lambda: switch_case_cond(cases[1:], default_case))
return default_case()
def switch_case_where(cases, default_case):
if cases:
condition, effect = c... |
"""Functions to create, run and visualize optimization benchmarks.
TO-DO:
- Add other benchmark sets:
- finish medium scale problems from https://arxiv.org/pdf/1710.11005.pdf, Page 34.
- add scalar problems from https://github.com/AxelThevenot
- Add option for deterministic noise or wiggle.
"""
from pathlib i... |
# -----------------------------------------------
# ................. LIBRARIES ...................
# -----------------------------------------------
import glob
import os
import time
import numpy as np
# -----------------------------------------------
# ............. GLOBAL VARIABLES ................
# -------------... |
#system
import json
#sbaas
from .stage01_rnasequencing_genesCountTable_query import stage01_rnasequencing_genesCountTable_query
from .stage01_rnasequencing_analysis_query import stage01_rnasequencing_analysis_query
from SBaaS_base.sbaas_template_io import sbaas_template_io
# Resources
from io_utilities.base_importData... |
# -*- coding: utf-8 -*-
import re
import sys
import platform
import requests
from requests.auth import HTTPBasicAuth
from . import __version__
from . import log
def clean_name( name ):
""" replaces non-alpha with underscores '_'
and set the string to lower case
"""
return re.sub( '[^0-9a-zA-Z]+... |
#!/usr/bin/env python
"""
A simple script to organize photos into albums named by their camera source.
For me, this is useful for cycling through only high quality photos on my TV
hooked up to a chromecast.
"""
import argparse
import flickrapi
def auth_flickr(api_key, api_secret):
"""Authenticate user to flick... |
#-
# Copyright (c) 2015 Michael Roe
# All rights reserved.
#
# This software was developed by the University of Cambridge Computer
# Laboratory as part of the Rigorous Engineering of Mainstream Systems (REMS)
# project, funded by EPSRC grant EP/K008528/1.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open System... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^next/(?P<priornumber>[0-9]+)/$', views.nextSession, name='nextSession'),
url(r'^all/$', views.allSessions, name='allSessions'),
url(r'^allpt1/$', views.allSessionspt1, name='allSessionspt1'),
url(r'^allpt2/$', views.allSession... |
# Copyright (c) 2012 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 ... |
from __future__ import absolute_import, division, print_function
import collections
import tensorflow as tf
from synthesizer.models.helpers import TacoTestHelper, TacoTrainingHelper
from tensorflow.contrib.seq2seq.python.ops import decoder
from tensorflow.contrib.seq2seq.python.ops import helper as helper_py
from tenso... |
#!/usr/bin/env python2
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# ... |
from datetime import datetime
import json
from pathlib import Path
import pymssql
config_json: dict = json.loads(Path('config.json').read_text())
# Connecting to database
def connect():
global config_json
# Connect to Microsoft SQL server
conn = pymssql.connect(
server=config_json['server'],
... |
#!/usr/bin/env 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
# Copyright 2013 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 ... |
from numpy import ones
def get_Nr(self, Time=None):
"""Create speed in function of time vector Nr
Parameters
----------
self : OutElec
An OutElec object
Time : Data
a time axis (SciDataTool Data object)
Returns
-------
Nr: ndarray
speed in function of time
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.