text
string
size
int64
token_count
int64
import os from enum import Enum class AppPackage(Enum): # Add packages here as required. LASTOOLS = "lastools" def getPackageDirectory(package: AppPackage, version: str = None): "Gets the directory where the specified package is installed." varName = f'AZ_BATCH_APP_PACKAGE_{package.value}' if ...
410
130
""" This file should be imported at the bottom of configure.py TODO: All of this may be moved into a single function in the future so people can choose a reactor in configure.py """ from twisted.internet import reactor from twisted.internet.task import LoopingCall from threading import currentThread, Thread...
680
200
import random import time import requests class Account: # C'tor def __init__(self, language, world, user, password, ability): # def standard class variables self.cookie = "" self.language = language self.world = world self.user = user self.password = password ...
7,170
1,969
from django.shortcuts import render from django.views import View # Create your views here. class CoreView(View): template_name = 'core/home.html' def get(self, request, *args, **kwargs): return render(request, self.template_name, {})
251
74
#!/usr/bin/python # -*- coding: utf-8 -*- """hashvis by Peter Hosey Reads from standard input or files, and prints what it reads, along with colorized versions of any hashes or signatures found in each line. The goal here is visual comparability. You should be able to tell whether two hashes are the same at a glance...
12,075
5,813
# https://projecteuler.net/problem=7 import math def sieve(xmax): p = {i for i in range(2, xmax + 1)} for i in range(2, xmax): r = {j * i for j in range(2, int(xmax / i) + 1)} p -= r return sorted(p) print(sum(sieve(2000000)))
270
124
"""Add new types Revision ID: 32053847c4db Revises: 05a62958a9cc Create Date: 2019-06-11 10:36:14.456629 """ from alembic import context from sqlalchemy.orm import sessionmaker # revision identifiers, used by Alembic. revision = '32053847c4db' down_revision = '05a62958a9cc' branch_labels = None depends_on = None a...
3,066
1,095
from advanced_tools.IO_path_utils import * from advanced_tools.algorithm_utils import *
88
25
import os import pickle import functools import errno import shutil from urllib.request import urlopen #import definitions def read_config(schema='data/schema.yaml', name='sets'): filename = '.{}rc'.format(name) paths = [ os.path.join(os.curdir, filename), os.path.expanduser(os.path...
2,836
838
import cv2 import time import numpy as np import imutils camera= 0 cam = cv2.VideoCapture(camera) fgbg = cv2.createBackgroundSubtractorMOG2(history=1000,varThreshold=0,detectShadows=False) width=600 height=480 fps_time = 0 while True: ret_val,image = cam.read() image = cv2.resize(image,(width,height)) imag...
1,984
835
#Given a positive integer num, write a function which returns True if num is a perfect square else False. class Solution(object): def isPerfectSquare(self, num): low=0 high=num #Starting from zero till the number we need to check for perfect square while(low<=high): #Calu...
999
234
from minescrubber_core import abstract from . import mainwindow class UI(abstract.UI): def __init__(self): self.main_window = mainwindow.MainWidget() def init_board(self, board): self.main_window.init_board(board) def refresh(self, board, init_image=True): self.main_window.refr...
1,432
456
from .power_group import PowerGroup
36
10
""" .. module:: elementtype.py :platform: Linux .. moduleauthor:: Michael Schilonka <michael@schilonka.de> """ import logging class ElementType(object): ''' The ElementType class is an in-memory representation of a graph element type. It provides some functions to operate on all entities of the sam...
2,386
674
# coding=utf-8 from OTLMOW.OTLModel.Classes.Put import Put from OTLMOW.OTLModel.Classes.PutRelatie import PutRelatie from OTLMOW.GeometrieArtefact.VlakGeometrie import VlakGeometrie # Generated with OTLClassCreator. To modify: extend, do not edit class Infiltratievoorziening(Put, PutRelatie, VlakGeometrie): """Vo...
672
241
# get the training data D, sample the Generator with random z to produce r N = X_train z = np.random.uniform(-1, 1, (1, z_dim)) r = G.predict_on_batch(z) # define our distance measure S to be L1 S = lambda n, r: np.sum(np.abs(n - r)) # compute the distances between the reference and the samples in N using the...
1,517
622
import os import boto3 # import subprocess from subprocess import Popen, PIPE from time import sleep import json import ast from datetime import datetime, time, timedelta, date import logging import logging.handlers import sys, getopt import glob import shutil logger = logging.getLogger() logger.setLevel(logging.INFO)...
20,923
6,835
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-10-21 # @Author : Emily Wenger (ewenger@uchicago.edu) import time import numpy as np import tensorflow as tf import tensorflow_addons as tfa from keras.utils import Progbar class FawkesMaskGeneration: # if the attack is trying to mimic a target im...
14,328
4,849
from abc import ABCMeta, abstractmethod import database from . import w_l class IncomingClass(metaclass=ABCMeta): @abstractmethod def __init__(self, request): self.request = request self.graph = None self.uri = None self.named_graph_uri = None self.error_messages = None...
1,124
303
from typing import Callable def blocking(func: Callable): setattr(func, "_ow_blocking", True) return func def is_blocking(func: Callable): return getattr(func, "_ow_blocking", False) is True def nonblocking(func: Callable) -> Callable: setattr(func, "_ow_nonblocking", True) return func def i...
418
143
import setuptools setuptools.setup( name= 'ramCOH', version= '0.1', description= '...', author= 'Thomas van Gerve', packages= setuptools.find_packages( exclude= ['examples'] ), # package_dir= {'' : 'petroPy'}, package_data= {'ramCOH': ['static/*']}, install_requi...
404
149
from chess_game._board import make_board from chess_game.chess_game import ChessGame from chess_game.play_game import get_user_input, game_event_loop if __name__ == "__main__": game_board = make_board() # pawn = Pawn('x', 'y', None, None, None) # pawn.move() print('Chess') print(' : Rules') pr...
798
271
""" Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Note: A leaf is a node with no children. Example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its depth =...
576
196
# time 15 mins # used time 15 mins # time 15 mins # used time 15 mins # this is actually a correct solution # the code i submitted a day ago, which passed lintcode, is actually wrong after i looked KMP up # the previous version does not take care of the situations where the target contains repeatitive elements class...
1,589
406
# -*- coding: cp1252 -*- # -*- coding: utf-8 -*- """ Algoritmos y Estructuras de Datos Proyecto Final Antonio Reyes #17273 Esteban Cabrera #17781 Miguel #17102 """ import random import xlrd file_location = "C:/Users/Antonio/Desktop/Recommendation-System-python-neo4J-master/Database.xlsx" workbook = xlrd.ope...
15,633
5,653
from flask import Flask import time from _thread import get_ident app=Flask(__name__) @app.route("/") def hello_world(): time.sleep(20) return "hello world!"+str(get_ident()) @app.route("/index") def hello(): time.sleep(1) return "Hello"+str(get_ident()) if __name__=="__main__": app.run(port=6...
324
124
import unittest import util.strings as strings class TestStrings(unittest.TestCase): def test_first_index_of(self): self.assertEqual(1, strings.first_index_of('1', "0103003004")) self.assertEqual(20, strings.first_index_of('f', "post this text on a form")) def test_last_index_of(self): ...
724
273
# Data sources database( thermoLibraries = ['primaryThermoLibrary'], reactionLibraries = [('C3', False)], seedMechanisms = ['GRI-Mech3.0'], kineticsDepositories = ['training'], kineticsFamilies = 'default', kineticsEstimator = 'rate rules', ) # List of species species( label='ethane', r...
1,395
552
# Copyright (c) 2019-2021 by University of Kassel, Tu Dortmund, RWTH Aachen University and Fraunhofer # Institute for Energy Economics and Energy System Technology (IEE) Kassel and individual # contributors (see AUTHORS file for details). All rights reserved. __version__ = "1.3.0" __author__ = "smeinecke" import os s...
438
147
import assistantResume from speak_module import speak from database import speak_is_on def output(o): # For command line input if speak_is_on(): speak(o) print(assistantResume.name +": "+o+"\n")
215
68
import vk_api from vk_api.utils import get_random_id from vk_bot.core.sql.vksql import * def relationmeet(text, vk, event): check = checkrelation('waitmeet', event.object.from_id) if check == None: check = checkrelation('relation', event.object.from_id) if check == None: userid = ""...
3,545
1,185
"""Wallpaper Downloader Main Module.""" import argparse import asyncio import logging import sys from datetime import datetime from wallpaperdownloader.downloader import download, LOGGER_NAME def abort(*args): """Print message to the stderr and exit the program.""" print(*args, file=sys.stderr) sys.exit...
1,746
553
""" Functions shared across the main window, the welcome window and the system tray. """ import os import qcrash.api as qcrash from PyQt5 import QtWidgets from hackedit.app import templates, settings from hackedit.app.dialogs.dlg_about import DlgAbout from hackedit.app.dialogs.dlg_template_answers import DlgTemplate...
4,512
1,297
""" pygame-menu https://github.com/ppizarror/pygame-menu LOCALS Local constants. License: ------------------------------------------------------------------------------- The MIT License (MIT) Copyright 2017-2021 Pablo Pizarro R. @ppizarror Permission is hereby granted, free of charge, to any person obtaining a copy ...
4,778
1,903
import os import sys from enum import Enum from enum import unique from typing import List # Set system constants based on the current platform if sys.platform.startswith("win32"): DEFAULT_SYSTEM_CONFIG_PATH = os.path.join(os.environ["APPDATA"], "config") elif sys.platform.startswith("linux"): DEFAULT_SYSTEM_C...
3,184
1,085
#- Copyright 2014 GOTO 10. #- Licensed under the Apache License, Version 2.0 (see LICENSE). ## Utilities used for creating build extensions. from abc import ABCMeta, abstractmethod # Abstract superclass of the tool sets loaded implicitly into each context. # There can be many of these, one for each context. class To...
1,076
313
# -*- coding: utf-8 -*- ''' REFERENCES: [1] Y. Bar-Shalom, X. R. Li, and T. Kirubarajan, "Estimation with Applications to Tracking and Navigation," New York: John Wiley and Sons, Inc, 2001. [2] R. A. Singer, "Estimating Optimal Tracking Filter Performance for Manned Maneuvering Targets," in IEEE Transactions on Aerospa...
32,864
12,303
# Generated by Django 3.2.4 on 2021-06-19 08:48 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('orders', '0004_auto_20210619_0847'), ] operations = [ migrations.AlterField( model_name='dinner_platters', name='Top...
848
280
""" Orchestrate experiment execution. """ import typing as tp import attr from benchbuild.experiment import Experiment from benchbuild.project import Project from benchbuild.utils import actions, tasks ExperimentCls = tp.Type[Experiment] Experiments = tp.List[ExperimentCls] ProjectCls = tp.Type[Project] Projects = t...
1,229
394
""" Mask R-CNN Dataset functions and classes. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by Waleed Abdulla """ import numpy as np import tensorflow as tf import keras.backend as KB import keras.layers as KL import keras.initiali...
6,751
2,288
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns def plot_well_map(df_logs, fig_size=(10, 10)): """ Simple map of locations of nearby wells """ f, ax = plt.subplots(figsize=fig_size) df = df_logs.drop_duplicates(subset=['HACKANAME', 'X', 'Y']) plt.scatter...
2,150
847
#!/usr/bin/env python """ cc_plugin_eustace.eustace_global_attrs Compliance Test Suite: Check core global attributes in EUSTACE files """ import os from netCDF4 import Dataset # Import base objects from compliance checker from compliance_checker.base import Result, BaseNCCheck, GenericFile # Restrict which vocabs w...
5,244
1,478
import unittest import translator class TestTranslator(unittest.TestCase): def test_one_e2f(self): respopnse = translator.english_to_french('IBM Translator') self.assertEqual(respopnse, 'Traducteur IBM') def test_un_f2e(self): respopnse = translator.french_to_english('Traducteur IB...
705
261
class Student: # class variables school_name = 'ABC School' # constructor def __init__(self, name, age): # instance variables self.name = name self.age = age s1 = Student("Harry", 12) # access instance variables print('Student:', s1.name, s1.age) # access class variable print...
556
187
# -*- coding: utf-8 -*- from . import base from .audit_log import * from .channel import * from .emoji import * from .gateway import * from .guild import * from .invite import * from .oauth import * from .user import * from .voice import * from .webhook import *
264
88
#!/usr/bin/python # -*- coding: utf-8 -*- import os import datetime import hamster.client import reports import argparse import pdfkit import gettext gettext.install('brainz', '../datas/translations/') # custom settings: reportTitle = "My Activities Report" activityFilter = "unfiled" def valid_date(s): try: ...
1,878
610
from functools import wraps # created by PL # git hello world def single_ton(cls): _instance = {} @wraps(cls) def single(*args, **kwargs): if cls not in _instance: _instance[cls] = cls(*args, **kwargs) return _instance[cls] return single @single_ton class ...
589
231
# Custo da viagem distancia = float(input('Qual a distância da sua viagem? ')) valor1 = distancia * 0.5 valor2 = distancia * 0.45 print('Você está prestes a começar uma viagem de {}Km/h.'.format(distancia)) if distancia <= 200: print('O preço de sua passagem será de R${:.2f}.'.format(valor1)) else: print('O pre...
374
150
"""Difference classes.""" __all__ = [ 'BaseDifference', 'Missing', 'Extra', 'Invalid', 'Deviation', ] from cmath import isnan from datetime import timedelta from ._compatibility.builtins import * from ._compatibility import abc from ._compatibility.contextlib import suppress from ._utils import _...
10,254
2,991
from django.conf.urls import include, url, re_path from rest_framework import routers from . import views urlpatterns = [ re_path(r"^api/dashboard/(?P<slug>[a-zA-Z0-9-_]+)/versiontime", views.get_last_processed_time), re_path(r"^api/dashboard/(?P<slug>[a-zA-Z0-9-_]+)/players", views.get_player_list), re_p...
2,735
1,273
from typing import Any, Dict, List, Sequence import numpy as np import torch from detectron2.engine import DefaultPredictor class SiamPredictor(DefaultPredictor): def __call__( self, original_images: Sequence[np.ndarray], visual_crops: Sequence[np.ndarray], ) -> List[Dict[str, Any]]: ...
1,945
535
from user_agent2.base import ( generate_user_agent, generate_navigator, generate_navigator_js, )
109
37
import glob import random import uuid import numpy as np from multiprocessing import Pool from sklearn.metrics import ( recall_score, precision_score, accuracy_score, f1_score, mean_squared_error) from mutagene.io.profile import read_profile_file, write_profile, read_signatures from mutagene.signatures.identify i...
7,626
2,662
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-02-01 13:47 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
3,542
986
import argparse import os import sys from ckl.values import ( ValueList, ValueString, NULL ) from ckl.errors import ( CklSyntaxError, CklRuntimeError ) from ckl.interpreter import Interpreter def main(): parser = argparse.ArgumentParser(description="CKL run command") parser.add_argument("...
1,807
577
import datetime import fnmatch import hashlib import json import time import arrow import os from botocore.exceptions import ClientError from boto.s3.key import Key from security_monkey.alerters import custom_alerter from security_monkey.common.sts_connect import connect from security_monkey import app, db from securi...
21,190
5,965
# noinspection PyPackageRequirements from telegram import InlineKeyboardMarkup, InlineKeyboardButton class InlineKeyboard: HIDE = None REMOVE = None @staticmethod def static_animated_switch(animated=False): static_button = InlineKeyboardButton( '{} normal'.format('☑️' if animated ...
623
182
import urllib2 import json FAKE_PACKAGES = ( 'south', 'django-debug-toolbar', 'django-extensions', 'django-social-auth', ) class GuitarWebAPI(object): def __init__(self, url): self.url = url def search(self, q): url = self.url + 'search/' + q + '/' res = urllib2.urlop...
596
213
import zipfile from getpass import getpass import os import stat import tempfile from os import path from .crypto import encrypt def compile_ruleset(ruleset_path, ruleset_encryption_password=None, output_path=None): output_path = output_path or os.getcwd() ruleset_encryption_password = ruleset_encryption_pa...
1,005
324
from typing import List # 使用最小花费爬楼梯 class Solution: def minCostClimbingStairs_1(self, cost: List[int]) -> int: dp = [0 for _ in range(len(cost))] dp[0], dp[1] = cost[0], cost[1] for i in range(2, len(cost)): dp[i] = min(dp[i - 1], dp[i - 2]) + cost[i] return min(dp[-...
553
229
""" File: pages/page.py Author: Luke Mason Description: Main part of the application, the actual graph page. """ # Application imports from message import log, error, success from settings import APP_NAME, COLOR, FONT, FONT_SIZE, SCREEN_WIDTH, SCREEN_HEIGHT, WIDTH, HEIGHT, PAD, _QUIT from sprites.vertex import Vertex ...
10,289
4,273
import brownie def test_update(n1, barb, barb2, owner): tx = n1.update_capitalization(1, "coNan", {'from': owner}) assert tx.events["NameUpdated"].values() == (1, "Conan", "coNan") assert n1.summoner_name(1) == "coNan" def test_update_fails(n1, barb, barb2, owner, accounts): with brownie.reverts("!...
521
201
# Filenames : <tahm1d> # Python bytecode : 2.7 # Time decompiled : Thu Sep 10 23:29:38 2020 # Selector <module> in line 4 file <tahm1d> # Timestamp in code: 2020-09-02 17:33:14 import os, sys, time from os import system from time import sleep def htrprint(s): for t in s + '\n': sys.stdout.write(t) ...
603
285
import os import numpy as np import pandas as pd import torch as th from mstarhe.core.nn.models import PrettyFeedForward from MstarHe2R.components.dataloader import Mstar2RDataLoader __IMG_SIZE__ = 128 * 128 class MSTARNet(PrettyFeedForward): data_loader_class = Mstar2RDataLoader # model_graph_class = AN...
4,165
1,437
from abc import ABC, abstractmethod '''Comments In the original solution only functions were used to implement the event system (observer pattern). In this implementation I wanted to write classes (to be as nearest as possible to the pattern (?)). It is surely better to use python first-citizen functions to create t...
996
267
#! /usr/bin/env python import time import os import argparse import json import cv2 import sys sys.path += [os.path.abspath('keras-yolo3-master')] from utils.utils import get_yolo_boxes, makedirs from utils.bbox import draw_boxes from tensorflow.keras.models import load_model from tqdm import tqdm import numpy as np ...
3,056
1,022
import tensorflow.keras.constraints as constraints from tensorflow.keras.layers import GlobalAveragePooling2D from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.layers import Conv2DTranspose from tensorflow.keras.layers import LeakyReLU from tensorflow.keras.layers import ReLU from tensorflow....
11,655
3,348
# coding=utf-8 from operator import xor import os import scrypt import time from libs.rediswrapper import UserHelper try: xrange except NameError: xrange = range class Token(object): """ @param user_id: @type user_id: @param password: @type password: """ __BLOCK_SIZE = 256 _...
3,649
1,164
import json from collections import defaultdict import fastavro import pandas as pd from django.contrib import messages from django.http import HttpResponseRedirect from django.urls import reverse from datasets.models import Connection from users.models import User def get_supported_file_types(): """Return a li...
2,961
888
#! /usr/bin/python def solution(A, B, K): res = 0 rem_A = A % K rem_B = B % K if rem_A == 0 and rem_B == 0: res = (B - A) / K + 1 elif rem_A == 0 and rem_B != 0: low_B = B - rem_B if low_B >= A: res = (low_B - A) / K + 1 else: res = 0 elif...
637
274
import sys import Sofa import Tools def MechanicalObjectVisitor(node): ## listing mechanical states, bottom-up from node ancestors = [] visited = [] for p in node.getParents(): path = p.getPathName() if not path in visited: state = p.getMechanicalState(...
3,766
994
import time import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.manifold import TSNE from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import f1_score import stellargraph as sg from stellargraph.mapper import CorruptedGenerator, HinSAGENodeGenerator from st...
7,216
2,585
from flask import Flask , render_template, request import google_news app = Flask(__name__) outFile = '' @app.route("/") def main(): print "Welcome!" return render_template('index.html') @app.route('/uploadFile', methods=['POST']) def upload(): global outputFile filedata = request.files['upload'] ...
878
263
# Copyright 2020 DeepMind Technologies Limited. # # 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...
1,222
431
# Generated by Django 2.2.3 on 2019-07-12 12:51 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('TeamXapp', '0039_auto_20190712_1348'), ] operations = [ migrations.AddField( model_name='leavec...
1,069
369
""" The given file contains the class to refer to the Site entity """ from quartic_sdk.core.entities.base import Base import quartic_sdk.utilities.constants as Constants class Site(Base): """ The given class refers to the site entity which is created based upon the site response returned by the API ""...
742
203
# Generated by Django 2.0.5 on 2019-05-24 15:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('newapp', '0002_auto_20190524_1507'), ] operations = [ migrations.AlterField( model_name='course', name='additional_i...
525
175
from django.views import View from comment.models import BlockedUser, BlockedUserHistory, Comment from comment.mixins import CanBlockUsersMixin from comment.responses import UTF8JsonResponse, DABResponseData from comment.messages import BlockUserError class BaseToggleBlockingView(DABResponseData): response_class...
2,027
551
def stable_api(x): print("X: {0}".format(x))
49
23
# -*- coding: utf-8 -*- # Copyright (c) 2015 Brad Newbold (wudan07 [at] gmail.com) # See LICENSE for details. # glyph.py # """wIcon library: glyph provides GlyphObject """ ##from handy import * ##from common import * ### represents a character in a glyphString class GlyphObject: def __init__(self, glyph): ### s...
39,550
20,796
import json from paho.mqtt.client import Client from subscriber import Subscriber from datetime import datetime class MqttSender(Subscriber): def __init__(self, client: Client, topic: str): self.client = client self.topic = topic def on_next(self, message: dict): json_message = json...
463
140
# Generated by Django 2.2.17 on 2020-12-28 08:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0003_auto_20201228_1605'), ] operations = [ migrations.CreateModel( name='Count', fields=[ ...
1,914
690
from webium import BasePage, Finds, Find from selenium.webdriver.common.by import By class Homepage(BasePage): catalog_header = Find(by=By.CLASS_NAME, value="Header__BlockCatalogLink") computers_label = Find(by=By.CSS_SELECTOR, value="a[href='/kompyutery/']") laptops_accessories_label = Find(by=By.XPATH, ...
430
162
from __future__ import print_function import argparse import sys import os import shutil import zipfile import urllib parser = argparse.ArgumentParser() ## Required parameters parser.add_argument("--bert_model_name", default = None, type = str, required = Tr...
3,112
1,237
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-21 15:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pdata_app', '0034_auto_20180221_1158'), ] operations = [ migrations.AddField(...
1,386
427
# Copyright (c) 2020 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 appli...
3,226
1,030
#!/usr/bin/env python import logging import sys import CloudFlare import os import re from os import path from certbot.plugins import dns_common __author__ = "Endrigo Antonini" __copyright__ = "Copyright 2020, Endrigo Antonini" __license__ = "Apache License 2.0" __version__ = "1.0" __maintainer__ = "Endrigo Antonini...
5,867
1,901
from datetime import datetime from marshmallow import Schema, EXCLUDE import marshmallow.fields as ms_fields class LocationLatSchema(Schema): user_id = ms_fields.Str(required=True) user_timestamp = ms_fields.DateTime(default=datetime.now()) location_id = ms_fields.Str(default="") latitude = ms_fields...
476
155
# Till now only Python 3.10 can run match statement def check_point(point): match point: case (0, 0): print("Origin") case (0, y): print(f"Y = {y}") case (x, 0) print(f"X = {x}") case (x, y): print(f"X = {x}, Y = {y}") case _: ...
411
149
# python3 # -*- coding: utf-8 -*- # @Author : lina # @Time : 2018/4/22 21:17 """ code function: define all parameters. """ matched_file_name = "../data/gcn_res.txt" wordvec_path = '../data/word2vec.model' incremental_path = "../data/incremental_res.txt"
272
123
from django.shortcuts import render from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse def root(request): """ Newsletter > Root """ return render(request, 'newsletter/newsletter_root.jade')
246
68
# Copyright (c) 2019 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 applic...
16,826
5,108
"""Middle High German phonology tools """ from typing import List from cltk.phonology.gmh.transcription import Transcriber from cltk.phonology.syllabify import Syllabifier __author__ = ["Clément Besnier <clem@clementbesnier.fr>"] class MiddleHighGermanTranscription: """ Middle High German Transcriber ""...
1,580
507
import json from html import unescape from bs4 import BeautifulSoup from baiduspider.core._spider import BaseSpider from baiduspider.errors import ParseError class Parser(BaseSpider): def __init__(self) -> None: super().__init__() def parse_web(self, content: str) -> dict: """解析百度网页搜索的页面源代码...
11,680
3,660
import socket from requests.adapters import HTTPAdapter from requests.compat import urlparse, unquote try: from requests.packages.urllib3.connection import HTTPConnection from requests.packages.urllib3.connectionpool import HTTPConnectionPool except ImportError: from urllib3.connection import HTTPConnectio...
2,142
611
from django.test import TestCase from jarvis.resume.utils.extractor import get_text from jarvis.resume.utils.parser_helper import get_urls, get_url_response, url_categories, get_github_username, get_stackoverflow_userid, get_stackoverflow_username, get_name, get_id_from_linkedin_url, get_email from unidecode import uni...
3,021
1,005
from __future__ import print_function from __future__ import division from sklearn.utils import check_random_state from sklearn import preprocessing as prep from utils.data import load_data, show_data_splits, shape_data from utils.evaluation import evaluate from utils.profiles import select_model, show_design, train,...
8,032
2,346
from django.contrib import admin from django.db import models from easy_select2.widgets import Select2Multiple from news.models import Entry class EntryAdmin(admin.ModelAdmin): list_display = ('title', 'pub_date', 'author') readonly_fields = ('slug',) exclude = ('author',) formfield_overrides = { ...
560
165
import analyzer_client as analyzer from tkinter import * from tkinter import filedialog from tkinter import messagebox from tkinter import ttk import json import os from pathlib import Path IP_ADDRESS = "localhost" PORT = "8061" ENGINE_CURR_OPTIONS = {} ANALYZE_CURR_OPTIONS = {'language':'en', 'ent...
21,999
7,806
# mods 1 import random print(random.randint(1,10))
53
25