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-18T22:11:32.453971+00:00
1,623,279,461,000
97d66172bd4c2423ae2f13dd7db81e7ecee66794
3
{ "blob_id": "97d66172bd4c2423ae2f13dd7db81e7ecee66794", "branch_name": "refs/heads/master", "committer_date": 1623279461000, "content_id": "476c4b921f43ef1123195680dd83843459fda34a", "detected_licenses": [ "MIT" ], "directory_id": "4e1db8b75d33499ce0f9ec43534f4f50a5fa86b6", "extension": "py", "fi...
2.875
stackv2
''' EDA - Exploratory Data Analysis ''' from enum import unique from re import search import numpy as np import pandas as pd import os import glob import cv2 from sklearn.model_selection import train_test_split class preprocess: def __init__(self, data_path): self.data_path = data_path sel...
131
24.96
108
17
756
python
[]
0
true
2024-11-18T22:11:32.735072+00:00
1,554,788,948,000
6458dc4b6cbb65d3463fd962d7502dbf1c8ea5c3
3
{ "blob_id": "6458dc4b6cbb65d3463fd962d7502dbf1c8ea5c3", "branch_name": "refs/heads/master", "committer_date": 1554788948000, "content_id": "3a1698cd3a853eba0ad48464c7b44b30b36a5772", "detected_licenses": [ "ZPL-2.1" ], "directory_id": "bfbedb1a9be1235e530f58e51e0dc44ff2208322", "extension": "py", ...
2.5625
stackv2
import ZPublisher.HTTPRequest import cgi import z3c.form.converter import z3c.form.interfaces import zope.publisher.browser class FileUploadDataConverter(z3c.form.converter.FileUploadDataConverter): """Although ZPublisher's and zope.publisher's FileUpload implementations are almost identical, ``FileUploadData...
27
37.48
74
14
211
python
[]
0
true
2024-11-18T22:11:33.026388+00:00
1,534,149,686,000
f8406bc95c7453ab6fd70b272570ee4ddd490b51
3
{ "blob_id": "f8406bc95c7453ab6fd70b272570ee4ddd490b51", "branch_name": "refs/heads/master", "committer_date": 1534149686000, "content_id": "3765c62061d3a628932a09a6ebd895997be7032a", "detected_licenses": [ "MIT" ], "directory_id": "65ec7c4b790cd7c9c9b6b34322bd00eb1531f40a", "extension": "py", "fi...
2.78125
stackv2
import json import requests import time with open("env.json") as f: data = json.load(f) TOKEN = data['token']['TELEGRAM_BOT_TOKEN'] URL = "https://api.telegram.org/bot{}/".format(TOKEN) def get_content(url): response = requests.get(url) content = response.content.decode("utf-8") return content def get_json_fro...
52
21.19
70
12
303
python
[]
0
true
2024-11-18T22:11:33.151542+00:00
1,621,250,696,000
9ff0f9e50b6d91be21d0efb0d3be4fae80bea8b5
2
{ "blob_id": "9ff0f9e50b6d91be21d0efb0d3be4fae80bea8b5", "branch_name": "refs/heads/master", "committer_date": 1621250696000, "content_id": "339331d03feaf8ef522382716d0172ed86bb900c", "detected_licenses": [ "MIT" ], "directory_id": "fb04cc96bf6cbc369e14de17459087f7cf987cc9", "extension": "py", "fi...
2.328125
stackv2
import time import cv2 import numpy as np import tensorflow as tf import yolov3_tf2 import valohai import os from yolov3_tf2.models import ( YoloV3 ) from yolov3_tf2.dataset import transform_images from yolov3_tf2.utils import draw_outputs params = { "size": 416, } inputs = { "classes": ".data/classes.t...
76
31.25
92
18
615
python
[]
0
true
2024-11-18T22:11:33.437301+00:00
1,563,544,171,000
4799d84e4dd5ecb203dbcd616771cadc18e700ff
2
{ "blob_id": "4799d84e4dd5ecb203dbcd616771cadc18e700ff", "branch_name": "refs/heads/master", "committer_date": 1563544171000, "content_id": "7b39244df876d8bf9e050e72156609c6c4a81670", "detected_licenses": [ "MIT" ], "directory_id": "59df1200253ef0373654aa24b71e29ac29e63ced", "extension": "py", "fi...
2.34375
stackv2
# built-in from ssl import create_default_context # external import certifi from aiohttp import ClientSession, TCPConnector def aiohttp_session(*, auth=None, **kwargs): headers = dict() if auth: headers['Authorization'] = auth.encode() ssl_context = create_default_context(cafile=certifi.where()) ...
18
28.56
72
12
116
python
[]
0
true
2024-11-18T22:11:33.493149+00:00
1,592,636,896,000
df9e91abca136e8a47ddaa221f5412e6de809222
3
{ "blob_id": "df9e91abca136e8a47ddaa221f5412e6de809222", "branch_name": "refs/heads/master", "committer_date": 1592636896000, "content_id": "809023fa3238e5a54793924d81d51f70be9cb831", "detected_licenses": [ "MIT" ], "directory_id": "2817aefa1d4e90338a14eaa9e44f08226d2597c7", "extension": "py", "fi...
3.125
stackv2
from dataclasses import dataclass, astuple from typing import Union, Iterable, Any, Generator from abc import ABC from typeguard import typechecked, check_type import numpy as np @dataclass class geometry(ABC): """Abstact parent class geometry This is actually an abstract class not to be used """ de...
186
25.2
81
15
1,158
python
[]
0
true
2024-11-18T22:11:33.599337+00:00
1,624,233,177,000
1e2b8a52b9ad3e80e6555708f2c76fbaa2f6384e
2
{ "blob_id": "1e2b8a52b9ad3e80e6555708f2c76fbaa2f6384e", "branch_name": "refs/heads/main", "committer_date": 1624233177000, "content_id": "3f2deb3bee4a4b674b57981ed9062205e926cdeb", "detected_licenses": [ "MIT" ], "directory_id": "2f8cdd3cdcb64d45426c9d231a02cc368d652976", "extension": "py", "file...
2.375
stackv2
# -*- coding: utf-8 -*- """ Created on Wed Jan 6 13:39:58 2021 @author: siboc """ import numpy as np import scipy import math from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from sklearn.metrics import r2_score import tensorflow as tf import tensorflow.keras.backend as K #...
220
30.27
157
16
1,695
python
[]
0
true
2024-11-18T22:11:33.648806+00:00
1,606,823,412,000
22da4dae446ea24d2f9edef1d4ad9bde4c78f9ad
4
{ "blob_id": "22da4dae446ea24d2f9edef1d4ad9bde4c78f9ad", "branch_name": "refs/heads/main", "committer_date": 1606823412000, "content_id": "b4a99f4de76654c64e5f42ec37250c9a00996a6c", "detected_licenses": [ "MIT" ], "directory_id": "3d93043191d6a5552586ca9c41d99460dcc7b8dd", "extension": "py", "file...
3.5
stackv2
class Trie: def __init__(self): self.children = {} def insert(self, word, start=0): tree = self while start < len(word): if word[start] not in tree.children: tree.children[word[start]] = Trie() tree = tree.children[word[start]] start ...
44
24.64
51
15
266
python
[]
0
true
2024-11-18T22:11:33.914903+00:00
1,627,025,387,000
268ba1e5cf054db5f5883baac48fbca35f8a6788
3
{ "blob_id": "268ba1e5cf054db5f5883baac48fbca35f8a6788", "branch_name": "refs/heads/master", "committer_date": 1627025387000, "content_id": "c2232b21e3f1f3ebb5dea8addbe5a548c840ee84", "detected_licenses": [ "MIT" ], "directory_id": "e94c3e02b390b7c37214218083e4c5b2ad622f60", "extension": "py", "fi...
3.046875
stackv2
# # @lc app=leetcode.cn id=438 lang=python3 # # [438] 找到字符串中所有字母异位词 # # @lc code=start from typing import List class Solution: def findAnagrams(self, s: str, p: str) -> List[int]: hash_win,hash_need = {},{} ans = [] for char in p: hash_need[char] = 1 if char not in hash_need el...
40
30.32
82
16
322
python
[]
0
true
2024-11-18T22:11:34.300054+00:00
1,614,181,199,000
87e508b9de9fe57fafb86b805b7b7db8c438de1a
3
{ "blob_id": "87e508b9de9fe57fafb86b805b7b7db8c438de1a", "branch_name": "refs/heads/master", "committer_date": 1614181199000, "content_id": "fa7f718af45df3359fcb7e475d72819ed8e43508", "detected_licenses": [ "Python-2.0", "MIT" ], "directory_id": "50008b3b7fb7e14f793e92f5b27bf302112a3cb4", "exten...
3.265625
stackv2
from Tkinter import * import tkMessageBox import tkSimpleDialog import math import random import string #----------------------------------------------- def millerTest(a, i, n): if i == 0: return 1 x = millerTest(a, i / 2, n) if x == 0: return 0 y = (x * x) % n if ((y == 1) and (x != 1) and (x != (n - 1))): ...
50
24.28
119
15
396
python
[]
0
true
2024-11-18T22:11:34.946899+00:00
1,617,642,822,000
ed9e3c04ba9d71501e8b8cbb3f193ba88be5ec98
3
{ "blob_id": "ed9e3c04ba9d71501e8b8cbb3f193ba88be5ec98", "branch_name": "refs/heads/master", "committer_date": 1617643602000, "content_id": "e32afc929171c1525954f6d6390e4d00d56b9058", "detected_licenses": [ "Apache-2.0" ], "directory_id": "ec5a247812e4b5a51e4fdfd071bc298a957bcbdf", "extension": "py"...
2.734375
stackv2
# 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 agreed to in writing, software # distributed under the...
295
32.5
79
17
2,073
python
[]
0
true
2024-11-18T22:11:35.133672+00:00
1,513,726,844,000
83662d05f988a902015a55e1f09e7f4f0cefa3fd
3
{ "blob_id": "83662d05f988a902015a55e1f09e7f4f0cefa3fd", "branch_name": "refs/heads/master", "committer_date": 1513726844000, "content_id": "6b4f1e0c8ef0ab8eaff026545d84aa6c5b03ac8f", "detected_licenses": [ "Apache-2.0" ], "directory_id": "598b6594fe5513c6a85d1e99fef04b7c33631f46", "extension": "py"...
2.921875
stackv2
#Step 1: Import modules (some of visualizations will use custom imports later) import requests, json, csv, urllib.request import matplotlib.pyplot as plt import pandas as pd import numpy as np from math import pi from scipy import stats from timeit import default_timer as timer #Step 2: Download and Read CSV Data from...
249
35.41
138
17
2,545
python
[]
0
true
2024-11-18T22:11:35.553230+00:00
1,633,423,873,000
aa1b973e34cb22d1168a6a7e8027ed0152ed9cd2
3
{ "blob_id": "aa1b973e34cb22d1168a6a7e8027ed0152ed9cd2", "branch_name": "refs/heads/master", "committer_date": 1633423873000, "content_id": "2922d50ec51652ef67b8b7c7e60fda5240787832", "detected_licenses": [ "MIT" ], "directory_id": "01ee7a41bb8f418244a3b8d716a0f8cf6dfcd483", "extension": "py", "fi...
2.59375
stackv2
#!/usr/bin/env python import pandas as pd import argparse import sys def parse_args(args=None): Description = 'Check samplesheet and add files to bed file' Epilog = """Example usage: python modify_samplesheet.py <FILE_IN> <FILE_OUT> -r <total_reads.tsv>""" parser = argparse.ArgumentParser(description=De...
51
28.96
117
12
391
python
[]
0
true
2024-11-18T22:11:35.639669+00:00
1,687,424,074,000
a0bbcf5b8d1d995ff26738805895fc6fbed79959
3
{ "blob_id": "a0bbcf5b8d1d995ff26738805895fc6fbed79959", "branch_name": "refs/heads/master", "committer_date": 1687424074000, "content_id": "29e28dde0ed8b30fa88d239437c0df204a3400b5", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "20c8a74b45862ba8604d1c65608b1ea358812bd2", "extension": "p...
2.734375
stackv2
# Import analysis/plotting/simulation modules from hummingbird import analysis, plotting, simulation # Simulate diffraction data sim = simulation.base.Simulation() sim.hitrate = 0.5 sim.sigma = 1 # Specify the facility state = {} state['Facility'] = 'Dummy' # Create a dummy facility state['Dummy'] = { # The e...
56
29.52
119
12
436
python
[]
0
true
2024-11-18T22:11:35.801305+00:00
1,628,678,207,000
b67064e608c14abfb9954bbe637c5f08bffa3208
2
{ "blob_id": "b67064e608c14abfb9954bbe637c5f08bffa3208", "branch_name": "refs/heads/main", "committer_date": 1628678209000, "content_id": "b03aad9b40137730309aa124282d1331dbc4d501", "detected_licenses": [ "MIT" ], "directory_id": "bfa81e9ebd6c394fb7ff27afd063bca6e5cf48c1", "extension": "py", "file...
2.328125
stackv2
from django.contrib.auth.models import ( AbstractBaseUser, PermissionsMixin, UserManager ) from django.db import models from django.utils import timezone from django.core.mail import send_mail from django.utils.translation import ugettext_lazy as _ #from .managers import UserManager class UserBasicModel(AbstractB...
65
36.23
110
13
782
python
[]
0
true
2024-11-18T22:11:35.942263+00:00
1,503,694,845,000
99475fd7031a5696854f56f3e07702b39679197e
3
{ "blob_id": "99475fd7031a5696854f56f3e07702b39679197e", "branch_name": "refs/heads/master", "committer_date": 1503694845000, "content_id": "872977ee59c7edafb7b9c73bbb3344df9f00cec0", "detected_licenses": [ "MIT" ], "directory_id": "1a22b44eba9accbb3718db8b88ae2973b4745e1e", "extension": "py", "fi...
3.078125
stackv2
def smart_procrustes_align_gensim(base_embed, other_embed, words=None): """Procrustes align two gensim word2vec models (to allow for comparison between same word across models). Code ported from HistWords <https://github.com/williamleif/histwords> by William Hamilton <wleif@stanford.edu>. (With help...
208
39.31
137
14
2,260
python
[]
0
true
2024-11-18T22:11:36.043120+00:00
1,596,969,865,000
34864b7ec3bbdd39ba753d440758ced87c641600
3
{ "blob_id": "34864b7ec3bbdd39ba753d440758ced87c641600", "branch_name": "refs/heads/master", "committer_date": 1596969865000, "content_id": "9b30fead1d3db841efd70d327647682a47588a69", "detected_licenses": [ "MIT" ], "directory_id": "bbc9f425394d30ad92b39dc5a9eca4d067a082c5", "extension": "py", "fi...
2.828125
stackv2
from pydantic import BaseModel from typing import Optional class AnnoationLocation(BaseModel): start: int end: int def __eq__(self, other): return self.start == other.start and self.end == other.end def __hash__(self): return hash("{}-{}".format(self.start, self.end)) def __repr...
38
22.24
82
12
215
python
[]
0
true
2024-11-18T22:11:36.159398+00:00
1,677,918,035,000
bc9a2348e3ff02c7bb2c563948cfbff16f5c4e57
3
{ "blob_id": "bc9a2348e3ff02c7bb2c563948cfbff16f5c4e57", "branch_name": "refs/heads/main", "committer_date": 1677918035000, "content_id": "fa74332782db806cdee4784ab33fcb9bbe516343", "detected_licenses": [ "MIT" ], "directory_id": "2829825dc7e4d118e37e76924af9355983b02283", "extension": "py", "file...
2.6875
stackv2
from abaqusConstants import * class MesherOptions: """The MesherOptions object controls the default settings that Abaqus uses for all meshing methods. The MesherOptions object has no constructor. Abaqus creates the *MesherOptions* member when a session is started. MesherOptions commands are intended f...
65
47.57
100
8
653
python
[]
0
true
2024-11-18T22:11:36.266806+00:00
1,578,913,283,000
d7f273ded50c92b45edf30d2afdd58f10c5ca0fb
3
{ "blob_id": "d7f273ded50c92b45edf30d2afdd58f10c5ca0fb", "branch_name": "refs/heads/master", "committer_date": 1578913283000, "content_id": "0858227a0df77e45d319d2cb31ac010236980193", "detected_licenses": [ "Unlicense", "Python-2.0" ], "directory_id": "052933ebf841e04d49f2dea950f524a5bbac9ec5", ...
2.984375
stackv2
# Bl4ckC4T v1 with tkinter gui import tkinter from tkinter import * def start(): keystring = ''.join(fieldkey.get(1.0, END).split()) choice = var1.get() outstring = "" inputstring = fieldinp.get(1.0, END) for index in range(len(inputstring)-1): if index >= len(keystring): keyst...
75
26.52
83
16
683
python
[]
0
true
2024-11-18T22:11:36.616724+00:00
1,601,468,749,000
9e6f15dc2cac08c907c09d913c189e28611dfbe8
3
{ "blob_id": "9e6f15dc2cac08c907c09d913c189e28611dfbe8", "branch_name": "refs/heads/master", "committer_date": 1601468749000, "content_id": "626c926c750da910eaf53289f469d55f9dbcea91", "detected_licenses": [ "MIT" ], "directory_id": "e07a7b9f88eb2b0a30a2eb0a5518c546efdffbac", "extension": "py", "fi...
2.8125
stackv2
#coding:utf-8 import os from PIL import Image import numpy as np import cv2 def resize(imgPath,savePath): files = os.listdir(imgPath) files.sort() print('****************') print('input :',imgPath) print('start...') for file in files: fileType = os.path.splitext(file) if fileTyp...
32
32.66
84
15
329
python
[]
0
true
2024-11-18T22:11:36.669153+00:00
1,599,053,689,000
a298038a5522eb420734e08cef100febf2c075f6
3
{ "blob_id": "a298038a5522eb420734e08cef100febf2c075f6", "branch_name": "refs/heads/master", "committer_date": 1599053689000, "content_id": "1d5cb71413c7e07ee44320335d69728637346e19", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5fe72bb13baf3649058ebe11aa86ad4fc56c69ed", "extension": "py"...
3.359375
stackv2
""" Minimal MapProxy Middleware demonstrating the decorate_img API To run: 1. Install MapProxy in a virtual enviroment together with Gunicorn 2. Create a basic MapProxy config and copy this file into the same directory as mapproxy.yaml 2. Activate virtual environment 3. Change to the directory containing this ...
63
30.48
95
11
498
python
[]
0
true
2024-11-18T22:11:36.731560+00:00
1,595,503,868,000
0ffdf58d3fd94fc5a1e4b99c88e07a48937bd74c
3
{ "blob_id": "0ffdf58d3fd94fc5a1e4b99c88e07a48937bd74c", "branch_name": "refs/heads/master", "committer_date": 1595503868000, "content_id": "6cafc104a1c387fcea584dfcca639a04c7f84219", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "a47b4cfde908ea6c8341e43a48739ac65fdd5b67", "extension": "p...
2.71875
stackv2
import numpy as np from scipy.special import gammaln from bilby import Likelihood as bilbyLikelihood from PyGRB.backend.makekeys import MakeKeys from PyGRB.backend.rate_functions import * class PoissonRate(MakeKeys, bilbyLikelihood): """ Custom Poisson rate class inheriting from bilby.Likelihood. Param...
131
34.74
88
17
1,031
python
[]
0
true
2024-11-18T22:11:36.963247+00:00
1,594,214,667,000
9e2057ce69bb3cc09880e0a5304e0b0e39f7f3a7
3
{ "blob_id": "9e2057ce69bb3cc09880e0a5304e0b0e39f7f3a7", "branch_name": "refs/heads/master", "committer_date": 1594214667000, "content_id": "57014d6029941b78afaaaf94d790fd4cddf40763", "detected_licenses": [ "MIT" ], "directory_id": "56bae55c1cd5000acdd14a4b7767a0292794cbb6", "extension": "py", "fi...
3.140625
stackv2
#################################### # Class and utils for the Reader # #################################### import os import time from transformers import pipeline class Reader: def __init__( self, model_name="twmkn9/distilbert-base-uncased-squad2", tokenizer_name="twmkn9/distilbert-bas...
143
36.31
118
17
1,023
python
[]
0
true
2024-11-18T22:11:37.182971+00:00
1,689,598,901,000
202ed67d09e6e5276790858b12c2ff0e009880fd
3
{ "blob_id": "202ed67d09e6e5276790858b12c2ff0e009880fd", "branch_name": "refs/heads/master", "committer_date": 1689598901000, "content_id": "a9ce4da6fcb46304d7bcd7d3fda65ab5840e65e4", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c1e7b91b35926621b3907584aecf333bd9da3e5b", "extension": "p...
3.296875
stackv2
import numpy as np from sklearn.metrics import confusion_matrix from sklearn.utils.validation import ( check_consistent_length, column_or_1d, check_array, ) from ._label import MISSING_LABEL, is_labeled, is_unlabeled from ._label_encoder import ExtLabelEncoder def ext_confusion_matrix( y_true, y_pred...
106
40.64
79
18
1,081
python
[]
0
true
2024-11-18T22:11:37.344579+00:00
1,571,562,331,000
8ea0d24fd48b6cc578c75496330fa5e89222546e
3
{ "blob_id": "8ea0d24fd48b6cc578c75496330fa5e89222546e", "branch_name": "refs/heads/master", "committer_date": 1571562331000, "content_id": "b09c06c6ae065493c29b73d740b59f0bbe6816ba", "detected_licenses": [ "MIT" ], "directory_id": "51ac9ce2f111d75cc555c6ba363849245ff767fc", "extension": "py", "fi...
2.671875
stackv2
"""Checks filesystem for audio files that the bot app turns into SFX commands.""" import os from utils.logger import loggymclogger as log list_of_sfx_files = [] sfx_with_extentions = [] path = 'static/sfx/hooks/' for file in os.listdir(path): # create instance with attributes if file.endswith('.ogg') or file...
19
30.95
81
11
148
python
[]
0
true
2024-11-18T22:11:37.412911+00:00
1,633,707,361,000
2e6c63ed9d07323971ea3d6e6fe9ab93ec5e50bc
2
{ "blob_id": "2e6c63ed9d07323971ea3d6e6fe9ab93ec5e50bc", "branch_name": "refs/heads/master", "committer_date": 1633707361000, "content_id": "594daaea6326eed801c3b98d59c42cda2214e29b", "detected_licenses": [ "MIT" ], "directory_id": "70ae5a37085359bbbd76794d50c84aaf4deb862b", "extension": "py", "fi...
2.46875
stackv2
with open('mobydick.txt','r') as f1: m1 = f1.read().split() with open('solved.txt','r') as f2: m2 = f2.read().split() assert len(m1) == len(m2) for i in range(len(m1)): if m1[i] != m2[i]: print(m1[i], m2[i]) # quickly bquickly # landlord alandlord # the tthe # more's more’s # boarders pboarders ...
48
18.92
90
10
337
python
[]
0
true
2024-11-18T22:11:37.599535+00:00
1,551,003,377,000
a9c6ba522adc262659cf54b6db8248bb490ddabd
3
{ "blob_id": "a9c6ba522adc262659cf54b6db8248bb490ddabd", "branch_name": "refs/heads/master", "committer_date": 1551003377000, "content_id": "79a9e273f9b8040683bd0659c17dcfc1238c8ac6", "detected_licenses": [ "MIT" ], "directory_id": "d57c6f42448ae84194379027274fbff97eb8cd13", "extension": "py", "fi...
3.15625
stackv2
from tkinter import messagebox from tempfile import mkstemp from shutil import move from os import fdopen, remove import sys class MoneyManager(): def __init__(self): '''Constructor to set username to '', pin_number to an empty string, balance to 0.0, and transaction_list to an empty li...
91
37.65
115
20
693
python
[]
0
true
2024-11-18T22:11:37.666172+00:00
1,577,988,291,000
46e59657364e12b7bde14a9f3fd6b45e3728ade2
2
{ "blob_id": "46e59657364e12b7bde14a9f3fd6b45e3728ade2", "branch_name": "refs/heads/master", "committer_date": 1577988291000, "content_id": "203470221b72b865ab577299538ff7f20d3a3542", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "e01fce96f85c6c6d59cdff0222393bebc6afe3c3", "extension": "p...
2.46875
stackv2
# -*- coding: utf-8 -*- from typing import Dict import os import pkg_resources from bag.design import Module yaml_file = pkg_resources.resource_filename(__name__, os.path.join('netlist_info', 'DynamicToStaticLatch.yaml')) # noinspection PyPep8Naming class bag_advanced_examples__DynamicToStaticLatch(Module): ...
90
41.2
112
13
1,040
python
[]
0
true
2024-11-18T22:11:37.719958+00:00
1,493,494,581,000
10960f8b983f74f27200c85399698f7d282bfbf7
4
{ "blob_id": "10960f8b983f74f27200c85399698f7d282bfbf7", "branch_name": "refs/heads/master", "committer_date": 1493494581000, "content_id": "b9fbe4e41453e14363d07accecd7cf39862430fe", "detected_licenses": [ "MIT" ], "directory_id": "74c6fe5bf63a97d231ba795c11b83a361542fa30", "extension": "py", "fi...
3.625
stackv2
import re import json def read_file(file_name): """Returns a list of all of the lines of the fast alert file Each line in the file is a separate Snort fast alert file_name - Name of file to be read. """ try: f = open(file_name, "r") except: print("Cannot open file " + f...
222
39.26
80
14
2,021
python
[]
0
true
2024-11-18T22:11:37.760973+00:00
1,445,442,203,000
e44815b1de02f687d7df022e13e01db0cfe89766
2
{ "blob_id": "e44815b1de02f687d7df022e13e01db0cfe89766", "branch_name": "refs/heads/master", "committer_date": 1445442203000, "content_id": "ffeb731ab068806fbea30c9c559c940429c1cacc", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "fd64150f20f5459b9c376a11cdf7db740776b96d", "extension": "p...
2.484375
stackv2
"""Views for Zinnia Hashids""" from django.http import Http404 from django.shortcuts import get_object_or_404 from django.views.generic.base import RedirectView from zinnia.models.entry import Entry from zinnia_hashids.factory import hashids class EntryHashids(RedirectView): """ View for handling the hashid...
29
28.48
66
15
198
python
[]
0
true
2024-11-18T22:11:37.920139+00:00
1,321,463,727,000
7ed8b933c31b7ef77cefcfba01e74d68ff047fc6
3
{ "blob_id": "7ed8b933c31b7ef77cefcfba01e74d68ff047fc6", "branch_name": "refs/heads/master", "committer_date": 1321463727000, "content_id": "50705526ea922eb9dbeb1e0dcd019b055bb64d99", "detected_licenses": [ "MIT" ], "directory_id": "4d5a0fdad1e606a70cad345c2136129a3d616485", "extension": "py", "fi...
2.625
stackv2
#!/usr/bin/env python from Foundation import * from AppKit import * from SystemConfiguration import * import commands, re, time class ToggleProxy(NSObject): def applicationDidFinishLaunching_(self, notification): # find image files self.active_image = NSImage.ima...
100
36.4
105
15
800
python
[]
0
true
2024-11-18T22:11:38.086425+00:00
1,554,716,433,000
8ecdb0cc5a3a1a7e9c1da2f68a108adec6c63bfd
3
{ "blob_id": "8ecdb0cc5a3a1a7e9c1da2f68a108adec6c63bfd", "branch_name": "refs/heads/master", "committer_date": 1554716433000, "content_id": "604843f4215669ac79c3a51390c2ba288fe9e1ea", "detected_licenses": [ "Apache-2.0" ], "directory_id": "4cb699b29d0a64e8a6a73e98501530548b9638a4", "extension": "py"...
2.59375
stackv2
import Check_internet import speech_recognition as sr from datetime import datetime import os from pocketsphinx import LiveSpeech, get_model_path import time def recognition_google(): '''We get the command and save file''' date = datetime.now() file_name = 'audio/' + str(date)[:str(date).index('.')].rep...
78
25.33
129
16
512
python
[]
0
true
2024-11-18T22:11:38.372913+00:00
1,548,998,276,000
22c16d7b11dccfe7f37a0e0be448dd622244687a
3
{ "blob_id": "22c16d7b11dccfe7f37a0e0be448dd622244687a", "branch_name": "refs/heads/master", "committer_date": 1548998276000, "content_id": "e39c6bf65f5be183270fb9db84f5b36e496fd935", "detected_licenses": [ "MIT" ], "directory_id": "e91f477713556f14b288b89ecce89754d4bd93f7", "extension": "py", "fi...
3.09375
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Evaluate an environment and an agent. Do this by running the agent in the environment for a while and measuring the average reward. """ # 3rd party modules import gym # local modules from rl_utils import load_cfg, get_parser, test_agent def main(environment_name, ...
42
24.17
77
11
250
python
[]
0
true
2024-11-18T22:11:38.627613+00:00
1,429,913,962,000
854d18db3dfd7c21ba5d90b4dc079ff705674bd6
3
{ "blob_id": "854d18db3dfd7c21ba5d90b4dc079ff705674bd6", "branch_name": "refs/heads/master", "committer_date": 1429913962000, "content_id": "c242bce5f3a9f2071a699a1291ef3d62bcc90f0d", "detected_licenses": [ "MIT" ], "directory_id": "5d4f40721d896229234f765a027195a1f1bcefa4", "extension": "py", "fi...
3.09375
stackv2
import bpy import math import re import mathutils class Scaler: # according to hypertextbook.com/facts/2006/bodyproportions.shtml # forarm+hand vs forarm ratio GOLDEN_RATIO = 1.618 # name of the forarm bone, should always be this name FOREARM = 'forearm' # name of the hand objects after imp...
132
30.73
70
16
930
python
[]
0
true
2024-11-18T22:11:38.810885+00:00
1,554,400,780,000
345a74821bfedb0dc52fa72673bb5193f720c73e
2
{ "blob_id": "345a74821bfedb0dc52fa72673bb5193f720c73e", "branch_name": "refs/heads/master", "committer_date": 1554400780000, "content_id": "d3631a29ce041d4b97aad258422b2c6182585593", "detected_licenses": [ "MIT" ], "directory_id": "38e2d57607a000a81c9a07103a6070902652eb2b", "extension": "py", "fi...
2.359375
stackv2
# -*- coding: utf-8 -*- import bot from lib import timeutils bot.reload(timeutils) class Module(bot.Module): index = "restatsdb" def register(self): self.addcommand(self.main, 'get', 'Query a statsdb-interface API.' ' Actions: toprace <map>, game <id>,...
93
34.74
79
19
768
python
[]
0
true
2024-11-18T22:11:39.122220+00:00
1,523,979,956,000
1a3642af1d9942250a5b454c49087195a3bdeca5
2
{ "blob_id": "1a3642af1d9942250a5b454c49087195a3bdeca5", "branch_name": "refs/heads/master", "committer_date": 1523979956000, "content_id": "841f710551e4afff56e37393e2d73117ca2ab12f", "detected_licenses": [ "MIT" ], "directory_id": "55a7e280f70d936b938db5f6d58744681a42bb14", "extension": "py", "fi...
2.46875
stackv2
import os import sys #reload(sys) # sys.setdefaultencoding("utf8") import re import pandas as pd import io import bz2 def list_cleaner(rev_list): rev_list = rev_list.replace('\t', '') rev_list = rev_list.replace('\n', '') rev_list = re.sub( r"<id>|</id>|<parentid>|</parentid>|<timestamp>|</ti...
56
19.89
125
16
290
python
[]
0
true
2024-11-18T22:11:39.294547+00:00
1,517,674,828,000
8ef78c16c3fcb68e6e87edc8d9dc1c3df81f4c5c
3
{ "blob_id": "8ef78c16c3fcb68e6e87edc8d9dc1c3df81f4c5c", "branch_name": "refs/heads/master", "committer_date": 1517674828000, "content_id": "f7a994290087890e1c2117dccc612d658b5df11c", "detected_licenses": [ "MIT" ], "directory_id": "d23223539e2bd0ca230259e46382a487adfe9e1e", "extension": "py", "fi...
2.953125
stackv2
from bot_logger import logger from cogs.modules.coin_market import CurrencyException, FiatException from collections import defaultdict from discord.errors import Forbidden import discord import json class AlertFunctionality: """Handles Alert Command functionality""" def __init__(self, bot, coin_market, aler...
326
42.7
93
24
2,519
python
[]
0
true
2024-11-18T22:11:39.352076+00:00
1,617,470,018,000
b437cddd400059d1d559ca2284141eabdc8d7813
4
{ "blob_id": "b437cddd400059d1d559ca2284141eabdc8d7813", "branch_name": "refs/heads/main", "committer_date": 1617470018000, "content_id": "a620a0df557001b1bec083667fd664b5bbff73b5", "detected_licenses": [ "MIT" ], "directory_id": "7c8b5f35cad9d47b750ee26f2ee0f2701a049918", "extension": "py", "file...
3.90625
stackv2
""" Least squares is a powerful technique for finding a function from a relatively small family of potential functions that best describe a particular set of data. This technique is especially common in statistics. For example, least squares is used in linear regression problems – here, the family of potential function...
45
33.42
80
9
433
python
[]
0
true
2024-11-18T22:11:39.551671+00:00
1,511,453,078,000
0e470526ebcc33c436177108bbc56ca93cbd9f01
3
{ "blob_id": "0e470526ebcc33c436177108bbc56ca93cbd9f01", "branch_name": "refs/heads/master", "committer_date": 1511453078000, "content_id": "d4aa7bc8e2e61109761e0fa49f46b79be78c7059", "detected_licenses": [ "MIT" ], "directory_id": "54b867b0413a3379b6500f4ddfc2e799002f5d79", "extension": "py", "fi...
2.75
stackv2
#!/usr/bin/env python3 import os, sys from argparse import ArgumentParser, FileType from yaml import safe_load as load from jinja2 import Template def main(): parser = ArgumentParser() parser.add_argument('input', type=FileType('r')) parser.add_argument('output', nargs='?', type=FileType('w'), default=sys.stdou...
27
22.44
82
12
154
python
[{"finding_id": "codeql_py/jinja2/autoescape-false_e4b6027691c62c86_03150461", "tool_name": "codeql", "rule_id": "py/jinja2/autoescape-false", "finding_type": "problem", "severity": "medium", "confidence": "medium", "message": "Using jinja2 templates with autoescape=False can potentially allow XSS attacks.", "remediati...
1
true
2024-11-18T22:11:39.605217+00:00
1,580,395,027,000
dd89a2d24956fa7ef33ef1f86137ff1072a3b477
2
{ "blob_id": "dd89a2d24956fa7ef33ef1f86137ff1072a3b477", "branch_name": "refs/heads/master", "committer_date": 1580395027000, "content_id": "bf786883fac318a42050da3c22bf62d4a7239926", "detected_licenses": [ "MIT" ], "directory_id": "6a7bd3fce2e7744d252e4b959e82454d10d5d098", "extension": "py", "fi...
2.3125
stackv2
from ipywidgets import * import ipygee as ui from .calendar import Calendar class Scores(ui.widgets.CheckAccordion): def __init__(self, **kwargs): self.outliers = SelectMultiple(description='Outliers bands') self.medoid = SelectMultiple(description='Medoid bands') self.doy = Calendar(month...
42
35.24
74
15
341
python
[]
0
true
2024-11-18T22:11:39.712710+00:00
1,508,753,499,000
a72ced34e5ecb404d30f068dbf1b57f7b7afc4ce
2
{ "blob_id": "a72ced34e5ecb404d30f068dbf1b57f7b7afc4ce", "branch_name": "refs/heads/master", "committer_date": 1508753499000, "content_id": "6503286b6d06a3aee9d1af253c781836dd5245d4", "detected_licenses": [ "MIT" ], "directory_id": "ba98d4ba587ecb7d7941cb32d1df1adea4332ebf", "extension": "py", "fi...
2.421875
stackv2
import CppHeaderParser from difflib import SequenceMatcher import os, re, glob class CppHeader(object): def __init__(self): pass class TestReader(object): def __init__(self, writer, includeResolver = None): self.writer = writer self._includeResolver = includeResolver def _handleIn...
292
38.39
132
21
2,114
python
[]
0
true
2024-11-18T22:11:39.837346+00:00
1,529,597,644,000
4f9a855d7e542c839764b2ac0a8573c759c416aa
3
{ "blob_id": "4f9a855d7e542c839764b2ac0a8573c759c416aa", "branch_name": "refs/heads/master", "committer_date": 1529597644000, "content_id": "cdb2ce92cd3f3115a9bee4cf03d3284ac0ddc03b", "detected_licenses": [ "MIT" ], "directory_id": "6a74ca985f5f4ea51b78b08981cedc17c514cee4", "extension": "py", "fi...
2.796875
stackv2
# -*- coding: utf-8 -*- # ena_processing module for epistemic network analysis import os import numpy as np def look_for_topic_score(a_dict,word,size): values = [] the_keys = a_dict.keys() for key in the_keys: if word.startswith(key): values = a_dict[key] return values ...
136
34.15
95
16
1,217
python
[]
0
true
2024-11-18T22:11:39.964916+00:00
1,592,179,250,000
56623b7be64ce15d5821a602960e64b890626778
3
{ "blob_id": "56623b7be64ce15d5821a602960e64b890626778", "branch_name": "refs/heads/master", "committer_date": 1592179250000, "content_id": "8f076822bfba9698d4fef0fca89b1c163c155c1a", "detected_licenses": [ "MIT" ], "directory_id": "c0fc645c9a5be5fc3bd862ab7887db56b29f6bc3", "extension": "py", "fi...
2.78125
stackv2
from django.shortcuts import render, redirect, HttpResponse from django.utils.crypto import get_random_string from datetime import datetime import random def index(request): now = datetime.now() print(now) context = { 'current_time': now } #totalGold = is a cookie stored in dict ...
103
33.16
112
15
817
python
[]
0
true
2024-11-18T22:11:40.049235+00:00
1,538,975,699,000
1671307a7aa67820425ebe43ece0d1d1cca98127
3
{ "blob_id": "1671307a7aa67820425ebe43ece0d1d1cca98127", "branch_name": "refs/heads/master", "committer_date": 1538975699000, "content_id": "7e043ac46401157abed4593ebe4837567a549d3b", "detected_licenses": [ "MIT" ], "directory_id": "89d63a264d19548c438bcb804c699ca7ed70d6a4", "extension": "py", "fi...
2.734375
stackv2
import discord from feedgen.feed import FeedGenerator import config token = open(".token", "r").read() client = discord.Client() feed = FeedGenerator() feed.title(config.feedtitle) feed.link(href=config.feedlink) feed.description(config.feeddescription) @client.event async def on_ready(): print("Logged in as", c...
32
26.91
63
13
193
python
[]
0
true
2024-11-18T22:11:40.648394+00:00
1,569,030,245,000
0b100600f048f7d93452ea7466655108dc1e1962
3
{ "blob_id": "0b100600f048f7d93452ea7466655108dc1e1962", "branch_name": "refs/heads/master", "committer_date": 1569030245000, "content_id": "ac205155c07c807fabce49197af8fe326aeeeff2", "detected_licenses": [ "MIT" ], "directory_id": "94462ad305ce7811a46ed7e14db774a8dd303442", "extension": "py", "fi...
2.984375
stackv2
# # @lc app=leetcode id=200 lang=python3 # # [200] Number of Islands # class Solution: def numIslands(self, grid) -> int: if not grid: return 0 rows, cols = len(grid), len(grid[0]) visited = [[False for x in col] for col in grid] islands = 0 def dfs(i, j): ...
30
25.07
94
15
227
python
[]
0
true
2024-11-18T22:11:40.711699+00:00
1,618,750,482,000
d2dfb26a85dad66d15cd2d2cf2697b9c7b29dbc2
3
{ "blob_id": "d2dfb26a85dad66d15cd2d2cf2697b9c7b29dbc2", "branch_name": "refs/heads/main", "committer_date": 1618750482000, "content_id": "eb17126f699a113b00b29a18931fdfed89950e8f", "detected_licenses": [ "MIT" ], "directory_id": "466904871bf1fa4396be1951c4c992d7727a1aad", "extension": "py", "file...
2.671875
stackv2
import pandas as pd import numpy as np import plotly.express as px import plotly.graph_objects as go from plotly.subplots import make_subplots import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output external_stylesheets = ['https://codepen.io/chr...
226
25.23
87
20
1,905
python
[]
0
true
2024-11-18T22:11:40.776912+00:00
1,634,111,410,000
d4eee081e6125fe367a0a794c2aec792a693c180
3
{ "blob_id": "d4eee081e6125fe367a0a794c2aec792a693c180", "branch_name": "refs/heads/master", "committer_date": 1634111410000, "content_id": "e4f789769b46a9eaef4367d5c6e5b13341dabaea", "detected_licenses": [ "Apache-2.0" ], "directory_id": "8ea7049d5d0f51a50648092948379ac8e72f7885", "extension": "py"...
2.578125
stackv2
#!/usr/bin/python import matplotlib.pyplot as plt import numpy as np import common as c #Line following clock time def rt_time_line(clock_l, clock_unit, rt_l, rt_unit, output_file): fs = 10; bw = 0.5; lw = 1.5; cs=2.5; ms=4 plt.figure(figsize=(8,4)) plt.plot(clock_l, rt_l, '--', linewidth=lw, label="Roundtrip L...
85
41.56
106
13
1,230
python
[]
0
true
2024-11-18T22:11:40.957474+00:00
1,593,905,728,000
b31748c1bb8549d7020da55534b2b12435184e86
3
{ "blob_id": "b31748c1bb8549d7020da55534b2b12435184e86", "branch_name": "refs/heads/master", "committer_date": 1593905728000, "content_id": "cf6f29208e7342168d8040697813351f2cd7e70f", "detected_licenses": [ "MIT" ], "directory_id": "5d9c05cd100dc20d5b641ae7832c65d3c8508f3e", "extension": "py", "fi...
2.921875
stackv2
# get config to connect to database import json import mysql.connector class MySQLConnector: "Singleton" instance = None class MySQLConnectorSingleton: "Inner Class" def __init__(self, config_path): data = json.load(open(config_path)) config = { ...
29
29.1
89
14
168
python
[]
0
true
2024-11-18T22:11:41.140492+00:00
1,648,045,692,000
42ef7b0647dc0fe2ce93de4b66c19c1d84ec378a
3
{ "blob_id": "42ef7b0647dc0fe2ce93de4b66c19c1d84ec378a", "branch_name": "refs/heads/master", "committer_date": 1648045692000, "content_id": "113146415bc676dd59a9e6402814d028669cad21", "detected_licenses": [ "Apache-2.0" ], "directory_id": "738df50d55fe023c62467f7d72255f9f372bfd8a", "extension": "py"...
2.625
stackv2
import json import boto3 import base64 import os import uuid from datetime import datetime S3_BUCKET_UPLOAD_IMAGE = os.environ['S3_BUCKET_UPLOAD_IMAGE'] client_s3 = boto3.client('s3') def putObjectToS3(data): print ('>> putObjectToS3') # Generate file name originalNameAndExt = data['name'] divi...
44
23.89
63
12
279
python
[]
0
true
2024-11-18T22:11:41.200331+00:00
1,611,652,566,000
aa15373e972f01202f04eea8cf39d08f7040ddb1
3
{ "blob_id": "aa15373e972f01202f04eea8cf39d08f7040ddb1", "branch_name": "refs/heads/master", "committer_date": 1611652566000, "content_id": "6c15d2094c64449569adee8a8666606627601852", "detected_licenses": [ "MIT" ], "directory_id": "8d6020321aa4d67971624325d7221adb4ac21bcf", "extension": "py", "fi...
2.65625
stackv2
import unittest from injecta.service.argument.PrimitiveArgument import PrimitiveArgument class PrimitiveArgumentTest(unittest.TestCase): def test_string(self): argument = PrimitiveArgument('hello world') self.assertEqual('\'hello world\'', argument.getStringValue()) def test_number(self): ...
58
32.93
144
11
414
python
[]
0
true
2024-11-18T22:11:41.247278+00:00
1,626,564,615,000
02041f61238d2c3cdabf1d04692695135be17da9
3
{ "blob_id": "02041f61238d2c3cdabf1d04692695135be17da9", "branch_name": "refs/heads/main", "committer_date": 1626564615000, "content_id": "8dde37bf24aa7e5c2a5f72cb39cabe0d82a4b203", "detected_licenses": [ "MIT" ], "directory_id": "7aa18c68ffc0824463e52a4299420d9ceb3d009c", "extension": "py", "file...
2.625
stackv2
# Rocket class definition # Maintained by Raihaan Usman and Luis Marques from libraries.components.Component import Component as Component import pickle, os class Rocket: def __init__ (self, name, defined_constraints={}, enforced_constraints=[]): self.name = name self.constraints = defined_const...
68
32.13
155
19
451
python
[]
0
true
2024-11-18T22:11:41.307001+00:00
1,673,295,091,000
1fbc1c2ee571152528133c8494a2c4d44d561cac
3
{ "blob_id": "1fbc1c2ee571152528133c8494a2c4d44d561cac", "branch_name": "refs/heads/master", "committer_date": 1673295091000, "content_id": "8d6b540cfd67ccec5f56817e763b40210309f5db", "detected_licenses": [ "MIT" ], "directory_id": "7de9290f987f3233ff526f842f80206a3fb7d6a8", "extension": "py", "fi...
2.859375
stackv2
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm import seaborn as sns import os #from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot class Plot: def bar_plot(self, xlabel, ylabel, zlabel, xxlabels, yylabels, view, save, variance=False, cu...
143
28.66
142
17
1,023
python
[]
0
true
2024-11-18T22:11:41.422099+00:00
1,598,546,215,000
abd70bb8d681b1ec1d382945e765a82de6decd38
4
{ "blob_id": "abd70bb8d681b1ec1d382945e765a82de6decd38", "branch_name": "refs/heads/master", "committer_date": 1598546215000, "content_id": "c6f36af34f9b25c4fc1ecc9e2d575ccb37491ca2", "detected_licenses": [ "MIT" ], "directory_id": "280dee3aa31737800c58adaf5c7c1e61dd58e8b2", "extension": "py", "fi...
3.984375
stackv2
#Diccionario diccionario = {'variable1': "kebapconverduras",'variable2': "kelv9"} print(diccionario['variable1']) #Lista lista = ["ASDasd","ASDAsd",15.8,'asdasd',""] print(lista[-3]) #Inmutable tupla1 = ("Hola","Mundo") texto1, texto2= tupla1 print(texto1, texto2) #Identacion y condicionales. if diccionario['variabl...
23
19.91
68
9
164
python
[]
0
true
2024-11-18T22:11:41.918097+00:00
1,691,839,659,000
6fa5383f2cfa65f72482de72e3e17786a030b1f5
4
{ "blob_id": "6fa5383f2cfa65f72482de72e3e17786a030b1f5", "branch_name": "refs/heads/main", "committer_date": 1691839659000, "content_id": "98821a3b1f9d74d58249d5394bb37f9887078dde", "detected_licenses": [], "directory_id": "dbbfad3e182c60b1aee658feddca196ae12a85df", "extension": "py", "filename": "excel...
3.734375
stackv2
import os from openpyxl import load_workbook def get_cell_value_handle_error(cell): """ Retrieve the value of a given cell and handle error types. Parameters ---------- cell : openpyxl.cell.cell.Cell The cell to get the value from. Returns -------- object The value o...
139
24.52
106
16
783
python
[]
0
true
2024-11-18T22:11:41.970587+00:00
1,664,464,162,000
7f2900105ba4d0629ac78fa138356df14a6fd71f
2
{ "blob_id": "7f2900105ba4d0629ac78fa138356df14a6fd71f", "branch_name": "refs/heads/main", "committer_date": 1664464162000, "content_id": "2fbaa42ffeab086c14d2e1c1393305d5e4cee99c", "detected_licenses": [ "MIT" ], "directory_id": "ee08398cd300de34582479e1d15aaaaf128e8701", "extension": "py", "file...
2.375
stackv2
import pandas as pd import numpy import networkx def getConnectionToTF(model, allTFs, affectedNodes): g = networkx.from_pandas_edgelist(model, 'source', 'target', create_using=networkx.DiGraph()) allNodes = numpy.array(list(g.nodes)) includedTFs = numpy.intersect1d(allTFs, allNodes) connectedToTF = nu...
127
41.51
141
18
1,450
python
[]
0
true
2024-11-18T22:11:42.055999+00:00
1,618,395,271,000
d024624b964886d44a7fd93d2592228e37c01c80
3
{ "blob_id": "d024624b964886d44a7fd93d2592228e37c01c80", "branch_name": "refs/heads/master", "committer_date": 1618395271000, "content_id": "17485258bcf325b3abb2044da7d811eba72cb656", "detected_licenses": [ "MIT" ], "directory_id": "92d46641d3ad7d1e02c8493927d4f514ff471e0a", "extension": "py", "fi...
3.09375
stackv2
from typing import Dict from matplotlib import pyplot as plt from PIL import Image from services.classify import ClassificationResult def display_classification_results(results: ClassificationResult) -> None: """ Display a GUI window showing the images and the probabilities that a given image is classif...
32
27.97
96
12
232
python
[]
0
true
2024-11-18T22:11:42.170365+00:00
1,655,445,135,000
1d6937149e89db69355f126f707fff6d9f76810f
2
{ "blob_id": "1d6937149e89db69355f126f707fff6d9f76810f", "branch_name": "refs/heads/master", "committer_date": 1655445135000, "content_id": "07774626ae0e132efe031e7e5378e92c26b09ab0", "detected_licenses": [ "MIT" ], "directory_id": "6b0a3af51d2d715b44c44a0c1b85b767b7376ca7", "extension": "py", "fi...
2.484375
stackv2
import logging import threading import RPi.GPIO as GPIO logger = logging.getLogger('EInkUI') class ButtonAndLed: def __init__(self, controller, button_gpio=26, led_gpio=21): self.button_gpio = button_gpio self.controller = controller GPIO.setmode(GPIO.BCM) GPIO.setup(button_gpio,...
38
26.68
76
14
237
python
[]
0
true
2024-11-18T22:11:42.395119+00:00
1,596,135,238,000
f1f0d8af00fef1ccd0463d2ba1a1f54f5ae6051d
3
{ "blob_id": "f1f0d8af00fef1ccd0463d2ba1a1f54f5ae6051d", "branch_name": "refs/heads/master", "committer_date": 1596135238000, "content_id": "c3a29b9f7dbe3782a41b18559a4e4aa02dc3a9c8", "detected_licenses": [ "MIT" ], "directory_id": "bfa18247f4d3df9dab1dc6ec307fd58adec42ade", "extension": "py", "fi...
2.53125
stackv2
import os,sys,inspect currentdir = os.getcwd() parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) import utils.bot as bot def lets_chat(): model = bot.Model() prevMsg = None try: while True: question = input('\nask : ') reply_m ...
34
19.44
66
14
144
python
[]
0
true
2024-11-18T22:11:42.447967+00:00
1,686,708,338,000
74f25a81ecee583d623a891be4a93bb2713e23c9
3
{ "blob_id": "74f25a81ecee583d623a891be4a93bb2713e23c9", "branch_name": "refs/heads/master", "committer_date": 1687234657000, "content_id": "0f9f1663bedb3af3caf1571a8ffb3d2c3ac6d2cf", "detected_licenses": [ "MIT" ], "directory_id": "fa42a30d96bbdfa9b81de691013e68c2dcedc27d", "extension": "py", "fi...
3.453125
stackv2
# This script reads source files given as arguments and rewrites them, # replacing anything that looks like a copyright header with # the contents of 'header.inc'. The |year| placeholder is replaced # with the current year. import datetime import os import shutil import sys import tempfile # The rules for recognizing...
108
29.68
80
17
707
python
[]
0
true
2024-11-18T22:11:42.634816+00:00
1,575,927,628,000
27bccd833254ae2013ed8dd23c976ed0db1f46fb
3
{ "blob_id": "27bccd833254ae2013ed8dd23c976ed0db1f46fb", "branch_name": "refs/heads/master", "committer_date": 1575927628000, "content_id": "2879cb305b14e1d13c1e8efe5187614b288ae403", "detected_licenses": [ "MIT" ], "directory_id": "f052da8e80d9fb4805a45f0097c56b891f93b633", "extension": "py", "fi...
2.515625
stackv2
import json import random import string from liquid_dl.settings import BASE_DIR import os from passlib.hash import pbkdf2_sha256 def create_new_cloudcmd_password(N=10): os.chdir(BASE_DIR) cmd = "node node_modules/cloudcmd/bin/cloudcmd --username admin --password " new_pswrd = ''.join(random.SystemRandom(...
36
33.36
111
12
321
python
[]
0
true
2024-11-18T22:11:43.231077+00:00
1,515,766,814,000
a02fd88d47f4efd0afd70711e280995027cde4e6
3
{ "blob_id": "a02fd88d47f4efd0afd70711e280995027cde4e6", "branch_name": "refs/heads/master", "committer_date": 1515766814000, "content_id": "d80b78049645b4c7e27df80e6ed30df841aed1e2", "detected_licenses": [ "MIT" ], "directory_id": "6a359cc353252935e1dbfea50a093253afdb8cba", "extension": "py", "fi...
3.390625
stackv2
from matplotlib import pyplot as plt from matplotlib.patches import Rectangle from itertools import cycle def fraction_bar(counts,labels,ax=None,cmap_name="Dark2", legend=True,horizontal=True,title="",number=False): # Get an axis if ax is None: figsize = (10,1) if not hori...
49
31.59
93
16
442
python
[]
0
true
2024-11-18T22:11:43.341881+00:00
1,546,857,392,000
69a9214fca9b350c9c2e468b749b1b5da94db784
3
{ "blob_id": "69a9214fca9b350c9c2e468b749b1b5da94db784", "branch_name": "refs/heads/master", "committer_date": 1546857392000, "content_id": "4f85b1c2faced793756d98eb74945176c8750c12", "detected_licenses": [ "MIT" ], "directory_id": "a3e70d262535691f5b001e728d0b9a2c111fa92c", "extension": "py", "fi...
2.828125
stackv2
#!/usr/local/bin/python # -*- coding: utf-8 -*- import pyparsing as pp from pyparsing_ext.actions import * arithOplist = [('**', 2, pp.opAssoc.RIGHT, RightBinaryOperatorAction), (pp.oneOf('+ - ~'), 1, pp.opAssoc.RIGHT, UnaryOperatorAction), (pp.oneOf('* / // %'), 2, pp.opAssoc.LEFT, BinaryOperatorAction), ...
52
36.85
89
11
533
python
[]
0
true
2024-11-18T22:11:43.388838+00:00
1,594,460,989,000
5d40e402f67bf79bb8f8ca9f0a0fe12fe1b665ad
3
{ "blob_id": "5d40e402f67bf79bb8f8ca9f0a0fe12fe1b665ad", "branch_name": "refs/heads/master", "committer_date": 1594460989000, "content_id": "db6fe050864dbe086655e959e056b96af1d427c8", "detected_licenses": [ "Apache-2.0" ], "directory_id": "6ecee1d9c6bcb33b659e3bc174420f7b4b0aa40c", "extension": "py"...
2.859375
stackv2
import numpy as np from skimage.transform import ProjectiveTransform, FundamentalMatrixTransform from rust_bindings import homogeneous def get_rotation(T): return T[0:3, 0:3] def get_translation(T): return T[0:3, 3] def get_rotation_translation(T): return get_rotation(T), get_translation(T) def inv...
149
20.32
77
14
1,023
python
[]
0
true
2024-11-18T22:11:43.499319+00:00
1,523,643,163,000
be440135a7e81bdebadabf66e7ad7a99222ab9f1
2
{ "blob_id": "be440135a7e81bdebadabf66e7ad7a99222ab9f1", "branch_name": "refs/heads/master", "committer_date": 1523643163000, "content_id": "975b6dbe410b1541e458ed60045c48c5a29f64af", "detected_licenses": [ "MIT" ], "directory_id": "25978f857bcd50b425481168f30f025771a657ad", "extension": "py", "fi...
2.34375
stackv2
import os import json import pickle import shutil import argparse import numpy as np from tqdm import * from models import * import pandas as pd import nibabel as nib from random import seed, shuffle from keras.layers import * from keras.callbacks import CSVLogger from keras.optimizers import SGD, Adam, Adagrad from s...
369
31.8
100
17
3,052
python
[]
0
true
2024-11-18T22:11:43.569820+00:00
1,641,990,080,000
84be32e147d9c6b72752c7a40e67c5496c3a27b0
3
{ "blob_id": "84be32e147d9c6b72752c7a40e67c5496c3a27b0", "branch_name": "refs/heads/master", "committer_date": 1641990080000, "content_id": "22caacde70399b507623d9cd72453e452961d0f9", "detected_licenses": [ "Unlicense" ], "directory_id": "d159b8f142cc40a91c3d5f469e41a481aa976ccc", "extension": "py",...
2.640625
stackv2
import discord TOKEN = "<Add token string here>" claimed_rooms = {} class DiscordDriverClient(discord.Client): async def on_ready(self): print("Connection is ready") async def on_group_join(self, channel, user): print("User joined the group") print(channel.__dict__) print(user.__dict__) async ...
77
37.35
112
20
663
python
[]
0
true
2024-11-18T22:11:43.624235+00:00
1,689,056,330,000
7877db4b99b9883867ef05cd814228c6e8f15175
3
{ "blob_id": "7877db4b99b9883867ef05cd814228c6e8f15175", "branch_name": "refs/heads/main", "committer_date": 1689056330000, "content_id": "3b8091486c8c9fceef5409f2059fd279910d0cca", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "5b7c2feb27a71837edf526315d413706a6bf82ff", "extension": "py"...
3
stackv2
# Copyright (c) Facebook, Inc. and its affiliates. # Mostly copy-pasted from # https://github.com/facebookresearch/detr/blob/master/util/box_ops.py import torch from torch import Tensor from torchvision.ops.boxes import box_area def box_cxcywh_to_xyxy(x: Tensor): x_c, y_c, w, h = x.unbind(-1) b = [(x_c - 0.5...
57
28.95
76
11
628
python
[]
0
true
2024-11-18T22:11:43.677016+00:00
1,520,836,877,000
acc86af0adbc79d4a5ea5c472a0d1d71a83b188b
3
{ "blob_id": "acc86af0adbc79d4a5ea5c472a0d1d71a83b188b", "branch_name": "refs/heads/master", "committer_date": 1520836877000, "content_id": "e6a3a7532337d4ce8ca0922d6536ebf10720f3ad", "detected_licenses": [ "Apache-2.0" ], "directory_id": "970e890767da78ec287c9a72fea0154e9defb39d", "extension": "py"...
2.578125
stackv2
#!/usr/bin/env python3 # -*- coding:utf-8 -*- __author__ = 'xiaosong Liu' import tensorflow as tf import numpy as np import functools def lazy_property(function): attribute = '_' + function.__name__ @property @functools.wraps(function) def wrapper(self): if not hasattr(self, attribute): setattr(self, attri...
106
33.16
123
18
964
python
[]
0
true
2024-11-18T22:11:43.797156+00:00
1,529,368,899,000
a28fbdf199b9cc5881bf147ea415739c38aab716
3
{ "blob_id": "a28fbdf199b9cc5881bf147ea415739c38aab716", "branch_name": "refs/heads/master", "committer_date": 1529368899000, "content_id": "797e4fbb73121b1876210b4278e2a06bac56a7dd", "detected_licenses": [ "MIT" ], "directory_id": "b2d320ccaff0aea90ec582a4543dcd482fbe7a2f", "extension": "py", "fi...
2.734375
stackv2
import sys import pygame import game_functions as gf from pygame.sprite import Group from settings import Settings from game_stats import GameStats from scoreboard import Scoreboard from button import Button from ship import Ship from enemy import Alien from background import Background def run_game(): """Main gam...
45
33.89
88
11
360
python
[]
0
true
2024-11-18T22:11:43.861114+00:00
1,634,485,514,000
2c819ca4948ded2631edf743173565c03a79ffab
4
{ "blob_id": "2c819ca4948ded2631edf743173565c03a79ffab", "branch_name": "refs/heads/main", "committer_date": 1634485514000, "content_id": "dc86ff010e63e924748961c7b0b173923a7c2d64", "detected_licenses": [ "MIT" ], "directory_id": "8fef8af953e8dafde78c671e8ee9813d08ab2d60", "extension": "py", "file...
3.5625
stackv2
# https://leetcode.com/problems/gas-station/ #https://leetcode.com/problems/gas-station/discuss/1004074/Greedy-Method-or-Explanation-%2B-Visual-or-Python # To make a car work the difference between gas available at the gas station i.e gas[i] and the gas in the car # cost[i] should be positive # Once we get this poi...
27
32.96
111
11
265
python
[]
0
true
2024-11-18T22:11:43.916253+00:00
1,629,433,414,000
43981f632556bd47aa05e1aad4eda6db9269eb92
2
{ "blob_id": "43981f632556bd47aa05e1aad4eda6db9269eb92", "branch_name": "refs/heads/main", "committer_date": 1629433414000, "content_id": "c9dd9a083d913376831a38b4d1ff534e69918eb1", "detected_licenses": [ "Apache-2.0" ], "directory_id": "bbf9fdde40203535c05a4b4580e8ae4e8aff193a", "extension": "py", ...
2.375
stackv2
# From Python # It requires OpenCV installed for Python from .PoseEstimation import PoseEstimation import sys import cv2 import os # import DTW import numpy as np from .utils import limb_breakdown, crop_resize_image class OpenPose(PoseEstimation): def __init__(self): try: # Import Openpose (Win...
88
31.5
131
19
692
python
[]
0
true
2024-11-18T22:11:44.494099+00:00
1,555,101,147,000
ca87233225fcd1e5efbdd4a2f3a79ddae82e90c7
2
{ "blob_id": "ca87233225fcd1e5efbdd4a2f3a79ddae82e90c7", "branch_name": "refs/heads/master", "committer_date": 1555101147000, "content_id": "b7a52f07d446dd3561b98cf35f83b5e248820887", "detected_licenses": [ "MIT" ], "directory_id": "30df673e7925ae51f88c1cfcc52dbd4e364b24d9", "extension": "py", "fi...
2.453125
stackv2
from enums.dependency_type import DependencyType class QuantityDependency: def __init__(self, dependency_type: DependencyType, start_quantity, end_quantity, start_quantity_values=None, start_quantity_gradients=None, end_quantity_v...
18
39.22
64
9
118
python
[]
0
true
2024-11-18T22:11:44.584362+00:00
1,480,962,009,000
1689d93b1f08fccf994ac640ba79ce381e33380c
2
{ "blob_id": "1689d93b1f08fccf994ac640ba79ce381e33380c", "branch_name": "refs/heads/master", "committer_date": 1480962009000, "content_id": "e3326193b3830e979388d91fdf8930f647d5efbe", "detected_licenses": [ "ISC" ], "directory_id": "702a34e117e7d65735b79c35dd0f035f62665745", "extension": "py", "fi...
2.484375
stackv2
# -*- coding: utf-8 -*- import re from ConfigParser import ConfigParser import os from twisted.internet import defer from bouser.utils import safe_int __author__ = 'viruzzz-kun' re_usagi_config = re.compile(ur'https?://.*', re.U) re_local_config = re.compile(ur'((file://)?/)?.*', re.U) def set_value(d, path, ite...
64
25.23
65
18
407
python
[]
0
true
2024-11-18T22:11:49.542681+00:00
1,576,474,010,000
c12e2cd567d21e574922bbcb54e0d112b6d4c807
4
{ "blob_id": "c12e2cd567d21e574922bbcb54e0d112b6d4c807", "branch_name": "refs/heads/master", "committer_date": 1576474010000, "content_id": "9fa74324588c87d4eb279a4e3b8d3dcac19a8bec", "detected_licenses": [ "MIT" ], "directory_id": "2f0681ba95a35c0335d5e9ae810547f5653f89e9", "extension": "py", "fi...
3.546875
stackv2
# vendor imports import click @click.command() @click.argument("input_file", type=click.File("r")) def main(input_file): """Put your puzzle execution code here""" # Convert the comma-delimited string of numbers into a list of ints register = list( map(lambda op: int(op), input_file.read().strip()....
70
27.76
78
17
463
python
[]
0
true
2024-11-18T22:11:49.714183+00:00
1,598,623,305,000
2e78719d90ea929566bf63fef35a7a35e157acbc
3
{ "blob_id": "2e78719d90ea929566bf63fef35a7a35e157acbc", "branch_name": "refs/heads/master", "committer_date": 1598623305000, "content_id": "5eb8b98035c0a5e88188a5a0af256ed07109bbf3", "detected_licenses": [ "MIT" ], "directory_id": "6469ddc4f050a38237f3ccd62f9099900a711d73", "extension": "py", "fi...
2.84375
stackv2
from rest_framework.pagination import PageNumberPagination from rest_framework.response import Response class CustomPagination(PageNumberPagination): def get_paginated_response(self, data): total_objs = self.page.paginator.count objes_per_count = self.get_page_size(self.request)...
44
36.75
175
16
362
python
[]
0
true
2024-11-18T22:11:49.852932+00:00
1,671,832,928,000
d34c8149cf775077e8ecee5dfb2272c2392a7d59
2
{ "blob_id": "d34c8149cf775077e8ecee5dfb2272c2392a7d59", "branch_name": "refs/heads/master", "committer_date": 1671832928000, "content_id": "29560c8c72044e71043f1c89f20f1de62e9f98dc", "detected_licenses": [ "MIT" ], "directory_id": "d77545ea6755126f47b92f775ec9480f6a7ad1f7", "extension": "py", "fi...
2.3125
stackv2
"""Train script. Usage: train.py <hparams> <dataset_root> [--cuda=<id>] train.py -h | --help Options: -h --help Show this screen. --cuda=<id> id of the cuda device [default: 0]. """ import torch import numpy as np import json from docopt import docopt from os.path import join from irl_dcb.config import ...
59
33.34
79
16
514
python
[]
0
true
2024-11-18T22:11:50.109240+00:00
1,543,980,562,000
0dfd228ef5bb57adb064cde5c8a6b813f0eb7b3c
3
{ "blob_id": "0dfd228ef5bb57adb064cde5c8a6b813f0eb7b3c", "branch_name": "refs/heads/master", "committer_date": 1543980562000, "content_id": "1068168d680d34638dc20fb43787d3e93c976af8", "detected_licenses": [ "MIT" ], "directory_id": "a290eba23a67c2843e1a09479125abe694ba21a7", "extension": "py", "fi...
2.765625
stackv2
import boto3 BUCKET = ' your bucket name' #input your bucket name KEY = ' My file' #input your json file # --------------- Helpers that build all of the responses ---------------------- def build_speechlet_response(title, output, reprompt_text, should_end_session): return { 'outputSpeech':...
134
34.68
136
16
1,000
python
[]
0
true
2024-11-18T22:11:50.319176+00:00
1,632,001,576,000
9bc449116b546eccc5538965c3419bb114f32d8d
3
{ "blob_id": "9bc449116b546eccc5538965c3419bb114f32d8d", "branch_name": "refs/heads/main", "committer_date": 1632001576000, "content_id": "3129848670d763ec9d0f07dc11cbe3951306bda0", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0a69487302b10312a85701108e99d5d3b3cd225b", "extension": "py", ...
3
stackv2
import math from typing import Union import numpy as np from rlgym.utils import RewardFunction from rlgym.utils.gamestates import PlayerData, GameState from rlgym.utils.reward_functions.common_rewards import ConstantReward class _DummyReward(RewardFunction): def reset(self, initial_state: GameState): pass ...
90
40.01
116
16
825
python
[]
0
true
2024-11-18T22:11:50.818903+00:00
1,584,404,423,000
4e0d0686f28af87dbe730da2cd12a3d3445d093f
3
{ "blob_id": "4e0d0686f28af87dbe730da2cd12a3d3445d093f", "branch_name": "refs/heads/master", "committer_date": 1584404423000, "content_id": "ae0120c07958df27ddb90be59dede2dc46563356", "detected_licenses": [ "MIT" ], "directory_id": "e5fb34819dcb5153108dac3e778c6c759e922634", "extension": "py", "fi...
3.15625
stackv2
# This Python file uses the following encoding: utf-8 import matplotlib.pyplot as plt import json def makePlotIterationBasic(benchmakrAsJson): benchmarkArray = benchmakrAsJson["benchmarks"]; nameOfBenchmarkBaseIter = "IterateAndMultiplayOverLargArrayWithStep" nameOfBenchmarkReverseIter = "IterateReverseAnd...
70
42.03
109
15
754
python
[]
0
true
2024-11-18T22:11:50.962186+00:00
1,625,664,698,000
d3b4aae06697c6d2bbdd09326acdba0ed6aa57c6
2
{ "blob_id": "d3b4aae06697c6d2bbdd09326acdba0ed6aa57c6", "branch_name": "refs/heads/master", "committer_date": 1625664698000, "content_id": "b4c8363fc0d3eddae25139372378b5091c8ee4fe", "detected_licenses": [ "MIT" ], "directory_id": "7a8191bb9ce8b92fdde62c9d2dc0883ddbbc070a", "extension": "py", "fi...
2.46875
stackv2
"""Skynet download API. """ import json import os from . import utils def default_download_options(): """Returns the default download options.""" obj = utils.default_options("/") return obj def download_file(self, path, skylink, custom_opts=None): """Downloads file to path from given skylink wit...
68
23
75
10
350
python
[]
0
true
2024-11-18T22:11:51.245472+00:00
1,600,268,318,000
1dc86081f205b95012d63f6444993797c8080a43
3
{ "blob_id": "1dc86081f205b95012d63f6444993797c8080a43", "branch_name": "refs/heads/master", "committer_date": 1600268318000, "content_id": "b5c38ef8a7a0dc739c4e05898ccf394e24f693c9", "detected_licenses": [ "MIT" ], "directory_id": "797ff15c55ab1aaaf34b762d8764e3ab2989dd18", "extension": "py", "fi...
2.71875
stackv2
import logging from sklearn.base import BaseEstimator, RegressorMixin import numpy as np from .multinomial import MultinomialRegression from ..utils import clip_for_log from sklearn.metrics import log_loss from .multinomial import _get_identity_weights class FullDirichletCalibrator(BaseEstimator, RegressorMixin): ...
74
32.47
143
13
569
python
[]
0
true
2024-11-18T22:11:51.319976+00:00
1,624,380,229,000
190e60092fa3ecfa4ba2ae3d0a9c69bda7e903d6
2
{ "blob_id": "190e60092fa3ecfa4ba2ae3d0a9c69bda7e903d6", "branch_name": "refs/heads/main", "committer_date": 1624387759000, "content_id": "b7ea017cfb86a7cf313e0fa157b4855fd17f0216", "detected_licenses": [ "MIT" ], "directory_id": "01a28e08e3e21bb212c5635d2dbfc15f013a9147", "extension": "py", "file...
2.5
stackv2
#!/usr/bin/env python3 # sudo apt install python3 python3-pip # sudo pip3 install kafka-python prometheus-client rfc3339 import datetime, sys from kafka import KafkaConsumer, KafkaProducer from prometheus_client import start_http_server from prometheus_client import Counter from rfc3339 import rfc3339 def publish_me...
76
28.34
119
15
537
python
[]
0
true
2024-11-18T22:11:51.534623+00:00
1,541,736,278,000
22230262a1cba18e7d51a5e47300ababdd72d01d
3
{ "blob_id": "22230262a1cba18e7d51a5e47300ababdd72d01d", "branch_name": "refs/heads/master", "committer_date": 1541736278000, "content_id": "6f5f15a469203afc80a526405b14a05618637500", "detected_licenses": [ "Apache-2.0" ], "directory_id": "53705eb05b83771bde3a61d7d80deed4e3bc6bdd", "extension": "py"...
2.828125
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup import logging as log import re def get_html(url): try: response = requests.get(url, timeout=30) response.raise_for_status() response.encoding = 'utf-8' return response.text except: ...
59
30.31
75
17
491
python
[{"finding_id": "codeql_py/incomplete-hostname-regexp_ccecbda7954bd976_25f284a0", "tool_name": "codeql", "rule_id": "py/incomplete-hostname-regexp", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "This string, which is used as a regular expression [here](1), has an unescaped '.' befor...
1
true
2024-11-18T22:11:51.731808+00:00
1,595,576,885,000
9e18ff4964931a8e03537d1d65e4d5e97c2d0da9
2
{ "blob_id": "9e18ff4964931a8e03537d1d65e4d5e97c2d0da9", "branch_name": "refs/heads/master", "committer_date": 1595576885000, "content_id": "402473ecada7929d1d9cf03d59ae8a527be821ff", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e5b7d3891d773e059ba4d4e6265af2002fc345ac", "extension": "py"...
2.3125
stackv2
# -*- coding: utf-8 -*- # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
90
35.02
78
15
746
python
[]
0
true
2024-11-18T22:11:52.327753+00:00
1,396,555,314,000
0f5a4b14dd7281ba39bd619e0ffadb096aae9810
3
{ "blob_id": "0f5a4b14dd7281ba39bd619e0ffadb096aae9810", "branch_name": "refs/heads/master", "committer_date": 1396555314000, "content_id": "c76d85899579e36302488ae4ca88836727cf5e45", "detected_licenses": [ "Apache-2.0" ], "directory_id": "f264f3df859e3b4a5a91bfff76281e50a47778f4", "extension": "py"...
3.15625
stackv2
#!/usr/bin/env python import sys, random if len(sys.argv) != 3: sys.stderr.write("Must provide file with list of filenames and number of files to pick\n") sys.exit(1) file_list = open(sys.argv[1]) file_array = [] for filepath in file_list: file_array.append(filepath.strip()) try: choices = int(sys.argv[...
17
28.06
94
10
127
python
[]
0
true
2024-11-18T22:11:52.385713+00:00
1,600,243,384,000
2664317f7880588adc161007712029ba16c41e80
2
{ "blob_id": "2664317f7880588adc161007712029ba16c41e80", "branch_name": "refs/heads/master", "committer_date": 1600294241000, "content_id": "b6e7ad19d655bb10c87cecbdcaa0cf95aa0a89a5", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5338c650967185dfaf86fba09b268ded79d570c1", "extension": "py"...
2.4375
stackv2
# -*- coding: utf-8 -*- import os import numpy as np from keras.models import Model import sys # print("before") # print(sys.path) sys.path.append(os.path.dirname(os.path.realpath(__file__))) sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + '/utils') from backend import ( DummyNetFea...
308
35.5
112
19
2,284
python
[]
0
true
2024-11-18T22:11:52.699575+00:00
1,611,364,959,000
749a8caeca3e50cbf4ea811d0345193213938072
2
{ "blob_id": "749a8caeca3e50cbf4ea811d0345193213938072", "branch_name": "refs/heads/main", "committer_date": 1611364959000, "content_id": "4af007da88bbb441f2d708e43bae6de8f58f9b74", "detected_licenses": [ "MIT" ], "directory_id": "a60dffba4ce42aae3388784978ea172385604815", "extension": "py", "file...
2.40625
stackv2
import logging from pathlib import Path from loguru import logger from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route # set log level [DEBUG, INFO, WARNING, ERROR, CRITICAL] LOGURU_LOGGING_LEVEL = "DEBUG" def config_log(): # remove d...
77
31.25
101
16
567
python
[]
0
true
2024-11-18T22:11:52.754775+00:00
1,687,110,807,000
94c03d32e765b2ad199acc0f54128c99a1244796
3
{ "blob_id": "94c03d32e765b2ad199acc0f54128c99a1244796", "branch_name": "refs/heads/master", "committer_date": 1687110807000, "content_id": "41a533d7e36ef28d3fcfe670017428a07db24fc7", "detected_licenses": [ "MIT" ], "directory_id": "2ac01e5646032561a45f1c3283297dad58d4f5f0", "extension": "py", "fi...
3.03125
stackv2
#!/usr/bin/python3 """ Forked forked from https://github.com/eth-brownie/brownie/blob/master/brownie/convert/datatypes.py. """ # from copy import deepcopy from decimal import Decimal, getcontext from hexbytes import HexBytes from typing import Any, TypeVar try: from vyper.exceptions import DecimalOverrideExcepti...
222
31
99
16
1,818
python
[]
0
true
2024-11-18T22:11:52.807152+00:00
1,536,258,137,000
91649ebb2dd422417eb61b37fa37329347c8eba8
3
{ "blob_id": "91649ebb2dd422417eb61b37fa37329347c8eba8", "branch_name": "refs/heads/master", "committer_date": 1536273106000, "content_id": "b9fb25e03c0ed940fff43ed701ce297127d309b5", "detected_licenses": [ "Unlicense" ], "directory_id": "b52f9311530e85dec2ff8975f2c4cb05f50db676", "extension": "py",...
2.546875
stackv2
'''dumpjson Returns data from the WSDOT Traveler Info REST endpoints. ''' import os import json import logging from argparse import ArgumentParser from . import (URLS, _DEFAULT_ACCESS_CODE, get_traveler_info, ENVIRONMENT_VAR_NAME) from .jsonhelpers import CustomEncoder, dict_list_to_geojson from .field...
67
30.58
79
13
486
python
[]
0
true
2024-11-18T22:11:53.185289+00:00
1,525,032,817,000
15bb9465dbd9f42bf8932f800ac63ec86efdec78
4
{ "blob_id": "15bb9465dbd9f42bf8932f800ac63ec86efdec78", "branch_name": "refs/heads/master", "committer_date": 1525032817000, "content_id": "29ca871d3a4385ed92a7df108383465ed435e235", "detected_licenses": [ "Apache-2.0" ], "directory_id": "f3728053204065f1f271b9b550049d9e4342c792", "extension": "py"...
4.03125
stackv2
#52167 Programming and Scripting #Tom Mirrington 04/2018 #script to calculate the standard deviation in each data field #define lists for petal length, petal width, sepalk length, sepal width petl = [] petw = [] sepl = [] sepw = [] #open data file and seperate lines into a list for each data field. count number of ...
114
27.64
104
12
866
python
[]
0
true
2024-11-18T22:11:53.231820+00:00
1,539,790,372,000
82330083ae66f4044afe35eadf8f515a3224a755
3
{ "blob_id": "82330083ae66f4044afe35eadf8f515a3224a755", "branch_name": "refs/heads/master", "committer_date": 1539790372000, "content_id": "2340dbaf8d1ad6624c7477dab7f734d5cf44d099", "detected_licenses": [ "MIT" ], "directory_id": "55c5cbb74f2536c6f64a0ea2826ab388d5e10575", "extension": "py", "fi...
2.515625
stackv2
import argparse import sys from code.auxilliaries.graph_reader import GraphReader from code.auxilliaries.virtuoso_graph_reader import VirtuosoGraphReader parser = argparse.ArgumentParser(description='Extract gold relations from a conll file.') parser.add_argument('--input_file') args = parser.parse_args() graph_nam...
92
32.02
104
18
729
python
[]
0
true
2024-11-18T22:11:53.330048+00:00
1,579,741,196,000
c3bcd6f510b006f48ae9e055c509559e48e2b1ca
2
{ "blob_id": "c3bcd6f510b006f48ae9e055c509559e48e2b1ca", "branch_name": "refs/heads/master", "committer_date": 1579741196000, "content_id": "d0cc6059535f285194fc06652775ee913af00c80", "detected_licenses": [ "Apache-2.0" ], "directory_id": "fb924874a27d57786d4f44d73abaaca5a002635d", "extension": "py"...
2.359375
stackv2
import paho.mqtt.client as mqtt from sense_hat import SenseHat from datetime import datetime import credential as cr import ssl, time # topic = "oth/tony/sensor/temperature" topic = "#" # The callback for when the client receives a CONNACK response from # the server. def on_connect(client, userdata, flags, rc): ...
50
28
96
15
358
python
[]
0
true
2024-11-18T22:11:53.510644+00:00
1,492,699,001,000
83fea501fec05ffdd5b5d57cbf1c7565df11c3ea
3
{ "blob_id": "83fea501fec05ffdd5b5d57cbf1c7565df11c3ea", "branch_name": "refs/heads/master", "committer_date": 1492699001000, "content_id": "d61233598d2bb71ef2e7a011b140ad2b9ec90883", "detected_licenses": [ "MIT" ], "directory_id": "ac4d8bfe6d64c5debac70644dec7d1172f1e292c", "extension": "py", "fi...
3.328125
stackv2
def verifyPrimeNumber(number): numbers = number.split(' ') s = int(numbers[0]) e = int(numbers[1]) primes=[] for n in xrange(s+1, e): for x in xrange(2, n): if not n % x: break else: primes.append(n) for prime in primes: ...
24
19.12
38
12
113
python
[]
0
true
2024-11-18T22:11:53.637327+00:00
1,597,189,707,000
9ecdf3e198d53a075e6b5c8d948ba0845203c8d4
3
{ "blob_id": "9ecdf3e198d53a075e6b5c8d948ba0845203c8d4", "branch_name": "refs/heads/main", "committer_date": 1597189707000, "content_id": "97a3ae13f51517b30c93a4f0baab09286928d0c2", "detected_licenses": [ "MIT" ], "directory_id": "6cf5e30bc644fe78db25d97c955912c13b6cd14e", "extension": "py", "file...
2.625
stackv2
from typing import List # import json import psycopg2.extras from narratives.db.ao3_db import AO3DB class DBFandoms(AO3DB): def __init__(self): self.cursor, self.connect = super().open() self._table_creation() def insert(self, fandoms: List): sql = """ INSERT INTO fando...
46
27.48
69
13
262
python
[]
0
true
2024-11-18T22:11:53.746318+00:00
1,553,360,259,000
9099170d1feab5e270a659e54ab51f90941be057
3
{ "blob_id": "9099170d1feab5e270a659e54ab51f90941be057", "branch_name": "refs/heads/master", "committer_date": 1553360259000, "content_id": "ab754966e631ce85b9f3ba2296993f827c687f56", "detected_licenses": [ "MIT" ], "directory_id": "399adb8d74117e41682037e3357305027d9a2769", "extension": "py", "fi...
2.5625
stackv2
# -*- coding: utf-8 -*- import subprocess import sys if sys.platform == 'win32': _cmd = ['netsh', 'wlan', 'show', 'interfaces'] _decode_coding = 'gb2312' else: _cmd = ['wpa_cli', 'status'] _decode_coding = 'utf-8' # return None, False or True def check_connected_ssid(ssid): flag = False ...
33
23.21
60
15
221
python
[]
0
true
2024-11-18T22:11:53.907933+00:00
1,490,580,183,000
ef0b475bdeaf3f58b1065267266bfb0d0a257725
2
{ "blob_id": "ef0b475bdeaf3f58b1065267266bfb0d0a257725", "branch_name": "refs/heads/master", "committer_date": 1490580183000, "content_id": "80b5aa246694689164cfdcada0d16e74c0d8f222", "detected_licenses": [ "MIT" ], "directory_id": "1c4fcff4694fda6cb4ad7c39306962f764010595", "extension": "py", "fi...
2.375
stackv2
import optparse from scapy.all import * def banner(): print "[***] Hotel Wireless Sniffer p180 [***]" def findGuest(pkt): raw= pket.sprintf('%Raw.load%') name = re.findallI('(?i)LAST_NAME=(.*)&', raw) if name: print '[+] Found Hotel Guest '+str(name[0])+', Room # '+str(room[0]) def main(): parser = optparse....
30
24.8
97
13
220
python
[]
0
true
2024-11-18T22:11:53.962150+00:00
1,440,157,473,000
4daef6f1570ba5743b6cc1233a16646dfc0d1183
3
{ "blob_id": "4daef6f1570ba5743b6cc1233a16646dfc0d1183", "branch_name": "refs/heads/master", "committer_date": 1440162550000, "content_id": "213aa1316f9efb26022b35ccfa18c8f032f6e078", "detected_licenses": [ "Apache-2.0" ], "directory_id": "3bddd914dce4962eb747211914dea9c92c94fb6c", "extension": "py"...
2.6875
stackv2
#!/usr/bin/env python import argparse import logging import re import sys logger = logging.getLogger(__name__) logger.addHandler(logging.StreamHandler()) # Artifact id is a function of artifact type and artifact extension # Combination of art_type and art_ext should be unique ART_ID = { (None, 'img'): 'img', ...
147
24.64
72
14
896
python
[]
0
true
2024-11-18T22:11:54.056782+00:00
1,691,693,380,000
037cdb22307991356d6e34d0e0979b6b8a415939
3
{ "blob_id": "037cdb22307991356d6e34d0e0979b6b8a415939", "branch_name": "refs/heads/master", "committer_date": 1691693380000, "content_id": "d703695cffb9009576daacae7a56909b85fa6fb4", "detected_licenses": [ "MIT" ], "directory_id": "5686d1a31b87a47a4774270c00cd141c221cf065", "extension": "py", "fi...
2.609375
stackv2
# -*- coding: utf-8 -*- """API model base classes and mixins.""" import logging import typing as t from ..auth import AuthModel from ..constants.logs import LOG_LEVEL_API from ..http import Http from ..logs import get_obj_log class Model: """API model base class.""" http: t.ClassVar[Http] = None """HTTP...
118
26.83
79
12
762
python
[]
0
true
2024-11-18T22:11:54.160364+00:00
1,688,030,577,000
97bf0ca72d8597476097961854a0607a5a29e76f
3
{ "blob_id": "97bf0ca72d8597476097961854a0607a5a29e76f", "branch_name": "refs/heads/main", "committer_date": 1688030577000, "content_id": "75c1cf0d02acc82829138b41fb314fa903779569", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "b346530b455135b224470511061cffcffa6274b5", "extension": "py"...
3.3125
stackv2
"""Engines without parallelization.""" from typing import Any, List from tqdm import tqdm from .base import Engine from .task import Task class SingleCoreEngine(Engine): """ Dummy engine for sequential execution on one core. Note that the objective itself may be multithreaded. """ def __init__...
36
22.22
63
13
171
python
[]
0
true
2024-11-18T22:11:54.233954+00:00
1,426,503,266,000
f61be41563b66797c6999356bf62e6dac0424141
2
{ "blob_id": "f61be41563b66797c6999356bf62e6dac0424141", "branch_name": "refs/heads/master", "committer_date": 1426503266000, "content_id": "fd561affaeb3da2600f3ff3936bb002788920e6b", "detected_licenses": [ "MIT" ], "directory_id": "2c387cb0d024bfacf0bb614d4b0f1647454a78aa", "extension": "py", "fi...
2.375
stackv2
import os from .cache import Cache from .models import CacheEntry from .utils import get_file_hash, save_file, load_file import shutil import io from .compiler import ExpressionProcessor from .expressions import stylesheets, scripts, html import subprocess import tempfile class AssetCollection(object): def __init...
517
29.7
83
19
3,240
python
[]
0
true
2024-11-18T22:11:54.757303+00:00
1,545,116,539,000
75b664c73df40a089de16a3f6cb790799a608434
3
{ "blob_id": "75b664c73df40a089de16a3f6cb790799a608434", "branch_name": "refs/heads/master", "committer_date": 1545116539000, "content_id": "78130115db8c805119f7f931b331c79f8e372fcf", "detected_licenses": [ "MIT" ], "directory_id": "a0230300191f39208f86b2961e635e55f3876131", "extension": "py", "fi...
3.421875
stackv2
from abc import ABC, abstractmethod from src.errors import StackOverflow, StackUnderflow class Stack(ABC): def __init__(self, capacity: int = 16): self.__stack = list() self.capacity = capacity @property def stack(self): return self.__stack @abstractmethod def push(self,...
45
24.53
59
15
270
python
[]
0
true