content stringlengths 5 1.05M |
|---|
from app import db
from app.Collections.Courses import Courses
from app.Collections.Users import Users
from app.Collections.Departments import Departments
from pymongo.errors import WriteError
from flask import jsonify, Response
import datetime
import jwt
class departmentServices():
@staticmethod
def a... |
"""
simple_calendar.py
This is an utterly hopeless calendar system, that in no way should be let near real-world pricing
applications.
Although we could later define a date object, dates for internal calculations are real numbers, with 1.0
equalling one year. This is good enough for really simple yield and price calc... |
# VRC Peripheral Python Library
# Written by Casey Hanner
import time
from struct import pack
from typing import Any, List, Literal, Union
from loguru import logger
import serial
class VRC_Peripheral(object):
def __init__(self, port: int, use_serial: bool = True) -> None:
self.port = port
self.P... |
from autodp.mechanism_zoo import GaussianMechanism
from autodp.fdp_bank import fDP_gaussian
import numpy as np
from absl.testing import absltest
from absl.testing import parameterized
params = [0.05, 0.1, 0.2, 0.5,1.0, 2.0,5.0, 10.0]
def _fdp_conversion(sigma):
# Using the log(1-f(fpr)) and log(- \partial f(... |
from estudent import data_generator
from estudent.school import School
def run_example():
students = data_generator.generate_students()
students.sort(key=lambda student: student.grades_avg(), reverse=True)
school = School(name="Hogwart", students=students)
best_student = school.students[0]
# pri... |
import os
import pandas as pd
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.feature_extraction.text import CountVectorizer
# code to read the xlsx File
filepath = os.path.abspath(os.path.dirname(__name__))
sheet_name = 'commonwordswithIPA'
filename = filepath + '/application/resources/recommender... |
from coreapi import codecs, exceptions, transports
from coreapi.compat import string_types
from coreapi.document import Document, Link
from coreapi.utils import determine_transport, get_installed_codecs
import collections
import itypes
LinkAncestor = collections.namedtuple('LinkAncestor', ['document', 'keys'])
def ... |
import abc
from munch import Munch
from .path import Path
from .serialization import YAMLMixin
from .storage import Storage
from .utils import import_class as _import_class
class Persistent(Storage, YAMLMixin, abc.ABC):
"""Base class for persistent storages.
A persistent storage must expose two *gateways*,... |
import torch
import numpy as np
import math
from . import common_functions as c_f
# input must be 2D
def logsumexp(x, keep_mask=None, add_one=True, dim=1):
if keep_mask is not None:
x = x.masked_fill(~keep_mask, c_f.neg_inf(x.dtype))
if add_one:
zeros = torch.zeros(x.size(dim-1), dtype=x.dtype,... |
from invoke import task
import requests
from os.path import join
from subprocess import run
from tasks.util.env import WASM_BUILD_DIR, WASM_INSTALL_DIR, clean_dir
from tasks.util.faasm import get_faasm_upload_host_port
from tasks.lammps.env import (
LAMMPS_DIR,
LAMMPS_FAASM_USER,
LAMMPS_FAASM_FUNC,
)
CMA... |
import logging
import pathlib
import torch.utils.data as data
import torchvision.transforms as T
from torchvision.datasets import ImageFolder
from codebase.torchutils.distributed import world_size
from ..utils import get_samplers
_logger = logging.getLogger(__name__)
def get_train_transforms(crop_size, mean, std,... |
import psycopg2
from faker import Faker
import os
import traceback
import psycopg2.extras
import random
import string
def connect_db():
db_name = os.getenv('COMPANY_NAME', 'apporbit')
user = os.getenv('POSTGRES_USER', 'odoo')
passwd = os.getenv('POSTGRES_PASSWORD', 'odoo')
host = os.geten... |
import argparse
from dataclasses import (
dataclass,
)
import logging
from pathlib import (
Path,
)
from typing import (
Any,
FrozenSet,
IO,
Iterable,
NamedTuple,
Optional,
Union,
)
import docker
from more_itertools import (
one,
)
import requirements
from requirements.requireme... |
#!/usr/bin/python
##############################
#### Modules Import Start ####
##############################
from flask import Flask, render_template, request, redirect, send_file
from werkzeug import secure_filename
from app import app
import global_variables
from sys import argv
#script, filename = argv
import o... |
#!/usr/bin/env python3
class Observer:
"""
Objects that are interested in a subject should
inherit from this class.
"""
def notify(self, sender: object):
pass
|
#!/usr/bin/env python
import uuid
# Tham khảo:
# - https://stackoverflow.com/a/159195
# - https://www.geeksforgeeks.org/extracting-mac-address-using-python/
def get_mac_address_1():
int_mac = uuid.getnode()
hex_mac_fmt = ':'.join(['{:02x}'.format((int_mac >> x) & 0xff)
for x in rang... |
# `pip install easydict` if you don't have it
from easydict import EasyDict as edict
import numpy as np
import json
import numpy as np
class NumpyEncoder(json.JSONEncoder):
""" Special json encoder for numpy types """
def default(self, obj):
if isinstance(obj, (np.int_, np.intc, np.intp, np.int8,
... |
from .data import MaskArray
from .data import MaskGroup
from .data import PdgArray
from .data import MomentumArray
from .data import ColorArray
from .data import ParticleSet
from .data import AdjacencyList
from .data import Graphicle
from . import matrix
from . import transform
__all__ = [
"MaskArray",
"MaskGr... |
import sys
import os
ROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "../"))
sys.path.append(ROOT_PATH)
import docutils.nodes
import docutils.parsers.rst
import docutils.utils
import docutils.frontend
from Utils.FileFunc import PathManager
def parse_rst(text: str) -> docutils.nodes.document:
p... |
# This file was automatically created by FeynRules 1.7.51
# Mathematica version: 8.0 for Linux x86 (64-bit) (February 23, 2011)
# Date: Thu 2 Aug 2012 10:15:24
from object_library import all_orders, CouplingOrder
NP = CouplingOrder(name = 'NP',
expansion_order = 99,
hierarchy =... |
import json
import pytest
from django.core.management import call_command
@pytest.fixture(scope="session")
def django_db_setup(django_db_setup, django_db_blocker):
with django_db_blocker.unblock():
call_command("migrate")
call_command("loaddata", "src/fixtures/account.json")
call_command(... |
from __future__ import annotations
from typing import Optional, List, TYPE_CHECKING
import pandas as pd
from whyqd.base import BaseMorphAction
if TYPE_CHECKING:
from ..models import ColumnModel
class Action(BaseMorphAction):
"""Delete columns provided in a list.
Script::
"DELETE_COLUMNS > ['so... |
import os
import sys
import bioframe
import click
import cooler
import cooltools
import cooltools.expected
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.lines import Line2D
import numpy as np
import pandas as pd
import pairlib
import pairlib.scalings
import pairtools
from diskc... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
import subprocess
import logging
import time
import os
import sys
import shutil
import sqlite3
from pathlib import Path
import scripts.cron_logging
# get the logger for the application
logger = scripts.cron_logging.logger
def reboot():
"""Reboot the system but first include some system info in the cron_log
fi... |
import logging
import urllib
from decorators import login_required
from google.appengine.ext import ndb
from application.handlers.base import BaseHandler
from application.models.program import Program
from application.models.agency import Agency
class ProgramHandler(BaseHandler):
@login_required
def get(self,... |
from collections import Iterable
from matrx.objects import AreaTile, EnvObject
import numpy as np
class CollectionTarget(EnvObject):
def __init__(self, location, collection_objects, collection_zone_name, name="Collection_target"):
""" An invisible object that tells which objects needs collection.
... |
from setuptools import setup
setup(
name='bluemoon',
version='0.1.1',
author='ksen0',
author_email='ksenok@protonmail.com',
packages=['bluemoon'],
description='Toolkit for finding exceptional things in data collected about a life.',
)
|
import argparse
from utils.pdb_file import read_pdb_ids_file, fetch_pdb
from utils.io import get_files
from utils.sequence_cluster import match_clusters, get_clusters
from utils.ProgressBar import ProgressBar
def pipeline(pdb_ids, pdb_gz_dir, out_dir='./', m_pdb_ch_file=None, sqid=30, loaded=False, remove_pdb_gz=Fals... |
# ------------------------------
# 27. Remove Element
#
# Description:
# Given an array and a value, remove all instances of that value in place and return the new length.
# Do not allocate extra space for another array, you must do this in place with constant memory.
#
# The order of elements can be changed. It does... |
# Generated by Django 2.1.5 on 2019-02-04 15:54
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('paikkala', '0009_default_room'),
]
operations = [
migrations.AlterField(
model_name='program',
... |
"""Mock responses for device queries."""
GET_DEVICE_RESP = {
"activation_code": None,
"activation_code_expiry_time": "2019-12-12T16:23:14.291Z",
"ad_group_id": 0,
"appliance_name": None,
"appliance_uuid": None,
"av_ave_version": "8.3.62.44",
"av_engine": "4.13.0.207-ave.8.3.62.44:avpack.8.5... |
#!/usr/bin/env python3
import socket
import time
import struct
import sys
import os
import hashlib
import getopt
import fcntl
import struct
import socket, select
from Crypto.Cipher import AES
import base64
import binascii
import random
class AEScipher():
def __init__(self, aespwd):
AESCTR_PASSWORD = hashl... |
import os
import sys
sys.path.insert(0, os.getcwd())
import numpy as np
import pandas as pd
import dreamtools as dt
@np.vectorize
def approximately_equal(x, y, ndigits=0):
return round(x, ndigits) == round(y, ndigits)
def test_gdx_read():
db = dt.Gdx("test.gdx")
assert approximately_equal(db["qY"]["byg", 201... |
import bs
import bsUtils
import bsSpaz
import weakref
import math
import random
import bsInternal
class PlayerScoredMessage(object):
"""
category: Message Classes
Informs a bs.Activity that a player scored.
Attributes:
score
The score value.
"""
def __init__(self,score):
... |
from django.db import models
from api.models.post.models import Post
class DetailPost(models.Model):
num = models.OneToOneField(Post,
unique=True,
primary_key=True,
on_delete=models.DO_NOTHING,
... |
import csv
import json
import sys
###############################################################################
#
# This file takes in a Manuscript vhmml JSON file with just listing data
# and outputs a CSV file (id, country, city, repository, shelf mark,
# project number, permalink
#
###############################... |
from __future__ import annotations
import datetime
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from .attachments import Poll, Geo, File, Media
from .enums import ReplySetting
from .constants import (
TWEET_EXPANSION,
TWEET_FIELD,
USER_FIELD,
PINNED_TWEET_EXPANSION,
MEDIA_FIE... |
### Welcome to SliceGAN ###
####### Steve Kench #######
'''
Use this file to define your settings for a training run, or
to generate a synthetic image using a trained generator.
'''
from slicegan import model, networks, util
import argparse
# Define project name
Project_name = 'NMC_exemplar_final'
# Specify project fo... |
# Copyright 2019 Eli Lilly and Company
#
# 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 l... |
# this file should generally become
# less useful as you scroll down.
# except for the bottom one :P <3
""" server settings """
# the domain you'd like gulag to be hosted on.
domain = 'cmyui.xyz' # cmyui.xyz
# the address which the server runs on, unix or inet4.
server_addr = '/tmp/gulag.sock' # /tmp/gulag.sock,
... |
def test_socfaker_pcap(socfaker_fixture):
assert socfaker_fixture.pcap()
|
#!/usr/bin/python3
import numpy as np
import numpy.matlib as mat
import scipy as sci
import muan.control.controls
from muan.control.state_space_gains import *
"""
A state-space plant class with support for process and measurement noise
"""
__author__ = 'Kyle Stachowicz (kylestach99@gmail.com)'
class StateSpacePlant(... |
###########################
#
# #534 Weak Queens - Project Euler
# https://projecteuler.net/problem=534
#
# Code by Kevin Marciniak
#
###########################
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import izip
def check(ls): return all(int(p) <= int(n) for p,n in izip(ls, ls[1:]))
def fv(x): return next(i for i,j in enumerate(x) if x[i]>=x[i+1])
with open('B-large.in','r') as f: lines = f.read().splitlines()
cn = 1
for x in lines[1:]:
if ... |
#!/usr/bin/env python
# Derived from http://sundararajana.blogspot.com/2007/05/motion-detection-using-opencv.html
import cv
class Target:
def __init__(self):
self.capture = cv.CaptureFromCAM(0)
cv.NamedWindow("Target", 1)
def run(self):
# Capture first frame to get size
frame... |
import torch
import torchvision as tv
import torch.backends.cudnn as cudnn
import torch.distributed as dist
from torch.nn.parallel import DistributedDataParallel as ddp
import os
import time
import random
import argparse
import numpy as np
random.seed(0)
np.random.seed(0)
torch.manual_seed(0)
if torch.cuda.is_availab... |
import unittest
from geom_tools.adjacency_tools import (
vertices_adjacency_from_polygon_vertex_indices,
max_vertex_ind_in_list,
expand_adjacency_table,
)
class TestAdjacencyTools(unittest.TestCase):
def test_vertices_adjacency_from_polygon_vertex_indices01(self):
indices = [
[0, ... |
# #####################################################################################################################
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
PyVO is a package providing access to remote data and services of the
Virtual observatory (VO) using Python.
The pyvo module currently provides these main capabilities:
* find archives that provide particular data of a particular type and/or
relat... |
'''
Created on Jan 6, 2014
@author: Jose Borreguero
'''
import numpy
import copy
from logger import vlog
from interpolator import Interpolator
class Channel( object ):
''' This class implements a dynamical channel defined by momentum transfer Q and energy E '''
def __init__( self ):
'''
Attributes:
... |
from datetime import datetime, timedelta
from typing import Optional
import jwt
# custom defined
from app.core.config import timezone, secret_key, algorithm, access_token_expire_minutes
# 创建token,token包含exp,和用户自定义的json数据
def create_access_token(*, data: dict, expires_delta: Optional[timedelta] = None):
to_encode ... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('serverdb', '0004_attribute_value_constraints'),
]
operations = [
# Mark all previously defined attributes as clonable once.
migrations.RunSQL(
'UPDATE attribute '
'S... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-06-25 17:50
from __future__ import unicode_literals
from decimal import Decimal
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
... |
result = "Some scalar, less then 255 bytes size"
|
# some general imports
from time import perf_counter
import datetime
import numpy as np
from scipy.optimize import fsolve
from scipy.linalg import norm
import matplotlib.pyplot as plt
import matplotlib.dates as mdates # for plotting dates
# loads the data from the csv file
# the data is stored in data, which will be... |
# Copyright (c) 2022, Prasanth and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
import datetime
class EmployeeDeduction(Document):
pass
@frappe.whitelist()
def add_data(doc, deduction_type=None, s_date=None, amount=None):
s_date = s_... |
import collections
import os
import sys
# parse result file and return as {suite: {case: {config: value} } }
def parseFile(fileName):
file = open(fileName)
suitesLines = []
suitesNames = []
totalLines = 0
res = {}
for i, line in enumerate(file.readlines()):
totalLines += 1
... |
# This file is only required for Python 2.x compatibility. Python 3 does not require an __init__.py
|
import math
def f(x):
return x**3*math.exp(x)
def trapezoidal(a, b, n):
h = float(b - a) / n
s = 0
s += f(a)/2
for i in range(1, n):
s += f(a + i*h)
s += f(b)/2
return s * h |
import unittest
from _2_add_two_numbers import add_two_numbers
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class MyTestCase(unittest.TestCase):
def test_1(self):
input_1 = ListNode(2)
input_1.next = ListNode(4)
input_1.next.next = ListNode(3)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from flask_script import Manager, Shell, Server
from flask_script.commands import Clean, ShowUrls
from flask_migrate import MigrateCommand
from flask.ext.login import login_required, make_secure_token, get_auth_token
from ccflasktest.app import create_app
from cc... |
#! /usr/bin/env python
'''
Demonstrates how simple group can be used as one-to-many
relationship using a column family
'''
import util
from pycassa.columnfamily import ColumnFamily
# Load data from data/movies
def loadData():
con = util.getConnection()
cf = ColumnFamily(con, 'videos')
tagCF = ColumnFamily(con, ... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
def test_strides():
desc = dace.float64[1, 2, 3]
assert desc.strides == (6, 3, 1)
assert desc.total_size == 6
perm_strides, perm_size = desc.strides_from_layout(0, 1, 2)
assert perm_size == desc.total_size
... |
import http.client
import socket
from base64 import b64encode
import json
from . import resources
from .resource import Resource, Empty
from .request import Request
from .response import Response
from recurly import USER_AGENT, DEFAULT_REQUEST_TIMEOUT, ApiError, NetworkError
from pydoc import locate
import urllib.parse... |
#!/usr/local/bin/python
"""
See LICENSE file for copyright and license details.
"""
from database.databaseaccess import DatabaseAccess
from database.mappings import *
from modules.core_module import CoreModule
from modules.statement import Statement
from modules.function import *
from modules.constant import *
from... |
# Setup
import os
import chart_studio
from dotenv import load_dotenv
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.datasets import make_blobs
from sklearn.neighbors import LocalOutlierFactor
import plotly.express as px
import plotly.graph_objects as go
import datapane as dp
GREY =... |
# Databricks notebook source
# MAGIC %md # CCU002_03-D12-outcomes_dose2
# MAGIC
# MAGIC **Description** This notebook determines outcomes for the analysis.
# MAGIC
# MAGIC **Author(s)** Venexia Walker
# COMMAND ----------
# MAGIC %md ## Clear cache
# COMMAND ----------
# MAGIC %sql
# MAGIC CLEAR CACHE
# COMMAND... |
#!/usr/bin/python3
"""
# Author: Scott Chubb scott.chubb@netapp.com
# Written for Python 3.7 and above
# No warranty is offered, use at your own risk. While these scripts have been
# tested in lab situations, all use cases cannot be accounted for.
"""
import sys, time, os
import requests
from datetime imp... |
'''
Simple xgboost implementation
'''
|
import requests
def download_from_url(url: str, save_path: str, chunk_size: int = 128, progress_update=None):
response = requests.get(url, stream=True)
total_size_in_bytes = int(response.headers.get('content-length', 0))
acc_c_size = 0
with open(save_path, 'wb') as fd:
for chunk in response.it... |
from flask_mail import Message, Mail
from flask import render_template
from . import mail
subject='Pitcher'
def mail_message(subject,template, to, **kwargs):
sender_email = 'dev.py.js@gmail.com'
email = Message(subject, sender =sender_email, recipients=[to])
email.body= render_template(template + ".txt", ... |
# -*- coding: utf-8 -*-
"""Noise modules."""
import abc
import six
import tensorflow as tf
from opennmt import constants
from opennmt.data import text
from opennmt.utils import misc
class WordNoiser(object):
"""Applies noise to words sequences."""
def __init__(self, noises=None, subword_token="■", is_spacer=... |
#!/usr/bin/env python3
import argparse
import os
import shutil
import socket
import sys
from functools import partial
from pathlib import Path
import mako.lookup
import mako.template
import requests
import toml
import yaml
BASE16_TEMPLATES_URL = 'https://raw.githubusercontent.com/chriskempson/base16-templates-source... |
# -*- coding: utf-8 -*-
SOI = b'\xFF\xA0' #Start of Image
EOI = b'\xFF\xA1' #End of Image
SOF = b'\xFF\xA2' #Start of Frame
SOB = b'\xFF\xA3' #Start of Block
DTT = b'\xFF\xA4' #Define Transform Table
DQT = b'\xFF\xA5' #Define Quantization Table
DHT = b'\xFF\xA6' #Define Huffman Table(s)
DRI = b'\x... |
import requests
__author__ = 'Corey Hoard'
__version__ = '1.0.0'
__license__ = 'MIT'
__all__ = ['Imgflip', 'Meme']
class Imgflip(object):
"""
Access the Imgflip RESTful JSON API.
A username and password are needed to caption images, but are not needed to get
the current list of memes.
Examples:
... |
import h5py
import numpy as np
def load_dataset(train_path, test_path):
train_dataset = h5py.File(train_path, "r")
train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features
train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels
test_dataset = ... |
import parser
import unittest
from test import test_support
#
# First, we test that we can generate trees from valid source fragments,
# and that these valid trees are indeed allowed by the tree-loading side
# of the parser module.
#
class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def roundtrip(self, f... |
# ----------------------------------------------------------------------
# |
# | __init__.py
# |
# | David Brownell <db@DavidBrownell.com>
# | 2018-05-19 14:09:14
# |
# ----------------------------------------------------------------------
# |
# | Copyright David Brownell 2018.
# | Distribute... |
from vedis import Vedis
import config
# Пытаемся узнать из базы «состояние» пользователя
def get_current_state(user_id):
with Vedis(config.db_file) as db:
try:
return db[user_id].decode() # Если используете Vedis версии ниже, чем 0.7.1, то .decode() НЕ НУЖЕН
except KeyError: ... |
import time
import sys
import os
def load_animation():
load_str = "starting your console application..."
ls_len = len(load_str)
animation = "|/-\\"
anicount = 0
counttime = 0
i = 0
while (counttime != 100):
... |
import torch
from koila import PrePassFunc, prepasses
from . import common
def test_compatibility() -> None:
assert isinstance(prepasses.identity, PrePassFunc)
assert isinstance(prepasses.symmetric, PrePassFunc)
assert isinstance(prepasses.reduce_dims, PrePassFunc)
assert isinstance(prepasses.permut... |
import os, sys, new
# WARNING: this is all nicely RPython, but there is no RPython code around
# to *compile* regular expressions, so outside of PyPy this is only useful
# for RPython applications that just need precompiled regexps.
#
# XXX However it's not even clear how to get such prebuilt regexps...
import rsre_c... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import hashlib
import sqlalchemy as sa
from holmes.models import Base
from holmes.models.domain import Domain
class Limiter(Base):
__tablename__ = "limiters"
id = sa.Column(sa.Integer, primary_key=True)
url = sa.Column('url', sa.String(2000), nullable=False)
... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pint.toa as toa
import pint.models as models
import pint.fitter as fit
import pint.residuals as r
import astropy.units as u
import enterprise
from enterprise.pulsar import Pulsar
import enterprise.signals.parameter as parameter
from enterprise.signals imp... |
class MassGBXMLExportOptions(object,IDisposable):
"""
Options used when exporting a gbXML file from a mass model document.
MassGBXMLExportOptions(massZoneIds: IList[ElementId])
MassGBXMLExportOptions(massZoneIds: IList[ElementId],massIds: IList[ElementId])
"""
def Dispose(self):
""" Dispose(self... |
# -*- coding: utf-8 -*-
"""
@inproceedings{DBLP:conf/cvpr/SunLCS19,
author = {Qianru Sun and
Yaoyao Liu and
Tat{-}Seng Chua and
Bernt Schiele},
title = {Meta-Transfer Learning for Few-Shot Learning},
booktitle = {{IEEE} Conference on Computer Vision and Pattern ... |
class Contact:
def __init__(self, firstname, middlename, nickname):
self.firstname = firstname
self.middlename = middlename
self.nickname = nickname
|
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x02\x6a\
\x00\
\x00\x10\xbe\x78\x9c\xc5\x98\xcf\x4f\xd3\x60\x18\xc7\xdf\x02\x0a\
\x2c\xb2\x76\x... |
# Link --> https://www.hackerrank.com/challenges/maximum-element/problem
# Code:
def getMax(operations):
maximum = 0
temp = []
answer = []
for i in operations:
if i != '2' and i != '3':
numbers = i.split()
number = int(numbers[1])
temp.append(number)
... |
Print("hello world");
print("Testing");
print("Salam")
print("Walikum as Salam")
print("testing Change");
print("New Change") |
# Program to find the longest common prefix
def findMinLength(array, size):
minimum = len(array[0])
for i in range(1,size):
if (len(array[i])< minimum):
minimum = len(array[i])
return(minimum)
# A Function that returns the longest common prefix from the array of strings
def co... |
#!/usr/bin/env python
#############################################################################
### Natom_vs_Nsmichars.py
###
### Counts alphabet chars in SMILES for comparison with the atom count.
### Using Prestwick (from PubChem search, 1271 SMILES), the Spearman
### correlation coefficient is .997. This ... |
from typing import Union, List, Dict
from nonebot import MessageSegment
from hoshino.log import new_logger
import base64, aiohttp, traceback
from .data import Data
from .config import config
from .api import Get_Random_Imginfo, Get_Imginfo
logger = new_logger('setu_download')
def b2b64(bytes: bytes) -> st... |
import FWCore.ParameterSet.Config as cms
import copy
# AlCaReco for Bad Component Identification
OutALCARECOEcalTestPulsesRaw_noDrop = cms.PSet(
SelectEvents=cms.untracked.PSet(
SelectEvents=cms.vstring('pathALCARECOEcalTestPulsesRaw')
),
outputCommands=cms.untracked.vstring(
'keep FEDRaw... |
# Copyright 2018 Digital Domain 3.0
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Tr... |
"""Object utilities."""
from __future__ import absolute_import, unicode_literals
from copy import copy
from .connection import maybe_channel
from .exceptions import NotBoundError
from .five import python_2_unicode_compatible
from .utils.functional import ChannelPromise
__all__ = ('Object', 'MaybeChannelBound')
def... |
from qiwi_handler.utils.methods import MakeDict
class MobilePinInfo(MakeDict):
def __init__(self,
mobile_pin_used: bool = None,
last_mobile_pin_change: bool = None,
next_mobile_pin_change: str = None,
):
self.mobilePinUsed = mobile_pin_u... |
def increase_number_roundness(n):
return '0' in str(n).rstrip('0')
if __name__ == '__main__':
n = 902200100
print(increase_number_roundness(n))
|
# -*- coding: utf-8 -*-
# _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2018 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
from ldap3 import Server, Connection, ALL
"""Commander Plugin fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.