added
stringdate
2024-11-18 17:59:49
2024-11-19 03:44:43
created
int64
0
2,086B
id
stringlengths
40
40
int_score
int64
2
5
metadata
dict
score
float64
2.31
5.5
source
stringclasses
1 value
text
stringlengths
258
23.4k
num_lines
int64
16
649
avg_line_length
float64
15
61
max_line_length
int64
31
179
ast_depth
int64
8
40
length
int64
101
3.8k
lang
stringclasses
1 value
sast_codeql_findings
stringlengths
2
265k
sast_codeql_findings_count
int64
0
45
sast_codeql_success
bool
1 class
sast_codeql_error
stringclasses
1 value
2024-11-18T20:59:39.844810+00:00
1,625,282,800,000
89ebee1cff643237caa06db58c2e361ba4ee4022
3
{ "blob_id": "89ebee1cff643237caa06db58c2e361ba4ee4022", "branch_name": "refs/heads/main", "committer_date": 1625282800000, "content_id": "613a191cf77f9186626e54ff5f8e280751d66fa2", "detected_licenses": [ "MIT", "Python-2.0" ], "directory_id": "4d6d00c7ee7f0f4f5085d4af00fdaeee1e4efeb2", "extensi...
2.578125
stackv2
# web_app/routes/movie_routes.py from flask import Blueprint, request, render_template, redirect, jsonify, flash from app.movie_reco_web import new_movie from app.movie_reco_web import new_movie movie_routes = Blueprint("movie_routes", __name__) @movie_routes.route("/movie/form") def movie_form(): print("MOVI...
37
33.38
122
13
297
python
[]
0
true
2024-11-18T20:59:39.897223+00:00
1,534,507,667,000
353b1cf15fa537366e9c1f390a2c62f1fcf2c4dd
3
{ "blob_id": "353b1cf15fa537366e9c1f390a2c62f1fcf2c4dd", "branch_name": "refs/heads/master", "committer_date": 1534507667000, "content_id": "9329315889037689e0da0c59dc0b0600b7cb1479", "detected_licenses": [ "MIT" ], "directory_id": "41a4768b6373d9775e9a9497941602a09f3397ac", "extension": "py", "fi...
2.546875
stackv2
import torch import torch.nn as nn import torch.nn.functional as F import math from torchlite.torch.models import Flatten class Generator(nn.Module): def __init__(self, scale_factor, res_blocks_count=4): upsample_block_num = int(math.log(scale_factor, 2)) super(Generator, self).__init__() ...
206
27.73
97
15
1,657
python
[]
0
true
2024-11-18T20:59:40.190357+00:00
1,658,182,382,000
31189e30b4ab752d8a3377b191929f751af08567
3
{ "blob_id": "31189e30b4ab752d8a3377b191929f751af08567", "branch_name": "refs/heads/master", "committer_date": 1658182382000, "content_id": "2ca5ee6dce09fbfd7ac993be4b31357f743c7d46", "detected_licenses": [ "MIT" ], "directory_id": "84922a6f22f75185df8acb2b54e757063a46666c", "extension": "py", "fi...
2.859375
stackv2
""" Convert SNP information to gene, rsid, or other useful annotations """ import struct import typing as ty import lmdb import msgpack from . import assets, exceptions class SnpToRsid: """Convert SNP coordinates to RSID information""" def __init__(self, path_or_build: str, *, num_chroms: int = 25, test=Fal...
74
37.93
113
17
675
python
[]
0
true
2024-11-18T20:59:40.512706+00:00
1,551,110,770,000
38b74b918d6cb492d6443d38cb9d81843e777fc0
3
{ "blob_id": "38b74b918d6cb492d6443d38cb9d81843e777fc0", "branch_name": "refs/heads/master", "committer_date": 1551110770000, "content_id": "3dd18bfa982352bf100959a2ab3ac45475e1acc7", "detected_licenses": [ "Unlicense" ], "directory_id": "0ece56ea9df32ec03c0d5bfdb8abf95958939095", "extension": "py",...
2.84375
stackv2
# -*- coding: utf-8 -*- """ Created on Mon Mar 12 10:47:40 2018 @author: arlan """ import numpy as np from taqm import taqm from scipy.stats import linregress from beinf import beinf import matplotlib.pyplot as plt import os # Change directory to where the data is stored and load data os.chdir('Data') X = np.load('M...
77
28.79
101
10
777
python
[]
0
true
2024-11-18T20:59:40.563713+00:00
1,273,530,098,000
90be8fcf7d5cf629c99c3160dfc2e4712e231abc
2
{ "blob_id": "90be8fcf7d5cf629c99c3160dfc2e4712e231abc", "branch_name": "refs/heads/master", "committer_date": 1273530098000, "content_id": "a3c20ceeda975f8e6c4c299ac1da8c2c86f4993c", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "8a591ba502b67d960a04a72872a1a8b6a9dc66ad", "extension": "p...
2.453125
stackv2
import mimeparse def determine_format(request, serializer, default_format='application/json'): # First, check if they forced the format. if request.GET.get('format'): if request.GET['format'] in serializer.formats: return serializer.get_mime_for_format(request.GET['format']) # If call...
29
32.31
101
13
210
python
[]
0
true
2024-11-18T20:59:40.624776+00:00
1,635,234,531,000
10229c050f9741186b63eb798af08789fc9a1829
3
{ "blob_id": "10229c050f9741186b63eb798af08789fc9a1829", "branch_name": "refs/heads/main", "committer_date": 1635234531000, "content_id": "eb054e5c54dc013ed4185f42276be329c603bbcf", "detected_licenses": [ "MIT" ], "directory_id": "6ebe332acd4a714f80e511f8a6765d989b3d9395", "extension": "py", "file...
2.75
stackv2
from pprint import pprint import click from rich import print from rich.tree import Tree from rich.live import Live from rich.padding import Padding from solution_2_ip_and_hostname import parse_cdp, connect_ssh def generate_tree_from_schema(schema): """ Функция рисует дерево топологии на основе словаря sche...
124
28.69
87
17
894
python
[]
0
true
2024-11-18T20:59:40.672924+00:00
1,583,961,397,000
da5ad81579e601e42427ad5d0746fcd0a15f2394
3
{ "blob_id": "da5ad81579e601e42427ad5d0746fcd0a15f2394", "branch_name": "refs/heads/master", "committer_date": 1583961397000, "content_id": "e705bf5e89f181cdad740a74dd5b9e3e18551a78", "detected_licenses": [ "MIT" ], "directory_id": "e0451d4e580d9b5c1327dc9103dfff801f6fb91b", "extension": "py", "fi...
2.515625
stackv2
# To add a new cell, type '#%%' # To add a new markdown cell, type '#%% [markdown]' #%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataScience.changeDirOnImportExport setting # ms-python.python added import os try: os.chdir(os.path.join(os.getcwd(), ...
129
22.85
156
14
888
python
[]
0
true
2024-11-18T20:59:40.778243+00:00
1,540,472,874,000
08fd417856419883d96a055cc3185ffacb740a48
2
{ "blob_id": "08fd417856419883d96a055cc3185ffacb740a48", "branch_name": "refs/heads/master", "committer_date": 1540472874000, "content_id": "41768371fb9ebe8223d3e3dfef8e235095db8005", "detected_licenses": [ "MIT" ], "directory_id": "0b7a105e8b708d85f5c08c75507dbb4447ccf172", "extension": "py", "fi...
2.328125
stackv2
class FPGA_config(object): def __init__(self, ddr2fpga_nb, fpga2ddr_nb, iter_nb, mem_nb, mem_depth, add_nb, mul_nb): self.func_layout = {'add': add_nb, 'mul': mul_nb} func_nb = sum(self.func_layout.values()) self.config = { 'ddr2fpga_nb': ddr2fpga_nb, 'fpga2dd...
18
39.39
93
13
205
python
[]
0
true
2024-11-18T20:59:40.934542+00:00
1,509,702,219,000
08f77172d6d8c97ef2fe380f355eac92aec3d81b
3
{ "blob_id": "08f77172d6d8c97ef2fe380f355eac92aec3d81b", "branch_name": "refs/heads/master", "committer_date": 1509702219000, "content_id": "13e4ca228547d4af884c3b1bed675d5109974a49", "detected_licenses": [ "MIT" ], "directory_id": "8f547afd2996c32336362002785f26a1c5f714cc", "extension": "py", "fi...
3.296875
stackv2
import numpy as np import matplotlib.pyplot as plt from skimage import io, img_as_float from skimage.color import rgb2gray ############################################################################### # all functions ############################################################### ####################################...
112
36.54
123
21
857
python
[]
0
true
2024-11-18T20:59:41.286933+00:00
1,591,178,665,000
a34de0b1b9646e966538b5d25ce3dd069bbefd19
3
{ "blob_id": "a34de0b1b9646e966538b5d25ce3dd069bbefd19", "branch_name": "refs/heads/master", "committer_date": 1591178665000, "content_id": "aeed6e07ec0def521ba6582647d4ee1ecbc6b645", "detected_licenses": [ "MIT-0" ], "directory_id": "7de00574899fe8a83281349d9e17248cc4dcbc75", "extension": "py", "...
2.5625
stackv2
""" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ from cfnlint.rules import CloudFormationLintRule from cfnlint.rules.limits import approaching_name_limit class LimitName(CloudFormationLintRule): """Check maximum Resource name size limit""" id = 'I3011' ...
19
37.42
108
10
163
python
[]
0
true
2024-11-18T20:59:41.763943+00:00
1,493,782,843,000
ceebabb5cede862687ec23662fc98a22cb1e1378
2
{ "blob_id": "ceebabb5cede862687ec23662fc98a22cb1e1378", "branch_name": "refs/heads/master", "committer_date": 1493782843000, "content_id": "3ed133288ef112cb01573848e62c36fb4d628cbf", "detected_licenses": [ "Apache-2.0" ], "directory_id": "76e5545d49f7dccebf82280d3556c18df074463a", "extension": "py"...
2.46875
stackv2
__author__ = 'Leandra' import pandas as pd import os import numpy as np import math from pyAudioAnalysis import audioAnalysis def load_df(path_name, file_name): file_path = os.path.join(path_name, file_name) df = pd.read_csv(file_path) return df def xy_centroid_to_num(x, y): scale_factor = 10.0 #3840...
150
34.45
101
18
1,360
python
[]
0
true
2024-11-18T20:59:41.966237+00:00
1,228,672,351,000
94db704e8f722ac148b7bf2b612fdb3ecd9d4622
3
{ "blob_id": "94db704e8f722ac148b7bf2b612fdb3ecd9d4622", "branch_name": "refs/heads/master", "committer_date": 1228672351000, "content_id": "9c43dd1daf82ec638afdc189955b8a58e477699b", "detected_licenses": [ "BSD-2-Clause", "BSD-3-Clause" ], "directory_id": "7565d9b7762706bf67adc27f43700d54f04d2f0d...
2.515625
stackv2
# Copyright 2008 Owen Taylor # # This file is part of Reinteract and distributed under the terms # of the BSD license. See the file COPYING in the Reinteract # distribution for full details. # ######################################################################## import gtk import os from window_builder import Wind...
36
32.94
94
16
255
python
[]
0
true
2024-11-18T20:59:42.098620+00:00
1,693,470,539,000
8554b72740fa7d1c9705475a685d8bf6ddb298dd
2
{ "blob_id": "8554b72740fa7d1c9705475a685d8bf6ddb298dd", "branch_name": "refs/heads/master", "committer_date": 1693470539000, "content_id": "6c440ed22440b3d92b5d30b76941157059b49441", "detected_licenses": [ "Apache-2.0" ], "directory_id": "f9d564f1aa83eca45872dab7fbaa26dd48210d08", "extension": "py"...
2.34375
stackv2
# coding: utf-8 import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class EquipmentDnsItem: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute n...
144
25.53
79
23
849
python
[]
0
true
2024-11-18T20:59:42.708888+00:00
1,452,104,924,000
229afc122a79193e1f6065450db8ed4dc1747f51
3
{ "blob_id": "229afc122a79193e1f6065450db8ed4dc1747f51", "branch_name": "refs/heads/master", "committer_date": 1452104946000, "content_id": "65882ed4686fc757550c4e1da9d851dabe3fa8ce", "detected_licenses": [ "MIT" ], "directory_id": "6da0ce25795eeff42de4a23edee323f259386df2", "extension": "py", "fi...
2.8125
stackv2
import sys import json import pyexiv2 from pyexiv2.utils import make_fraction from lib.geo import decimal_to_dms ''' A class for edit EXIF using pyexiv2 ''' class ExifEdit(object): def __init__(self, filename, precision=1000): self.filename = filename self.metadata = pyexiv2.ImageMetadata(filenam...
86
36.72
134
15
835
python
[]
0
true
2024-11-18T20:59:42.842811+00:00
1,594,039,186,000
982e5a5c95dd147c914f985655edd28567ca2796
3
{ "blob_id": "982e5a5c95dd147c914f985655edd28567ca2796", "branch_name": "refs/heads/master", "committer_date": 1594039186000, "content_id": "9091e9825df2732e03d5a045ad6818a8ca2af818", "detected_licenses": [ "MIT" ], "directory_id": "36ca14e66b6d6b99f7dba6394a5a6445196a5283", "extension": "py", "fi...
3.234375
stackv2
import os from string import ascii_uppercase from random import choice import pygame import pygame.freetype # Tutorial = https://www.youtube.com/watch?v=UEO1B_llDnc # init pygame.init() WIDTH = 800 HEIGHT = 500 win = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Hangman The Game") GAME_FONT = p...
129
24.57
76
18
958
python
[]
0
true
2024-11-18T20:59:43.175671+00:00
1,594,524,129,000
ce04a17f03e815e7c573c4126b3e3f4d573e2e66
3
{ "blob_id": "ce04a17f03e815e7c573c4126b3e3f4d573e2e66", "branch_name": "refs/heads/master", "committer_date": 1594524129000, "content_id": "0e28bc6658aed5d9007e5b562722b7cd261efb7a", "detected_licenses": [ "MIT" ], "directory_id": "661fb342f8ec023306143cfe15a665b208e01c47", "extension": "py", "fi...
2.96875
stackv2
''' Another example of loading a pre-trained NFSP model on Leduc Hold'em Here, we directly load the model from model zoo ''' import rlcard from rlcard.agents import RandomAgent from rlcard.utils import set_global_seed, tournament from rlcard import models # Make environment env = rlcard.make('leduc-holdem', config...
24
30.17
72
10
186
python
[]
0
true
2024-11-18T20:59:43.260795+00:00
1,604,064,574,000
bd14c5cb0f1f8c99989da4097eff7f4a66171fc4
2
{ "blob_id": "bd14c5cb0f1f8c99989da4097eff7f4a66171fc4", "branch_name": "refs/heads/master", "committer_date": 1604064574000, "content_id": "25b6147b80ff8d04c55d53a528dc82defee03a99", "detected_licenses": [ "MIT" ], "directory_id": "5188016e2be50005f23e10f7d1e80158e7baa89b", "extension": "py", "fi...
2.328125
stackv2
import json import requests headers = { "Authorization": "Bearer " + 'accessToken', } temperature = 36.5 Mask = 76 message_description = '해당인원 온도 :' +str(temperature) + '\n마스크 미착용 확률 : ' + str(Mask) +'%' template = { "object_type": "feed", "content": { "image_url": "IMAGE_URL, 클라이언트의 사진을 가져오거...
54
25.87
108
13
417
python
[]
0
true
2024-11-18T20:59:43.331982+00:00
1,584,219,605,000
6ed99ef52ad5531e7aeac24adbaa22b392291398
3
{ "blob_id": "6ed99ef52ad5531e7aeac24adbaa22b392291398", "branch_name": "refs/heads/master", "committer_date": 1584219605000, "content_id": "4e6f463d29633f1a19554f57362436b7cef102b8", "detected_licenses": [ "MIT" ], "directory_id": "981daa78d19cacbcdaaed167d017594b8dbce198", "extension": "py", "fi...
2.78125
stackv2
from collections import defaultdict from slugify import slugify from itertools import chain from utils.date import date_to_str from utils.locale import is_brazil from utils.amount import amount_to_str from utils.file import get_files_of_data_folder, get_file_content file_contents = None def _get_file_contents(): ...
121
28.24
84
15
744
python
[]
0
true
2024-11-18T20:59:43.397678+00:00
1,614,264,552,000
a64dc6faef140f70e99645929ebbff0c82d4a5b4
3
{ "blob_id": "a64dc6faef140f70e99645929ebbff0c82d4a5b4", "branch_name": "refs/heads/main", "committer_date": 1614264552000, "content_id": "3a1195d5eb934306e547c9cdcebe316380653f05", "detected_licenses": [ "MIT" ], "directory_id": "157b4b54236b98b4bb8edfec96afc9193947e93e", "extension": "py", "file...
2.546875
stackv2
#!/usr/bin/env python import sys import os import cv2 import numpy as np import math from cv_bridge import CvBridge, CvBridgeError import rospy import rospkg import std_msgs.msg from sensor_msgs.msg import Image IMAGES_DIR = '/path/to/img' #change this # DEPTH_TIMESTAMP_FILE = "path/to/timestampsdepth.txt" # COLOR_T...
107
33.39
107
16
835
python
[]
0
true
2024-11-18T20:59:43.518639+00:00
1,528,445,722,000
a8e1f4d55e7f450d5b35be5e3d4da66bd392ccc7
3
{ "blob_id": "a8e1f4d55e7f450d5b35be5e3d4da66bd392ccc7", "branch_name": "refs/heads/master", "committer_date": 1528445722000, "content_id": "01e229d799ca2ab80d2ba631d96c35eedc44a324", "detected_licenses": [ "MIT" ], "directory_id": "6db646e1f78d580003b6a37e8f722b28cc9ceae8", "extension": "py", "fi...
2.59375
stackv2
from base import * from ofxparse import OfxParser import codecs, re class OFXAdapter(BankAdapter): name = 'OFX' def parse_ofx(self): if not getattr(self, 'ofx', None): with codecs.open(self.filename) as f: self.ofx = OfxParser.parse(f) return self.ofx def get_...
40
34
105
17
289
python
[]
0
true
2024-11-18T20:59:43.578816+00:00
1,579,228,607,000
606a74ca64b228fb088f449a2fc05e5fabd1ce44
2
{ "blob_id": "606a74ca64b228fb088f449a2fc05e5fabd1ce44", "branch_name": "refs/heads/master", "committer_date": 1579228607000, "content_id": "19907053b925f6dc602aadf31904ad3c78f41dae", "detected_licenses": [ "MIT" ], "directory_id": "3f6088cf1aaaddc18ca1c6f2d5bfc69590941d60", "extension": "py", "fi...
2.5
stackv2
import matplotlib.pyplot as plt from pylab import mpl mpl.rcParams['font.sans-serif'] = ['FangSong'] # 指定默认字体 mpl.rcParams['axes.unicode_minus'] = False # 解决保存图像是负号'-'显示为方块的问题 plt.rcParams['font.size']=10 import pandas as pd import numpy as np import os root_path = os.path.dirname(os.path.abspath('__file__')) # root_pa...
186
32.56
139
9
2,162
python
[]
0
true
2024-11-18T20:59:44.052347+00:00
1,472,155,503,000
5b430ff94b536c55b3b8dd1cba2a81e8c425385a
4
{ "blob_id": "5b430ff94b536c55b3b8dd1cba2a81e8c425385a", "branch_name": "refs/heads/master", "committer_date": 1472155503000, "content_id": "16091ce662efbba9785b7a578bbcc8f6851a3c21", "detected_licenses": [ "MIT" ], "directory_id": "22a2a26a9fe0a4ba3c11e3115168849945f87d53", "extension": "py", "fi...
3.5
stackv2
""" THis is a paranthesis checker """ import os import sys os.system("clear") #reading the path to file if len(sys.argv) <= 1: print "Please input the codefile to be checked for paranthesis" print "USAGE : paranthesisChecker.py <path to file>" sys.exit(); filename=sys.argv[1] try: readme=open(filename,"r")...
125
22.22
77
18
780
python
[]
0
true
2024-11-18T20:59:44.203998+00:00
1,590,760,271,000
5bd24b4e2b662e1b444cd2684fe9583cbdf1880a
3
{ "blob_id": "5bd24b4e2b662e1b444cd2684fe9583cbdf1880a", "branch_name": "refs/heads/master", "committer_date": 1590760271000, "content_id": "5426897b4e636ae6b4c31f576eafc95138a15900", "detected_licenses": [ "MIT" ], "directory_id": "bb273d6ced49e7c4ddc41f8d2e5257e5a5097e34", "extension": "py", "fi...
2.984375
stackv2
# TASK - 1 : To build a Subjective-Objective classifier, by using 5000+5000 dataset # TASK - 2 : Constructing a function that performs mincut for a given file # TASK - 3 : Calling the function over all the 2000 files and creating new modified reviews from sklearn.feature_extraction.text import CountVectorizer from skl...
119
30.57
92
17
931
python
[]
0
true
2024-11-18T20:59:44.266257+00:00
1,568,556,471,000
8eca00957123033b0f193a1c0f0c556c73893588
3
{ "blob_id": "8eca00957123033b0f193a1c0f0c556c73893588", "branch_name": "refs/heads/master", "committer_date": 1568556471000, "content_id": "e72bdd515ed7cc0d2bfc14fe816888006045ef02", "detected_licenses": [ "MIT" ], "directory_id": "73f10c7c7aedb08670cd03304603bd92f964a77a", "extension": "py", "fi...
3.4375
stackv2
# https://docs.python.org/3/library/unittest.mock-examples.html import unittest from unittest.mock import patch class SomeClass(object): attribute = 'someclass_someclass' function = 'function' # def function(cls): # return 'function' class Sentinel(object): attribute = 'sentinel_sentinel' d...
105
23.11
103
12
621
python
[]
0
true
2024-11-18T20:59:44.323622+00:00
1,473,594,415,000
3a4572b310764eef429c9c55de6676bf46ac64ed
3
{ "blob_id": "3a4572b310764eef429c9c55de6676bf46ac64ed", "branch_name": "refs/heads/master", "committer_date": 1473594415000, "content_id": "c558d0db8b6c88aa55d2b496d64a47852676b8d7", "detected_licenses": [ "MIT" ], "directory_id": "97a642a2b5737c614d31b555cc9ac7f98d364150", "extension": "py", "fi...
2.984375
stackv2
class SnippetSyntaxError(Exception): """Base class for snippets syntax errors""" def __init__(self): self.language = None def set_language(self, language): self.language = language class EndSnippetSyntaxError(SnippetSyntaxError): """Ending snippet syntax error""" def __init__(s...
54
30.43
105
10
350
python
[]
0
true
2024-11-18T20:59:44.373660+00:00
1,623,528,450,000
e77aeb20e082e6037faa6d552a02195f81aa45c6
3
{ "blob_id": "e77aeb20e082e6037faa6d552a02195f81aa45c6", "branch_name": "refs/heads/master", "committer_date": 1623528450000, "content_id": "d1708574297a0944952999afed547472bb5dc9e8", "detected_licenses": [ "MIT" ], "directory_id": "5cf7fba21ae7999cb5e3a0e9ce5e44f51b21389d", "extension": "py", "fi...
2.640625
stackv2
# COMMAND ---------- #PySpark Functions from pyspark.sql.functions import col, when, lead, expr from pyspark.sql.window import Window # COMMAND ---------- ######## Load DF from blob storage ############## df = spark.read.format("csv") \ .options(header='true', delimiter = ',') \ .schema(customSchema) \ .load("/mnt/fi...
28
23.82
55
13
155
python
[]
0
true
2024-11-18T20:59:44.436745+00:00
1,567,944,662,000
70d368a82f0db8b99240b93473867b275fc0a4d4
4
{ "blob_id": "70d368a82f0db8b99240b93473867b275fc0a4d4", "branch_name": "refs/heads/master", "committer_date": 1567944662000, "content_id": "3a8f670f2b573a75d2343ff9b5a3be4ee389586a", "detected_licenses": [ "MIT" ], "directory_id": "6eadd5fbf819c055e494b77aeb5378e76b975a9e", "extension": "py", "fi...
4.375
stackv2
# Given an array of integers, find the first missing positive integer in # linear time and constant space. In other words, find the lowest positive # integer that does not exist in the array. The array can contain duplicates # and negative numbers as well. # For example, the input [3, 4, -1, 1] should give 2. The inpu...
47
25.74
88
12
360
python
[]
0
true
2024-11-18T20:59:44.653774+00:00
1,608,472,956,000
9d856acabc20d75f69476058b5cad3c0ab31ab4e
4
{ "blob_id": "9d856acabc20d75f69476058b5cad3c0ab31ab4e", "branch_name": "refs/heads/master", "committer_date": 1608472956000, "content_id": "5bed5f068d30a77b2a82f5f99c84d2c0a98755c7", "detected_licenses": [ "MIT" ], "directory_id": "9818262abff066b528a4c24333f40bdbe0ae9e21", "extension": "py", "fi...
4.09375
stackv2
''' Digit Problem This time your task is simple. Given two integers X and K, find the largest number that can be formed by changing digits at atmost K places in the number X. Input: First line of the input contains two integers X and K separated by a single space. Output: Print the largest number formed in a single...
32
19.78
125
11
171
python
[]
0
true
2024-11-18T20:59:44.798834+00:00
1,686,120,388,000
7804eadd716365f2328e26d5c058d87ae79e01a8
3
{ "blob_id": "7804eadd716365f2328e26d5c058d87ae79e01a8", "branch_name": "refs/heads/master", "committer_date": 1686120388000, "content_id": "93dc7009bcac9159202736858d96d2a7a183a777", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d48d076fb07c1faf04b81b24f86c4cf2c48ecf29", "extension": "py"...
2.5625
stackv2
#!/usr/bin/python # -*- coding:utf-8 -*- SKIP_VERIFY_ATTR_TYPE = False def _verify_attr_type(value, allowedAttrType): if isinstance(allowedAttrType, list): for t in allowedAttrType: if isinstance(value, t): return True return False return isinstance(value, allowedAt...
51
33.08
94
18
388
python
[]
0
true
2024-11-18T20:59:44.853280+00:00
1,595,068,024,000
d2d1e77263bbe8975298a57a964c5129b4190e8d
3
{ "blob_id": "d2d1e77263bbe8975298a57a964c5129b4190e8d", "branch_name": "refs/heads/master", "committer_date": 1595068024000, "content_id": "b9272e85cdf98c822d04c4d711483bf33401675c", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "4cbb866848c57fa103d198a27767bd817a9ab287", "extension": "p...
2.78125
stackv2
#!/usr/bin/env python3 import os import sys from bs4 import BeautifulSoup SCRIPT_TAG = "script" JQUERY_ADDRESS = "https://ajax.googleapis.com/ajax/libs/" \ "jquery/3.4.1/jquery.min.js" INDEX_HTML_SCRIPT_NAME = "processRefs.js" OTHER_HTML_SCRIPT_NAME = "script.js" OTHER_HTML_FUNC_CALL = "colorReferenc...
60
26.63
76
17
372
python
[]
0
true
2024-11-18T20:59:45.168031+00:00
1,600,946,955,000
e23f3dc4c8ddc4ea0a809d00e6052643d80e3453
3
{ "blob_id": "e23f3dc4c8ddc4ea0a809d00e6052643d80e3453", "branch_name": "refs/heads/master", "committer_date": 1600946955000, "content_id": "a00337d3f68c0f5113011222a2d8f3a4778715f6", "detected_licenses": [ "Apache-2.0" ], "directory_id": "778606229e2d14fa76acb5dff7070692ead1a7d6", "extension": "py"...
2.890625
stackv2
import requests import json import re class Round_plan(): """一个关于调用百度地图API全方式路径规划功能的类""" def __init__(self, transit_mode): self.transit_mode = transit_mode def stod(self, slat, slng, dlat, dlng, waypoints='', route_type=''): # 输入:起点纬度、起点经度、终点纬度、终点经度 self.slat=slat self.slng=slng ...
115
47.53
121
28
1,567
python
[]
0
true
2024-11-18T20:59:45.386387+00:00
1,647,289,971,000
b3ff8fa901590ca9d2ecedba94c31be4eaaa49f3
3
{ "blob_id": "b3ff8fa901590ca9d2ecedba94c31be4eaaa49f3", "branch_name": "refs/heads/master", "committer_date": 1647289971000, "content_id": "626951e3832893e5c1f75e6bde36330bd081c87e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "3102aa91e2b5d2f7ff0821d33639651585797081", "extension": "py"...
2.65625
stackv2
import RPi.GPIO as GPIO import json class on_off_range : def __init__(self, on_string , off_string): self.on_string= on_string self.off_string= off_string class actuator: def __init__(self,name, port): GPIO.setmode(GPIO.BCM) GPIO.setup(port, GPIO.OUT) self.name=name ...
79
21.39
62
12
384
python
[]
0
true
2024-11-18T20:59:45.493436+00:00
1,573,148,949,000
58da9c43e10fba440647b5d0a6039fb6ed106ec5
3
{ "blob_id": "58da9c43e10fba440647b5d0a6039fb6ed106ec5", "branch_name": "refs/heads/master", "committer_date": 1573148949000, "content_id": "ab703d17d833d65ae68d1cd4bd9a88bfd05c1178", "detected_licenses": [ "MIT" ], "directory_id": "308ff3931781ba97355e610f20356f7df5a684bc", "extension": "py", "fi...
2.90625
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Helper functions for plotting modules """ import collections import numpy as np from matplotlib import ticker from tunacell.base import Colony, Lineage MIN_SEP = 20 MAX_XTICKS = 6 def _set_axis_limits(ax, values, which='x', pad=.1, force_range=(None, None)): "...
133
26.74
116
18
955
python
[]
0
true
2024-11-18T20:59:46.873084+00:00
1,473,943,081,000
6704746b0a9cf54c42b42f33ec4c08808e41379d
3
{ "blob_id": "6704746b0a9cf54c42b42f33ec4c08808e41379d", "branch_name": "refs/heads/master", "committer_date": 1473943081000, "content_id": "9db62c5b745f78937726dd81dbcedeac1817ed4b", "detected_licenses": [ "MIT" ], "directory_id": "de8599411de3f1b53c0026a635a15470b4d22854", "extension": "py", "fi...
2.921875
stackv2
import os import argparse import glob from tankbuster.engine import bust # Set up the argument parser ap = argparse.ArgumentParser() # Add argument for input ap.add_argument("-i", "--input", required=True, help="The image or directory to be analysed.") # Parse the arguments args = vars(ap.parse_args()) # Assign arg...
29
20.9
94
10
149
python
[]
0
true
2024-11-18T20:59:47.186567+00:00
1,458,625,179,000
c231e096ce27326847130c768abf679f41eb71bd
3
{ "blob_id": "c231e096ce27326847130c768abf679f41eb71bd", "branch_name": "refs/heads/master", "committer_date": 1458625179000, "content_id": "d5462af09a0493dc1f3e01a35dd3ef8df5f03eee", "detected_licenses": [ "MIT" ], "directory_id": "c2caf7c60c1d1cef84e96144e73bb6941388a6ea", "extension": "py", "fi...
3.0625
stackv2
import datetime import dateutil.tz import pytz import calendar LOCAL_TIMEZONE = dateutil.tz.tzlocal() def to_utc(dt): if dt.tzinfo is None: dt = dt.replace(tzinfo=LOCAL_TIMEZONE) if dt.tzinfo != pytz.UTC: return dt.astimezone(tz=pytz.UTC) return dt def to_timestamp(dt): return calenda...
37
23.51
69
11
249
python
[]
0
true
2024-11-18T20:59:47.254755+00:00
1,586,791,373,000
780128fc234764de7f428e073414c915e6114f34
3
{ "blob_id": "780128fc234764de7f428e073414c915e6114f34", "branch_name": "refs/heads/master", "committer_date": 1586791373000, "content_id": "d7ecf552dad415c9a1c25ccb1feca1a1199735f8", "detected_licenses": [ "MIT", "Apache-2.0" ], "directory_id": "429a2fac32015d4460e98f61c90ee85d961d5f9b", "exten...
3.234375
stackv2
# -*- coding: UTF-8 -*- from __future__ import unicode_literals from functools import wraps import jscaller def object2result(obj): """ Object 转 Result。""" return Result(obj.__parent__, obj.__name__, True) def object2expr(obj): """ Object 转 Express。""" return Express(obj.__parent__, object2result(ob...
455
27.65
105
20
3,284
python
[]
0
true
2024-11-18T20:59:47.468520+00:00
1,512,040,608,000
4e4146455582f56d1db789c7ded76e9d964b247a
3
{ "blob_id": "4e4146455582f56d1db789c7ded76e9d964b247a", "branch_name": "refs/heads/master", "committer_date": 1512040608000, "content_id": "af4f0cbf581bc85afc4e56a920064f5ed3e03c91", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "123cdb1d6a6956586dd91c86d02e0d1bacdcebae", "extension": "p...
2.765625
stackv2
#!/Users/jcb/anaconda/bin/python3 import sys import pprint from pddl import PDDL_Parser from action import Durative_Action class VRP: '''Represent a parsed Pandora PDDL file and output a VRP formatted for input into the CP solver. This is a domain specific implementation, assuming that we are ...
381
34.54
137
20
3,094
python
[]
0
true
2024-11-18T20:59:47.598677+00:00
1,599,267,401,000
de092e5bf752977b832288e93a93df331b33acc3
3
{ "blob_id": "de092e5bf752977b832288e93a93df331b33acc3", "branch_name": "refs/heads/master", "committer_date": 1599267401000, "content_id": "eb7f1e7ec9417c6e24b2509e6b95f04fc4f480af", "detected_licenses": [ "MIT" ], "directory_id": "ffe15d571ddc21b2f8ac22ba1122ad7ce27d3c02", "extension": "py", "fi...
3.03125
stackv2
if __name__ == "__main__": set=0 dingdong = list(map(int, input().split())) if(dingdong[0]==1): for i in range(0, 8): if(dingdong[i]!=i+1): print("mixed") set=1 break if(set==0): print("ascending") elif(dingdon...
24
22.75
46
15
152
python
[]
0
true
2024-11-18T20:59:47.665668+00:00
1,522,472,683,000
98bd57fd0c0907acc35b97b1128f93353d9c89f0
2
{ "blob_id": "98bd57fd0c0907acc35b97b1128f93353d9c89f0", "branch_name": "refs/heads/master", "committer_date": 1522472683000, "content_id": "17b791612ee3653527b50b9c5be93d3380f20b13", "detected_licenses": [ "Apache-2.0" ], "directory_id": "6639761e05e3b0aae3f6ce53558e99149e11a09e", "extension": "py"...
2.328125
stackv2
#!/usr/bin/env python from stanza.research import config config.redirect_output() import datetime from stanza.monitoring import progress from stanza.research import evaluate, output import metrics import learners import datasets parser = config.get_options_parser() parser.add_argument('--learner', default='Baseline...
86
46.02
92
16
772
python
[]
0
true
2024-11-18T20:59:47.764832+00:00
1,619,049,051,000
2c278159d4f63e2772a4bf1cd2bcb6eb94ca912d
3
{ "blob_id": "2c278159d4f63e2772a4bf1cd2bcb6eb94ca912d", "branch_name": "refs/heads/master", "committer_date": 1619049051000, "content_id": "d5b6e0cd57c95c808dd96ca2784525d8c1988873", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5bd05b2b6b9b01f6f2c58bfb7a14b0b45ea20999", "extension": "py"...
3.0625
stackv2
from __future__ import print_function from copy import copy font = Glyphs.font def glyph_exists(gname): glyph_existence = False if gname in font.glyphs: glyph_existence = True return glyph_existence def _duplicate_glyph(glyph, suffix=".alt"): new_glyph = glyph.copy() new_glyph.name = gl...
50
23.54
84
14
338
python
[]
0
true
2024-11-18T20:59:47.810098+00:00
1,396,988,968,000
261c8a5159c28e872d2b6889f40456d68b3abdda
3
{ "blob_id": "261c8a5159c28e872d2b6889f40456d68b3abdda", "branch_name": "refs/heads/master", "committer_date": 1396988968000, "content_id": "8b087899b63a6f143c5cce32fb6d29ce1b3bd4f4", "detected_licenses": [ "MIT" ], "directory_id": "0f5b9c9ebb32e6878630b5ff7a52b84daa1d23c3", "extension": "py", "fi...
2.90625
stackv2
# encoding=utf-8 from PyQt4.QtGui import * from PyQt4.QtCore import * from loginwindow import LoginWindow from messagewindow import MessageWindow from clientthread import ClientThread from PyQt4 import QtGui import socket import sys class Client(QtGui.QMainWindow): def __init__(self,application, parent = None): QtGu...
128
32.16
157
15
1,040
python
[]
0
true
2024-11-18T20:59:47.881039+00:00
1,576,936,802,000
5cdf5fadaecac300a4de2ef717cf0f367b493096
3
{ "blob_id": "5cdf5fadaecac300a4de2ef717cf0f367b493096", "branch_name": "refs/heads/master", "committer_date": 1576936802000, "content_id": "9a77186f94e2aaa3f98b7b5e80519ec08d677e34", "detected_licenses": [ "MIT" ], "directory_id": "984062ef926f8ebf16610688bc79053c7a4cd8b5", "extension": "py", "fi...
3.09375
stackv2
from collections import OrderedDict import time class GeoDistributedLRUCache(object): """Using Dictionary to hold Cache""" def __init__(self, cacheSize=1024): self.cacheSize = cacheSize self.__values = {} self.__access_times = OrderedDict() self.access_iter = 0 def size(sel...
49
26.78
52
13
307
python
[]
0
true
2024-11-18T20:59:58.229813+00:00
1,514,461,011,000
1cc20e21eb80e2cd654bbb9a4c31c7a5abce4eb7
3
{ "blob_id": "1cc20e21eb80e2cd654bbb9a4c31c7a5abce4eb7", "branch_name": "refs/heads/master", "committer_date": 1514461011000, "content_id": "6aa2cfb153c3906b54f135975b6f92842cafa4dd", "detected_licenses": [ "Apache-2.0" ], "directory_id": "1e0cc26234a06f0d0ee25888ad817cb7f3e5a256", "extension": "py"...
2.578125
stackv2
# -*- coding: utf-8 -*- """ Created on Sat Jul 23 22:21:47 2016 @author: nebula """ import os # import Image, ImageDraw from PIL import Image # from PIL import ImageDraw import matplotlib.pyplot as plt def makeHist(inpath, outfile): img = Image.open(inpath) print(img.size) rawimage = img.getdata() h...
62
31.16
100
14
624
python
[]
0
true
2024-11-18T20:59:58.496034+00:00
1,494,863,758,000
d9aef5ba4a6c0004176d610c0ae68fd6d55874a9
3
{ "blob_id": "d9aef5ba4a6c0004176d610c0ae68fd6d55874a9", "branch_name": "refs/heads/master", "committer_date": 1494863758000, "content_id": "75f208b38a2bf4dd7dbcc72ab9b704d7b471f98d", "detected_licenses": [ "MIT" ], "directory_id": "b7aa0a823da3bb99eb161bb92b3d53122c534ced", "extension": "py", "fi...
2.640625
stackv2
from __future__ import absolute_import from werkzeug.http import parse_options_header from . import exceptions class Negotiator(object): """The class used to select the proper parser and renderer.""" def select_parser(self, parser_classes, content_type): """Select the proper parser class. ...
51
35.41
71
14
340
python
[]
0
true
2024-11-18T21:00:00.205259+00:00
1,614,181,199,000
9f473b3cfe6a2ad7f129142f0e8f9d047a0600fc
4
{ "blob_id": "9f473b3cfe6a2ad7f129142f0e8f9d047a0600fc", "branch_name": "refs/heads/master", "committer_date": 1614181199000, "content_id": "8f56266eda7eac8ed9e35115d15d0f9e09e24ecb", "detected_licenses": [ "Python-2.0", "MIT" ], "directory_id": "50008b3b7fb7e14f793e92f5b27bf302112a3cb4", "exten...
3.78125
stackv2
class groupcount(object): """Accept a (possibly infinite) iterable and yield a succession of sub-iterators from it, each of which will yield N values. >>> gc = groupcount('abcdefghij', 3) >>> for subgroup in gc: ... for item in subgroup: ... print item, ... print ......
30
21.93
67
13
181
python
[]
0
true
2024-11-18T21:00:00.313323+00:00
1,587,651,002,000
709f460ec188b60df6c323f74ea384c5e35b6000
2
{ "blob_id": "709f460ec188b60df6c323f74ea384c5e35b6000", "branch_name": "refs/heads/master", "committer_date": 1587651002000, "content_id": "100fc72d7662a30b910796bcf0a0c745423956d9", "detected_licenses": [ "MIT" ], "directory_id": "a298b34be474fe8826152830f2ef641ac68b720e", "extension": "py", "fi...
2.3125
stackv2
# -*- coding: utf-8 -*- # Copyright (c) 2020 Ricardo Bartels. All rights reserved. # # check_redfish.py # # This work is licensed under the terms of the MIT license. # For a copy, see file LICENSE.txt included in this # repository or visit: <https://opensource.org/licenses/MIT>. from cr_module.classes.inventory i...
150
37.44
120
17
1,267
python
[]
0
true
2024-11-18T21:00:00.416813+00:00
1,595,172,405,000
f2e4706703b1bd229a00e3a224760a2655fcb6d4
3
{ "blob_id": "f2e4706703b1bd229a00e3a224760a2655fcb6d4", "branch_name": "refs/heads/master", "committer_date": 1595172405000, "content_id": "76cdb1bd8a4c6dfae0aec240b18c31a9bca5a97c", "detected_licenses": [ "MIT" ], "directory_id": "2052a12f0ab7a827d6427b5533b6ae29847dcc3b", "extension": "py", "fi...
2.96875
stackv2
class Solution: def exist(self, board: List[List[str]], word: str) -> bool: if not word: return True def h(board, i, j, cur, target, used): ret = False if board[i][j] == target[len(cur)]: cur += board[i][j] if cur == target: ...
43
31.81
72
18
347
python
[]
0
true
2024-11-18T21:00:00.598903+00:00
1,540,991,658,000
4df5b924cfac73bd81a15d1cc21e59268d054917
3
{ "blob_id": "4df5b924cfac73bd81a15d1cc21e59268d054917", "branch_name": "refs/heads/master", "committer_date": 1540991658000, "content_id": "ce0863050e67db5e3c8e91b0739549fd44ff0ec9", "detected_licenses": [ "MIT" ], "directory_id": "6934faf01429e38412c5efc6e11882f8b4cbd7a6", "extension": "py", "fi...
2.65625
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Detect faces in images. """ # # This script detects faces in images. # https://docs.opencv.org/3.1.0/d7/d8b/tutorial_py_face_detection.html # Input is a folder with image files. # Output is a csv-file listing number of detected faces, genre, hashes and filenames. # ...
125
27.52
107
12
895
python
[]
0
true
2024-11-18T21:00:00.731617+00:00
1,612,691,220,000
afc470118f82f7be88e40636f874e27cc2b92cf4
2
{ "blob_id": "afc470118f82f7be88e40636f874e27cc2b92cf4", "branch_name": "refs/heads/master", "committer_date": 1612691220000, "content_id": "c64407fd485df984b069273e51bcc8f891eb559a", "detected_licenses": [ "MIT" ], "directory_id": "dca5fe58b5283376d149f352ce31f1b98778a8df", "extension": "py", "fi...
2.34375
stackv2
# Author: Simon Blanke # Email: simon.blanke@yahoo.com # License: MIT License import random from tqdm.auto import tqdm import scipy import numpy as np import pandas as pd import multiprocessing from .util import merge_dicts class Config: def __init__(self, *args, **kwargs): kwargs_base = { ...
178
29.2
112
15
1,208
python
[]
0
true
2024-11-18T21:00:01.031655+00:00
1,636,524,825,000
5b7f529e6fa2739a114dbaed48989f0a1801463f
4
{ "blob_id": "5b7f529e6fa2739a114dbaed48989f0a1801463f", "branch_name": "refs/heads/main", "committer_date": 1636524825000, "content_id": "48dda0e4ab65570c2aa1baf93f32abf5b2953b6a", "detected_licenses": [ "MIT" ], "directory_id": "39b7b6f5e38fb05b4e63afbc839e2abd79f3a6f9", "extension": "py", "file...
3.75
stackv2
# ============================================= # # Módulo de suporte para realização das tarefas # # ============================================= # import numpy as np # ============================================= # # Algoritmo QR # # ============================================= ...
333
29.35
114
16
2,892
python
[]
0
true
2024-11-18T21:00:01.392727+00:00
1,692,297,954,000
8991e2d3576153c4a49d8fc9782dcf88a42d3a4c
3
{ "blob_id": "8991e2d3576153c4a49d8fc9782dcf88a42d3a4c", "branch_name": "refs/heads/main", "committer_date": 1692297954000, "content_id": "641af84969cddc28e4c8b0936d456348e54c3503", "detected_licenses": [ "MIT" ], "directory_id": "7231c313f64c1e281d4d55e66f34d26bb5c4965d", "extension": "py", "file...
3.09375
stackv2
""" Module containing kernel related classes TODO: Replace kernel evaluation with compute_kern found in hyppo.common.tools by reducing dependencies on autograd.numpy """ from __future__ import division from builtins import str from past.utils import old_div from abc import ABC, abstractmethod import autograd import ...
260
28.52
89
15
2,122
python
[]
0
true
2024-11-18T21:00:01.503605+00:00
1,608,135,516,000
9d99e7d173963fbfc79250cc487b139eba41db7a
3
{ "blob_id": "9d99e7d173963fbfc79250cc487b139eba41db7a", "branch_name": "refs/heads/master", "committer_date": 1608135516000, "content_id": "08b62332ff5274445330668fd4b5a0f3f47cf599", "detected_licenses": [ "MIT" ], "directory_id": "ba397ec0c1fed0347f46791eea0c3798cc6a2a0c", "extension": "py", "fi...
2.65625
stackv2
# -*- coding: utf-8 -*- # MIT License # Copyright (c) 2020 Arthur # 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, ...
122
45.7
136
11
1,284
python
[]
0
true
2024-11-18T21:00:02.395938+00:00
1,685,458,882,000
d0d8d5d24bca591f4b9100744e249ec02dc64fc0
3
{ "blob_id": "d0d8d5d24bca591f4b9100744e249ec02dc64fc0", "branch_name": "refs/heads/master", "committer_date": 1685458882000, "content_id": "4310faa04094d52abff3c509951be4243ff53bbc", "detected_licenses": [ "MIT" ], "directory_id": "792c262e2d584f064575ab98050c3dcc0e10db85", "extension": "py", "fi...
2.78125
stackv2
"""Utility functions for avoiding conflicts in the FC.""" import os from typing import Any, AsyncGenerator, List, Optional, Tuple from wipac_telemetry import tracing_tools as wtt from .mongo import Mongo from .schema import types def _is_conflict(uuid: Optional[str], file_found: Optional[types.Metadata]) -> bool: ...
118
33.43
88
18
930
python
[]
0
true
2024-11-18T21:00:02.449304+00:00
1,614,033,211,000
f2ca5f9cf4bcce57e2ec18ec8c5c292dfa956c98
3
{ "blob_id": "f2ca5f9cf4bcce57e2ec18ec8c5c292dfa956c98", "branch_name": "refs/heads/master", "committer_date": 1614033211000, "content_id": "2166fc514608f1a179c9356d51078d02ef544fcf", "detected_licenses": [ "MIT" ], "directory_id": "3d028c8ba838fd5a918430017784f3b1d563502b", "extension": "py", "fi...
2.59375
stackv2
import requests import json from bs4 import BeautifulSoup as BS import re import time import os from dotenv import load_dotenv def scrape_from_artist(artist_id, file_name='lyrics.txt'): initial_time = time.time() base_url = "https://api.genius.com" path = 'artists/{}/songs'.format(artist_id) request_u...
89
25.13
69
14
588
python
[]
0
true
2024-11-18T21:00:02.598337+00:00
1,618,759,697,000
2a0bbe7b446125b0ee2a99aa1f5701c4b80a1d19
2
{ "blob_id": "2a0bbe7b446125b0ee2a99aa1f5701c4b80a1d19", "branch_name": "refs/heads/main", "committer_date": 1618759697000, "content_id": "980b91dde32823fc522234c9585ea8a5c6ae5368", "detected_licenses": [ "MIT" ], "directory_id": "6bfbd232b5d3038e8d8d1b53bce31482fdaf530e", "extension": "py", "file...
2.359375
stackv2
import datetime from typing import List import ics from config import cqu_class_time, cqu_maxweek, cqu_time from cqu import sub def getCquClassListByUname(uname: str, upass: str)->List[str]: s = sub.CQU_Subject() subSchedule = s.getSubByLogin(uname=uname,upass=upass) class_list = [] for x in subSched...
35
30.06
69
11
336
python
[]
0
true
2024-11-18T21:00:03.037219+00:00
1,693,515,274,000
1783083f99362f3e6409e620d0de1bc55dca7935
3
{ "blob_id": "1783083f99362f3e6409e620d0de1bc55dca7935", "branch_name": "refs/heads/master", "committer_date": 1693515274000, "content_id": "de9e4631e8eebea342347bb40d30a8d16a96389f", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "a2e145c21db228c0a9764fe0d9cef784ec8ddb79", "extension": "p...
2.65625
stackv2
import os from bugswarm.common import log from bugswarm.common.log_downloader import download_log from reproducer.reproduce_exception import ReproduceError def analyze_and_compare(job_dispatcher, job, run): """ Analyze jobs, including those that are not reproduced (those that are missing a reproduced log mo...
81
50.96
118
19
925
python
[]
0
true
2024-11-18T21:00:03.100390+00:00
1,554,302,645,000
cab2fb678f85fb689545028695dce15b9068d0c7
3
{ "blob_id": "cab2fb678f85fb689545028695dce15b9068d0c7", "branch_name": "refs/heads/master", "committer_date": 1554302645000, "content_id": "c945067a737bbbdcd9fabae2487eef19273adc46", "detected_licenses": [ "MIT" ], "directory_id": "9b1a11c85572e409478206028a8a8ff3c2a5bfc0", "extension": "py", "fi...
3.3125
stackv2
''' 这是一个备份文件的脚本示例。 ''' import os import time def backupzip(source, target): ''' ZIP备份文件函数。 自动将source目录列表的文件备份打包成zip文件,存放在target目录下的ymdHMS.zip。 source:备份文件路径列表。 target:备份文件存放路径。 ''' target = target + os.sep + time.strftime('%Y%m%d') if not os.path.exists(target): os.mkdir(ta...
39
21.1
67
11
257
python
[]
0
true
2024-11-18T21:00:03.164099+00:00
1,499,276,988,000
5f7e9d9a5feb8ac95b7c8b236e6aebe6e1356487
3
{ "blob_id": "5f7e9d9a5feb8ac95b7c8b236e6aebe6e1356487", "branch_name": "refs/heads/master", "committer_date": 1499276988000, "content_id": "a63c265fea1d953fe54bc349532a186ac4dbbe88", "detected_licenses": [ "MIT" ], "directory_id": "064672488e3e0b037f4a58a56dbfe72e861799cc", "extension": "py", "fi...
2.515625
stackv2
import os import smtplib from email.header import Header from email.mime.text import MIMEText class Mail: debug_level = True if os.getenv('FLASK_DEBUG', 0) == 1 else False def __init__(self, smtp=smtplib.SMTP()): self.from_address = None self.to_address = None self.subject = None ...
39
27.26
79
14
250
python
[]
0
true
2024-11-18T21:00:03.398608+00:00
1,513,882,110,000
54bca3b0de16ee5b82ea1808422edf52dea9d62e
2
{ "blob_id": "54bca3b0de16ee5b82ea1808422edf52dea9d62e", "branch_name": "refs/heads/master", "committer_date": 1513882110000, "content_id": "b61e3e2283565941d88089c71b6cd934b27c2802", "detected_licenses": [ "MIT" ], "directory_id": "f33c1f5e37814c45a8dd0bcb85de3581a21defde", "extension": "py", "fi...
2.328125
stackv2
import boto3 client_dynamo = boto3.client('dynamodb') def lambda_handler(event, context): token = event['authorizationToken'] auth_info = client_dynamo.get_item(TableName='tokens', Key={'token': { 'S': token } }).get('Item') if (auth_info): print auth_info return generatePolicy('user', ev...
31
34.68
148
16
293
python
[]
0
true
2024-11-18T21:00:03.720335+00:00
1,462,141,121,000
f2e60050169bdf68b871543f04ba8c9f2c58e98d
3
{ "blob_id": "f2e60050169bdf68b871543f04ba8c9f2c58e98d", "branch_name": "refs/heads/master", "committer_date": 1462141121000, "content_id": "081045f7bd1cb85f52e5f9124dc4a81986e73e85", "detected_licenses": [ "MIT" ], "directory_id": "cf1a394ff57fe3339d8a8e7b99c1809d7f1e278b", "extension": "py", "fi...
2.6875
stackv2
#!/usr/bin/env python ''' Author: Andrew Scott Date: 4/26/2016 ''' import hashlib import os, sys, time import multiprocessing from random import shuffle import itertools import argparse # Constants ##------------------------------------------------------------------------------------------ CORE_COUNT = multiproce...
417
30.43
155
22
3,152
python
[{"finding_id": "codeql_py/clear-text-storage-sensitive-data_fe506bb247ec38b9_6e157da0", "tool_name": "codeql", "rule_id": "py/clear-text-storage-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression stores [sensitive data (password)](1) as clear text.\...
1
true
2024-11-18T21:00:04.041482+00:00
1,683,896,947,000
72614043b2bdb0f91eb54fda96aa7565f35799d5
2
{ "blob_id": "72614043b2bdb0f91eb54fda96aa7565f35799d5", "branch_name": "refs/heads/master", "committer_date": 1683896947000, "content_id": "4c5ed6a947d8a4183837ce612c7725a103426cb7", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "bbb121f18a6e4015834b28780bd434655679360e", "extension": "p...
2.46875
stackv2
import os import sys from setuptools import setup, find_packages PACKAGE_NAME = 'hamiltorch' MINIMUM_PYTHON_VERSION = 3, 5 def check_python_version(): """Exit when the Python version is too low.""" if sys.version_info < MINIMUM_PYTHON_VERSION: sys.exit("Python {}.{}+ is required.".format(*MINIMUM_PYTH...
38
37.53
140
15
362
python
[]
0
true
2024-11-18T21:00:04.164962+00:00
1,571,985,555,000
d97b025d7b660ee0c1768c8b2339694060d35309
3
{ "blob_id": "d97b025d7b660ee0c1768c8b2339694060d35309", "branch_name": "refs/heads/master", "committer_date": 1571985555000, "content_id": "7d72e52f3e63ae7fa5ced8589a39cf07eecfe11a", "detected_licenses": [ "MIT" ], "directory_id": "1837257009ceddc0e11836e3391413a1387d4f53", "extension": "py", "fi...
3.0625
stackv2
import warnings import cv2 import numpy as np import shapely.geometry as geom from matplotlib import patches as patches from skimage import measure class Point: def __init__(self, *args, dtype=int): if dtype not in [int, float]: raise ValueError('dtype must be either int or float but {} is gi...
423
28.51
119
17
3,101
python
[]
0
true
2024-11-18T21:00:04.227181+00:00
1,590,370,982,000
c5f402cba597ad39f35b39a5b1047bcf015c400a
4
{ "blob_id": "c5f402cba597ad39f35b39a5b1047bcf015c400a", "branch_name": "refs/heads/master", "committer_date": 1590370982000, "content_id": "38102e59431d0ad407cd6485ce54efd5d13db6ce", "detected_licenses": [ "MIT" ], "directory_id": "7a9a741e115acc444538429ebd10e2b2c136d0b2", "extension": "py", "fi...
3.9375
stackv2
""" 课堂练习 请你在之前代码的基础上,写出提取食材的代码,并打印出来。 不懂做?点击下面的“需要帮助”。 """ # 引用requests库 import requests # 引用BeautifulSoup库 from bs4 import BeautifulSoup # 获取数据 res_foods = requests.get('http://www.xiachufang.com/explore/') # 解析数据 bs_foods = BeautifulSoup(res_foods.text, 'html.parser') # 查找最小父级标签 list_foods = bs_foods.find_all('div'...
56
20.46
62
9
492
python
[]
0
true
2024-11-18T21:00:04.496791+00:00
1,692,696,275,000
37d9034ecb34ee7a17c8c824b712b8cc02d6f2f9
3
{ "blob_id": "37d9034ecb34ee7a17c8c824b712b8cc02d6f2f9", "branch_name": "refs/heads/main", "committer_date": 1692696275000, "content_id": "f708d071fa142d37a44bb0357c5c00e2834f8455", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "1cc43d5ed0a843289c8f6dafb6a16fab26a8eede", "extension": "py"...
2.5625
stackv2
""" Sphinx builders for output formats """ import sphinx from sphinx.builders.text import TextBuilder from . import doctree2md, doctree2py, doctree2nb SPHINX_GE_6 = sphinx.version_info[0] >= 6 class MarkdownBuilder(TextBuilder): name = 'markdown' format = 'markdown' out_suffix = '.md' writer_class...
57
28.49
79
12
405
python
[]
0
true
2024-11-18T21:00:04.627890+00:00
1,611,617,237,000
baf66cad19f5ff8cfa420ae8596f18d098723b84
4
{ "blob_id": "baf66cad19f5ff8cfa420ae8596f18d098723b84", "branch_name": "refs/heads/master", "committer_date": 1611617237000, "content_id": "8827e38f31ea366f3c0abfe00bab36e0ed2f4926", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5b3d8b5c612c802fd846de63f86b57652d33f672", "extension": "py"...
3.96875
stackv2
# Python solution for 'Find the odd int' codewars question. # Level: 6 kyu # Tags: Fundamentals. # Author: Jack Brokenshire # Date: 07/03/2020 import unittest def find_it(seq): """ Given an array, find the integer that appears an odd number of times. There will always be only one integer that appears an ...
35
31.17
116
13
432
python
[]
0
true
2024-11-18T21:00:04.681523+00:00
1,526,352,497,000
0264bc85d86c5e9b332bf659813340718898a8fb
3
{ "blob_id": "0264bc85d86c5e9b332bf659813340718898a8fb", "branch_name": "refs/heads/master", "committer_date": 1526352497000, "content_id": "0df19936f504a5cbf818915e0ee604651d1c2c30", "detected_licenses": [ "MIT" ], "directory_id": "33491b01251cd48a4c319ec1de61eb543ccc0e97", "extension": "py", "fi...
2.984375
stackv2
""" Contains functions for combining translations into a summary string """ def metar(trans: {str: object}) -> str: """ Condense the translation strings into a single report summary string """ summary = [] if 'Wind' in trans and trans['Wind']: summary.append('Winds ' + trans['Wind']) i...
49
42.63
93
18
537
python
[]
0
true
2024-11-18T21:00:04.780142+00:00
1,603,019,535,000
ac7438b9820d9180ab9dd56a83fc734983829321
3
{ "blob_id": "ac7438b9820d9180ab9dd56a83fc734983829321", "branch_name": "refs/heads/master", "committer_date": 1603019535000, "content_id": "f4a89b51855ff47c292c8c46b6436772e3da9e43", "detected_licenses": [ "MIT" ], "directory_id": "4f247138fe484ddc311d45109b38ad3706e40342", "extension": "py", "fi...
2.578125
stackv2
from PIL import Image import os import numpy as np import pandas as pd import plotly.express as px __author__ = "Sarsiz Chauhan" img_name="keanu" img_path = os.path.join(os.getcwd(), 'images/{}.jpg'.format(img_name)) # img_path = os.path.join(os.getcwd(), 'images/saz copy.jpg') im = Image.open(img_path) width, heig...
55
24.38
93
13
415
python
[]
0
true
2024-11-18T21:00:04.830415+00:00
1,614,716,218,000
d7133b527f3a75608291d6846a3d63db992c06e6
3
{ "blob_id": "d7133b527f3a75608291d6846a3d63db992c06e6", "branch_name": "refs/heads/master", "committer_date": 1614716218000, "content_id": "f46b306c721f337cf8023d78f5eb14a7c8ada125", "detected_licenses": [ "BSD-3-Clause", "Apache-2.0" ], "directory_id": "38926818c32a9ed3cbd4ff8dcbbf57f1318bb20d",...
2.890625
stackv2
import sys import os import math import numpy # usage: parse_effects dir target_std def weighted_std(values, weights_in): """ Return weighted standard deviation. values, weights -- Numpy ndarrays with the same shape. """ average = numpy.average(values, weights=weights_in) # Fast and numerically...
42
24.4
58
18
277
python
[]
0
true
2024-11-18T21:00:04.940314+00:00
1,588,919,246,000
dc4fe8b4dc05a70a14f1623922d4199990942ed1
3
{ "blob_id": "dc4fe8b4dc05a70a14f1623922d4199990942ed1", "branch_name": "refs/heads/master", "committer_date": 1588919246000, "content_id": "627eac5f9aee6fe9d957f9746b63dd0b8642862c", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9078bcd228b0d84d647c45811044974961aa170c", "extension": "py"...
3.1875
stackv2
from itertools import starmap from Position import Position from Moves import Moves from RuleEngine import RuleEngine from MoveGenerator import MoveGenerator from Board import Board class Player (object): def __init__(self, type): self.type = type self.lastMoveHasCaptured = False self.mg =...
91
38.59
108
23
719
python
[]
0
true
2024-11-18T21:00:04.986311+00:00
1,604,440,134,000
fe3d8e46108c28db367e9df22988eeaa3342be0a
3
{ "blob_id": "fe3d8e46108c28db367e9df22988eeaa3342be0a", "branch_name": "refs/heads/main", "committer_date": 1604440134000, "content_id": "87ac7d81b2ac581f8e0fde0813b2ca4ea3e16505", "detected_licenses": [ "MIT" ], "directory_id": "fcf49543e3426294a83e075e6f6f588fd1a77200", "extension": "py", "file...
3.09375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 2 10:48:17 2020 @author: elliemarfleet """ # import all necessary libraries in addition to class framework import random import operator import tkinter import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot import matplotlib.animation ...
182
21.52
115
12
1,037
python
[]
0
true
2024-11-18T21:00:05.243114+00:00
1,619,472,892,000
49cdc94d6c79acd28562f01e5a6804d55884ce7a
3
{ "blob_id": "49cdc94d6c79acd28562f01e5a6804d55884ce7a", "branch_name": "refs/heads/main", "committer_date": 1619472892000, "content_id": "0175839500dab0076b85044e6472665eec18dc75", "detected_licenses": [ "MIT" ], "directory_id": "9ea5af0d02cbb9a96f1482bf3bd86fbfe118d2c1", "extension": "py", "file...
2.75
stackv2
import numpy as np # Import the model from the auxillary folder import sys sys.path.append("aux") from Example_3_4_aux import myModel np.random.seed(1) # Constants: N = 10 Ntest = 100 H = 15 varType = "float64" # Analytical solution real = lambda x,y: np.exp(-x)*(x+y**3) # Create the training data X,Y = np.meshgr...
48
24.23
73
11
382
python
[]
0
true
2024-11-18T21:00:05.294010+00:00
1,538,675,613,000
214ce6f2f252d2128f23c406bbbdae3008b8c9ae
2
{ "blob_id": "214ce6f2f252d2128f23c406bbbdae3008b8c9ae", "branch_name": "refs/heads/master", "committer_date": 1538675613000, "content_id": "ddf283fee77e702def2e278c8f0b545a2bc21b50", "detected_licenses": [ "MIT" ], "directory_id": "7beb31c44048bee2745c6e4fa062e02a282b3439", "extension": "py", "fi...
2.359375
stackv2
"""Index page handler package.""" import os from arduinozore.handlers.crudHandler import CrudHandler from arduinozore.handlers.tools import get_arduino from arduinozore.handlers.tools import get_config_name from arduinozore.models.card import Card from arduinozore.models.device import Device from arduinozore.models.se...
109
32.58
77
15
747
python
[]
0
true
2024-11-18T21:00:05.402093+00:00
1,583,257,129,000
0645fe37ed067e2ee6e899c4c091b0b8306292d0
2
{ "blob_id": "0645fe37ed067e2ee6e899c4c091b0b8306292d0", "branch_name": "refs/heads/master", "committer_date": 1583257129000, "content_id": "2ad54241da54d559d9f6c6384e4783f84d8a2489", "detected_licenses": [ "MIT" ], "directory_id": "eef13f4b5c1f1384571411c6241f9d6ee26809de", "extension": "py", "fi...
2.3125
stackv2
from util import get_path from util import plot_confusion_matrix from util import get_categories from util import generate_current_config_to_string from util import TrainingData from simple_cnn import step_decay from sklearn.metrics import classification_report import sklearn.metrics as metrics from keras.callbacks im...
160
43.83
174
17
1,597
python
[]
0
true
2024-11-18T21:00:05.458705+00:00
1,597,732,863,000
a2a57e715642200d17e3a22ff42acd6f049df25d
2
{ "blob_id": "a2a57e715642200d17e3a22ff42acd6f049df25d", "branch_name": "refs/heads/master", "committer_date": 1597732863000, "content_id": "8da260007c7fa75ecb584e20f30a88c6dd7b4ad3", "detected_licenses": [ "MIT" ], "directory_id": "78ac7c4bcf5f8513d0b07cf411e37888f5a62d84", "extension": "py", "fi...
2.328125
stackv2
# Written by Chun Kit Wong and CIRC under MIT license: # https://github.com/wong-ck/DeepSegment/blob/master/LICENSE import os import sys import tarfile # search for utilities module under root dir DIR_ROOT = os.path.join(os.path.dirname(__file__), "..", "..", "..") DIR_ROOT = os.path.abspath(DIR_ROOT) sys.path.inser...
57
32.19
99
13
544
python
[]
0
true
2024-11-18T21:10:21.373555+00:00
1,554,736,073,000
6df155882f33e4d93f699cebeb0e3bed081056fc
4
{ "blob_id": "6df155882f33e4d93f699cebeb0e3bed081056fc", "branch_name": "refs/heads/master", "committer_date": 1554736073000, "content_id": "7ac68883cfd402dbdd0ed07127f077711dbdd5f9", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "70f5f279e051360310f95be895320d8fa6cd8d93", "extension": "p...
3.796875
stackv2
""" =========== Join styles =========== Illustrate the three different join styles. """ import numpy as np import matplotlib.pyplot as plt def plot_angle(ax, x, y, angle, style): phi = np.radians(angle) xx = [x + .5, x, x + .5*np.cos(phi)] yy = [y, y, y + .5*np.sin(phi)] ax.plot(xx, yy, lw=8, color=...
47
22.89
77
12
343
python
[]
0
true
2024-11-18T21:10:21.485006+00:00
1,610,816,902,000
13365644d1cafe15f0413c686974be1a546986e7
3
{ "blob_id": "13365644d1cafe15f0413c686974be1a546986e7", "branch_name": "refs/heads/main", "committer_date": 1610816902000, "content_id": "21a883e6f151ffb8f283b109f16a156f8ddbe2d7", "detected_licenses": [ "MIT" ], "directory_id": "23662216f2883e08fba066bc6179c441459f2203", "extension": "py", "file...
2.8125
stackv2
#!/usr/bin/env python3 from jagerml.helper import * class Loss: def rememberTrainableLayers(self, trainLayers): self.trainLayers = trainLayers def regularization(self): regularizationLoss = 0 for layer in self.trainLayers: if layer.weightL1 > 0: regulari...
165
25.73
92
18
1,137
python
[]
0
true
2024-11-18T21:10:21.548418+00:00
1,502,741,967,000
7805848769231c96e796ac5722525451213f393c
3
{ "blob_id": "7805848769231c96e796ac5722525451213f393c", "branch_name": "refs/heads/master", "committer_date": 1502741967000, "content_id": "a55276b470f799bb9815b72a687a5e2124adef24", "detected_licenses": [ "MIT" ], "directory_id": "f51307144b887adc352024aac108100c57d64950", "extension": "py", "fi...
2.609375
stackv2
#!/usr/bin/env python import argparse import cPickle import logging from fuel.server import start_server logger = logging.getLogger() def main(): parser = argparse.ArgumentParser("Starts fuel server") parser.add_argument("stream", help="The path to the pickled stream") parser.add_argument("port", type=...
27
24.52
72
11
164
python
[]
0
true
2024-11-18T21:10:21.892663+00:00
1,608,283,635,000
21f4697374df43646f645a081cfadcc81fdc6909
2
{ "blob_id": "21f4697374df43646f645a081cfadcc81fdc6909", "branch_name": "refs/heads/master", "committer_date": 1608283635000, "content_id": "414e92abef77acd0db1f09a65b357ea92f46169d", "detected_licenses": [ "MIT" ], "directory_id": "19e7940e41d15a2dbd5e99525bed531b5d05208b", "extension": "py", "fi...
2.40625
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Tue Jul 30 23:41:38 2019 @author: liudiwei """ import random import string from douban.items import Subject from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Request, Rule class BookSubjectSpider(CrawlSpider): n...
56
31.11
97
16
445
python
[]
0
true
2024-11-18T21:10:21.968891+00:00
1,556,499,582,000
03aace82ec48cb70284bdcd8ae7cdc2255642ab5
2
{ "blob_id": "03aace82ec48cb70284bdcd8ae7cdc2255642ab5", "branch_name": "refs/heads/master", "committer_date": 1556499582000, "content_id": "5945815b9c39ada244a7922548f9eff58fc68092", "detected_licenses": [ "MIT" ], "directory_id": "e5a12a65d7026b5dbad8c7fdeb2a1c41cf30c843", "extension": "py", "fi...
2.421875
stackv2
#!/usr/bin/python3 import os import time import threading import read_data from sys import argv from timer import preprocessing_timer, preprocessing_records from multiprocessing import Process, Pool, TimeoutError from threading import Thread """ REQUIREMENTS: Command line tools: vcf2bed (convert2bed sort-bed) bed...
356
27.49
146
20
2,928
python
[]
0
true
2024-11-18T21:10:22.041079+00:00
1,648,657,817,000
f46e09a2a6a089d023245b23ade7e8462f42fded
3
{ "blob_id": "f46e09a2a6a089d023245b23ade7e8462f42fded", "branch_name": "refs/heads/master", "committer_date": 1648657817000, "content_id": "8a27954b8d4490061b5e152ccca91885312f9d07", "detected_licenses": [ "MIT" ], "directory_id": "86e292a80731c6824fa410df41761db6a07939ca", "extension": "py", "fi...
2.625
stackv2
#!/usr/bin/env python import re from operator import itemgetter from EPPs.common import GenerateHamiltonInputEPP, InvalidStepError class GenerateHamiltonInputQPCR(GenerateHamiltonInputEPP): """"Generate a CSV containing the necessary information to for the Make QPCR 1 to 24 samples Hamilton method""" _use_l...
166
46.91
134
22
1,756
python
[]
0
true
2024-11-18T21:10:23.403616+00:00
1,621,338,186,000
25d81cc6a9d393748eebfcd24a4b1b5d29571fa9
2
{ "blob_id": "25d81cc6a9d393748eebfcd24a4b1b5d29571fa9", "branch_name": "refs/heads/master", "committer_date": 1621338186000, "content_id": "bfbe12e053cf44365f5d04a7699329307b4a54d7", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "1e3dbdd5201937bd29dcc1897b5999df8a3adde7", "extension": "p...
2.453125
stackv2
import numpy as np from skmultiflow.transform.base_transform import StreamTransform # from skmultiflow.trees.nodes.active_learning_node_perceptron import compute_sd from skmultiflow.utils.utils import get_dimensions def compute_sd(sum_of_squares: float, sum_of_values: float, samples_seen: float): variance = 0.0 ...
115
38.33
124
19
1,057
python
[]
0
true
2024-11-18T21:10:23.449478+00:00
1,585,593,171,000
e53c51b67cc8a6a9a50cb50b40ea428134ec54f8
3
{ "blob_id": "e53c51b67cc8a6a9a50cb50b40ea428134ec54f8", "branch_name": "refs/heads/master", "committer_date": 1585593171000, "content_id": "36fcc5d6d6c0dd3b622fc6da5ded6e2c1ea3d6d4", "detected_licenses": [ "MIT" ], "directory_id": "e6be223fc7354ba576ae2ad839e2c9426940a62e", "extension": "py", "fi...
2.859375
stackv2
""" Implement commands that interact with AWS Data Pipeline """ import fnmatch import logging from operator import attrgetter from typing import List import boto3 import funcy import etl.text from etl.text import join_with_quotes logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) class ...
112
33.88
119
17
800
python
[]
0
true
2024-11-18T21:10:23.515694+00:00
1,585,585,694,000
94db90621b7ecb3965c3c30129a7a0a1e5f76cf0
2
{ "blob_id": "94db90621b7ecb3965c3c30129a7a0a1e5f76cf0", "branch_name": "refs/heads/master", "committer_date": 1585585694000, "content_id": "3fb84309727cab33fdfeace20d4ed55c5cc7f0d4", "detected_licenses": [ "BSD-2-Clause", "BSD-2-Clause-Views" ], "directory_id": "a4f6ca0e54c42d47438d9117a7677fdfed...
2.5
stackv2
import checking_functions as check sensorSpecs = {"name": check.sensor_is_already_present, "description": check.field_is_void} thingSpecs = {"name": check.thing_is_already_present} observedPropertySpecs = {"name": check.observed_property_is_already_present} dataStreamSpecs = {"name": check.data_stream_is_already_prese...
29
37.1
91
8
266
python
[]
0
true
2024-11-18T21:10:23.572338+00:00
1,693,250,306,000
1cf84bd882107708628e8272e4f133dcb51d3590
3
{ "blob_id": "1cf84bd882107708628e8272e4f133dcb51d3590", "branch_name": "refs/heads/master", "committer_date": 1693250306000, "content_id": "837aa87ec12f8e33dd5cf0d6dc3252844cd1785c", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "759b671e6b37617a2782f991d233d262e6a794ad", "extension": "p...
2.625
stackv2
"""Helper functions for quick command line interfaces with skorch and fire. """ from functools import partial from importlib import import_module from itertools import chain import re import shlex import sys from sklearn.base import BaseEstimator from sklearn.pipeline import FeatureUnion from sklearn.pipeline import...
356
27.06
106
14
2,495
python
[]
0
true
2024-11-18T21:10:23.829963+00:00
1,612,793,916,000
077e1841e57dcbd409eb055addb8d8456d4425f7
3
{ "blob_id": "077e1841e57dcbd409eb055addb8d8456d4425f7", "branch_name": "refs/heads/main", "committer_date": 1612793916000, "content_id": "be67267eee071bd299ef785f1c64824018326b14", "detected_licenses": [ "MIT" ], "directory_id": "6ebac72a9a90bf2c1db6eab2e8006028e19bced7", "extension": "py", "file...
2.8125
stackv2
# autotransplate.py # pip install googletrans==3.1.0a0 from googletrans import Translator, LANGUAGES # print(LANGUAGES) #เอาไว้ดูวาภาษทาที่ต้องการแปลย่อว่ายังไง from openpyxl import Workbook from datetime import datetime translator = Translator() # result = translator.translate('แมว') # print(result.text) article =...
39
23.56
69
10
280
python
[]
0
true
2024-11-18T21:10:23.960932+00:00
1,454,396,664,000
da27c098ced183fbd34ed54df9c60a57767ab5a1
3
{ "blob_id": "da27c098ced183fbd34ed54df9c60a57767ab5a1", "branch_name": "refs/heads/master", "committer_date": 1454396664000, "content_id": "e75cd9b37b71e4766ec10d7a1f10d999fff34f62", "detected_licenses": [ "MIT" ], "directory_id": "16f100da7ff8b105575e263929f922c4a771445b", "extension": "py", "fi...
2.8125
stackv2
import mwclient as mw import unicodecsv as csv import json import mwparserfromhell as parser import re from impl_languages_deduplication import get_standardized_lang import redis site = mw.Site('rosettacode.org', path='/mw/') search_pattern = re.compile(r"([\s\S]*?)<lang (\w+)>([\s\S]+?)<\/lang>") trim_pattern = re.co...
139
38.38
80
20
1,156
python
[]
0
true
2024-11-18T21:10:24.162744+00:00
1,530,663,302,000
d92d5d0b054f75d10ef22cd72a3bebb35f2d3ed6
3
{ "blob_id": "d92d5d0b054f75d10ef22cd72a3bebb35f2d3ed6", "branch_name": "refs/heads/master", "committer_date": 1530663302000, "content_id": "514fd70d8f1745ac1bd2e865d6a04ae824cf3115", "detected_licenses": [ "MIT" ], "directory_id": "4464ce90fc28a5f3eeb8fce31c987ed7b51b49c2", "extension": "py", "fi...
2.875
stackv2
import csv import urllib.parse import discord import requests from discord.ext import commands class Runescape: def __init__(self, bot: commands.Bot) -> None: self.bot = bot @commands.command(aliases=["rs3"], pass_context=True) async def rs(self, ctx: commands.Context, *username): """ ...
160
32.99
74
21
1,713
python
[]
0
true
2024-11-18T21:10:24.218133+00:00
1,611,076,890,000
301220755cd0aea029b9127f65904f341a5a32bc
3
{ "blob_id": "301220755cd0aea029b9127f65904f341a5a32bc", "branch_name": "refs/heads/master", "committer_date": 1611076890000, "content_id": "fd5d677357e380d278e4425ed80b468ba0567c78", "detected_licenses": [ "MIT" ], "directory_id": "19d7629643cc10d75fad146ca90112de26311646", "extension": "py", "fi...
2.734375
stackv2
""" EvenVizion library. https://github.com/RnD-Oxagile/EvenVizion Supporting paper at: https://github.com/AIHunters/EvenVizion/blob/master/EvenVizion-video_based_camera_localization_component.pdf This is licensed under an MIT license. See the README.md file for more information. This is an example of getting homogra...
149
45.3
108
16
1,359
python
[]
0
true
2024-11-18T21:10:24.328654+00:00
1,580,257,091,000
6db7b306503bc5bd2b6f72abc2f8bf4f530a8c7b
4
{ "blob_id": "6db7b306503bc5bd2b6f72abc2f8bf4f530a8c7b", "branch_name": "refs/heads/master", "committer_date": 1580257091000, "content_id": "71f699b1b0df20ad6a7b9a3d28976f9e8034bcda", "detected_licenses": [ "MIT" ], "directory_id": "ca32a4673ed45d28e05c822f31cb9ba1d520cf27", "extension": "py", "fi...
3.6875
stackv2
''' Financial Modeling Prep is a new concept that informs you about stock markets information (news, currencies and stock prices). This organization runs a free api that we will read data in from ''' from urllib.request import urlopen import json from pandas import DataFrame def get_jsonparsed_data(ticker): """ ...
47
22.64
126
10
260
python
[]
0
true
2024-11-18T21:10:24.481713+00:00
1,435,473,076,000
8fc799821fe23b639a0dcfcaf01815834f2b96f4
2
{ "blob_id": "8fc799821fe23b639a0dcfcaf01815834f2b96f4", "branch_name": "refs/heads/master", "committer_date": 1435473076000, "content_id": "f66f9b03bd69293505852d318b53cd4a0efbcab4", "detected_licenses": [ "MIT" ], "directory_id": "a6a8aca7908f1951615b24b2518ac56cc0e2880c", "extension": "py", "fi...
2.328125
stackv2
from flask import request, abort from flask.ext.restful import Resource, reqparse from model.news import News from util.serialize import news_serialize, news_list_serialize from util import cache from util.adminAuth import auth_required import boto from PIL import Image from StringIO import StringIO import os newsPar...
193
26.03
79
19
1,189
python
[]
0
true
2024-11-18T21:10:25.830528+00:00
1,583,378,293,000
8796f905d40a37ec9aa35e7d106c6c27c640b258
4
{ "blob_id": "8796f905d40a37ec9aa35e7d106c6c27c640b258", "branch_name": "refs/heads/master", "committer_date": 1583378293000, "content_id": "7502e8cca037996e9df6599da4a1468ecfeb62d6", "detected_licenses": [ "MIT" ], "directory_id": "51bb1a87d9496d9ce94aec7fe2d69d26da6db687", "extension": "py", "fi...
4.3125
stackv2
''' file_explorer.py Matthew Grunauer 3/4/2020 A program that reads and writes to text files ''' # Function allows for writing and appending to files def file_writer(filename, mode): userinp = "" print("Welcome to the file writer. Type 'close_file' when finished") try: with open(filename + ".txt", ...
73
37.23
85
18
633
python
[]
0
true
2024-11-18T21:10:25.879343+00:00
1,693,217,472,000
ab4a50cb4632d668a63f3415ef486bc74e091e48
3
{ "blob_id": "ab4a50cb4632d668a63f3415ef486bc74e091e48", "branch_name": "refs/heads/master", "committer_date": 1693217472000, "content_id": "029b7d157f2bbe43b3d930ab329c0de773c6d095", "detected_licenses": [ "MIT" ], "directory_id": "10ddfb2d43a8ec5d47ce35dc0b8acf4fd58dea94", "extension": "py", "fi...
3.359375
stackv2
# Time: O(logn) # Space: O(1) class Solution(object): def baseNeg2(self, N): """ :type N: int :rtype: str """ result = [] while N: result.append(str(-N & 1)) # N % -2 N = -(N >> 1) # N //= -2 result.reverse() return "".join(...
35
20.91
49
15
213
python
[]
0
true
2024-11-18T21:10:26.123653+00:00
1,567,521,172,000
444eb677bad4a2d8a3c3cac9ca37ba40d15904d7
3
{ "blob_id": "444eb677bad4a2d8a3c3cac9ca37ba40d15904d7", "branch_name": "refs/heads/master", "committer_date": 1567521172000, "content_id": "45861879f9cb575d0efe76cabc5da22065786970", "detected_licenses": [ "MIT" ], "directory_id": "0e34b549d569949263cc827e693e27969b68e893", "extension": "py", "fi...
2.703125
stackv2
#!/usr/bin/env python3 #title :stathelper.py #description :helper functions for hypothesis testing #author :Junjie Zhu #date :20180408 #version :0.1 #usage : #notes : #python_version :3.6.0 #==================================================================...
262
39.87
92
19
2,543
python
[]
0
true
2024-11-18T21:10:26.531646+00:00
1,564,380,712,000
dc32b8e759848260d896c814e4d2e7cd19079322
3
{ "blob_id": "dc32b8e759848260d896c814e4d2e7cd19079322", "branch_name": "refs/heads/master", "committer_date": 1564380712000, "content_id": "8632701ba50afa092145f9e99db5f69e038499b9", "detected_licenses": [ "MIT" ], "directory_id": "42ec7724362f766ba4b99c8413a746040ccd39a6", "extension": "py", "fi...
2.609375
stackv2
import argparse import random from datetime import timedelta from operator import getitem from os import listdir, makedirs, remove from os.path import join, exists, getsize import h5py import librosa import numpy as np import pandas as pd import soundfile as sf from python_speech_features import mfcc from scipy.io imp...
291
46.16
119
18
3,295
python
[]
0
true
2024-11-18T21:10:27.093226+00:00
1,647,373,466,000
3304511311797d9d31e32e8767ddfcf7c573ff4c
3
{ "blob_id": "3304511311797d9d31e32e8767ddfcf7c573ff4c", "branch_name": "refs/heads/master", "committer_date": 1647373466000, "content_id": "ea07b6467e4dcea746d8db117a9e474339031c23", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "f8491be7d1085039925d4672b52cc4cb4ec467db", "extension": "p...
2.703125
stackv2
from rest_framework import serializers from .models import Creditcard # Min and Max number of digits for a credit card CC_DIGITS_MIN = 15 CC_DIGITS_MAX = 19 class CreditcardSerializer(serializers.ModelSerializer): """Serializer to map the Model instance into JSON format.""" email = serializers.ReadOnlyField...
37
34.95
74
12
272
python
[]
0
true
2024-11-18T21:10:27.217313+00:00
1,616,373,464,000
12deeec34394a7f977a459a69f4e0c72c01958fb
3
{ "blob_id": "12deeec34394a7f977a459a69f4e0c72c01958fb", "branch_name": "refs/heads/master", "committer_date": 1616373464000, "content_id": "89dcb7f3791aafa99e1fc3a6af67cf0beea406f9", "detected_licenses": [ "MIT" ], "directory_id": "dbb320f62c06433b2ca92ee3dd51a6bde8527143", "extension": "py", "fi...
3.3125
stackv2
from functools import lru_cache from itertools import groupby def candyCrush1D(S): stack = [] for x in S: if not stack: stack.append((x, 1)) elif stack[-1][0] == x: stack.append((x, stack[-1][1]+1)) elif stack[-1][1] >= 3: temp = st...
110
25.46
72
19
782
python
[]
0
true
2024-11-18T21:10:27.512413+00:00
1,366,139,364,000
fceb411a71a9e59b0ea89b5ea0178e78fc0b1e44
2
{ "blob_id": "fceb411a71a9e59b0ea89b5ea0178e78fc0b1e44", "branch_name": "refs/heads/master", "committer_date": 1366139364000, "content_id": "973e36c99b1398e16659e85a864d8d19fa0b7c9e", "detected_licenses": [ "BSD-2-Clause-Views" ], "directory_id": "d3e2439c132d1c9d57f8a4fe853c39744580a2d1", "extensio...
2.453125
stackv2
# encoding: utf-8 from datetime import datetime from django.utils.encoding import force_unicode from django.db import models from django.db.models.aggregates import Max import inspect def get_table_for_field(model, field_name): for field in model._meta.fields: if field_name == field.attname: ...
87
43.44
130
19
834
python
[]
0
true
2024-11-18T21:10:27.685956+00:00
1,597,062,632,000
ebedbdd7e57867b8df6441b5f8be4e14fbb011bf
3
{ "blob_id": "ebedbdd7e57867b8df6441b5f8be4e14fbb011bf", "branch_name": "refs/heads/master", "committer_date": 1597062632000, "content_id": "69eca3621e6da9241143db57031d263dea94ead0", "detected_licenses": [ "MIT" ], "directory_id": "1e0718a10abf5772f9ea7ea93386c25a69999015", "extension": "py", "fi...
2.65625
stackv2
import tensorflow as tf import tensorflow.keras.backend as K import tensorflow_probability as tfp import numpy as np def scaled_rmse_metric(scale=1.0, axis=0): @tf.function def scaled_rmse(y_true, y_pred): return K.sqrt(K.mean(K.square((y_true - y_pred)*scale), axis=axis)) return scaled_rmse def s...
235
51.37
121
23
3,469
python
[]
0
true
2024-11-18T21:10:27.820210+00:00
1,445,934,001,000
7496fcf669e8b8bcc7e0a104727748c18f5da0d8
2
{ "blob_id": "7496fcf669e8b8bcc7e0a104727748c18f5da0d8", "branch_name": "refs/heads/master", "committer_date": 1445934001000, "content_id": "dd0f1e6dfa73a310f4d27e7da1f709ad970c9d3e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2d821acbcef35b8c23379847ae42521aacc3d4d3", "extension": "py"...
2.34375
stackv2
import tornado.web from tornado.escape import json_encode class BaseHandler(tornado.web.RequestHandler): def get_current_user(self): user = self.get_secure_cookie("authed_user") return user or None def _api_out(self, ok, data=None, msg=None): return self.write(json_encode(dict(ok=ok...
21
24
71
14
124
python
[]
0
true
2024-11-18T21:10:28.057453+00:00
1,616,945,586,000
6516dc79d6fef9bba9472ea53b203da02d72068d
3
{ "blob_id": "6516dc79d6fef9bba9472ea53b203da02d72068d", "branch_name": "refs/heads/main", "committer_date": 1616945586000, "content_id": "7203e759646b2de5bfeaef810bfa92d0b139c012", "detected_licenses": [ "MIT" ], "directory_id": "5af7205e7b82d17b4a4b405aa0a5c814136cc008", "extension": "py", "file...
3.046875
stackv2
from typing import Any, NoReturn from http_status_constants import HttpStatusCode class ApiError(Exception): """ Exception class for managed errors """ def __init__(self, error: Any, msg=None, http_status_code=HttpStatusCode.HTTP_STATUS_BAD_REQUEST) -> NoReturn: if msg is None: # default useful err...
18
31.39
114
12
129
python
[]
0
true