content stringlengths 5 1.05M |
|---|
from pprint import pprint
from tylmdparser import parse
from enum import Enum
import sys
class TypeInfer():
def __init__(self, ast):
self.__num = 0
self.tenv = {}
self.constraint = []
self.typed_ast = self.__typing(ast)
def __gensym(self):
self.__num = self.__num + 1
... |
class MyTypeError(TypeError):
def __init__(self, message: str, code: int):
super().__init__(message)
self._code = code
@property
def code(self) -> int:
return self._code
if __name__ == "__main__":
error = MyTypeError("Waht?", 12345)
print(error)
print(error.code)
"""
Raises error bec... |
# Django specific imports...
from django.conf import settings
from django.views.decorators.csrf import csrf_exempt, csrf_protect, ensure_csrf_cookie, requires_csrf_token
from django.core.context_processors import csrf
from django.views.generic import View
from django.http import HttpResponseBadRequest, HttpResponse , ... |
# compatibility module.
import itertools
import sys
from six.moves import configparser
map = itertools.imap if sys.version_info < (3,) else map
|
'''
Storage Path
============
The StorgePath API can be used to gain access to standard storage locations
across platforms such as home directory, root directory, external storage
directory, documents, downloads, etc.
The :class:`StoragePath` provides access to public methods to access standard
storage locations.
Si... |
# Copyright 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://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... |
import pcl
from loguru import logger
import os
import sys
import time
import numpy as np
import cv2
import matplotlib.pyplot as plt
from numba import njit
from numba.cuda import jit
from decimal import Decimal
from mmdet.apis import inference_detector
from matplotlib.patches import Polygon
from shapely.geometry imp... |
"""Test TotalConnectDevice."""
from copy import deepcopy
from unittest.mock import Mock
import pytest
from const import PARTITION_DETAILS_1, PARTITION_DISARMED
from total_connect_client.client import ArmingHelper
from total_connect_client.exceptions import PartialResponseError, TotalConnectError
from total_connect_c... |
from azure.cognitiveservices.vision.customvision.prediction import CustomVisionPredictionClient
from msrest.authentication import ApiKeyCredentials
from matplotlib import pyplot as plt
from PIL import Image, ImageDraw, ImageFont
import os
import numpy as np
import pandas as pd
def main():
from dotenv import load_d... |
#
# Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
#
# This file is part of MLonMCU.
# See https://github.com/tum-ei-eda/mlonmcu.git for further info.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You m... |
from django.apps import AppConfig
class CoursesystemConfig(AppConfig):
name = 'coursesystem'
|
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.generics import get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework.status import *
from rest_framework.views import APIView
from... |
from __future__ import absolute_import, division, print_function
from operator import itemgetter
from libtbx.utils import Abort
from libtbx import group_args
from six.moves import cStringIO as StringIO
import re
import operator
import os.path
import sys
from functools import reduce
from six.moves import range
from six.... |
from django import forms
from . import models
class PostEvent(forms.ModelForm):
title = forms.CharField(widget=forms.TextInput(
attrs ={
'class':'form-control',
'placeholder':'Enter Job name...',
}))
organizers_name = forms.CharField(widget=forms.TextInput(
attrs ={
'class':'form-control',
'placeholder... |
# Copyright (c) 2020, Ioana Bica
import os
import pickle
import argparse
import logging
import numpy as np
import pandas as pd
from CRN_encoder_evaluate import test_CRN_encoder
from CRN_decoder_evaluate import test_CRN_decoder
from utils.cancer_simulation import get_cancer_sim_data
def init_arg():
parser = argp... |
# Copyright (c) 2022, Himanshu Warekar
# MIT License. See license.txt
from pyIR.best_match_25 import BestMatch25
from pyIR.jelinek_mercer_language_model import JelinekMercerLanguageModel
from pyIR.trec_eval.importer import Importer
from pyIR.vector_space_model import VectorSpaceModel
def evaluate(path: str) -> None... |
print '... Importing simuvex/s_variable.py ...'
from angr.sim_variable import *
|
"""Blueprint for HacsWebResponse."""
import os
from time import time
from homeassistant.components.http import HomeAssistantView
from jinja2 import Environment, PackageLoader
from aiohttp import web
from integrationhelper import Logger
from .hacsbase import Hacs
WEBRESPONSE = {}
def webresponse(cla... |
#!/usr/bin/python3
#
# Maintainer: jeffskinnerbox@yahoo.com / www.jeffskinnerbox.me
# Version: 0.1.0
#
# USAGE
# To run the /dev/video camera - python3 videostream_test_2.py -s usb
# To run the Raspberry Pi camera - python3 videostream_test_2.py -s picamera
# To run using a file - python3 videostream... |
# 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, overload
from .. import... |
from util.hparams import HyperParams
class ROMEHyperParams(HyperParams):
KEYS = [
# Method
"layers",
"fact_token",
"v_num_grad_steps",
"v_lr",
"v_loss_layer",
"v_weight_decay",
"kl_factor",
"mom2_adjustment",
# Module templates
... |
# -*- encoding: utf-8 -*-
# Copyright (c) 2016 Servionica
#
# 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 ... |
EXPECTED_DAILY_WEBSITE_GENERATE_SAMPLES_QUERIES_SIZE = """delimiter //
DROP PROCEDURE IF EXISTS get_daily_samples_size_websites;
CREATE PROCEDURE get_daily_samples_size_websites (
IN id INT,
OUT entry0 FLOAT,
OUT entry1 FLOAT,
OUT entry2 FLOAT,
OUT entry3 FLOAT,
OUT entry4 FLOAT,
OUT entry5 ... |
"""
Django settings for settings project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... |
import io_shared
from io_shared import UnsafeSharedMMap, SharedMMap, RWSharedMMap
# --- UnsafeSharedMMap
data = b'Hello, World!!!'
shm = UnsafeSharedMMap('/my_share', 15)
shm.write(data)
shm.seek(0)
print(shm.readline()) # 'Hello, World!!!\n'
shm.close()
# --- SharedMMap
data = b'Hello, World!!!'
shm = SharedMMap('/... |
import datetime as dt
import json
import os
from io import BufferedReader, FileIO
from pathlib import Path
from typing import Tuple
from hashfs import HashFS
from tinydb import TinyDB
from tinydb_serialization import Serializer, SerializationMiddleware
import sacred.optional as opt
# Set data type values for abstrac... |
n = int(input())
array = list(map(int, input().split()))
array.sort()
con = max_con = 1
for i in range(1, n, 1):
if array[i] == array[i-1]:
con += 1
max_con = max(max_con, con)
else:
con = 1
if max_con <= (n+1) / 2:
print("YES")
else:
print("NO")
|
#!/usr/bin/python
#
# {{ ansible_managed }}
#
# Copyright (c) 2016 Michael Scherer <mscherer@redhat.com>
#
# 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 witho... |
#!/usr/bin/env python
# Copyright 2018 João Pedro Rodrigues
#
# 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 applicabl... |
from datetime import timedelta
import pytest
from django.core import mail
from django.core.management import call_command
from django.utils.timezone import localtime, now
from django_ilmoitin.models import NotificationTemplate
from freezegun import freeze_time
from common.utils import assert_to_addresses
from events.... |
print("Hello World My Name is Sumanda.")
|
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import normalize
from sklearn.decomposition import PCA
class Database:
def __init__(self):
self.all_values = None
self.apriori_values = None
self.columns = [
"Age",
"... |
# coding=utf8
from __future__ import unicode_literals, absolute_import, division, print_function
"""
This is the SpiceBot JSON Commands system.
This Class stores commands in an easy to access manner
"""
from sopel.config.types import StaticSection, ListAttribute
from .Config import config as botconfig
from .Read imp... |
#!/usr/bin/python
from opticalUtils import MininetOE, OpticalSwitch, OpticalLink
from mininet.topo import Topo
from mininet.log import setLogLevel
from mininet.node import RemoteController
from mininet.cli import CLI
class SmallOpticalTopo( Topo ):
def build( self ):
o1ann = { "latitude": 37.6, "longitud... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import pytest
from indico.modules.events.models.legacy_mapping import LegacyEventMapping
@pytest.mark.p... |
# Standard Library
import glob
import gzip
import json
import os
import zlib
from datetime import datetime
# First Party
from smdebug.core.access_layer.s3handler import ReadObjectRequest, S3Handler
from smdebug.core.access_layer.utils import is_s3
from smdebug.core.logger import get_logger
from smdebug.profiler.profil... |
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""You may copy this file as the starting point of your own model."""
import os
import nibabel as nib
import numpy as np
import numpy.ma as ma
def parse_segments(seg, msk_modes):
"""Parse the label segments.
Each channel cor... |
from gitvendor import cli
from mock import patch
import pytest
class TestCLI():
def test_empty_argument_exception(self):
with pytest.raises(SystemExit):
cli.main([])
@patch('pkg_resources.require')
def test_version(self, mock_package):
with pytest.raises(SystemExit):
... |
# 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, overload
from .. import... |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext, Context, loader
from django.core.urlresolvers import r... |
# -*- coding: utf-8 -*-
from urllib.parse import urlsplit
import scrapy
from scrapy.exceptions import CloseSpider
from intelark.converters import *
from intelark.items import *
convertTo = {
"NumPCIExpressPorts": int,
"MaxCPUs": int,
"NumMemoryChannels": int,
"CoreCount": int,
"ThreadCount": int,... |
"""
Executes several performance tests.
"""
import os.path
import shutil
import subprocess
import tempfile
import time
import webbrowser
from contextlib import suppress
from pathlib import Path
import click
from jinja2 import Template
from tabulate import tabulate
@click.group()
def cli():
pass
def start(
... |
from django.test import TestCase
from django.test.client import RequestFactory
from mlist.views.movie_delete import MovieDelete
from mlist.models import User, Collection, Movie, MovieInCollection
class TestMovieDelete(TestCase):
def test_get_queryset(self):
request_factory = RequestFactory()
movi... |
"""Finance Database View"""
__docformat__ = "numpy"
# pylint:disable=too-many-arguments
import os
from collections import OrderedDict
from typing import Dict
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from tabulate import tabulate
from gamestonk_terminal import feature_flags as gtff
f... |
"""Add transaction speed
Revision ID: 7208e2a9a8e8
Revises: dfa080636f10
Create Date: 2021-01-20 23:10:47.781405
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "7208e2a9a8e8"
down_revision = "dfa080636f10"
branch_labels = None
depends_on = None
def upgrade()... |
import argparse
from collections import defaultdict
from pysam import VariantFile
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def plot_distributions(vafs, true_vafs, false_vafs):
sns.set(rc={"figure.figsize": (20, 10)})
sns.set_style("white")
# plt.hist(vafs, bins=100, color='... |
import inspect
import itertools
from django.db.models import Model
from fixtureless import exceptions
from fixtureless.generator import create_instance
from fixtureless.utils import list_get
class Factory(object):
def _verify_kwargs(self, vals):
def _error_nondict(x):
if not isinstance(x, d... |
from werkzeug.datastructures import MultiDict
def process_kwargs(kwargs_in, DEFAULTS={}):
kwargs = MultiDict(kwargs_in)
kwargs_out = {}
for k, v in DEFAULTS.items():
kwargs_out[k] = kwargs.get(k, **v)
return kwargs_out
|
"""
Configuration for the automatic printer lights
"""
import board
OCTOPRINT = {
'api_key': '',
'base_address': 'http://ADDRESS:PORT'
}
BRIGHTNESS = {
'rc_pin': board.D23,
'num_readings': 5,
'factor_dark': 0.7
}
AUTOLIGHT = {
'pixel_pin': board.D12,
'sleep_time': 5,
'num_pixels': 8,
... |
#
# ctemh.py
#
#------------------------------------------------------------------------
#Copyright 2011-2014 Earl J. Kirkland
#
#This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either vers... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 1 20:07:17 2018
@author: J
Solution to project euler problem 100
for a bag of N discs containing A blue discs, the probability of consequtively
drawing two blue discs is P(AA) = A(A-1)/(N(N-1)).
find the smallest A such that P(AA) == 1/2 and N > 10^12
We can see that... |
class Module:
def __init__(self, gui):
self.gui = gui
def get_tools_checkables(self):
"""
Gets the module's tools and checkables
Returns
-------
tools : List[tool]
tool : List[name, menu_name path, command, desc, func)
('load_geometry', 'L... |
# Benchmark the parsing of a mmCIF file given as an argument
import sys
import time
from Bio.PDB import MMCIFParser
mmcif_filepath = sys.argv[1]
parser = MMCIFParser()
start = time.time()
parser.get_structure("", mmcif_filepath)
end = time.time()
print(end - start)
|
# Glue Default Import...
from GlueWrapper import gluewrapper # Import gluewrapper
@gluewrapper.run_etl(procedure="PROCEDURE_NAME", file_name="FILE_NAME")
def main():
pass
main()
|
"""
Indexer is an internal class, used by Store.
"""
from collections import defaultdict
from typing import Dict, Optional, Iterable, Text
from BTrees.OOBTree import BTree # type: ignore
from .util import get_hashable
from .exceptions import NotHashable
class Indexer:
"""
Manages access to B-tree indices f... |
# Generated by Django 3.0.5 on 2021-01-07 22:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0002_device_operating_system"),
]
operations = [
migrations.AddField(
model_name="device",
name="location",
... |
# MIT License
#
# Copyright (c) 2019 Konrad Pagacz
#
# 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... |
from .utils import load_dataset as _load_dataset
from .utils import load_dataset_online,get_kzz_miniute
# Load FOREX datasets
FOREX_EURUSD_1H_ASK = _load_dataset('FOREX_EURUSD_1H_ASK', 'Time')
# Load Stocks datasets
STOCKS_GOOGL = _load_dataset('STOCKS_GOOGL', 'Date')
|
from datetime import date
nome = str(input("Qual é o seu nome: "))
sexo = int(input("Escolha o número para identificar o sexo\n[1]-Masculino\n[2]-Feminino\nEscolha: "))
if sexo == 1:
print("Conforme a lei, o {} é obrigado de alistar".format(nome))
ano = int(input("Informe o seu ano de nascimento: "))
ano_at... |
import logging
from google.cloud import speech
from google.cloud import texttospeech as tts
from google.cloud.speech import (
RecognitionConfig,
StreamingRecognitionConfig,
StreamingRecognizeRequest,
)
from google.api_core.exceptions import GoogleAPIError
from typing import Generator
from .bases import In... |
#!/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 ... |
#Change Return Program - The user enters a cost and then the amount of money given. The program will figure out the change and the number of quarters, dimes, nickels, pennies needed for the change.
class Cash_Register:
def __init__(self):
pass
# A method to receive the cost and money
def rece... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging as log
from extensions.load.loader import Loader
from mo.front.common.r... |
from django.apps import AppConfig
class CalenderConfig(AppConfig):
name = 'Calender'
|
from distutils.core import setup
from Cython.Build import cythonize
import numpy
setup(
name='HVApy',
version=0.1,
description='Simple random number generators',
author='Markus Dablander, Joshua Russell-Buckland',
author_email='markus.dablander.16@ucl.ac.uk, \
joshua.russell-buckland.15@ucl.ac.... |
#!/usr/bin/env python3
"""
Dispatch your torrents into multiple watchdirs
See:
https://github.com/Anthony25/torrents_dispatcher
"""
from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
setup(
name="torrents_dispatcher",
version="0.0.6",
description="Dispatch ... |
import pydiffvg
import torch
import skimage
import ttools.modules
import skimage.io
from skimage.io import imshow
import skimage.color
import random
import argparse
import math
import torch.nn as nn
from torch.nn import functional as F
from torch.autograd import Variable
import clip_utils
import torchvision
import tor... |
#!/bin/python3
"""Face recognition from Image/all data."""
import os
# import errno
import subprocess
# import csv
# import subprocess
import sys
import cv2
import face_recognition
import numpy as np
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.PublicKey import RSA
# This is a demo of running face recognit... |
# Generated by Django 2.1.7 on 2019-05-12 16:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('elections', '0050_auto_20190511_1819'),
]
operations = [
migrations.CreateModel(
name='EuroParl... |
--- crmsh/utils.py.orig 2021-08-12 08:25:45 UTC
+++ crmsh/utils.py
@@ -1667,7 +1667,7 @@ def list_corosync_node_names():
in corosync.conf
'''
try:
- cfg = os.getenv('COROSYNC_MAIN_CONFIG_FILE', '/etc/corosync/corosync.conf')
+ cfg = os.getenv('COROSYNC_MAIN_CONFIG_FILE', '%%PREFIX%%/etc/cor... |
from time import sleep
n1 = float(input('Primeiro valor: '))
n2 = float(input('Segundo valor: '))
opcao = 0
while opcao != 5:
print(''' [1] somar
[2] multiplicar
[3] maior
[4] novos números
[5] sair do programa''')
opcao = int(input('>>>>> Qual é sua opção? '))
if opcao == 1:
soma... |
""" Package for the cppext library.
"""
from __future__ import absolute_import
from .__version__ import __version__
from ._cpp import hello as cpphello
from ._cpp import Greeting as CppGreeting
from ._py import hello as pyhello
|
from __future__ import print_function
import math
import torch.nn as nn
import numpy as np
from torch.autograd import Variable
import torch
import sys
class Loss(object):
""" Base class for encapsulation of the loss functions.
This class defines interfaces that are commonly used with loss functions
in tra... |
""" Functions for calculating multiple eQTLS
"""
import pandas as pd
import numpy as np
import statsmodels.api as sm
def ceQTL(counts, dos, cov_mat, rsid):
""" Convinence function to calculate the single SNP comparison
"""
acov_mat = cov_mat.copy(deep=True)
acov_mat['soi'] = dos.ix[rsid, acov_mat.ind... |
from django.core.management.base import BaseCommand, CommandError
from gwasdb.hdf5 import get_hit_count, load_permutation_thresholds
from gwasdb.models import Study, Phenotype, Genotype
from aragwas import settings
import os, requests, shutil
class Command(BaseCommand):
help = 'Get an HDF5 file of a newly compute... |
"""
This module is deprecated -- use scipy.linalg.blas instead
"""
from __future__ import division, print_function, absolute_import
from _fblas import *
import numpy as _np
@_np.deprecate(old_name="scipy.linalg.fblas", new_name="scipy.linalg.blas")
def _deprecate(): pass
_deprecate()
|
#!/usr/bin/env python3
S="""75
95 64
17 47 82
18 35 87 10
20 04 82 47 65
19 01 23 75 03 34
88 02 77 73 07 63 67
99 65 04 28 06 16 70 92
41 41 26 56 83 40 80 70 33
41 48 72 33 47 32 37 16 94 29
53 71 44 65 25 43 91 52 97 51 14
70 11 33 28 77 73 17 78 39 68 17 57
91 71 52 38 17 14 91 43 58 50 27 29 48
63 66 04 68 89 53 ... |
from PyQt4 import QtCore, QtGui
from Detail import DETAIL
from Mainwindow import MAINWINDOW
from Quiz import QUIZ
from Classprofile import Classprofile
from StudentProfileNew import STUDENT
from QuestionStudent import QUESTIONSTUDENT
from add import ADD
from Q import Q
import sys
class start_teacher(QtGui... |
#!/usr/local/bin/python3
import os
import sys
import subprocess
def init_libraries(directory):
'''My Common libraries'''
libs = ["https://github.com/EmmanuelOga/easing.git", "https://github.com/airstruck/knife.git",
"https://github.com/vrld/moonshine.git", "https://github.com/Pomb/doodlehouse-love.g... |
#How to run:
# $ CONSUMER_KEY=<your consumer key> python test.py
from private_app import PrivateApp
from itertools import islice
from pprint import pprint
import os
consumer_key = os.getenv('CONSUMER_KEY')
if not consumer_key:
raise EnvironmentError('Environment variable CONSUMER_KEY not found. How to run: \
... |
with open("abcd.txt") as f:
with open("abc.txt", "w") as f1:
for line in f:
f1.write(line)
|
from __future__ import annotations
import os
from functools import reduce
from typing import List, Union, Tuple, TYPE_CHECKING
import torch
import torch.nn.functional as F
from torch import nn, tensor, optim, squeeze
from configuration import config
from runs.runs_manager import get_fully_train_folder_path
from src.... |
# -*- coding: utf-8 -*-
"""
@author: Germán L. Osella Massa (german.osella at nexo.unnoba.edu.ar)
"""
import numpy as np
def escalar(datos, margen_adicional=0, minimos=None, maximos=None):
"""
Recibe datos cuyos valores se encuentran en el intervalo [minimos, maximos],
y los escala de forma que queden en... |
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from ...viz import colors
from .components.three_dim_figure import three_dim_figure
def flex_scale(x):
try:
nan_min = np.nanmin(x)
nan_range = np.nanmax(x) - nan_min
x_ = (x - nan_min) / nan_range
candidates ... |
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LICENSE.
import sys
import requests
import torch
import torchvision.mode... |
import logging
from typing import Optional
from meross_iot.model.enums import Namespace
_LOGGER = logging.getLogger(__name__)
class RollerShutterMixin:
_execute_command: callable
check_full_update_done: callable
uuid: str
def __init__(self, device_uuid: str,
manager,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Analyze a list of words and search for complex terms.
Return a list of simple and complex terms.
"""
##########
# IMPORT #
##########
from collections import Counter
from nltk.util import ngrams
########
# MAIN #
########
def complexe(list_words, complex_size=2, thr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
NetData plugin for Nvidia GPU stats.
Requirements:
# - Nvidia driver installed (this plugin uses the NVML library)
# - nvidia-ml-py Python package (Python NVML wrapper) installed or copy the 'pynvml.py' file
# from the 'nvidia-ml-py' package (https://pypi.python.org/... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'EmailSpecification'
db.create_table(u'mailcenter_emailspecification', (
(u'id', ... |
import theano.tensor as tt
import numpy as np
from functools import reduce
__all__ = ['ExpQuad',
'RatQuad',
'Exponential',
'Matern52',
'Matern32',
'Linear',
'Polynomial',
'Cosine',
'WarpedInput',
'Gibbs']
class Covarian... |
import math
import matplotlib.pyplot as plt
# 余弦フーリエクラス
class cosFourier:
def __init__(self):
self._coefficient: list = list() # 係数
self._period: float = 2*math.pi # 周期の1/2
self._num: int = 100 # 要素数
self._limit: int = 100 # フーリエ打ち切り次数
@property
def coefficient(self) ... |
import random
food=["استنبلي", "خورشت بادمجان", "ماکاروني", "بيف استروگانف", "کشک و بادمجان", "دلمه", "زرشک پلو با مرغ", "لازانيا", "پيتزا", "خورشت قيمه", "خوراک لوبيا", "آلبالو پلو", "آبگوشت", "گوشت و لوبيا", "قيمه ريزه", "کله گنجشکي", "ماهي", "کتلت", "کباب تابه اي", "آش رشته", "خورشت نعناع جعفري", "خورشت آلوچه", "تن ... |
# -*- coding: utf-8 -*-
import datetime
import logging
import random
import string
logger = logging.getLogger(__file__)
def ishl7(line):
"""Determines whether a *line* looks like an HL7 message.
This method only does a cursory check and does not fully
validate the message.
:rtype: bool
"""
#... |
from configparser import ConfigParser
import json
import logging
import mmap
import os
import requests
import sys
import time
import traceback
import yara
from subprocess import Popen, PIPE
# custom ConfigParser to keep case sensitivity
class CaseConfigParser(ConfigParser):
def optionxform(self, optionstr):
... |
'''Diff judge unittest module.'''
from tornado import testing
from tornado.ioloop import IOLoop, PollIOLoop
import PyExt
import Privilege
from StdChal import StdChal, STATUS_AC, STATUS_RE
class EvIOLoop(PollIOLoop):
'''Tornado compatible ioloop interface.'''
def initialize(self, **kwargs):
'''Initia... |
"""Open a file with real data and estimate the DOM rates.
"""
from __future__ import division
from km3pipe import Module, Pipeline
from km3pipe.io.aanet import AanetPump
class RateEstimator(Module):
def process(self, blob):
hits = blob["Hits"]
doms = {h.dom_id for h in hits}
hit_times =... |
# coding=utf-8
# Copyright 2018-2020 EVA
#
# 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 ... |
#####
# Step 2 - Rasters and numpy
#####
# Numpy is a exceptionally powerful package for Python that gives incredible scientific computing functionality.
# Some basic functionality has been built into arcpy that allows us to interact with it in a fairly seamless manner.
# Review the code below, this is a sim... |
import numpy as npd
from read_from_file import *
from remove_sm import *
"""
csi_matrix.py
Read Csi matrix and apply some corrections
Naoufal Mahfoudi (c) 2016 mohamed-naoufal.mahfoudi@inria.fr
"""
triangle = [1, 3, 6]
broken_perm = 0
def csi_matrix(csi):
"""csi_matrix, reads the csi matrix , removes the spa... |
# MIT License
#
# Copyright (c) 2017 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# 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
# t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.