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-18T21:59:12.736414+00:00
1,693,406,835,000
2fc3f6205a0a52ecbe6945188d2ea8a70c12dda4
3
{ "blob_id": "2fc3f6205a0a52ecbe6945188d2ea8a70c12dda4", "branch_name": "refs/heads/main", "committer_date": 1693406835000, "content_id": "c5719878b495e31927037d1317eb283f091da1ef", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "b24457559eff579d6e2f5723d188c894cae4029a", "extension": "py"...
2.59375
stackv2
""" Helper functions ---------------- """ from __future__ import annotations import typing as t from typing import cast, overload import sqlalchemy as sa from sqlalchemy import inspect from sqlalchemy.ext.compiler import compiles from sqlalchemy.orm import DeclarativeBase from .model import relationship __all__ = ...
354
33.36
88
19
2,636
python
[]
0
true
2024-11-18T21:59:12.912634+00:00
1,606,495,999,000
7925364d4e54c371a09c0ca2b70c58911e88248b
4
{ "blob_id": "7925364d4e54c371a09c0ca2b70c58911e88248b", "branch_name": "refs/heads/main", "committer_date": 1606495999000, "content_id": "540f074f0194105eb1c77305fd7cce9d193cf17f", "detected_licenses": [ "MIT" ], "directory_id": "cec8abc545d03b5150976e9803a9aaea58fa55e1", "extension": "py", "file...
3.5625
stackv2
# First of all we initialize an object using an image. From here the image is converted to an HSV Image # # findSkin() is a function that by calling 2 other functions, it returns the final mask containing the skin. # First we call the color segmentation that will segment the HSV picture in a mask. # Then the region seg...
77
44.04
159
12
816
python
[]
0
true
2024-11-18T21:59:13.123072+00:00
1,571,154,219,000
79e860f3e371cbd5cecf8151c7cbb5e366d0e483
3
{ "blob_id": "79e860f3e371cbd5cecf8151c7cbb5e366d0e483", "branch_name": "refs/heads/master", "committer_date": 1571154219000, "content_id": "f5c6de90d0a61d125bb0e23488f4d3b11e6aba3c", "detected_licenses": [ "MIT" ], "directory_id": "421e00dcc509ca5cf0a3d221de6e9c5dc21e2f8d", "extension": "py", "fi...
2.890625
stackv2
#! /usr/bin/python3 import json import argparse import sys import string import collections ALPHABET_SIZE = len(string.ascii_lowercase) SHIFT_STRING = string.ascii_lowercase + string.ascii_lowercase + string.ascii_uppercase + string.ascii_uppercase letter_index_without_register = {} letter_index_with_register = {} d...
177
33.88
112
16
1,380
python
[]
0
true
2024-11-18T21:59:13.509271+00:00
1,579,555,575,000
15fa7eafab2529c2557c3531aac2e3e408cb816c
3
{ "blob_id": "15fa7eafab2529c2557c3531aac2e3e408cb816c", "branch_name": "refs/heads/master", "committer_date": 1579852878000, "content_id": "4291412ec39b3977a46971494dbf9f8a3b9b5905", "detected_licenses": [ "MIT" ], "directory_id": "4fcd2998ed38f37c549807c60298650bc7fbcc7d", "extension": "py", "fi...
2.921875
stackv2
import torch as tr def sdf_plane(point: tr.Tensor): """ Distance to plane whose normal is x-axis """ return point[..., 0] def sdf_sphere(point: tr.Tensor, radius: tr.Tensor): """ Distance to sphere """ return tr.norm(point, dim=-1) - radius def sdf_box(point: tr.Tensor, box: tr.Tensor): """ Di...
46
27.11
73
13
350
python
[]
0
true
2024-11-18T21:59:13.566977+00:00
1,472,745,124,000
33d5d345550800ff3de0abe0908632474d1ae7c7
3
{ "blob_id": "33d5d345550800ff3de0abe0908632474d1ae7c7", "branch_name": "refs/heads/master", "committer_date": 1472745124000, "content_id": "a4f91ea51b839b296fed673f80f15f42a213cb36", "detected_licenses": [ "MIT" ], "directory_id": "0f8d044d3011375cb0f2de271cd9538d4fb544c6", "extension": "py", "fi...
2.890625
stackv2
#!/usr/bin/env python # coding:utf-8 ''' The script is aims for formatting the srt files. ''' __author__ = 'sherry' __date__ = '27 Aug 2016' # from os import listdir # from os.path import isfile, join # import pysrt # import re import glob # 预定义文件夹地址 _filespath = "/Users/sherry/Downloads/Lesson1Subtitles/*" def _ge...
51
24.82
58
18
373
python
[]
0
true
2024-11-18T21:59:13.879119+00:00
1,449,011,253,000
584c8260b3addf8e742003a8957a6c2c03dea12c
3
{ "blob_id": "584c8260b3addf8e742003a8957a6c2c03dea12c", "branch_name": "refs/heads/master", "committer_date": 1449011253000, "content_id": "f1f1242752ef7e38c5913751c605d842b5d69827", "detected_licenses": [ "MIT" ], "directory_id": "c4932e8f15d1818fda385a3d750b8a491a49d1bd", "extension": "py", "fi...
3.46875
stackv2
import networkx as nx class ConceptHistory: #history keeps a cpoy of the graph as reference for what's been presented so far def __init__(self, callback): self._historyGraph = nx.DiGraph() self._historyRecord = [] self._callback = callback def _addToHistory(self, user, action, node...
83
40.23
85
19
807
python
[]
0
true
2024-11-18T21:59:14.177950+00:00
1,586,800,582,000
4c44f7ab0c6583bdb160be8c4a01f7224f387792
3
{ "blob_id": "4c44f7ab0c6583bdb160be8c4a01f7224f387792", "branch_name": "refs/heads/master", "committer_date": 1586800582000, "content_id": "078d808fbab8c710a7ae028b8fa6091d27e10480", "detected_licenses": [ "MIT" ], "directory_id": "a7d14c76d68901da8f197eee934a420333592796", "extension": "py", "fi...
3.171875
stackv2
import logging import functools def create_log_decorator(): """ Creates a logging object and returns it """ logger = logging.getLogger("relia-logger") logger.setLevel(logging.DEBUG) # create the logging file handler fh = logging.FileHandler("diagnostic.log") fmt = '%(asctime)s - %(name...
43
26.7
83
15
253
python
[]
0
true
2024-11-18T21:59:14.382639+00:00
1,689,331,205,000
43280b8aed175c5487c18bc180d6c22f38133b66
3
{ "blob_id": "43280b8aed175c5487c18bc180d6c22f38133b66", "branch_name": "refs/heads/master", "committer_date": 1689331205000, "content_id": "8a9c08bc4fe5df6b445ca70720deb404bfb1d825", "detected_licenses": [ "MIT" ], "directory_id": "a655b14c035657d6916ab4d557e8adaebd77055d", "extension": "py", "fi...
2.640625
stackv2
from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from plyer import flash Builder.load_string(''' <FlashInterface>: Button: text: "Turn On" on_release: root.turn_on() Button: text: "Turn off" on_release: root.turn_off() Button:...
46
15.15
40
9
173
python
[]
0
true
2024-11-18T21:59:14.583211+00:00
1,602,160,645,000
246a05544d65a5c8b00a4ac786e66f355febb4a4
2
{ "blob_id": "246a05544d65a5c8b00a4ac786e66f355febb4a4", "branch_name": "refs/heads/master", "committer_date": 1602160645000, "content_id": "4c584c0bd19e4ab7a67be041e0efd7d92b9ca1b3", "detected_licenses": [ "MIT" ], "directory_id": "5261a40658ddb6e38917b57a8f85686337647335", "extension": "py", "fi...
2.3125
stackv2
# -*- coding: utf-8 -*- """ HISTORY: Created on Fri May 22 23:39:22 2020 Project: Vortex GUI Author: DIVE-LINK (www.dive-link.net), dive-link@mail.ru Shustov Aleksey (SemperAnte), semte@semte.ru TODO: [x] switch widget [x] ip address validator [x] emulation file dialog [x] waiting for co...
240
34.8
111
17
1,924
python
[]
0
true
2024-11-18T21:59:14.663948+00:00
1,678,801,789,000
c9a5e22a21b7eb3703ec680a335583f49a68f6e8
2
{ "blob_id": "c9a5e22a21b7eb3703ec680a335583f49a68f6e8", "branch_name": "refs/heads/master", "committer_date": 1678801789000, "content_id": "79acfbaa1de79b1ac5cc88655ee2ce0fac667b7c", "detected_licenses": [ "MIT" ], "directory_id": "184b40438287d124117dcd48cf9abdab71e116c7", "extension": "py", "fi...
2.5
stackv2
import argparse import nox nox.options.sessions = ["tests-3.11"] @nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11"]) def tests(session): session.install(".[test]") command = ["pytest", "tests"] + list(session.posargs) session.run(*command) @nox.session def lint(session): session.install(".[d...
65
29.17
103
12
511
python
[]
0
true
2024-11-18T21:59:14.720816+00:00
1,560,979,431,000
3694ee321ff0dade1bff7f03605e6a82ca83a9fd
3
{ "blob_id": "3694ee321ff0dade1bff7f03605e6a82ca83a9fd", "branch_name": "refs/heads/master", "committer_date": 1560979431000, "content_id": "ff1db638d0338c60d1372f1e5fd7bb41a3882715", "detected_licenses": [ "MIT" ], "directory_id": "9661ca39879ccb98fd32a2666a28e2e1a610ca2d", "extension": "py", "fi...
3.046875
stackv2
#!/usr/bin/python """ These two functions can be used with the json module for python as an object hook to prevent unicode encoding of strings. Simply pass the Decode_Dict function like so << a = json.load( file , object_hook = Decode_Dict ) >> This will preserve all values but convert strings to ascii...
51
42.75
73
13
503
python
[]
0
true
2024-11-18T21:59:14.777149+00:00
1,443,464,880,000
98764aaec014c29035556373d3cfe1b809d288b2
2
{ "blob_id": "98764aaec014c29035556373d3cfe1b809d288b2", "branch_name": "refs/heads/master", "committer_date": 1443464880000, "content_id": "780913ca3852c3df1bc3a9f9e690200ead40e84c", "detected_licenses": [ "MIT" ], "directory_id": "116f2da1306fb65fbbeae572c9a9300536d9e919", "extension": "py", "fi...
2.328125
stackv2
# -*- coding: utf-8 -*- """ Created on Fri Jul 24 15:50:53 2015 @author: Niklas Bendixen """ # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/topics/items.html from scrapy.item import Item, Field # http://doc.scrapy.org/en/1.0/topics/items.html from scrapy.loader....
29
33.76
143
14
262
python
[]
0
true
2024-11-18T21:59:14.825659+00:00
1,570,808,672,000
46eb87b4b67a6cb993a6dad3d1eb92fe795d30f2
3
{ "blob_id": "46eb87b4b67a6cb993a6dad3d1eb92fe795d30f2", "branch_name": "refs/heads/master", "committer_date": 1570808672000, "content_id": "8275f0bcd861c6babf36999b04fb70a0a858a321", "detected_licenses": [ "MIT" ], "directory_id": "295e30c065b6a27fb2ab3a676577f81ff7d6a71e", "extension": "py", "fi...
2.734375
stackv2
"""Track class.""" import logging import trio from ._streamer import Streamer from ._transport import Transport LOG = logging.getLogger(__name__) class Track(trio.abc.AsyncResource, Streamer): """Something that can produce a stream.""" def __init__(self, func): """Store a function for later use.""...
51
29.39
76
14
358
python
[]
0
true
2024-11-18T21:59:15.132899+00:00
1,689,433,753,000
396eaeace6c7022357e6e014ffe3947b8fc36954
3
{ "blob_id": "396eaeace6c7022357e6e014ffe3947b8fc36954", "branch_name": "refs/heads/master", "committer_date": 1689433753000, "content_id": "8f5887bb542b1dcaa493fe67d463b2650eac8b93", "detected_licenses": [ "MIT" ], "directory_id": "b742c51d6a2bca6c370bfe28384e0b394b76b76c", "extension": "py", "fi...
2.609375
stackv2
"""Ability and ability type class definitions.""" from typing import Optional from ..base import Cached from ..census import Query from ..models import AbilityData, AbilityTypeData, ResourceTypeData from .._proxy import InstanceProxy __all__ = [ 'Ability', 'AbilityData', 'AbilityType', 'ResourceType'...
330
27.51
72
13
2,269
python
[]
0
true
2024-11-18T21:59:15.376281+00:00
1,541,842,511,000
999790a29b22edd46b2eca050f5030c813c657e6
3
{ "blob_id": "999790a29b22edd46b2eca050f5030c813c657e6", "branch_name": "refs/heads/master", "committer_date": 1541842511000, "content_id": "aadd69b7dad66ae86911131462d5d8dfbf895994", "detected_licenses": [ "MIT" ], "directory_id": "17e0f88e6ad20dcb8a1ee57fa4fd02626cfbac84", "extension": "py", "fi...
2.953125
stackv2
class OpenpyxlTemplateException(Exception): pass class CellException(OpenpyxlTemplateException): pass class RowException(OpenpyxlTemplateException): pass class CellExceptions(RowException): def __init__(self, cell_exceptions): self.cell_exceptions = cell_exceptions super().__init__...
29
22.86
94
16
154
python
[]
0
true
2024-11-18T21:59:15.628290+00:00
1,688,116,043,000
ca1e58139f60bdec2d71ad42227d64af61a5a581
3
{ "blob_id": "ca1e58139f60bdec2d71ad42227d64af61a5a581", "branch_name": "refs/heads/master", "committer_date": 1688116043000, "content_id": "9aa288bcfbb3b089ab50415105dd6095863feaca", "detected_licenses": [ "Apache-2.0" ], "directory_id": "580a43c9bc8cc5cd5db745155e0721b5ba1664f6", "extension": "py"...
2.53125
stackv2
# # Copyright 2021 Jaroslav Chmurny # # This file is part of AWS Sandbox. # # AWS Sandbox is free software developed for educational purposes. It # is 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...
94
35.41
107
12
782
python
[]
0
true
2024-11-18T21:59:15.941345+00:00
1,554,818,026,000
61a3fb11228054672ca166027fea142a18634028
2
{ "blob_id": "61a3fb11228054672ca166027fea142a18634028", "branch_name": "refs/heads/master", "committer_date": 1554818026000, "content_id": "51f8dd247aeec81f5a7cff45a2b8dd047f2308b8", "detected_licenses": [ "MIT" ], "directory_id": "cd656f5760c31f825f1f718544f7180c16118d90", "extension": "py", "fi...
2.453125
stackv2
#!/usr/bin/env python3 """ Release the code to the given directory as a binary package and a debian package. The architecture is assumed to be AMD64 (i.e. Linux x64). If you want to release the code for a different architecture, then please do that manually. """ import argparse import os import pathlib import shutil ...
128
32.3
119
15
1,061
python
[]
0
true
2024-11-18T21:59:16.044447+00:00
1,445,712,077,000
57688344e770d3ca6fed0a2b427bfb991cca8e54
2
{ "blob_id": "57688344e770d3ca6fed0a2b427bfb991cca8e54", "branch_name": "refs/heads/master", "committer_date": 1445712077000, "content_id": "d72fa9e370f6f8ce82e5e365ef13d9f38f0dc538", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "b40162533f0e2f467ed975ba2aa1a221bac0b0b1", "extension": "p...
2.40625
stackv2
from flask import Flask,request,Response,json from flask.ext.cors import CORS from spacy.en import English from scipy.stats import norm import math import scipy pipeline = English() app = Flask(__name__) CORS(app) @app.route("/", methods=['POST']) def hello(): tokens = pipeline(request.form['line']) headAndTok...
32
28.16
100
13
243
python
[{"finding_id": "codeql_py/flask-debug_82dc9f97cdc94423_d7cfa621", "tool_name": "codeql", "rule_id": "py/flask-debug", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger.", ...
1
true
2024-11-18T21:59:16.619746+00:00
1,612,959,562,000
bfbe2b8b17daac8847d77f48f92632ea8b90b9c4
3
{ "blob_id": "bfbe2b8b17daac8847d77f48f92632ea8b90b9c4", "branch_name": "refs/heads/master", "committer_date": 1612959562000, "content_id": "3f8f59cef6c30798d4c23c80f994fbe0d0e43426", "detected_licenses": [ "Apache-2.0" ], "directory_id": "ec7724453207548809e828aa213fd6b3adb9014c", "extension": "py"...
2.53125
stackv2
import json from qgis.PyQt.QtCore import QVariant # Coloque o caminho do arquivo JSON Para leitura json_path = 'D:\\Desenvolvimento\\modelagens\\edgv_300\\master_file_300_shp.json' # Coloque a pasta onde deseja que os arquivos shp sejam salvos. folder_to_save = 'D:\\Desenvolvimento\\modelagens\\edgv_300\\shp300\\' c...
83
36.14
103
23
934
python
[]
0
true
2024-11-18T21:59:16.813053+00:00
1,551,520,888,000
0634af8e30e6cb29f4a7721b38d7be5f23348bc5
4
{ "blob_id": "0634af8e30e6cb29f4a7721b38d7be5f23348bc5", "branch_name": "refs/heads/master", "committer_date": 1551520888000, "content_id": "dfcc03460a8d1dad010a49a2c0f6093e940a2558", "detected_licenses": [ "MIT" ], "directory_id": "4c8ecf39e363316d121c1031efcad89d750a0ddc", "extension": "py", "fi...
3.90625
stackv2
def recursive_division(numberator, denominator): # divide by denominator x = numberator//denominator # while divisible by denominator while not x % denominator: x //= denominator return x def is_recurring_decimal(n): if n < 1: raise ValueError('{n} must be greate...
84
22.56
92
16
477
python
[]
0
true
2024-11-18T21:59:17.194182+00:00
1,674,141,770,000
d0b0e62e2df502d0c3b60ed1082aa0cca18f0ef6
3
{ "blob_id": "d0b0e62e2df502d0c3b60ed1082aa0cca18f0ef6", "branch_name": "refs/heads/main", "committer_date": 1674141770000, "content_id": "3203817d1580aa63aebd07644760593cbce2e6d1", "detected_licenses": [ "MIT" ], "directory_id": "159c51fb1bffd7af22fb1d70d2949bf92b13cd17", "extension": "py", "file...
2.671875
stackv2
from .base import HQBase class SettingsApi(HQBase): """ Set of functions to access and modify Global Notice. """ _apiprefix = "/api/v1/settings" def get_globalnotice(self): """GET /api/v1/settings/globalnotice""" r = self._make_call('get', self._route_globalnotice) return str(r[...
27
26.89
83
13
176
python
[]
0
true
2024-11-18T21:59:17.244024+00:00
1,612,962,953,000
0f8cf0a589b70b85a37065eb360b9bf027a3e108
3
{ "blob_id": "0f8cf0a589b70b85a37065eb360b9bf027a3e108", "branch_name": "refs/heads/master", "committer_date": 1612962953000, "content_id": "901429d6650fa4f5fa5bac8957436c34aa836a42", "detected_licenses": [ "MIT" ], "directory_id": "8bc7a924cf8c9691530b2eff71c1226eed87922c", "extension": "py", "fi...
2.9375
stackv2
import spotipy.util as util import pandas as pd import spotipy from datetime import datetime class SpotifyUtil: ''' Utility class for accessing Spotify API ''' query_dict = { 'current_user_recently_played': 'parse_songplays', 'current_user_top_artists': 'parse_top_artists', 'cur...
210
37.38
113
17
1,703
python
[]
0
true
2024-11-18T21:59:17.365796+00:00
1,478,100,408,000
2f14e5e6e90655ad1c22acfba7ed4ee708e65497
3
{ "blob_id": "2f14e5e6e90655ad1c22acfba7ed4ee708e65497", "branch_name": "refs/heads/master", "committer_date": 1478100408000, "content_id": "ff374e0dacac288570073c99fb3183bb18edd552", "detected_licenses": [ "MIT" ], "directory_id": "a1b4e5ccfafd44ea84bf65ed0f6477a4951a75e7", "extension": "py", "fi...
3.375
stackv2
import os import matplotlib.pyplot as plt class FastaParser(object): def __init__(self, path): self.path = path if not os.path.isfile(self.path): raise IOError("There is no file at the path specified") if self.path == None: raise TypeError("You did not specify a file path") file_in_path = open(sel...
118
26.87
126
18
855
python
[]
0
true
2024-11-18T21:59:17.618361+00:00
1,394,169,687,000
434de0abfbdec4352c9da32b9800880a0aba3572
2
{ "blob_id": "434de0abfbdec4352c9da32b9800880a0aba3572", "branch_name": "refs/heads/master", "committer_date": 1394169687000, "content_id": "3239ef1effd2aa881e3a921007bee9a5e39c4a2d", "detected_licenses": [ "MIT" ], "directory_id": "36a5fbfac3e499eedc2681259183cca50d23489d", "extension": "py", "fi...
2.328125
stackv2
import pprint, traceback, re from random import randrange class perk: def modifyAccuracyOffense(self, character = None, enemy = None, attack = None, amount = None, printFlag = True): pass def modifyAccuracyDefense(self, character = None, enemy = None, attack = None, amount = None, printFlag = True): pass def mo...
253
29.87
117
16
2,135
python
[]
0
true
2024-11-18T21:59:18.155058+00:00
1,590,258,065,000
732e83683f18f9da4d2b574311914b190b96ac8d
2
{ "blob_id": "732e83683f18f9da4d2b574311914b190b96ac8d", "branch_name": "refs/heads/master", "committer_date": 1590258065000, "content_id": "14f5f76a690c9c3c439dc243b9435ae4024dd93b", "detected_licenses": [ "MIT" ], "directory_id": "5d96d7c1c928c812076302c3fdc62919573265fd", "extension": "py", "fi...
2.375
stackv2
from six import PY3 from transliterate.utils import translit if PY3: from transliterate.contrib.apps.translipsum.utils import Generator else: from lipsum import Generator __title__ = 'transliterate.contrib.apps.translipsum.__init__' __author__ = 'Artur Barseghyan' __copyright__ = '2013-2017 Artur Barseghyan'...
41
31.83
71
12
309
python
[]
0
true
2024-11-18T21:59:18.401147+00:00
1,689,183,080,000
3acf4ac052febbcab0c686df596f0cb770028643
3
{ "blob_id": "3acf4ac052febbcab0c686df596f0cb770028643", "branch_name": "refs/heads/master", "committer_date": 1689183080000, "content_id": "e6ed4f5da36dc4cd4d937e480209c56944988ac9", "detected_licenses": [ "MIT" ], "directory_id": "363b8f40cfa26a8269b57998f8397f430767fc2d", "extension": "py", "fi...
2.53125
stackv2
# -*- coding: utf-8 -*- import types from decimal import Decimal from throw_out_your_templates_1_core_wrappers import safe_bytes from throw_out_your_templates_1_core_wrappers import safe_unicode from throw_out_your_templates_3_core_visitor_map import DEFAULT from throw_out_your_templates_3_core_visitor_map import Vis...
39
38.82
82
15
400
python
[]
0
true
2024-11-18T21:59:18.967857+00:00
1,582,290,627,000
729e0ed9ac08b7af5b82149b5e68559ab8c44d9a
2
{ "blob_id": "729e0ed9ac08b7af5b82149b5e68559ab8c44d9a", "branch_name": "refs/heads/master", "committer_date": 1582290627000, "content_id": "66eb1e913ac33c14db79cf445b1d77381422f829", "detected_licenses": [ "MIT" ], "directory_id": "39747b041ce5bd6a86d55bc5b9ad789a572184fd", "extension": "py", "fi...
2.46875
stackv2
#!/usr/bin/env python from ete3 import NCBITaxa import pandas as pd from argparse import ArgumentParser def get_seqids(df, seqid2taxid, ncbitaxa): filtered = pd.DataFrame() for i in df.index: taxid = df.loc[i,"taxID"] # Intersect descendants with those we have genomes for descendants ...
48
36.06
109
14
482
python
[]
0
true
2024-11-18T21:59:19.038037+00:00
1,520,213,482,000
0ed3024d68d33f956247b68ec50cf06fecdbb250
2
{ "blob_id": "0ed3024d68d33f956247b68ec50cf06fecdbb250", "branch_name": "refs/heads/master", "committer_date": 1520213482000, "content_id": "2b1373866a763db45d8b5fe074eaf72f9d0db652", "detected_licenses": [ "MIT" ], "directory_id": "f1a3f9b6f651c0a60b06623faa9a7ecf84c05af1", "extension": "py", "fi...
2.375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2017/11/4 上午9:26 # @Author : fanqiang # @Site : # @File : spider.py # @Software: PyCharm import hashlib import pathlib import re import subprocess import time from datetime import datetime import requests from PIL import Image, ImageEnhance from pret...
235
34.57
120
17
2,163
python
[{"finding_id": "codeql_py/weak-sensitive-data-hashing_53854aab786bb72f_cccb8150", "tool_name": "codeql", "rule_id": "py/weak-sensitive-data-hashing", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "[Sensitive data (password)](1) is used in a hashing algorithm (MD5) that is insec...
1
true
2024-11-18T21:59:19.102708+00:00
1,610,417,687,000
dfdb5fcbde4cd5fa4f3ac255c4a39d926b415db5
3
{ "blob_id": "dfdb5fcbde4cd5fa4f3ac255c4a39d926b415db5", "branch_name": "refs/heads/master", "committer_date": 1610417687000, "content_id": "eb4bf4e8352e1634901e9a8a47f0208d93a1d4e4", "detected_licenses": [ "MIT" ], "directory_id": "a8124c3361ec462e076fbe246c3571672a28a54b", "extension": "py", "fi...
2.53125
stackv2
import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd import numpy as np import plotly.graph_objs as go from datetime import datetime as dt app = dash.Dash() app.layout = html.Div([ html.H1(children='Choose a country', style={ 'textAlign...
48
21.23
71
14
270
python
[]
0
true
2024-11-18T21:59:19.338404+00:00
1,550,235,874,000
f994b2f076c212cbb0560e3649fd57944d964ca0
3
{ "blob_id": "f994b2f076c212cbb0560e3649fd57944d964ca0", "branch_name": "refs/heads/master", "committer_date": 1550235874000, "content_id": "e5f5160e5d6730d146aa8c8272ec62bf282cc90b", "detected_licenses": [ "MIT" ], "directory_id": "e72411ef74b230a15e15515a09950972c170ecf7", "extension": "py", "fi...
3.078125
stackv2
from model import * # Helper def lenVector(x, y): return sqrt(x * x + y * y) def normalizeVector(x, y): l = sqrt(x * x + y * y) if l == 0: l = 0.001 return (x / l, y / l) def partition(pred, data): yes, no = [], [] for d in data: (yes if pred(d) else no).append(d) retu...
392
34.46
114
22
3,354
python
[]
0
true
2024-11-18T21:59:19.443334+00:00
1,487,959,616,000
06efe57484373002a03f69c490e808456b6f911b
3
{ "blob_id": "06efe57484373002a03f69c490e808456b6f911b", "branch_name": "refs/heads/master", "committer_date": 1487959616000, "content_id": "674d74c746fcde9a6e805a66238a11bbe2fca264", "detected_licenses": [ "MIT" ], "directory_id": "39b5b8ce18f7bf9566bde4539b9ea9c329dc7f9a", "extension": "py", "fi...
2.640625
stackv2
import numpy as np import cv2 import argparse import sys parser = argparse.ArgumentParser(description='Capture Vidoe') parser.add_argument('videoName', metavar='N', type=str,help='video name') args = parser.parse_args() videoName = args.videoName if (videoName ==''): print('please provide video name') sys.exit(...
38
22.42
73
11
233
python
[]
0
true
2024-11-18T21:59:19.497935+00:00
1,481,814,998,000
60ef8571036b2902d67560d24f447eea64a54a83
2
{ "blob_id": "60ef8571036b2902d67560d24f447eea64a54a83", "branch_name": "refs/heads/master", "committer_date": 1481814998000, "content_id": "21391459915491d79ce723cc129d6dae921748ac", "detected_licenses": [ "MIT" ], "directory_id": "3afdbc5d33ce8248cc0635985078e91c15c48207", "extension": "py", "fi...
2.359375
stackv2
## @file config_obj.py # @brief Defines a simple container for user and authentication details, as populated from a configuration file # import ConfigParser config = ConfigParser.RawConfigParser() config.read('.rektconfig.txt') user = {'username':config.get('user', 'username'), 'client_id':config.get('user', 'client_...
18
28
111
9
125
python
[]
0
true
2024-11-18T21:59:19.713214+00:00
1,615,444,394,000
f74b8d2d0691b72c01e37e80e5a47e6a7cb8a821
3
{ "blob_id": "f74b8d2d0691b72c01e37e80e5a47e6a7cb8a821", "branch_name": "refs/heads/main", "committer_date": 1615444394000, "content_id": "19e9890df87cd93fc535deb61c5141f52ba58f1a", "detected_licenses": [ "MIT" ], "directory_id": "bfef929f2c5681431f4eb2c297167c5c07f55b91", "extension": "py", "file...
2.84375
stackv2
# Copyright 2021 Peizhi Yan. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
56
23.25
80
11
349
python
[]
0
true
2024-11-18T21:59:19.766036+00:00
1,575,479,967,000
8e037f03584d540f36b9355ff78da8562f17f9df
3
{ "blob_id": "8e037f03584d540f36b9355ff78da8562f17f9df", "branch_name": "refs/heads/master", "committer_date": 1575479967000, "content_id": "b1414170a6850e4ad6588f5e1e3ca59524ced254", "detected_licenses": [ "MIT" ], "directory_id": "c20c653e1942a8c3681a4bd93bd8202f228328a0", "extension": "py", "fi...
2.90625
stackv2
""" Code for figuring out various vector representions of documents """ import numpy as np from collections import defaultdict import tools def tf_sents(doc): """ Create a sentence level tf representation of the document """ words = set(word for word in tools.word_iter(doc)) word_pk = {word: pk for pk, w...
122
28.52
87
23
848
python
[]
0
true
2024-11-18T21:59:19.907432+00:00
1,432,048,990,000
a369280b9f205a654d19b1bc4694e21947ff764d
2
{ "blob_id": "a369280b9f205a654d19b1bc4694e21947ff764d", "branch_name": "refs/heads/master", "committer_date": 1432048990000, "content_id": "dd4b3659187326e341f289e67727f5f34df12e5f", "detected_licenses": [ "MIT" ], "directory_id": "8077e89e880f8ec006db88f37a050f3ff6553a8b", "extension": "py", "fi...
2.5
stackv2
__author__ = 'John' import numpy as np from sklearn.decomposition import ProjectedGradientNMF import recsys import evaluate import similarity from nmf_analysis import mall_latent_helper as nmf_helper from sklearn import decomposition from numpy.linalg import inv from sklearn.metrics.pairwise import pairwise_distances ...
147
41.44
153
19
1,660
python
[]
0
true
2024-11-18T21:59:20.171732+00:00
1,396,247,985,000
f0196d3edbc34fa207794c68d2c35fe7eedd1c2d
2
{ "blob_id": "f0196d3edbc34fa207794c68d2c35fe7eedd1c2d", "branch_name": "refs/heads/master", "committer_date": 1396247985000, "content_id": "adf3252e4ae4448fa6eb25fffeb7f9586469e313", "detected_licenses": [ "MIT" ], "directory_id": "8442bc86179825f2b73d10cbce661d88baf137df", "extension": "py", "fi...
2.375
stackv2
# # This file is part of Evergreen. See the NOTICE for more information. # import evergreen from evergreen.futures._base import Executor, Future from evergreen.locks import Lock from evergreen.queue import Queue class _WorkItem(object): def __init__(self, future, fn, args, kwargs): self.future = future ...
73
27.07
80
14
435
python
[]
0
true
2024-11-18T21:59:20.228695+00:00
1,578,575,818,000
1e6c6b413de36d169e1a4c6d55bcc52df6393ceb
3
{ "blob_id": "1e6c6b413de36d169e1a4c6d55bcc52df6393ceb", "branch_name": "refs/heads/master", "committer_date": 1578575818000, "content_id": "7abe5f26c404024e2a7a7dac2297927ffdc34fea", "detected_licenses": [ "MIT" ], "directory_id": "56a14ad617c353feabbb092b5b7541f4e1fa1513", "extension": "py", "fi...
2.515625
stackv2
from django.db import models from django.contrib.auth.models import User from django.utils.datetime_safe import date import datetime class Profile(models.Model): ''' this is a model class that defines how a user profile will be created ''' user = models.OneToOneField(User, on_delete = models.CASCADE, ...
85
26.31
80
12
476
python
[]
0
true
2024-11-18T21:59:20.488923+00:00
1,635,191,831,000
645ebebe050fa770771a238a345966ec9e6fc985
3
{ "blob_id": "645ebebe050fa770771a238a345966ec9e6fc985", "branch_name": "refs/heads/master", "committer_date": 1635191831000, "content_id": "3795e6b319cac5d6e7259107f8f73dcadaf8ac9f", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c2f74061a6964fb52dc2ea10aabcfa756edbf469", "extension": "p...
2.5625
stackv2
import typing from .general import __quotes from .url_methods import __return_json_v3 def forex(apikey: str) -> typing.Optional[typing.List[typing.Dict]]: """ Query FMP /fx/ API :param apikey: Your API key. :return: A list of dictionaries. """ path = f"fx" query_vars = {"apikey": apikey}...
39
25.21
78
9
276
python
[]
0
true
2024-11-18T21:59:20.818174+00:00
1,607,831,644,000
59ebee313b99483c72ce91b6640e516b764a26ed
3
{ "blob_id": "59ebee313b99483c72ce91b6640e516b764a26ed", "branch_name": "refs/heads/master", "committer_date": 1607831644000, "content_id": "fb82c8366065f2f84b4f48688cc8d6078fd24d89", "detected_licenses": [ "MIT" ], "directory_id": "e1ca5e083adf94ee707a775cc4d343b9ae42792d", "extension": "py", "fi...
2.8125
stackv2
#!/usr/bin/env python from __future__ import print_function, unicode_literals import subprocess from PyInquirer import style_from_dict, Token, prompt, Separator from pprint import pprint import sys from pyfiglet import Figlet import argparse import os class Deepli(object): """ Code that runs deepli """ ...
89
22.15
68
17
494
python
[]
0
true
2024-11-18T21:59:20.875167+00:00
1,647,262,466,000
17475bf45850090454f0078e4ba289491519e276
3
{ "blob_id": "17475bf45850090454f0078e4ba289491519e276", "branch_name": "refs/heads/master", "committer_date": 1647262466000, "content_id": "fefb65c8887138c0b8b29cdcada13a03c7ee0b9a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5fe6613dfe1eb6c94b277255bb0a7bded1a53525", "extension": "py"...
3.296875
stackv2
from typing import List def findRepeatedDnaSequences(s: str) -> List[str]: if len(s)<11: return [] letters_val = {'A': '1', 'C':'2', 'G': '3', 'T':'4'} s_num = [letters_val[i] for i in s] values = {} result = set() v = s_num[:10] values[int(''.join(v)...
26
26.54
60
13
195
python
[]
0
true
2024-11-18T21:59:20.937831+00:00
1,690,377,671,000
fd52c226270a5fdfdd3a354249ee181bf98064ba
3
{ "blob_id": "fd52c226270a5fdfdd3a354249ee181bf98064ba", "branch_name": "refs/heads/master", "committer_date": 1690377671000, "content_id": "c47929a7ad7f1f827322ba9e9168a8c43cede1f5", "detected_licenses": [ "MIT" ], "directory_id": "a0eb6744e6f7f509b96d21f0bc8b3f8387f6861c", "extension": "py", "fi...
2.84375
stackv2
import util_make_files util_make_files.pathlib_basic() import pathlib import os import pprint p_file = pathlib.Path('temp/file.txt') print(p_file) # temp/file.txt print(type(p_file)) # <class 'pathlib.PosixPath'> p_dir = pathlib.Path('temp/dir') print(p_dir) # temp/dir print(type(p_dir)) # <class 'pathlib.Posix...
122
15.4
72
12
550
python
[]
0
true
2024-11-18T21:59:21.219549+00:00
1,559,879,241,000
cf28dd2a6e1a2d5f96783f7f3242031e4e64a8b0
2
{ "blob_id": "cf28dd2a6e1a2d5f96783f7f3242031e4e64a8b0", "branch_name": "refs/heads/master", "committer_date": 1559879241000, "content_id": "842c3b59d507f46cfb66982a0d915b177eb91a20", "detected_licenses": [ "MIT" ], "directory_id": "415b5c3ccf75b55c39dadba0773419a21ebeb9d1", "extension": "py", "fi...
2.46875
stackv2
from .template import CollectionBuilder from moff.node import CollectionNode, Node, node class ListBuilderItem (CollectionBuilder): # override def is_mergeable(self, builder): return False # override def merge(self, builder): raise Error(".merge() is unsupported.") # override ...
21
22.1
48
13
104
python
[]
0
true
2024-11-18T21:59:21.272074+00:00
1,686,041,559,000
0a6cac6c7f954658111c2c38410e1e28bd668125
3
{ "blob_id": "0a6cac6c7f954658111c2c38410e1e28bd668125", "branch_name": "refs/heads/main", "committer_date": 1686041559000, "content_id": "09827e667df3d13c0d4a2bb852bcd42a753c809b", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "3bfb784c1178906d3d42ab7e357a3066894a5a61", "extension": "py"...
2.859375
stackv2
import sys from loguru import logger from loguru._colorizer import Colorizer def formatter(record: dict): """ Formats the logging message by: - Adding color and bold - Indenting the message """ base_format = ( "<b>" # bold "<light-blue>[eds-scikit]</light-blue>" "- ...
51
24.14
67
12
307
python
[]
0
true
2024-11-18T21:59:21.329874+00:00
1,466,259,415,000
535e39d7fe7371c3c52c7cf083f5713fc925f093
2
{ "blob_id": "535e39d7fe7371c3c52c7cf083f5713fc925f093", "branch_name": "refs/heads/master", "committer_date": 1466259415000, "content_id": "5111b400d490cda967a1cc070c3b3f72a6cd1341", "detected_licenses": [ "MIT" ], "directory_id": "3a23c6263d28ad5828eedd54cf9e8bb55a4b3196", "extension": "py", "fi...
2.375
stackv2
import OSC, time #import rtmidi_python as rtmidi #midi_out = rtmidi.MidiOut() #midi_out.open_port(0) def handler(addr, tags, data, client_address): txt = "OSCMessage '%s' from %s: " % (addr, client_address) txt += str(data) print(txt) #num = data[0] #print num #midi_out.send_message([0x90, 192...
22
30.14
113
10
233
python
[]
0
true
2024-11-18T21:59:22.195734+00:00
1,608,915,396,000
6dc586b4c585504148ffffea1c01eed14d3a51af
3
{ "blob_id": "6dc586b4c585504148ffffea1c01eed14d3a51af", "branch_name": "refs/heads/main", "committer_date": 1608915396000, "content_id": "881fbe95871ca390446734593c6aff8c81a3ae11", "detected_licenses": [ "MIT" ], "directory_id": "c8b22d7645c41f7e584ead42fb7d3070a1f5a6d4", "extension": "py", "file...
2.75
stackv2
#!/usr/bin/env python3 from src.util import * tiles = read_file_to_list("input.txt") #optimazation, create variants once for tile in tiles: tile.createVariants() solution = find_solution(tiles,[],set(),0,0) print(solution[0][0].id * solution[0][-1].id * solution[-1][0].id * solution[-1][-1].id) # end::starOne...
34
18.65
88
11
196
python
[]
0
true
2024-11-18T21:59:22.249242+00:00
1,517,025,137,000
288f23c256702dc86dfdbba940268cc6e7d326ac
3
{ "blob_id": "288f23c256702dc86dfdbba940268cc6e7d326ac", "branch_name": "refs/heads/master", "committer_date": 1517025137000, "content_id": "cb13b3bd1c008a9a46454ffcf1d07c2b4f854b7e", "detected_licenses": [ "MIT" ], "directory_id": "cb2db085109c57c96674b03448a5698604eecc38", "extension": "py", "fi...
3.390625
stackv2
import json class HighScoreManager: """A HighScoreManager manages the recording of highscores achieved to a highscore file. """ _data = None def __init__(self, file="highscores.json", gamemode='regular', auto_save=True, top_scores=10): """Constructs a HighScoreManager usin...
123
33.86
80
16
935
python
[]
0
true
2024-11-18T21:59:22.592337+00:00
1,675,017,549,000
b686aea94ed6ce6c26b26d3ec194733d11c2347d
2
{ "blob_id": "b686aea94ed6ce6c26b26d3ec194733d11c2347d", "branch_name": "refs/heads/main", "committer_date": 1675017549000, "content_id": "620e45c16e4abb32c1fa4a9b918fd0a6bc0149fe", "detected_licenses": [ "MIT" ], "directory_id": "de77d2ebb336a32149bd8a9a3d4d50018f264c3b", "extension": "py", "file...
2.3125
stackv2
from simple_cqrs.domain_event import DomainEvent from melange import QueuePublisher from melange.backends import LocalSQSBackend from melange.serializers import PickleSerializer, SerializerRegistry class MyTestMessage: def __init__(self, message: str) -> None: self.message = message if __name__ == "__m...
25
30.96
68
11
172
python
[]
0
true
2024-11-18T21:59:22.863163+00:00
1,406,720,604,000
a1324d8c4735140d0b95435a924b1830b1a39eb1
3
{ "blob_id": "a1324d8c4735140d0b95435a924b1830b1a39eb1", "branch_name": "refs/heads/master", "committer_date": 1406720604000, "content_id": "bd462901b22988199d5003381f7a8e1aed0ff314", "detected_licenses": [ "MIT" ], "directory_id": "e3c5877e1837ef5f51c70c451fc09dfa83f0065e", "extension": "py", "fi...
2.71875
stackv2
import cv2.cv as cv import cv2 import numpy as np from Tkinter import Tk from tkFileDialog import askopenfilename Tk().withdraw() filename = askopenfilename() img = cv2.imread(filename,0) img = cv2.medianBlur(img,5) cimg = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR) cannyimg=cv2.Canny(img,100,200) circles = cv2.HoughCircle...
28
27.75
112
12
280
python
[]
0
true
2024-11-18T21:59:22.918961+00:00
1,517,257,089,000
655beefd45d79b0d064ded4061f40d3c47784031
2
{ "blob_id": "655beefd45d79b0d064ded4061f40d3c47784031", "branch_name": "refs/heads/master", "committer_date": 1517257089000, "content_id": "989b0a290429d0029fb7c97999e794c77b53ca15", "detected_licenses": [ "MIT" ], "directory_id": "1717c2caf13c0381df7aa9a50cd3e212b6e27ae3", "extension": "py", "fi...
2.4375
stackv2
from __future__ import division import argparse import json from multiprocessing import Pool import sys from gym_puyopuyo.state import State from gym_puyopuyo.field import TallField from puyotable.compress import state_encode, state_decode from puyotable.canonization import canonize_state from tabulate_deals import ...
166
28.07
116
19
1,097
python
[]
0
true
2024-11-18T21:59:23.021290+00:00
1,546,741,906,000
9f58e998fc508dddd658e90e5eef084c615e6792
3
{ "blob_id": "9f58e998fc508dddd658e90e5eef084c615e6792", "branch_name": "refs/heads/master", "committer_date": 1546741906000, "content_id": "d13730c1037ff6002b629d64c271d177aacb851b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9c27879bcba366f939c4b3bcbcbd2e504f48e5ab", "extension": "py"...
3.234375
stackv2
import click import json import csv import sys @click.command() @click.argument('input', type=click.File('rb')) def cli(input): """Dynamodb to CSV Convert the aws dynamodb output (Scalar types, JSON) to CSV. \b Process from stdin: dyndb2csv - \b Process from a file: dyndb2csv...
46
18.74
64
13
233
python
[]
0
true
2024-11-18T21:59:23.124633+00:00
1,681,056,055,000
35ac79c1b7578eb96f8243dcf7a3c42629e01181
3
{ "blob_id": "35ac79c1b7578eb96f8243dcf7a3c42629e01181", "branch_name": "refs/heads/master", "committer_date": 1681056055000, "content_id": "c2ee020d201ca9919045ef32a7c6daf4e3b931ff", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "a97dd156cdf145493e9988a147d39eb7a67d781d", "extension": "p...
2.59375
stackv2
#!/usr/bin/env python import asyncio import json import os import secrets import signal import websockets from connect4 import PLAYER1, PLAYER2, Connect4 JOIN = {} WATCH = {} async def error(websocket, message): """ Send an error message. """ event = { "type": "error", "message"...
198
25.61
77
15
1,165
python
[]
0
true
2024-11-18T21:59:23.396749+00:00
1,535,433,434,000
b4964f77b5344cc8eef146e34871a002756794ed
3
{ "blob_id": "b4964f77b5344cc8eef146e34871a002756794ed", "branch_name": "refs/heads/master", "committer_date": 1535433434000, "content_id": "80d083426acf27a98e6f5a88f3675310102ab3b1", "detected_licenses": [ "MIT" ], "directory_id": "a8206b29df21a7fc094f54c09e3e0ce11ddacacd", "extension": "py", "fi...
3.046875
stackv2
# coding=utf-8 import os import io import ftplib import pyftp class FTP(ftplib.FTP): def __init__(self, host='', user='', passwd='', acct='', timeout=ftplib._GLOBAL_DEFAULT_TIMEOUT, port=None, source_address=None): self.source_address = source_address self.timeout = timeout ...
130
29.93
89
14
939
python
[]
0
true
2024-11-18T21:59:28.495528+00:00
1,692,680,717,000
db7ec693ee58562501108d4f117982ff209da123
3
{ "blob_id": "db7ec693ee58562501108d4f117982ff209da123", "branch_name": "refs/heads/master", "committer_date": 1692680717000, "content_id": "7b6524318279f25866c23803c5b8a0a1816f3c1d", "detected_licenses": [ "MIT" ], "directory_id": "a475c244c10673d2cd037d31647eb97b093b153a", "extension": "py", "fi...
2.640625
stackv2
''' irqUART demo for pyboard Author: shaoziyang Date: 2020.6 http://www.micropython.org.cn ''' from machine import Pin, UART from irqUART import irqUART cnt = 0 def U1_RX_IRQ(t): global cnt n = 0 while u1.any(): d = u1.any() cnt+=d n+=1 print('[', n, ']',...
31
15.58
55
11
188
python
[]
0
true
2024-11-18T21:59:28.556713+00:00
1,622,625,078,000
f6276afe8b8d304eda1390406ab9fbcbdc1e3bcf
4
{ "blob_id": "f6276afe8b8d304eda1390406ab9fbcbdc1e3bcf", "branch_name": "refs/heads/master", "committer_date": 1622625078000, "content_id": "d0f005acb8874a3be113d4b989c6b0da893ea418", "detected_licenses": [ "MIT" ], "directory_id": "f117d31ece12b25afe7182e0546f63f49a1a88d2", "extension": "py", "fi...
3.96875
stackv2
class Dad: basketball = 1 class Son(Dad): dance = 2 basketball = 2 def isdance(self): return f"Yes i dance {self.dance} no. of times" class Grand_son(Son): dance = 5 def isdance(self): return f"I dance awesomely {self.dance} no. of times" instance1 = Dad() instance1 = Son() in...
21
24.48
107
10
148
python
[]
0
true
2024-11-18T21:59:28.659034+00:00
1,609,734,505,000
5b6636eda8870a22ea899cb8ba03e4ffe32033f0
4
{ "blob_id": "5b6636eda8870a22ea899cb8ba03e4ffe32033f0", "branch_name": "refs/heads/master", "committer_date": 1609734505000, "content_id": "cb9359c9500d5a90cc510da4fa022469be0d689e", "detected_licenses": [ "MIT" ], "directory_id": "4d0eaa9d9a4d95f280a3b7cd0f05e1656b393894", "extension": "py", "fi...
4.3125
stackv2
#Difficulty = Easy #Submission Speed = 64.69% ''' Solution-1: Example: nums = [3,2,1,4] target = 6 Step1) Create a dictionary and populate it with elements of nums as the key and their corresponding index as values. d = { 3:0, 2:1 1:2 4:3 } Ste...
56
36.11
125
13
509
python
[]
0
true
2024-11-18T21:59:28.827653+00:00
1,566,523,034,000
616c3e0c3e53aaec7e85ae0965b25ddd77a8ea40
3
{ "blob_id": "616c3e0c3e53aaec7e85ae0965b25ddd77a8ea40", "branch_name": "refs/heads/master", "committer_date": 1566523034000, "content_id": "32eb7ed8192073562f4ea044938ef730b74d621d", "detected_licenses": [ "MIT" ], "directory_id": "0f2ca882c67a8dba0be5c0890c18c658aa10025a", "extension": "py", "fi...
2.546875
stackv2
from tool.origin_createDataset import createDataset def getImageListAndLabelList(txt): """ txt: a txt file that contain ImagesFullPath and Label """ with open(txt, 'r') as f: lines = f.readlines() images = [line.rstrip() for line in lines] labels = [line.split("_")[-1].replace(".jpg...
20
30.4
71
13
154
python
[]
0
true
2024-11-18T22:11:23.982569+00:00
1,693,578,098,000
93fafd798aa7f9b25588bfed62ce7b1a4ddb3f95
3
{ "blob_id": "93fafd798aa7f9b25588bfed62ce7b1a4ddb3f95", "branch_name": "refs/heads/main", "committer_date": 1693578098000, "content_id": "e8435eae0bb4365565dd49680542b2a91b0919aa", "detected_licenses": [ "Apache-2.0" ], "directory_id": "98c182bda68e5c9d55c2b6317fe8a889069ed821", "extension": "py", ...
2.796875
stackv2
#!/usr/bin/python3 import json import datetime from shutil import copyfile import os import sys filePath = "shared/src/commonMain/resources/schedule.json" outputPath = filePath # outputPathiOS = "iosApp/iosApp/schedule.json" startDate = datetime.date.today() customOutput = False shouldPrint = False # Gathering Arg...
106
33.29
107
21
837
python
[]
0
true
2024-11-18T22:11:24.295704+00:00
1,668,287,342,000
53f6c1a18c3707240a5b6b9ea79ae6820eee1acf
3
{ "blob_id": "53f6c1a18c3707240a5b6b9ea79ae6820eee1acf", "branch_name": "refs/heads/master", "committer_date": 1668287342000, "content_id": "e196cd40ab2d303eab4c546ca400006d5ac92863", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "e84feb798166ad65670c11d3ddff7cfae0be4258", "extension": "p...
3.328125
stackv2
""" jsonspec.pointer.stages ~~~~~~~~~~~~~~~~~~~~~~~ """ from collections.abc import Mapping, Sequence, Set class Staged: obj = None parent_obj = None parent_member = None def __init__(self, obj, parent=None, member=None): self.obj = obj self.parent_obj = parent self....
69
26.97
70
15
465
python
[]
0
true
2024-11-18T22:11:24.454827+00:00
1,345,241,706,000
48eb2fa8c26bba285b321c43ff543da24c816936
3
{ "blob_id": "48eb2fa8c26bba285b321c43ff543da24c816936", "branch_name": "refs/heads/master", "committer_date": 1345241706000, "content_id": "408c4b2aae6f90bb7455a67363a3457e1caea75a", "detected_licenses": [ "MIT" ], "directory_id": "ea1cdf2a2b6393915b28b43eced814ada4b753b0", "extension": "py", "fi...
2.53125
stackv2
from sikwidgets.widgets.page import Page from sikwidgets.widgets.radio_button import RadioButton from sikwidgets.widgets.widget import WidgetError # TODO: https://answers.launchpad.net/sikuli/+question/183688 class MenuButton(RadioButton): # a button that spawns a menu def click(self, offset=None): previously_sele...
62
29.5
78
11
439
python
[]
0
true
2024-11-18T22:11:25.048759+00:00
1,601,991,484,000
655946785244c624a62769275d4853994314f143
3
{ "blob_id": "655946785244c624a62769275d4853994314f143", "branch_name": "refs/heads/master", "committer_date": 1601991484000, "content_id": "8cb5000965bf55a163c8c75ec3eba8dc739a8c81", "detected_licenses": [ "MIT" ], "directory_id": "50afc0db7ccfc6c80e1d3877fc61fb67a2ba6eb7", "extension": "py", "fi...
3.390625
stackv2
def solution(day, date1, date2): days = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"] date1 = date1.split("/") date2 = date2.split("/") ans = int(date2[0]) - int(date1[0]) if date1[1] != date2[1]: n = int(date2[1]) - int(date1[1]) ans += 30 * n x ...
20
29.1
89
12
198
python
[]
0
true
2024-11-18T22:11:25.107986+00:00
1,487,536,958,000
c7c89ea1922c55dc48b2139db5da8c965c81aa3f
3
{ "blob_id": "c7c89ea1922c55dc48b2139db5da8c965c81aa3f", "branch_name": "refs/heads/master", "committer_date": 1487536958000, "content_id": "8f581ea77c57f4b3a56db879f3615427caf1f8a8", "detected_licenses": [ "MIT" ], "directory_id": "2bd4f6c81125ca42f338d4e4f27cf59d0e4d34a1", "extension": "py", "fi...
3.09375
stackv2
#!/usr/bin/env python """CAM Newton's End Zone Dance Floods a switch's CAM table with random MAC addresses, making it start behaving as a hub. TODO: - argparse to set options - check input for validity """ import re import socket import struct import random import time def random_mac(): """Returns a random MA...
120
28.02
79
14
994
python
[]
0
true
2024-11-18T22:11:25.369654+00:00
1,523,822,834,000
a341a2bcea32697f5174ad35eb117121682ee22d
3
{ "blob_id": "a341a2bcea32697f5174ad35eb117121682ee22d", "branch_name": "refs/heads/master", "committer_date": 1523822834000, "content_id": "ab96744ab8e9264c09cb71d27e8688a7c7be0f26", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d7629c7ce339828eb0722a6f662dd57a4fad4ecc", "extension": "py"...
2.828125
stackv2
# -*- coding: utf-8 -*- # Copyright 2017-2018 Niall McCarroll # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
79
37.85
108
13
723
python
[]
0
true
2024-11-18T22:11:25.574506+00:00
1,606,319,281,000
9c735ecce7e993b21756cb2b42d56ffe70e862ae
5
{ "blob_id": "9c735ecce7e993b21756cb2b42d56ffe70e862ae", "branch_name": "refs/heads/master", "committer_date": 1606319281000, "content_id": "15b4e5db39ecdaf3a079f65d5517191cccee3681", "detected_licenses": [ "MIT" ], "directory_id": "db874762d017c0c62b2a5db3c9a5fcc514d57405", "extension": "py", "fi...
4.65625
stackv2
#Exercício Python 079: Crie um programa onde o usuário possa digitar vários valores numéricos #cadastre-os em uma lista. Caso o número já exista lá dentro, ele não será adicionado. #No final, serão exibidos todos os valores únicos digitados, em ordem crescente. lista = [] while True: num = int(input("Digite um nú...
17
37.82
94
18
185
python
[]
0
true
2024-11-18T22:11:25.833384+00:00
1,594,399,996,000
9d59835ce3ee4c0c61dfdf89a511f4a0c9d2e798
3
{ "blob_id": "9d59835ce3ee4c0c61dfdf89a511f4a0c9d2e798", "branch_name": "refs/heads/master", "committer_date": 1594399996000, "content_id": "533725e8d853473743f547b9cc3d79e5bf8e162b", "detected_licenses": [ "MIT" ], "directory_id": "b5c61f071ccb966f30ea2d0b5655aacf15d3779a", "extension": "py", "fi...
2.8125
stackv2
import json import Company import Competence import Credit import Consult import Global import PySimpleGUI as view def listCompany(): file = Global.DATABASE() with open(file, 'r') as json_file: dados = json.load(json_file) count = len(dados) listCompany = [] for index in range(count): ...
94
28.17
70
15
535
python
[]
0
true
2024-11-18T22:11:25.944948+00:00
1,586,275,587,000
0166a0dda7916355b391ae869499bcf39a2dc39c
2
{ "blob_id": "0166a0dda7916355b391ae869499bcf39a2dc39c", "branch_name": "refs/heads/master", "committer_date": 1586275587000, "content_id": "2571c928682ed39e0d8b1c0dcd5915d58ea3c1d2", "detected_licenses": [ "MIT", "BSD-3-Clause", "Apache-2.0" ], "directory_id": "abe1a003574ece6d148a336e55add0b...
2.359375
stackv2
from flask_login import current_user from turkey import app from turkey.models import Goal, Task, CompletedTask, TaskBreak import datetime import calendar from turkey.utils import get_tasks_history, render_turkey def get_completed_tasks_display(task_id): week = get_tasks_history(task_id) # Calculate widths t...
115
30.48
98
16
781
python
[]
0
true
2024-11-18T22:11:26.180368+00:00
1,511,948,152,000
847081f8a6d55e1c46fbac2c5d6f53a88595a8a1
3
{ "blob_id": "847081f8a6d55e1c46fbac2c5d6f53a88595a8a1", "branch_name": "refs/heads/master", "committer_date": 1530201581000, "content_id": "f69e7593ab63bc89d95ea8040956ef26a9c5677a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0afeeea3dbf502de1bcb76dc8c6ca6021d255d05", "extension": "py"...
3.015625
stackv2
import collections import enum import math import sys smallest_number = sys.float_info.epsilon class Angle: def __init__(self, radians): self.__radians = radians @classmethod def from_radians(class_, radians): return class_(radians) @classmethod def from_degrees(class_, degrees): return class_...
177
27.03
106
21
1,353
python
[]
0
true
2024-11-18T22:11:26.312964+00:00
1,520,578,482,000
cd54b05fdfdc7dc67b655332637ac23d386c6044
2
{ "blob_id": "cd54b05fdfdc7dc67b655332637ac23d386c6044", "branch_name": "refs/heads/master", "committer_date": 1520578482000, "content_id": "27e57a9cbcecfb0a45c60f9759d7396352f6034f", "detected_licenses": [ "MIT" ], "directory_id": "a158a3fa8465bec6222aeb2f38d0baaec0a97a28", "extension": "py", "fi...
2.375
stackv2
import codecs import json import tldextract DATA_FILE = "/home/rkapoor/Documents/ISI/data/DIG-Nov-Eval/gt-v02-all.jl" DOMAIN_OF_INTEREST = 'backpage.com' def safe_copy(json_from, json_to, field): if field in json_from and json_from[field] is not None: json_to[field] = json_from[field] def get_domain(jso...
35
26.37
76
13
247
python
[]
0
true
2024-11-18T22:11:26.355052+00:00
1,693,720,774,000
977e1c3ae9cee9dd4095655fd7df2dae46c7d789
3
{ "blob_id": "977e1c3ae9cee9dd4095655fd7df2dae46c7d789", "branch_name": "refs/heads/master", "committer_date": 1693720774000, "content_id": "e4dd3435d6cd74d07f0e93697bf91415820d35b3", "detected_licenses": [ "MIT" ], "directory_id": "77bf313c3bb3d014f7f2b8b64cf92dad7abd0910", "extension": "py", "fi...
3.21875
stackv2
# messages can be any size (that fits in memory) # server.py import socketserver class MyTCPHandler(socketserver.BaseRequestHandler): def handle(self): self.data = self.request.recv(1024).strip() print('from', str(self.client_address[0])) print(self.data) self.request.sendall(self.data.upper()) with socketse...
33
29.55
73
13
255
python
[]
0
true
2024-11-18T22:11:26.412859+00:00
1,689,687,458,000
5c6717bc3cba5b77a31e39fa5db20e7e66a8bb5a
3
{ "blob_id": "5c6717bc3cba5b77a31e39fa5db20e7e66a8bb5a", "branch_name": "refs/heads/main", "committer_date": 1689687458000, "content_id": "8459d3cfe2a486ebdcf6f64c27cdb458a2d82263", "detected_licenses": [ "MIT" ], "directory_id": "47fdde90ff7017bbff0646c77ba66c51e8a5b74d", "extension": "py", "file...
2.6875
stackv2
from enum import Enum class MatchupType(str, Enum): REGULAR = "regular" PLAYOFF = "playoff" PLAYOFF_BYE = "playoff_bye" LOSER = "loser" CHAMPIONSHIP = "championship" def display(self): if self == MatchupType.REGULAR: return "Regular season matchup" if self == Match...
21
27.19
44
10
152
python
[]
0
true
2024-11-18T22:11:26.566223+00:00
1,689,160,599,000
7882dddc607c263073820134512ffda73011447a
2
{ "blob_id": "7882dddc607c263073820134512ffda73011447a", "branch_name": "refs/heads/master", "committer_date": 1689160599000, "content_id": "e18c6a145546317ba80ea0f93d5f2cf4a5521f43", "detected_licenses": [ "MIT" ], "directory_id": "627fbcb61f9420edb1e92d2f245c3a254e1f2506", "extension": "py", "fi...
2.359375
stackv2
import winreg import re import pythoncom import win32com.client import ctypes import wmi from common.stringops import remove_non_ascii def get_windows_data(): key = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion" with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key) as key: releaseId = int(winreg.Query...
129
32.71
110
16
1,017
python
[]
0
true
2024-11-18T22:11:26.685015+00:00
1,598,880,787,000
80e07eaf21a3fa040eacded62df6b62f8e64283d
3
{ "blob_id": "80e07eaf21a3fa040eacded62df6b62f8e64283d", "branch_name": "refs/heads/master", "committer_date": 1598880787000, "content_id": "bc1c75c52658225744a8a45447533aadfde90f05", "detected_licenses": [ "MIT" ], "directory_id": "556f6b68ba6401e6d7003edfdaca454925dab71a", "extension": "py", "fi...
2.859375
stackv2
# OHLCV 데이터에서 기술적 분석 지표들의 FeatureSet을 추출한다 # ------------------------------------------------------------- import pandas as pd import numpy as np from MyUtil.ComFeatureSet import getUpDnClass # 과거 n-day 동안의 주가 패턴으로 Feature Set을 구성한다 def getPatternFeatureSet(data, u, d, nPast=20, nHop=3, nFuture=20, binary=False): ...
81
35.37
102
16
1,163
python
[]
0
true
2024-11-18T22:11:26.730998+00:00
1,614,348,304,000
23634a6f74092cb9c4c0c69295f108c9a97b0f53
3
{ "blob_id": "23634a6f74092cb9c4c0c69295f108c9a97b0f53", "branch_name": "refs/heads/master", "committer_date": 1614348304000, "content_id": "ec1974ff423337c87d5753b45d6fb78f3cc54827", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "f4c20145f702b692316c6464e79a477d238771fd", "extension": "p...
2.703125
stackv2
import numpy as np import pandas as pd import scipy from typing import List from tqdm.auto import tqdm, trange from .imputers import impute from .tools.utils_bootstrap import empirical_bootstrap from .tools import utils_preddiff as ut_preddiff from functools import partial global pbar ###############################...
302
50.97
120
19
3,425
python
[]
0
true
2024-11-18T22:11:26.947257+00:00
1,598,978,360,000
a95275209de0ed5c1a1e76a6a2f81bbeeaa80975
2
{ "blob_id": "a95275209de0ed5c1a1e76a6a2f81bbeeaa80975", "branch_name": "refs/heads/master", "committer_date": 1598978360000, "content_id": "9f541b49e9e201725a3aa0e7a145179425a7f12b", "detected_licenses": [ "MIT" ], "directory_id": "4db5f7f602d353eff9e8e6de94cdd7f2b41f7bf3", "extension": "py", "fi...
2.421875
stackv2
from .base import AbstractDataset import pandas as pd from datetime import date class ML1MDataset(AbstractDataset): @classmethod def code(cls): return 'ml-1m' @classmethod def url(cls): return 'http://files.grouplens.org/datasets/movielens/ml-1m.zip' @classmethod def zip_fi...
40
25.9
72
12
254
python
[]
0
true
2024-11-18T22:11:27.260796+00:00
1,611,863,002,000
73d9caa5f0b6d32e678dca3213749da0f50f097f
2
{ "blob_id": "73d9caa5f0b6d32e678dca3213749da0f50f097f", "branch_name": "refs/heads/master", "committer_date": 1611863002000, "content_id": "506338a62674f3980b02af9b04538897e35e0d07", "detected_licenses": [ "MIT" ], "directory_id": "5ebb857895b1c3adc1de0e04ecbb9e081ddef2b1", "extension": "py", "fi...
2.3125
stackv2
from typing import List, Iterator from .__core__ import PyotCore, PyotStatic # PYOT STATIC OBJECTS class LeaderboardPlayerData(PyotStatic): puuid: str game_name: str tag_line: str leaderboard_rank: int ranked_rating: int number_of_wins: int @property def account(self) -> "Account": ...
48
25.56
80
14
320
python
[]
0
true
2024-11-18T22:11:27.317037+00:00
1,596,381,974,000
ba0c01e28e077518dd50d678f9e440a8a3470c94
3
{ "blob_id": "ba0c01e28e077518dd50d678f9e440a8a3470c94", "branch_name": "refs/heads/master", "committer_date": 1596381974000, "content_id": "f76ab3c70b534dddc66b49a1725c011d83f3b504", "detected_licenses": [ "MIT" ], "directory_id": "a01f33a7a6a355b2071963304577d8f3a4caaa0c", "extension": "py", "fi...
3.265625
stackv2
# -------------- #Header files import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns #path of the data file- path data = pd.read_csv(path) #Code starts here data['Gender'].replace('-','Agender',inplace=True) gender_count = data['Gender'].value_counts() gender_count.plot(kind='ba...
76
23.88
87
12
522
python
[]
0
true
2024-11-18T22:11:27.615238+00:00
1,619,928,035,000
fe28d7f9c84880b3bfe746fa5fd5a98db5243d21
3
{ "blob_id": "fe28d7f9c84880b3bfe746fa5fd5a98db5243d21", "branch_name": "refs/heads/main", "committer_date": 1619928035000, "content_id": "702885514a87451d8c166241307da1308c903863", "detected_licenses": [ "MIT" ], "directory_id": "d49d3eca655d9b52b7249c256e091a5672b6fdd5", "extension": "py", "file...
3.09375
stackv2
import numpy as np import imageio from PIL import Image import sys class stereoViterbi(): def endPointError(self, depthArray, gt): rows, cols = depthArray.shape error = np.sum(np.abs(depthArray - gt)) / (rows * cols) return error def errorRate(self, depthArray, gt): rows, cols ...
99
40.84
142
22
1,030
python
[]
0
true
2024-11-18T22:11:27.686033+00:00
1,686,577,427,000
1a2e8306918956d534de1bc935a87f0e3f9e4312
3
{ "blob_id": "1a2e8306918956d534de1bc935a87f0e3f9e4312", "branch_name": "refs/heads/master", "committer_date": 1686577427000, "content_id": "537a2eea2cc41f181fd13c34e8ff365986016ac7", "detected_licenses": [ "MIT" ], "directory_id": "0948f5944bcb95af55ac258d6104044ddbedab6b", "extension": "py", "fi...
2.71875
stackv2
# epd_async.py Demo of nano_gui asynchronous code. # Needs a large screen e.g. # https://www.waveshare.com/wiki/2.7inch_e-Paper_HAT # or 4.2" Waveshare Pico ePaper display. # Released under the MIT License (MIT). See LICENSE. # Copyright (c) 2020-2022 Peter Hinch # color_setup must set landcsape False, asyn True and ...
127
30.09
98
16
1,211
python
[]
0
true
2024-11-18T22:11:28.078508+00:00
1,618,605,866,000
5b63af9c7704d94141ea276cb7bdc95467c9b46e
3
{ "blob_id": "5b63af9c7704d94141ea276cb7bdc95467c9b46e", "branch_name": "refs/heads/main", "committer_date": 1618605866000, "content_id": "eb57bbb9a91f24852eb35a40cf7a2b0a1257aa52", "detected_licenses": [ "MIT" ], "directory_id": "169607b7367203b983e50f5e609cff5b3d03b401", "extension": "py", "file...
2.640625
stackv2
#!/usr/bin/env python3 # coding=utf-8 from struct import calcsize ''' disambiguation of struct keys as used in F1 2020 telemetry uint8 unsigned char B int8 signed char b uint16 unsigned short H int16 short h float f uint64 unsigned long long Q ''' header = "<HBBBBQfIBB" #structu...
128
26.42
88
11
1,060
python
[]
0
true
2024-11-18T22:11:28.130194+00:00
1,521,598,529,000
b39fc53d3343eabb683d9eb5264de490dca7b8c1
3
{ "blob_id": "b39fc53d3343eabb683d9eb5264de490dca7b8c1", "branch_name": "refs/heads/master", "committer_date": 1521598529000, "content_id": "34693fa027eb48d0392b78a6905dab7ae0907efc", "detected_licenses": [ "MIT" ], "directory_id": "50c51e40abbed5f8fe07399df61ffb3c8e648c06", "extension": "py", "fi...
2.875
stackv2
import subprocess import re class NmapWrapper: ip_addr_regex = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}') router_regex = re.compile('Nmap scan report for gateway') NMAP_COMMAND = 'sudo nmap -p 22,80,445,65123,56123 -O 192.168.0.*' def __init__(self): self.router_ip = None self.t...
38
32.61
94
18
340
python
[]
0
true
2024-11-18T22:11:28.237542+00:00
1,583,036,273,000
a6e12a6780b7120b1abbdb34de4c8289d69d7ca3
3
{ "blob_id": "a6e12a6780b7120b1abbdb34de4c8289d69d7ca3", "branch_name": "refs/heads/master", "committer_date": 1583036273000, "content_id": "3401e7507db16060c32472b5316b7b490dd97964", "detected_licenses": [ "MIT" ], "directory_id": "39f06a517576bced6c1f7c228e907287a6ab221c", "extension": "py", "fi...
2.65625
stackv2
from .DatabaseConnector import DatabaseConnector from .FileDataManager import FileDataManager import logging class DatabaseDataManager: def __init__(self, db_host, db_username, db_password, db_name): self.connector = DatabaseConnector(db_host, db_username, db_password, db_name) self.insert_statem...
140
40.22
105
20
1,128
python
[]
0
true
2024-11-18T22:11:28.287950+00:00
1,596,087,036,000
d5bb142e961c85625b1a9cd0f456f9c7913a19bc
2
{ "blob_id": "d5bb142e961c85625b1a9cd0f456f9c7913a19bc", "branch_name": "refs/heads/master", "committer_date": 1596087036000, "content_id": "18d39385215b1bddc2149cae2029c35b32405a52", "detected_licenses": [ "MIT" ], "directory_id": "eeeacb9258ac76ad1c967d5d79edcf8fd1cc9afa", "extension": "py", "fi...
2.5
stackv2
class Anime(): def __init__(): return def get_anime_details(self, id): id = str(id) params = { 'fields': ','.join(self.anime_fields), } uri = f'anime/{id}' return self._api_handler.call(uri, params=params) # need pagination here def search_a...
59
29.75
77
13
434
python
[]
0
true
2024-11-18T22:11:28.382873+00:00
1,636,121,300,000
236e0baf300f14c8ceebaf729c5335f5ebf48e5a
3
{ "blob_id": "236e0baf300f14c8ceebaf729c5335f5ebf48e5a", "branch_name": "refs/heads/master", "committer_date": 1636121300000, "content_id": "b777cc1562c92f0e7fe3dd30a699917effb19089", "detected_licenses": [ "MIT" ], "directory_id": "a13e3f41abc70b25160b4935fa4df07090a76799", "extension": "py", "fi...
2.71875
stackv2
#!/usr/bin/env python # coding: utf-8 # # Load libraries # import pandas as pd # manipulate dataframes import matplotlib import matplotlib.pyplot as plt # plotting import numpy as np import time, h5py, imelt, torch, os from sklearn.metrics import mean_squared_error from tqdm import tqdm # First we check if CUDA i...
85
31.98
131
15
678
python
[]
0
true
2024-11-18T22:11:28.498758+00:00
1,621,604,903,000
2a2dea01f781ac01e24dc99294951c0a7f0585f2
3
{ "blob_id": "2a2dea01f781ac01e24dc99294951c0a7f0585f2", "branch_name": "refs/heads/main", "committer_date": 1621604903000, "content_id": "6221e6ae96393c655dac10a83422320769998ea1", "detected_licenses": [ "MIT" ], "directory_id": "7fad93d1f6ad4b51d22a78ea31bbb0408f7ccff4", "extension": "py", "file...
3.015625
stackv2
class InvalidToken(Exception): """An Exception Raised When an Invalid Token was Supplied.""" def __init__(self): super(InvalidToken, self).__init__("An Invalid Bearer Token was Supplied to Weverse.") class PageNotFound(Exception): r""" An Exception Raised When a link was not found. Parame...
24
29.25
94
11
164
python
[]
0
true
2024-11-18T22:11:29.225346+00:00
1,592,281,968,000
7403bc25dffd01a7468612f712588c7c5be7e206
3
{ "blob_id": "7403bc25dffd01a7468612f712588c7c5be7e206", "branch_name": "refs/heads/master", "committer_date": 1592281968000, "content_id": "1d1c49ef5a3638ac20ebfe792af7e650477c3e6f", "detected_licenses": [ "MIT" ], "directory_id": "6189a9d1361c57aded429d811874808b28509381", "extension": "py", "fi...
2.90625
stackv2
# This file will run the sequence of code that will pull all workspaces, channels, groups and threads from your user scope. # Please go through the README for instructions on how to configure and run. import files import connect # Read the oauth key. auth_key_file = open("oauth_key.txt","r") auth_key = auth_key_file....
101
35.65
123
17
857
python
[]
0
true
2024-11-18T22:11:29.272318+00:00
1,681,117,027,000
c02242a48a5cd17b80c30c27ccd8fcade6658562
3
{ "blob_id": "c02242a48a5cd17b80c30c27ccd8fcade6658562", "branch_name": "refs/heads/master", "committer_date": 1681117027000, "content_id": "be4f72ae05b08f5410171fb3ff1d1a4c72f0e23d", "detected_licenses": [ "MIT" ], "directory_id": "096ab431340d348cccefd2ece72da225603b4dbc", "extension": "py", "fi...
2.953125
stackv2
""" Created on 10 Jan 2017 @author: Sergey Denisov """ from functools import wraps from typing import Any from time import sleep import inspect def development_mode(dev: bool, with_return: Any): def decorator_function(func): @wraps(func) def inner(*args, **kwargs): if not dev: ...
122
25.32
131
20
733
python
[]
0
true
2024-11-18T22:11:29.422447+00:00
1,607,797,565,000
812de2b5be1d1527955790e39a04586e8dbb54bf
3
{ "blob_id": "812de2b5be1d1527955790e39a04586e8dbb54bf", "branch_name": "refs/heads/main", "committer_date": 1607797565000, "content_id": "4012b3ddb9079c778b3c07fd569818e789e40393", "detected_licenses": [ "MIT" ], "directory_id": "9acbbab24f239612a9a64914922e99da01c34d57", "extension": "py", "file...
2.859375
stackv2
import joblib class Churn: def __init__(self): self.scaler = joblib.load('../parameters/minmaxscaler_cycle3.joblib') def data_cleaning(self, df1): new_columns = {'Age': 'age', 'Balance': 'balance', 'NumOfProducts': 'num_of_products'} df1.rename(columns=new_columns, inplace...
25
32.84
94
11
202
python
[]
0
true
2024-11-18T22:11:30.564506+00:00
1,540,658,464,000
62440f66e91bd82163a172fdb7d5b933b0d62c64
3
{ "blob_id": "62440f66e91bd82163a172fdb7d5b933b0d62c64", "branch_name": "refs/heads/master", "committer_date": 1540658464000, "content_id": "968841703e928cf65d29a8172ae2f461720b658d", "detected_licenses": [ "MIT" ], "directory_id": "91c4b223cb5d8ae9c99cdba09ec347685f979058", "extension": "py", "fi...
3.28125
stackv2
from nltk.corpus import brown class Corpus: """ Corpus wrapper that normalizes a pos-tagged corpus by setting all words to lowercase """ def __init__(self, tagged_sentences): """ :param tagged_sentences: list of lists of tuples, where each list is a sentence and each tuple is a token ...
56
29.71
120
16
406
python
[]
0
true
2024-11-18T22:11:30.898097+00:00
1,692,884,989,000
8f28e1446b2112acbce259c0a05e3d2efc96f15e
3
{ "blob_id": "8f28e1446b2112acbce259c0a05e3d2efc96f15e", "branch_name": "refs/heads/master", "committer_date": 1692884989000, "content_id": "6b1d57430acdcc0bdb05ce722dc388c76bb71e27", "detected_licenses": [ "Apache-2.0" ], "directory_id": "080db1ae362de6823e7c78ab6071c82e347ce967", "extension": "py"...
2.625
stackv2
from pydantic import BaseModel from typing import Dict def _to_camel_case(snake_str: str) -> str: components = snake_str.split('_') # We capitalize the first letter of each component except the first one # with the 'title' method and join them together. return components[0] + ''.join(x.title() for x i...
26
27.15
91
11
178
python
[]
0
true
2024-11-18T22:11:30.981171+00:00
1,557,848,801,000
83e7ee3d751ad671201219136ae2637c6a261375
3
{ "blob_id": "83e7ee3d751ad671201219136ae2637c6a261375", "branch_name": "refs/heads/master", "committer_date": 1557848801000, "content_id": "66a27f70ab75946475a5d5da2cfc4fb6e23366aa", "detected_licenses": [ "MIT" ], "directory_id": "aac26984e0e869a6a6a604b7b249c8b6c4b13803", "extension": "py", "fi...
3.15625
stackv2
import numpy as np import os from .SearchForFile import SearchForFile from .SearchForFilePattern import SearchForFilePattern def FindPDSFiles(InPath,FMTname,FilePattern): ''' Searches a directory (InPath) for a .fmt file and for all of the data files. Inputs: InPath: An absolute path to the folder which conta...
41
31
66
12
352
python
[]
0
true
2024-11-18T22:11:31.045512+00:00
1,532,043,324,000
f82dcefb7aa5017b5153e6c109df9244ee99f4b3
2
{ "blob_id": "f82dcefb7aa5017b5153e6c109df9244ee99f4b3", "branch_name": "refs/heads/master", "committer_date": 1532043324000, "content_id": "f667a9b6e4b5f297ffe0af8359f70f16cf263caa", "detected_licenses": [ "Apache-2.0" ], "directory_id": "09e5c8b938dcdcec91cdb21092ed5ff9feecfc56", "extension": "py"...
2.328125
stackv2
import logging import time import sys from btfxwss import BtfxWss log = logging.getLogger(__name__) fh = logging.FileHandler('test.log') fh.setLevel(logging.DEBUG) sh = logging.StreamHandler(sys.stdout) sh.setLevel(logging.DEBUG) log.addHandler(sh) log.addHandler(fh) logging.basicConfig(level=logging.DEBUG, handler...
46
21.11
59
11
302
python
[]
0
true
2024-11-18T22:11:31.093574+00:00
1,660,867,759,000
c601e1f16557716a19f326990fa8e75cf665dad5
2
{ "blob_id": "c601e1f16557716a19f326990fa8e75cf665dad5", "branch_name": "refs/heads/master", "committer_date": 1660867759000, "content_id": "2b28f066e831da3c4d00fcb1465787fdd7285426", "detected_licenses": [ "MIT" ], "directory_id": "be879e2ecd58202003a3ea65d0bf5914cfce8188", "extension": "py", "fi...
2.328125
stackv2
""" Dump FITS format data to JSON format for display on website. """ import json import click from astropy.table import Table def _dump_json(data, filename): click.secho('Writing {}'.format(filename), fg='green') with open(str(filename), 'w') as fh: json.dump(data, fh) fh.write('\n') table = T...
57
24.82
127
12
482
python
[]
0
true
2024-11-18T22:11:31.211354+00:00
1,563,204,980,000
e49b5885d05b628f08b96ecdb86e480b8df1d26d
2
{ "blob_id": "e49b5885d05b628f08b96ecdb86e480b8df1d26d", "branch_name": "refs/heads/master", "committer_date": 1563204980000, "content_id": "78c108cf27e3149aded7597e4694444b3f7a4bbe", "detected_licenses": [ "MIT" ], "directory_id": "d13d809413ce79d79d08c41e35d07324fe0616ea", "extension": "py", "fi...
2.40625
stackv2
import logging import json import asyncio import time from tile_fetch import load_tiles from upload import upload_file logger = logging.getLogger() logger.setLevel(logging.INFO) logger.info('Loading function') def lambda_handler(event, context): logger.info('-=-=-=-=-=-= event -=-=-=-=-=-=') logger.info(even...
42
26.48
66
14
271
python
[]
0
true
2024-11-18T22:11:31.268884+00:00
1,605,677,505,000
4dd0b5fcb3011ee9ea3b1009b45223e4a7fef3eb
3
{ "blob_id": "4dd0b5fcb3011ee9ea3b1009b45223e4a7fef3eb", "branch_name": "refs/heads/main", "committer_date": 1605677505000, "content_id": "7f401ada3c37b176e5a30171034066e391272ede", "detected_licenses": [ "MIT" ], "directory_id": "aac8a771e69aae9850db2a4eb0d713984ddccbb0", "extension": "py", "file...
2.640625
stackv2
#! /usr/bin/python3 from authordetect import Author, Tokenizer, SmartTimer # NOTE: Set PYTHONHASHSEED to constant value to have deterministic hashing # across Python interpreter processes. import os os.environ['PYTHONHASHSEED'] = str(0) ###################### # User Configuration # ###################### infile = '...
53
21.62
74
9
306
python
[]
0
true
2024-11-18T22:11:31.317841+00:00
1,480,000,762,000
a675a988922d96ad5951f8cbcd249939e1cd37d4
3
{ "blob_id": "a675a988922d96ad5951f8cbcd249939e1cd37d4", "branch_name": "refs/heads/master", "committer_date": 1480000762000, "content_id": "2ff078a1287db862f7dd24ab79d5a7c16f2c14e4", "detected_licenses": [ "MIT" ], "directory_id": "d0cd3c2355d4afdc7d58cc7ba789387ef42a4e52", "extension": "py", "fi...
2.546875
stackv2
# -*- coding: utf-8 -*- # @Author: cody kochmann # @Date: 2016-11-23 07:52:40 # @Last Modified 2016-11-24 # @Last Modified time: 2016-11-24 10:10:01 from functools import wraps import logging class default_output(object): """ returns the backup plan if the decorated method fails by: Cody Kochmann """ ...
25
32.72
76
14
215
python
[]
0
true
2024-11-18T22:11:31.390214+00:00
1,518,031,233,000
fbcf5e86a87f40df07b5dfdcb097a93303848447
3
{ "blob_id": "fbcf5e86a87f40df07b5dfdcb097a93303848447", "branch_name": "refs/heads/master", "committer_date": 1518031233000, "content_id": "61de62141fe7148a35eba0ff44cb4ae398fe576b", "detected_licenses": [ "MIT" ], "directory_id": "5ea68b963af59a5031afdeebb2b63f97f2f84d12", "extension": "py", "fi...
3.09375
stackv2
# -*- coding: utf-8 -*- import sqlite3 conn = sqlite3.connect("example.db") conn.row_factory = sqlite3.Row def get_all_with_options(options): cursor = conn.cursor() query = "SELECT * FROM hotel" option_query = " WHERE " valid_options = 0 for option in options: if option[0] == 'name': ...
67
30.58
113
17
505
python
[]
0
true
2024-11-18T22:11:31.675538+00:00
1,489,155,173,000
89ed159bc482b936d056db4c2f664e6f3feba4e4
3
{ "blob_id": "89ed159bc482b936d056db4c2f664e6f3feba4e4", "branch_name": "refs/heads/master", "committer_date": 1489155173000, "content_id": "3aacd6441e3cc6240b4f9958598c1535b4a28247", "detected_licenses": [ "MIT" ], "directory_id": "c14863962358ef14b390aef405906195879f3f3d", "extension": "py", "fi...
2.625
stackv2
from linguistic_treatment import CACMLinguisticTreatment from settings import CACM, CACM_PATH, CS276, CS276_PATH, DOC_IDS_PATH, INDEX_PATH, \ PREFIX, INITIAL_MARKER, TERM_IDS_PATH, TITLE_MARKER from collections import Counter from copy import copy from itertools import zip_longest import os class Index(object):...
332
41.81
128
23
3,179
python
[]
0
true
2024-11-18T22:11:31.839322+00:00
1,547,525,289,000
512f74206b1fd56ffd5772df4faa441f16d50e29
3
{ "blob_id": "512f74206b1fd56ffd5772df4faa441f16d50e29", "branch_name": "refs/heads/master", "committer_date": 1547525289000, "content_id": "d08caa8b8417148a7b7899e441d67577da1f2c1b", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "eb1bb61df95e400e1dc0755fc76d7a77ee922e62", "extension": "p...
2.90625
stackv2
#Copyright (c) 2013-2018 Hanson Robotics, Ltd. from functools import update_wrapper def get_enclosed(func, typ): """Return values in func's closure of type typ as a dictionary, which maps their position in the cell list to the actual values.""" cells = {i: cell.cell_contents for i, cell in enumerate(func._...
58
31.17
78
11
463
python
[]
0
true
2024-11-18T22:11:31.886476+00:00
1,636,530,683,000
a3318ae74f7a769fc726659b6336de49a1598965
2
{ "blob_id": "a3318ae74f7a769fc726659b6336de49a1598965", "branch_name": "refs/heads/master", "committer_date": 1636530683000, "content_id": "6ea9d9c67bfb22de4f07e5031155c563ccc8f309", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9bfb73079afd1d5555c9662ec53f42905f65f22b", "extension": "py"...
2.5
stackv2
import tensorflow as tf import nibabel as nib import os from utils.myfuncs import * from utils.hausdorff_util import * # Compute Accuracy from data_loader.data_loader import DataGenerator from models.lvae_mlp import lvae_mlp from utils.config import process_config from utils.utils import get_args def testing(config):...
98
36.47
112
18
850
python
[]
0
true
2024-11-18T22:11:32.072959+00:00
1,638,966,352,000
f6ca502907810cdb5ae97dfccdafe1ee6dc476d5
3
{ "blob_id": "f6ca502907810cdb5ae97dfccdafe1ee6dc476d5", "branch_name": "refs/heads/master", "committer_date": 1638966352000, "content_id": "c62be32faffb5084a38619b6347e830183f098da", "detected_licenses": [ "MIT" ], "directory_id": "cf96012ef7502cec83901a873bf694f5d6063186", "extension": "py", "fi...
3.109375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'MICROYU' import json color2num = dict( gray=30, red=31, green=32, yellow=33, blue=34, magenta=35, cyan=36, white=37, crimson=38 ) def colorize(string, color, bold=False, highlight=False): """ Colorize a string. ...
73
26.04
86
19
513
python
[]
0
true
2024-11-18T22:11:32.189728+00:00
1,613,179,609,000
a14971229dd10bbf9c7dfd17279968e09c032f17
3
{ "blob_id": "a14971229dd10bbf9c7dfd17279968e09c032f17", "branch_name": "refs/heads/main", "committer_date": 1613179609000, "content_id": "a86df99a7efec89b79c6855450d0655e11283c6b", "detected_licenses": [ "CC0-1.0" ], "directory_id": "4ab658da446555037dd748f5c503859ab6e243f2", "extension": "py", "...
3.0625
stackv2
class Display_Body(): ##! ##! Generates HTML BODY. ##! def Display_Body(self): html=[] html=html+[ self.XML_Tag_Start("BODY") ] args={ "width": "100%", "border": "1", } html=html+[ self.XML_Tag_Start("TABLE",...
70
23.43
78
17
421
python
[]
0
true