text
string
size
int64
token_count
int64
from flask import Flask, request, render_template from functions import read_json import os # Mandatory app = Flask(__name__) # __name__ --> __main__ # ---------- Flask functions ---------- @app.route("/") # @ --> esto representa el decorador de la función def home(): """ Default path """ #return app.sen...
1,671
591
import os from dotenv import dotenv_values from opta.core.kubernetes import get_namespaced_secrets, update_secrets from opta.exceptions import UserErrors from opta.utils import deep_merge, logger MANUAL_SECRET_NAME = "manual-secrets" # nosec LINKED_SECRET_NAME = "secret" # nosec def get_secrets(namespace: str, m...
1,473
476
import numpy as np from matplotlib import _api from .axes_divider import make_axes_locatable, Size from .mpl_axes import Axes @_api.delete_parameter("3.3", "add_all") def make_rgb_axes(ax, pad=0.01, axes_class=None, add_all=True, **kwargs): """ Parameters ---------- pad : float Fraction of th...
5,114
1,771
from flask import Blueprint admin = Blueprint('admin', __name__, url_prefix='/manage')
88
28
from chatterbot import ChatBot from chatterbot.trainers import ListTrainer # The only required parameter for the ChatBot is a name. This can be anything you want. chatbot = ChatBot("My First Chatbot") # Training your ChatBot conversation = [ "Hello", "Hi there!", "How are you doing?", "I'm doing great....
535
177
""" Helper module for evaluation and display of the summary of training sessions. """ import numpy as np import pandas as pd from runpandas._utils import convert_pace_secmeters2minkms def _build_summary_statistics(obj): """ Generate session statistics from a given DataFrame. Parameters -------...
7,405
2,152
# -*- coding: utf-8 -*- from functools import wraps from flask import abort, jsonify from flask_login import current_user def admin_required(f): @wraps(f) def decorated_function(*args, **kwargs): if not current_user.active or not current_user.is_admin: abort(403) return f(*args, *...
589
187
from base.fab import * from plugins.FabFlee.FabFlee import * @task def flee_get_perf(results_dir): print("{}/{}".format(env.local_results,results_dir)) my_file = open("{}/{}/perf.log".format(env.local_results,results_dir), 'r') print(my_file.read())
263
103
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import time import logging import asyncio import hashlib import jwt class Account: def __init__(self, username, password, spin=None, brand): self._username = username self._password = password self._spin = spin self._brand =...
479
136
def open_file(): while True: file_name = input("Enter input file: ") try: measles = open(file_name, "r") break except: print("File unable to open. Invalid name or file doesn't exist!") continue # name it re-prompts for a write name return ...
3,263
932
nome = input('Nome Completo:').title().strip().split() print(f"""Prazer em Conhece-lo Seu Primeiro Nome e: {nome[0]} Seu Ultimo Nome e: {nome[len(nome)-1]}""")
159
67
# Copyright 2015 Huawei Technologies Co.,LTD. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
3,193
891
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import logging, os, sys from pprint import pprint as pp from secret.project import get_project from secret.cli import prepare def trollius_log(level=logging.CRITICAL): os.environ['TROLLIUSDEBUG'] = "1" # more inform...
1,865
619
def get_obj1(): obj = \ { "sha": "d25341478381063d1c76e81b3a52e0592a7c997f", "commit": { "author": { "name": "Stephen Dolan", "email": "mu@netsoc.tcd.ie", "date": "2013-06-22T16:30:59Z" }, "committer": { "name": "Stephen Dolan", ...
3,947
1,740
### #Various nose tests. If you want to adapt this for your own use, be aware that the start/end block list has a very specific formatting. ### import get_freebusy import arrow from operator import itemgetter from pymongo import MongoClient import secrets.admin_secrets import secrets.client_secrets MONGO_CLI...
3,094
1,781
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the SCICO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. r""" Regularized Abel Inversion ========================== This example demonstrates a TV-regularized Abel inversio...
2,664
1,112
from ..util import slice_ def csrot(N, CX, INCX, CY, INCY, C, S): """Applies a Givens rotation to a pair of vectors x and y Parameters ---------- N : int Number of elements in input vector CX : numpy.ndarray A single precision complex array, dimension (1 + (`N` - 1)*abs(`INCX`)) ...
1,760
694
from dice import * class Item(): def __init__(self, weight): self.weight = weight class Weapon(item): def __init__(self, weight, damage_die, reach)
160
55
第一题: import io import sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8') #str = input() #print(str) class Solution(object): def findMedium(l): length = len(l) l.sort() # 如果为奇数,输出中间的值 if length % 2 != 0: print(l[length//2]) # 如果为偶数,中心两位均值 ...
2,476
956
from django.shortcuts import render from .forms import RegistrationForm, UserUpdateForm, ProfileUpdateForm from django.shortcuts import redirect from .models import Profile from django.contrib.auth.decorators import login_required def registration(request): if request.method == 'POST': form = RegistrationForm(reque...
1,091
361
# (C) Copyright Artificial Brain 2021. # # 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 ...
2,685
1,011
import numpy as np import scipy.stats as sp from concept import Concept def info_gain(prev_dist, new_dist): return sp.entropy(prev_dist) - sp.entropy(new_dist) def main(): attributes = range(10) num_concepts = 5 concept_size = 4 concept_space = Concept(attributes, num_concepts, concept_size) problem1 = [(1, 2,...
1,045
495
import aiohttp import discord from discord.ext import commands from discord.commands import Option, slash_command, SlashCommandGroup import json with open ('././config/guilds.json', 'r') as f: data = json.load(f) guilds = data['guilds'] with open ('././config/api.json', 'r') as f: ApiData = json.load(f) githubApi...
1,695
744
import json import time import smbus from paho.mqtt import client as mqtt # BH1750FVI config DEVICE = 0x23 # Default device I2C address POWER_DOWN = 0x00 POWER_ON = 0x01 RESET = 0x07 CONTINUOUS_LOW_RES_MODE = 0x13 CONTINUOUS_HIGH_RES_MODE_1 = 0x10 CONTINUOUS_HIGH_RES_MODE_2 = 0x11 ONE_TIME_HIGH_RES_MODE_1 = 0x20 ON...
1,126
500
# -*- coding: utf-8 -*- """ Class definition of YOLO_v3 style detection model on image and video """ import os import numpy as np import tensorflow as tf from PIL import Image, ImageDraw, ImageFont import cv2 from keras import backend as K from keras.layers import Input, Lambda from keras.models import Model, Sequent...
18,721
6,383
# SPDX-License-Identifier: Apache-2.0 # Licensed to the Ed-Fi Alliance under one or more agreements. # The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. # See the LICENSE and NOTICES files in the project root for more information. from os import path from sys import platform from ed...
3,262
1,090
# update_one() 方法只能修匹配到的第一条记录,如果要修改所有匹配到的记录,可以使用 update_many()。 # 以下实例将查找所有以 F 开头的 name 字段,并将匹配到所有记录的 alexa 字段修改为 123: import pymongo myclient = pymongo.MongoClient("mongodb://localhost:27017/") mydb = myclient["runoobdb"] mycol = mydb["sites"] myquery = {"name": {"$regex": "^F"}} newvalues = {"$set": {"alexa": "12...
425
249
from random import shuffle """ Will search a list of integers for a value using a linear search algorithm. Does not require a sorted list to be passed in. Returns -1 if item is not found Linear Search: Best - O(1) Worst - O(n) Average - O(n) Space Complexity - O(1) """ def search(data: list, value: int) -> int: ...
789
257
""" The MIT License (MIT) Copyright (c) 2017 Roland Jaeger 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...
3,657
1,106
# -*- coding: utf-8 -*- # %reset -f """ @author: Hiromasa Kaneko """ # Demonstration of MAEcce in PLS modeling import matplotlib.figure as figure import matplotlib.pyplot as plt import numpy as np from dcekit.validation import mae_cce from sklearn import datasets from sklearn.cross_decomposition import PL...
3,526
1,535
#!/home/admica/python3/bin/python3 #Discord eve bot by admica import asyncio, discord, time, threading, websocket, json from discord.ext import commands from discord.ext.commands import Bot import aiohttp import re from queue import Queue from datetime import timedelta from datetime import datetime import os, sys impo...
151,828
40,320
# ----------------------------------------------------------------------------- # Copyright (c) Equinor ASA. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ----------------------------------------------------------------------------- """Tests tha...
18,796
4,460
import processing.opengl.PGraphics3D def setup(): size(100, 100, P3D) def draw(): # check that "g" is defined and is the expected type assert(isinstance(g, processing.opengl.PGraphics3D)) # check that the alias cameraMatrix->camera is working as expected g.camera(0, 0, -10, 0, 0, 0, 0, 1, 0) ...
417
166
import faiss import numpy as np import utils.path_fixes as pf from pathlib import Path from data.processing.corpus_embeddings import CorpusEmbeddings from functools import partial import argparse FAISS_LAYER_PATTERN = 'layer_*.faiss' LAYER_TEMPLATE = 'layer_{:02d}.faiss' NLAYERS = 12 NHEADS = 12 def parse_args(): ...
4,811
1,639
import pytest from weasyl import http @pytest.mark.parametrize(('wsgi_env', 'expected'), [ ({}, {}), ({'PATH_INFO': '/search', 'QUERY_STRING': 'q=example'}, {}), ({'HTTP_ACCEPT': '*/*'}, {'Accept': '*/*'}), ( {'CONTENT_LENGTH': '', 'HTTP_ACCEPT_ENCODING': 'gzip', 'HTTP_UPGRADE_INSECURE_REQUES...
504
196
from neural_network.train import Trainer class Classifier(): def __init__(self, train=False): self.train = train self.trainer = Trainer() if not self.train: self.trainer.load() else: self.trainer.train() def classify(self, audio_file_path): #pre...
421
128
# Copyright (c) 2020, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities, fields import cybox.bindings.cybox_common as common_binding class Metadata(entities.Entity): _binding = common_binding _binding_class = common_binding.MetadataType _namesp...
556
181
#All Routes are defined here from flask_cors import CORS, cross_origin from app.main.controller.products import ProductController from flask import request, jsonify import json #Test route without any connections def test(): return "{testroutesuccess:'Test Route Success!'}" api_v2_cors_config = { "origins": [ ...
972
290
import pytest import datetime from fbchat._user import User, ActiveStatus def test_user_from_graphql(): data = { "id": "1234", "name": "Abc Def Ghi", "first_name": "Abc", "last_name": "Ghi", "profile_picture": {"uri": "https://scontent-arn2-1.xx.fbcdn.net/v/..."}, "...
6,850
2,265
from operator import* a = -1 b = 5 print('a= ',a) print('b= ',b) print() print(not_(a)) print(truth(a)) print(is_(a,b)) print(is_not(a,b))
143
74
description = 'system setup' group = 'lowlevel' sysconfig = dict( cache = 'localhost', instrument = 'ErWIN', experiment = 'Exp', datasinks = ['conssink', 'dmnsink'], notifiers = [], ) modules = ['nicos.commands.standard'] devices = dict( ErWIN = device('nicos.devices.instrument.Instrument', ...
1,903
602
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # 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 applicab...
1,771
608
import tensorflow as tf from remps.policy.policy import Policy from remps.utils.utils import get_default_tf_dtype class Gaussian(Policy): """ Used for torcs MultiLayerPerceptron Discrete policy. Parametrized by the input space, the action space and the hidden layer size. Basic policy network with...
4,029
1,130
#!/usr/bin/env python import math, random, subprocess, time sin=math.sin commands=["/usr/bin/setterm","/usr/bin/xset"] fname = "" file = None type = None _test = "" cmd = None class SystemError(BaseException): pass for c in commands: _test = subprocess.getoutput("setterm --blength 256") if not _test: ...
921
349
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2020 CoML # 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 ...
26,558
7,385
import stomasimulator.geom.geom_utils as geom class AttributeCalculator(object): """ Abstraction for calculations performed on XPLT state data """ def __init__(self, prefix, reference_data, dimensionality, lambda_fn=None): self.prefix = '' if prefix is None else prefix self.reference_data = r...
6,907
1,965
# -*- coding: utf-8 -*- from .helpers.vfs import VirtualFileSystem from .views.files import ns class VFS(object): def __init__(self, app=None, mongo=None, **kwargs): self.app = app self.mongo = mongo self.vfs = None if app is not None: self.app = app self.in...
801
267
# -*- coding: utf-8 -*- ''' @author: Angel Navia Vázquez May 2018 ''' # import code # code.interact(local=locals()) import os import pickle # from fordclassifier.classifier.classifier import Classifier import numpy as np import pandas as pd from sklearn.metrics import roc_curve, auc import json i...
51,954
16,414
""" CDN App """
16
10
# %% Import import numpy as np import pandas as pd import requests import os from bs4 import BeautifulSoup """ Takes a dictionary of relevant brands and their URLs and returns a raw csv file """ # %% Functions def outlets_crawl(brand, url): """ Returns a raw, unformatted df of outlets with it's brand from t...
2,722
1,035
import docker, os, platform, requests, shutil, subprocess, sys from .infrastructure import * # Runs a command without displaying its output and returns the exit code def _runSilent(command): result = SubprocessUtils.capture(command, check=False) return result.returncode # Performs setup for Linux hosts def _setupLi...
5,918
1,942
import unittest class TruthTest(unittest.TestCase): def testAssertTrue(self): self.assertTrue(True) def testAssertFalse(self): self.assertFalse(False)
180
58
import sys import time from tia.trad.tools.io.follow import followMonitor import tia.configuration as conf from tia.trad.tools.errf import eReport import ujson as json import matplotlib.pyplot as plt import math import collections import logging from tia.trad.tools.ipc.processLogger import PROCESS_NAME LOGGER_NAME = P...
6,570
2,086
import os import os.path import ConfigParser PROJECT_BASE = ''.join([os.path.dirname(os.path.abspath(__file__)), "/../"]) CONFIG_FILE = ''.join([PROJECT_BASE, 'config.ini']) _UNSET = object() class ConfigurationError(Exception): pass def get(section, option=None, type=None, fallback=_UNSET): config = Conf...
1,975
527
# -*- coding: utf-8; py-indent-offset: 2 -*- from __future__ import division from mmtbx.ions.environment import ChemicalEnvironment import mmtbx.ions.identify from mmtbx import ions import mmtbx.monomer_library.pdb_interpretation from mmtbx import monomer_library from mmtbx.ions.environment import chem_carboxy, chem_...
8,940
3,597
import re from ..utils import Report, fetch SITE = "fileinfo.com" PATH = "/extension" def extract(extension: str) -> list[Report]: soup = fetch(site=SITE, path=PATH, extension=extension) description_short = soup.find_all("h2")[0].text.strip() infoboxes = soup.find_all(attrs={"class": "infoBox"}) de...
600
208
from fastapi import APIRouter from pydantic import BaseModel from style.predict.servable.serve import get_servable router = APIRouter() class PredictionRequest(BaseModel): text: str model_name: str @router.get("/") async def index(): return {"success": True, "message": "Predictions Router is working!...
801
234
from IPython.Shell import IPShellEmbed ipshell = IPShellEmbed() ipshell()
77
28
#!/usr/bin/python3 """ (C) Copyright 2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import time from pool_test_base import PoolTestBase from server_utils import ServerFailed class PoolCreateTests(PoolTestBase): # pylint: disable=too-many-ancestors,too-few-public-methods """Pool cre...
2,623
787
from setuptools import setup, find_packages setup( name='atmfjstc-async-utils', version='0.1.0', author_email='atmfjstc@protonmail.com', package_dir={'': 'src'}, packages=find_packages(where='src'), install_requires=[ ], zip_safe=True, description="Utilities for async code", ...
577
196
import subprocess import sys from collections import defaultdict import pandas as pd import networkx import random import functools import matplotlib import matplotlib.pyplot as plt import matplotlib.animation as animation from .model import Network, Link, Frame, Node import io if sys.platform == 'darwin': matplo...
5,865
1,903
import logging import os import firebase_admin from fastapi import HTTPException, Security, status from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer from fastapi.security.api_key import APIKeyCookie, APIKeyHeader, APIKeyQuery from firebase_admin import auth from cotect_endpoints.utils import id_ut...
3,286
1,040
# Author: Moises Henrique Pereira # this class handle the functions tests of controller of the component of the numerical features import pytest import sys from PyQt5 import QtWidgets from ui.mainTest import StaticObjects @pytest.mark.parametrize('slider', [1, 2.9, False, ('t1', 't2'), None]) def test_CIR_setSli...
7,201
2,257
#!/usr/bin/env python3 import argparse import pathlib GENERATED_EXTENSIONS = ["pb.go", "pb.gw.go", "swagger.json"] def find_files(path, fileglob): files_full = list(path.glob(fileglob)) return files_full def strip_path_extension(filelist): # We cannot use Path.stem directly as it doesn't handle doubl...
2,092
710
"""Define different helper functions.""" import datetime import json import re import sys import urllib.parse from urllib.request import Request, urlopen import icu import markdown from flask import current_app, g, make_response, render_template, request, url_for from flask_babel import gettext from . import static_...
21,848
6,980
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.gis.db.models.fields class JSONField(models.TextField): """Mocks jsonfield 0.92's column-type behaviour""" def db_type(self, connection): if connection.vendor == 'postgresql' ...
5,037
1,431
from . import functions from ..program import ARGS from ..program import ENV from ..program import PROGRAM def reference_branch(remote_branches=None): remote_branches = remote_branches or functions.remote_branches() remote, *rest = ARGS.reference_branch.split('/', maxsplit=1) if rest: if remote n...
1,267
378
from django.apps import AppConfig class CookiesConfig(AppConfig): name = 'cookies'
89
28
#!/usr/bin/env python3 # do not hesitate to debug import pdb # python computation modules and visualization import numpy as np import sympy as sy import scipy as sp import matplotlib.pyplot as plt from sympy import Q as syQ sy.init_printing(use_latex=True,forecolor="White") def Lyapunov_stability_test_linear(ev): ...
7,016
2,209
from django.shortcuts import render from rest_framework import mixins from rest_framework import permissions from rest_framework import viewsets from rest_framework.decorators import action from .models import User from .serializers import UserSerializer # Create your views here. class UserViewSet(mixins.ListModelMi...
1,690
463
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import abc import ast import io import tokenize from pathlib import Path from typing import Iterable, Optional from fixit.common.report impor...
2,197
628
from homeschool.referrals.tests.factories import ReferralFactory from homeschool.test import TestCase class TestReferral(TestCase): def test_factory(self): referral = ReferralFactory() assert referral.referring_user is not None assert referral.created_at is not None assert referra...
356
101
################################################################################ # Python package __init__.py file. # # Author: Carl Cortright # Date: 12/20/2016 # ################################################################################ from slackwebhook import slackwebhook
284
64
#! /usr/bin/env python import sys import pathogenseq as ps ref_file = sys.argv[1] query_file = sys.argv[2] prefix = sys.argv[3] ps.mauve_call_variants(ref_file,query_file,prefix) cmd = "bgzip -f %s.vcf" % prefix ps.run_cmd(cmd)
229
101
__author__ = 'deon'
20
10
from job_scheduler.cache.base import ScheduleCache from job_scheduler.cache.fake import FakeScheduleCache from job_scheduler.cache.redis import RedisScheduleCache all = ["ScheduleCache", "RedisScheduleCache", "FakeScheduleCache"]
231
72
valor = input("Digite algo: ") print("É do tipo", type(valor)) print("Valor numérico:", valor.isnumeric()) print("Valor Alfa:", valor.isalpha()) print("Valor Alfanumérico:", valor.isalnum()) print("Valor ASCII:", valor.isascii()) print("Valor Decimal", valor.isdecimal()) print("Valor Printavel", valor.isprintable())
317
111
from typing import List class Observable: _observers: List = [] def __init__(self): self._observers = [] def subscribe(self, observer): self._observers.append(observer) def notify_observers(self, *args, **kwargs): for obs in self._observers: obs.notify(self, *arg...
447
142
#coding=utf-8 import numpy as np import tensorflow as tf import os import sys import time import shutil import re import signal import subprocess import numpy as np import math from Policy import * np.set_printoptions(threshold=np.inf) BASELINES = 1 class MultiBaseline: def __init__(self, baseline_number): ...
26,579
9,670
## ## /src/data/preprocessors/__init__.py ## ## Created by Paul Warkentin <paul@warkentin.email> on 15/07/2018. ## Updated by Paul Warkentin <paul@warkentin.email> on 15/07/2018. ## from .bbox_preprocessor import BBoxPreprocessor from .default_preprocessor import DefaultPreprocessor from .image_preprocessor import Ima...
335
121
import numpy as np import os,sys,time import torch import torch.nn.functional as torch_F import collections from easydict import EasyDict as edict import util class Pose(): def __call__(self,R=None,t=None): assert(R is not None or t is not None) if R is None: if not isinstance(t,torch...
4,775
2,005
# -*- coding: utf-8 -*- """ 1265. Print Immutable Linked List in Reverse You are given an immutable linked list, print out all values of each node in reverse with the help of the following interface: ImmutableListNode: An interface of immutable linked list, you are given the head of the list. You need to use the foll...
1,550
425
# -*- coding: utf-8 -*- # -------------------------------------- # @Time : 2021/5/12$ 12:12$ # @Author : Qian Li # @Email : 1844857573@qq.com # @File : network.py # Description : details(i.e., online network,online projector network, online predictor,classifier, target network, target projector,) for self-supe...
3,403
1,121
from enum import Enum, unique class Frames(Enum): FRAME_DLE = 0x10 FRAME_STX = 0x02 FRAME_ETX = 0x03 # Local wired panel (black face with service button) FRAME_TYPE_LOCAL_WIRED_KEY_EVENT = b'\x00\x02' # Remote wired panel (white face) FRAME_TYPE_REMOTE_WIRED_KEY_EVENT = b'\x00\x03' # ...
789
399
num1 = input() num2 = input() num3 = input() print(int(num1) + int(num2) + int(num3))
87
40
#!/usr/bin/python import json import socket import sys import getopt import logging from enum import Enum from datetime import datetime import base64 import hmac import hashlib import time import urllib.request import urllib.parse import configparser metadata_url = 'http://169.254.169.254/metadata/scheduledevents?api...
5,525
1,750
import logging, time, os class Config: def __init__(self, data_prefix): # data_prefix = r'../data/' self.data_prefix = data_prefix self._multiwoz_damd_init() def _multiwoz_damd_init(self): self.vocab_path_train = self.data_prefix + '/multi-woz-processed/vocab' self.data...
1,750
612
from __future__ import print_function import time import sys import os import shutil import csv import boto3 from awsglue.utils import getResolvedOptions import pyspark from pyspark.sql import SparkSession from pyspark.ml import Pipeline from pyspark.ml.feature import StringIndexer, VectorIndexer, OneHotEncoder, Vec...
6,438
2,070
from datetime import datetime __author__ = 'aGn' __copyright__ = "Copyright 2018, Planet Earth" class Response(object): """Response Class""" def __init__(self): self.socket = None @staticmethod def publisher( module, meta_data, **kwargs ): """ Pack...
1,350
381
import mimetypes import os from pathlib import Path def ignore_files(dir: str, files: list[str]): """ Returns a list of files to ignore. To be used by shutil.copytree() """ return [f for f in files if Path(dir, f).is_file()] def get_input_images(input_folder: Path, output_path: Path): """ ...
1,399
445
from ..abc import MixinMeta import json import re class FetchData(MixinMeta): """CDT FetchData functions""" ## No cog dependencies## # def __init__(self, bot: Red): # """init""" # self.bot = bot async def aiohttp_http_to_text(ctx, url): """pull text from url, ret...
3,117
949
# Copyright 2020 Jaime Tierney, Adam Luchies, and Brett Byram # 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...
7,175
2,849
from typing import List from PySide2.QtGui import QVector3D from nexus_constructor.common_attrs import SHAPE_GROUP_NAME, CommonAttrs from nexus_constructor.model.component import Component from nexus_constructor.model.geometry import OFFGeometryNoNexus class SlitGeometry: def __init__(self, component: Component...
4,392
1,539
import os import argparse import numpy as np import tensorflow as tf from tensorflow.keras.optimizers import Adam from tensorflow.keras.models import Model from tensorflow.keras.preprocessing.image import load_img, img_to_array import matplotlib.pyplot as plt from visualizations.manual_plot_by_matplotlib import plot_...
5,029
1,917
import telegram from flatten_dict import flatten import os import time import datetime from pik import PIKData from helpers import hash_vals, dump_data, load_data, compare class Credentials(object): def __init__(self, credentials_json): self.__credentials = load_data(credentials_json) self.auth_t...
5,149
1,626
#!/usr/bin/python # @author Mohamed Azzouni , Paris, France # import os import time import ntpath import sys import json import argparse from os.path import join, getsize from shutil import copyfile behaviour = """{ "reporting": true , "updatefiles": true , "excludeDirs" :[".git",".repo"], "shebang": { ...
15,025
4,984
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def print_list(self): temp = self.head linked_list = '' while temp: linked_list += str(temp.data) + " -> " ...
2,132
672
# -*- coding: utf-8 -*- ################################################################################# # Author : Webkul Software Pvt. Ltd. (<https://webkul.com/>) # Copyright(c): 2015-Present Webkul Software Pvt. Ltd. # License URL : https://store.webkul.com/license.html/ # All Rights Reserved. # # # # This pr...
22,048
7,189
import os,subprocess from shlex import quote import pandas as pd from igf_data.utils.singularity_run_wrapper import execute_singuarity_cmd from igf_data.utils.fileutils import check_file_path,get_temp_dir class Picard_tools: ''' A class for running picard tool :param java_exe: Java executable path ...
18,274
5,156
# -*- coding: utf-8 -*- import sys import os import json import http.client import urllib import time sys.path.append("../") from models.ApiInstance import ApiInstance from utils.ConstantUtils import ConstantUtils ''' NetworkingUtils is responsible for holding the external URLs and the default parameters o...
8,348
2,173