content stringlengths 0 1.05M | origin stringclasses 2
values | type stringclasses 2
values |
|---|---|---|
import sys
import csv
import numpy as np
import statistics
import scipy.stats
def anova(index, norobot_data, video_data, robot_data):
norobot_mean = norobot_data.mean(axis = 0)[index]
video_mean = video_data.mean(axis = 0)[index]
robot_mean = robot_data.mean(axis = 0)[index]
group_means = [... | nilq/baby-python | python |
from .sequence_tagger_model import SequenceTagger, MultiTagger
from .language_model import LanguageModel
from .text_classification_model import TextClassifier
from .pairwise_classification_model import TextPairClassifier
from .relation_extractor_model import RelationExtractor
from .entity_linker_model import EntityLink... | nilq/baby-python | python |
def longestPalindromicSubstring(string):
longest = ""
for i in range(len(string)):
for j in range(i, len(string)):
substring = string[i : j + 1]
if len(substring) > len(longest) and isPalindrome(substring):
longest = substring
return longest
def isPalindrome(string):
leftIdx = 0
rightIdx = len(stri... | nilq/baby-python | python |
from django.conf import settings
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from user.models import User
from user.serializers import UserSerializer
import redis
import uuid
import pycountry
# initiates the redis instance.
redis_... | nilq/baby-python | python |
import cv2
import numpy as np
import BboxToolkit as bt
import pycocotools.mask as maskUtils
from mmdet.core import PolygonMasks, BitmapMasks
pi = 3.141592
def bbox2mask(bboxes, w, h, mask_type='polygon'):
polys = bt.bbox2type(bboxes, 'poly')
assert mask_type in ['polygon', 'bitmap']
if mask_type == 'bit... | nilq/baby-python | python |
from flask_sqlalchemy import SQLAlchemy
from typing import Optional, Set
from models import Team, ProblemSet, PermissionPack
class DefaultPermissionProvider:
def __init__(self, db: SQLAlchemy) -> None:
self.db = db
def get_contest_permissions(self, uid: int, contest_id: Optional[str]) -> S... | nilq/baby-python | python |
import pytest
from drink_partners.extensions.authentication.static import (
StaticAuthenticationBackend
)
class TestStaticAuthentication:
@pytest.fixture
def backend(self):
return StaticAuthenticationBackend.create()
async def test_respects_the_token_from_querystring_param(
self,
... | nilq/baby-python | python |
from tracrpc.api import *
from tracrpc.web_ui import *
from tracrpc.ticket import *
from tracrpc.wiki import *
from tracrpc.search import *
| nilq/baby-python | python |
import sys
import azure
import socket
from azure.servicebus import (
_service_bus_error_handler
)
from azure.servicebus.servicebusservice import (
ServiceBusService,
ServiceBusSASAuthentication
)
#from azure.http import (
# HTTPRequest,
# HTTPError
# )
#from azure.http.httpclient impo... | nilq/baby-python | python |
#función para leer el archivo txt que contiene el mensaje encriptado
# el archivo se llama mensaje_cifrado_grupo1.txt
def txt_a_mensaje(): # funcion 7
return # se devuelve el mensaje en string | nilq/baby-python | python |
from django.urls import path
from .views import Notifier
urlpatterns = [
path('get/<int:pk>', Notifier.as_view()),
path('get', Notifier.as_view()),
]
| nilq/baby-python | python |
# built-in
from argparse import ArgumentParser
from pathlib import Path
from shutil import rmtree
# app
from ..actions import format_size, get_path_size
from ..config import builders
from .base import BaseCommand
class SelfUncacheCommand(BaseCommand):
"""Remove dephell cache.
"""
@staticmethod
def bu... | nilq/baby-python | python |
from distutils.core import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name = 'EssentialCV',
packages = ['EssentialCV'],
version = '0.26',
licen... | nilq/baby-python | python |
import numpy as np
def wPrefersM1OverM(prefer, w, m, m1):
for i in range(N):
if (prefer[w][i] == m1):
return True
if (prefer[w][i] == m):
return False
def stableMarriage(prefer):
wPartner = [-1 for i in range(N)]
mFree = [False for i in range(N)]
... | nilq/baby-python | python |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
##############################################################################
#
# PURPOSE:
# Helper library used by the MRE internal lambda functions to interact with
# the control plane
#
################... | nilq/baby-python | python |
##########################################################################
# MediPy - Copyright (C) Universite de Strasbourg
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
# for de... | nilq/baby-python | python |
def count(a, b, c):
if not a and not b and not c:
return '1'
sum = 2 * a + 3 * b + 4 * c
cnt = a + b + c
l = 0
r = cnt + 1
while l < r:
m = (l + r) // 2
if (sum + 5 * m) / (cnt + m) < 3.5:
l = m + 1
else:
r = m
# так и не понял, почему... | nilq/baby-python | python |
import logging
import sqlite3
import os
import datetime
from resources.cloud.clouds import Cloud, Clouds
from resources.cluster.database import Database
from lib.util import read_path, Command, RemoteCommand, check_port_status
LOG = logging.getLogger(__name__)
class Cluster(object):
"""Cluster class represents... | nilq/baby-python | python |
"""
Tema: Assertions y Test suites
Curso: Selenium con python.
Plataforma: Platzi.
Profesor: Hector Vega.
Alumno: @edinsonrequena.
"""
# Unittest Modules
import unittest
# Selenium Modules
from selenium import webdriver
class SearchTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.d... | nilq/baby-python | python |
try:
import greenlet
except ImportError:
greenlet_available = False
else:
greenlet_available = True
is_patched = False
from weakref import WeakSet
orig_greenlet = greenlet.greenlet
greenlets = WeakSet()
class PatchedGreenlet(orig_greenlet):
def __init__(self, *a, **k):
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import os
import requests
import pymysql
class WorkPipeline(object):
def process_item(self, item, spider):
return ... | nilq/baby-python | python |
"""
Application ID: 512001308941.
Публичный ключ приложения: COAKPIKGDIHBABABA.
Секретный ключ приложения: 95C3FB547F430B544E82D448.
Вечный session_key:tkn14YgWQ279xMzvjdfJtJuRajPvJtttKSCdawotwIt7ECm6L0PzFZLqwEpBQVe3xGYr7
Session_secret_key:b2208fc58999b290093183f6fdfa6804
""" | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pytest
from case import skip
@skip.if_pypy()
@skip.unless_module('boto3')
@skip.unless_module('pycurl')
@pytest.mark.usefixtures('hub')
class AWSCase(object):
pass
| nilq/baby-python | python |
"""
Loaders for classic datasets.
"""
from .datasets import Ionosphere, MagicGammaTelescope
__all__ = ["Ionosphere", "MagicGammaTelescope"]
| nilq/baby-python | python |
count = 0
for i in range(10):
nums = int(input())
if nums == 5:
count += 1
print(count)
| nilq/baby-python | python |
import unittest
import logging
import os
import numpy as np
import pandas as pd
import scipy.stats as stats
import broadinstitute_psp.utils.setup_logger as setup_logger
import cmapPy.pandasGEXpress.parse as parse
import cmapPy.pandasGEXpress.GCToo as GCToo
import sip
# Setup logger
logger = logging.getLogger(setup_lo... | nilq/baby-python | python |
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import plotly.graph_objects as go
from main import get_path_distance
# drop down list for use in airport codes
from controls import CI... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from eve.exceptions import ConfigException
from sqlalchemy import Boolean, Column, ForeignKey, Integer, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from eve_sqlalche... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from .handler_class import handler_class
import urllib3
import requests
import json
import time
class http_handler_class(handler_class):
def __init__(self, *args, **kwargs):
# verify required input parameters
required_args = ['url']
for param_name in required_args:
... | nilq/baby-python | python |
from setuptools import find_packages, setup
from netbox_nagios.version import VERSION
setup(
name="netbox-nagios",
version=VERSION,
author="Gabriel KAHLOUCHE",
author_email="gabriel.kahlouche@groupama.com",
description="Netbox Plugin to show centreon device state in Netbox.",
url="https://gith... | nilq/baby-python | python |
from django.db import models
from django.utils.translation import gettext_lazy
from cradmin_legacy.superuserui.views import mixins
from cradmin_legacy.viewhelpers import listbuilder
from cradmin_legacy.viewhelpers import listbuilderview
from cradmin_legacy.viewhelpers import listfilter
from cradmin_legacy.viewhelpers ... | nilq/baby-python | python |
#!/home/schamblee/projects/django-oidc-provider/project_env/bin/python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| nilq/baby-python | python |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import os
from yolox.exp import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
#### s
self.depth = 0.33
self.width = 0.50
# #### m
# self... | nilq/baby-python | python |
#!/usr/bin/env python3
""" Update Rancher app answers using API """
import os
import requests
class RancherAPI: # pylint: disable=too-few-public-methods
""" Make calls to Rancher API """
_CALLER = {
'GET': requests.get,
'PUT': requests.put,
'POST': requests.post,
}
def __ini... | nilq/baby-python | python |
from __future__ import absolute_import
__author__ = 'katharine'
from enum import IntEnum
from .base import PebblePacket
from .base.types import *
__all__ = ["MusicControlPlayPause", "MusicControlPause", "MusicControlPlay", "MusicControlNextTrack",
"MusicControlPreviousTrack", "MusicControlVolumeUp", "Musi... | nilq/baby-python | python |
# Authors: Sylvain MARIE <sylvain.marie@se.com>
# + All contributors to <https://github.com/smarie/python-pytest-cases>
#
# License: 3-clause BSD, <https://github.com/smarie/python-pytest-cases/blob/master/LICENSE>
from .common_pytest_lazy_values import lazy_value, is_lazy
from .common_others import unfold_exp... | nilq/baby-python | python |
#!/usr/bin/python
'''
(C) Copyright 2020 Intel Corporation.
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 ... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
ZFILL = 3
| nilq/baby-python | python |
"""Config flow for DSMR integration."""
import logging
from typing import Any, Dict, Optional
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from .const import DOMAIN # pylint:disable=unused-import
_LOGGER = logging.getLogger(__name__)
class DSMRFlowHandler(config_en... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Card',
fields=[
('id', models.AutoField(verbose... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Kumagai group.
import os
from pathlib import Path
from monty.serialization import loadfn
from pydefect.analyzer.calc_results import CalcResults
from pydefect.analyzer.grids import Grids
from pydefect.analyzer.refine_defect_structure import refine_defect_structure
from pyde... | nilq/baby-python | python |
"""
These constants provide well-known strings that are used for identifiers,
etc... for widgets that are commonly sub-classed by Manager implementations.
"""
kUIIdBase = "uk.co.foundry.asset.api.ui."
kParameterDelegateId = kUIIdBase + "parameterdelegate"
kParameterDelegateName = "Asset Parameter UI"
kInfoWidgetId... | nilq/baby-python | python |
import matplotlib.pyplot as plt
def plot_creater(history,bin, modelname):
"""[For the training progress, a chart about the accuracy / loss is created for the deep learning approaches and stored accordingly]
Args:
history (keras.callbacks.History object): [Contains values accuracy, validation-accuracy, ... | nilq/baby-python | python |
import GrossSalary, SalaryDeductions, NetSalary
print("Salary Computation App")
while True:
action = str(input("\nWould you like to to do? \n[A] Calculate Salary\n[B] Exit Application")).lower()
if(action == 'a'):
try:
name = str(input("\nEnter Name: "))
rendered_hours = float(... | nilq/baby-python | python |
from src.libs.CrabadaWeb2Client.CrabadaWeb2Client import CrabadaWeb2Client
from pprint import pprint
from src.libs.CrabadaWeb2Client.types import CrabForLending
# VARS
client = CrabadaWeb2Client()
# TEST FUNCTIONS
def test() -> None:
pprint(client.getCheapestCrabForLending())
# EXECUTE
test()
| nilq/baby-python | python |
# coding: utf-8
import requests
from bs4 import BeautifulSoup
import re
import json
import os
from xml.etree import ElementTree
import time
import io
import pandas as pd
from gotoeat_map.module import getLatLng, checkRemovedMerchant
def main():
merchantFilePath = os.path.dirname(
os.path.abspath(__file__)... | nilq/baby-python | python |
#!/usr/bin/env python
# coding: utf-8
# ## Full Run
# In[1]:
import os
# In[2]:
Xtrain_dir = 'solar/data/kaggle_solar/train/'
Xtest_dir = 'solar/data/kaggle_solar/test'
ytrain_file = 'solar/data/kaggle_solar/train.csv'
station_file = 'solar/data/kaggle_solar/station_info.csv'
import solar.wrangle.wrangle
import so... | nilq/baby-python | python |
from typing import Tuple, AnyStr
from lib.ui import BasePage
from lib.log import Loggers
from utils.Files import read_page_elements
log = Loggers(__name__)
class Baidu(BasePage):
def open_index(self):
self.get_url("https://www.baidu.com")
def login(self, locator: Tuple[AnyStr]):
self.click... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 30 10:22:30 2020
@author: NN133
"""
import sys
import time
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
sys.path.append("C:/Users/NN133/Documents/libsvm-3.22/python")
from svmutil import *
#%matplotlib inline
from util_ker import *
#Import data... | nilq/baby-python | python |
# meta class 에서는 __init__ 보다는 __new__ 를 사용합니다.
# 사용법은 아래와 같습니다.
# __new__ (<클래스자신>, <클래스명>, (클래스의 부모 클래스), {클래스의 어트리뷰트 딕셔너리} )
# __new__ 가 실행된 다음에 __init__ 가 실행되게 됩니다.
class Meta(type):
def __new__(cls, name, bases, attrs):
print("__new__ 메서드!")
print(cls, name, bases, attrs)
return type.__... | nilq/baby-python | python |
default_app_config = 'action_notifications.apps.ActionNotificationsConfig'
| nilq/baby-python | python |
from __future__ import division, unicode_literals
import codecs
from bs4 import BeautifulSoup
import urllib
from logzero import logger as LOGGER
import re
import codecs
from w3lib.html import replace_entities
import os
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from PIL import... | nilq/baby-python | python |
from setuptools import setup, find_packages
with open("README.md") as f:
long_description = f.read()
setup(
name="BindsNET",
version="0.2.9",
description="Spiking neural networks for ML in Python",
license="AGPL-3.0",
long_description=long_description,
long_description_content_type="text/m... | nilq/baby-python | python |
class Queue(object):
def __init__(self, queue):
self._queue = queue
self.name = None
def delete(self):
raise NotImplementedError()
class BrokerBackend(object):
def __init__(self):
self._queues = None
@property
def queues(self):
if self._queues is None:
... | nilq/baby-python | python |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.keras.layers as tfkl
from veqtor_keras.util import localized_attention
class LocalizedAttentionLayer1D(tfkl.Layer):
def __init__(self,
patch_size=3,
n... | nilq/baby-python | python |
"""
https://adventofcode.com/2018/day/2
"""
from collections import Counter
from itertools import product
from pathlib import Path
def solve_a(codes):
pairs = triplets = 0
for code in codes:
occurrences = Counter(code).values()
pairs += any(count == 2 for count in occurrences)
triplet... | nilq/baby-python | python |
import hashlib
def hash_uid(uid, truncate=6):
"""Hash a UID and truncate it
Args:
uid (str): The UID to hash
truncate (int, optional): The number of the leading characters to keep. Defaults to 6.
Returns:
str: The hashed and trucated UID
"""
hash_sha = hashlib.sha256()
... | nilq/baby-python | python |
from lib.interface import *
from lib.arquivo import *
from time import sleep
arq = './Ex115/cadastro.txt'
if not arquivoExiste(arq):
criarArquivo(arq)
while True:
cor(2)
opcao = menu(['Cadastrar', 'Listar', 'Sair'])
if opcao == 1:
#Opção para cadastrar uma nova pessoa no arquivo
cabec... | nilq/baby-python | python |
from datetime import datetime
import json
import platform
import socket
import sys
from collections.abc import Iterable
import os
import inspect
import types
import pickle
import base64
import re
import subprocess
import io
import threading
import signal
try:
import pkg_resources
except ImportError:
pkg_resourc... | nilq/baby-python | python |
import logging
from tqdm import tqdm
import tmdb
from page import blocked_qids
from sparql import sparql
def main():
"""
Find Wikidata items that are missing a TMDb TV series ID (P4983) but have a
IMDb ID (P345) or TheTVDB.com series ID (P4835). Attempt to look up the
TV show via the TMDb API. If th... | nilq/baby-python | python |
import sys
sum = 0
for i in range(1, len(sys.argv), 1):
sum += int(sys.argv[i])
print(sum) | nilq/baby-python | python |
from .normalize import *
from .logarithmic import *
from .exponential import *
from .gamma import *
from .tumblin import *
from .reinhard import *
from .durand import *
from .drago import *
from .fattal import *
from .lischinski import *
| nilq/baby-python | python |
__author__ = 'xf'
| nilq/baby-python | python |
# -*- coding: utf-8 -*-
import pytest
from django.conf import settings
from django.http import HttpResponse
from mock import Mock, PropertyMock, patch
from django_toolkit import middlewares
@pytest.fixture
def http_request(rf):
return rf.get('/')
@pytest.fixture
def http_response():
return HttpResponse()
... | nilq/baby-python | python |
__version__ = 0.6 | nilq/baby-python | python |
import boto3
import json
import string
from time import asctime
from urllib.request import Request, urlopen
import yaml
def get_API_key() -> None:
"""Grab QnAMaker API key from encrypted s3 object.
"""
s3_client = boto3.client('s3')
response = s3_client.get_object(
Bucket='octochat-processor',... | nilq/baby-python | python |
import warnings
from collections import Counter
from itertools import chain
from typing import Tuple, Type
import strawberry
def merge_types(name: str, types: Tuple[Type]) -> Type:
"""Merge multiple Strawberry types into one
For example, given two queries `A` and `B`, one can merge them into a
super typ... | nilq/baby-python | python |
#!/usr/bin/env python3
from matplotlib import pyplot as plt
import numpy as np
with plt.xkcd():
# Based on "Stove Ownership" from XKCD by Randall Munroe
# https://xkcd.com/418/
fig = plt.figure(figsize=(6,4))
ax = fig.add_axes((0.1, 0.2, 0.8, 0.7))
ax.set_xticks([])
ax.set_yticks([])
# a... | nilq/baby-python | python |
import collections
import itertools
import json
import os
import operator
import attr
import torch
import torchtext
import numpy as np
from seq2struct.models import abstract_preproc
try:
from seq2struct.models import lstm
except ImportError:
pass
from seq2struct.models import spider_enc_modules
from seq2struc... | nilq/baby-python | python |
import logging
import numpy as np
from rasterio.dtypes import dtype_ranges
import warnings
logger = logging.getLogger(__name__)
def execute(
mp,
resampling="nearest",
band_indexes=None,
td_matching_method="gdal",
td_matching_max_zoom=None,
td_matching_precision=8,
td_fallback_to_higher_zo... | nilq/baby-python | python |
from Classes.Wrappers.PlayerDisplayData import PlayerDisplayData
class BattleLogPlayerEntry:
def encode(calling_instance, fields):
pass
def decode(calling_instance, fields):
fields["BattleLogEntry"] = {}
fields["BattleLogEntry"]["Unkown1"] = calling_instance.readVInt()
fields["... | nilq/baby-python | python |
# coding: UTF-8
import numpy as np
import chainer
from chainer import Variable,Chain
import chainer.links as L
import chainer.functions as F
import chainer.optimizers as O
# model
class MyChain(Chain):
def __init__(self):
super().__init__(
l1 = L.Linear(1,2),
l2 = L.Linear(2,1),
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
Script Name:
Author: Do Trinh/Jimmy - 3D artist.
Description:
"""
# -------------------------------------------------------------------------------------------------------------
""" Import """
import argparse
from PLM.cores.Errors import VersionNotFoundException
from PLM ... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Huawei.VRP config normalizer
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# -------------------------------------------------... | nilq/baby-python | python |
from django.contrib import admin
from . import models
# Register your models here.
admin.site.register(models.Student)
admin.site.register(models.Subject)
admin.site.register(models.Assignment)
admin.site.register(models.Submission)
| nilq/baby-python | python |
# -*- coding: utf-8 -*-
from django.core.management import call_command
from django.db import migrations
def create_cache_table(apps, schema_editor):
"""
创建 cache table
"""
call_command("createcachetable", "account_cache")
class Migration(migrations.Migration):
dependencies = [
("accou... | nilq/baby-python | python |
from django.contrib.auth import get_user_model
from questionnaire.models import Questionnaire
from functional_tests.base import FunctionalTest
from functional_tests.pages.qcat import HomePage
from functional_tests.pages.questionnaire import QuestionnaireStepPage
from functional_tests.pages.technologies import Technolo... | nilq/baby-python | python |
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
from models.user import User
from database import session
def create_user(login_session):
"""Create a new user from login session and return his id."""
newUser = User(name=login_session["username"],
email=login_session["email"],
... | nilq/baby-python | python |
from tkinter import *
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from PIL import ImageTk, Image
from PyDictionary import PyDictionary
from googletrans import Translator
root = tk.Tk()
root.title("Yanis's Dictionary")
root.geometry('600x300')
root['bg'] = 'white'
frame = Fra... | nilq/baby-python | python |
import socket
import threading
HOST = '127.0.0.1'
PORT = 9999
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((HOST, PORT))
print 'Connect Success!....'
def sendingMsg():
while True:
data = raw_input('')
sock.send(data)
sock.close()
def gettingMsg():
while True:
... | nilq/baby-python | python |
# Generated by Django 3.1.1 on 2020-10-30 15:53
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('grant_applications', '0009_auto_20201030_1209'),
]
operations = [
migrations.AddField(
mod... | nilq/baby-python | python |
# select CALOL1_KEY from CMS_TRG_L1_CONF.L1_TRG_CONF_KEYS where ID='collisions2016_TSC/v206' ;
import re
import os, sys, shutil
import subprocess
import six
"""
A simple helper script that provided with no arguments dumps a list of
top-level keys, and provided with any key from this list as an argument,
dumps a list of... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2018-11-23 10:18
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wdapp', '0011_auto_20181123_0955'),
]
operations = [
migrations.RemoveField(
... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
"""
配置日志信息,并添加 request_id
:create: 2018/9/23
:copyright: smileboywtu
"""
import datetime
import logging
import sys
import uuid
from logging.handlers import TimedRotatingFileHandler
from tornado import gen
from tornado.log import access_log
from tornado.stack_context import run_with_stack_con... | nilq/baby-python | python |
# coding: utf-8
# In[87]:
#基于分词的文本相似度的计算,
#利用jieba分词进行中文分析
import jieba
import jieba.posseg as pseg
from jieba import analyse
import numpy as np
import os
'''
文本相似度的计算,基于几种常见的算法的实现
'''
class TextSimilarity(object):
def __init__(self,file_a,file_b):
'''
初始化类行
'''
str_a = ''
... | nilq/baby-python | python |
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output, State
popover = html.Div(
[
html.P(
["Click on the word ", html.Span("popover", id="popover-target")]
),
dbc.Popover(
[
dbc.Popove... | nilq/baby-python | python |
#!/usr/bin/env python
#
# Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | nilq/baby-python | python |
##############################
# import Verif #
# var = Verif.class(object) #
# var.def() #
##############################
# this lib it's verification #
# maked by khalil preview #
##############################
import tkinter
from tkinter import *
from tkinter import mes... | nilq/baby-python | python |
import attrs
import asyncio
import datetime
import os
import shutil
import pickle
from typing import Any, Optional, List
@attrs.define
class Cache:
name: str
data: Any
expired_after: int = attrs.field(default=10)
expiration: datetime.datetime = attrs.field(init=False)
@expiration.default
def ... | nilq/baby-python | python |
#Done by Carlos Amaral in 18/06/2020
"""
Imagine an alien was just shot down in a game. Create a
variable called alien_color and assign it a value of 'green' , 'yellow' , or 'red' .
• Write an if statement to test whether the alien’s color is green. If it is, print
a message that the player just earned 5 points.
• Wri... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: epl/protobuf/v1/query.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as... | nilq/baby-python | python |
from qqai.classes import *
class TextTranslateAILab(QQAIClass):
"""文本翻译(AI Lab)"""
api = 'https://api.ai.qq.com/fcgi-bin/nlp/nlp_texttrans'
def make_params(self, text, translate_type=0):
"""获取调用接口的参数"""
params = {'app_id': self.app_id,
'time_stamp': int(time.time()),
... | nilq/baby-python | python |
"""
Enumeración de estado del resultado de una partida de PPT.
"""
from enum import Enum
class Condicion(Enum):
"""
Posibles estados del resultado de la partida.
"""
VICTORIA = 0
DERROTA = 1
EMPATE = 2
| nilq/baby-python | python |
import csv
import random
def load_lorem_sentences():
with open('lorem.txt') as fh:
return [l.strip() for l in fh.readlines()]
def load_dictionary():
with open('dictionary.csv') as csv_file:
return [l for l in csv.DictReader(csv_file, delimiter=',')]
SUFFIXES = ['at', 'it', 'is', 'us', 'et'... | nilq/baby-python | python |
import pickle
import random
import h5py
import numpy as np
import pandas as pd
class Generator():
""" Data generator to the neural image captioning model (NIC).
The flow method outputs a list of two dictionaries containing
the inputs and outputs to the network.
# Arguments:
data_path = data_pa... | nilq/baby-python | python |
#!/usr/bin/env python
# # -*- coding: utf-8 -*-
"""
@File: routes.py.py
@Author: Jim.Dai.Cn
@Date: 2020/9/22 上午11:26
@Desc:
"""
from app.company import blueprint
from flask import render_template, jsonify, current_app, request
@blueprint.route('/company', methods=['GET'])
def get_company_list(... | nilq/baby-python | python |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUIs\LoadDataDialog.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_fromMemoryDialog(object):
def setupUi(self, fromMemoryDial... | nilq/baby-python | python |
import random
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class Person:
def __init__(self, name, hp, mp, atk, df, magic, items,type):
self.maxhp =... | nilq/baby-python | python |
import torch
import torch.utils.data as data
import os
import pickle
import numpy as np
from data_utils import Vocabulary
from data_utils import load_data_and_labels_klp, load_data_and_labels_exo
from eunjeon import Mecab
NER_idx_dic = {'<unk>': 0, 'B-PS_PROF': 1, 'B-PS_ENT': 2, 'B-PS_POL': 3, 'B-PS_NAME': 4,
... | nilq/baby-python | python |
"""
Test file to test RetrieveMovie.py
"""
from Product.Database.DatabaseManager.Retrieve.RetrieveMovie import RetrieveMovie
from Product.Database.DBConn import create_session
from Product.Database.DBConn import Movie
def test_retrieve_movie():
"""
Author: John Andree Lidquist
Date: 2017-11-16
Last Up... | nilq/baby-python | python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.