filename stringlengths 13 19 | text stringlengths 134 1.04M |
|---|---|
the-stack_106_32214 | import pandas as pd
from dash_website.utils.aws_loader import load_csv
columns_to_take = [
"id",
"sex",
"age_category",
"sample",
"aging_rate",
"Age",
"Biological_Age",
"Ethnicity.White",
"Ethnicity.British",
"Ethnicity.Irish",
"Ethnicity.White_Other",
"Ethnicity.Mixed",... |
the-stack_106_32215 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 PPMessage.
# Guijin Ding, dingguijin@gmail.com
# All rights reserved
#
from ppmessage.core.apkinfo import ApkInfo
from ppmessage.core.ipainfo import IpaInfo
import traceback
import random
import sys
import os
APP_NAME = "ppmessage"
if len(sys.argv) == 2:
APP_NA... |
the-stack_106_32216 | import time
import logging
from spaceone.inventory.libs.manager import GoogleCloudManager
from spaceone.inventory.libs.schema.base import ReferenceModel
from spaceone.inventory.model.load_balancing.cloud_service import *
from spaceone.inventory.connector.load_balancing import LoadBalancingConnector
from spaceone.inven... |
the-stack_106_32218 | """
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
"""
from __future__ import annotations
import operator
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Dict,
Optional,
Tuple,
Union,
cast,
)
from warnings import (
... |
the-stack_106_32219 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 13 14:51:46 2019
@author: MAGESHWARAN
"""
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPRegressor
from sklearn.metrics import r2_score
# read hours dataset
hour_df = pd.read_csv("hour... |
the-stack_106_32220 | def checkio(first, second):
list1=first.split(',')
list2 = second.split(',')
set1=set(list1)
set2=set(list2)
new_set = set1&set2
if len(new_set) == 0:
return ''
else:
return ','.join(sorted(new_set))
|
the-stack_106_32224 | import logging
import typing as t
from src.error import Error
from src.smali_method import SmaliMethod
class SmaliClass:
def __init__(self, name: str):
self.name: str = name
self.sig: str = ''
self.methods: t.List[SmaliMethod] = []
self.header_block: t.List[str] = []
def __pa... |
the-stack_106_32226 | # (c) 2015, Jon Hadfield <jon@lessknown.co.uk>
"""
Description: This lookup takes an AWS region and an RDS instance
name and returns the endpoint name.
Example Usage:
{{ lookup('aws_rds_endpoint_name_from_instance_name', ('eu-west-1', 'mydb')) }}
"""
from ansible import errors
try:
import boto.rds
except ImportErr... |
the-stack_106_32227 | import requests
from django.core.exceptions import ImproperlyConfigured
from allauth.socialaccount.helpers import complete_social_login
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.models import SocialLogin
from allauth.socialaccount import app_settings, providers
f... |
the-stack_106_32228 | #! /usr/bin/env python3
'''
This module provides access to the BankTransaction class
Usage:
t1 = BankTransaction()
t1.info()
t2 = BankTransaction(account=BankAccount(account_number=90101))
t2.info()
account_list = [BankAccount(subscriber_origin='nn_NO')]
t3 = BankTransaction(account=account_l... |
the-stack_106_32229 | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import argparse
import contextlib
import glob
import os
import re
import shutil
import subprocess
import sys
import hashlib
import platform
from amd_hipify import amd_hipify
from distutils.version impor... |
the-stack_106_32230 | import numpy as np
import ants
from cinemri.registration import Registrator
from cinemri.contour import Contour, get_anterior_wall_data, mask_to_contour
from cinemri.utils import numpy_2d_to_ants, average_by_vicinity, plot_vs_on_frame
from enum import Enum, unique
@unique
class VSNormType(Enum):
none = 0
# no... |
the-stack_106_32232 | from typing import FrozenSet
from collections import Iterable
from math import log, ceil
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msa... |
the-stack_106_32239 | from pathlib import Path
import subprocess as sp
def get_model_path(model_name, model_type=None):
"""
creates the path based on the model_name
model_name: string value indicationg the <org>/<model>/<version>
model_type: model type for braingen and kwyk model
Returns
-------
model_path... |
the-stack_106_32242 | #!/usr/bin/env python
# encoding: utf-8
'''
@author: Jason Lee
@license: (C) Copyright @ Jason Lee
@contact: jiansenll@163.com
@file: quick_sort.py
@time: 2019/3/28 10:13
@desc:
'''
def quick_sort(data):
if len(data) == 1:
return
quick_sort_core(data, 0, len(data) - 1)
def quick_sort_core(d... |
the-stack_106_32243 | # ipa.py - ipa transliteration module
# coding: utf-8
# The MIT License (MIT)
# Credit for IPA rules - Wikipedia, LionSlayer ...
# Copyright (c) 2018 Thura Hlaing
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to de... |
the-stack_106_32244 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
the-stack_106_32245 | try:
from ub.modules.sql_helper import SESSION, BASE
except ImportError:
raise AttributeError
from sqlalchemy import Column, String, UnicodeText
class bot_pm_ban(BASE):
__tablename__ = "bot_pm_ban_sql"
sender = Column(String(14), primary_key=True)
def __init__(self, sender):
self.sender ... |
the-stack_106_32247 | import json
import tensorflow as tf
from tensorflow import keras
model = keras.models.load_model('model.h5')
with open('dictionary.txt', 'r') as file:
diction = json.load(file)
def review_encode(s):
encoded = []
for word in s:
if word.lower() in diction:
encoded.append(diction[word.... |
the-stack_106_32248 | import threading,time
import queue
# li=[1,2,3,4,5]
# def pri():
# while li:
# a=li[-1]
# print(a)
# time.sleep(1)
# try:
# li.remove(a)
# except Exception as e:
# print('----',a,e)
#
# if __name__ == '__main__':
# t1 = threading.Thread(target=pri... |
the-stack_106_32249 | import pygame as pg
import random
from settings import *
from termcolor import colored
class Player(pg.sprite.Sprite):
def __init__(self, game, x, y,
health = PLAYER_HEALTH,
damage = PLAYER_DAMAGE,
armor = PLAYER_ARMOR,
weapon = 'weapon1',
... |
the-stack_106_32251 | import joblib
import numpy as np
import seldon_core
from seldon_core.user_model import SeldonComponent
from typing import Dict, List, Union, Iterable
import os
import logging
import yaml
logger = logging.getLogger(__name__)
JOBLIB_FILE = "model.joblib"
class SKLearnServer(SeldonComponent):
def __init__(self, mo... |
the-stack_106_32256 | import os
import torch
import argparse
from dataset import Dataset
from utils import compute_F1, compute_exact_match
from torch.utils.data import DataLoader
from transformers import AdamW
from tqdm import tqdm
from trainer import train, valid
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, AdamW... |
the-stack_106_32259 | #!/usr/bin/env python3
# Copyright (c) 2014-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs."""
fro... |
the-stack_106_32260 | import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
import slicing.slicer as slicer
file_name = 'insurance.csv'
dataset = pd.read_csv(file_name)
attributes_amount = len(dataset.values[0])
# for now w... |
the-stack_106_32261 | import tensorflow as tf
import numpy as np
import os
import json
# Spectral band names to read related GeoTIFF files
band_names = ['B01', 'B02', 'B03', 'B04', 'B05',
'B06', 'B07', 'B08', 'B8A', 'B09', 'B11', 'B12']
def prep_example(bands, BigEarthNet_19_labels, BigEarthNet_19_labels_multi_hot, patch_nam... |
the-stack_106_32262 | import numpy as np
import pytest
from numpy.testing import assert_allclose
from robogym.envs.dactyl.full_perpendicular import make_env, make_simple_env
from robogym.utils import rotation
def test_cube_mass():
env = make_env(constants=dict(randomize=False))
sim = env.unwrapped.sim
cube_id = sim.model.body... |
the-stack_106_32263 | import time
import electrumx.lib.util as util
def sessions_lines(data):
'''A generator returning lines for a list of sessions.
data is the return value of rpc_sessions().'''
fmt = ('{:<6} {:<5} {:>17} {:>5} '
'{:>7} {:>7} {:>5} {:>5} {:>7} '
'{:>7} {:>7} {:>7} {:>7} {:>9} {:>21}')
... |
the-stack_106_32265 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
the-stack_106_32267 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The XRJV1 Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PrioritiseTransaction code
#
from test_framework.test_framework import XRJV1TestFramework
from te... |
the-stack_106_32268 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
the-stack_106_32269 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# import libs
import pandas as pd
# # Dataset
# [SP500 Since 1950](https://www.kaggle.com/datasets/benjibb/sp500-since-1950?resource=download)
# In[2]:
df = pd.read_csv('GSPC.csv')
# In[3]:
df
# In[4]:
df.info()
# In[5]:
df.drop('Date', axis=1, inplace=... |
the-stack_106_32270 | text = input()
result_string = []
digits = [int(i) for i in text if i.isdigit()]
non_digits = [i for i in text if not i.isdigit()]
take_list = [num for idx, num in enumerate(digits) if idx % 2 == 0]
skip_list = [num for idx, num in enumerate(digits) if idx % 2 != 0]
take_skip_list = list(zip(take_list, skip_list))
s... |
the-stack_106_32272 | import torch
from esm import pretrained, ProteinBertModel
class FBModel(object):
def __init__(self, name, repr_layer=[-1], random_init=False):
self.name_ = name
self.repr_layer_ = repr_layer
model, alphabet = pretrained.load_model_and_alphabet(name)
if random_init:
# E... |
the-stack_106_32273 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 'local_data_dir': '/Users/eric/data/mms',
# example of setting your local data directory on macOS
# 'local_data_dir': 'c:\users\eric\data\mms', and Windows
import os
CONFIG = {'local_data_dir': 'pydata',
'debug_mode': False,
'download_only': False,
... |
the-stack_106_32274 | """
This module implements runtime logic to orchestrate the following steps
1. Attach to a target application
2. Resolve and activate probes
3. Resolve and program pmc events
4. Collect profile data for reporting
Author: Manikandan Dhamodharan, Morgan Stanley
"""
import logging
from xpedite.txn.classifier ... |
the-stack_106_32275 | from datetime import datetime
import flask
from config import Config
import requests
class OlhoVivoClient():
""" An Client that centralizes the comunication with OlhoVivo API """
def __init__(self):
self.url = Config.OLHOVIVO_URL
self.token = Config.OLHOVIVO_KEY
self.session = request... |
the-stack_106_32276 | import sys
if len(sys.argv) != 3:
print('Uso ex09-08.py LARGURA LINHAS')
else:
try:
LARGURA = int(sys.argv[1])
LINHA = int(sys.argv[2])
except:
print('Voce informou valores invalidos')
else:
nome_do_arquivo = 'mobydick.txt'
def verifica_pagina(arquivo, linha, pa... |
the-stack_106_32277 | #!/usr/bin/env python
#pylint: skip-file
# This source code is licensed under the Apache license found in the
# LICENSE file in the root directory of this project.
class ActionProperty(object):
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the v... |
the-stack_106_32278 | import re
import subprocess
import sys
import pytest
import ray
from ray.test_utils import run_string_as_driver_nonblocking
def test_worker_stdout():
script = """
import ray
import sys
ray.init(num_cpus=2)
@ray.remote
def foo(out_str, err_str):
print(out_str)
print(err_str, file=sys.stderr)
ray.get(fo... |
the-stack_106_32280 | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
from __future__ import absolute_import, unicode_literals
import hashlib
import os
import random
import re
import string
import tempfile
import time
import warnings
import pickle
from django.conf i... |
the-stack_106_32283 |
# COM3110/4155/6155: Text Processing
# Regular Expressions Lab Class
import sys, re
#------------------------------
testRE = re.compile('(logic|sicstus)', re.I)
#------------------------------
with open('RGX_DATA.html') as infs:
linenum = 0
for line in infs:
linenum += 1
if line.strip() =... |
the-stack_106_32284 | import os
import sys
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..', '..', "common")))
from env_indigo import *
indigo = Indigo()
bingo = Bingo.createDatabaseFile(indigo, "get_indigo_object_bug", 'molecule')
for item in ("C1=CC=CC=C1", "C1=CN=CC=C1"):
bingo.insert(indigo.loadM... |
the-stack_106_32285 | """
Test the memory module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import shutil
import os
import os.path
from tempfile import mkdtemp
import pickle
import warnings
import io
import sys
import time
import nose
from... |
the-stack_106_32289 | from pymaze.maze import Maze
from pymaze.solver import DepthFirstBacktracker
from pymaze.solver import BiDirectional
from pymaze.solver import BreadthFirst
class MazeManager(object):
"""A manager that abstracts the interaction with the library's components. The graphs, animations, maze creation,
and s... |
the-stack_106_32290 | # test dataset with opinion scores (os) in dictionary style with repetitions
dataset_name = 'test_dataset_os_as_dict_with_repetitions'
yuv_fmt = 'yuv420p'
width = 1920
height = 1080
ref_score = 5.0
ref_videos = [
{'content_id': 0, 'content_name': 'foo', 'path': 'foo.png'},
{'content_id': 1, 'content_nam... |
the-stack_106_32291 | # 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 version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
... |
the-stack_106_32292 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import OrderedDict
import re
from textwrap import dedent as dd
import glfw
from glfw import gl
class Shader(object):
'''Wrapper for opengl boilerplate code'''
def __init__(self, source):
assert glfw.core.init(), 'Error: GLFW could not b... |
the-stack_106_32293 | import _plotly_utils.basevalidators
class GeoValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="geo", parent_name="layout", **kwargs):
super(GeoValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
data_clas... |
the-stack_106_32299 | #!/usr/bin/env python
"""Trivial example scheduler
:Authors: Eric H. Neilsen, Jr.
:Organization: Fermi National Accelerator Laboratory
"""
__docformat__ = "restructuredtext en"
import json
import os
import posix
import datetime
import logging
import json
import time
import datetime
from collections import OrderedDi... |
the-stack_106_32301 | # Author: Rishabh Sharma <rishabh.sharma.gunner@gmail.com>
# This module was developed under funding provided by
# Google Summer of Code 2014
from ..client import GenericClient
import os
import tarfile
from functools import partial
from collections import OrderedDict
from astropy.time import Time
from astropy.time i... |
the-stack_106_32303 | from devito.tools import memoized_meth
from devito import VectorTimeFunction, TensorTimeFunction
from examples.seismic import Receiver
from examples.seismic.elastic.operators import ForwardOperator
class ElasticWaveSolver(object):
"""
Solver object that provides operators for seismic inversion problems
a... |
the-stack_106_32304 | # Copyright 2017 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 by applicable law... |
the-stack_106_32308 | # coding: utf-8
import tushare as ts
import pandas as pd
import datetime
g = {}
# 定义行业类别
g.index = 'industry'
# 定义全局参数值
g.indexThre = 0.2 #站上pastDay日均线的行业比重
g.pastDay = 30 # 过去pastDay日参数
g.topK = 6 #
if g.index == 'index':
# 定义行业指数list以便去股票
g.indexList = ['000928.XSHG', '000929.XSHG', '000930.XSHG', '00093... |
the-stack_106_32309 | #
# CanvasRenderAgg.py -- for rendering into a ImageViewAgg widget
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import math
import aggdraw as agg
from . import AggHe... |
the-stack_106_32311 | print("テーブル名を入力してください")
table = input()
#print("カラム数を入力してください")
#colum = int(input())
print("csvデータを張り付けてね")
mail=[]
while(True):
i = input()
if(i=="end"):
break
test=i.split(",")
test2='"'
for n in range(len(test[0])):
test2.append(test[0][n])
mail.append()
for i in mail:
p... |
the-stack_106_32313 | """
Newsreader - Site
Copyright (c) 2018 Trevor Bramwell <trevor@bramwell.net>
SPDX-License-Identifier: Apache-2.0
"""
import requests
from bs4 import BeautifulSoup
from .article import Article
class Site():
"""A site represents a news source and contains a list of articles
after being parsed"""
name... |
the-stack_106_32314 | #!/usr/bin/env python
from distutils.core import setup
LONG_DESCRIPTION = \
'''The program reads one or more input FASTA files.
For each file it computes a variety of statistics, and then
prints a summary of the statistics as output.
The goal is to provide a solid foundation for new bioinformatics command line tools... |
the-stack_106_32315 | import tvm
import numpy as np
from tvm import relay
from tvm.relay.ir_pass import alpha_equal
from tvm.relay.ir_builder import convert
def test_tensor_type_alpha_equal():
t1 = relay.TensorType((3, 4), "float32")
t2 = relay.TensorType((3, 4), "float32")
t3 = relay.TensorType((3, 4, 5), "float32")
assert... |
the-stack_106_32316 | import os
from bokeh.layouts import gridplot
from bokeh.plotting import figure, show, save, output_file
from bokeh.models import ColumnDataSource, HoverTool, LinearColorMapper, BasicTicker, PrintfTickFormatter, ColorBar, Range1d
from bokeh.transform import transform
from bokeh.palettes import RdBu, Spectral, RdYlBu, Rd... |
the-stack_106_32317 | import os
import pickle
import gendist
import torchvision
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime
from tqdm import tqdm
from loguru import logger
from augly import image
from jax.flatten_util import ravel_pytree
def processor(X, angle):
X_shift = image.... |
the-stack_106_32318 | import pytest
@pytest.fixture
def document_0(publication):
return {
'references': [publication['identifiers'][0]],
}
@pytest.fixture
def document_base(lab, award):
return {
'award': award['uuid'],
'lab': lab['uuid'],
'document_type': 'growth protocol',
}
@pytest.fix... |
the-stack_106_32319 | """modify isotopes table
Revision ID: 8e68245fe95a
Revises: a5189c25d85e
Create Date: 2017-01-07 15:11:16.650856
"""
# revision identifiers, used by Alembic.
revision = "8e68245fe95a"
down_revision = "a5189c25d85e"
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade()... |
the-stack_106_32320 | from __future__ import annotations
import os
import signal
import subprocess as sp
from enum import Enum, auto
from threading import Thread
from typing import Callable, List
from pyutils import exc
from .util import find_executable, kill
# Public classes
class OutputAction(Enum):
"""Output actions."""
PRI... |
the-stack_106_32322 | import dbm
import logging
import os
from pathlib import Path
import shutil
import tempfile
from django.apps import apps
from django.utils.module_loading import import_string
from .classes import DefinedStorage, PassthroughStorage
from .settings import setting_temporary_directory
logger = logging.getLogger(name=__nam... |
the-stack_106_32325 | import importlib
import torch.utils.data
from data.base_data_loader import BaseDataLoader
from data.base_dataset import BaseDataset
import numpy
def find_dataset_using_name(dataset_name):
# Given the option --dataset [datasetname],
# the file "data/datasetname_dataset.py"
# will be imported.
dataset_f... |
the-stack_106_32326 | from google.protobuf.json_format import MessageToJson
class EmailComparetor:
def compareEmailPb(self, oldPb, newPb):
if (oldPb.localPart != ''):
if (newPb.localPart != ''):
None
else:
assert False, self.errorString(errorString="Local Part", newPb=ne... |
the-stack_106_32327 |
from scipy import signal
import numpy as np
import dtw
from grbpy.burst import Burst
import matplotlib.pyplot as plt
import csv
import os
import pickle
data_path = os.path.join('..','batse_data')
# select the matrix type
matrix_type = 'euclid'
# adds a 25% buffer tot eh t90 time when False
no_buffer = True
# t... |
the-stack_106_32328 | # Copyright 2012 by Wibowo Arindrarto. All rights reserved.
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Biopython interface... |
the-stack_106_32329 | import pygame as pg
from settings import *
class Player(pg.sprite.Sprite):
def __init__(self, game, x, y):
self.groups = game.all_sprites
pg.sprite.Sprite.__init__(self, self.groups)
self.game = game
self.image = pg.Surface((TILESIZE, TILESIZE))
self.image.fill(YELL... |
the-stack_106_32331 | from typing import Tuple, FrozenSet
from collections import Iterable
from mathsat import msat_term, msat_env
from mathsat import msat_make_constant, msat_declare_function
from mathsat import msat_get_integer_type, msat_get_rational_type, msat_get_bool_type
from mathsat import msat_make_and, msat_make_not, msat_mak... |
the-stack_106_32334 | """
TencentBlueKing is pleased to support the open source community by making
蓝鲸智云PaaS平台社区版 (BlueKing PaaSCommunity Edition) available.
Copyright (C) 2017-2018 THL A29 Limited,
a Tencent company. All rights reserved.
Licensed under the MIT License (the "License");
you may not use this file except in compliance with the... |
the-stack_106_32335 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2020 by Inria
Authoried by Xiaoyu BIE (xiaoyu.bie@inrai.fr)
License agreement in LICENSE.txt
"""
import datetime
import scipy.io as sio
import os
import sys
import argparse
from matplotlib import ticker
from tqdm import tqdm
import torch
import numpy ... |
the-stack_106_32336 | """
Given two words A and B, find the minimum number of steps required to convert A to B. (each operation is counted as 1 step.)
You have the following 3 operations permitted on a word:
Insert a character
Delete a character
Replace a character
Example :
edit distance between
"Anshuman" and "Antihuman" is 2.
Operatio... |
the-stack_106_32337 | import io
import asyncio
import discord
import random
import asyncio
import random
import datetime
import config
import discord
from utils.embed import Embed
import traceback
from discord import errors
from discord.ext import commands
from discord.ext import commands
class general(commands.Cog):
def __init__(self, ... |
the-stack_106_32338 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
fix_xml_ampersands,
float_or_none,
xpath_with_ns,
xpath_text,
)
class KarriereVideosIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\... |
the-stack_106_32339 | # coding: utf-8
# ----------------------------------------------------------------
# <copyright company="Aspose" file="CreateFolderRequest.py">
# Copyright (c) 2018-2019 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a
#... |
the-stack_106_32341 | from .base_atari_env import BaseAtariEnv, base_env_wrapper_fn, parallel_wrapper_fn
import os
def raw_env(**kwargs):
mode = 33
num_players = 4
return BaseAtariEnv(game="pong", num_players=num_players, mode_num=mode, env_name=os.path.basename(__file__)[:-3], **kwargs)
env = base_env_wrapper_fn(raw_env)
pa... |
the-stack_106_32342 | """
Utility functions to sync and work with Open Humans data in a local filesystem.
"""
import csv
import hashlib
import logging
import os
import re
import arrow
from humanfriendly import format_size, parse_size
import requests
MAX_FILE_DEFAULT = parse_size('128m')
def strip_zip_suffix(filename):
if filename.e... |
the-stack_106_32344 | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# The code is based on HigherHRNet-Human-Pose-Estimation.
# (https://github.com/HRNet/HigherHRNet-Human-Pose-Estimation)
# Modified by Zigang Geng (zigang@mail.ustc.edu.cn).
# ---... |
the-stack_106_32345 | import enum
import subprocess
import os
import tempfile
try:
from importlib.resources import path
except ImportError:
# use backport for python < 3.7
from importlib_resources import path
__all__ = ["subroutinize", "OutputFormat", "Error"]
class OutputFormat(enum.Enum):
CFF = "cff"
CFF2 = "cff2"... |
the-stack_106_32347 |
"""The data layer used during training to train a Fast R-CNN network.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
from PIL import Image
import torch
from model.utils.config import cfg
from roi_data_layer.minibatch i... |
the-stack_106_32348 | """ This strdiff computes differences in two strings
from etutils.strdiff import strdiff
A= strdiff(string1, string2, <optional>)
INPUT:
data: datamatrix
rows = features
colums = samples
OPTIONAL
OUTPUT
output
DESCRIPTION
Compute differences in strin... |
the-stack_106_32349 | from typing import Any, Dict, Optional, Union
import httpx
from ...client import Client
from ...models.conn_record import ConnRecord
from ...types import UNSET, Response, Unset
def _get_kwargs(
conn_id: str,
*,
client: Client,
mediation_id: Union[Unset, None, str] = UNSET,
my_endpoint: Union[Uns... |
the-stack_106_32350 | #-*-coding: utf-8 -*-
# regular expressions module
import re as reg
def find_int_in_str(string=None):
"""
trouver les nombres entiers dans une chaine de caractere
en ignorant les signes
:param string: str
:reutrn: ['float', 'float', ...]
"""
response = []
if string: # si la ... |
the-stack_106_32351 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2020) Hewlett Packard Enterprise Development LP
#
# 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/l... |
the-stack_106_32354 | from django import forms
from django.forms.models import ModelForm
from django.utils.translation import ugettext_lazy as _
from itdagene.app.workschedule.models import Worker, WorkerInSchedule, WorkSchedule
from itdagene.core.models import Preference
class WorkScheduleForm(ModelForm):
invites = forms.MultipleChoi... |
the-stack_106_32356 | # stolen from https://djangostars.com/blog/how-to-create-and-deploy-a-telegram-bot/
import requests
from bottle import Bottle, response, request as bottle_request
class BotHandlerMixin:
BOT_URL = None
def get_chat_id(self, data):
"""
Method to extract chat id from telegram request.
... |
the-stack_106_32359 | import pandas as pd
import datetime
from sklearn.model_selection import train_test_split
import os, sys
sys.path.insert(0, os.path.abspath(".."))
from src.utils.utils import save_df
def ingest_file(path):
"""Reads data from a csv located at path and returns a dataframe
Parameters:
path (string): P... |
the-stack_106_32361 | import mmcv
import numpy as np
import torch
from mmdet.core import bbox2roi, build_assigner, build_sampler
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
from mmdet.models.dense_heads import (AnchorHead, CornerHead, FCOSHead,
FSAFHead, GuidedAnchorHead, PAAHead,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.