content stringlengths 5 1.05M |
|---|
from django.conf.urls import include, url
from mailviews.previews import autodiscover, site
autodiscover()
app_name = 'mailviews'
urlpatterns = [
url(regex=r'', view=site.urls)
]
|
# THIS FILE IS SAFE TO EDIT. It will not be overwritten when rerunning go-raml.
from flask import jsonify, request
from ..models import FarmerRegistration, FarmerNotFoundError
def GetFarmerHandler(iyo_organization):
try:
farmer = FarmerRegistration.get(iyo_organization)
except FarmerNotFoundError:
... |
import web
from web import form
import socket
import sensor
from threading import Thread
localhost = "http://" + socket.gethostbyname(socket.gethostname()) + ":8080"
print(localhost)
urls = (
'/','Login',
'/control','Page_one',
'/left', 'Left',
'/right', 'Right',
'/... |
import os
import sys
command = " ".join(sys.argv[1:])
os.system(command)
|
from __future__ import unicode_literals, print_function
from pprint import pprint
import xmltodict
with open("show_security_zones.xml") as infile:
show_security_zones = xmltodict.parse(infile.read())
print("\n\n")
print("Print the new variable and its type")
print("-" * 20)
pprint(show_security_zones)
print(typ... |
# https://www.urionlinejudge.com.br/judge/en/problems/view/1012
entrada = input().split()
a = float(entrada[0])
b = float(entrada[1])
c = float(entrada[2])
print(f"TRIANGULO: {a*c/2:.3f}")
print(f"CIRCULO: {3.14159*c**2:.3f}")
print(f"TRAPEZIO: {(a+b)*c/2:.3f}")
print(f"QUADRADO: {b**2:.3f}")
print(f"RETANGU... |
import torch
tau = 6.28318530718
class FractalPerlin2D(object):
def __init__(self, shape, resolutions, factors, generator=torch.random.default_generator):
shape = shape if len(shape)==3 else (None,)+shape
self.shape = shape
self.factors = factors
self.generator = generator
s... |
import json
from unittest.mock import Mock
import graphene
from django.conf import settings
from django.shortcuts import reverse
from django_countries import countries
from django_prices_vatlayer.models import VAT
from tests.utils import get_graphql_content
from saleor.core.permissions import MODELS_PERMISSIONS
from ... |
# Copyright 2019 Huawei Technologies 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 or agreed to... |
#!/usr/bin/env python3
"""
# scripts/manifest/lib/verify_input.py
# (c) 2020 Sam Caldwell. See LICENSE.txt.
#
# input verification functions.
#
"""
from .hasher import SUPPORTED_HASH_ALGORITHMS
def url_string(s: str) -> bool:
"""
Verify the given string (s) is a URL.
:param s: string
:r... |
from flask import Flask, request, jsonify
import customs.orchestrator as orch
import customs.validator as valid
app = Flask(__name__)
@app.route('/customs', methods=['POST'])
def customs():
content = request.get_json(silent=True) # exception?
check = valid.is_json_correct(content)
if check is True:
... |
a = float(input("Zadej velikost polomeru kruhu v cm: "))
obsah = a*a*3.14
obvod = 2*3.14*a
print("Obsah je", "", obsah, "cm")
print("Obvod je", "", obvod, "cm") |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.0
# kernelspec:
# display_name: Python [conda env:PROJ_irox_oer] *
# language: python
# name: conda-env-PROJ... |
#import random package
import random
#get random number between 1 and 10
#print(random.randint(0, 1))
choice = random.randint(0,3)
if choice == 0:
print("Tails")
elif choice == 1:
print("Heads")
else:
print("Your quarter fell in the gutter.")
#get random number between 1 and 100
# print(random.randint(0,... |
# Copyright (c) 2018, Neil Booth
#
# All rights reserved.
#
# The MIT License (MIT)
#
# 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 r... |
from mopidy import backend
class KitchenPlaybackProvider(backend.PlaybackProvider):
def translate_uri(self, uri):
return self.backend.library.get_playback_uri(uri)
|
url = "https://lenta.ru/parts/news/"
user_agent = "text"
|
#Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
#For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
#Bonus: Can you do this in one pass?
def k_sum_in_list(k, list):
needed = {}
for n in list:
if needed.get(n, False):
... |
"""Test suits for Anytown Mapper."""
import math
import os
import unittest
import sqlite3
import tempfile
from main import app
from main import get_db
from main import init_db
from anytownlib.kavrayskiy import coords_to_kavrayskiy
from anytownlib.kavrayskiy import make_global_level_image
from anytownlib.map_cache im... |
# flake8: noqa
# Import all APIs into this package.
# If you have many APIs here with many many models used in each API this may
# raise a `RecursionError`.
# In order to avoid this, import only the API that you directly need like:
#
# from .api.chamber_schedule_api import ChamberScheduleApi
#
# or import this pack... |
from flask import Flask,render_template,request,redirect,url_for
import os, git
def styleSheet():
stylesheet = "/static/styles/light_theme.css"
if request.cookies.get('darktheme') == 'True':
stylesheet = "/static/styles/dark_theme.css"
return stylesheet
def create_app(test_config=None):
# cre... |
#!/usr/bin/env python
try:
from scapy.all import *
#from scapy.layers.dot11 import Dot11, Dot11Elt, Dot11Auth, Dot11Beacon, Dot11ProbeReq, Dot11ProbeResp, RadioTap
from gui.tabulate_scan_results import Gui
from multiprocessing import Process
import time, threading, random, Queue
import signal, os
import scapy_e... |
from pyibex import Interval, tan, bwd_imod, atan
import math
def Cmod(x,y):
xx = Interval(x)
yy = Interval(y)
bwd_imod(xx,yy,2*math.pi)
return yy
def Catan2(x,y,th):
iZeroPi2 = Interval(0)| Interval.PI/2.
iPi2Pi = Interval.PI/2. | Interval.PI
if x.is_empty() or y.is_empty() or th.is_empty():
return... |
#!/usr/bin/env python
import maccleanmessages
import sys
from setuptools import setup
requires=[]
if sys.version_info[:2] == (2, 6):
requires.append('argparse>=1.1')
setup(
name='maccleanmessages',
version=maccleanmessages.__version__,
description='Remove macOS Messages app history (chats / texts ... |
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
from pyparsing import lineno, col
"""
Base classes for implementing decoder parsers.
A decoder parser receives a data structure and returns an instance of a class
from the domain model.
For example, it may receive a JSON and return a CWRFile instance.
... |
# MIT License
#
# Copyright (c) 2020 Adam Dodd
#
# 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, pu... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import logging
def categorical_accuracy(preds, y):
"""Return accuracy given a batch of label distributions and true labels"""
max_preds = preds.argmax(dim=1, keepdim=True)
correct = max_preds.squeeze(1).eq(y)
return correct.sum().floa... |
from pathlib import Path
import pandas as pd
DATA_DIR = Path('data')
DIR = DATA_DIR / 'raw' / 'jigsaw-unintended-bias-in-toxicity-classification'
def load_original_dataset():
df = pd.read_csv(DIR / 'train.csv', index_col=0)
df['label'] = (df.target >= 0.5)
df = df[['comment_text', 'label']]
df.column... |
import yunionclient
from yunionclient.common import utils
import json
@utils.arg('--limit', metavar='<NUMBER>', default=20, help='Page limit')
@utils.arg('--offset', metavar='<OFFSET>', help='Page offset')
@utils.arg('--order-by', metavar='<ORDER_BY>', help='Name of fields order by')
@utils.arg('--order', metavar='... |
inter = dict.fromkeys([x for x in a if x in b])
|
n1 = int(input('Digite um valor: '))
n2 = int(input('Digite outro valor: '))
s= n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
e = n1 ** n2
print(f'A soma é: {s}, o produto é: {m}, a divisão é: {d:.3f},', end=' ')
print(f'a divisão inteira é: {di} e a potência é: {e}') |
"""
Utility functions
=======================
"""
import time
from . import RUNNING_ON_PI
if RUNNING_ON_PI: # pragma: no cover
import RPi.GPIO as GPIO
def digital_write(pin, value): # pragma: no cover
GPIO.output(pin, value)
def digital_read(pin): # pragma: no cover
return GPIO.input(pin)
def del... |
from unittest.mock import patch
from django.test import TestCase
from vimage.core.base import VimageKey, VimageValue, VimageEntry
from .const import dotted_path
class VimageEntryTestCase(TestCase):
def test_entry(self):
ve = VimageEntry('app', {})
self.assertIsInstance(ve.key, VimageKey)
... |
# -*- coding: utf-8 -*-
"""Utilities related to reading and generating indexable search content."""
from __future__ import absolute_import
import os
import fnmatch
import re
import codecs
import logging
import json
from builtins import next, range
from pyquery import PyQuery
log = logging.getLogger(__name__)
def... |
from django.test import TestCase
from wagtailimportexport import functions
class TestNullPKs(TestCase):
"""
Test cases for null_pks method in functions.py
"""
def test_null(self):
pass
class TestNullFKs(TestCase):
"""
Test cases for null_fks method in functions.py
"""
def tes... |
from django import forms
from django.contrib.contenttypes.forms import generic_inlineformset_factory
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.test import TestCase
from django.test.utils import isolate_apps
from .models import (
Animal, ForProxyMode... |
from django.db import models
class Core(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(max_length=100)
back_story = models.TextField()
height = models.CharField(max_length=50)
weight = models.FloatField()
strength = models.IntegerField()
wisdom = model... |
# high-level interface for interacting with Brick graphs using rdflib
# setup our query environment
from rdflib import RDFS, RDF, Namespace, Graph, URIRef
class BrickGraph(object):
def __init__(self, filename='metadata/sample_building.ttl'):
self.bldg = Graph()
self.bldg = Graph()
self.bldg... |
#!/usr/local/bin/python3
from random import randint
def sortea_numero():
return randint(1, 6)
def eh_impar(numero: float):
return numero % 2 != 0
def acertou(numero_sorteado: float, numero: float):
return numero_sorteado == numero
if __name__ == '__main__':
numero_sorteado = sortea_numero()
... |
import pytest
from datetime import datetime, timedelta
import xarray as xr
import cftime
import numpy as np
import vcm
from vcm.cubedsphere.constants import TIME_FMT
from vcm.convenience import (
cast_to_datetime,
parse_current_date_from_str,
parse_timestep_str_from_path,
round_time,
parse_datetime... |
# This code is based off the DUET algorithm presented in:
# O. Yilmaz and S. Rickard, "Blind separation of speech mixtures via time-frequency masking."
# S. Rickard, "The DUET Blind Source Separation Algorithm"
#
# At this time, the algorithm is not working when returning to the time domain
# and, to be honest, I haven... |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2016 the HERA Collaboration
# Licensed under the BSD License.
"""The way that Flask is designed, we have to read our configuration and
initialize many things on module import, which is a bit lame. There are
probably ways to work around that but things work well enough ... |
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from datetime import datetime
import pandas as pd
class Funcion_salida:
def Retirar_desplegar_teclado(self):
MOV = -100
# movimiento botones
self.salida_nombre.setGeometry(self.width/3.6, (self.height/2.7)+... |
class Command:
def __init__(self, name, obj, method, help_text):
assert hasattr(method, '__call__')
self._name = str(name)
self._obj = obj
self._method = method
self._help = str(help_text)
@property
def name(self):
return self._name
@property
def hel... |
from __future__ import print_function
from hawc_hal import HAL
import matplotlib.pyplot as plt
from threeML import *
import pytest
from conftest import point_source_model
@pytest.fixture(scope='module')
def test_fit(roi, maptree, response, point_source_model):
pts_model = point_source_model
hawc = HAL("HAWC... |
#!/usr/bin/env python
import os
import sys
sys.path.insert(0,os.environ['HOME']+'/P3D-PLASMA-PIC/p3dpy/')
import numpy as np
from mpi4py import MPI
from subs import create_object
import AnalysisFunctions as af
#
# MPI INITIALIZATION
#
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
status = MPI.St... |
import unittest
from sharepp import SharePP, Coin
class SharePPTest(unittest.TestCase):
def test_valid_input(self):
price = SharePP.get_etf_price("LU1781541179")
self.assertTrue(float, type(price))
def test_invalid_input(self):
try:
SharePP.get_etf_price("invalid_isin")
... |
#!/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-10-19 16:23:55
from __future__ import unicode_literals
from flask import render_template, request, json
from flask import Response
from .app import a... |
import os
import shutil
import subprocess
def create_videos(video_metadata, relevant_directories, frame_name_format, delete_source_imagery):
stylized_frames_path = relevant_directories['stylized_frames_path']
dump_path_bkg_masked = relevant_directories['dump_path_bkg_masked']
dump_path_person_masked = rel... |
from django.urls import path, include
from mighty.functions import setting
from mighty.applications.user import views
urlpatterns = [
path('user/', include([
path('create/', views.CreateUserView.as_view(), name="use-create"),
])),
]
api_urlpatterns = [
path('user/', include([
path('form/',... |
from django.core.management.base import BaseCommand, CommandError
from openfood.models import Product, Category, Position
from django.db import models
from datetime import datetime
import sys
import requests
class Collector:
"""
Get products from Open Food Facts database.
Register fields for 'Products' &... |
import altair as alt
from model import data_wrangle
def return_fatality_bar_chart(value=None):
"""
creates an altair chart object for the plot of the fatality barchart.
Parameters
----------
value: the value passed in from the radio buttons.
"0", "1", and "2" for "first-world", "non-first-wo... |
import sys
from collections import OrderedDict
import calplot
import pandas as pd
def loadData(filename: str):
df = pd.read_csv(filename, usecols=['DateTime', 'Open', 'High', 'Low', 'Close', 'Volume'], na_values=['nan'])
df['DateTime'] = pd.to_datetime(df['DateTime'], utc=True).dt.tz_convert('US/Eastern')
... |
from aiohttp import web, test_utils
import typing
import asyncio
import functools
from .const import InputQuery
import attr
@attr.s
class AppContainer:
host: typing.Optional[str] = attr.ib(default=None)
port: typing.Optional[int] = attr.ib(default=None)
_app: web.Application = attr.ib(factory=web.Applica... |
'''OpenGL extension SGIS.texture_color_mask
Overview (from the spec)
This extension implements the same functionality for texture
updates that glColorMask implements for color buffer updates.
Masks for updating textures with indexed internal formats
(the analog for glIndexMask) should be supported by a separate ... |
from .api import AppSyncAPI
|
# -*- coding: utf-8 -*-
import time
from typing import List, Dict, Any
from chaosaws import aws_client
from chaoslib.exceptions import FailedActivity
from chaosaws.types import AWSResponse
from chaoslib.types import Configuration, Secrets
from logzero import logger
from .constants import OS_LINUX, OS_WINDOWS, GREP_PR... |
import torch as T
import dataclasses as dc
from typing import Optional, Callable
def vanilla_gradient(
output, input,
filter_outliers_quantiles:tuple[float,float]=[.005, .995]):
map = T.autograd.grad(output, input)
assert isinstance(map, tuple) and len(map) == 1, 'sanity check'
map = map[0... |
import argparse
import torch
import wandb
wandb.login()
from dataloader import get_dataloaders
from utils import get_model
from train import Trainer
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', required=True, choices=['c10', 'c100', 'svhn'])
parser.add_argument('--model', required=True, choice... |
def divide(num):
try:
return 42 / num
except ZeroDivisionError:
print('Error: Invalid argument')
print(divide(2))
print(divide(12))
print(divide(0))
print(divide(1))
|
# coding=utf-8
#
# created by kpe on 28.Mar.2019 at 15:56
#
from __future__ import absolute_import, division, print_function
|
import graphviz
dot = graphviz.Digraph(comment='GIADog system overview')
dot.render('output/system.gv', view=True) |
# The MIT License (MIT)
# Copyright (c) 2020 Mike Teachman
# https://opensource.org/licenses/MIT
# Platform-independent MicroPython code for the rotary encoder module
# Documentation:
# https://github.com/MikeTeachman/micropython-rotary
import micropython
_DIR_CW = const(0x10) # Clockwise step
_DIR_CCW = const(0... |
from flask import Flask
app = Flask(__name__)
import sqreen
sqreen.start()
from app import routes
if __name__ == '__main__':
app.run(debug=True)
|
"""Module to generate datasets for FROCC
"""
import os
import numpy as np
import sklearn.datasets as skds
import scipy.sparse as sp
def himoon(n_samples=1000, n_dims=1000, sparsity=0.01, dist=5):
# n_samples = 1000
# n_dims = 1000
# dist = 5
# sparsity = 0.01
x, y = skds.make_moons(n_samples=n_sa... |
import pytest
from mixer.main import mixer
from smpa.models.address import Address, SiteAddress
@pytest.fixture
def address():
obj = Address()
obj.number = "42"
obj.property_name = "property name"
obj.address_line_1 = "address line 1"
obj.address_line_2 = "address line 2"
obj.address_line_3 =... |
# Russell RIchardson
# Homework 2, problem 1
"""This reads from a text file and returns a string of the text"""
def read_from_a_file(the_file):
file=open(the_file,'r')
the_string=file.read()
file.close()
return the_string
"""This takes in a string and writes that string to a text file"""
def write... |
"""
Perform inference on inputted text.
"""
import utils
import torch
from termcolor import cprint, colored as c
import model
import data
import re
import sys
source = sys.argv[1]
# get an edgt object
def get_edgt():
input_chars = list(" \nabcdefghijklmnopqrstuvwxyz01234567890")
output_chars = ["<nop>", "<cap... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''checkplot.py - Waqas Bhatti (wbhatti@astro.princeton.edu) - Jan 2017
License: MIT.
Contains functions to make checkplots: quick views for determining periodic
variability for light curves and sanity-checking results from period-finding
functions (e.g., from periodbase)... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lazy_read.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol... |
import os
import sys
import socket
import time
from multiprocessing import Process
from pathlib import Path
from typing import Tuple, Union
import torch
from torch.utils.tensorboard import SummaryWriter
from super_gradients.training.exceptions.dataset_exceptions import UnsupportedBatchItemsFormat
# TODO: These utils... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2016-2017 Stella/AboodXD
# Supported formats:
# -RGBA8
# -RGB10A2
# -RGB565
# -RGB5A1
# -RGBA4
# -L8/R8
# -L8A8/RG8
# -BC1
# -BC2
# -BC3
# -BC4U
# -BC4S
# -BC5U
# -BC5S
# Feel free to include this in your own program if you want, just give cr... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
# Marcelo Campos de Medeiros
# ADS UNIFIP
# REVISÃO DE PYTHON
# AULA 10 CONDIÇÕES GUSTAVO GUANABARA
'''
Faça um Programa que pergunte o salário do funcionário e calcule o valor do seu aumento.
* Para salários superiores a R$ 1.250.00, Calcule um aumento de 10%.
* Para os inferiores ou iguais o aumento é de 15%... |
# global imports
from dash.dependencies import Input, Output, State, ALL # ClientsideFunction
from dash import html
# local imports
from ..dash_app import app
import pemfc_gui.input as gui_input
from .. import dash_layout as dl
tab_layout = html.Div(dl.frame(gui_input.main_frame_dicts[1]))
@app.callback(
Outpu... |
import bitmex
import time
import pandas as pd
from keys import ID, SECRET, SLACK_TOKEN
from slackclient import SlackClient
sc = SlackClient(SLACK_TOKEN)
client = bitmex.bitmex(test=False, api_key=ID, api_secret=SECRET)
dfpair = []
def get_volume_data(client):
dfpair.clear()
dfxbt = client.Trade.Trade_getBuc... |
#!/usr/bin/env python3
import sys
if len(sys.argv) > 1:
infilename = sys.argv[1]
else:
infilename = 'input.txt'
with open(infilename, 'r') as infile:
buf= [line.strip().split() for line in infile]
max_col = max([len(x) for x in buf])
print(max_col)
row_checksums = []
for line in buf:
maximum = 0
minim... |
import itertools
from typing import Optional, Sequence
from eth_typing import Address, BlockNumber, Hash32
from eth_utils import is_same_address
from sqlalchemy import orm
from sqlalchemy.orm.exc import NoResultFound
from cthaeh.filter import FilterParams
from cthaeh.loader import get_or_create_topics
from cthaeh.mod... |
import yaml
import contextlib
import logging
from teuthology import misc as teuthology
from teuthology.orchestra import run
log = logging.getLogger(__name__)
import os
import pwd
import time
import argparse
"""
# Test yaml to test script mapper for boto3
tests_mapper_v2 = {'test_Mbuckets_basic': 'test_Mbuckets_basic'... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#- Author : (DEK) Devendra Kavthekar
# program068:
# Please write a program using generator to print the even numbers between
# 0 and n in comma separated form while n is input by console.
# Example:
# If the following n is given as input to the program:
# 10
# The... |
import numpy as np
from typing import Union, Optional
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.utils.annotations import override
from ray.rllib.utils.exploration.exploration import Exploration, TensorType
from ray.rllib.utils.framework import try_import_tf, try_import_torch, \
get... |
version = "2021.11.29.01"
|
import logging
from itertools import chain
from pprint import pformat
from future.utils import lmap
from foxylib.tools.collections.collections_tool import merge_dicts, DictTool, lchain
from foxylib.tools.database.elasticsearch.elasticsearch_tool import ElasticsearchTool
from foxylib.tools.json.json_tool import JsonTo... |
from django.shortcuts import render
from django.http import HttpResponse
from .models import User
# Create your views here.
def help(request):
helpdict = {'help_insert':'HELP PAGE'}
return render(request,'appTwo/help.html',context=helpdict)
def index(request):
return render(request,'appTwo/index.html')
d... |
import wx
from wx.adv import CalendarCtrl, GenericCalendarCtrl
from get_file import get_file
from wx import adv
from static.MButton import MButton
class TimeFrame(wx.Frame):
'''类似于日程表, 可以添加事件及其时间段, 到了相应的时间会提醒用户'''
def __init__(self, parent, data=None):
wx.Frame.__init__(self, parent, title='日程表', si... |
import argparse
import cv2
# ap = argparse.ArgumentParser()
# ap.add_argument("--i", "--image", required=True, help="path to input image")
# args= vars(ap.parse_args())
# image = cv2.imread(args["image"])
image = cv2.imread("lena.png")
(h, w, c)= image.shape[:3]
#height= no of rows, width= no of columns, channnel= ... |
import discord
from discord.ext import commands
from discord.utils import get
class c259(commands.Cog, name="c259"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Abyssal_Awakening', aliases=['c259', 'Abyssal_10'])
async def example_embed(self, ctx):
embed =... |
# Imports
from django.db import models
from django.contrib.auth.models import User
# Lead
class Lead(models.Model):
name = models.CharField(max_length=255)
email = models.EmailField(max_length=255, unique=True)
message = models.CharField(max_length=500, blank=True)
owner = models.ForeignKey(User, related_name=... |
# ckwg +28
# Copyright 2018 by Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditi... |
# Copyright 2017 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... |
# -*- coding: utf-8 -*-
r"""Consider the following properties of relation $r$. Because the corruption operations (see `Corruption`_)
are applied independently of triples, the resulting candidate corrupt triples could overlap with known positive
triples in $\mathcal{K}$.
===================== ========================... |
import statistics
import os
import jwql.instrument_monitors.miri_monitors.data_trending.utils.mnemonics as mn
import jwql.instrument_monitors.miri_monitors.data_trending.utils.sql_interface as sql
import jwql.instrument_monitors.miri_monitors.data_trending.utils.csv_to_AstropyTable as apt
from jwql.utils.utils imp... |
import matplotlib.pyplot as plt
def show(*args, **kws):
"""Show a window with the given plot data. Blocks until window is closed.
Parameters
----------
*args : pyplot args
**kws : pyplot kw
Examples
--------
Plot a line.
>>> bplot.line(x, y)
>>> bplot.show()
"""
plt.show(*args, *... |
import matplotlib.pyplot as plt
from keras.preprocessing import image
import warnings
warnings.filterwarnings("ignore")
import time
import os
import numpy as np
import pandas as pd
from tqdm import tqdm
import json
#from basemodels import VGGFace, OpenFace, Facenet, Age, Gender, Race, Emotion
#from extendedmodels impo... |
"""Module containing a template class to generate counterfactual explanations.
Subclasses implement interfaces for different ML frameworks such as TensorFlow or PyTorch.
All methods are in dice_ml.explainer_interfaces"""
from abc import ABC, abstractmethod
from collections.abc import Iterable
import numpy as np... |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
from setuptools import setup
setup(name='my-package-ahadmushir',
version='0.0.1',
description='Testing installation of Package',
url='https://github.com/ahadmushir/my_first_package',
author='ahadmushir',
author_email='a.ahad.mushir@gmail.com',
license='MIT',
packages=['mypackage'],
zip_safe=False)
|
'''
Author : Bhishm Daslaniya [17CE023]
"Make it work, make it right, make it fast."
– Kent Beck
'''
n = int(input("Enter number: "))
print("Factors of "+ str(n) )
for _ in range(1,n):
if(n % _ == 0):
print( _ ,end=" ") |
# coding: utf-8
from flask import Blueprint
scope = Blueprint("scope", __name__, url_prefix="/scope/")
|
__author__ = 'matth'
import unittest
import sys
from processfamily.test import ParentProcess, Config
import os
import subprocess
import requests
import time
import socket
import logging
import glob
from processfamily.processes import process_exists, kill_process, AccessDeniedError
from processfamily import _traceback_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.