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-19T01:43:02.947935+00:00
1,585,925,324,000
d8bab637be37aa09043e8d04a21240453c0add23
2
{ "blob_id": "d8bab637be37aa09043e8d04a21240453c0add23", "branch_name": "refs/heads/master", "committer_date": 1585925324000, "content_id": "13d5f02133f1641fc741816173e0004c713e3443", "detected_licenses": [ "MIT" ], "directory_id": "fe230e6ea75a1bb4be0e351c7f3e189c14327821", "extension": "py", "fi...
2.4375
stackv2
import pandas as pd import numpy as np import os import sys os.chdir("../../../dynamic-reproducibility") sys.path.append('utils') from terminal_outputs import printProgressBar from confs import Config QUERIES = Config.chicago_queries CLUSTERS = Config.chicago_clusters if not os.path.exists('input/Crimes_Workload'): ...
85
40.88
157
15
1,025
python
[]
0
true
2024-11-19T01:43:03.162685+00:00
1,568,097,772,000
18c2226f9be707528e39e21b920eaf22f08a20e9
2
{ "blob_id": "18c2226f9be707528e39e21b920eaf22f08a20e9", "branch_name": "refs/heads/master", "committer_date": 1568097772000, "content_id": "285d8e66eb74f34f99fdcbcbf9e739155f2184b3", "detected_licenses": [ "MIT" ], "directory_id": "83ad51c9f7ea71eefcf38882ac9b20d514332a0b", "extension": "py", "fi...
2.328125
stackv2
from . import main from flask import render_template,redirect,request,url_for from app.requests import getNews,getSearchItem,getArticles # Insert home page view @main.route('/') def home(): """ homepage route """ title = "Welcome to Newsrecapp" news = getNews() return render_template('index.html',sources =...
35
29.83
86
13
248
python
[]
0
true
2024-11-19T01:43:03.275467+00:00
1,618,831,291,000
414ab79a4ade5f6580615cc63d0e6bfcd076b5b9
3
{ "blob_id": "414ab79a4ade5f6580615cc63d0e6bfcd076b5b9", "branch_name": "refs/heads/master", "committer_date": 1618831291000, "content_id": "c944f4115e3bd5ffc61d5c6c092aa702c7668c3e", "detected_licenses": [ "MIT" ], "directory_id": "4372b3f8aff592d3d447e76bef21fbc1d11b8d21", "extension": "py", "fi...
2.578125
stackv2
from django.db import models from . import BaseModel class Schema(BaseModel): COMMA = ',' SEMICOLON = ';' COLON = ':' COLUMN_SEPARATOR = [ (COMMA, 'Comma (,)'), (SEMICOLON, 'Semicolon(;)'), (COLON, 'Colon(:)'), ] QUOTE = "'" DOUBLE_QUOTE = '"' STRING_CHARACTER =...
39
22.64
74
10
227
python
[]
0
true
2024-11-19T01:43:05.796585+00:00
1,521,557,028,000
fccab3cd4221e2a0a8d8bcf21150f419adc13bb6
3
{ "blob_id": "fccab3cd4221e2a0a8d8bcf21150f419adc13bb6", "branch_name": "refs/heads/master", "committer_date": 1521557028000, "content_id": "d9c3cf6547e42e5bab12e1fb8504fb7d30ee4dc1", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e18e5d6e4977280952ef3c920ede6aae71f897b1", "extension": "py"...
2.984375
stackv2
import discord from discord.ext import commands import aiohttp import json class Animals: def __init__(self, client): self.client = client self.session = aiohttp.ClientSession() @commands.command(name='rd', pass_context=True) async def random_dog(self, ctx, *args): """ ge...
59
27.39
79
20
368
python
[]
0
true
2024-11-19T01:43:08.399074+00:00
1,630,733,693,000
685da1b346980640b79c50776c6e3acefc8741b1
2
{ "blob_id": "685da1b346980640b79c50776c6e3acefc8741b1", "branch_name": "refs/heads/main", "committer_date": 1630733693000, "content_id": "91286910848fc0e97634bab98921f00b13735c40", "detected_licenses": [ "Unlicense" ], "directory_id": "43cfb676f6703d0a6132f0f1f96b5927a6dfac53", "extension": "py", ...
2.421875
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- from _lark.card.modules import Module from typing import List, Optional class CardConfig: def __init__(self, wide_screen_mode: bool = True, enable_forward: bool = True): self.wide_screen_mode = wide_screen_mode self.e...
29
26.03
67
11
170
python
[]
0
true
2024-11-19T01:43:08.633983+00:00
1,652,296,409,000
02ffc5f086fccff5593203df5eb5d8caceb48b95
3
{ "blob_id": "02ffc5f086fccff5593203df5eb5d8caceb48b95", "branch_name": "refs/heads/master", "committer_date": 1652296409000, "content_id": "d6e085ffcf2be8a6c46aa78af075a6cfbc006edc", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "3c3af05dbce543e90abaf30866f02c8093bf63bd", "extension": "p...
3.015625
stackv2
from typing import Iterable, Tuple, List from wagtail import VERSION if VERSION < (2, 0): from wagtail.wagtailcore.models import Page, Site else: from wagtail.core.models import Page, Site def build_page_tree( # Would that mypy supported recursive types tree: Iterable[Tuple[Page, Iterable]], roo...
72
25.71
75
14
435
python
[]
0
true
2024-11-19T01:43:08.693143+00:00
1,431,018,320,000
d35479999d4286b7d7b69941287942e6b909a46c
2
{ "blob_id": "d35479999d4286b7d7b69941287942e6b909a46c", "branch_name": "refs/heads/master", "committer_date": 1431018320000, "content_id": "c4d811f17244649985618c94d02bd0f12acb117c", "detected_licenses": [ "MIT" ], "directory_id": "aef93329edd6df903eb104d069451b1d02a51bb8", "extension": "py", "fi...
2.484375
stackv2
import subprocess import os from datepoints import GithubDatePoints from pixelsets import LettersPixelSet class Github(object): def __init__(self, string, cwd, dictionary): self.__string = string self.__dictionary = dictionary self.__cwd = os.path.abspath(cwd) self.commands = [] ...
45
33.82
100
15
370
python
[]
0
true
2024-11-19T01:43:18.110227+00:00
1,528,230,873,000
873860326d879bf948cfa0852c05fcac26989243
3
{ "blob_id": "873860326d879bf948cfa0852c05fcac26989243", "branch_name": "refs/heads/master", "committer_date": 1528230873000, "content_id": "e7e0d7ac8a1325a77d7b5bc0dc4392bfd896de79", "detected_licenses": [ "Apache-2.0" ], "directory_id": "94bde0b0e1c42b3e604ca3c9249ede2a5a05d12a", "extension": "py"...
2.96875
stackv2
#!/usr/bin/python # ---------------- READ ME --------------------------------------------- # This Script is Created Only For Practise And Educational Purpose Only # This Script Is Created For https://bitforestinfo.blogspot.in # This Script is Written By # # ################################################## ######## Pl...
50
28.32
94
12
306
python
[]
0
true
2024-11-19T01:43:18.153600+00:00
1,627,908,985,000
d98fc8a37f9074c4325a295c475c6745b0b79e45
4
{ "blob_id": "d98fc8a37f9074c4325a295c475c6745b0b79e45", "branch_name": "refs/heads/main", "committer_date": 1627908985000, "content_id": "7bffcd57105a122bfa0222afccf80458a13c2196", "detected_licenses": [ "MIT" ], "directory_id": "326f67ddb17d2126ada58285b105517db085a650", "extension": "py", "file...
3.703125
stackv2
import yfinance as yf import streamlit as st import pandas as pd st.write(""" # Simple Stock Price App Shown are the stock closing price and volume of Google! """) # https://towardsdatascience.com/how-to-get-stock-data-using-python-c0de1df17e75 #define the ticker symbol tickerSymbol = 'GOOGL' #get data on this tick...
22
26.09
80
8
176
python
[]
0
true
2024-11-19T01:43:18.274032+00:00
1,621,602,436,000
9a9f3399d7f823e4f16abea7d511fa212e633efd
3
{ "blob_id": "9a9f3399d7f823e4f16abea7d511fa212e633efd", "branch_name": "refs/heads/master", "committer_date": 1621602436000, "content_id": "4b72890d330848bab0b4bd610d1c265f0f76731c", "detected_licenses": [ "MIT" ], "directory_id": "605dbe3f437e011eacd6e9614514dc9eba5c35b1", "extension": "py", "fi...
2.921875
stackv2
import uuid from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from smtplib import SMTP, SMTP_SSL from typing import BinaryIO, List, Optional, Union class Mailer: """Object for send mail""" def __init__( self, ...
127
32.28
99
16
933
python
[]
0
true
2024-11-19T01:54:46.600743+00:00
1,632,729,639,000
9e22bcdb6e264059006904444a04ce6a6300a411
2
{ "blob_id": "9e22bcdb6e264059006904444a04ce6a6300a411", "branch_name": "refs/heads/master", "committer_date": 1632729639000, "content_id": "1c304fd07c92b9666cc4f024f111acb314da5bd6", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "07148f74e6f9929356aa68e8889c7d71525b6978", "extension": "p...
2.375
stackv2
#!/usr/bin/env python ########################################################################## # frontends/swig_python/python_rpyc_server.py # # Part of Project Thrill - http://project-thrill.org # # Copyright (C) 2015 Timo Bingmann <tb@panthema.net> # # All rights reserved. Published under the BSD-2 license in the L...
83
29.47
77
13
553
python
[]
0
true
2024-11-19T01:54:46.665061+00:00
1,578,379,747,000
f3420aa110cc13fcb03d1c722cbfbd76ee0c27b9
2
{ "blob_id": "f3420aa110cc13fcb03d1c722cbfbd76ee0c27b9", "branch_name": "refs/heads/master", "committer_date": 1578379747000, "content_id": "edc11574bca5c115d8096bbbde5bb5cc93217729", "detected_licenses": [ "Apache-2.0" ], "directory_id": "640e0cd0549c0047b467cc19f6b538b61d51aee3", "extension": "py"...
2.390625
stackv2
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
51
32.12
74
12
421
python
[]
0
true
2024-11-19T01:54:46.775280+00:00
1,631,544,871,000
6e19753f05da35fe6ceacc343c4b55de96b0220d
4
{ "blob_id": "6e19753f05da35fe6ceacc343c4b55de96b0220d", "branch_name": "refs/heads/main", "committer_date": 1631544871000, "content_id": "57cff9baa90a6adcc10a427025e4ad8d10dfb777", "detected_licenses": [ "MIT" ], "directory_id": "6c7cba2f1e80b023238a2657b7fe1f10272ff7a0", "extension": "py", "file...
3.75
stackv2
def flower_beds(beds: list): right_bed = beds[0][1] left_bed = beds[0][0] for i in range(1, len(beds)): if right_bed >= beds[i][0] and right_bed < beds[i][1]: right_bed = beds[i][1] elif beds[i][0] > right_bed: print(f'{left_bed} {right_bed}') left_bed = b...
18
32.78
71
15
182
python
[]
0
true
2024-11-19T01:54:46.944693+00:00
1,691,682,979,000
3cf4d35d8fcd8899cdfcdee1d2eae8d9e0055ae6
3
{ "blob_id": "3cf4d35d8fcd8899cdfcdee1d2eae8d9e0055ae6", "branch_name": "refs/heads/maint", "committer_date": 1691682979000, "content_id": "d54b91643c8e2d5004ffda7fd2a6dc1aabb62c59", "detected_licenses": [ "BSD-3-Clause", "MIT" ], "directory_id": "76f23cc69dc10c44bc7cf00b78e37db04c7a9c45", "exte...
2.625
stackv2
## NDA AWS Token Generator ## Author: NIMH Data Archives ## http://ndar.nih.gov ## License: MIT ## https://opensource.org/licenses/MIT import binascii import hashlib import logging import xml.etree.ElementTree as etree import sys if sys.version_info[0] == 2: import urllib2 as urllib_request else...
121
30.55
89
12
838
python
[{"finding_id": "codeql_py/weak-sensitive-data-hashing_631a910934060c31_a55e6d18", "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 (SHA1) that is inse...
1
true
2024-11-19T01:54:47.286246+00:00
1,606,712,310,000
b301a1d49fc643a0deeac75cc2b188a030b34b43
2
{ "blob_id": "b301a1d49fc643a0deeac75cc2b188a030b34b43", "branch_name": "refs/heads/master", "committer_date": 1606712310000, "content_id": "4742e7504cb9c77ecb3fadf2b31e1e51a9e3a8dc", "detected_licenses": [ "MIT" ], "directory_id": "c795ec7f77219892183a1222fb51b8be2e754944", "extension": "py", "fi...
2.421875
stackv2
import ClientAPI class PlayAnimation: def __init__(self, oid): self.OID = oid def CancelEffect(self): pass def UpdateEffect(self): pass def ExecuteEffect(self, sourceOID, animName): caster = ClientAPI.World.GetObjectByOID(sourceOID) ...
38
24.5
91
14
197
python
[]
0
true
2024-11-19T01:54:47.900457+00:00
1,464,164,760,000
e8537f10204f46b318402b7cdec8228abd477c94
3
{ "blob_id": "e8537f10204f46b318402b7cdec8228abd477c94", "branch_name": "refs/heads/master", "committer_date": 1464164760000, "content_id": "1d28f85c2b53590bb27fb9f261095ec477d30e8b", "detected_licenses": [ "MIT" ], "directory_id": "87f0a79711e71f9ae71071514d9de603b29d2e14", "extension": "py", "fi...
2.796875
stackv2
from config import redis_conn def has_fileid(file_id): return redis_conn.sismember("fileids", file_id) def add_fileid(file_id): redis_conn.sadd("fileids", file_id) def get_filename_by_id(file_id): return redis_conn.get("{0}:filename".format(file_id)) def set_filename_with_id(file_id, filename): retu...
22
28.32
71
10
159
python
[]
0
true
2024-11-19T01:54:47.963141+00:00
1,689,412,509,000
650aaf2560f65614a91a7d5854f2d20d1b6c8760
2
{ "blob_id": "650aaf2560f65614a91a7d5854f2d20d1b6c8760", "branch_name": "refs/heads/master", "committer_date": 1689412509000, "content_id": "45fb1809780cf40d8867cf679f1e67ba2c23ec29", "detected_licenses": [ "MIT" ], "directory_id": "b836a2aa3301da2f74d978b40f68165765821830", "extension": "py", "fi...
2.484375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017-2019 Random.Zebra (https://github.com/random-zebra/) # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. from random import choice import requests from misc impo...
76
30.12
87
15
607
python
[]
0
true
2024-11-19T01:54:48.032181+00:00
1,608,835,665,000
19ad736c4c499492aeb075940f9ae83d749fe123
3
{ "blob_id": "19ad736c4c499492aeb075940f9ae83d749fe123", "branch_name": "refs/heads/main", "committer_date": 1608835665000, "content_id": "a5e7220b909e5a25de84aafade8a40b8ba46762a", "detected_licenses": [ "MIT" ], "directory_id": "92197d3da9ceb3a91d2ce98fb9a3bea91e1723dc", "extension": "py", "file...
2.65625
stackv2
import tensorflow as tf from tensorflow.keras.layers import Input, Lambda, Dense, Flatten from tensorflow.keras.models import Model from tensorflow.keras.applications.resnet50 import ResNet50 from tensorflow.keras.applications.resnet50 import preprocess_input from tensorflow.keras.preprocessing import image from tensor...
59
27.19
89
10
410
python
[]
0
true
2024-11-19T01:54:48.150153+00:00
1,621,271,197,000
527f2d3f75840be8caa1d686cd967a8c9d97ff38
3
{ "blob_id": "527f2d3f75840be8caa1d686cd967a8c9d97ff38", "branch_name": "refs/heads/master", "committer_date": 1621271197000, "content_id": "328689f5f8eaeda0dab46cb6d13bbf114ccb9f7d", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "15fbe75198cc2646f843de9a795c1b3cb1b9bf21", "extension": "p...
2.96875
stackv2
import functools from enum import IntEnum from typing import ( Callable, Generator, Iterable, Iterator, List, Optional, Tuple, TypeVar, Union, ) from ..data_logging.data_recorder import DataRecorder from .candidate_converter import CandidateConverter class Type(IntEnum): V...
238
34.39
105
16
1,820
python
[]
0
true
2024-11-19T01:54:48.208282+00:00
1,608,588,137,000
233663103a8c8491a9e4a2ad7cc962dc963bf48f
3
{ "blob_id": "233663103a8c8491a9e4a2ad7cc962dc963bf48f", "branch_name": "refs/heads/master", "committer_date": 1608588137000, "content_id": "6ca74d0c8ddadd9814e8ed4b983e5dcf223f946a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "18f59fdb3f780416bd525f1b9df01f36ada30dbb", "extension": "py"...
2.71875
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Randall Balestriero" import symjax.tensor as T import matplotlib.pyplot as plt from symjax.viz import compute_graph x = T.random.randn((10,), name="x") y = T.random.randn((10,), name="y") z = T.random.randn((10,), name="z") w = T.Variable(T.ones(1), name="...
28
19.96
36
10
174
python
[]
0
true
2024-11-19T01:54:49.189246+00:00
1,624,802,116,000
a19aabbe91a7fb4c57869518e563fcc9fa376ad3
3
{ "blob_id": "a19aabbe91a7fb4c57869518e563fcc9fa376ad3", "branch_name": "refs/heads/master", "committer_date": 1624802116000, "content_id": "9ba033c4eaa1d62322973ca162807777cc3bf8b7", "detected_licenses": [ "MIT", "Apache-2.0" ], "directory_id": "75cbfb15ae671ac6564186cdbbf5aad74a317c66", "exten...
2.625
stackv2
from enum import Enum from labelbox.orm.db_object import DbObject from labelbox.orm.model import Field class AssetAttachment(DbObject): """ Asset attachment provides extra context about an asset while labeling. Attributes: attachment_type (str): IMAGE, VIDEO, TEXT, or IMAGE_OVERLAY attachmen...
25
28.32
78
11
158
python
[]
0
true
2024-11-19T01:54:49.425883+00:00
1,573,896,666,000
cecca567dc686ee3f24f95fab22d9d379bbaea55
3
{ "blob_id": "cecca567dc686ee3f24f95fab22d9d379bbaea55", "branch_name": "refs/heads/master", "committer_date": 1573896666000, "content_id": "53ac9fd6c1a33300b48501dbf7e3fe9e475c2bbf", "detected_licenses": [ "MIT" ], "directory_id": "174bb065ecb814cf4533cedfedeb16046b029de4", "extension": "py", "fi...
3.1875
stackv2
import pickle import pandas as pd import numpy as np from scipy.stats import poisson class FootballModel: """ Model that predict a game result between 2 internationals football teams """ def __init__(self, path: str): self.model = self.load_model(path) @staticmethod def load_mode...
27
20.11
49
14
128
python
[]
0
true
2024-11-19T01:54:49.719480+00:00
1,614,181,199,000
f86ccf95bfc05ff737449c5761bcce2b56701220
4
{ "blob_id": "f86ccf95bfc05ff737449c5761bcce2b56701220", "branch_name": "refs/heads/master", "committer_date": 1614181199000, "content_id": "f8cee38fc5522b6c4b4299451792d03cd5cef9bc", "detected_licenses": [ "MIT" ], "directory_id": "50008b3b7fb7e14f793e92f5b27bf302112a3cb4", "extension": "py", "fi...
4.09375
stackv2
# create blank class print "creating empty class object" print class A(object): pass # create hypothetical constructor print "defining class constructor" print "will set instance attribute \"a\"" print def init(cls, a): print "initializing the instance" print cls.__setattr__("a",a) # create new method print "...
87
16.1
64
8
382
python
[]
0
true
2024-11-19T01:54:49.910657+00:00
1,583,978,741,000
02262ebb47b577f6de1c9845338653e100136fb9
2
{ "blob_id": "02262ebb47b577f6de1c9845338653e100136fb9", "branch_name": "refs/heads/master", "committer_date": 1583978741000, "content_id": "ea43cead01cd86d2d73ecced4e4fc6719c556254", "detected_licenses": [ "MIT" ], "directory_id": "750065657aeb6d4d1f6a2445a5fe460e1769edcb", "extension": "py", "fi...
2.46875
stackv2
from .check import RemoteCheck from .exceptions import MissingExpectedValueError REPR = 'CheckFile' class CheckFile(RemoteCheck): MANDATORY = ['filename'] STAT_FLAGS = {'access_rights': r'%a', 'blocks_num': r'%b', 'byte_per_block': r'%B', 'dev_num':...
64
39.34
120
25
551
python
[]
0
true
2024-11-19T01:54:50.032500+00:00
1,540,848,435,000
8c2e5383f7676b97a33abd2f4db46db0cb9554c0
2
{ "blob_id": "8c2e5383f7676b97a33abd2f4db46db0cb9554c0", "branch_name": "refs/heads/master", "committer_date": 1540848435000, "content_id": "943ba91613bc6fd3fb6f6fdfea1e25266d584a55", "detected_licenses": [ "MIT" ], "directory_id": "ae5e669a085cda1fa6cd9378d754c88202975e3a", "extension": "py", "fi...
2.4375
stackv2
import logging import discord from discorrecd.events import EventManager log = logging.getLogger(__name__) _EVENT_METHODS = [ ('on_ready', 'ready'), ('on_resumed', 'resumed'), ('on_message', 'message'), ('on_message_delete', 'message_delete'), ('on_message_edit', 'message_edit'), ('on_typing...
85
34.64
107
14
700
python
[]
0
true
2024-11-19T01:54:50.102401+00:00
1,563,498,010,000
3721d7aab5e1c4609f4a59c0bdb3e2dc09b6ce85
3
{ "blob_id": "3721d7aab5e1c4609f4a59c0bdb3e2dc09b6ce85", "branch_name": "refs/heads/master", "committer_date": 1563498010000, "content_id": "d4aefc57becb47d5a1c14d64de48f503c7490b3c", "detected_licenses": [ "MIT" ], "directory_id": "b1caa1bcbf436372876894f09b0e180c9b7a6bd0", "extension": "py", "fi...
2.78125
stackv2
# -*- coding: UTF-8 -*- import re import os import hashlib class Storage(): def __init__(self, video_url: str) -> None: self.video_url = video_url def get_file_path(self) -> str: return 'subtitle_{0}.en.vtt'.format(re.sub( r'[^\w-]', '', hashlib.md5(str(self.video_url).encode('u...
18
22.22
89
20
109
python
[]
0
true
2024-11-19T01:54:50.215430+00:00
1,628,267,542,000
86895078069d1a1ba256620df6b6a6e6e245ea16
2
{ "blob_id": "86895078069d1a1ba256620df6b6a6e6e245ea16", "branch_name": "refs/heads/main", "committer_date": 1628267542000, "content_id": "0043841796c262fba0e966b788ff4fa33977e474", "detected_licenses": [ "MIT" ], "directory_id": "77892a5ab82e2c5285b5562fb1dee1015132101d", "extension": "py", "file...
2.328125
stackv2
from discord_slash.utils.manage_commands import create_option, create_choice import discord from discord.ext.commands import Bot from discord.ext import commands from discord_slash import cog_ext, SlashContext, SlashCommand from discord import DMChannel import re import asyncio import os guild_ids = [int(os.environ['...
106
39.97
77
18
939
python
[]
0
true
2024-11-19T01:54:50.668504+00:00
1,691,336,559,000
e70df4243dbed2d7da0947d1a01fa8b46aa02434
3
{ "blob_id": "e70df4243dbed2d7da0947d1a01fa8b46aa02434", "branch_name": "refs/heads/master", "committer_date": 1691336559000, "content_id": "47db7e2dadb9af9771b23021ab1ba3d21301e15e", "detected_licenses": [ "MIT" ], "directory_id": "ff6fd44d205ff9ee6e54b660f454d90f240ecf1b", "extension": "py", "fi...
2.75
stackv2
""" -*- coding: utf-8 -*- ======================== AWS Lambda ======================== Contributor: Chirag Rathod (Srce Cde) ======================== """ import os import json import boto3 import pandas as pd def lambda_handler(event, context): BUCKET_NAME = os.environ["BUCKET_NAME"] PREFIX = os.environ["PR...
72
24.4
81
18
439
python
[]
0
true
2024-11-19T01:54:50.752644+00:00
1,321,892,102,000
44583d0404757d68c24727379cf73cafccfb75c8
3
{ "blob_id": "44583d0404757d68c24727379cf73cafccfb75c8", "branch_name": "refs/heads/master", "committer_date": 1321892102000, "content_id": "a609766528ef658efcac053a15f975fb1d152821", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "ea004ba957ca1d44345a66aa13dd43aa99459e1e", "extension": "p...
2.53125
stackv2
# -*- coding: utf-8 -*- from __future__ import unicode_literals # unicode by default from datetime import datetime from sqlalchemy import Column, UnicodeText, Boolean, Integer, ForeignKey, \ DateTime, Unicode from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.hybrid import hyb...
127
37.43
77
15
1,100
python
[]
0
true
2024-11-19T01:54:50.857276+00:00
1,530,754,184,000
d6c5ee0527e04127a0f8fca3c349493295a3dddb
3
{ "blob_id": "d6c5ee0527e04127a0f8fca3c349493295a3dddb", "branch_name": "refs/heads/master", "committer_date": 1530754184000, "content_id": "6f27e4ca52b27c15c6e1588f53a8264a2dea1256", "detected_licenses": [ "MIT" ], "directory_id": "939885781d727a0ec6a2839faeb7277ac925a42c", "extension": "py", "fi...
2.671875
stackv2
import codecs import json import numpy as np from gensim.models import Word2Vec from keras.layers import Embedding # tokenizing function def tokenize(sentence): result = sentence.replace('\n', '').split(' ') return(result) # create embeddings with gensim def create_embeddings(file_name, ...
54
31.43
100
14
413
python
[]
0
true
2024-11-19T01:54:50.910383+00:00
1,544,324,372,000
b6a64f02808665cd79e0e38cec4182ae31b1aeb6
4
{ "blob_id": "b6a64f02808665cd79e0e38cec4182ae31b1aeb6", "branch_name": "refs/heads/master", "committer_date": 1544324372000, "content_id": "526f622485245e4248f25290fa3545036c7c97bd", "detected_licenses": [ "Unlicense" ], "directory_id": "db46eece6bdc7c72eb648fd84d3e0c879883ecb6", "extension": "py",...
4
stackv2
""" # PROBLEM 9 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2 For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. """ from math import ceil # Okay, so obviously a, b, and c must b...
37
36.22
95
14
437
python
[]
0
true
2024-11-19T01:54:50.967513+00:00
1,430,214,365,000
a95617a9165a5ac94f00b63b5dfc1a30b3eb0a70
3
{ "blob_id": "a95617a9165a5ac94f00b63b5dfc1a30b3eb0a70", "branch_name": "refs/heads/master", "committer_date": 1430214365000, "content_id": "9cb8ac12e6736046d0db84cb096952383d8d0a98", "detected_licenses": [ "MIT" ], "directory_id": "16fd1d27db50e1dcbcdd2ece09eb426aa7f38030", "extension": "py", "fi...
2.59375
stackv2
# -*- coding: utf-8 -*- import nltk from ... import config if "simple" in config.engines: labels = config.engines["simple"]["labels"] def convert_label(label): if label in labels: return labels[label] else: print "simple:",label return label # see http://timmcnamara.co.nz/post/2650550090/extracting-names...
28
26.93
114
17
218
python
[]
0
true
2024-11-19T01:54:51.083782+00:00
1,623,746,468,000
b2ea62a67517d480d144f947682cbc45f91a54fd
3
{ "blob_id": "b2ea62a67517d480d144f947682cbc45f91a54fd", "branch_name": "refs/heads/master", "committer_date": 1623746468000, "content_id": "9d5808ee3b2d77bdbd26d5d303a3e111fb50189a", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "ee0b9cd2424e634a212a6d9734af1eaedd40dfe0", "extension": "p...
2.515625
stackv2
################################################################################ #This software was developed by the University of Tennessee as part of the #Distributed Data Analysis of Neutron Scattering Experiments (DANSE) #project funded by the US National Science Foundation. # #See the license text in license.txt ...
188
39.05
86
16
1,916
python
[]
0
true
2024-11-19T01:54:51.625559+00:00
1,508,937,942,000
c201d744e3816e90aa560fd224356d49f8bf8023
2
{ "blob_id": "c201d744e3816e90aa560fd224356d49f8bf8023", "branch_name": "refs/heads/master", "committer_date": 1508937942000, "content_id": "312ce35825b2deb828293910b1de5cac4670a95e", "detected_licenses": [ "MIT" ], "directory_id": "6bc9b01dd7afc1c0f0bf6228910d206b7f0d8720", "extension": "py", "fi...
2.390625
stackv2
# -*- coding: utf-8 -*- import inspect from functools import partial import boto3 from django.conf import settings __author__ = 'dreipol GmbH' class Decorator(object): def __init__(self, function, *args, **kwargs): self.function = function @property def original_function(self): function...
81
28.26
104
14
491
python
[]
0
true
2024-11-19T01:54:52.540790+00:00
1,620,772,291,000
8d6fd962bec5fe715518ec83e07c0ac80c4f890f
3
{ "blob_id": "8d6fd962bec5fe715518ec83e07c0ac80c4f890f", "branch_name": "refs/heads/master", "committer_date": 1620772291000, "content_id": "4bde9100c8478180617b3ac586610b363a97cb5f", "detected_licenses": [ "MIT" ], "directory_id": "8c87bc3dca66de62c2e6aa8c9f5221d8ed4a1ece", "extension": "py", "fi...
2.78125
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 28 15:13:31 2019 @author: peter *** This program requires ffmpeg be installed in anaconda To install, run the following command in your anaconda terminal conda install -c conda-forge ffmpeg *** """ import h5py import numpy as np import matplotlib...
85
23.24
77
14
603
python
[]
0
true
2024-11-19T01:54:53.936835+00:00
1,527,014,119,000
16cc3c069856c264ed44ee11ea8fa6c01be2e152
3
{ "blob_id": "16cc3c069856c264ed44ee11ea8fa6c01be2e152", "branch_name": "refs/heads/master", "committer_date": 1527014119000, "content_id": "45616523f66873e9367de8bf90661f8a257a9785", "detected_licenses": [ "MIT" ], "directory_id": "9d5a833cc18cf290f018e74dc6c0c51895103401", "extension": "py", "fi...
3.109375
stackv2
#!/usr/bin/python # hat.py # # Script to grab one set of serial data and log it to a sql database # Requires a database and table to be set up already for the data # # Sources: # pyserial.readthedoc.io/en/latest/pyserial_api.html # pyserial.readthedoc.io/en/latest/shortintro.html # https://docs.python.org/3/lib...
61
29.82
107
17
519
python
[]
0
true
2024-11-19T01:54:54.003706+00:00
1,587,302,273,000
38bd5f417206f5c2cfa635acc84acde20c1f3543
3
{ "blob_id": "38bd5f417206f5c2cfa635acc84acde20c1f3543", "branch_name": "refs/heads/master", "committer_date": 1587302273000, "content_id": "c07fd7ddc108ee13af65bae4dea7c9c73b617856", "detected_licenses": [ "CC0-1.0" ], "directory_id": "28229c94427e42ecd6e504eeb92fcdbeae1091ba", "extension": "py", ...
2.859375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "Vinícius Madureira" __copyright__ = "Copyright 2020, Vinícius Madureira" __license__ = "Creative Commons Zero 1.0 Universal" __version__ = "0.01a" __maintainer__ = "Vinícius Madureira" __email__ = "viniciusmadureira@outlook.com" __status__ = "Testing" from...
60
31.28
141
17
403
python
[]
0
true
2024-11-19T01:54:54.125749+00:00
1,552,719,922,000
1fe4a523e8be6fd6b34630afb3237a9889bd6654
3
{ "blob_id": "1fe4a523e8be6fd6b34630afb3237a9889bd6654", "branch_name": "refs/heads/master", "committer_date": 1552719922000, "content_id": "9001d917e1b8e347542b4f7dd3a13df05d87bdac", "detected_licenses": [ "MIT" ], "directory_id": "ffe57560bea0e45be6eb6a1422cbc20fd8468737", "extension": "py", "fi...
3
stackv2
''' K-means Clustering (from scratch) with elbow method selection ''' import numpy as np import matplotlib.pyplot as plt from scipy.spatial.distance import euclidean import common.utils as ut # get data from: # https://www.kaggle.com/c/otto-group-product-classification-challenge TRN_DATA_PATH = 'datasets/otto-group...
186
27.04
79
19
1,446
python
[]
0
true
2024-11-19T01:54:54.232492+00:00
1,485,783,244,000
5adbe92b88cfa34c3d5d5bef206e82f6500e50b2
3
{ "blob_id": "5adbe92b88cfa34c3d5d5bef206e82f6500e50b2", "branch_name": "refs/heads/master", "committer_date": 1485783244000, "content_id": "7c9c792bcd298a501f1be25fd690b9ea0e989edc", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "60e006eb75b4d6786a4e679cde318f141c367b0b", "extension": "p...
2.9375
stackv2
import re import datetime import dateparser from .exceptions import SearchSyntaxError units = { 'd': datetime.timedelta(days=1), 'h': datetime.timedelta(hours=1), } def parse_date(value): match = re.match(r"^([\-\+])(\d+)([{}])".format(''.join(units)), value) if not match: returned = datepar...
32
21.59
80
14
169
python
[]
0
true
2024-11-19T01:54:54.369335+00:00
1,611,366,906,000
f7d49c73121475b443ca46a5c55c357751fe071b
3
{ "blob_id": "f7d49c73121475b443ca46a5c55c357751fe071b", "branch_name": "refs/heads/main", "committer_date": 1611366906000, "content_id": "9ca5c9d0c714eff9d5cb0e4ca5986f802da331be", "detected_licenses": [ "Apache-2.0" ], "directory_id": "a42fb6a9947211d7ebae45f2073c61e7d4c4ad9b", "extension": "py", ...
2.8125
stackv2
import matplotlib.pyplot as plt import numpy as np import csv import scipy.special as sc def binary_entropy(x): return -(sc.xlogy(x, x) + sc.xlog1py(1 - x, -x))/np.log(2) plt.rcParams.update({'font.size': 20}) with open('dcache', newline='\n') as csvfile: ic = list(csv.reader(csvfile)) icx = [float(x[0]) ...
34
30.09
91
12
340
python
[]
0
true
2024-11-19T01:54:54.553094+00:00
1,558,459,977,000
9f1f3be57cbfdbe8ac22d1c6ce2b950af3089122
3
{ "blob_id": "9f1f3be57cbfdbe8ac22d1c6ce2b950af3089122", "branch_name": "refs/heads/master", "committer_date": 1558459977000, "content_id": "2a3d9007c94883c398c0883fd7f00e749cfa2106", "detected_licenses": [ "MIT" ], "directory_id": "11f75121b7861795876cad114566f0c1ef1e3ef1", "extension": "py", "fi...
2.8125
stackv2
"""Script that checks for changes uploaded to the database by Tom through FileZilla and updates the master sheet to be the new sheet. Then, it alters the changelog.html file to reflect the changes. Uses pandas for the table changes and Beautiful Soup 4 for the html changes. Returns False if no changes are made and True...
111
39.91
107
17
1,024
python
[]
0
true
2024-11-19T01:54:54.615993+00:00
1,576,174,750,000
954aaf68abfc9029b48bd2e2490bcdc5be4e48f7
2
{ "blob_id": "954aaf68abfc9029b48bd2e2490bcdc5be4e48f7", "branch_name": "refs/heads/master", "committer_date": 1576201396000, "content_id": "d56c2fa082bc5b77fab112801d27844b276322c9", "detected_licenses": [ "MIT" ], "directory_id": "3faf1ff6b32134964f0e577f052575083cb235d1", "extension": "py", "fi...
2.4375
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- from matplotlib import pyplot as plt from sklearn.model_selection import train_test_split from sklearn.utils import shuffle from config import Config from data_loader import BehavioralDataset from models import BehavioralModel from tensorflow.keras.callbacks import ModelChe...
85
33.55
110
15
775
python
[]
0
true
2024-11-19T01:54:55.225221+00:00
1,691,580,764,000
92381d32a201fa564eeadff1a5b8ac9baa262728
3
{ "blob_id": "92381d32a201fa564eeadff1a5b8ac9baa262728", "branch_name": "refs/heads/main", "committer_date": 1691580764000, "content_id": "ecfdc60f15d0333853ffc1d3284d088797582953", "detected_licenses": [ "MIT" ], "directory_id": "6d9be7a09300d84c5394e927a31d0e4c82aa3943", "extension": "py", "file...
2.53125
stackv2
from ..core._geopandas import from_geopandas from ._ressources import read_remote_shapefile REPR = """ AR6 reference regions - Iturbide et al., 2020 Attributes ---------- all : Regions All regions (land + ocean). land : Regions Land regions only ocean : Regions Ocean regions only """ class ar6_cls: ...
93
20.82
81
16
478
python
[]
0
true
2024-11-19T01:54:55.969849+00:00
1,592,278,450,000
9616b410afd69602a47d94b73cbe3fe30943e12a
3
{ "blob_id": "9616b410afd69602a47d94b73cbe3fe30943e12a", "branch_name": "refs/heads/master", "committer_date": 1592278450000, "content_id": "81be946de277cc03bcd1d9600756698a40645ee3", "detected_licenses": [ "Apache-2.0" ], "directory_id": "239560e26d08bc398e3c1e6d53e7fb0b65f74d61", "extension": "py"...
2.71875
stackv2
# Copyright 2020 The Keras CV Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
114
48.06
120
17
1,246
python
[]
0
true
2024-11-19T01:54:56.087798+00:00
1,512,605,069,000
707802397e3b21f51ded1bfdb9b98e93fbdae8d6
3
{ "blob_id": "707802397e3b21f51ded1bfdb9b98e93fbdae8d6", "branch_name": "refs/heads/master", "committer_date": 1512605069000, "content_id": "3b3a2d8fcdf797a16dbb509a86717002ab267668", "detected_licenses": [ "MIT" ], "directory_id": "b2ca3bc0eaaf3dd430a2f5c118c01632d0a01143", "extension": "py", "fi...
2.609375
stackv2
import sqlite3 def connect(func): def func_wrapper(*args, **kwargs): conn = sqlite3.connect("myDB.db") return func(*args, **kwargs) conn.close() return func_wrapper #TODO check and edit function @connect def createUsers(conn): try: conn.execute('''CREATE TABLE USERS ...
79
25.62
71
12
518
python
[]
0
true
2024-11-19T01:54:56.152867+00:00
1,691,566,580,000
da9f86b3f19f4b8db14bc92c69aff0bf65193052
3
{ "blob_id": "da9f86b3f19f4b8db14bc92c69aff0bf65193052", "branch_name": "refs/heads/master", "committer_date": 1691566580000, "content_id": "0b359a50b1ac0200430fe8605d30abb4d93450e9", "detected_licenses": [ "MIT" ], "directory_id": "691b82da7c38a6c109088d8426ffa26175f4ff31", "extension": "py", "fi...
2.75
stackv2
# -*- coding: utf-8 -*- """ 定义一些任务的执行操作,将具体的操作从tasks.py里面抽离出来 每个任务需要饮用的模块放到函数里面引用,方便单独调试函数 """ import requests def get_link_status(url): """ 请求地址,返回请求状态和内容 @param url: @return: """ try: resp = requests.get(url, timeout=5, verify=False) except Exception: return 500, ...
255
32.4
90
22
2,159
python
[{"finding_id": "codeql_py/request-without-cert-validation_1fcc7e933dc682b3_f0267f36", "tool_name": "codeql", "rule_id": "py/request-without-cert-validation", "finding_type": "problem", "severity": "medium", "confidence": "medium", "message": "This request may run without certificate validation because [it is disabled]...
1
true
2024-11-19T01:54:56.202847+00:00
1,693,304,204,000
92e1607c4bb0cd0249ea633bf0afcfbac28f5ff3
3
{ "blob_id": "92e1607c4bb0cd0249ea633bf0afcfbac28f5ff3", "branch_name": "refs/heads/main", "committer_date": 1693304204000, "content_id": "0e07ce2f166e9bd88001e48a5a5a714169f232c3", "detected_licenses": [ "MIT" ], "directory_id": "2bc6b545b4207a92f771a9659d0363740f52b611", "extension": "py", "file...
3.15625
stackv2
""" Module for representing symbols not present in the periodic table Designed for fragment names, but more general terminology: name (e.g. fragname such as Im) symbol (chemical_symbol, from the periodic table) """ import amof.files.path import json from ase.data import chemical_symbols # Seventh line of the...
90
38.16
133
16
821
python
[]
0
true
2024-11-19T01:54:56.615465+00:00
1,553,282,358,000
28f28b3e3c978ebb449cfc50113e5fa50946dfea
2
{ "blob_id": "28f28b3e3c978ebb449cfc50113e5fa50946dfea", "branch_name": "refs/heads/master", "committer_date": 1553282358000, "content_id": "5d86ca3c990d72a40ff83c2a521c2e50ebf71153", "detected_licenses": [ "MIT" ], "directory_id": "55174bc174f53fe98ade8fecbd32334d940115f2", "extension": "py", "fi...
2.4375
stackv2
import logging import requests import bcdata log = logging.getLogger(__name__) def get_dem(bounds, out_file="dem.tif", dst_crs="EPSG:3005", resolution=25): """Get 25m DEM for provided bounds, write to GeoTIFF """ bbox = ",".join([str(b) for b in bounds]) # build request payload = { "ser...
34
26.32
95
15
262
python
[]
0
true
2024-11-19T01:54:56.962133+00:00
1,624,207,628,000
cf8530c9a219ea9953d95c612534e2e181df85b4
3
{ "blob_id": "cf8530c9a219ea9953d95c612534e2e181df85b4", "branch_name": "refs/heads/master", "committer_date": 1624207628000, "content_id": "bdadf85e1c5dcb6c45a0e707b1e66f4ed08f96be", "detected_licenses": [ "MIT" ], "directory_id": "da7bfeb4bec8dde569dbf2538a33b05f9da271c7", "extension": "py", "fi...
3.40625
stackv2
#!/usr/bin/env python3 from operator import itemgetter class Graph: def __init__(self, root, vertices=[]): self.root = root self.vertices = vertices self.result = [] # the latest result of running of the MST self.prev_result = [] self.genEdges() def calcWeigth(self, ...
142
29.64
88
16
1,081
python
[]
0
true
2024-11-19T01:54:57.020318+00:00
1,624,120,726,000
c7461e99e193f08b1db6796fb377c627014ebaf3
3
{ "blob_id": "c7461e99e193f08b1db6796fb377c627014ebaf3", "branch_name": "refs/heads/main", "committer_date": 1624120726000, "content_id": "9588a0cd829a2c3d078e01b875bb5373fbc5481d", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d197338cca23b2c64987358a7282e503f2c519e1", "extension": "py", ...
2.625
stackv2
import os import pandas as pd from torch.utils.data import Dataset, DataLoader from .data_parser import get_train_data, get_test_data from .feature_extractor import feature_transformer from loguru import logger from pathlib import Path import numpy as np import argparse from torch import nn import torch from PIL import...
136
33.51
104
15
1,132
python
[]
0
true
2024-11-19T01:54:57.176310+00:00
1,584,427,574,000
5c31164f3639f2c169e40101c9054dacea4bd3c5
4
{ "blob_id": "5c31164f3639f2c169e40101c9054dacea4bd3c5", "branch_name": "refs/heads/master", "committer_date": 1584427574000, "content_id": "123eea5930cb40c8cc24ce135f41d3e4aa9109df", "detected_licenses": [ "MIT" ], "directory_id": "efc4effa33c234b14344a141de986e4c2e78bfb2", "extension": "py", "fi...
4.125
stackv2
# Задачи на циклы и оператор условия------ # ---------------------------------------- ''' Задача 1 Вывести на экран циклом пять строк из нулей, причем каждая строка должна быть пронумерована. ''' for i in range(1, 6): print(i, 0) ''' Задача 2 Пользователь в цикле вводит 10 цифр. Найти количество введеных пользов...
128
16.47
92
11
733
python
[]
0
true
2024-11-19T01:54:57.362440+00:00
1,610,449,258,000
4899c4130b444e882d7274f3ab4f6e9f093952eb
2
{ "blob_id": "4899c4130b444e882d7274f3ab4f6e9f093952eb", "branch_name": "refs/heads/main", "committer_date": 1610449258000, "content_id": "3009881ed8ad79900581966d181a4ad3bc362b2e", "detected_licenses": [ "MIT" ], "directory_id": "b63062e7720fd33e5da70e1709b31bb818030efa", "extension": "py", "file...
2.484375
stackv2
import sys import os sys.path.append(os.path.abspath('Database')) sys.path.append(os.path.abspath('Errors')) sys.path.append(os.path.abspath('Utils')) from database import DatabaseManager from FormatErrors import * from IssuanceErrors import * from Models.AbstractModel import IModel from VerificaitionUtil import * impo...
69
32.25
69
14
512
python
[]
0
true
2024-11-19T01:54:57.644254+00:00
1,598,322,931,000
4d9ce905319a13f5d87eb896d207661cc317f66e
2
{ "blob_id": "4d9ce905319a13f5d87eb896d207661cc317f66e", "branch_name": "refs/heads/master", "committer_date": 1598322931000, "content_id": "f056a70d82b404d057a436498a64c515abe8d932", "detected_licenses": [ "Zlib" ], "directory_id": "0bbf35091b8b9ea10ce65ccdd0b9dbf459dc64ed", "extension": "py", "f...
2.328125
stackv2
from . import ExporterModel from . import LED_model from . import RuntimeModel class LED(ExporterModel.Module): def __init__(self, name=None): if not name: name = self.__class__.__name__ super(LED, self).__init__(name, visible=True) self.model = LED_model def set_runtime_h...
31
38.45
115
18
266
python
[]
0
true
2024-11-19T01:54:57.741677+00:00
1,620,417,005,000
194c2b1d7ff0a8eafbf9483b750a78f568ac6507
3
{ "blob_id": "194c2b1d7ff0a8eafbf9483b750a78f568ac6507", "branch_name": "refs/heads/master", "committer_date": 1620417005000, "content_id": "5e75b333f04a884f0e5c1da07483e2e3a2240125", "detected_licenses": [ "MIT" ], "directory_id": "ae0f90383fd4317e29e5ade4be50f825eeed0d71", "extension": "py", "fi...
3.3125
stackv2
def solution(name): change = [min(ord(letter) - ord('A'), ord('Z') - ord(letter) + 1) for letter in name] i, answer = 0, 0 while True: answer += change[i] change[i] = 0 if sum(change) == 0: return answer left, right = 1, 1 while change[i - left] == 0: ...
26
20.88
89
14
154
python
[]
0
true
2024-11-19T01:54:57.869462+00:00
1,576,138,941,000
dd8ee281bde128af06714456855babf9d4496cc6
2
{ "blob_id": "dd8ee281bde128af06714456855babf9d4496cc6", "branch_name": "refs/heads/master", "committer_date": 1576138941000, "content_id": "660ad99039c2f186036011d61d69be7fc10b6c74", "detected_licenses": [ "MIT" ], "directory_id": "c6ac78d7f7c1b39061e4f98a40e1f1c8f2a5d247", "extension": "py", "fi...
2.4375
stackv2
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import six.moves.urllib.parse as urlparse import time from bs4 import BeautifulSoup from requests import RequestException from school_api.client.api.base import BaseSchoolApi from school_api.client.api.utils.schedule_parse import Schedul...
185
37.19
109
22
1,543
python
[]
0
true
2024-11-19T01:54:57.913313+00:00
1,580,043,957,000
10a6f8b25df49c6a812393824c1c081f83364575
3
{ "blob_id": "10a6f8b25df49c6a812393824c1c081f83364575", "branch_name": "refs/heads/master", "committer_date": 1580043957000, "content_id": "3942bd4cbfc0ae03d3d7ace5d3448b3adfc668f0", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5ca1c80d00779af265624d2015d33f13de49c18e", "extension": "py"...
3.28125
stackv2
_num_names = ["one", "two", "three", "four", "five"] def count(i): if i < 1: raise ValueError("only numbers greater than zero are supported") if i > len(_num_names): return str(i) return _num_names[i-1] collective_nouns = ( (5, "group"), (10, "mob"), (25, "horde") ) def collec...
42
19.62
72
12
224
python
[]
0
true
2024-11-19T01:54:58.026853+00:00
1,689,758,026,000
4a1f93201ff19efba3a2c315a6c3f9db5a2c3dcb
3
{ "blob_id": "4a1f93201ff19efba3a2c315a6c3f9db5a2c3dcb", "branch_name": "refs/heads/main", "committer_date": 1689758026000, "content_id": "a2b8beea3f50a7aaf52f33099bb210e99a84b115", "detected_licenses": [ "MIT" ], "directory_id": "736f2a84daf2c7eb486c07070f7a2d1d87463c21", "extension": "py", "file...
2.5625
stackv2
import numpy as np import matplotlib.pylab as plt from .basewidget import BaseWidget from probeinterface.plotting import plot_probe from spikeinterface.postprocessing import compute_unit_locations from .utils import get_unit_colors class UnitLocalizationWidget(BaseWidget): """ Plot unit localization on pro...
109
30.28
105
15
747
python
[]
0
true
2024-11-19T01:54:58.280162+00:00
1,615,019,736,000
fcd1c2b6df008efe3201e788225899112ad38320
3
{ "blob_id": "fcd1c2b6df008efe3201e788225899112ad38320", "branch_name": "refs/heads/master", "committer_date": 1615019736000, "content_id": "546e2bd9857ba54d83f9e0d84088200d9675c082", "detected_licenses": [ "MIT" ], "directory_id": "155ee4b3936042b03ff4e63d2c229a4bdac001a3", "extension": "py", "fi...
3.21875
stackv2
import requests import sys import collections ### api_key = input("Введите свой Api Key: ") token = input('Введите свой Token: ') board_id = input('Введите Id нужной доски : ') auth_params = { 'key': api_key, 'token': token } # Адрес, на котором расположен API Trello, # Именно туда мы будем о...
133
37.32
127
18
1,287
python
[]
0
true
2024-11-19T01:54:58.400627+00:00
1,627,359,653,000
db1a7870c28e5fd000d79ec66fad27f4c55eafc6
3
{ "blob_id": "db1a7870c28e5fd000d79ec66fad27f4c55eafc6", "branch_name": "refs/heads/master", "committer_date": 1627359653000, "content_id": "5e8c2fad356e80fe12912307912884559f0f3de4", "detected_licenses": [ "MIT", "Python-2.0", "BSD-3-Clause", "Apache-2.0", "BSD-2-Clause" ], "directory...
2.578125
stackv2
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
48
35.5
64
13
386
python
[]
0
true
2024-11-19T01:54:58.516599+00:00
1,687,274,561,000
a46529262a728f8729a147acbd02ebd37cb9fb25
3
{ "blob_id": "a46529262a728f8729a147acbd02ebd37cb9fb25", "branch_name": "refs/heads/master", "committer_date": 1687274561000, "content_id": "50fd677ff15d56deef2389727d55d48a25db7a89", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "79ec7db0c3871dc58d368c3e34afe359d61cd838", "extension": "p...
2.53125
stackv2
# -*- coding: utf-8 -*- """ Module to provide a simulator to render a laparoscopic view comprising models of anatomy along with a laparoscopic ultrasound probe. """ # pylint: disable=too-many-arguments import numpy as np import vtk import sksurgerycore.transforms.matrix as cmu import sksurgeryvtk.widgets.vtk_renderi...
221
43.42
80
14
2,240
python
[]
0
true
2024-11-19T01:54:58.572114+00:00
1,449,716,469,000
f6a9c9ba846657d531250e4cc40b1a8f5c6b11ea
3
{ "blob_id": "f6a9c9ba846657d531250e4cc40b1a8f5c6b11ea", "branch_name": "refs/heads/master", "committer_date": 1449716469000, "content_id": "cd60f7182faba0a8c5c9e5ecceb3ac4fe0fc0fed", "detected_licenses": [ "MIT" ], "directory_id": "118771fdb3b355a51a6cd9e85599fb8cb2f6f901", "extension": "py", "fi...
2.9375
stackv2
import os, sys, getopt, socket from ftpscanner import FTPScanner from database import Database from indexer import Indexer def enumerate_files(ftp_server_uri, database, verbose=False): ''' Connect to a remote public FTP server and enumerate all files present. This uses a depth-first approach to finding all...
186
30.62
109
16
1,377
python
[]
0
true
2024-11-19T01:54:58.774567+00:00
1,592,972,204,000
e427a8fcf2916ac352f32f9dced8ca5ba915468e
2
{ "blob_id": "e427a8fcf2916ac352f32f9dced8ca5ba915468e", "branch_name": "refs/heads/master", "committer_date": 1592972204000, "content_id": "7b0d8763c88906e7e21eedeb42ff00731b02f9f4", "detected_licenses": [ "MIT" ], "directory_id": "476b1816c90433d23ca6344fba6eb82a08bf3469", "extension": "py", "fi...
2.375
stackv2
import asyncio from typing import Optional import h2.events from typing import Dict from typing import Awaitable from aiosonic.exceptions import MissingEvent from aiosonic.types import ParamsType from aiosonic.types import ParsedBodyType class Http2Handler(object): def __init__(self, connection): """In...
129
31.41
79
18
841
python
[]
0
true
2024-11-19T01:54:58.827046+00:00
1,515,279,386,000
7bd29daadebcbaf75d3f44948509b3ee393bd643
3
{ "blob_id": "7bd29daadebcbaf75d3f44948509b3ee393bd643", "branch_name": "refs/heads/master", "committer_date": 1515279386000, "content_id": "d1d801b8825bafeccb0e3fc6b5f8c0229ff6504b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "01ccb9971ca96cae4105f5295491492da843e174", "extension": "py"...
3.15625
stackv2
import tensorflow as tf import numpy as np class Qnetwork(): """ Args: input_shape (tuple): tuple of inputs to network. output_shape (int): number of output nodes for network. filter_sizes (tuple of 2 ints): number of filters in each of the two hidden layers. Defaults to (16,32). ...
186
53.16
174
19
2,146
python
[]
0
true
2024-11-19T01:54:58.884323+00:00
1,494,292,184,000
0b15516a5f14cf1a5e8dc7c2314ab10a2c9f41bc
3
{ "blob_id": "0b15516a5f14cf1a5e8dc7c2314ab10a2c9f41bc", "branch_name": "refs/heads/master", "committer_date": 1494292184000, "content_id": "e8f5f3aa774dfdc36b01e75d82ed50a782144a1e", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "8542b93187097c13f838abd23c13fbf9f509ce9a", "extension": "p...
3.421875
stackv2
# Part of the JBEI Quantitative Metabolic Modeling Library (JQMM) # Copyright (c) 2016, The Regents of the University of California. # For licensing details see "license.txt" and "legal.txt". import re import core class NamedRangedNumber(object): """ Class for a rangedNumber, and a set of names associated wi...
337
37.98
118
20
2,752
python
[]
0
true
2024-11-19T01:54:59.042822+00:00
1,522,675,975,000
daec88bc894f3c174d559270fbcfb2aa89208c74
4
{ "blob_id": "daec88bc894f3c174d559270fbcfb2aa89208c74", "branch_name": "refs/heads/master", "committer_date": 1522675975000, "content_id": "572b56c8262507b2f821e625f96114047742f6e0", "detected_licenses": [ "Apache-2.0" ], "directory_id": "ab89d2aeda40ede8d8fb6f62f37b25f174956556", "extension": "py"...
4.25
stackv2
# Peter Thornton, 10 Feb 18 # The Collatz Conjecture # Reference: https://en.wikipedia.org/wiki/Collatz_conjecture i = int(input("Please enter an integer: ")) x = i while i > 1: if i % 2 == 0: i = int(i / 2) print(i) else: i = int((3 * i) + 1) print(i) print("Number at sta...
17
19.59
61
14
119
python
[]
0
true
2024-11-19T01:54:59.118808+00:00
1,568,488,967,000
b0dd72b5d784ddfa1fbb053059a7fd755700f246
3
{ "blob_id": "b0dd72b5d784ddfa1fbb053059a7fd755700f246", "branch_name": "refs/heads/master", "committer_date": 1568488967000, "content_id": "8128375e48665adb56df89039167f68dc479fde1", "detected_licenses": [ "MIT" ], "directory_id": "3eaee86a639831002675d608d433e82d8f95d2ef", "extension": "py", "fi...
2.703125
stackv2
import numpy as np import matplotlib.pyplot as plt def kmeans(k, data): return mask if __name__ == '__main__': #generate data num_points = int(np.round(np.random.uniform(100, 1000))) num_centers = int(np.round(np.random.uniform(1,5))) centers = [] pt_variances = [] for center in range(num_centers): x_c...
32
19.41
59
13
202
python
[]
0
true
2024-11-19T01:54:59.682813+00:00
1,617,834,270,000
23a167c51198297873c30982b5d21f40a8cbc3e3
2
{ "blob_id": "23a167c51198297873c30982b5d21f40a8cbc3e3", "branch_name": "refs/heads/main", "committer_date": 1617834270000, "content_id": "11f24697e548cfbc02cdf1c6b48f3a7164fd0561", "detected_licenses": [ "MIT" ], "directory_id": "da7f977e9e06710c986903af4bf1dff36e2705dd", "extension": "py", "file...
2.421875
stackv2
import subprocess import sys import re from pathlib import Path from .api.info import printinfo dirpath = Path(__file__).parent.absolute() dirpathparent = Path(__file__).parent.parent.absolute() def is_venv(): return hasattr(sys, "real_prefix") or ( hasattr(sys, "base_prefix") and sys.base_prefix != sys...
44
21.82
80
13
250
python
[]
0
true
2024-11-19T01:54:59.877257+00:00
1,501,252,317,000
0ac44562099c5bc9ecae777a1c1216b0846c09e1
3
{ "blob_id": "0ac44562099c5bc9ecae777a1c1216b0846c09e1", "branch_name": "refs/heads/master", "committer_date": 1501252317000, "content_id": "8df7822573048038bda47cfe29e223a6c79b9629", "detected_licenses": [ "MIT" ], "directory_id": "5e20baa12b26cdb095787119a6d4c7f9b5442c0e", "extension": "py", "fi...
2.59375
stackv2
import csv import cv2 import numpy as np from keras.callbacks import EarlyStopping, ModelCheckpoint from keras.models import load_model from keras.optimizers import Adam import sklearn from sklearn.model_selection import train_test_split from matplotlib import pyplot as plt import os.path from drive_networks import alv...
283
38.13
121
19
2,652
python
[]
0
true
2024-11-19T01:54:59.933691+00:00
1,614,665,696,000
d8238fe8e7cb66e8e5acbd2e994b4fcaa6652fb2
3
{ "blob_id": "d8238fe8e7cb66e8e5acbd2e994b4fcaa6652fb2", "branch_name": "refs/heads/master", "committer_date": 1614669625000, "content_id": "bb74e41e9fc56b36b1cbb16fdbd86a40c67c5463", "detected_licenses": [ "MIT" ], "directory_id": "29ab0edfe49732531a16bfcc41fc2ee303607d83", "extension": "py", "fi...
2.53125
stackv2
import sys sys.path.append(".") sys.path.append("./App/utils") from face_recognizer.detect_faces import face_detection from PyQt5.QtGui import QImage, QPainter from PyQt5.QtWidgets import QWidget import config import numpy as np import cv2 import os class FaceDetectionWidget(QWidget): def __init__(self, parent=No...
59
34.1
124
20
526
python
[]
0
true
2024-11-19T01:55:00.173217+00:00
1,615,922,246,000
1fdb1fd239c40027eb5be1a3407ef17d25ef4972
2
{ "blob_id": "1fdb1fd239c40027eb5be1a3407ef17d25ef4972", "branch_name": "refs/heads/main", "committer_date": 1615922865000, "content_id": "de427709d68178f93aed8a6235dbb197ff70b695", "detected_licenses": [ "MIT" ], "directory_id": "515de6054a99228ba45d226d364c7f194b7f37ad", "extension": "py", "file...
2.40625
stackv2
import math from pathlib import Path import sys import traceback import warnings from omegaconf import OmegaConf import torch import torch.nn as nn from torch.optim import AdamW from torchtext.data import BPTTIterator from torchtext.datasets import WikiText103 import tqdm from models.language_model import LanguageMod...
97
35.25
90
17
809
python
[]
0
true
2024-11-19T01:55:00.292200+00:00
1,626,602,180,000
4cc143dbe5c3ad84346deeb0ab47d8d7909a5671
3
{ "blob_id": "4cc143dbe5c3ad84346deeb0ab47d8d7909a5671", "branch_name": "refs/heads/master", "committer_date": 1626602180000, "content_id": "3c0775d90842c2982b4711dd629d2ecedba713a7", "detected_licenses": [ "Apache-2.0" ], "directory_id": "26f61d8631bce66d00d7a33029228d69083a7a9e", "extension": "py"...
2.625
stackv2
from socket import * import ssl import threading import time import re import httplib import struct import string import os import sys import socket as Socket import select class handler(threading.Thread): def __init__(self,socket, port) : threading.Thread.__init__(self) self.socket=socket ...
275
34.16
117
20
2,207
python
[{"finding_id": "codeql_py/insecure-default-protocol_054ff290e728fb8b_d1f262aa", "tool_name": "codeql", "rule_id": "py/insecure-default-protocol", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "Call to deprecated method ssl.wrap_socket does not specify a protocol, which may result in...
1
true
2024-11-19T01:55:00.484489+00:00
1,621,863,589,000
831b40001adf04ab4f0de5598e253530b1fdc7a2
3
{ "blob_id": "831b40001adf04ab4f0de5598e253530b1fdc7a2", "branch_name": "refs/heads/master", "committer_date": 1621863589000, "content_id": "946fa27803e3e48255e3c12ad62fe381ec68b752", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "d9b9a1d13a03bc348788ae8b5700407a961fb348", "extension": "p...
3
stackv2
from chatlib.date_tools import check_complete_date, infer_date import re from datetime import datetime from chatlib.base import BaseChatData class WhatsAppChatData(BaseChatData): """Class to read and contain WhatsApp chat export data""" def __init__(self, path, *args, **kwargs): """Create a WhatsAppCh...
184
42.05
141
24
1,727
python
[]
0
true
2024-11-19T01:55:00.540338+00:00
1,490,284,647,000
7765062929ec9c5c9b10c6f7e9e377f411cd6a63
3
{ "blob_id": "7765062929ec9c5c9b10c6f7e9e377f411cd6a63", "branch_name": "refs/heads/master", "committer_date": 1490284647000, "content_id": "ede5beefb9c99dad1db7f64e0f4c672704e34701", "detected_licenses": [ "Apache-2.0" ], "directory_id": "da0dae284de95cc6c186a4f9daf6f53d8495a788", "extension": "py"...
2.65625
stackv2
import logging import signal import click from gevent.wsgi import WSGIServer from chaosmonkey.engine.app import configure_engine, shutdown_engine from chaosmonkey.api.app import flask_app @click.command(name='chaos-monkey-engine') @click.option("--port", "-p", default=5000, help="Port used to expose the CM API. Defau...
55
35.45
112
11
477
python
[]
0
true
2024-11-19T01:55:00.701834+00:00
1,594,465,879,000
5d406f7d7bc211ec17f340bf0f59dc4f5bba4231
3
{ "blob_id": "5d406f7d7bc211ec17f340bf0f59dc4f5bba4231", "branch_name": "refs/heads/master", "committer_date": 1594465879000, "content_id": "5932dd16a2412a233209d09aa02824883b2c2bc0", "detected_licenses": [ "MIT" ], "directory_id": "0137fbaf1b63b4ff080eabec2098e4c02f011ef7", "extension": "py", "fi...
3.3125
stackv2
# Importing all libraries import sys import numpy as np import pandas as pd import os from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): ''' messages_filepath : csv file containing the messages categories_filepath :csv file containing the categories ''' ...
107
31.53
82
13
762
python
[]
0
true
2024-11-19T01:55:00.757615+00:00
1,427,214,061,000
d018d7c5cb493da09a5d3f23e9d44963983a22c9
3
{ "blob_id": "d018d7c5cb493da09a5d3f23e9d44963983a22c9", "branch_name": "refs/heads/master", "committer_date": 1427214061000, "content_id": "3b3194f63d0c912ca998f89812665dae3b7290c7", "detected_licenses": [ "MIT" ], "directory_id": "284f2826edc52da7892ba7ee80ea9d4f34c72bd7", "extension": "py", "fi...
2.921875
stackv2
""" Extra tools/enhancements not included with Cherrypy JSON Output ----------- The JSON output handler here allows you to convert arbitrary obects into JSON format, and send them out as a application/json response. This method uses a custom encoder, and calls obj.__to_json__() or obj.__to_dict__() on any object whi...
60
25.68
83
11
368
python
[]
0
true
2024-11-19T01:55:00.996845+00:00
1,640,766,301,000
400e1aba3498b964f19cae695581421b233354ce
4
{ "blob_id": "400e1aba3498b964f19cae695581421b233354ce", "branch_name": "refs/heads/master", "committer_date": 1640766301000, "content_id": "88947d153d1b83494dd29d08f6e977e0260971f3", "detected_licenses": [ "Unlicense" ], "directory_id": "0a8a0b80abb155fa74b0fd4746bf01e8d666a5d3", "extension": "py",...
3.609375
stackv2
def merge_sort(items): """Merge sort using a single buffer as intermediate storage. """ if items is None: return helper = [] merge_sort_impl(items, helper, 0, len(items)) def merge_sort_impl(items, helper, start, end): if (end - start) <= 1: return mid = (end - start) / 2 +...
110
25.7
74
13
772
python
[]
0
true
2024-11-19T01:55:01.313895+00:00
1,357,305,769,000
6ce7589bf19632342daf9f72620c8add383bcd1a
3
{ "blob_id": "6ce7589bf19632342daf9f72620c8add383bcd1a", "branch_name": "refs/heads/master", "committer_date": 1357305769000, "content_id": "fe830c008f7e422af2132df689a21fed8822cd55", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "7ac1614630592039e67bf77d9cfb45763cc77101", "extension": "p...
2.703125
stackv2
# # 2011, Kristofer Hallin (kristofer.hallin@gmail.com) # # Mermaid, IRC bot written by Kristofer Hallin # kristofer.hallin@gmail.com # import os import sys import log import imp from os.path import exists class Module(object): def __init__(self): sys.path.append("plugins/") self.log = log.Logge...
91
28.3
88
15
627
python
[]
0
true
2024-11-19T01:55:01.440124+00:00
1,603,945,642,000
e99f7bb6a42f5c52b6aa436b391970ad342ad7b6
2
{ "blob_id": "e99f7bb6a42f5c52b6aa436b391970ad342ad7b6", "branch_name": "refs/heads/master", "committer_date": 1603945642000, "content_id": "6f5a23cef4d32cf91e6580da64541359a13ddc17", "detected_licenses": [ "Apache-2.0" ], "directory_id": "35709b5378fb660e9a3e5fb9fc1601466492d9bd", "extension": "py"...
2.3125
stackv2
from openpyxl import Workbook #from lunarcalendar import Solar, Converter from datetime import date, timedelta from convertdate import islamic from ummalqura.hijri_date import HijriDate um = [0x17, 0x06] wb = Workbook() ws = wb.active ws.cell(1, 1).value = "Gregorian" for i, l in enumerate(um): ws.cell(1, 2+i).va...
30
28.5
78
14
326
python
[]
0
true
2024-11-19T01:55:01.566398+00:00
1,530,147,883,000
a0531ccfda6405638594da9112789f05cd93a47a
3
{ "blob_id": "a0531ccfda6405638594da9112789f05cd93a47a", "branch_name": "refs/heads/master", "committer_date": 1530147883000, "content_id": "00e14ac982358781b379a78d94da05343f88502b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "56b252c2e3b97e80cdea0df5c0d79cfa524ea4a1", "extension": "py"...
2.75
stackv2
"""Dependency tracking for checkpointable objects.""" # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
103
39.19
80
12
917
python
[]
0
true
2024-11-19T01:55:01.819960+00:00
1,288,222,301,000
499107344b9e2984a56f1fcc0ce7eb9b1f1aa247
3
{ "blob_id": "499107344b9e2984a56f1fcc0ce7eb9b1f1aa247", "branch_name": "refs/heads/master", "committer_date": 1288222301000, "content_id": "d294fa038fe90052f86fc86109fa92b5e50e9dbf", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "5275a98f4b6f4fed4b0fb826e5494dcba42264d7", "extension": "p...
2.734375
stackv2
#! /usr/bin/python """Conjunctions, interjections, adverbs This module contains base classes for conjunctions, interjections, adverbs and interjections. """ __author__= "mlinar" __url__ = "http://latin.languagebits.com/" __mail__ = "cheesepy [a] gmail.com" __version__="0.0.1" from pylatinam.lexicon.lexicon import L...
38
23.39
74
13
256
python
[]
0
true
2024-11-19T01:55:02.020195+00:00
1,611,190,983,000
0a714081b5a9e9cdf555b2d222c4958f956c69b9
3
{ "blob_id": "0a714081b5a9e9cdf555b2d222c4958f956c69b9", "branch_name": "refs/heads/main", "committer_date": 1611190983000, "content_id": "62e1465464f68db428075fef238a70b2fd94767b", "detected_licenses": [ "MIT" ], "directory_id": "549c0f0cb4357885e3c5ab66262fe603f780a1ce", "extension": "py", "file...
2.5625
stackv2
from flask_restful import reqparse def payment_request_parser(): ''' payment parser to parse request data ''' parser =reqparse.RequestParser(bundle_errors=True) parser.add_argument('CreditCardNumber', type=str, required=True) parser.add_argument('CardHolder', type=str, required=True) ...
16
32.06
68
9
111
python
[]
0
true
2024-11-19T01:55:02.079067+00:00
1,649,436,937,000
21e0056a59a0c4e0677c7c6ab59a37c4b59d5c45
3
{ "blob_id": "21e0056a59a0c4e0677c7c6ab59a37c4b59d5c45", "branch_name": "refs/heads/master", "committer_date": 1649436937000, "content_id": "4c94cbf33e6121d3cb1c97152e25b18bea8f159a", "detected_licenses": [ "MIT" ], "directory_id": "714bb3669d0d048e32d61e27d819b0af20f7ad47", "extension": "py", "fi...
2.8125
stackv2
#coding:utf8 from pathlib import Path import shutil import os import zipfile import img2pdf import sys import re CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) UNZIP_FOLDER = os.path.join(CURRENT_DIR , "temp") def main(): argv = sys.argv if len(argv) < 2: print("ZIPファイルパスを指定してください") ...
58
27.47
120
14
432
python
[]
0
true
2024-11-19T01:55:02.127633+00:00
1,624,204,321,000
aa255837fb21dc0c8d23dd430fe8fea3db91ef84
3
{ "blob_id": "aa255837fb21dc0c8d23dd430fe8fea3db91ef84", "branch_name": "refs/heads/master", "committer_date": 1624204321000, "content_id": "87ea28453413c160f122476991eb7579fc53dcc4", "detected_licenses": [ "MIT" ], "directory_id": "92c8b971304c402f287081fb466e0142ec89ffd2", "extension": "py", "fi...
3.28125
stackv2
class MarkdownEditor: def __init__(self): self.final_text = [] self.line_count = 0 self.select_format() def select_format(self): self.format = input('Choose a formatter: ') if self.format == '!help': print("""Available formatters: plain bold italic header li...
113
28.41
135
16
747
python
[]
0
true
2024-11-19T01:55:02.203119+00:00
1,479,299,369,000
b08f322940c825d1424454e6eda1c6e701778870
4
{ "blob_id": "b08f322940c825d1424454e6eda1c6e701778870", "branch_name": "refs/heads/master", "committer_date": 1479299369000, "content_id": "52125b2d4cda45dd122d0d37a45e5b0f60325def", "detected_licenses": [ "MIT" ], "directory_id": "ea95aacb5cbec6afba445e1e7941f0084b45827a", "extension": "py", "fi...
3.640625
stackv2
import numpy as np RADIX_SCALE = 2**52 class ExactRep(object): """Fixed-point representation of arrays with auxilliary bits such that + - * / ops are all exactly invertible (except for overflow).""" def __init__(self, val, from_intrep=False): if from_intrep: self.intrep = val ...
96
27.84
86
14
738
python
[]
0
true
2024-11-19T01:55:02.512067+00:00
1,585,402,572,000
779723c22e4286f51fb2484f36a446ede22f179d
3
{ "blob_id": "779723c22e4286f51fb2484f36a446ede22f179d", "branch_name": "refs/heads/master", "committer_date": 1585402572000, "content_id": "85b596d601caf107f615c98d79ef0e615a5e48b9", "detected_licenses": [ "MIT" ], "directory_id": "8407770d7d0ea5cbdc6a875322a9f72b203c551d", "extension": "py", "fi...
3.078125
stackv2
#Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd #Importing the dataset dataset=pd.read_csv("Data.csv") X=dataset.iloc[:,:-1].values#Matrix of features y=dataset.iloc[:,-1].values#Dependent variable vector #Handling missing data from sklearn.impute import SimpleImputer m...
49
36
95
10
423
python
[]
0
true
2024-11-19T01:55:02.671672+00:00
1,570,257,180,000
f8eee8288be5436f7a0e7801c967a15802acac32
3
{ "blob_id": "f8eee8288be5436f7a0e7801c967a15802acac32", "branch_name": "refs/heads/master", "committer_date": 1570257180000, "content_id": "3120fd3952e271ae1d1dc6fa85b28409e7abaabf", "detected_licenses": [ "MIT" ], "directory_id": "c9628662944eefce0f870da0ab86a1ca776d91de", "extension": "py", "fi...
2.609375
stackv2
# -*- coding: utf-8 -*- """ Created on Sat Jun 22 12:58:18 2019 @author: Marcel """ import numpy as np import matplotlib.pyplot as plt from WA_connection import * import graph_api as ga class I1D(): N = 0 N_sample = 0 T = 0 beta = 0 latice = None U = 0 U_theo = None count = 0 ...
73
24.03
97
14
565
python
[]
0
true
2024-11-19T01:55:02.745390+00:00
1,384,758,462,000
f274bb6d66f0adc164e7bf44c81801837664dd8e
3
{ "blob_id": "f274bb6d66f0adc164e7bf44c81801837664dd8e", "branch_name": "refs/heads/master", "committer_date": 1384758462000, "content_id": "50910025192806df3b0dd6a79f0ac6997fe6d0db", "detected_licenses": [ "MIT" ], "directory_id": "808955db535318fc182e9134dd0bbed190420237", "extension": "py", "fi...
2.546875
stackv2
# encoding: utf-8 from django.db import models import os from mencoder import * class Video(models.Model): """This is a small demo using just two fields. The slug field is really not necessary, but makes the code simpler. ImageField depends on PIL or pillow (where Pillow is easily installable in a virtual...
49
35.55
79
12
418
python
[]
0
true
2024-11-19T01:55:02.798278+00:00
1,592,436,977,000
d05bb441963ef0156ff66bcfbaf8edbd0c6a5335
2
{ "blob_id": "d05bb441963ef0156ff66bcfbaf8edbd0c6a5335", "branch_name": "refs/heads/master", "committer_date": 1592436977000, "content_id": "19ce517ddff2987f48003f7aa3ab9f22549a1621", "detected_licenses": [ "MIT" ], "directory_id": "fc06a746952fc849dfa854df9f8d5bd765814f27", "extension": "py", "fi...
2.484375
stackv2
import pandas as pd import geopandas as gpd import joblib import folium import urllib import json import numpy as np import os import altair as alt import streamlit as st # from coronavirus.preprocessor.preprocessor import load_data from coronavirus.mapper.mapper import choropleth_map, base_map from coronavirus.db_util...
81
33.89
112
15
685
python
[]
0
true
2024-11-19T01:55:02.847344+00:00
1,567,901,688,000
c661fdd94136102baff28502e163f9ef32442025
2
{ "blob_id": "c661fdd94136102baff28502e163f9ef32442025", "branch_name": "refs/heads/master", "committer_date": 1567901688000, "content_id": "f6b323e1e878610f450bed564a12dc9309b0e6df", "detected_licenses": [ "MIT" ], "directory_id": "3bc73227909d974e64615cf8a3c5673526db6149", "extension": "py", "fi...
2.46875
stackv2
from abc import ABC, abstractmethod from typing import Iterable, Mapping, Optional from bankroll.model import AccountBalance, Activity, Position from .configuration import Settings # Offers data about one or more brokerage accounts, initialized with data # (e.g., exported files) or a mechanism to get the data (e.g....
47
30.64
76
12
329
python
[]
0
true
2024-11-19T01:55:02.893502+00:00
1,621,460,063,000
f7f764ab9476f5307740cad5ccbda9881a8225de
2
{ "blob_id": "f7f764ab9476f5307740cad5ccbda9881a8225de", "branch_name": "refs/heads/master", "committer_date": 1621463046000, "content_id": "f15622264a090e3a1d3a630fd7b7adc19564d10d", "detected_licenses": [ "MIT" ], "directory_id": "b2dcc3a31408096660596e2b4759a6951ab46569", "extension": "py", "fi...
2.453125
stackv2
import numba import numpy as np from ..meta_ufunc import Ufunc MODULUS = None # The modulus of the group, not the order ORDER = None # The size of the group class AdditiveGroupUfunc(Ufunc): """ A mixin class that provides the basics for compiling ufuncs. """ # pylint: disable=no-value-for-paramete...
128
34.2
103
15
1,184
python
[]
0
true
2024-11-19T01:55:03.064005+00:00
1,591,212,845,000
bce621904fde631fcdfb18678cc86d6d7cfbdb9e
3
{ "blob_id": "bce621904fde631fcdfb18678cc86d6d7cfbdb9e", "branch_name": "refs/heads/master", "committer_date": 1591212845000, "content_id": "1223fcb483eaa58c00113ba07ba720ce46c96339", "detected_licenses": [ "Unlicense" ], "directory_id": "b0f9d8fcfe5c7638b10a4c608c63c3f13cf848ee", "extension": "py",...
2.5625
stackv2
import re import operator from pprint import pprint from collections import OrderedDict from data.attrib_errors import error_dict from ordered_set import OrderedSet from tf_config import langsettings # XML RE PATTERNS commentFullRE = re.compile(r'^<!--.*?-->$') commentStartRE = re.compile(r'^<!--.*') commentStopRE ...
251
39.98
118
27
2,332
python
[{"finding_id": "codeql_py/bad-tag-filter_74fea561533991a0_f626c1e7", "tool_name": "codeql", "rule_id": "py/bad-tag-filter", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "This regular expression does not match comments containing newlines.", "remediation": "", "location": {"file_pat...
2
true
2024-11-19T01:55:03.177199+00:00
1,628,852,841,000
4433393f1e2c12b596e2898bf9fe1ced0e0de4af
2
{ "blob_id": "4433393f1e2c12b596e2898bf9fe1ced0e0de4af", "branch_name": "refs/heads/main", "committer_date": 1628852841000, "content_id": "77b5ce34a4de3231aa02b60e33901864604889b5", "detected_licenses": [ "Apache-2.0" ], "directory_id": "1d8ad2558c8eca2f2c998b3085d77d10a378d2cb", "extension": "py", ...
2.328125
stackv2
from __future__ import print_function import os import sys import time import socket from time import sleep import telnetlib teluser = [] telpass = [] def telnetBrute0x00(ip, usernames, passwords, port, delay): telnet = telnetlib.Telnet(ip) telnet.read_until("login: ") for username in usernames: f...
52
29.12
82
16
378
python
[]
0
true
2024-11-19T01:55:03.237758+00:00
1,518,204,205,000
2b35843b8d6fc4a0d8738567e98de796148a1452
3
{ "blob_id": "2b35843b8d6fc4a0d8738567e98de796148a1452", "branch_name": "refs/heads/master", "committer_date": 1518204320000, "content_id": "a0f78b93a1827e8d8f1aa9cefc03e76250e97dc3", "detected_licenses": [ "MIT" ], "directory_id": "ec7d491a866ce29e6fbf14633621b326912cb7e8", "extension": "py", "fi...
2.765625
stackv2
from time import time, sleep from Queue import Full from .thread_with_stop import ThreadWithStop def take_sample(db, client_id, include_all=False): # Note: get the timestamp _after_ the cmd returns from Mongo, which # is probably closed to the time of the sample. result = db.admin.current_op(include_all=...
69
29.62
79
15
497
python
[]
0
true
2024-11-19T01:55:03.369132+00:00
1,601,983,083,000
501cc51dc2fad39e9b196c90031a2e7d001f967b
3
{ "blob_id": "501cc51dc2fad39e9b196c90031a2e7d001f967b", "branch_name": "refs/heads/master", "committer_date": 1601983083000, "content_id": "971c90f1eb614e8611933c72b37c53644586248b", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "40722d3f0142512fd0999de61152998eb1b140ad", "extension": "p...
2.875
stackv2
# -*- coding: utf-8 -*- """ Created on Sat Aug 15 17:32:35 2020 @author: gaurav """ import cv2 CarCascade = cv2.CascadeClassifier("cars.xml") def detect_cars(frame): cars=CarCascade.detectMultiScale(frame,1.1 , 1) for (x,y,w,h) in cars: cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), thicknes...
35
21.23
74
12
224
python
[]
0
true
2024-11-19T01:55:03.673057+00:00
1,618,066,764,000
e3ddccbe10660e8c66be50a6710acf8fffbfbcb8
3
{ "blob_id": "e3ddccbe10660e8c66be50a6710acf8fffbfbcb8", "branch_name": "refs/heads/master", "committer_date": 1618066764000, "content_id": "2e9167b81790818add05501a5e9b239a55485951", "detected_licenses": [ "MIT" ], "directory_id": "e64692544c84130fb2dc2e6f69c654778ec32824", "extension": "py", "fi...
2.53125
stackv2
from tkinter import * from tkinter import ttk import pandas as pd import matplotlib.pyplot as plt from pycoingecko import CoinGeckoAPI from timeit import default_timer as timer from datetime import timedelta from datetime import datetime from apscheduler.schedulers.background import BackgroundScheduler # =============...
325
32.83
119
22
2,902
python
[]
0
true
2024-11-19T01:55:03.904613+00:00
1,505,924,299,000
82613a4a4f493008ee57f0e08977a8cc29fad2dc
3
{ "blob_id": "82613a4a4f493008ee57f0e08977a8cc29fad2dc", "branch_name": "refs/heads/master", "committer_date": 1505924299000, "content_id": "7bbb0b5779ae5bd6fd283b0954abafff9347725a", "detected_licenses": [ "MIT" ], "directory_id": "42674986d9415add5af37c75594ac0d288962621", "extension": "py", "fi...
3.046875
stackv2
# -*- coding: utf-8 -*- import time class Colors(): HEADER = '\033[95m' BLUE = '\033[94m' GREEN = '\033[92m' YELLOW = '\033[93m' RED = '\033[91m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' class TimeRange(): def __init__(self, start_time, end_time): def parse_ts(t): try: ...
41
19.93
74
19
277
python
[]
0
true
2024-11-19T01:55:04.017956+00:00
1,691,446,787,000
3b518c02c369ee29ffdfce1f63a7ae372b060b3d
2
{ "blob_id": "3b518c02c369ee29ffdfce1f63a7ae372b060b3d", "branch_name": "refs/heads/master", "committer_date": 1691446787000, "content_id": "bbb8da86b79f38b480e9e90c7a0d85a1c7392d11", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "cb293ffb6c0015bf01ac30e6ce1b217a376c2458", "extension": "p...
2.390625
stackv2
#!/usr/bin/env python3 import argparse from botocore.exceptions import ClientError import copy import string import random import json module_info = { 'name': 'guardduty__list_accounts', 'author': 'Manas Bellani', 'category': 'ENUM', 'one_liner': ( 'List GuardDuty master account, and other acco...
152
40.49
142
19
1,281
python
[]
0
true
2024-11-19T01:55:04.068046+00:00
1,576,082,099,000
86a4637ab1572acbe18a7313808ceffc56ef1e6b
2
{ "blob_id": "86a4637ab1572acbe18a7313808ceffc56ef1e6b", "branch_name": "refs/heads/master", "committer_date": 1576082099000, "content_id": "cee70b33f54af9fdbb3fd788b0f7db927031955a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "c068ca1a8ee9a8faa057055cdfec50ec48dd9ab4", "extension": "py"...
2.5
stackv2
import dash import dash_core_components as dcc import dash_html_components as html import dash_table from parser import RHSDParser import pandas as pd import plotly.graph_objs as go import random import math from pandas.tseries.offsets import * app = dash.Dash(__name__, external_stylesheets=['assets/typography.css']) ...
189
34.3
130
18
1,576
python
[]
0
true
2024-11-19T01:55:04.214716+00:00
1,633,003,892,000
248dce9d7a2196d7a2cd340d22160c471fb86e69
4
{ "blob_id": "248dce9d7a2196d7a2cd340d22160c471fb86e69", "branch_name": "refs/heads/master", "committer_date": 1633003892000, "content_id": "b28a5ba40f68a351a32fa9d296fa2f43e924ae9f", "detected_licenses": [ "CC0-1.0" ], "directory_id": "63ba933a294865f65409635f62e0f1d59f725f37", "extension": "py", ...
3.8125
stackv2
import re """ Validate addresses function, accept input as an array of ip addresses """ def validateAddresses(addresses): # Regular express for ipv4 includes number ipv4_regex = r'([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])' # Compile the ipv4 regular expression and make a pattern ipv4_patter...
63
27.41
81
14
469
python
[]
0
true
2024-11-19T01:55:04.449279+00:00
1,563,716,560,000
5a5ca03867747e8e971620b6900afc6c59c58df6
3
{ "blob_id": "5a5ca03867747e8e971620b6900afc6c59c58df6", "branch_name": "refs/heads/master", "committer_date": 1563716560000, "content_id": "ddb48b67ad8f516944a3564b9ef74e3ed3b4ef05", "detected_licenses": [ "Apache-2.0" ], "directory_id": "8c4571e893b3f83c49e2ab7d3cf261ee14a3c6f9", "extension": "py"...
2.96875
stackv2
#https://learn.pimoroni.com/tutorial/170pt-projects/the-shift-register-170pt import logging from time import sleep from gpiozero.pins.mock import MockFactory from gpiozero import Device, DigitalOutputDevice #Todo: Make this configurable.. #Device.pin_factory = MockFactory() class ShiftRegister(object): def __in...
53
25.6
121
13
344
python
[]
0
true