content stringlengths 5 1.05M |
|---|
#!/usr/bin/python3
# -*- coding: latin-1 -*-
import os
import sys
# import psycopg2
import json
from bson import json_util
from pymongo import MongoClient
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
def create_app():
app = Flask(__name__)
return app
a... |
import time
import pytube
from .log import config_logger
from .step import Step
from pytube import YouTube
from multiprocessing import Process
from yt_concate.settings import VIDEOS_DIR
from threading import Thread
class DownloadVideos(Step):
def process(self, data, inputs, utils):
logging = config_l... |
# Generated by Django 3.1.3 on 2020-11-08 05:52
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("user", "0004_auto_20201108_0004"),
]
operations = [
migrations.AlterField(
model_name="user",
... |
import torch
import warnings
from torch.nn import Parameter
class WeightDrop(torch.nn.Module):
def __init__(self, module, weights, dropout=0):
super(WeightDrop, self).__init__()
self.module = module
self.weights = weights
if hasattr(module, "bidirectional") and module.bidirectional... |
class Constants:
WebSockerURL = "ws://localhost:2203"
Success = "success"
Type = "type"
SetCapabilities = "setCapabilities"
ErrorCode = "errorCode"
Error = "error"
Message = "message"
Gesture = "gesture"
GestureData = "gestureData"
FingerShortcutData = "fingerShortcutData"
Fi... |
from __future__ import absolute_import
import re
import unittest
from sqlbuilder.mini import P, Q, compile
__all__ = ('TestMini', 'TestMiniQ')
class TestCase(unittest.TestCase):
maxDiff = None
class TestMini(TestCase):
def test_mini(self):
sql = [
'SELECT', [
'author.... |
def add(lst):
"""Given a non-empty list of integers lst. add the even elements that are at odd indices..
Examples:
add([4, 2, 6, 7]) ==> 2
Example solution:
# line 1
even_sum = 0
# line 2
for i in range(len(lst)):
# line 3
if i % 2 == 0 and lst[i] % 2 == 0:
... |
A, B, C, D = map(int, input().split())
if A / B == C / D:
print("DRAW")
elif A / B < C / D:
print("TAKAHASHI")
else:
print("AOKI") |
import os
from PyQt4.QtCore import QSettings
import distutils
from distutils import util
#https://github.com/qgis/QGIS/blob/f38856e7381519431f828cc890bc8b33a8f2a544/src/gui/qgsmaptoolidentify.cpp#L413-L427
#min area in canvas units <- selected display projection
#e.g. WebMerc 100km2 = 100000000m2
min_area= 100000000
... |
"""
Author: shikechen
Function: Use requests lib to get AQI data
Version: 5.1
Date: 2019/5/13
"""
import requests
def get_html_text(url):
r = requests.get(url, timeout=30)
# print(r.status_code)
return r.text
def main():
city_pinyin = input('Input city\'s pinyin:')
url = 'http://... |
from model import G
data_path = 'items.json'
model = G(data_path)
model.main()
|
import pytest
from predictionserver.app.attributeapp_autogen import create_attribute_app
from predictionserver.app.localapp import create_local_app_process, kill_local_app_process
@pytest.fixture
def attribute_client():
app = create_attribute_app()
process = create_local_app_process(app=app)
yield app.tes... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
from django.db import models, migrations
from django.contrib.contenttypes.models import ContentType
from taiga.base.utils.contenttypes import update_all_contenttypes
def create_notifications(apps, schema_editor):
upda... |
# Copyright 2020 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,... |
# MIT License
#
# Copyright (C) IBM Corporation 2018
#
# 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... |
"""
Django settings for trailerplan_auth_py project.
Generated by 'django-admin startproject' using Django 3.1.7.
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/
"""
i... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 31 14:32:51 2019
@author: Steve O'Hagan
"""
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from IPython.display import SVG, display
from rdkit import Chem
from time import time
import pickle
#Import Keras objects
from keras.models impor... |
import secure
__all__ = ("set_secure_headers",)
# Angular requires default-src 'self'; style-src 'self' 'unsafe-inline';
# https://angular.io/guide/security#content-security-policy
csp_policy = (
secure.ContentSecurityPolicy()
.default_src("'self'")
.font_src("'self'", "fonts.gstatic.com")
.style_src(... |
# Generated by Django 2.2.9 on 2020-01-18 03:46
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ifthen', '0002_move_guid'),
]
operations = [
migrations.AlterField(
... |
from turtle import *
from enum import Enum
class Direction(Enum):
UL = 0
UR = 1
DL = 2
DR = 3
def square(size):
fd(size)
lt(90)
fd(size)
lt(90)
fd(size)
lt(90)
fd(size)
lt(90)
def square_dir(size, direction):
if direction == Direction.UL:
fd(size)
lt(90)... |
from django.conf.urls import patterns, include, url
from gallery import views
urlpatterns = patterns(
'',
url(r'^$', views.index, name='index'),
url(r"^(?P<gallery_id>\d+)/$", views.detail, name='detail'),
url(r"^(?P<gallery_id>\d+)/delete/$", views.delete, name='delete'),
url(r"^new/$", views.uplo... |
from selenium import webdriver
from .driver import browser
import unittest
class JdTest(unittest.TestCase):
def setUp(self):
self.driver = browser()
self.driver.implicitly_wait(30)
self.driver.maximize_window()
def tearDown(self):
self.driver.quit()
|
from .docker import *
import os
INSTALLED_APPS.append('raven.contrib.django.raven_compat')
RAVEN_CONFIG = {
'dsn': os.environ["SENTRY_DSN"],
'release': os.environ.get("APP_GIT_COMMIT", "no-git-commit-available")
} |
import numpy as np
import pandas as pd
from sklearn.cluster import DBSCAN as skDBSCAN
from cuml import DBSCAN as cumlDBSCAN
import cudf
import os
from collections import OrderedDict
import argparse
import datetime
from azureml.core.run import Run
## GPU execution
def gpu_load_data(fname, ncols):
dtypes = OrderedDi... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division
from flask import Blueprint
data_mod = Blueprint('data', __name__, url_prefix='/data', template_folder='./templates', static_folder='static')
from . import views
|
import torch
class DiscreteLowerboundModel(torch.nn.Module):
def __init__(self, model_pv, model_qu_x, model_context):
super(DiscreteLowerboundModel, self).__init__()
self.model_pv = model_pv
self.model_qu_x = model_qu_x
self.model_context = model_context
def forward(self, x):... |
# Copyright 2006-2012 Mark Diekhans
# Copyright sebsauvage.net
# FIXME cant this be replaced with https://pypi.python.org/pypi/sqlitedict/
"""
Code from:
http://sebsauvage.net/python/snyppets/index.html#dbdict
A dictionnary-like object for LARGE datasets
Python dictionnaries are very efficient objects for fast data... |
constants.physical_constants["proton Compton wavelength over 2 pi"] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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 _utilitie... |
"""
# Copyright (c) 2018 Works Applications Co., Ltd.
#
# 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... |
#!/usr/bin/env python
#===============================================================================
# Copyright (c) 2014 Geoscience Australia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are... |
'''OpenGL extension NV.vertex_program1_1
This module customises the behaviour of the
OpenGL.raw.GL.NV.vertex_program1_1 to provide a more
Python-friendly API
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions, wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.G... |
#!/usr/bin/env python
"""
Module that performs extraction. For usage, refer to documentation for the class
'Extractor'. This module can also be executed directly,
e.g. 'extractor.py <input> <output>'.
"""
import argparse
import hashlib
import multiprocessing
import os
import shutil
import tempfile
import traceback
i... |
import turtle
import random
riley = turtle.Turtle()
riley.width(5)
mood = random.choice(["happy", "sad", "angry", "party"])
if mood == "happy":
riley.color("yellow")
elif mood == "sad":
riley.color("blue")
elif mood == "angry":
riley.color("red")
elif mood == "party":
riley.color("magenta")
else:... |
from __future__ import print_function, division
import numpy as np
from numpy.random import RandomState
def estimate_mean_std(vals, esttype):
if esttype == 'robust':
mean = np.median(vals)
std = 1.4826 * np.median(np.abs(vals - mean))
elif esttype == 'mle':
mean = np.mean(vals)
... |
class Solution:
def divisorGame(self, N: int) -> bool:
if N==2:
return True
elif N==1:
return False
dp =[]
dp.append(True)
dp.append(True)
dp.append(True)
print(dp)
for i in range(3,N+1):
if i%2!=0:... |
# -*- coding:utf-8 -*-
'''
#Thanks to Osama Arafa's Camera_SwitchMenu, Help me learned to call ops in ops
#Thanks xVan for helping me with the camera'view undo option
#Thanks Bookyakuno for helping me add keymap (https://blenderartists.org/t/keymap-for-addons/685544/19?u=atticus_lv)
'''
bl_info = {
"name": "Smart... |
# Copyright 2014 Cisco Systems, 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 requir... |
# coding=utf8
from setuptools import setup
setup(
name="plugml",
version="0.2.4",
description="easy-to-use and highly modular machine learning framework",
long_description="easy-to-use and highly modular machine learning framework based on scikit-learn with postgresql data bindings",
url=... |
class User(object):
def __init__(self, id=None, name=None) -> None:
self.id = id
self.name = name
def setId(self, id):
self.id = id
def getId(self):
return self.id
def setName(self, name):
self.id = name
def getName(self):
return se... |
# hst.py Demo/test for Horizontal Slider class for Pyboard TFT GUI
# Adapted for (and requires) uasyncio V3
# Released under the MIT License (MIT). See LICENSE.
# Copyright (c) 2016-2020 Peter Hinch
import uasyncio as asyncio
import pyb
from tft.driver.constants import *
from tft.driver.tft_local import setup
from t... |
import config
import features
import colorama
import sys
import os
import json
from datetime import datetime
from mutagen.easyid3 import EasyID3
np = features.get_norm_path
colorama.init()
c_reset = colorama.Style.RESET_ALL
c_red = colorama.Fore.RED
c_green = colorama.Fore.GREEN
c_bright = colorama.Style.BRIGHT
c_dim... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 04 10:26:49 2018
@author: Mostafa Meliani <melimostafa@gmail.com>
Multi-Fidelity co-Kriging: recursive formulation with autoregressive model of order 1 (AR1)
Partial Least Square decomposition added on highest fidelity level
KPLSK model combined PLS followed by a Krging m... |
# coding=utf-8
# Author: Jianghan LI
# Question: 807.Max_Increase_to_Keep_City_Skyline
# Complexity: O(N)
# Date: 2018-03-24 0:11:06 - 0:20:48, 1 wrong try
class Solution(object):
def maxIncreaseKeepingSkyline(self, grid):
"""
:type grid: List[List[int]]
:rtype: int
"""
bo... |
import pytest
from optuna.study import create_study
from optuna.trial import Trial
from optuna.visualization.matplotlib import plot_optimization_history
@pytest.mark.parametrize("direction", ["minimize", "maximize"])
def test_plot_optimization_history(direction: str) -> None:
# Test with no trial.
study = cr... |
import numpy as np
import pandas as pd
from eppy import modeleditor
from eppy.modeleditor import IDF
import subprocess
import csv
def LHSample( D,bounds,N):
''' :param D:参数个数 :param bounds:参数对应范围(list) :param N:拉丁超立方层数 :return:样本数据 '''
result = np.empty([N, D])
temp = np.empty([N])
d = 1.0... |
'''
Visualize steps of the calibration process to ensure everything went according to plan
'''
from matplotlib import pyplot as plt
from astropy.io import fits
from visualization import zscale #https://github.com/abostroem/utilities
overscan_size = 32 #pixels
unusable_bottom = 48//2 #pixels
def visualize_bias(biasfi... |
import unittest
from unittest import TestCase
from agents.meter import Meter
class TestMeter(TestCase):
def test_get_latest_aggregate_consumption(self):
expected1 = 0.434
expected2 = 0.561
meter = Meter('MAC000002')
actual1 = meter.get_latest_consumption()
actual2 = mete... |
#!/usr/bin/env mayapy
#
# Copyright 2020 Autodesk
#
# 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... |
import json
import os
from random import shuffle
import pytest
from django.core.management import call_command
from django_dynamic_fixture import get
from readthedocs.projects.constants import PUBLIC
from readthedocs.projects.models import HTMLFile, Project
from readthedocs.search.documents import PageDocument
from r... |
import os
import configparser
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
config = configparser.ConfigParser()
config.read(os.path.join(PROJECT_ROOT, 'config.cfg'))
|
from django.contrib import admin
from .models import Project, UserProject
admin.site.register(Project)
admin.site.register(UserProject)
|
import re
def get_octets(address: str):
pattern = re.compile(r'\b(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})')
result = pattern.fullmatch(address)
try:
if int(max(result.groups(), key=lambda i: int(i))) > 255:
raise ValueError('Not a Valid Ip address')
octets = ['{:08b}'.format(... |
from bs4 import *
import urllib2
def page_parser(url):
print "downloading %s now" % url
page = urllib2.urlopen(url).read()
soup = BeautifulSoup(page)
paragraphs = soup.find_all('p')
text = [p.getText() for p in paragraphs]
return " ".join(text)
url_list = ["https://cran.r-project.org/doc/manu... |
# -*- coding:utf-8 -*-
import os
import re
import time
from datetime import timedelta
from .nVector import nVector
from mathutils import Vector, Matrix
from mathutils.geometry import intersect_sphere_sphere_2d
import math
import blf
import bgl
import bpy
import gpu
import bmesh
from gpu_extras.batch import batch_for_... |
def iteritems(p):
try:
it = p.iteritems()
except AttributeError:
it = p.items()
return it
def itervalues(p):
try:
it = p.itervalues()
except AttributeError:
it = p.values()
return it
|
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List, Optional
import bunch
import click
from openr.cli.commands import prefix_mgr
from openr.Open... |
#!/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
import time
import getopt
import matplotlib
from Enums import *
from matplotlib import pyplot as plt
from Crawler import Crawler
from NeuralNetwork import NeuralNetwork
from Hyperparameters import Hyperparameters
from Utils import Utils
def ge... |
from app import db
from flask_dance.consumer.backend.sqla import OAuthConsumerMixin, SQLAlchemyBackend
from flask_login import current_user
from app import blueprint
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(30), unique=True)
... |
from typing import List
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
result = [] # type: List[List[int]]
for start, end in sorted(intervals):
if result and start <= result[-1][1]:
result[-1][1] = max(result[-1][1], end)
e... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
from aiogram.dispatcher.filters import BoundFilter
from aiogram import types
class IsPrivate(BoundFilter):
async def check(self, message: types.Message):
return types.ChatType.PRIVATE == message.chat.type
|
from .connect import ConnectAPI
from .connect import AsyncConsumer
from .metric import Metric
from .resource import Resource
from .webhooks import Webhook
|
scan_time = 0.6
prefix = 'NIH:TEMP' |
"""Base class for August entity."""
from homeassistant.core import callback
from homeassistant.helpers.event import async_track_time_interval
class AugustSubscriberMixin:
"""Base implementation for a subscriber."""
def __init__(self, hass, update_interval):
"""Initialize an subscriber."""
s... |
#%%
import numpy as np
from kdg.utils import generate_gaussian_parity, generate_ellipse, generate_spirals, generate_sinewave, generate_polynomial
from kdg.utils import plot_2dsim
from kdg import kdf
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from scipy.io import savemat, loadmat
# %%
n_s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Morgane T.
mainScript
"""
# Libraries
from argparse import ArgumentParser
from distutils import util
import CTD_functions as CTD
import WP_functions as WP
import methods_functions as methods
import os
# Script version
VERSION = '1.0'
# Functions
def argu... |
"""
RealEstateAppRealitica
-------------
Script that runs a web scraper in a background and gets
all available real estates in Balkan area, and filters them
by given parameters(country, city, municipality).
You can get it by downloading it directly or by typing:
$ pip install RealEstateAppRealitica
After it is... |
#*----------------------------------------------------------------------------*
#* Copyright (C) 2021 Politecnico di Torino, Italy *
#* SPDX-License-Identifier: Apache-2.0 *
#* *
... |
def dict_intersection(dict1, dict2):
return {k: v for k, v in dict1.items() if dict2.get(k) == v}
|
import xlrd
import json
filename1 = r"C:\Users\Terry\Desktop\SKUs.xls"
def reader():
data = xlrd.open_workbook(filename1)
table = data.sheets()[0]
company = []
for i in range(0,table.ncols):
company.append(table.col_values(i))
# print(table.col_values(i))
print(company[1])
# pr... |
# Monsters Castle Socket Server
# Python 2.7.14
import socket, select, os, time, json, struct, hashlib
import game, msg, scene
CONNECTION_LIST = [] # Read sockets
CONNECTION_USERS = {} # Socket-Username (if not logined, username is None)
CONNECTION_MSGQUEUE = {} # Socket-MsgQueue [[len, str], tail]
USERS_CON... |
# Copyright (C) 2020 Adek Maulana.
# All rights reserved.
"""
Heroku manager for your Fire-X
"""
import asyncio
import math
import os
import heroku3
import requests
from telegraph import Telegraph
from firebot import CMD_HELP
from firebot.utils import edit_or_reply, fire_on_cmd, sudo_cmd
telegraph = Telegraph()
... |
#!/usr/bin/env python
# Brocapi HTTP API
__copyright__ = """
Copyright 2017 FireEye, 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... |
# info
READ_DOGS = 'Reading dogs information ...'
WRITE_DOGS = 'Writen new dog to database ...'
UPDATE_DOGS = 'Updating dog information in database ...'
DELETE_DOGS = 'Deleting dog information from database ...'
|
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import msgprint, _
from client.hr_services.doctype.end_of_service_a... |
import heterocl as hcl
import numpy as np
import time
import plotly.graph_objects as go
from gridProcessing import Grid
from shape_functions import *
from custom_graph_functions import *
from DubinsCar import *
import math
""" USER INTERFACES
- Define grid
- Generate initial values for grid using shape functions
- ... |
# 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 writing, software
# distributed under the... |
# coding: utf-8
import os
import time
import libmc
import slow_memcached_server
import subprocess
def memcached_server_ctl(cmd, port):
ctl_path = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__)
))),
'misc', 'memcached_server'
)
... |
import numpy as np
import paddle
import pytest
import tensorflow as tf
import torch
from finetuner.tuner.callback import EarlyStopping
from finetuner.tuner.keras import KerasTuner
from finetuner.tuner.paddle import PaddleTuner
from finetuner.tuner.pytorch import PytorchTuner
from finetuner.tuner.state import TunerStat... |
from bs4 import BeautifulSoup
from bs4.element import Tag
from lxml import objectify
import xmltodict
from functools import wraps
from app.modules.firewall import Firewall
import ConfigParser, re, json, logging
from threading import Thread
from requests import get
from requests.packages.urllib3.exceptions import Insecu... |
##### Uncompyle #####
# Author: AnonPrixor
# This is a Public and Simple Script
import os
import sys
import time
def logo():
print("""
[+]==========================[+]
# Pyc > Py Decompiler #
# Author: AnonPrixor #
# Team: PureXploit #
[+]==========================[+]
""")
def uncompyle(... |
import numpy as np
from bayesnet.tensor.constant import Constant
from bayesnet.tensor.tensor import Tensor
from bayesnet.function import Function
class Swapaxes(Function):
def __init__(self, axis1, axis2):
self.axis1 = axis1
self.axis2 = axis2
def forward(self, x):
x = self._convert2... |
#!/usr/bin/env python3
from tkinter import *
# class Layout:
# Main:
calc = Tk()
calc.title("Calculette de merde")
calc.configure(background="orange")
# make buttons fit the window (column / row)
calc.grid_columnconfigure(0, weight=1)
calc.grid_columnconfigure(1, weight=1)
calc.grid_columnconfigure(2, weight=1)
c... |
"""Constants for the Eloverblik integration."""
DOMAIN = "eloverblik"
|
import random
import numpy as np
import tensorflow as tf
def set_global_seeds(i):
tf.set_random_seed(i)
np.random.seed(i)
random.seed(i)
def tf_print(tensor, name):
return tf.Print(tensor, [tensor],
summarize=10000,
message='{} tensor:\n'.format(name))
def batch_to_seq(tensor, is_train):
... |
a = []
for line in open('day1.txt').read().split('\n'):
a.append(int(line))
n = len(a)
c = 0
for i in range(n):
for j in range(i + 1, n):
for k in range(j + 1, n):
x = a[i]
y = a[j]
z = a[k]
c = c + 1
if x + y + z == 2020:
pri... |
#!/usr/bin/env python
'''
Author: Christopher Duffy
Date: March 2015
Name: msfrpc_smb.py
Purpose: To scan a network for a smb ports and validate if credentials work on the target host
Copyright (c) 2015, Christopher Duffy All rights reserved.
Redistribution and use in source and binary forms, with or without modificati... |
# coding: utf-8
import pprint
import re
import six
class VerificationCodeDTO:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the valu... |
from tkinter import Frame,Canvas,NW,N,S,SUNKEN,ALL,Message,CENTER
from tkinter import messagebox
from PIL import Image,ImageTk
import math
import time
import random
import os.path
from os import listdir
from os.path import isfile, join
from matrixTile import matrixTile
from configShisen import configShisen
from tileboa... |
distancia = int(input('Digite a distancia da sua viagem: '))
valor1 = distancia*0.5
valor2 = distancia*0.45
if distancia > 200:
print('O preço dessa viagem vai custar R${}'.format(valor2))
else:
print('O preço dessa viagem vai custar R${}'.format(valor1))
print('--fim--') |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from os import path
import sys
import datetime
sys.path.append(path.dirname(path.dirname(path.dirname(__file__))))
from Data... |
import sys
def fibonacci(n):
a, b, counter = 0, 1, 0
while True:
if (counter > n):
return
#yield a
a, b = b, a + b
print('%d,%d' % (a,b))
counter += 1
f = fibonacci(10)
# ------------------------------------------------------------------------------------... |
# This is not 100% vanilla, because still we need to replace the xml of new body.
#
import numpy as np
import pybullet
from pybullet_envs.gym_locomotion_envs import WalkerBaseBulletEnv, Walker2DBulletEnv
from pybullet_envs.robot_locomotors import WalkerBase, Walker2D
from pybullet_envs.scene_stadium import MultiplayerS... |
from math import hypot
c = float(input('Digite o cateto: '))
ca = float(input('Digite o catedo adjacente: '))
h = hypot(c, ca)
print('A hipotenusa tem o valor de {:.2f}'.format(h)) |
from sys import path
from os.path import dirname as dir
from shutil import rmtree
path.append(dir(path[0]))
from analizer import grammar
from analizer.reports import BnfGrammar
from analizer.interpreter import symbolReport
dropAll = 0
if dropAll:
print("Eliminando registros")
rmtree("data")
s = """
--SELE... |
# fastfield main python script.
## change enviroment variable
## activate 'walker'
import json
import pickle as pck
import os
import shutil
#use after database analysis
class move_FILE():
def __init__(self,input_dir,output_file_name,output_dir):
# open_JSON class instantiation
self.output_file_name = output_fil... |
from django.urls import path
from .views import (
PostListView,
PostListViewByTag,
PostDetailView,
PostCreateView,
PostUpdateView,
PostDeleteView,
UserPostListView,
SearchPostView,
CommentCreateView,
post_like,
PostLikeViewRedirect,
PostLikeAPI,
)
from . import views
from... |
"""
Maze environment for reinforcement learning, with the python package tkinter.
Red rectangle: explorer.
Black rectangle: hells [reward = -1]
Yellow bin circle: paradise [reward = +1]
All other state: ground [reward = 0]
Alse referenced the tutorial of morvanzhou: https://morvanzhou.github.i... |
#! venv/bin/python
import unittest
import benicio
from app import db, views, models
dbs = db.session
class BenicioTestCase(unittest.TestCase):
def setUp(self):
benicio.app.config['TESTING'] = True
benicio.app.config['WTF_CSRF_ENABLED'] = False
self.client = benicio.app.test_client()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.