text
string
size
int64
token_count
int64
from rest_framework.authtoken.models import Token from rest_framework import serializers from applications.placement_cell.models import (Achievement, Course, Education, Experience, Has, Patent, Project, Publication, Skill, ...
2,327
615
import factory from concat_col_app.models import Color, Apple class ColorFactory(factory.django.DjangoModelFactory): class Meta: model = Color class AppleFactory(factory.django.DjangoModelFactory): class Meta: model = Apple
253
71
from pathlib import Path from typing import Dict from errors.common.exception import DppError class DppArgparseError(DppError): pass class DppArgparseTaxonomyNotFoundError(DppArgparseError): def __init__(self, taxonomy_name: str): super().__init__(f"taxonomy '{taxonomy_name}' does not exist") ...
1,843
557
from .utility import * from .tricks import * from .tensorlog import * from .self_op import * from .resume import * from .optims import * from .metric import *
161
53
""" Copyright (C) 2018-2021 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 law or agreed to i...
1,290
399
import cv2 from PIL import Image import argparse from pathlib import Path from multiprocessing import Process, Pipe,Value,Array import torch from config import get_config from mtcnn import MTCNN from Learner_trans_tf import face_learner from utils import load_facebank, draw_box_name, prepare_facebank, save_label_score,...
15,381
5,093
import time class TryClass: value = 1 valu = 2 val = 3 va = 4 v = 5 def __init__(self, value=4): print("Created TryClass :", self) self.value = value def metod1(self, value, val2=""): self.value += value print(f"\t>>> metod 1, add: {value}, now value : {se...
2,603
964
# -*- coding: utf-8 -*- # Copyright 2017, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """This module implements the abstract base class for backend modules. To create add-on backend modules subclass the Backend...
3,204
767
from typing import List import sys class Solution: def jump(self, nums: List[int]) -> int: if len(nums) <=1: return 0 l , r , jumps = 0, nums[0] , 1 while r < len(nums)-1 : jumps += 1 # you can land anywhere between l & r+1 in a jump and then use Num[i] to jump from ...
487
181
import unittest from . import states class DonationStateTestCase(unittest.TestCase): def test_approve_pending_state(self): approve_pending_statue = states.PendingApprovalState() approved_event = states.DonationApprovedEvent() self.assertIsInstance( approve_pending_statue.appl...
1,881
521
from jinja2 import nodes from jinja2.ext import Extension class FragmentCacheExtension(Extension): # a set of names that trigger the extension. tags = set(['cache']) def __init__(self, environment): super(FragmentCacheExtension, self).__init__(environment) # add the defaults to the envir...
2,137
570
import os def retrieve_molecule_number(pdb, resname): """ IDENTIFICATION OF MOLECULE NUMBER BASED ON THE TER'S """ count = 0 with open(pdb, 'r') as x: lines = x.readlines() for i in lines: if i.split()[0] == 'TER': count += 1 if i.split()[3] == resname: ...
767
257
# api.py # Part of PyBBIO # github.com/alexanderhiam/PyBBIO # MIT License # # Beaglebone platform API file. from bbio.platform.platform import detect_platform PLATFORM = detect_platform() if "3.8" in PLATFORM: from bone_3_8.adc import analog_init, analog_cleanup from bone_3_8.pwm import pwm_init, pwm_cleanup ...
666
267
import re import sys from urllib.parse import quote as _uriquote import requests from . import __version__, errors, utils from .converters import _county_types, _leaderboard_types, _vpn_types, _not_none from . import checks from .cog import request_cog GET='get' POST='post' class HTTPClient: __CSRF_token_regex...
21,947
6,781
import os from argparse import ArgumentParser from pathlib import Path import gym import ray import ray.tune.result as ray_results import yaml from gym.spaces import Tuple from ray.cluster_utils import Cluster from ray.rllib.utils import try_import_tf, try_import_torch from ray.tune import run_experiments, register_en...
10,198
3,013
#!/usr/bin/env python r""" This module contains keyword functions to supplement robot's built in functions and use in test where generic robot keywords don't support. """ import time from robot.libraries.BuiltIn import BuiltIn from robot.libraries import DateTime import re ###########################################...
7,273
2,086
# Copyright (c) OpenMMLab. All rights reserved. from .builder import NODES from .faceswap_nodes import FaceSwapNode from .frame_effect_nodes import (BackgroundNode, BugEyeNode, MoustacheNode, NoticeBoardNode, PoseVisualizerNode, SaiyanNode, SunglassesNod...
826
262
#!/usr/bin/python3 import ibm_db import getopt import sys import os from toposort import toposort_flatten db = None host = "localhost" port = "50000" user = None pwd = None outfile = None targetdb = None try: opts, args = getopt.getopt(sys.argv[1:], "h:d:P:u:p:o:t:") except getopt.GetoptError: sys.exit(-1) f...
4,044
1,525
import numpy as np DEFAULT_FILE_PATH = "utils/datasets/glove.6B.50d.txt" def loadWordVectors(tokens, filepath=DEFAULT_FILE_PATH, dimensions=50): """Read pretrained GloVe vectors""" wordVectors = np.zeros((len(tokens), dimensions)) with open(filepath) as ifs: for line in ifs: line = lin...
732
217
# Copyright 2021 MosaicML. All Rights Reserved. """Performance profiling tools. The profiler gathers performance metrics during a training run that can be used to diagnose bottlenecks and facilitate model development. The metrics gathered include: * Duration of each :class:`.Event` during training * Time taken by t...
2,446
727
''' 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 use this ...
2,753
908
from typing import Optional, Sequence import plotly.graph_objects as go def bar(x: Sequence, y: Sequence, text: Optional[Sequence] = None, width: Optional[int] = None, col: Optional[str] = None, opacity: float = 1, name: Optional[str] = None, show_legend: bool = ...
1,112
312
# Copyright 2018-2021 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or...
4,029
1,288
import pytorch_lightning as pl import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from pytorch_lightning.loggers import TensorBoardLogger from torch.utils.data import DataLoader from torchvision import transforms from torchvision.datasets import CelebA class Encoder(nn.Modu...
5,271
1,911
# Import libraries import sys import pandas as pd from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): """ Load the data from the disaster response csvs Parameters: messages_filepath (str): Path to messages csv categories_filepath (str): Path to categories csv...
2,686
821
#!/usr/bin/env python3 import subprocess import sys import json SERVICES = { 'control': [ 'control', 'nodemgr', 'named', 'dns', ], 'config-database': [ 'nodemgr', 'zookeeper', 'rabbitmq', 'cassandra', ], 'webui': [ 'web', ...
3,658
1,148
from flask import Flask, jsonify, request from flask_cors import CORS, cross_origin import simplejson as json from leaderboard.leaderboard import Leaderboard import uwsgidecorators import signalfx app = Flask(__name__) app.config['CORS_HEADERS'] = 'Content-Type' cors = CORS(app) highscore_lb_starship = Leaderboard('...
2,693
932
import argparse import numpy as np from .._helpers import read, reader_map from ._helpers import _get_version_text def info(argv=None): # Parse command line arguments. parser = _get_info_parser() args = parser.parse_args(argv) # read mesh data mesh = read(args.infile, file_format=args.input_for...
1,591
486
import os, shutil from CCSLink import Spark_Session as SS def add_zipped_dependency(zip_from, zip_target): """ This method creates a zip of the code to be sent to the executors. It essentially zips the Python packages installed by PIP and submits them via addPyFile in the current PySpark context E...
1,324
409
try: from .nbody_graph_search import Ugraph except (SystemError, ValueError): # not installed as a package from nbody_graph_search import Ugraph # This file defines how 3-body angle interactions are generated by moltemplate # by default. It can be overridden by supplying your own custom file. # To fi...
2,484
738
#!/pxrpythonsubst # # Copyright 2016 Pixar # # 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: # ...
8,099
2,201
import sys import os sys.path.append('./code/') from skeleton import Skeleton from read_data import * from calibration import Calibration from ukf_filter import ukf_Filter_Controler from canvas import Canvas from regression import * import time from functools import wraps import os def check_time(function): @wraps...
7,079
2,853
from __future__ import print_function import json import os from django.conf import settings from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from wagtail.wagtailcore.models import Page, Site from v1.models import HomePage, BrowseFilterablePage def run(): print(...
2,683
809
# Simple python3 script to compare output with a reference output. # Usage: python3 compareOutputs.py testOutput.h5 testRefOutput.h5 import sys import h5py import numpy as np if len(sys.argv) != 3: print("Expected two arguments. Output and reference output file.") sys.exit(1) filename = sys.argv[1] ref_filen...
1,456
541
# -*- coding: utf-8 -*- from rest_framework import serializers from .models import Tag class TagSerializer(serializers.ModelSerializer): class Meta: model = Tag read_only_fields = ('topics_count',)
222
68
from amqpstorm.management import ApiConnectionError from amqpstorm.management import ApiError from amqpstorm.management import ManagementApi if __name__ == '__main__': API = ManagementApi('http://127.0.0.1:15672', 'guest', 'guest') try: result = API.aliveness_test('/') if result['status'] == 'o...
571
184
# -*- coding: utf-8 -*- from zvt.contract.api import df_to_db from zvt.contract.recorder import Recorder from zvt.domain.meta.stockhk_meta import Stockhk from zvt.recorders.em import em_api class EMStockhkRecorder(Recorder): provider = "em" data_schema = Stockhk def run(self): df_south = em_api....
1,048
399
from util.io import read_setting_json, read_0h_data, read_24h_data, draw_single_curve from util.convert import split_array_into_samples, calculate_avg_of_sample, convert_to_percentage from util.calculus import calculate_summary_of_sample, fit_sigmoid_curve import matplotlib.pyplot as plt import numpy as np import csv ...
6,362
2,259
# -*- test-case-name: twisted.names.test.test_rootresolve -*- # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Resolver implementation for querying successive authoritative servers to lookup a record, starting from the root nameservers. @author: Jp Calderone todo:: robustify ...
6,492
1,974
# ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================ import os, sys rootpath = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pard...
2,056
749
class BaseSSO: async def get_redirect_url(self): """Returns redirect url for facebook.""" raise NotImplementedError("Provider not implemented") async def verify(self, request): """ Fetches user details using code received in the request. :param request: starlette req...
406
101
from inspect import signature import json import time import os import glob import logging from pathlib import Path from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver from watchdog.events import PatternMatchingEventHandler from EDScoutCore.FileSystemUpdatePrompter...
6,007
1,857
import sqlite3 conn = sqlite3.connect('example.db') c = conn.cursor() import os import hashlib import time def get_file_md5(filePath): h = hashlib.md5() h.update(open(filePath,"rb").read()) return h.hexdigest() def get_file_sha256(filePath): h = hashlib.sha256() h.update(open(filePath,"rb").read()) return h....
1,355
576
""" Migration script to add 'ldda_parent_id' column to the implicitly_converted_dataset_association table. """ from sqlalchemy import * from sqlalchemy.orm import * from migrate import * from migrate.changeset import * import logging log = logging.getLogger( __name__ ) metadata = MetaData() def upgrade(migrate_engi...
1,834
569
import pandas as pd import numpy as np import matplotlib.pyplot as plt import prince from sklearn import utils from sklearn.cluster import DBSCAN import itertools from cmca import CMCA from ccmca import CCMCA from matplotlib import rc plt.style.use('ggplot') df = pd.read_csv("./uk2018.csv") df["prtclcgb"].replace({5: ...
4,083
2,008
""" Problem: Given a list of possibly overlapping intervals, return a new list of intervals where all overlapping intervals have been merged. The input list is not necessarily ordered in any way. For example, given [(1, 3), (5, 8), (4, 10), (20, 25)], you should return [(1, 3), (4, 10), (20, 25)]. """ from typing i...
1,196
442
import time import emoji # Put your commands here COMMAND1 = "testing testing" COMMAND2 = "roger roger" BLUEON = str("blue on") BLUEOFF = str("blue off") REDON = str("red on") REDOFF = str("red off") GREENON = str("green on") GREENOFF = str("green off") YELLOWON = str("yellow on") YELLOWOFF = str("yellow off") CL...
3,163
1,221
# coding=utf-8 """RSES :)"""
29
17
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
89,316
25,873
"""Support for MQTT discovery.""" import asyncio import logging from hatasmota.discovery import ( TasmotaDiscovery, get_device_config as tasmota_get_device_config, get_entities_for_platform as tasmota_get_entities_for_platform, get_entity as tasmota_get_entity, has_entities_with_platform as tasmota...
4,640
1,507
# Copyright 2019 Google LLC. 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 or a...
15,696
4,797
def write(message: str): print("org.allnix", message) def read() -> str: """Returns a string""" return "org.allnix"
130
49
# from folder workMETRLA # MODEL CODE # -*- coding: utf-8 -*- """ Created on Mon Sep 28 10:28:06 2020 @author: wb """ import torch import torch.nn as nn import math # from GCN_models import GCN # from One_hot_encoder import One_hot_encoder import torch.nn.functional as F import numpy as np from sc...
18,474
7,645
# animation for medium article from termcolor import colored import time import imageio import pyautogui pyautogui.FAILSAFE = True matrix = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0...
2,079
1,015
from django.db import models from products.models import Product from utils.models import Utility class Inventory(Utility): inventory_number = models.CharField(unique=True, max_length=100, blank=True, null=True) supplier = models.CharField(max_length=100, blank=True, null=True) user = models.ForeignKey('...
782
250
from django.shortcuts import render from hierarchical_app.models import Folder # Create your views here. def index_view(request): return render(request, 'index.html', {'welcome': "Welcome to Kens Hierarchical Data and You assessment", 'folders': Folder.objects.all()})
276
83
import sys import os import argparse import logging import json import time import subprocess from shutil import copyfile import numpy as np from sklearn import metrics from easydict import EasyDict as edict import torch from torch.utils.data import DataLoader import torch.nn.functional as F from torch.nn import DataP...
19,221
6,169
groupSize = input() groups = list(map(int,input().split(' '))) tmpArray1 = set() tmpArray2 = set() for i in groups: if i in tmpArray1: tmpArray2.discard(i) else: tmpArray1.add(i) tmpArray2.add(i) for i in tmpArray2: print(i)
262
101
import unittest from hf_src.main import soma class TestSoma(unittest.TestCase): def test_retorno_soma_15_30(self): self.assertEqual(soma(15, 30), 45)
164
70
import copy import json from oic.utils.authn.client import CLIENT_AUTHN_METHOD from oic.utils.keyio import KeyJar from oic.utils.keyio import KeyBundle __author__ = 'roland' import logging logger = logging.getLogger(__name__) class OIDCError(Exception): pass def flow2sequence(operations, item): flow = o...
6,867
2,017
import FWCore.ParameterSet.Config as cms hltPFPuppiNoLep = cms.EDProducer("PuppiProducer", DeltaZCut = cms.double(0.1), DeltaZCutForChargedFromPUVtxs = cms.double(0.2), EtaMaxCharged = cms.double(99999.0), EtaMaxPhotons = cms.double(2.5), EtaMinUseDeltaZ = cms.double(-1.0), MinPuppiWeight = cms...
2,696
1,132
# -*- coding: utf-8 -*- ## \package wizbin.build # MIT licensing # See: docs/LICENSE.txt import commands, os, shutil, subprocess, traceback, wx from dbr.functions import FileUnstripped from dbr.language import GT from dbr.log import DebugEnabled from dbr.log import Logger from dbr.md5 import WriteMD5 from ...
29,212
12,296
from YoshiViz import Gui if __name__ == '__main__': #file director gui = Gui.Gui() """ report_generator.\ generate_pdf_report(fileDirectory, repositoryName, tempCommunityType) """ print('the type of', repositoryName, 'is', tempCommunityType, '\n"check .\YoshiViz\output"')
311
102
''' Wrap an __init__ function so that I don't have to assign all the parameters to a self. variable. ''' # https://stackoverflow.com/questions/5048329/python-decorator-for-automatic-binding-init-arguments import inspect from functools import wraps def lazy_init(init): ''' Create an annotation to assign all the p...
623
203
# def register_feed(): import os import cv2 path = '/UserImage' cam = cv2.VideoCapture(0) name=input("Name: ") cv2.namedWindow("test") img_counter = 0 while True: ret, frame = cam.read() if not ret: print("failed to grab frame") break else: cv2.imshow("test", frame) k = c...
781
260
# -*- encoding: utf-8 -*- ''' @Author : lance @Email : wangyl306@163.com ''' import time from model_cx.inceptionresnet import inceptionresnet from model_cx.vgg19two import vgg19_all_lr from model_cx.inceptionv3 import inceptionv3 from model_cx.densenet import densenet from model_cx.nasnet import nas...
2,643
995
"""Coordinate changes in state space models.""" import abc try: # cached_property is only available in Python >=3.8 from functools import cached_property except ImportError: from cached_property import cached_property import numpy as np import scipy.special # for vectorised factorial from probnum impor...
3,275
938
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth.provider import OAuthProvider from allauth.socialaccount import app_settings class LinkedInAccount(ProviderAccount): def get_profile_url(self): return se...
2,345
656
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets from torch.autograd import Variable from sklearn.model_selection import train_test_split import time import pandas as pd import numpy as np import csv batch_size = 128 NUM_EPOC...
4,744
1,989
import json, io, os, os.path from Catalog.Schema import DBSchema, DBSchemaEncoder, DBSchemaDecoder from Query.Plan import PlanBuilder from Storage.StorageEngine import StorageEngine class Database: """ A top-level database engine class. For now, this primarily maintains a simple catalog, ...
4,618
1,344
import numpy as np import mylib def test_arr_add_value(): for _ in range(10): shape = np.random.randint(1, 10, size=np.random.randint(3, 10)).tolist() in_arr = np.random.rand(*shape).astype(np.double) ok = np.allclose(mylib.array_add_value(in_arr, np.pi), in_arr + np.pi) if not ok...
371
139
""" Registry general data files """ from typing import Any from moderngl_window.resources.base import BaseRegistry from moderngl_window.meta import DataDescription class DataFiles(BaseRegistry): """Registry for requested data files""" settings_attr = "DATA_LOADERS" def load(self, meta: DataDescription) ...
619
164
import unittest from routes import Mapper class TestMapperStr(unittest.TestCase): def test_str(self): m = Mapper() m.connect('/{controller}/{action}') m.connect('entries', '/entries', controller='entry', action='index') m.connect('entry', '/entries/{id}', controller='entry',...
658
188
""" python config_slave.py 127.0.0.1 38000 38006 127.0.0.2 18999 18002 will generate 4 slave server configs accordingly. will be used in deployment automation to configure a cluster. usage: python config_slave.py <host1> <port1> <port2> <host2> <port3> ... """ import argparse import collections import json import ...
2,106
720
#1) Write a function, sublist, that takes in a list of numbers as the parameter. In the function, use a while loop to return a sublist of the input list. # The sublist should contain the same values of the original list up until it reaches the number 5 (it should not contain the number 5). def sublist(input_lst): ...
3,227
1,021
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available. Copyright (C) 2017-2021 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 th...
25,605
8,481
import util import libtcodpy as tcod import enemies import operator class Missile (util.Entity): sym = '*' color = tcod.white class BasicMissile (Missile): color = tcod.yellow class IceMissile (Missile): color = tcod.light_blue class AoeMissile (Missile): color = tcod.red class Building (util.Entity): sym ...
5,188
2,343
#!/usr/bin/python3 from PIL import Image from numpy import complex, array from tqdm import tqdm import colorsys W=512 #W=142 def mandelbrot(x, y): def get_colors(i): color = 255 * array(colorsys.hsv_to_rgb(i / 255.0, 1.0, 0.5)) return tuple(color.astype(int)) c, cc = 0, complex(x, y) fo...
795
352
# # -*- coding: utf-8 -*- # # Copyright (c) 2018 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 app...
9,672
3,019
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Jiao Lin # California Institute of Technology # (C) 2006-2010 All Rights Reserved # # {LicenseText} # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
1,940
661
from .base_options import BaseOptions class TestOptions(BaseOptions): """Test Option Class""" def __init__(self): super(TestOptions, self).__init__() self.parser.add_argument('--load_checkpoint_path', required=True, type=str, help='checkpoint path') self.parser.add_argument('--save_re...
602
184
# -*- coding: utf-8 -*- """ Created on Fri Apr 24 18:45:34 2020 @author: kakdemi """ import pandas as pd #importing generators all_generators = pd.read_excel('generators2.xlsx', sheet_name='NEISO generators (dispatch)') #getting all oil generators all_oil = all_generators[all_generators['typ']=='oil'].copy() #gett...
6,325
2,656
# -*- coding: utf-8 -*- """ Created on Tue Nov 16 19:47:41 2021 @author: User """ import tkinter as tk racine = tk . Tk () label = tk . Label ( racine , text ="J ' adore Python !") bouton = tk . Button ( racine , text =" Quitter ", command = racine . destroy ) label . pack () bouton . pack ()
307
129
from fastapi import APIRouter, status, Body, HTTPException from fastapi.encoders import jsonable_encoder from starlette.responses import JSONResponse from app.models.common import * from app.models.clickup import * from app.database.crud.clickup import * router = APIRouter() @router.get("/", response_description="C...
2,579
720
""" N.B imports are within functions to prevent tensorflow being imported before it's warnings are silenced """ import os import logging from imlib.general.logging import suppress_specific_logs tf_suppress_log_messages = [ "multiprocessing can interact badly with TensorFlow" ] def main( signal_array, ba...
2,668
918
# coding=utf-8 import dateutil.parser import flask import json import os import time import urllib import yaml EPISODES = yaml.load(open("episodes.yaml").read()) app = flask.Flask(__name__, static_path="/assets", static_folder="assets") app.jinja_env.filters["strftime"] = \ ...
1,378
452
#!/usr/bin/env python3 from functools import * import operator def factorial(number): assert number >= 1 return reduce(operator.mul, range(1, number+1)) def digits(number): yield from (int(digit) for digit in str(number)) print(sum(digits(factorial(100))))
273
92
import numpy as np from math import cos, sin, pi import cv2 import random from config import config, TransformationParams from data_prep import map_coco_to_personlab class AugmentSelection: def __init__(self, flip=False, degree = 0., crop = (0,0), scale = 1.): self.flip = flip self.degree = degre...
5,449
1,843
# -*- coding: utf-8 -*- """ Created on Wed Dec 25 15:46:32 2019 @author: tadahaya """ from .binom import BT from .connect import Connect from .fet import FET from .gsea import GSEA from .ssgsea import ssGSEA __copyright__ = 'Copyright (C) 2020 MIZUNO Tadahaya' __version__ = '1.0.3' __license__...
412
193
""" Selfium Helper Files ~~~~~~~~~~~~~~~~~~~ All Helper Files used in Selfium project; :copyright: (c) 2021 - Caillou and ZeusHay; :license: MIT, see LICENSE for more details. """ from .getUser import * from .getGuild import * from .params import * from .notify import * from .sendEmbed import * from .isStaff import *
320
114
# Copyright (c) 2021 PaddlePaddle Authors. 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 app...
10,859
3,833
from faust import Record class RssFeed(Record, serializer='json'): feed_source: str title: str link: str published: str = None author: str = None summary: str = None published_parsed: list = None authors: list = None tags: list = None comments: str = None content: list = No...
856
274
#!/usr/bin/python3 #------------------------------------------------------------------------------ # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def levelOrder(self, root): ...
923
242
#!/usr/bin/env python3 from setuptools import setup, find_packages setup( name="", version="0.01", packages=find_packages(), install_requires=[ "fitbit" ], dependency_links=[ ], extras_require={ "tests": [ "flake8", "autopep8", ] } )
320
111
import sys sys.path.append("../") from src.app.sigma import SigmaConverter if __name__ == "__main__": sigmaconverter = SigmaConverter() sigmaconverter.read_from_file() sigmaconverter.write_to_excel()
214
74
# Generated by Django 2.2.14 on 2020-11-08 05:40 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('processes', '0131_auto_20201107_2316'), ] operations = [ migrations.RunSQL( "UPDATE processes_workflow SET run_environ...
449
166
from model.sparsely_lstm_vae import * import torch.utils.data as data_utils from sklearn import preprocessing from utils.eval_methods import * device = get_default_device() # Read data # normal = pd.read_csv("data/SWaT_Dataset_Normal_v1.csv") # , nrows=1000) normal = pd.read_csv("data/SWaT/SWaT_Dataset_Normal_v1.csv...
4,291
1,750
from __future__ import absolute_import, unicode_literals from dcs.celeryconf import app import time from django.core.mail import EmailMessage @app.task(bind=True, ignore_result=False, max_retries=3) def demo_task1(self): result = { 'val1': 1, 'val2': 2, 'val3': 3, } print("hellp") ...
542
191
#!/usr/bin/env python3 import importlib import os # automatically import any Python files in the models/ directory for file in sorted(os.listdir(os.path.dirname(__file__))): if file.endswith(".py") and not file.startswith("_"): model_name = file[: file.find(".py")] importlib.import_module("pytorc...
355
108
# -*- coding: utf-8 -*- __author__ = '带土' SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:mapei123@127.0.0.1:3306/awesome' SECRET_KEY = '\x88D\xf09\x91\x07\x98\x89\x87\x96\xa0A\xc68\xf9\xecJ:U\x17\xc5V\xbe\x8b\xef\xd7\xd8\xd3\xe6\x98*4' # Email 配置 MAIL_SERVER = 'smtp.exmail.qq.com' MAIL_PORT = 465 MAIL_USE_SSL = True...
808
479