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-19T02:32:17.589035+00:00
1,610,600,416,000
c8a42b43076c37bd436e03048fac522836515d94
3
{ "blob_id": "c8a42b43076c37bd436e03048fac522836515d94", "branch_name": "refs/heads/main", "committer_date": 1610600416000, "content_id": "5a00afc7647063592ef51818b1e3f4492bf3685d", "detected_licenses": [ "MIT" ], "directory_id": "5eb914e3fe1dcbbaa670ef7e314b06b94309f31a", "extension": "py", "file...
2.703125
stackv2
""" Puzzboss-only commands """ import discord from discord.ext import commands from discord.ext.commands import guild_only import logging import puzzboss_interface import re import typing def puzzboss_only(): async def predicate(ctx): # TODO: Make this more open to whoever's puzzbossing return 7903...
299
33.21
134
19
2,185
python
[]
0
true
2024-11-19T02:32:17.655046+00:00
1,603,994,926,000
934950bb42696948c305e16aa4ea1c51105b1dfa
3
{ "blob_id": "934950bb42696948c305e16aa4ea1c51105b1dfa", "branch_name": "refs/heads/master", "committer_date": 1603994926000, "content_id": "1fbfc7c4899aac7b640d9fefd790fd093787cb8b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9673935b03b25683b79e2e28a4584ebccd74cda9", "extension": "py"...
3.109375
stackv2
import json import sys import argparse def get_args(): """Parse commandline.""" parser = argparse.ArgumentParser() parser.add_argument("--dataset-name", required=True, help="Name of dataset (COCO/ImageNet)") parser.add_argument("--output", required=True, help="Output file name") parser.add_argument...
62
26.11
96
18
403
python
[]
0
true
2024-11-19T02:32:17.723432+00:00
1,615,737,567,000
14312644cc46e3ea6f6db7ad913bd2856964f3de
3
{ "blob_id": "14312644cc46e3ea6f6db7ad913bd2856964f3de", "branch_name": "refs/heads/master", "committer_date": 1615737567000, "content_id": "031a84f3bfa65b54cc4033eca3059fc3210bba4b", "detected_licenses": [ "MIT" ], "directory_id": "91b0920c79909376181d322e8bfcc36180b54c02", "extension": "py", "fi...
2.546875
stackv2
"""Contains SQL Dialects.""" from typing import NamedTuple from sqlfluff.core.dialects.dialect_ansi import ansi_dialect from sqlfluff.core.dialects.dialect_bigquery import bigquery_dialect from sqlfluff.core.dialects.dialect_mysql import mysql_dialect from sqlfluff.core.dialects.dialect_teradata import teradata_diale...
52
28.87
70
13
397
python
[]
0
true
2024-11-19T02:32:17.817899+00:00
1,541,622,978,000
2c7dbeeadb8df7cd8d82b7b4b509211202f324c5
3
{ "blob_id": "2c7dbeeadb8df7cd8d82b7b4b509211202f324c5", "branch_name": "refs/heads/master", "committer_date": 1541622994000, "content_id": "d961002e0e47ccb4d67ec7cd643e0abfd7bfd479", "detected_licenses": [ "MIT" ], "directory_id": "88df81bd5a85138b26f5a61df78cc971571b17f2", "extension": "py", "fi...
2.59375
stackv2
#!/usr/bin/env python # # Bottle session manager. See README for full documentation. # # Written by: Sean Reifschneider <jafo@tummy.com> # # License: 3-clause BSD # Updated with JSON by Justin Winokur from __future__ import with_statement import bottle import time try: import cPickle as pickle except ImportE...
243
32.53
79
24
1,751
python
[{"finding_id": "codeql_py/clear-text-storage-sensitive-data_814426e85d953f87_5690752b", "tool_name": "codeql", "rule_id": "py/clear-text-storage-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression stores [sensitive data (secret)](1) as clear text.", ...
1
true
2024-11-19T02:32:18.217829+00:00
1,693,469,408,000
207bdc42a5e7dd3bc211c5a609e35cb727e99146
3
{ "blob_id": "207bdc42a5e7dd3bc211c5a609e35cb727e99146", "branch_name": "refs/heads/main", "committer_date": 1693469408000, "content_id": "0fda5def9ee635adffdad9c0290fa326f646d0c7", "detected_licenses": [ "Apache-2.0" ], "directory_id": "524758d5f3f2e67e8b09f120a93448fbcf8f8096", "extension": "py", ...
2.53125
stackv2
import pandas as pd import streamlit as st @st.cache_data def load_data(): return pd.DataFrame( { "category": [ "📊 Data Exploration", "📈 Data Visualization", "🤖 LLM", "📊 Data Exploration", ], } ) data...
37
19.14
53
13
147
python
[]
0
true
2024-11-19T02:32:18.440852+00:00
1,584,972,757,000
468b8e04eb42a7a0c4c243de257d6516623af67f
3
{ "blob_id": "468b8e04eb42a7a0c4c243de257d6516623af67f", "branch_name": "refs/heads/master", "committer_date": 1584972757000, "content_id": "3889367b0b9b9bdc1dfc7d7cc9056c028642a079", "detected_licenses": [ "MIT" ], "directory_id": "87796f8b79b325cdfca7a98b120d690a13ebd267", "extension": "py", "fi...
3.34375
stackv2
import os import numpy import matplotlib.pyplot import scipy.ndimage import argparse root, filename = os.path.split(__file__) in_path = os.path.join(root, "in.jpg") def parse_args(): parser = argparse.ArgumentParser(description="Reads an image and applies an Gaussian blur filter to it. Afterwards," ...
157
29.18
120
17
1,146
python
[]
0
true
2024-11-19T02:32:18.569140+00:00
1,676,895,719,000
73fc20e8183b0b4d8c10c872c7e218b756aff8c8
3
{ "blob_id": "73fc20e8183b0b4d8c10c872c7e218b756aff8c8", "branch_name": "refs/heads/main", "committer_date": 1676895719000, "content_id": "8974728f679e563824575048f83748c2226631ad", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5693aed52c4d61cc9f3369e8b7bfaa4474a84cdd", "extension": "py", ...
2.65625
stackv2
def replace_newline_with_space(batch): return { **batch, "text": [text.replace("\n", " ") for text in batch["text"]] } def remove_html_spans(batch): """Removes lines containing a '<' or '>' from the texts.""" bad_strings = ["<", ">"] return { **batch, "text": [ ...
16
28.69
105
17
120
python
[]
0
true
2024-11-19T02:32:18.761251+00:00
1,636,491,156,000
7305a66d68b6020dc5099e9a884e038a9f9f65b4
3
{ "blob_id": "7305a66d68b6020dc5099e9a884e038a9f9f65b4", "branch_name": "refs/heads/main", "committer_date": 1636491156000, "content_id": "48f7b81cad1cd871521896cab7e73026a27332c3", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0215b8a789c93b53c61c1649306609b44b5ae502", "extension": "py", ...
2.515625
stackv2
def MultiChannelTemplateMatching(db2Signal, db2Template, blCenter, blNormalize): ''' Synopsis: DB1SCORE = CBASS_U_MultiChannelTemplateMatching(DB2SIGNAL, DB2TEMPLATE, [BLNORM]) Returns a score DB1SCORE indicative of how well the multi-channel signal DB2SIGNAL matches the spatio temporal template DB2TEMPLATE Input: -DB2...
80
51.7
151
20
1,281
python
[]
0
true
2024-11-19T02:32:18.829745+00:00
1,675,171,093,000
3dd7703b0a12dd59642a65ed00ae70b6dd8be98f
2
{ "blob_id": "3dd7703b0a12dd59642a65ed00ae70b6dd8be98f", "branch_name": "refs/heads/master", "committer_date": 1675171093000, "content_id": "095c0ab732e915dccc9a26cca5b5ae390053877c", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "117d783552708d9454293fb57d36a065907e4091", "extension": "p...
2.4375
stackv2
# Copyright 2017 Bateared Collie # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. ...
182
35.98
104
14
1,478
python
[]
0
true
2024-11-19T02:32:19.093350+00:00
1,525,946,276,000
b5392d62d76ff423b37f6a5010c41c8a12a036a1
2
{ "blob_id": "b5392d62d76ff423b37f6a5010c41c8a12a036a1", "branch_name": "refs/heads/master", "committer_date": 1525946276000, "content_id": "0c61b58a3f575db09c7f0d1de9be219def08b525", "detected_licenses": [ "Apache-2.0", "MIT" ], "directory_id": "78b60bf95e60e788f067f39188f36b694ac9d21f", "exten...
2.421875
stackv2
import tensorflow as tf from tensorflow.contrib.rnn import BasicLSTMCell, LSTMStateTuple from tensorflow.python.ops.rnn_cell_impl import RNNCell as _RNNCell def exp_mask(val, mask, offset=1e12): return val + (1.0 - tf.cast(mask, 'float')) * -offset def log(x): return tf.log(x + 1e-12) class NestedLSTMWrappe...
114
45.88
121
23
1,274
python
[]
0
true
2024-11-19T02:32:19.449781+00:00
1,387,083,004,000
1590d46a0fda2a21865f8c5419ef6bed084963cd
3
{ "blob_id": "1590d46a0fda2a21865f8c5419ef6bed084963cd", "branch_name": "refs/heads/master", "committer_date": 1387083004000, "content_id": "a68938f057731e231d5ca831b926f5c7c9c44cc1", "detected_licenses": [ "MIT" ], "directory_id": "d039da1c0b99e2642d3c354de9faa6f427141ee3", "extension": "py", "fi...
2.90625
stackv2
from problems.leetcode.LeetcodeProblem import LeetcodeProblem class RecoverBinarySearchTree(LeetcodeProblem): def solve(self, root): self.earlier = self.later = None self.pre = None self.go(root) self.earlier.val, self.later.val = self.later.val, self.earlier.val return roo...
35
29.2
75
15
238
python
[]
0
true
2024-11-19T02:32:19.574299+00:00
1,687,214,542,000
ed4cb2ae497637e0c79ea5e492ef766daf7c3308
3
{ "blob_id": "ed4cb2ae497637e0c79ea5e492ef766daf7c3308", "branch_name": "refs/heads/master", "committer_date": 1687214542000, "content_id": "5432028f1a5ec4a8a0e230f67a9e60c47baf044a", "detected_licenses": [ "MIT" ], "directory_id": "333934114c06dcdb7524fe8c0cfd8b881dfa0085", "extension": "py", "fi...
3.21875
stackv2
""" Some common widgets for prompting subject response. """ from PyQt5 import QtCore, QtGui, QtWidgets class ImagePrompt(QtWidgets.QLabel): """ Displays an image (QPixmap), centered and fit to the containing widget. """ def __init__(self, parent=None): super(ImagePrompt, self).__init__(paren...
187
26.49
78
20
1,219
python
[]
0
true
2024-11-19T02:32:19.727711+00:00
1,485,568,850,000
d49fa6b8e9eb8922ea8ad31105afb28a3167e60e
2
{ "blob_id": "d49fa6b8e9eb8922ea8ad31105afb28a3167e60e", "branch_name": "refs/heads/master", "committer_date": 1485568850000, "content_id": "ed1d9c98429277bdecf03fe8ffae362887d9f654", "detected_licenses": [ "MIT" ], "directory_id": "9743d5fd24822f79c156ad112229e25adb9ed6f6", "extension": "py", "fi...
2.390625
stackv2
#calss header class _ACQUAINTANCE(): def __init__(self,): self.name = "ACQUAINTANCE" self.definitions = [u'a person that you have met but do not know well: ', u'used in some expressions about knowing or meeting people: ', u'knowledge of a subject: '] self.parents = [] self.childen = [] self.properties = ...
19
21.79
167
10
125
python
[]
0
true
2024-11-19T02:32:19.784124+00:00
1,634,758,897,000
cdb9767ca0d8b61ce3fec7a266dba6a5941790a2
3
{ "blob_id": "cdb9767ca0d8b61ce3fec7a266dba6a5941790a2", "branch_name": "refs/heads/main", "committer_date": 1634758897000, "content_id": "9a3dd03525735d64f3b4b3f09f6089e6e6bf8a0c", "detected_licenses": [ "MIT" ], "directory_id": "5fd14511a9dff814f2c40b228f8be44d8d86dfbb", "extension": "py", "file...
2.609375
stackv2
""" Helper functions """ import os import time from os.path import join from pathlib import Path from typing import Callable from colorama import Fore, Style from pytorch_lightning import seed_everything from torch import Tensor from torch.nn import Module VERBOSITY = 3 TIMESTAMPED = True DATA_DIR = join(Path(os.pat...
203
27.93
115
19
1,609
python
[]
0
true
2024-11-19T02:32:19.892538+00:00
1,550,668,919,000
7d1c2acff3be2039fc706550ab8537e01d82d577
2
{ "blob_id": "7d1c2acff3be2039fc706550ab8537e01d82d577", "branch_name": "refs/heads/master", "committer_date": 1550668919000, "content_id": "48909b3bbcfb610fb65dcedbeb609d940078c876", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c60cfe2ff0e72014f85a0da2f9e19dba80465880", "extension": "p...
2.359375
stackv2
#!/usr/bin/env python3 import os import sys import glob import argparse import numpy as np import pandas as pd from scipy.stats import chi2 from statsmodels.stats.multitest import multipletests def parse_args(): parser = argparse.ArgumentParser('cross_study_association.py') define_args(parser) return pars...
145
27.07
99
15
1,097
python
[]
0
true
2024-11-19T02:32:19.964974+00:00
1,612,442,179,000
adf423eb052cf6102c29ee9d09f5b98c80aef8c7
2
{ "blob_id": "adf423eb052cf6102c29ee9d09f5b98c80aef8c7", "branch_name": "refs/heads/main", "committer_date": 1612442179000, "content_id": "48fa439f0d61da7bc558b01a307ac79b18fd051c", "detected_licenses": [ "MIT" ], "directory_id": "33cb5c94d5c96e982e95112f14d797dc6af51e24", "extension": "py", "file...
2.328125
stackv2
from investor import * import time data=loadset() assets=loadassets() def pricebykey(key): return data[key][sorted(data[key].keys())[-1]] money=0.0 for key in assets.keys(): if key=="money": money+=assets[key] continue money+=pricebykey(key)*assets[key] print(money) with open("bankinghi...
23
17.91
89
16
124
python
[]
0
true
2024-11-19T02:32:20.030154+00:00
1,433,784,524,000
d46defa8e1b145c62a72612dcd0e2e4584387f57
3
{ "blob_id": "d46defa8e1b145c62a72612dcd0e2e4584387f57", "branch_name": "refs/heads/master", "committer_date": 1433784524000, "content_id": "a8fbdcb5dad57ea30813ea9faab9c9bcd89547ed", "detected_licenses": [ "Apache-2.0" ], "directory_id": "062b1dff75e8190154224e02b41b020ba7572082", "extension": "py"...
3.484375
stackv2
from collections import Counter # vraca n-grame velicine n nad listom rijeci jedne recenice def make_ngrams(words, n): ngrams = [] if n > len(words): return ngrams for i in xrange(0, len(words) - n + 1): ngram = [] for j in xrange(0, n): ngram.append(words[i + j]) ...
28
31.21
85
14
272
python
[]
0
true
2024-11-19T02:32:20.336464+00:00
1,636,215,730,000
b97ed5b341e793045a2618e31bdb55a82798560c
3
{ "blob_id": "b97ed5b341e793045a2618e31bdb55a82798560c", "branch_name": "refs/heads/main", "committer_date": 1636215730000, "content_id": "c7a75c1e722f9132790a08f7d2656a59c7d368b0", "detected_licenses": [ "MIT" ], "directory_id": "fcd2b1340e9ca0c4341e0e16c482f2c87a5d291a", "extension": "py", "file...
3.296875
stackv2
from random import choice from compare import CompareCards deck: list[int] = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10] visible_deck: list[str] = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"] suits: list[str] = ["♣", "♦", "♠", "♥"] class Dealer(CompareCards): def __init__(self): s...
123
39.56
100
20
1,207
python
[]
0
true
2024-11-19T02:32:20.494337+00:00
1,331,915,445,000
2e575571f904f22b9cbe4da6c001d7b62215d4c4
2
{ "blob_id": "2e575571f904f22b9cbe4da6c001d7b62215d4c4", "branch_name": "refs/heads/master", "committer_date": 1331915445000, "content_id": "c327019415a1cfa0fdabae3cf6fe46172aa5678b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "8ffbfec865b023130800b1beacfb76c4863d58b9", "extension": "py"...
2.34375
stackv2
from copy import deepcopy from django.conf import settings import fudge import fudge.patcher from lettuce import * from sorl.thumbnail.base import ThumbnailBackend from armstrong.core.arm_content.images.sorl import get_preset_thumbnail, dimensions from armstrong.core.arm_content.tests.arm_content_support.models impor...
97
40.55
90
14
911
python
[]
0
true
2024-11-19T02:32:20.542183+00:00
1,620,013,822,000
e6e723be8b8f3cd4bf6283db31c4694338bdebdd
2
{ "blob_id": "e6e723be8b8f3cd4bf6283db31c4694338bdebdd", "branch_name": "refs/heads/master", "committer_date": 1620013822000, "content_id": "475a2570a7bd8ae69498f323d9791886168368af", "detected_licenses": [ "MIT" ], "directory_id": "0f9f4aac050e3b2b1ee2723eb71f9abeb4bd404b", "extension": "py", "fi...
2.421875
stackv2
""" 请注意,尽量减少使用这个爬虫,因为对服务器压力大... """ from typing import Any from json import dumps from functools import reduce from requests import Session s = Session() s.headers["User-Agent"] = "HavfunClient-adnmb" s.cookies.update( {"userhash": "0%10%1F6i80S%94%BA%9DL%9C%26%15%A0%F3L%C4%01%5Cb%9E%17"}) cdn = 'https://nmbimg.f...
46
28.54
75
15
417
python
[]
0
true
2024-11-19T02:32:20.652679+00:00
1,685,167,662,000
3395e627066b6d43f00bd48864cbf40a62f14530
3
{ "blob_id": "3395e627066b6d43f00bd48864cbf40a62f14530", "branch_name": "refs/heads/main", "committer_date": 1685167662000, "content_id": "b3d669a8b5f2456cf704e3871cdd56aedbab0d2d", "detected_licenses": [ "MIT" ], "directory_id": "1987838bc542a8f3584825b0d6e0d2eec3fb6007", "extension": "py", "file...
2.921875
stackv2
from tflite_runtime.interpreter import Interpreter import numpy as np from PIL import Image from time import time class ImageClassifier: def __init__(self): try: self.interpreter = Interpreter(model_path='model.tflite') self.interpreter.allocate_tensors() _, sel...
51
35.43
100
15
413
python
[]
0
true
2024-11-19T02:32:20.961031+00:00
1,682,346,625,000
66c8e4c9141f09fbe9842ab02498cf033fed3445
3
{ "blob_id": "66c8e4c9141f09fbe9842ab02498cf033fed3445", "branch_name": "refs/heads/master", "committer_date": 1682346625000, "content_id": "f691783682c10dacbd27fc74410faaa7a9b881ed", "detected_licenses": [ "MIT" ], "directory_id": "3daf036e3911c00e50fb76e083ada2134ff1758f", "extension": "py", "fi...
2.875
stackv2
#!/usr/bin/env python3 """ Copy text to clipboards (to both of them). This solution here is specific to Linux. For a platform independent solution, you can check out https://github.com/asweigart/mapitpy/blob/master/pyperclip.py (I didn't try it). Last update: 2017-01-08 (yyyy-mm-dd) """ if __name__ == "__main__": ...
80
23.75
77
12
416
python
[]
0
true
2024-11-19T02:32:21.182813+00:00
1,636,422,697,000
57c6027ed35bbb2d7bc54cd41ff5871114240ac6
2
{ "blob_id": "57c6027ed35bbb2d7bc54cd41ff5871114240ac6", "branch_name": "refs/heads/master", "committer_date": 1636422697000, "content_id": "52f0e8aa8f5611ddd6592cd2a9fe9484b92d8d22", "detected_licenses": [ "MIT" ], "directory_id": "e80e030290c22918a7cd6e7166aa21ba8335fe83", "extension": "py", "fi...
2.390625
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jun 29 10:16:17 2020 @author: farruh """ import contextlib import librosa import numpy as np import os import pandas as pd import pickle import requests import wave from collections import Counter from math import floor from tensorflow.keras.models im...
209
36.45
127
22
1,942
python
[]
0
true
2024-11-19T02:32:21.610335+00:00
1,614,845,204,000
0a5ab870110f9b6ad70905c3eedb958a78435236
2
{ "blob_id": "0a5ab870110f9b6ad70905c3eedb958a78435236", "branch_name": "refs/heads/master", "committer_date": 1614845204000, "content_id": "98c55eaf4eec4a51df609f92e317de72950cedae", "detected_licenses": [ "MIT" ], "directory_id": "a8c76e503df527445b14163f74faa8aca7e90ecd", "extension": "py", "fi...
2.375
stackv2
from xendit.models._base_model import BaseModel from xendit.xendit_error import XenditError from xendit._api_requestor import _APIRequestor from xendit._extract_params import _extract_params from .response import XenPlatformAccount, XenPlatformCallbackURL, XenPlatformTransfers from .xenplatform_business_profile import...
173
27.12
115
14
1,085
python
[]
0
true
2024-11-19T02:32:22.168389+00:00
1,617,286,255,000
a580a8f234b128bba346fec61e5fffbaac5098bc
2
{ "blob_id": "a580a8f234b128bba346fec61e5fffbaac5098bc", "branch_name": "refs/heads/master", "committer_date": 1617286255000, "content_id": "209f8d8d19cb32a30c9669854996532207ab567a", "detected_licenses": [ "MIT" ], "directory_id": "1a009e5f55063d1f55fdfca4493de6980e82f594", "extension": "py", "fi...
2.46875
stackv2
import numpy as np from matplotlib import pyplot as plt from arc.consts import arc_cmap def plot_grid(grid: np.ndarray, plot_handle = None): if plot_handle is None: fig, ax = plt.subplots() plot_handle = ax plot_handle.pcolormesh( grid, cmap=arc_cmap, rasterized=True, ...
22
24.45
58
11
149
python
[]
0
true
2024-11-19T02:32:22.235426+00:00
1,583,947,109,000
2c415eea4a243c5b11bdc8333e8d010040d4f922
3
{ "blob_id": "2c415eea4a243c5b11bdc8333e8d010040d4f922", "branch_name": "refs/heads/master", "committer_date": 1583947109000, "content_id": "095aced834d54f610b644f3dad4d1b780dffbb2e", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "ac85011994e9c09d80497d5cbebc5d73c6c4fc77", "extension": "p...
2.734375
stackv2
import abc import dask.array import os import logging import numpy as np try: import anndata except ImportError: anndata = None from .input import InputDataBase from .model import _ModelBase logger = logging.getLogger(__name__) class _SimulatorBase(metaclass=abc.ABCMeta): r""" Simulator base class ...
71
22.08
95
14
357
python
[]
0
true
2024-11-19T02:32:22.381073+00:00
1,435,485,058,000
994293b8d46a5f11c7b09955a74d1a632eed8ac9
2
{ "blob_id": "994293b8d46a5f11c7b09955a74d1a632eed8ac9", "branch_name": "refs/heads/master", "committer_date": 1435485058000, "content_id": "25c26f9182d0c4659c568535081e53a1c04a4b48", "detected_licenses": [ "MIT" ], "directory_id": "5f79e6511c73494e1c9c25da6107056a71ab5e89", "extension": "py", "fi...
2.375
stackv2
import socket # Import socket module import os import cv2 from socketIO_client import SocketIO, LoggingNamespace host = '192.168.30.107' # Get local machine name port = 8080 # Reserve a port for your service. statusport = 9002 statusIO = SocketIO(host, statusport, LoggingNamespace) s = s...
48
27.94
127
13
395
python
[]
0
true
2024-11-19T02:32:22.660922+00:00
1,692,542,563,000
f7aae180c68a6b2d791313ff97623e2b5a406681
3
{ "blob_id": "f7aae180c68a6b2d791313ff97623e2b5a406681", "branch_name": "refs/heads/master", "committer_date": 1692542563000, "content_id": "23dbd60263aa8bc0d5d289b9a2255ead368d2d10", "detected_licenses": [ "MIT" ], "directory_id": "2ea17ca56425f589e6d0a9f94c0f3fc9475dbd35", "extension": "py", "fi...
2.703125
stackv2
"""Retrieve Devices from Flume API.""" from requests import Session from .constants import API_DEVICES_URL, DEFAULT_TIMEOUT # noqa: WPS300 from .utils import configure_logger, flume_response_error # noqa: WPS300 # Configure logging LOGGER = configure_logger(__name__) class FlumeDeviceList(object): """Get Flum...
65
24.89
79
13
352
python
[]
0
true
2024-11-19T02:32:22.730741+00:00
1,557,815,767,000
35485486b4f0229fe68e9e9c3596997ae1fddc15
3
{ "blob_id": "35485486b4f0229fe68e9e9c3596997ae1fddc15", "branch_name": "refs/heads/master", "committer_date": 1557815767000, "content_id": "582e62fa563b872b1eb9fde9c4c1c05065c5a460", "detected_licenses": [ "MIT" ], "directory_id": "4f394cd7f9ad10be1e9635c7da56629521cb58f3", "extension": "py", "fi...
2.84375
stackv2
"""Experience manager for reinforcement learning agent.""" from typing import Generic, TypeVar, Optional, Collection from decuen.experience.experience import Experience ActionType = TypeVar("ActionType") class ExperienceManager(Generic[ActionType]): """ Wrapper class for processing Experiences and updates...
40
28.05
97
15
233
python
[]
0
true
2024-11-19T02:32:22.898826+00:00
1,616,836,791,000
d59b77b3d5d2990e0557338f5e1f9aa065d76f0d
2
{ "blob_id": "d59b77b3d5d2990e0557338f5e1f9aa065d76f0d", "branch_name": "refs/heads/main", "committer_date": 1616836791000, "content_id": "1668153e7b242be60b7996446427e6f0227373ba", "detected_licenses": [ "MIT" ], "directory_id": "4f1d934eb9de9652717b85caf92bf123afc172e7", "extension": "py", "file...
2.5
stackv2
"""This file implements mcprotocol 4E type communication. """ import re import socket from . import mcprotocolerror from . import mcprotocolconst as const from .type3e import Type3E class Type4E(Type3E): """mcprotocol 4E communication class. Type 4e is almost same to Type 3E. Difference is only subheader. ...
80
32.35
86
20
645
python
[]
0
true
2024-11-19T02:32:22.952616+00:00
1,693,421,338,000
f4ab770ace3e542b0cd807998f49181fb188c2fb
3
{ "blob_id": "f4ab770ace3e542b0cd807998f49181fb188c2fb", "branch_name": "refs/heads/main", "committer_date": 1693421338000, "content_id": "2a1333970bbd1131deda05f20b5b00729ad30e4e", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "e5de04caeb8ae7fae9a0c0604aa93008c27569fd", "extension": "py"...
3.453125
stackv2
# Copyright (c) 2015-2018 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ ======== Gradient ======== Use `metpy.calc.gradient`. This example demonstrates the various ways that MetPy's gradient function can be utilized. """ import numpy as np i...
65
30.89
80
9
572
python
[]
0
true
2024-11-19T02:32:23.009567+00:00
1,446,569,634,000
48846b5747740af57b3f041c1d1aad5f90c2840d
3
{ "blob_id": "48846b5747740af57b3f041c1d1aad5f90c2840d", "branch_name": "refs/heads/master", "committer_date": 1446569634000, "content_id": "4cae32e460ebe779ddbd8a96d622846793fc64a7", "detected_licenses": [ "MIT" ], "directory_id": "38676e6889809b5c11085c161214c9cf4ba3ddd5", "extension": "py", "fi...
2.859375
stackv2
#!/usr/bin/python # -*- coding: utf-8 -*- import argparse import sys from imma_parser import parse_line, log import happybase import string import random ID_CHARS = string.ascii_uppercase + string.digits def id_generator(size=4, chars=ID_CHARS): result = ''.join(random.choice(chars) for i in xrange(size)) r...
121
36.78
77
21
995
python
[]
0
true
2024-11-19T02:32:23.119128+00:00
1,508,476,770,000
a63d8508b35e78918e8dcbe36ee098e0cc401def
3
{ "blob_id": "a63d8508b35e78918e8dcbe36ee098e0cc401def", "branch_name": "refs/heads/master", "committer_date": 1508476770000, "content_id": "04275bca5578171925010c3c379bbd0c7619f636", "detected_licenses": [ "MIT" ], "directory_id": "ff29fc82dbc49c74b02978438f9276a19f111200", "extension": "py", "fi...
3.15625
stackv2
# uncomment out to apply the cap # Also set the cap def Projection(starting_age,career_ceiling_age,cap,x,a): from acc_convert import AccConv y = a/(career_ceiling_age - starting_age) #salary increases z = 0 for i in range(starting_age,65): if x >= cap: x = cap z += x ...
26
26
76
14
225
python
[]
0
true
2024-11-19T02:32:23.291740+00:00
1,580,131,112,000
ce756aea0243892be723c700f1e9e0b694c5a25c
2
{ "blob_id": "ce756aea0243892be723c700f1e9e0b694c5a25c", "branch_name": "refs/heads/master", "committer_date": 1580131112000, "content_id": "6e38153d2ada2f993902835afd1f5153538e9f48", "detected_licenses": [ "MIT" ], "directory_id": "ca32e3595795307a0bbe97a14cbc51b812019398", "extension": "py", "fi...
2.46875
stackv2
# -*- coding: utf-8 -*- """ Created on Mon Mar 12 16:12:16 2018 @author: Malumbo """ from math import sqrt #from its4land import * from geometryVisualizer.tessellations import GTessellation, QTessellation class QRccTiles(QTessellation): def __init__(self, _tuple, qsd): super().__init__(self, _tuple...
76
30.11
121
15
674
python
[]
0
true
2024-11-19T02:32:23.427622+00:00
1,615,407,168,000
69b270c830e6a311f5a231a41768f1192e0f093c
3
{ "blob_id": "69b270c830e6a311f5a231a41768f1192e0f093c", "branch_name": "refs/heads/main", "committer_date": 1615407168000, "content_id": "357fd22210144d3f9621e79478fa4b0fe3ef5dfd", "detected_licenses": [ "MIT" ], "directory_id": "05f37f163b339867931bc1006cc78c286998a394", "extension": "py", "file...
2.953125
stackv2
import pandas as pd import numpy as np def makeCSV(filepath): df = pd.read_csv(filepath) return df def showInfo(dataframe): print(dataframe.describe()) print("-"*50) print(dataframe.info()) def NumericalPivot(dataframe,features,target): dataframe[[features]].groupby([target], as_index=False)....
18
27.5
106
13
129
python
[]
0
true
2024-11-19T02:32:23.476541+00:00
1,593,113,561,000
98917b399266c2d1b08a0495e92c2910dbca7f39
2
{ "blob_id": "98917b399266c2d1b08a0495e92c2910dbca7f39", "branch_name": "refs/heads/master", "committer_date": 1593113561000, "content_id": "1388e928893526ed2a0fc7c6791ab7a93c5e650c", "detected_licenses": [ "MIT" ], "directory_id": "0a39725070cfe18b5c0fc6978c3c942c28152238", "extension": "py", "fi...
2.453125
stackv2
# buttontest.py Test/demo of pushbutton classes for Pybboard TFT GUI # The MIT License (MIT) # # Copyright (c) 2016 Peter Hinch # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without rest...
258
35.69
99
14
2,485
python
[]
0
true
2024-11-19T02:32:23.586035+00:00
1,637,595,614,000
ee1df377522f685c62c7d166dc813512e285656a
3
{ "blob_id": "ee1df377522f685c62c7d166dc813512e285656a", "branch_name": "refs/heads/main", "committer_date": 1637595614000, "content_id": "a66527f1cf780e115c13dbca2920daa065b9af6f", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "d43670c37825f5965e4e8da050b3f65628b3d0d6", "extension": "py"...
3.046875
stackv2
#!/usr/bin/env python import argparse def calc_freq(field, spin_type, g): mu_b = 9.274009994e-24 hbar = 1.0545718e-34 gyro = { 'H': 42.57747872e6, 'e': mu_b/hbar * g / (2.0 * 3.1415927) }[spin_type] return field * gyro def main(): parser = argparse.ArgumentParser() parser...
34
19.44
46
13
244
python
[]
0
true
2024-11-19T02:32:23.894796+00:00
1,651,150,599,000
7abc59fb88963e26fbc6a20e1643d2d70b39ff90
3
{ "blob_id": "7abc59fb88963e26fbc6a20e1643d2d70b39ff90", "branch_name": "refs/heads/master", "committer_date": 1651150599000, "content_id": "a4e203d1b6836035a37bfa5e39ed1b570e13ea2d", "detected_licenses": [ "MIT" ], "directory_id": "25e4677bb06e6267b593cdcfcfeaa3fb99792224", "extension": "py", "fi...
2.53125
stackv2
"""The most common steps in the release of a Python package.""" import requests from bag.check_rst import check_rst_file from bag.console import bool_input from bag.pathlib_complement import Path from . import ReleaseStep, StopRelease, CommandStep from .regex import version_in_python_source_file __all__ = ( "Sh...
210
32.1
88
20
1,618
python
[]
0
true
2024-11-19T02:32:24.073658+00:00
1,582,456,861,000
d62bc9872c0849d70ab9e5fce0a94fed56b82803
3
{ "blob_id": "d62bc9872c0849d70ab9e5fce0a94fed56b82803", "branch_name": "refs/heads/master", "committer_date": 1582456861000, "content_id": "0c606d701a0dfeeb18ecaf007857f53eaaf3f606", "detected_licenses": [ "MIT" ], "directory_id": "4bcb9232cf4761c8aa372a3ec83841b59a1fece9", "extension": "py", "fi...
2.546875
stackv2
# Reference: https://github.com/codecraf8/python-rest-api-aiohttp import inspect import json from aiohttp.web import Request, Response from aiohttp.http_exceptions import HttpBadRequest from aiohttp.web_exceptions import HTTPMethodNotAllowed from data import Datadump DEFAULT_METHODS = ('GET', 'POST', 'PUT', 'DELET...
98
33.92
95
18
689
python
[]
0
true
2024-11-19T02:32:24.198416+00:00
1,568,749,486,000
d1d9fa2dec8cd7341437207773ac6d22c6ccbe34
2
{ "blob_id": "d1d9fa2dec8cd7341437207773ac6d22c6ccbe34", "branch_name": "refs/heads/master", "committer_date": 1568749486000, "content_id": "75ad413ce45db2680280feba6291ca8095558303", "detected_licenses": [ "MIT" ], "directory_id": "9df7d2c1aba24abafc3366053db3fcc264a7a9bd", "extension": "py", "fi...
2.328125
stackv2
import sys import os import subprocess from Bio.SeqIO.FastaIO import SimpleFastaParser import operator # this runs rountines to identify and remove duplicate # contigs from AAFTF.utility import calcN50 from AAFTF.utility import softwrap from AAFTF.utility import fastastats from AAFTF.utility import execute from AAFT...
125
41.24
145
24
1,431
python
[]
0
true
2024-11-19T02:32:24.251514+00:00
1,675,070,847,000
e6bb356aa6d6d1c0fc880fc7be56651b1f624c39
3
{ "blob_id": "e6bb356aa6d6d1c0fc880fc7be56651b1f624c39", "branch_name": "refs/heads/master", "committer_date": 1675070847000, "content_id": "c48167af4dc6106fee45a4ebafeab1af20aa9265", "detected_licenses": [ "MIT" ], "directory_id": "24a4618ee8f0643dc1810558c38551e5170b4bee", "extension": "py", "fi...
3.109375
stackv2
# nltk for POS-tagging import nltk text = word_tokenize("And now for something completely different") nltk.pos_tag(text) bigram_tagger = nltk.BigramTagger(train_sents) bigram_tagger.tag(text) import spacy nlp = spacy.load('en') sent_0 = nlp(u'Mathieu and I went to the park.') sent_1 = nlp(u'If Clement was asked to t...
133
30.8
104
13
1,148
python
[]
0
true
2024-11-19T02:32:24.751695+00:00
1,621,951,033,000
611289551bd069b8479edfb8bc762caabdad2db7
2
{ "blob_id": "611289551bd069b8479edfb8bc762caabdad2db7", "branch_name": "refs/heads/master", "committer_date": 1621951033000, "content_id": "4261b50df449da541d9ca31825320e64d08a96f7", "detected_licenses": [ "MIT" ], "directory_id": "d15343f636580d3d3bdb3ede2abd20d85dc5b797", "extension": "py", "fi...
2.40625
stackv2
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import TensorDataset, DataLoader from tqdm.notebook import tqdm torch.manual_seed(2020) try: print(torch.cuda.get_device_name(torch.cuda.current_device())) print(torch.cuda.is_available()) ...
225
32.13
109
20
1,841
python
[]
0
true
2024-11-19T02:32:24.864306+00:00
1,575,012,792,000
3483d94ebcf255c6b39346f1188ab64baf3a756e
3
{ "blob_id": "3483d94ebcf255c6b39346f1188ab64baf3a756e", "branch_name": "refs/heads/master", "committer_date": 1575012792000, "content_id": "9818f5015836011ebc6b260fb8b648fe93a91cb8", "detected_licenses": [ "MIT" ], "directory_id": "314c551ac665f5a2d02aba45a8fcab16df29673c", "extension": "py", "fi...
2.859375
stackv2
# Binary Classification Metrics def precision(): pass def recall(): pass def F1_score(): pass # Multi-class classification Metrics def accuracy(outputs, targets): _, predicted = outputs.max(1) total = targets.size(0) correct = predicted.eq(targets).sum().item() return round(100. * correc...
51
19.88
53
12
290
python
[]
0
true
2024-11-19T02:32:25.145514+00:00
1,632,302,097,000
063138256a4289757d4a0954d5931e81451464ee
3
{ "blob_id": "063138256a4289757d4a0954d5931e81451464ee", "branch_name": "refs/heads/main", "committer_date": 1632302097000, "content_id": "2865091a5b348faf83cd115144cdb3b05e2cd083", "detected_licenses": [ "MIT" ], "directory_id": "3caf3415d3b273c594483f6777226a491174454a", "extension": "py", "file...
3.0625
stackv2
# @title Helper Functions import datetime import inspect import json from matplotlib.figure import Figure import os from pandas import DataFrame import pickle from shutil import Error # @markdown - add_ending_slash(directory: str) -> str def add_ending_slash(directory: str) -> str: """add_ending_slash function ...
207
26.73
108
14
1,442
python
[]
0
true
2024-11-19T02:32:27.606924+00:00
1,587,424,449,000
3897b5910aababdc4b709606f9da3d43938f0516
2
{ "blob_id": "3897b5910aababdc4b709606f9da3d43938f0516", "branch_name": "refs/heads/master", "committer_date": 1587424449000, "content_id": "83beeca890896a8733f0b28349ef9a0683f6bd50", "detected_licenses": [ "MIT" ], "directory_id": "5c202d7b86c0e698503e170cafe7774531bbfe69", "extension": "py", "fi...
2.3125
stackv2
import hashlib from django.core.cache import cache from django.core.exceptions import EmptyResultSet from django.db import models from django_extmodels.utils import generate_count_query, get_extmeta #TODO:jbowen7 the cache to use should be determined from settings class ExtQuerySet(models.QuerySet): def cached_cou...
40
29.95
83
14
305
python
[]
0
true
2024-11-19T02:32:30.912151+00:00
1,616,698,537,000
f3b95914f018da7e9d5c7e5b674f12e407d9b4c6
3
{ "blob_id": "f3b95914f018da7e9d5c7e5b674f12e407d9b4c6", "branch_name": "refs/heads/master", "committer_date": 1616698537000, "content_id": "8b16cb0ec341895c3d323b43c5c2ea643cb5a472", "detected_licenses": [ "MIT" ], "directory_id": "29fe41d3a3c43c4ff6bfc8b656361ba945aa2374", "extension": "py", "fi...
3.078125
stackv2
"""Utilities for downloading project data. Top level function :func:`scripts.download.download_raw` downloads the raw Christmas Bird Count project data from Google Drive. Run this module as a script to automatically download the project data into ``data/raw/`` under the project root. If the directory doesn't already ...
74
27.49
80
13
529
python
[]
0
true
2024-11-19T02:32:30.964755+00:00
1,570,203,615,000
e57079cdfb7ddb3eac5407a7533f1956919f714a
2
{ "blob_id": "e57079cdfb7ddb3eac5407a7533f1956919f714a", "branch_name": "refs/heads/master", "committer_date": 1570203615000, "content_id": "a38323fa48235eb1741774f38bd2e4c7c28fadc8", "detected_licenses": [], "directory_id": "dadd3582949fb3c3be1a55bbda027e30ca8004a3", "extension": "py", "filename": "wid...
2.421875
stackv2
from django.core.exceptions import ImproperlyConfigured from cms.utils.django_load import load from smartsnippets.exceptions import WidgetAlreadyRegistered, WidgetNotRegistered from smartsnippets.widgets_base import SmartSnippetWidgetBase from models import SmartSnippetVariable from collections import defaultdict cla...
71
33.49
85
15
493
python
[]
0
true
2024-11-19T02:32:31.033508+00:00
1,542,335,781,000
5fe411001b433b317ff79215d9ec8d11ea2f90e4
3
{ "blob_id": "5fe411001b433b317ff79215d9ec8d11ea2f90e4", "branch_name": "refs/heads/master", "committer_date": 1542335782000, "content_id": "f031f9bcfc7477b55b6de5e7b1de8d93e4e279d2", "detected_licenses": [ "Apache-2.0" ], "directory_id": "b23b08a0a4fa092bb4ed0ff6f3a672f157d73738", "extension": "py"...
2.953125
stackv2
from PedSimulation.entity import Goal from PedSimulation.shape2d import Point2D, Circle2D from PedSimulation.strategy import Strategy, Path, StaticStrategy from PedSimulation.utils import shortest_path class NearestGoalStrategy(StaticStrategy): def on_begin(self): """ Set agents' paths on scene be...
47
33.34
127
16
388
python
[]
0
true
2024-11-19T02:32:31.137169+00:00
1,672,744,326,000
b3d00b7e49f7e5b91f97428d9bb80c14d775ecd3
2
{ "blob_id": "b3d00b7e49f7e5b91f97428d9bb80c14d775ecd3", "branch_name": "refs/heads/master", "committer_date": 1672744326000, "content_id": "809f5982c9fced4b518b6781cd36c7d0be9145e4", "detected_licenses": [ "Apache-2.0", "MIT" ], "directory_id": "05083d24088bbb3bfb7cdd162c101c72e18bc3a6", "exten...
2.375
stackv2
# Copyright (C) Tavendo GmbH. Open-source licensed under the # MIT License (http://opensource.org/licenses/MIT) import re import sys import argparse from twisted.python import log from twisted.internet.utils import getProcessOutput from twisted.internet.defer import inlineCallbacks from autobahn import wamp from aut...
140
29.87
117
20
977
python
[]
0
true
2024-11-19T02:32:31.584822+00:00
1,457,023,536,000
4d478cbfdae478ba43ef5069e9804a3a1e13ce93
2
{ "blob_id": "4d478cbfdae478ba43ef5069e9804a3a1e13ce93", "branch_name": "refs/heads/master", "committer_date": 1457023536000, "content_id": "3705b87a5a6c179506fe4a9c7e1d05eb79fdf217", "detected_licenses": [ "MIT" ], "directory_id": "ce6887d7ec33d2a7c78da5f27be05fe36e8d3899", "extension": "py", "fi...
2.375
stackv2
# !/home/grad3/harshal/py_env/my_env/bin/python2.7 from bs4 import BeautifulSoup as bs from datetime import datetime import re import string class parser: def __init__(self, html): self.html = filter(lambda x: x in string.printable, html) self.soup = bs(self.html, "lxml") def get_asin(self): ...
185
37.34
96
19
1,615
python
[]
0
true
2024-11-19T02:32:31.641191+00:00
1,574,044,135,000
56b8f331d8b648c9bccde0f7ec012432f75cee25
3
{ "blob_id": "56b8f331d8b648c9bccde0f7ec012432f75cee25", "branch_name": "refs/heads/master", "committer_date": 1574044135000, "content_id": "6d4b39d776cf4a211405215c383c71ae6f77b019", "detected_licenses": [ "MIT" ], "directory_id": "1ac3e4d08269bd643fa25558eaa5d19a0e95ec7a", "extension": "py", "fi...
3.28125
stackv2
# -*- coding: utf-8 -*- """ Created on Mon Nov 11 10:28:03 2019 @author: rshang """ import requests def Gettemperature(city): param = {"product": "observation","name": city,"app_id": "DemoAppId01082013GAL","app_code": "AJKnXv84fjrb0KIHawS0Tg"} r=requests.get('https://weather.cit.api.here.com/weather/1.0...
29
29.28
150
12
300
python
[]
0
true
2024-11-19T02:32:31.959671+00:00
1,454,689,737,000
a89b3c3d5ea9b36323426498df5b69cfde6a6c01
3
{ "blob_id": "a89b3c3d5ea9b36323426498df5b69cfde6a6c01", "branch_name": "refs/heads/master", "committer_date": 1454689737000, "content_id": "b6772ab0d8308fd527428b3ad73e32263176f742", "detected_licenses": [ "MIT" ], "directory_id": "c03f4397b95bcf70c670a3750fa67eaffe8989b7", "extension": "py", "fi...
2.625
stackv2
import flask import json import functools import werkzeug.exceptions import BilliardStats class Error(Exception): code = None def __init__(self, msg=None): Exception.__init__(self, msg or self.__class__.__name__) class ViewError(Error): """ """ code = 400 msg = "An unhandled error ha...
88
32.93
80
16
624
python
[]
0
true
2024-11-19T02:32:32.020995+00:00
1,586,032,138,000
225efb4a490d3f393de6e25969eced8487e88c2c
3
{ "blob_id": "225efb4a490d3f393de6e25969eced8487e88c2c", "branch_name": "refs/heads/master", "committer_date": 1586032138000, "content_id": "6fb6a8678c0159dea55fc2da052f323264de61d1", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c2ed2e64aa941a44614b3f2223658ddff637005c", "extension": "p...
2.5625
stackv2
# BSD-3-Clause License # # Copyright 2017 Orange # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the followi...
237
33.65
85
17
1,733
python
[]
0
true
2024-11-19T02:32:32.678625+00:00
1,598,030,584,000
7ccfc642ff33bfd20324af1db54a3d5ff46e456d
3
{ "blob_id": "7ccfc642ff33bfd20324af1db54a3d5ff46e456d", "branch_name": "refs/heads/master", "committer_date": 1598030584000, "content_id": "a427b141b36a83534d078eb0cb43bf5cf0554f6e", "detected_licenses": [ "MIT" ], "directory_id": "0dc7d8cb28d5f3d318bd6af7e9402685864fc85b", "extension": "py", "fi...
3.34375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from PyInquirer import prompt from tabulate import tabulate def start_menu_prompt(): """ Displays the first prompt the user sees when starting the program. Returns the user's selection from the choices ...
124
27.19
78
12
779
python
[]
0
true
2024-11-19T02:32:32.747076+00:00
1,595,418,572,000
8f4976f60b02ff534c8e12a9c9a91a640bb128e4
3
{ "blob_id": "8f4976f60b02ff534c8e12a9c9a91a640bb128e4", "branch_name": "refs/heads/master", "committer_date": 1595418572000, "content_id": "30d0f0caf1fe23e4c60eac286e15807363e6d9f0", "detected_licenses": [ "MIT" ], "directory_id": "d58e8b59a1c7df252f890c83dc480a79b59eb31d", "extension": "py", "fi...
2.6875
stackv2
import math import itertools from datetime import datetime from dateutil.parser import parse as datetime_parser from bibchex.strutil import split_at_multiple # Table shamelessly taken from # https://stackoverflow.com/a/4580132/4694124 LATEX_ACCENTS = [ [u"à", "\\`a"], # Grave accent [u"è", "\\`e"], [u"ì...
223
23.97
86
15
1,912
python
[]
0
true
2024-11-19T02:32:32.803554+00:00
1,693,479,425,000
6894fe1a93c9b015cc4cc604c5f4a273c17a6d49
2
{ "blob_id": "6894fe1a93c9b015cc4cc604c5f4a273c17a6d49", "branch_name": "refs/heads/main", "committer_date": 1693479425000, "content_id": "0fa664159f1073874f582595a8e839d2f0a57724", "detected_licenses": [ "Apache-2.0" ], "directory_id": "fcc3fcd8da44b7d6bd46098df9693d6fb01cef73", "extension": "py", ...
2.390625
stackv2
"""This module contains secret adapter class to interact with AWS Secrets Manager.""" import json import logging import lzma import os import sys import typing as _t from contextlib import suppress from functools import cached_property from functools import partial from pathlib import Path import boto3 from botocore....
293
34.85
147
20
2,212
python
[]
0
true
2024-11-19T02:32:32.855423+00:00
1,590,327,449,000
a975ccc0799eea009aaf96b158461a44284e5bb5
2
{ "blob_id": "a975ccc0799eea009aaf96b158461a44284e5bb5", "branch_name": "refs/heads/master", "committer_date": 1590327449000, "content_id": "4d3824e486091aa156e0a5add96abebd6062cb90", "detected_licenses": [ "Apache-2.0" ], "directory_id": "8b7a484f9d7fb9991879d49ca150b896f5104710", "extension": "py"...
2.359375
stackv2
from typing import List import dynet as dy from . import dy_model from ..init import init_wrap @dy_model class MLP(object): """docstring for MLP""" def __init__( self, model: dy.ParameterCollection, sizes: List[int], f: 'nonlinear' = dy.tanh, p: flo...
39
30.1
73
19
332
python
[]
0
true
2024-11-19T02:32:33.034863+00:00
1,476,747,882,000
524b94aa9134006f24c444dc535ee760be61b6ff
3
{ "blob_id": "524b94aa9134006f24c444dc535ee760be61b6ff", "branch_name": "refs/heads/master", "committer_date": 1476747882000, "content_id": "174a3d10e4bda8e1544c37d94b85714c03c9c1d6", "detected_licenses": [ "MIT" ], "directory_id": "250350579840aa5bb5001506e101a261d8ad85b4", "extension": "py", "fi...
2.515625
stackv2
#!/usr/bin/python """ Create a file of taxonomy information from MetaCyc flat pathways file (pathways.dat) Dependencies: MetaCyc flat files and NCBI taxonomy files To Run: $ python make_map_metacyc-pwy_taxonomy.py --input-pathways pathways.dat --input-taxonomy-names names.dmp --input-taxonomy-division division.d...
280
29.09
105
21
1,877
python
[]
0
true
2024-11-19T02:32:35.150106+00:00
1,633,944,549,000
78b02b87cdedeb68fb26e412153e75d02a6304b3
3
{ "blob_id": "78b02b87cdedeb68fb26e412153e75d02a6304b3", "branch_name": "refs/heads/master", "committer_date": 1633944549000, "content_id": "372fbacc8cc36c0656884db303476f5f6186b0ea", "detected_licenses": [ "MIT" ], "directory_id": "8f81418c90c36f27973f7cd552952e5d436629e8", "extension": "py", "fi...
2.703125
stackv2
import requests import pandas as pd import environ env = environ.Env() environ.Env.read_env() # reading .env file cert_cert = env('CERT') cert_key = env('KEY') online_edu_link = 'https://online.edu.ru/api/' def get_data(): """ Collecting platforms to DataFrame """ cert_cert = env('CERT') cert_k...
230
41.19
119
17
1,890
python
[]
0
true
2024-11-19T02:32:35.216142+00:00
1,480,278,270,000
c12368376d99e7e224b579dd5987c81278f8765f
2
{ "blob_id": "c12368376d99e7e224b579dd5987c81278f8765f", "branch_name": "refs/heads/master", "committer_date": 1480278270000, "content_id": "5af2b2bdd325f9375716a5c29b0f9c27883ad128", "detected_licenses": [ "MIT" ], "directory_id": "27fbd83e06f18feba620e08e6c0c243f56bf0994", "extension": "py", "fi...
2.5
stackv2
#!/usr/bin/env python\n # -*- coding: utf-8 -*- import sys import re import sublime import sublime_plugin pythonver = sys.version_info[0] if pythonver >= 3: from . import mw_utils as mw else: import mw_utils as mw class MediawikerSearchStringCommand(sublime_plugin.WindowCommand): ''' alias to Search st...
81
36.72
134
18
698
python
[]
0
true
2024-11-19T02:32:35.271056+00:00
1,554,748,589,000
4a67aa03597f09464762aaa401b6ea18377ddf09
3
{ "blob_id": "4a67aa03597f09464762aaa401b6ea18377ddf09", "branch_name": "refs/heads/master", "committer_date": 1554748589000, "content_id": "503659c9ac7caac9798933fc9b01ec9228dee84f", "detected_licenses": [ "MIT" ], "directory_id": "1d5fcf4f82618b376a310af29d865151ccd139be", "extension": "py", "fi...
2.8125
stackv2
import numpy as np import uncertainties.unumpy as unp from uncertainties.unumpy import (nominal_values as noms, std_devs as stds) import matplotlib.pyplot as plt import matplotlib as mpl from scipy.optimize import curve_fit plt.rcParams['figure.figsize'] = (12, 8) plt.rcParams['font.size'] = 13 plt.rcParams['lines.line...
42
26.76
75
10
391
python
[]
0
true
2024-11-19T02:32:35.331059+00:00
1,625,223,224,000
0f3a1236b2d598613e742e50a170db877de35dd7
3
{ "blob_id": "0f3a1236b2d598613e742e50a170db877de35dd7", "branch_name": "refs/heads/main", "committer_date": 1625223224000, "content_id": "5ebc64e6c2d305de2b589e16240a177f492e3073", "detected_licenses": [ "Apache-2.0" ], "directory_id": "ade0514f19210b4df851ddd24b30696b3d3cad76", "extension": "py", ...
2.546875
stackv2
import torch import torch.nn as nn import torch.nn.functional as F from dataset.spectogram.spectogram_configs import audio_channels, working_sample_rate, mel_bins, hop_size, classes_num from utils.common import count_parameters, human_format DEFAULT_CHANNEL_AND_POOL=[(64,2), (128,2), (256,2), (512,1)] def interpolate...
230
34.68
136
17
2,245
python
[]
0
true
2024-11-19T02:32:37.816418+00:00
1,484,680,556,000
16d6ffd53135efe26a5551ab110fcb4d8f073374
5
{ "blob_id": "16d6ffd53135efe26a5551ab110fcb4d8f073374", "branch_name": "refs/heads/master", "committer_date": 1484680556000, "content_id": "b06fd2536625071a7106074397b1c6aaa3d037ee", "detected_licenses": [ "MIT" ], "directory_id": "86e030a11a26f9c2489363e6a90a7e060db0b103", "extension": "py", "fi...
4.53125
stackv2
from math import sqrt __author__ = 'Ivan Povalyaev' # Задача-1: Написать класс для фигуры-треугольника, # заданного координатами трех точек. # Определить методы, позволяющие вычислить: площадь, высоту и периметр фигуры. class Figure: @property def perimeter(self): return sum(self.sides.values()) cl...
80
35.65
78
19
1,091
python
[]
0
true
2024-11-19T02:32:37.953142+00:00
1,555,931,744,000
7d7fd91519713652315e66b3c76af703373bb28e
3
{ "blob_id": "7d7fd91519713652315e66b3c76af703373bb28e", "branch_name": "refs/heads/master", "committer_date": 1555931744000, "content_id": "0af1f39808c60c63f1df6fb819ba0bed97b3bdf1", "detected_licenses": [ "MIT" ], "directory_id": "1b97650562d50887c37769ee2ded0f552e9d5959", "extension": "py", "fi...
2.921875
stackv2
import random from ecs.components.aicomponent import AIComponent from ecs.components.blockingcomponent import BlockingComponent from ecs.components.bosscomponent import BossComponent from ecs.components.combatcomponent import CombatComponent from ecs.components.displaycomponent import DisplayComponent from ecs.compone...
159
28.91
77
12
1,149
python
[]
0
true
2024-11-19T02:32:38.059731+00:00
1,615,758,335,000
1167bcb747b85c8e3ff0ccb74c8defec72f7e5ed
4
{ "blob_id": "1167bcb747b85c8e3ff0ccb74c8defec72f7e5ed", "branch_name": "refs/heads/main", "committer_date": 1615758335000, "content_id": "b75225cc512ca0eec4027b131bddb28fc7d54bb1", "detected_licenses": [ "CC0-1.0" ], "directory_id": "ab380e19b9d9d54fb76f3529729352e5803355ab", "extension": "py", "...
3.90625
stackv2
""" An option menu is a drop down menu """ import tkinter as tk root = tk.Tk() root.title("Option Menu") # this subroutine runs when the button is pressed. def submit(): lbl_displayChoice.config(text=choice.get()) # list of options that will be contained in the drop down list options = ["Java", "python", "C#", "C+...
41
23.88
70
10
224
python
[]
0
true
2024-11-19T02:32:39.436379+00:00
1,584,157,774,000
fa98838f50b9ea7dbafe9cf035c7dca4a74c1c2e
2
{ "blob_id": "fa98838f50b9ea7dbafe9cf035c7dca4a74c1c2e", "branch_name": "refs/heads/master", "committer_date": 1584157774000, "content_id": "a1fe31aa6017dc59a0946c20fe6a4cf1c6ce72c3", "detected_licenses": [ "MIT" ], "directory_id": "02a138997f38e9c331034466052677e3ed2fd85d", "extension": "py", "fi...
2.390625
stackv2
# -*- coding: utf-8 -*- """ Created on Sun Nov 10 22:42:34 2019 @author: Chenghai Li """ import numpy as np import tensorflow as tf import os x_train_uni = np.load( r'data/x_train_uni.npy') y_train_uni = np.load( r'data/y_train_uni.npy') x_test_uni = np.load( r'data/x_test_uni.npy') y_test_uni = np.load( r'data/y_te...
68
24.09
82
10
441
python
[]
0
true
2024-11-19T02:32:39.609990+00:00
1,634,115,749,000
0ac0c75b4c1adee93c2416baf194af16f0894e8d
3
{ "blob_id": "0ac0c75b4c1adee93c2416baf194af16f0894e8d", "branch_name": "refs/heads/master", "committer_date": 1634115749000, "content_id": "519fc4e22cc33d3e262c83dd191950b56c07ee84", "detected_licenses": [ "MIT" ], "directory_id": "72487430c5fab77281f2dbfc7413718424255aef", "extension": "py", "fi...
2.6875
stackv2
import powerwalker import pprint import sys pp = pprint.PrettyPrinter(indent=4) # Define PDU and serial port, print status pdu = powerwalker.PDU("/dev/ttyUSB1") ats = powerwalker.ATS("/dev/ttyUSB0") if len(sys.argv) < 3: raise ValueError('Missing arguments.') if sys.argv[1] != 'ats' and sys.argv[1] != 'pdu': ra...
35
19.43
66
10
213
python
[]
0
true
2024-11-19T02:32:39.946229+00:00
1,585,098,483,000
a7490266fa9af1301e43a38ca8cb54769f062d87
2
{ "blob_id": "a7490266fa9af1301e43a38ca8cb54769f062d87", "branch_name": "refs/heads/master", "committer_date": 1585098483000, "content_id": "d05a3259ddc7c10260194e20c2e596235cb1e29c", "detected_licenses": [ "MIT" ], "directory_id": "dfbf2e1d37af4f80449a64b5362f6036ad82d419", "extension": "py", "fi...
2.484375
stackv2
import time import numpy as np from gym_splendor_code.envs.splendor import SplendorEnv from gym_splendor_code.envs.mechanics.game_settings import * from typing import List class SplendorWrapperEnv(SplendorEnv): """ Description: This environment runs the game Splendor.""" def __init__(self): s...
45
32.6
104
23
357
python
[]
0
true
2024-11-19T02:32:40.193334+00:00
1,676,139,610,000
76a1fd1a465689322c973ea399291f970e104c80
3
{ "blob_id": "76a1fd1a465689322c973ea399291f970e104c80", "branch_name": "refs/heads/master", "committer_date": 1676139610000, "content_id": "4a226c259f04a65f2de25a2bd99d6c9644729122", "detected_licenses": [ "MIT" ], "directory_id": "255e19ddc1bcde0d3d4fe70e01cec9bb724979c9", "extension": "py", "fi...
3.1875
stackv2
from abc import ABCMeta, abstractmethod import threading class ClockInterface(object): __metaclass__ = ABCMeta @abstractmethod def time(self): pass @abstractmethod def tick(self, amount): pass @abstractmethod def sleep(self, amount): pass class Handshake(object): def __init__(self): ...
71
19.54
79
14
375
python
[]
0
true
2024-11-19T02:32:40.254958+00:00
1,625,951,753,000
60d68aea94f1463b6559c03a3ca28a53d248241d
3
{ "blob_id": "60d68aea94f1463b6559c03a3ca28a53d248241d", "branch_name": "refs/heads/main", "committer_date": 1625951753000, "content_id": "adee05a5435467f9b7cbf1de1318208c03849393", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e3d6d6e8b30376a9254f7f70da8936d6e8430d89", "extension": "py", ...
2.75
stackv2
#!/usr/bin/env python3 import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) import json import re from ipwhois import IPWhois import ipaddress from tqdm import tqdm def get_minimum_set_ranges(ranges): ''' Purpose: For a given array of IP ranges, go through the...
152
31.04
126
26
1,110
python
[{"finding_id": "codeql_py/incomplete-hostname-regexp_d758cf193e1687af_152044f8", "tool_name": "codeql", "rule_id": "py/incomplete-hostname-regexp", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "This regular expression has an unescaped '.' before 'microsoft.com', so it might match m...
5
true
2024-11-19T02:32:40.609908+00:00
1,619,609,961,000
f0c58a9603ce468d5a36e851a8944812ac8bcb01
3
{ "blob_id": "f0c58a9603ce468d5a36e851a8944812ac8bcb01", "branch_name": "refs/heads/main", "committer_date": 1619609961000, "content_id": "33d49199210bdab53a1c95e998d2a61711888f00", "detected_licenses": [ "MIT" ], "directory_id": "e01dcfd7ad3cc0c87ebbd28796e861142e4e65e8", "extension": "py", "file...
3.140625
stackv2
from typing import Tuple, Union import numpy as np from scipy.special import erf class RectifiedGaussianDistribution(object): """Implementation of the rectified Gaussian distribution. To see what is the rectified Gaussian distribution, visit: https://en.wikipedia.org/wiki/Rectified_Gaussian_distribu...
252
35.12
78
22
2,232
python
[]
0
true
2024-11-19T02:32:40.689104+00:00
1,605,127,182,000
373d5048938e1a62fcc5f0fd0fb725d96e67a55f
3
{ "blob_id": "373d5048938e1a62fcc5f0fd0fb725d96e67a55f", "branch_name": "refs/heads/master", "committer_date": 1605127182000, "content_id": "19bed249c6f653046e3ba413360f795da9f03dcc", "detected_licenses": [ "MIT" ], "directory_id": "c44ce996acfb209cb534b2733de4afce8007de18", "extension": "py", "fi...
2.9375
stackv2
from collections import namedtuple import re from os import environ import jsbsim from gym_jsbsim.catalogs.catalog import Catalog from gym_jsbsim.catalogs.property import Property, CustomProperty class Simulation: """ A class which wraps an instance of JSBSim and manages communication with it. """ ...
230
31.85
110
17
1,565
python
[]
0
true
2024-11-19T02:32:40.752774+00:00
1,693,503,258,000
5402a941f60159ade55dc0d60c5fd2388b2c7f99
3
{ "blob_id": "5402a941f60159ade55dc0d60c5fd2388b2c7f99", "branch_name": "refs/heads/main", "committer_date": 1693503258000, "content_id": "315e4f86e53a59c39b518dd54a9ea833c8406110", "detected_licenses": [ "MIT" ], "directory_id": "3beb429e5f8816e2215b6b666dc760c0dd5849dd", "extension": "py", "file...
2.65625
stackv2
from typing import Dict, List, Union from datastore.shared.typing import Field, Model ListUpdatesDict = Dict[Field, List[Union[str, int]]] def apply_fields( model: Model, add: ListUpdatesDict, remove: ListUpdatesDict, ) -> Model: modified_fields = {} for field, value in add.items(): # I...
34
30.82
90
13
248
python
[]
0
true
2024-11-19T02:32:40.868173+00:00
1,491,519,260,000
a189bf86765986bbce45c003e2c8f3b504180d89
2
{ "blob_id": "a189bf86765986bbce45c003e2c8f3b504180d89", "branch_name": "refs/heads/master", "committer_date": 1491519260000, "content_id": "88e5bb55abb4d4be849b2036e7b3246a2d4666f5", "detected_licenses": [ "MIT" ], "directory_id": "e770f20d89a7fd5f42da93746a15ed74d91e1280", "extension": "py", "fi...
2.484375
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Mar 26 06:43:00 2017 @author: Masao Takakuwa """ import sys, os import numpy as np import matplotlib.pyplot as plt sys.path.append(os.pardir) from dataset.mnist import load_mnist from MultiLayerNet import DPLMultiLayerNet from common.optimizer import ...
102
25.57
90
14
796
python
[]
0
true
2024-11-19T02:32:41.052267+00:00
1,691,923,121,000
0aa29696d0f1cd8dfe5642b8e70bd07460b6d940
2
{ "blob_id": "0aa29696d0f1cd8dfe5642b8e70bd07460b6d940", "branch_name": "refs/heads/main", "committer_date": 1691923121000, "content_id": "28f349ecc3ab49597e801d340b390e76e37ea4da", "detected_licenses": [ "MIT" ], "directory_id": "9c5abcac18a8bdac74b5ba1658fd3d36a13fe419", "extension": "py", "file...
2.40625
stackv2
import sqlalchemy as sql from estimagic.exceptions import TableExistsError from estimagic.logging.load_database import RobustPickler def make_optimization_iteration_table(database, if_exists="extend"): """Generate a table for information that is generated with each function evaluation. Args: databas...
104
34.87
88
14
825
python
[]
0
true
2024-11-19T02:32:41.109140+00:00
1,657,910,712,000
9ae6e9bce1b0ae30ac7b90dc9e6a7c27432d2da0
2
{ "blob_id": "9ae6e9bce1b0ae30ac7b90dc9e6a7c27432d2da0", "branch_name": "refs/heads/master", "committer_date": 1657910712000, "content_id": "1de6faf285c544aa6fd4396f0f0f37186972cab9", "detected_licenses": [ "MIT" ], "directory_id": "6661b4d8aa95cd4125c368f7a70c529fcc10bd45", "extension": "py", "fi...
2.3125
stackv2
from pa.lib import star as st from matplotlib import pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np import argparse import os plt.rcParams.update({ "text.usetex": True, "font.family": "serif", "font.serif": "Computer Modern", "font.size": 20, "figure.figsi...
124
32.3
90
16
1,214
python
[]
0
true
2024-11-19T02:32:41.169126+00:00
1,583,915,141,000
ce225200c7ec372da9dc620d91627a717a300c03
2
{ "blob_id": "ce225200c7ec372da9dc620d91627a717a300c03", "branch_name": "refs/heads/master", "committer_date": 1583915141000, "content_id": "28055f51144e1a251765b4c7c078ae730b1e4b89", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "13faf407e68e06ec8ca0f153d807940c6445399f", "extension": "p...
2.46875
stackv2
# -*- python -*- # # This file is part of cellnopt software # # Copyright (c) 2014 - EBI-EMBL # # File author(s): Thomas Cokelaer <cokelaer@ebi.ac.uk> # # Distributed under the GPLv3 License. # See accompanying file LICENSE.txt or copy at # http://www.gnu.org/licenses/gpl-3.0.html # # website: http://github....
64
24.14
78
16
374
python
[]
0
true
2024-11-19T02:32:41.430526+00:00
1,544,283,971,000
525624458ad783a1862b02f128349bf0225945e1
3
{ "blob_id": "525624458ad783a1862b02f128349bf0225945e1", "branch_name": "refs/heads/master", "committer_date": 1544283971000, "content_id": "ed63913d5ea3e4f6cf389669bebcd6ae57dd46d7", "detected_licenses": [ "MIT" ], "directory_id": "cc93fe1cc1b668570c78b09f9e7f6474db4e046e", "extension": "py", "fi...
3.296875
stackv2
import math from functools import reduce from operator import mul counter = 0 n = 0 d = [] for i in [1, 10, 100, 1000, 10000, 100000, 1000000]: while n < i: counter += 1 n += math.ceil(math.log10(counter)) print(counter) digits = math.ceil(math.log10(counter)) dif = i - (n - digits) ...
18
26.17
88
12
171
python
[]
0
true
2024-11-19T02:32:41.725836+00:00
1,619,533,902,000
3531c9e0926b69fb8067277402c97a7386632ce9
3
{ "blob_id": "3531c9e0926b69fb8067277402c97a7386632ce9", "branch_name": "refs/heads/main", "committer_date": 1619533902000, "content_id": "8d5e04da4800d0f412b01507ed76fe84e3e015f4", "detected_licenses": [ "MIT" ], "directory_id": "9505e191cb287507c7df05212ab562bea1eda553", "extension": "py", "file...
3.15625
stackv2
""" 例子:倒立摆 """ import tensorflow as tf import numpy as np import gym np.random.seed(2) tf.set_random_seed(2) # reproducible class Actor(object): # 可以输出连续动作 def __init__(self , sess , n_features , action_bound , lr = 0.0001): self.sess = sess self.s = tf.placeholder(tf.float32 , ...
167
32.49
120
16
1,487
python
[]
0
true
2024-11-19T02:32:41.832727+00:00
1,526,969,333,000
41e97bf9dba6f231fb27aa22345f513ca74a43ca
3
{ "blob_id": "41e97bf9dba6f231fb27aa22345f513ca74a43ca", "branch_name": "refs/heads/master", "committer_date": 1526969333000, "content_id": "e7483038ff0bf9262a51120f6534a4454be813f8", "detected_licenses": [ "MIT" ], "directory_id": "45a26e07bec39e30bced29605201487df6e9931f", "extension": "py", "fi...
2.796875
stackv2
''' Reference implementation of node2vec. Author: Aditya Grover For more details, refer to the paper: node2vec: Scalable Feature Learning for Networks Aditya Grover and Jure Leskovec Knowledge Discovery and Data Mining (KDD), 2016 ''' from utils import convert_embed_to_np import argparse import os import networkx as...
149
34.01
174
17
1,281
python
[]
0
true
2024-11-19T02:32:41.895816+00:00
1,574,773,925,000
21c30777b1bd61de7f0c388bf29d5df7e6e9f051
2
{ "blob_id": "21c30777b1bd61de7f0c388bf29d5df7e6e9f051", "branch_name": "refs/heads/master", "committer_date": 1574773925000, "content_id": "d9b55ac9e0c79ba3cecc83879c597639cad11dd7", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0dd42eda0a7abef8485d09341227c18e48121992", "extension": "py"...
2.484375
stackv2
import tkinter as tk import pafy,os,subprocess from pydub import AudioSegment #from pytube import YouTube def downloadVid(): global E1 url =E1.get() video=pafy.new(url) stream=video.allstreams s=1 a=[] counter=1 for i in stream: if "mp4" in str(i): a.append(i) ...
88
28.69
141
18
698
python
[]
0
true
2024-11-19T02:32:42.883259+00:00
1,679,648,645,000
3be0937a0b54faf704d0e4aa440ca1bd6462208f
3
{ "blob_id": "3be0937a0b54faf704d0e4aa440ca1bd6462208f", "branch_name": "refs/heads/main", "committer_date": 1679648645000, "content_id": "93afacbc90481471b53f1ad8c5c4556fea23ac87", "detected_licenses": [ "MIT" ], "directory_id": "d54aaed3d469095062c6c1d25e94565caedfa489", "extension": "py", "file...
2.515625
stackv2
import os import sublime import subprocess from sublime_plugin import WindowCommand NATIVE_FOCUS_WINDOW = int(sublime.version()) >= 4067 class FocusSublimeWindowCommand(WindowCommand): """ Focuses the SublimeText window. """ def run(self, **args): if NATIVE_FOCUS_WINDOW: self.wi...
39
29.49
99
16
247
python
[]
0
true
2024-11-19T02:32:42.990752+00:00
1,590,089,700,000
b0fda049ed06907d84e7439c6883daae48077c87
3
{ "blob_id": "b0fda049ed06907d84e7439c6883daae48077c87", "branch_name": "refs/heads/master", "committer_date": 1590089700000, "content_id": "ac7a25b6be5ef93a4a68c72c407f2d120a96d3b7", "detected_licenses": [ "MIT" ], "directory_id": "1d0da1695bea40f3ae58d66a388ea4d85cd71855", "extension": "py", "fi...
2.796875
stackv2
''' Initial Analysis script, results are saved to the /root/research docker directory - Outputs a text file which includes the following results - Total number of blocks - Transactions & types (shielded, deshielded, transparent, mixed, private) ''' import helpfulFunctions as hf import config as conf def mai...
40
36
110
18
393
python
[]
0
true
2024-11-19T02:32:43.050848+00:00
1,669,671,051,000
84979bacedfbb3104cdf64bd549c9b1d25a6f88a
3
{ "blob_id": "84979bacedfbb3104cdf64bd549c9b1d25a6f88a", "branch_name": "refs/heads/master", "committer_date": 1669671051000, "content_id": "80d2ecf9ee065e1ef3eea7722a99be406815d3a0", "detected_licenses": [ "MIT" ], "directory_id": "f8b1bb830377785ac65be495795dd711cfc0fb17", "extension": "py", "fi...
2.90625
stackv2
#! /usr/bin/env python3 """ usage: bactopia prepare [-h] [-f STR] [-a STR] [--pe1_pattern STR] [--pe2_pattern STR] [--fastq_separator STR] [-r] [--long_reads] [--merge] [--prefix STR] [--examples] [--version] STR bactopia prepare - Read a directory and prepare a FOFN of ...
299
40.53
150
21
3,104
python
[]
0
true
2024-11-19T02:32:43.104964+00:00
1,442,591,766,000
0fe08efaa787e62d37f034f70dce89653fc2ecd9
3
{ "blob_id": "0fe08efaa787e62d37f034f70dce89653fc2ecd9", "branch_name": "refs/heads/master", "committer_date": 1442591766000, "content_id": "55740c43919567b6e6e5f3ce0dcb326edccc24a8", "detected_licenses": [ "MIT" ], "directory_id": "9fd535df0f9f6c2471332675559db34fa9882842", "extension": "py", "fi...
3
stackv2
import csv # save the json output as tweets.json jsfile = file('tweets.json', 'w') jsfile.write('[\r\n') with open('sampletweet.txt','r') as f: next(f) # skip headings reader=csv.reader(f,delimiter='\t') # get the total number of rows excluded the heading row_count = len(list(reader)) ite = 0 ...
42
20.19
55
13
262
python
[]
0
true
2024-11-19T02:32:43.152675+00:00
1,630,075,067,000
dd4328b299080e9dfcba8614b2caf6eff22c5140
3
{ "blob_id": "dd4328b299080e9dfcba8614b2caf6eff22c5140", "branch_name": "refs/heads/master", "committer_date": 1630075067000, "content_id": "68061d806789538feb3508738e39a15f45139580", "detected_licenses": [ "MIT", "Python-2.0" ], "directory_id": "29b02627b62bcaaecef32015d1b0f9ef487e7b95", "exten...
2.734375
stackv2
import re import requests import os from bs4 import BeautifulSoup import webbrowser def scrape(http_response): bsoup = BeautifulSoup(http_response.text, "html.parser") image_tags = bsoup.find_all("img") urls = [img["src"] for img in image_tags] img = urls[0].split("/")[-1] for url in urls: ...
32
32.28
65
15
279
python
[]
0
true
2024-11-19T02:32:43.260835+00:00
1,619,229,126,000
8d2dbdee1dc81f8aab4bb459ef3549a601027c36
3
{ "blob_id": "8d2dbdee1dc81f8aab4bb459ef3549a601027c36", "branch_name": "refs/heads/main", "committer_date": 1619229126000, "content_id": "7c03db5520ff1a99e16cbadbe970ffc197da0b29", "detected_licenses": [ "MIT" ], "directory_id": "024fb96f0efbb3fa3ef6a8f0e0f2301b53ce1672", "extension": "py", "file...
2.90625
stackv2
import math import decimal import threading import sys import time import curses import screenfunctions import superglobals def main(stdscr): max_y = stdscr.getmaxyx()[0] - 1 max_x = stdscr.getmaxyx()[1] - 1 def resizing_thread_function(): while True: if max_y < 39 or max_x < 159: ...
111
34.9
86
22
1,029
python
[]
0
true
2024-11-19T02:32:43.443042+00:00
1,475,661,476,000
2def1bd2073f79772e1ec3136ecd4493b35de6b3
3
{ "blob_id": "2def1bd2073f79772e1ec3136ecd4493b35de6b3", "branch_name": "refs/heads/master", "committer_date": 1475661476000, "content_id": "6665c6b17ad4c7abf270ddc251a9cc914edf500a", "detected_licenses": [ "MIT" ], "directory_id": "5aa9b20b549eab23dc279f661472c58e51051b5e", "extension": "py", "fi...
3.375
stackv2
# -*- coding: utf-8 -*- """Models """ from datetime import datetime from typing import AnyStr, List, Any, Dict class User: """User model """ def __init__(self, *args: List[Any], **kwargs: Dict[Any, Any]) -> None: for key, value in kwargs.items(): setattr(self, key, value) def _...
43
22.37
84
13
253
python
[]
0
true
2024-11-19T02:32:43.492295+00:00
1,557,057,226,000
b6a6779de34ffb5ccd2ad5036860f108a8fae4f3
3
{ "blob_id": "b6a6779de34ffb5ccd2ad5036860f108a8fae4f3", "branch_name": "refs/heads/master", "committer_date": 1557057226000, "content_id": "82343bd6c57e729fa046d019f4d0658ee8e58ae4", "detected_licenses": [], "directory_id": "45de13a618813455a3ea1e65c5dd31066b311cd7", "extension": "py", "filename": "000...
3.21875
stackv2
# coding = utf-8 __author__= 'liez' import re def num(path): with open(path, 'r') as file: data=file.read() print(data) words=re.compile('[a-zA-Z0-9]+') #compile好像是必须用的,用来格式转换什么的,然后才能进行匹配之类的操作 dict={} for x in words.findall(data): if x not in dict: ...
20
19.8
80
14
119
python
[]
0
true
2024-11-19T02:32:43.544208+00:00
1,548,030,277,000
4d4b9a86a4d73b5de16d893b6ad8793030920b26
3
{ "blob_id": "4d4b9a86a4d73b5de16d893b6ad8793030920b26", "branch_name": "refs/heads/master", "committer_date": 1548030277000, "content_id": "88e1e5a58e544c96a94355fbe8203bf459ded061", "detected_licenses": [ "MIT" ], "directory_id": "83591b863e6d4658293e3bcf827f049031f5eec8", "extension": "py", "fi...
2.96875
stackv2
from collections import defaultdict from contextlib import contextmanager from .util import subvals, wraps def trace(start_node, fun, x): ''' ''' with trace_stack.new_trace() as trace_id: # Box the method first start_box = new_box(x, trace_id, start_node) # Now close the box ...
119
29.49
89
16
901
python
[]
0
true
2024-11-19T02:32:43.601899+00:00
1,634,197,676,000
eead371233589e0472da76a514d278e41b8e0e43
3
{ "blob_id": "eead371233589e0472da76a514d278e41b8e0e43", "branch_name": "refs/heads/main", "committer_date": 1634197676000, "content_id": "ab51eb874544fa763416098a82821feff038d8d7", "detected_licenses": [ "MIT" ], "directory_id": "bae0a2419770d8734a0e1044c3e266af602efae0", "extension": "py", "file...
2.828125
stackv2
#!/usr/bin/env python3.9 import matplotlib.pyplot as plt import pandas as pd import subprocess import copy import re import time import argparse import sys class Log: date=None add_lines=0 del_lines=0 def reset(self): self.date=None self.add_lines=0 self.del_lines=0 def co...
173
25.78
119
15
1,181
python
[]
0
true
2024-11-19T02:32:43.954520+00:00
1,580,319,850,000
796798574df5d0190df69c64b6d33f522eb35e3e
4
{ "blob_id": "796798574df5d0190df69c64b6d33f522eb35e3e", "branch_name": "refs/heads/master", "committer_date": 1580319850000, "content_id": "382eb527618041728c2401bd96085fe8c282b7ab", "detected_licenses": [ "Apache-2.0" ], "directory_id": "c37803914e7579ebcbd619b9db656652ebfc5b56", "extension": "py"...
3.578125
stackv2
# Read from file file = "d:\\tutorials\\python\\barantcev-training\\barantcev-training\\Learn Python Book\\txt_file.txt" with open(file) as f_obj: content = f_obj.read() print(content) print() # print(read) lines from file with open(file) as f_obj: for line in f_obj: print(line.strip()) # Crea...
38
23.21
111
12
252
python
[]
0
true
2024-11-19T02:32:44.008632+00:00
1,575,993,439,000
307a30c8a3dcd9507654aff5ca8c26399eafaa59
3
{ "blob_id": "307a30c8a3dcd9507654aff5ca8c26399eafaa59", "branch_name": "refs/heads/master", "committer_date": 1575993439000, "content_id": "5438036195b208621f20d3034164c96d1769c659", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "a5efb2239d1f8b1dc0728f0d8bca2ac2716da856", "extension": "p...
2.890625
stackv2
import numpy from matplotlib import pyplot x = numpy.linspace(0, 10, 80) y = numpy.linspace(0, 1, 20) X, Y = numpy.meshgrid(x, y) U = 4*numpy.sin(2*numpy.pi*Y)*numpy.cos(numpy.pi*X/2) V = -numpy.cos(2*numpy.pi*Y)*numpy.sin(numpy.pi*X/2) fig = pyplot.figure(figsize=(10, 2), frameon=True) ax = fig.add_subplot(1, 1, 1...
21
29.86
53
11
212
python
[]
0
true
2024-11-19T02:32:44.058441+00:00
1,581,761,033,000
e0d45e5f55d18251ad4d79617a6656b0e256847a
3
{ "blob_id": "e0d45e5f55d18251ad4d79617a6656b0e256847a", "branch_name": "refs/heads/master", "committer_date": 1581761033000, "content_id": "6a1d7a88d021c5d94a423a691d43dc8ca568e738", "detected_licenses": [ "MIT" ], "directory_id": "3c0636c7e7da75dcfb8b491a83f7cc2070f15c5a", "extension": "py", "fi...
2.609375
stackv2
#! /usr/bin/python # -*- coding: utf-8 -*- """The main scene of the cocos-single frontend. This is one of the views in MVC pattern. """ import pyglet from cocos import director, layer, scene, menu from cocos.scenes import transitions from .utils.basic import set_menu_style from .utils.layers import BackgroundLayer,...
135
27.16
108
18
826
python
[]
0
true
2024-11-19T02:32:44.105656+00:00
1,618,749,402,000
ebab349670141d4633633a210b990c581adcdec1
2
{ "blob_id": "ebab349670141d4633633a210b990c581adcdec1", "branch_name": "refs/heads/master", "committer_date": 1618749402000, "content_id": "32ad141607225dac492aab54b51d042c1f1438c5", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2a718238004855786b86143acb429ec0af8cd3df", "extension": "py"...
2.46875
stackv2
import boto3 import json import populartimes from datetime import datetime import time import os import pandas as pd s3_client = boto3.client('s3') response = s3_client.get_object(Bucket="sdd-s3-basebucket", Key="codebuild-googleplaces/places") api_key = response["Body"].read().decode("utf-8") date = datetime.now() ...
39
30.1
165
13
324
python
[]
0
true
2024-11-19T02:32:44.161659+00:00
1,562,473,155,000
ccce08c11e061a2324dbe5c256c610b923a849a5
3
{ "blob_id": "ccce08c11e061a2324dbe5c256c610b923a849a5", "branch_name": "refs/heads/master", "committer_date": 1562473155000, "content_id": "75f1890e365b1c24cc1521d92664a1d115582c29", "detected_licenses": [ "MIT" ], "directory_id": "43b8a53b70321de941b9804585c059a211f82081", "extension": "py", "fi...
2.84375
stackv2
# Copyright (c) Chris Choy (chrischoy@ai.stanford.edu). # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, ...
150
36.88
93
15
1,399
python
[]
0
true
2024-11-19T02:32:44.402145+00:00
1,566,015,789,000
95716a55e0e89364f72ce722c5784e27bc5a7ce2
4
{ "blob_id": "95716a55e0e89364f72ce722c5784e27bc5a7ce2", "branch_name": "refs/heads/master", "committer_date": 1566015789000, "content_id": "a817911b4c26b3108b3fdf7603ebce80d4f1120a", "detected_licenses": [ "MIT" ], "directory_id": "8b86f7809b18de55fddd55800f932a20725132ea", "extension": "py", "fi...
4.25
stackv2
from .node import Node class Queue: """Create a Queue data structure""" def __init__(self, iterable=[]): self.front = None self.back = None self._size = 0 if type(iterable) is not list: raise TypeError('Invalid iterable') for item in iterable: se...
46
25.37
52
12
278
python
[]
0
true
2024-11-19T02:32:44.633471+00:00
1,385,867,417,000
3b4bad57603416addcb36aa7fec3b97962b7caa8
2
{ "blob_id": "3b4bad57603416addcb36aa7fec3b97962b7caa8", "branch_name": "refs/heads/master", "committer_date": 1385867417000, "content_id": "36f38f609e202e7ee537cbca71edbb8e208c84a4", "detected_licenses": [ "ISC" ], "directory_id": "589ee9c9f4ae2ca4b0fa4ef0322bb18b93bbbcda", "extension": "py", "fi...
2.46875
stackv2
# Copyright (c) str4d <str4d@mail.i2p> # See COPYING for details. from twisted.internet.interfaces import IAddress from twisted.python.util import FancyEqMixin from zope.interface import implementer @implementer(IAddress) class I2PAddress(FancyEqMixin, object): """ An L{I2PAddress} represents the address of ...
36
28.28
83
14
261
python
[]
0
true
2024-11-19T02:32:45.595688+00:00
1,430,590,775,000
a33ceef883d71100486a0d214eaa4ac3045f0bb6
3
{ "blob_id": "a33ceef883d71100486a0d214eaa4ac3045f0bb6", "branch_name": "refs/heads/master", "committer_date": 1430590775000, "content_id": "d7252255a40aabdebe8cd349401eda25c63a82f8", "detected_licenses": [ "MIT" ], "directory_id": "56bbee381f2f22fffa17c7a3a22d1320f72f6f18", "extension": "py", "fi...
2.78125
stackv2
import os import shutil import tempfile from contextlib import contextmanager from archivekit.manifest import ResourceMetaData class Resource(object): """ Any file within the prefix of the given package, except the manifest. """ GROUP = None def __init__(self, package, name): self.package =...
91
31.73
76
17
638
python
[]
0
true
2024-11-19T02:32:45.758367+00:00
1,602,825,114,000
6b87aa9f175df20921747dd059a5700a40393f3e
3
{ "blob_id": "6b87aa9f175df20921747dd059a5700a40393f3e", "branch_name": "refs/heads/master", "committer_date": 1602825114000, "content_id": "c1573d0a217601e8cbe0fbf07673cc3b15b35610", "detected_licenses": [ "MIT" ], "directory_id": "e3fb5114c87653b236e3f006187861bb12b6337d", "extension": "py", "fi...
3.140625
stackv2
from text_to_speech.exceptions import LanguageNotSupportError, VoiceNotSupportError class Speech(object): def __init__(self, name, password, file_name=None): self.__file_name = file_name if file_name else 'out' def make_file(self, **kwargs): lang = kwargs.get('lang', '') voice = kwar...
51
24.12
83
14
286
python
[]
0
true