text
string
size
int64
token_count
int64
# -*- coding:utf-8 -*- """ 投资参考数据接口 Created on 2017/10/01 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ def get_bond_info(code): pass if __name__ == '__main__': pass
200
111
""" Processes a folder of .txt files to Spacy docs then saves the docs """ # first import standard modules import glob import os from pathlib import Path # then import third-party modules import spacy # finally import my own code (PEP-8 convention) from askdir import whichdir nlp = spacy.load("en_core_web_lg") sour...
883
278
from output.models.nist_data.list_pkg.nmtoken.schema_instance.nistschema_sv_iv_list_nmtoken_max_length_2_xsd.nistschema_sv_iv_list_nmtoken_max_length_2 import NistschemaSvIvListNmtokenMaxLength2 __all__ = [ "NistschemaSvIvListNmtokenMaxLength2", ]
253
104
# -*- coding:utf-8 -*- """ file: src/sample.py Sample Source file ================== Description ----------- Sample description ... Content ------- - say_hello_sikuli Status ------ Test with: tests/sample.py last verification date: xx/xx/xxxx last verifica...
462
159
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class ChaHubAccount(ProviderAccount): pass class ChaHubProvider(OAuth2Provider): """Chahub OAuth authentication backend""" ...
533
162
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import shutil import tempfile from telemetry import decorators from telemetry.testing import options_for_unittests from telemetry.testing import p...
3,046
1,079
from pcradmin import views from django.conf.urls import url, include urlpatterns = [ url(r'^(?P<pagename>\w+)/', views.index), #url(r'^sendmail$', views.sendmail), #url(r'^sentmail$', views.sentmail), url(r'^changelimit$', views.change_team_limits), url(r'^change_team_limit$', views.change_team_limit_list), ...
652
253
a = input('digite algo :') print('O tipo primitivo desswe valor é ', type(a)) print("Só tem espaços? ", a.isspace()) print('É um número? ', a.isnumeric()) print('E alfabetico?', a.isalpha()) print('É alphanumerico?', a.isalnum()) print('Esta em maiúsculas?', a.isupper()) print('Esta em minúsculas?', a.islower()) print...
354
133
""" Examples of authenticating to the API. Usage: login <username> <password> <server> login -h Arguments: username ID to provide for authentication password Password corresponding to specified userid. server API endpoint. Options: -h --help Show this screen. --version Show version. Descrip...
3,966
1,123
# -*- coding: utf-8 -*- ''' 【简介】 界面背景颜色设置 ''' from PyQt5.QtWidgets import QApplication, QLabel ,QWidget, QVBoxLayout , QPushButton, QMainWindow from PyQt5.QtGui import QPalette , QBrush , QPixmap from PyQt5.QtCore import Qt import sys app = QApplication(sys.argv) win = QMainWindow() win.setWindowTitle("...
487
219
import csv class ConstraintError(Exception): def __init__(self, column, value, fn_name, rownumber): self.column = column self.value = value self.fn_name = fn_name self.rown = rownumber def __str__(self): message = "{} value {} does not satisfy the constraint {} on row ...
8,349
2,255
import numpy as np from tensorflow.keras.preprocessing.image import Iterator import time import os import xml.etree.ElementTree as ET import cv2 import pydicom as dicom from os.path import join as opjoin import json from tqdm import tqdm def make_mask(image, image_id, nodules): height, width = image.shape # ...
13,074
4,317
from hexagon.support.hooks import HexagonHooks from hexagon.support.execute.tool import select_and_execute_tool from hexagon.support.update.cli import check_for_cli_updates import sys from hexagon.support.args import fill_args from hexagon.domain import cli, tools, envs from hexagon.support.help import print_help from...
2,058
676
""" Misc utility functions required by several modules in the ligpy program. """ import os import numpy as np from constants import GAS_CONST, MW def set_paths(): """ Set the absolute path to required files on the current machine. Returns ------- reactionlist_path : str ...
18,322
5,007
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import random import tempfile import shutil mayan_debug = 1 BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.dirname(BASE_DIR)) from global_variables import * from caffe_utils import * ''' @brief: ...
7,836
3,026
# -*- coding: utf-8 -*- """ PyVisio visDocuments - Visio Document manipulation library See docstring for class VisDocument for usage """ #TODO docstring __author__ = 'Ivo Velcovsky' __email__ = 'velcovsky@email.cz' __copyright__ = "Copyright (c) 2015" __license__ = "MIT" __status__ = "Development" from...
486
186
#!/usr/bin/env python3 # Pi-Ware main UI from tkinter import * from tkinter.ttk import * import tkinter as tk import os import webbrowser from functools import partial import getpass #Set global var username global username username = getpass.getuser() #Set global install/uninstall scripts global install_script globa...
7,103
2,508
from __future__ import division # This file implements a RenderVolumeVisual class. It is derived from the # VolumeVisual class in vispy.visuals.volume, which is released under a BSD # license included here: # # =========================================================================== # Vispy is licensed under the te...
50,478
16,812
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( n ) : A = [ 0 ] * ( n + 1 ) B = [ 0 ] * ( n + 1 ) A [ 0 ] = 1 A [ 1 ] = 0 B [ 0 ] = 0 B [ 1...
854
377
import os import shutil from textwrap import dedent import argparse import subprocess parser = argparse.ArgumentParser(description='This is a script to create 3D model folder structure') parser.add_argument('-p', '--project', help='3D project name', required=True) parser.add_argument('-wd', '--wd', help='Working direc...
3,342
1,139
# # Copyright (c) 2015 - 2022, Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # ''' Common command line arguments for experiments. ''' def setup_run_args(parser): """Add common arguments for all run scripts: --output-dir --node-count --trial-count --cool-off-time """ add_output_dir(pa...
5,476
1,512
import requests import json import chess import chess.pgn import io from collections import Counter from openpyxl import load_workbook import numpy #API link: https://api.chess.com/pub/player/{user}/games/{year}/{month}/pgn baseUrl='https://api.chess.com/pub/player/' users=['Mazrouai'] ...
10,466
2,145
import csv import numpy as np def loadData(path=r'dolphins.csv',type='data',hasHeaders=False): with open(path,'r') as f: reader=csv.reader(f,delimiter=',') if hasHeaders:headers=next(reader)#If Headers are provided data=list(reader) #print(data[0]) if type=='data': ...
1,464
489
# coding=utf-8 # Copyright, 2021 Ontocord, 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 ...
1,840
620
## Send data to a Graphite/Carbon Server import traceback import sys, time, socket, datetime from datetime import datetime class piSender: carbon_server = '127.0.0.1' carbon_port = 2003 station = "pi2wu" def __init__(self, config): if config.has_option('graphite','server'): se...
1,432
439
def nunjucks(name, outs, template, json, data, mode): # this genrule moves the generated html file to the correct location # nunjucks-cli does not allow specifying a single output file # nunjucks-cli converts the .njk to a .html by default native.genrule( name = name, srcs = data, ...
650
205
from b_bot import BBot from rand_str import * class BJira(BBot): def __init__(self): BBot.__init__(self) self.responses = RandomString( [ "Looks like you were talking about ticket" , "You might find that ticket at" , "Try" ]) def action(...
479
155
"""Samples negative pairs from run.""" import argparse from utils import load_qrels, load_run import numpy as np def main(): parser = argparse.ArgumentParser() parser.add_argument('-run') parser.add_argument('-qrel') parser.add_argument('-p', type=int) parser.add_argument('-n', type=int) ...
2,295
756
import torch import torch.nn as nn import torch.nn.functional as F #Unicamente como esta ahorita funciona para un grafo de 5x5. class NNGrid(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(in_channels = 3, out_channels= 5, kernel_size= 3, padding= 1) self.conv2 =...
1,123
480
''' Module containing the in-game mayhem instances such as the ship, planets, asteroid objects etc etc... Written by Naphat Amundsen ''' import numpy as np import pygame as pg import configparser import sys import os sys.path.insert(0,'..') from classes import spaceship from classes import planet fro...
3,436
1,547
import sys import os simp_path = 'TCGAIntegrator' abs_path = os.path.abspath(simp_path) sys.path.append(abs_path) from TCGAIntegrator import TCGAData as TCGAData def main(): df = TCGAData.loadData("LGG",mode="Hybird") print(df.shape) if __name__ == '__main__': main()
286
116
from synergy.db.model.queue_context_entry import queue_context_entry from synergy.scheduler.scheduler_constants import PROCESS_GC, TOKEN_GC, PROCESS_MX, TOKEN_WERKZEUG, EXCHANGE_UTILS, \ PROCESS_SCHEDULER, TOKEN_SCHEDULER, QUEUE_UOW_STATUS, QUEUE_JOB_STATUS, PROCESS_LAUNCH_PY, TOKEN_LAUNCH_PY, \ ROUTING_IRRELEV...
1,649
636
""" Fyle V3 APIs Base Class """ from .expenses import Expenses from .reports import Reports from .employees import Employees from .orgs import Orgs from .reimbursements import Reimbursements from .cost_centes import CostCenters from .categories import Categories from .projects import Projects from .refunds import Refun...
1,890
508
from datetime import date as d #---------------------------HOTEL---------------------------# def exit_function(): print("Do zobaczenia!") exit() def forumarz_rezerwacji(var1, var2, var3, var4, var5, var6, var7, var8, ile_dni, ile_osob, sniadanie, imie): print("\n"*3) print("==================...
6,164
2,260
import sys import maya.standalone maya.standalone.initialize(name='python') from maya import cmds # try: def run(): # get scene file file_path = sys.argv[1] # Open Scene cmds.file(file_path, open=True) #-------------- Script -------------- cmds.polyCube( d=10, h=10 , w=10) cmds.polyCube( d=10, h=10 , w=10) ...
598
272
from GreedyGRASP.Solver import Solver from GreedyGRASP.Solution import Solution from GreedyGRASP.LocalSearch import LocalSearch # Inherits from a parent abstract solver. class Solver_Greedy(Solver): def greedyFunctionCost(self, solution, remainCap, busesAssignments): for busAssi in busesAssignments: ...
3,733
1,060
import inspect import math as _math from copy import deepcopy import matplotlib.pyplot as _plt import numpy as np import pandas as pd import statsmodels.api as _sm from statslib._lib.gcalib import CalibType class GeneralModel: def __init__(self, gc, DM): self.gc = deepcopy(gc) self.DM = deepcopy...
5,654
2,033
List1 = [1, 2, 3, 4] List2 = ['I', 'tripped', 'over', 'and', 'hit', 'the', 'floor'] print(List1 + List2) List3 = List1 + List2 print(List3) fibs = (0, 1, 2, 3) print(fibs[3])
174
92
import os from flask import Flask, render_template, request, jsonify from display.predict import predict_file app = Flask(__name__, static_folder="./display/static", template_folder="./display/templates") @app.route('/') def en(): return render_template('index_EN.html') @app.route('/chs') def chs(): return...
1,581
442
import unittest from ortools.linear_solver import pywraplp class TestLinprogCurvefit(unittest.TestCase): def setUp(self): linprog_curvefit = __import__('linprog_curvefit') self.generate_variables = linprog_curvefit._generate_variables self.ErrorDefinition = linprog_curvefit.ErrorDefinition...
886
308
# Uno PWM bipolar curve tracer app by simple-circuit 12-22-19 # rev 3 1-13-20 from tkinter import * from tkinter import ttk from tkinter import filedialog from tkinter import font import numpy as np import serial root = Tk() default_font = font.nametofont("TkDefaultFont") default_font.configure(size=9) canvas = Canva...
14,278
6,594
import time import smbus from Adafruit_I2C import Adafruit_I2C # =========================================================================== # TMP102 Class # =========================================================================== class TMP102: #i2c = None # Constructor def __init__(self, address=0x48, deb...
665
236
from flask import Flask app = Flask(__name__) @app.route("/") def get_news(): return 'No news is good news' if __name__ == '__main__': app.run(port=5000, debug=True)
178
71
# -*- coding: utf-8 -*- # Copyright (c) 2015, Indictrans and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import json import string from frappe.model.document import Document from frappe.utils import cstr, flt, getdate, comma_and, cint from frappe...
854
293
import logging from typing import Text, List from src.utils.io import read_json from src.utils.fuzzy import is_relevant_string from src.utils.common import is_float from src.utils.constants import ( MEDICAL_TEST_PATH, QUANTITATIVE_PATH, POSITIVE_TEXT, TestResult ) logger = logging.getLogger(__name__)...
2,565
696
import requests import sys from time import sleep from tabulate import tabulate def get_scams(api_key): scams = [] headers = {"x-api-key": api_key} r = requests.get('https://tarkov-market.com/api/v1/items/all', headers=headers) for i in r.json(): r2 = requests.get('https://tarkov-market.com/ap...
1,064
371
# Real-time Hair Segmentation and Recoloring on Mobile GPUs (https://arxiv.org/abs/1907.06740) # TODO
101
42
import logging from .forms import PostSearchForm from .models import Blog class BlogContextMixin(object): logger = logging.getLogger(__name__) def dispatch(self, *args, **kwargs): self.blog = Blog.objects.get(slug=self.kwargs['blog']) self.block_size = self.blog.block_size self.chun...
996
310
from opencmiss.utils.maths.algorithms import calculate_line_plane_intersection class ImagePlaneModel(object): def __init__(self, master_model): self._master_model = master_model self._region = None self._frames_per_second = -1 self._images_file_name_listing = [] self._imag...
677
198
# -*- coding: utf-8 -*- """ SHARED - DATA VALIDATION """ # %% FILE IMPORT
76
38
# Copyright (c) 2018, Arm Limited and affiliates. # SPDX-License-Identifier: Apache-2.0 # # 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 # # ...
2,152
665
# Copyright 2016 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 or ag...
3,359
953
# directed graph problem or breadth first search variant from collections import defaultdict import re input_file = open("input.txt", "r") input_lines = input_file.readlines() letter_value = { 'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9, 'J': 10, ...
3,844
1,279
from __future__ import print_function from .. import PyPI, DjangoPyPI, PackageNotFound from prettytable import PrettyTable from pkg_resources import parse_version, resource_filename import requests import re try: from urlparse import unquote except ImportError: # Python 3 from urllib.parse import unquote ...
2,862
876
import numpy as np from scipy.interpolate import InterpolatedUnivariateSpline from scipy.fftpack import fft from combined_functions import check_ft_grid from scipy.constants import pi, c, hbar from numpy.fft import fftshift from scipy.io import loadmat from time import time import sys import matplotlib.pyplot as plt fr...
6,954
2,730
# The test suite runs in <20 seconds so is worth running here to # make sure there are no issues with the C/Cython extensions import astropy_healpix astropy_healpix.test()
172
53
""" Way2sms """ from way2sms.app import Sms
45
24
import time from graphql_client import GraphQLClient # some sample GraphQL server which supports websocket transport and subscription client = GraphQLClient('ws://localhost:9001') # Simple Query Example # query example with GraphQL variables query = """ query getUser($userId: Int!) { users (id: $userId) { id ...
1,164
340
# coding:utf-8 import os import sys def Scopus2HistCite(): try: wrt_lines = [] if len(sys.argv) >= 2 and os.path.isfile(sys.argv[1]): print("You are going to convert {}".format(sys.argv[1])) Scopus_file = sys.argv[1] elif os.path.isfile("./Scopus.ris"): ...
2,465
754
""" Mel-scale definition. """ import torch from torch import Tensor from typing import Union import numpy as np from math import log import librosa from librosa.filters import mel as mel_fn def hz_to_mel( frequencies: Union[float, int, Tensor, np.ndarray], htk=False) -> Union[float, int, Tensor, np.ndarra...
2,449
987
from django.urls import path from order import views urlpatterns = [ # 订单提交接口 path('ticket/submit/', views.TicketOrderSubmitView.as_view(), name='ticket_submit'), # 订单详情(支付、取消、删除) path('order/detail/<int:sn>/', views.OrderDetail.as_view(), name='order_detail'), # 订单列表 path('order/lis...
379
161
from django.db import models class Todo(models.Model): title = models.CharField(max_length=100) details = models.TextField() date = models.DateTimeField(auto_now_add=True) group = models.TextField(default='home') user_id = models.IntegerField() objects = models.Manager() def __str__(self...
349
107
""" unminify ======== """ def unminify(soup, encoding='utf-8'): """ """ return soup.prettify().encode(encoding)
127
49
import hashlib class data: def __init__(self,username,password): self.username=username self.hash=self.get_hash(password) def get_hash(self,password): for _ in range(0,9999999): head=(str(_)+self.username+password).encode() i=hashlib.sha3_256(head).hexdigest() ...
744
238
from typing import Tuple from rdkit import Chem from rdkit.Chem import Draw import re import itertools import numpy as np import networkx as nx import logging import collections def FindBreakingBonds(cnids: list, bids: list, bts: list, atomic_nums: list) -> list: """Returns bond ids to be broken. Check for double...
17,709
6,437
# ============================================================================= # # -*- coding: utf-8 -*- # """ # Created on Sun Aug 5 08:07:19 2018 # # @author: lenovo # """ # 25. Reverse Nodes in k-Group # Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. # # k is a ...
3,317
914
from django.conf import settings from django.core import mail from django.core.urlresolvers import reverse from perma.urls import urlpatterns from .utils import PermaTestCase class CommonViewsTestCase(PermaTestCase): def test_public_views(self): # test static template views for urlpattern in url...
2,708
780
import FWCore.ParameterSet.Config as cms #Note: distances in mm instead of in cm usually used in CMS generator = cms.EDFilter("Pythia8PtAndLxyGun", maxEventsToPrint = cms.untracked.int32(1), pythiaPylistVerbosity = cms.untracked.int32(1), pythiaHepMCVerbosity = cms.untracked.bool(True), PGunParameter...
1,708
661
import logging from typing import List, Optional from django.conf import settings from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from django.db import models VOTE_UP = 1 VOTE_DOWN = -1 VOTE_CHOICES = ((VOTE_UP, "Vote Up"), (VOTE_DOWN, "Vote Down")) User = get_...
5,492
1,725
from datetime import datetime from fastapi import APIRouter, Request from ..classes.jwt_authenticator import JWTAuthenticator from ..repositories import bookmark_repository from ..schemas.bookmark_schema import RequestSchema, ResponseSchema router = APIRouter( prefix='/bookmarks', tags=['bookmarks'], ) # Inde...
1,430
429
import os, urllib, datetime, time, sys import getpass from franz.openrdf.sail.allegrographserver import AllegroGraphServer from franz.openrdf.repository.repository import Repository from franz.miniclient import repository from franz.openrdf.query.query import QueryLanguage from franz.openrdf.model import URI from fran...
2,044
730
import pandas as pd def load_and_process(path): df1 = pd.read_csv(path) df2 = ( df1.drop(columns=['songName', 'ogLyric', 'kbLyric']) .rename(columns={'badword':'badWord'}) .sort_values("ogArtist", ascending = True) .sort_values("year", ascending = True) ) ...
1,635
609
import pprint import time import chess.pgn import IPython.display as display import ipywidgets as widgets def who(player): return 'White' if player == chess.WHITE else 'Black' def get_last_move_san_from_board(board): if len(board.move_stack) == 0: return chess.Move.null() else: last_mov...
4,887
1,488
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc import version_pb2 as version__pb2 class serviceStub(object): """This service defines a RPC call to request the Falco version. """ def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. ...
1,401
434
import sys import json import requests import subprocess from datetime import datetime #dict storing data collection={} def execute_commandRealtime(cmd): """Execute shell command and print stdout in realtime. Function taken from pyrpipe Singh et.al. 2020 usage: for output in execute_commandRealtime(['...
2,904
924
import tornado.web from core.logger_helper import logger from core.server.wxauthorize import WxConfig from core.server.wxauthorize import WxAuthorServer from core.cache.tokencache import TokenCache class WxHandler(tornado.web.RequestHandler): """ 微信handler处理类 """ '''微信配置文件''' wx_config = WxConfig...
1,336
488
#!/usr/bin/python # # Write in Python3.6 # Filename: # # Mapping_JsonToCsvExtractor.py # # # Basic Usage: # # python Mapping_JsonToCsvExtractor.py /directory/containing/datastream/mapping/json/files # # Utilities import sys import os import json import argparse def writeCsvHeader(delimiter, csv_file, *args):...
2,771
859
import sys from flask import Flask, redirect, request, session, url_for from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager, current_user from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from flask_wtf.csrf import CsrfProtect from .sessions import Shut...
2,692
868
from utils import initialize from pandas import DataFrame from genetic import GA import numpy as np import argparse import random import time import sys sys.setrecursionlimit(2000) random.seed(time.time()) parser = argparse.ArgumentParser() parser.add_argument('--mr', help='Mutation Rate') parser.add_argu...
4,088
1,926
#Creado por Jhon Edison Castro Sánchez #Diccionario tomado de https://github.com/danielmiessler/SecLists/blob/bb915befb208fd900592bb5a25d0c5e4f869f8ea/Passwords/Leaked-Databases/rockyou.txt.tar.gz #Se usa para generar el mismo comportamiento de openssl de linux #https://docs.python.org/2/library/crypt.html import cryp...
1,774
572
from nltk.book import * def letterFrequ(text): freq_dist = FreqDist() for word in text: for char in word: freq_dist.inc(char) return freq_dist print letterFrequ(text1) print letterFrequ(text5)
227
86
import connectBD as connectDB from pprint import pprint def findSort(): mydb = connectDB.connect() mycol = mydb.usuario print("\n===========================") print("==== TODOS OS USUARIOS ====") print("===========================\n") mydoc = mycol.find().sort("nome") for x in mydoc: ...
1,668
565
from utils import hrsize from time import time_ns class Sample: cpu : float memory: int round: int = 5 def __init__(self, cpu: int, mem: int) -> None: self.cpu = cpu self.memory = mem self.timestamp = time_ns() def __str__(self) -> str: return f"CPU: {round(self.c...
374
135
''' PDF to Image Converter Author: Fraser Love, me@fraser.love Created: 2020-06-13 Latest Release: v1.0.1, 2020-06-21 Python: v3.6.9 Dependancies: pdf2image Converts multiple pdf's to images (JPEG format) and stores them in a logical folder structure under the desired image directory. Usage: Update the pdf_dir and img...
1,220
415
from fvttmv.exceptions import FvttmvException from fvttmv.reference_tools import ReferenceTools from fvttmv.search.__references_searcher_string import ReferencesSearcherString from test.common import TestCase class ReferencesSearcherStringTest(TestCase): json_base_str = "\"img\":\"{0}\"" html_base_str = "<img...
4,217
1,139
# -*- coding: utf-8 -*- """ Created on Wed Aug 19 19:50:43 2020 @author: beck """ import cv2 import datetime import dateparser import os import sys import pandas as pd import pytz from hachoir.parser import createParser from hachoir.metadata import extractMetadata from PIL import Image import numpy as...
4,999
1,809
#! /home/seanchen/anaconda3/bin/python from __future__ import absolute_import from __future__ import division from __future__ import print_function #import sys import rospy from std_msgs.msg import String import torch import torch.nn.parallel import torch.nn.functional as F import numpy as np import cv2 from LPN impor...
4,237
1,609
import tensorflow as tf from sound_lstm_test import data batch_size = 10 x = tf.placeholder(tf.float32, [batch_size, 512, 80]) y_ = tf.placeholder(tf.float32, [batch_size, 59]) w_conv1 = tf.Variable(tf.truncated_normal([16, 2, 1, 64], stddev=0.1), name='conv1_w') b_conv1 = tf.Variable(tf.constant(0.1, shape=[64]), n...
3,696
1,669
'''' You're given 2 huge integers represented by linked lists. Each linked list element is a number from 0 to 9999 that represents a number with exactly 4 digits. The represented number might have leading zeros. Your task is to add up these huge integers and return the result in the same format. Example For a = [9876...
2,213
827
""" @file @brief Functions to handle data coming from :epkg:`Cancer Imaging Archive`. """ import os import pydicom import pandas import cv2 from pyquickhelper.filehelper.synchelper import explore_folder_iterfile # pylint: disable=C0411 def _recurse_fill(obs, dataset, parent=""): for data_element in dataset: ...
3,123
1,015
import re import collections import shutil from tensorflow.python.platform import gfile num_movie_scripts = 10 vocabulary_size = 10000 fraction_dev = 50 path_for_x_train = 'X_train.txt' path_for_y_train = 'y_train.txt' path_for_x_dev = 'X_dev.txt' path_for_y_dev = 'y_dev.txt' _PAD = b"_PAD" _GO = b"_GO" _EOS = b"_EO...
8,743
3,038
from rest_framework import serializers from dfirtrack_main.models import System, Systemtype class SystemtypeSerializer(serializers.ModelSerializer): """ create serializer for systemtype (needed because of foreignkey relationsship) """ class Meta: model = Systemtype # attributes made available...
851
208
from exasol_advanced_analytics_framework.interface.create_event_handler_udf \ import CreateEventHandlerUDF udf = CreateEventHandlerUDF(exa) def run(ctx): return udf.run(ctx)
185
66
# -*- coding: utf-8 -*- """ Created on Tue Mar 24 15:25:14 2020 @author: Nicola VIGANÒ, Computational Imaging group, CWI, The Netherlands, and ESRF - The European Synchrotron, Grenoble, France """ import numpy as np from . import operators from . import solvers def get_circular_mask(vol_shape, radius_offset=0, coo...
7,489
2,657
from .b_cap_client import BCapClient from .b_cap_exception import BCapException
80
25
''' @author: l4zyc0d3r People who are happy makes other happy. I am gonna finish it slowly but definitely.cdt ''' class Solution: def largestRectangleArea(self, H: List[int]) -> int: st, mx, i = [], 0, 0 while i<len(H): if len(st)==0 or H[st[-1]]<=H[i]: st.append(i) ...
675
244
from cal_setup import get_calendar_service def main(): # Delete the event service = get_calendar_service() try: service.events().delete( calendarId='primary', eventId='njdev79d574rdmkv0180t7t7lo', ).execute() except googleapiclient.errors.HttpError: print("Failed ...
402
129
# coding=utf-8 """Client blueprint"""
37
15
from __future__ import annotations import json import asyncio import itertools import typing as t from collections import defaultdict from contextlib import asynccontextmanager from aiohttp import ClientSession from aiohttp.client import ClientWebSocketResponse from aiohttp.http_websocket import WSMsgType, WSCloseCode ...
15,351
4,256
# -*- coding:utf-8 -*- # Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms # and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE...
7,680
2,176