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:31:36.768255+00:00
1,668,775,898,000
784b8a4ac1af4ff204f81454d3b908b3fc25c8aa
3
{ "blob_id": "784b8a4ac1af4ff204f81454d3b908b3fc25c8aa", "branch_name": "refs/heads/master", "committer_date": 1668775898000, "content_id": "9cde956d1a53053e687cb0182772c76cb2f29463", "detected_licenses": [ "MIT" ], "directory_id": "a8aa48ba417d9d6e8569ead55f2f4b2f146b2427", "extension": "py", "fi...
3.109375
stackv2
""" This module defines the possible types in the rule engine, and provides conversions from and to Python types. """ from calendar import timegm from collections.abc import Iterable from datetime import datetime import clips class RuleEngineType(object): """ Base class for a possible type """ PYTHO...
129
21.11
83
13
693
python
[]
0
true
2024-11-19T02:31:36.826066+00:00
1,593,960,763,000
092645c419bc56f7857104a586a68110bb96e292
3
{ "blob_id": "092645c419bc56f7857104a586a68110bb96e292", "branch_name": "refs/heads/master", "committer_date": 1593960763000, "content_id": "1bfd2f156c40c76d98864a21a5532bf30bb72b2a", "detected_licenses": [ "MIT" ], "directory_id": "d932a1250b5132f55bb63fc8c6483820961f9c24", "extension": "py", "fi...
3.28125
stackv2
class Progress: """ Manage progress step, status and information message """ # Statuses NONE = 0 INFO = 1 WARN = 2 ERROR = 3 def __init__(self, num_steps: int = None): self.num_steps = num_steps self.statuses = [] self.current_step = 0 self.next = '' ...
35
23.74
69
11
214
python
[]
0
true
2024-11-19T02:31:36.985778+00:00
1,452,700,976,000
4cdf4ce06e074e6a7489c704f82e6e36a7bb1e5a
2
{ "blob_id": "4cdf4ce06e074e6a7489c704f82e6e36a7bb1e5a", "branch_name": "refs/heads/master", "committer_date": 1452700976000, "content_id": "c286152c0f1c184e1cab291e6cd2f46145823055", "detected_licenses": [ "Apache-2.0" ], "directory_id": "c46b07e84d4859fa06da8fe36b597d0ca8106002", "extension": "py"...
2.453125
stackv2
# -*- coding: utf-8 -*- import csv import json import logging import os from flask import Flask, request, jsonify, redirect from jinja2 import Environment, PackageLoader from doc_processor import DocumentProcessor def setup_logging(): logging.basicConfig(level=logging.DEBUG, format='%(as...
97
27.07
87
16
631
python
[{"finding_id": "codeql_py/jinja2/autoescape-false_afc78711a07ba654_e810477d", "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-19T02:31:37.092591+00:00
1,618,379,088,000
367b18b2fd273222d341f0e40e6552131cae175a
2
{ "blob_id": "367b18b2fd273222d341f0e40e6552131cae175a", "branch_name": "refs/heads/main", "committer_date": 1618379088000, "content_id": "c5279db696b87e1da7e21e3a581311be130197a8", "detected_licenses": [ "Apache-2.0" ], "directory_id": "c53d57b6ea5b117d8fa260a29942cf9422a46063", "extension": "py", ...
2.46875
stackv2
import numpy as np import random import os from .eda import AutoEDA from .data_utils import ohe2cat from .log_utils import info, debug class AutoSample: def __init__(self, y_onehot): self.auto_eda = AutoEDA() self.y_onehot = y_onehot self.sample_num, self.class_num = y_onehot.shape ...
64
35.41
98
19
592
python
[]
0
true
2024-11-19T02:31:37.159579+00:00
1,554,486,902,000
66a1aa90271602cc4996ec950b94b04fc6f864ed
3
{ "blob_id": "66a1aa90271602cc4996ec950b94b04fc6f864ed", "branch_name": "refs/heads/master", "committer_date": 1554486902000, "content_id": "765ae116e5103ed62fbb12e44a23f996add7f8c5", "detected_licenses": [ "Unlicense" ], "directory_id": "edcce8be5573f92cb37fb14e3b29aecf96ba64ca", "extension": "py",...
2.953125
stackv2
# Mapping Object for epistatic interactions int the epistasis map # # Author: Zach Sailer # # ---------------------------------------------------------- # Outside imports # ---------------------------------------------------------- import json import itertools as it from functools import wraps from collections import ...
273
28.74
80
20
1,815
python
[]
0
true
2024-11-19T02:31:37.611194+00:00
1,597,707,340,000
a996009fdbd3c39078b3625f3b85fb9857439669
3
{ "blob_id": "a996009fdbd3c39078b3625f3b85fb9857439669", "branch_name": "refs/heads/master", "committer_date": 1597707340000, "content_id": "435b56d7d75263eeb5557b3bb81818eb362b8449", "detected_licenses": [ "MIT" ], "directory_id": "c7249d3cfa11dd524e4d3dc267e15eb02394ef49", "extension": "py", "fi...
2.875
stackv2
#!/usr/bin/env python u""" read_kml_file.py Written by Tyler Sutterley (09/2019) Reads polygons from keyhole markup language (.kml or .kmz) files INPUTS: input .kml or .kmz file OUTPUT: shapely multipolygon object of input file OPTIONS: EPSG: projection identifier for output coordinates KMZ: input fi...
98
37
79
14
982
python
[]
0
true
2024-11-19T02:31:37.671764+00:00
1,592,905,076,000
4a400cc8255e6d74a7a08c30b43304583e0236cf
2
{ "blob_id": "4a400cc8255e6d74a7a08c30b43304583e0236cf", "branch_name": "refs/heads/master", "committer_date": 1592905076000, "content_id": "a41c6729c1444279f3ad0da40c5c45aab8a78d9f", "detected_licenses": [ "MIT" ], "directory_id": "67828e43132cd5adb2534342de02cb825a5ff610", "extension": "py", "fi...
2.359375
stackv2
import matplotlib.pyplot as plt from path import Path import numpy as np import cv2 import scipy.ndimage as ndimage from numpy.ma import masked_array import argparse import matplotlib.colors as colors parser = argparse.ArgumentParser(description="Monodepthv2 training options") parser.add_argument('--width',default=1...
167
27.78
140
13
1,603
python
[]
0
true
2024-11-19T02:31:37.960042+00:00
1,447,144,472,000
c2d2d3bf2ae62254c768beb3698cb491ddc67ae4
3
{ "blob_id": "c2d2d3bf2ae62254c768beb3698cb491ddc67ae4", "branch_name": "refs/heads/master", "committer_date": 1447144472000, "content_id": "a37584ee0c72f67d164c0f19da3330692179cba1", "detected_licenses": [ "MIT" ], "directory_id": "c62286976ebfd07a48dec5eb883c0201397156d4", "extension": "py", "fi...
2.953125
stackv2
#!/usr/bin/env python import base64 def encode(sourceFileName, targetFileName): # encode source = open(sourceFileName, "rb") target = open(targetFileName, "wb") line = source.readline() while line: encodeData = base64.b64encode(line) target.write(encodeData + "\n") line = s...
27
25.15
43
12
166
python
[]
0
true
2024-11-19T02:31:38.012782+00:00
1,692,804,066,000
03dd364829577c51ec9b06413ce5d29c3a47285b
3
{ "blob_id": "03dd364829577c51ec9b06413ce5d29c3a47285b", "branch_name": "refs/heads/master", "committer_date": 1692804066000, "content_id": "8ce51cad30463cc546a023b0fd17c6788963cae3", "detected_licenses": [ "MIT" ], "directory_id": "59bf27c71911d269c975a0cd21287efa6ec0e35d", "extension": "py", "fi...
3.421875
stackv2
""" Standardized JSON conventions. """ import json from datetime import datetime from typing import Iterable from uuid import UUID from .utils import contextualize_char, shorten_left def as_json(value): """ Converts *value* to a JSON string using our custom :class:`JsonEncoder`. """ return json.dumps(...
145
31.18
128
19
1,113
python
[]
0
true
2024-11-19T02:31:38.256199+00:00
1,450,795,441,000
684ef723fabac70c46cb44ed685e749562a3fd00
3
{ "blob_id": "684ef723fabac70c46cb44ed685e749562a3fd00", "branch_name": "refs/heads/master", "committer_date": 1450795441000, "content_id": "386039a1df0b4b2bb15b7169749f9f770642c46d", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d47e1c69a7978ae942561ed1a6fbea471518422b", "extension": "py"...
2.640625
stackv2
import csv from .schedule_item import * from .util import * from .scheduler import * class CsvFieldNames: is_critical = "Crit" python_name = "Python Name" title = "Title" who = "Who" start_time = "Start" end_time = "End" effort = "Effort" total_effort = "Sum Effort" desc = "Descript...
76
34.33
98
17
591
python
[]
0
true
2024-11-19T02:31:38.336684+00:00
1,580,757,377,000
8ea8662bb22aba572bdfa06778e827b56eb20348
3
{ "blob_id": "8ea8662bb22aba572bdfa06778e827b56eb20348", "branch_name": "refs/heads/master", "committer_date": 1580757377000, "content_id": "578642f62364180d92a7ea3d0925bf1179bd9968", "detected_licenses": [ "Apache-2.0" ], "directory_id": "ee0217a7626a339b7c3d9aa88f7072b6d3fad754", "extension": "py"...
2.890625
stackv2
# Copyright 2018 The Texar Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
85
26.32
75
12
508
python
[]
0
true
2024-11-19T02:31:38.395759+00:00
1,636,096,669,000
d49993afb252323bf38ba008183f60ebcbed41e9
3
{ "blob_id": "d49993afb252323bf38ba008183f60ebcbed41e9", "branch_name": "refs/heads/master", "committer_date": 1636096669000, "content_id": "313c024151736d8386cf9972dca403635ab8e1ac", "detected_licenses": [ "MIT" ], "directory_id": "e42d21e7f16c25a182d39df31e39ef432992fa20", "extension": "py", "fi...
2.640625
stackv2
from enum import Enum, unique @unique class SystemScope(Enum): """ The scope of events: * SYSTEM * CLOUDLET * CLOUD """ SYSTEM = 0 CLOUDLET = 1 CLOUD = 2 @staticmethod def subsystems(): """ Return the subsystem scopes only. :return: the...
103
19.32
74
14
473
python
[]
0
true
2024-11-19T02:31:38.714803+00:00
1,578,663,184,000
2ec4c12df73b20db19cb4252cb57cdadd961d68d
2
{ "blob_id": "2ec4c12df73b20db19cb4252cb57cdadd961d68d", "branch_name": "refs/heads/master", "committer_date": 1578663184000, "content_id": "5b942fa8d3fed417d80fd1b77119b638d95a23a6", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "2ff0dc3ad2019f00ea021ac84881e3fe9e664647", "extension": "p...
2.359375
stackv2
#!/usr/bin/python # Copyright (c) Ontic. (http://www.ontic.com.au). All rights reserved. # See the COPYING file bundled with this package for license details. ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: kong_consumer...
185
28.64
121
17
1,288
python
[]
0
true
2024-11-19T02:31:38.774791+00:00
1,582,364,584,000
14d12780e84a790d137dec264573b3f2d62a6549
3
{ "blob_id": "14d12780e84a790d137dec264573b3f2d62a6549", "branch_name": "refs/heads/master", "committer_date": 1582364584000, "content_id": "7b7e9e1ddca4be72b1e94dc6a5b6188dc800514d", "detected_licenses": [ "MIT" ], "directory_id": "012837eafe45c8f7ee5fc77d4c4d7725d5314c5c", "extension": "py", "fi...
3.15625
stackv2
#!/usr/bin/env python3 # -*- coding=utf-8 -*- import cv2 as cv import numpy as np """ 霍夫直线检测 霍夫变换是一种图像变换算法,将二维空间坐标系变换到极坐标空间,可提取图像中的直线、圆等内容。opencv中的api如下: cv.HoughLines(binary, rho, theta, threshold, srn, stn, min_theta, max_theta) - binary: 二值图,轮廓不宜多并且噪声处理后 - rho: 极坐标r的步长 ...
48
27.81
84
15
545
python
[]
0
true
2024-11-19T02:31:38.906213+00:00
1,600,076,811,000
a5642ad2476dab1cbd4c8f37d74ddc08bcfb8a2d
3
{ "blob_id": "a5642ad2476dab1cbd4c8f37d74ddc08bcfb8a2d", "branch_name": "refs/heads/master", "committer_date": 1600076811000, "content_id": "a1d18a22cc827a4b7ca796b3290bc930421c0c78", "detected_licenses": [ "MIT" ], "directory_id": "be25315bdde597e8146d9f2da655b093f2ed13ed", "extension": "py", "fi...
2.875
stackv2
# organize data, read wav to get duration and split train/test # to a csv file # author: Max, 2020.09.02 import os import librosa from tqdm import tqdm import pandas as pd from sklearn.model_selection import StratifiedKFold def main(root_pth): if not os.path.exists('df_clips.csv'): data = [] fold...
59
36.2
112
18
580
python
[]
0
true
2024-11-19T02:31:39.322815+00:00
1,560,687,133,000
4347b1c299b04316843a84c5bc832a9d2f76f74c
3
{ "blob_id": "4347b1c299b04316843a84c5bc832a9d2f76f74c", "branch_name": "refs/heads/master", "committer_date": 1560687133000, "content_id": "84c88b89aadcab497115dca3bc11ce09104a1176", "detected_licenses": [ "MIT" ], "directory_id": "d1a8d1c7508f67841811b7f0dd22b53a411076ba", "extension": "py", "fi...
3.125
stackv2
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt class SampleFiguresMaker(object): """ Example ------- >>> from fig_html.utils import SampleFiguresMaker >>> root_dir = "./tests/outputs" >>> SampleFiguresMaker().make(root_dir) """ def make(self, outputs_...
91
29.21
93
13
734
python
[]
0
true
2024-11-19T02:31:39.371678+00:00
1,599,645,131,000
51f24457649f923fafcb42182fd4926887f0d3e6
3
{ "blob_id": "51f24457649f923fafcb42182fd4926887f0d3e6", "branch_name": "refs/heads/master", "committer_date": 1599645330000, "content_id": "0e2735db31e23d6ef2afd7530322a682fcd103d9", "detected_licenses": [ "MIT" ], "directory_id": "a3cba888899c626fc1a5cadffd507f5d2e74359f", "extension": "py", "fi...
2.90625
stackv2
from typing import Callable import hashlib import zlib def __common(n: int, h: Callable, digest_size: int, b=0) -> float: assert b <= digest_size if b == 0: return int.from_bytes(h(n.to_bytes(8, "big")).digest(), 'big') / 2**digest_size else: return (int.from_bytes(h(n.to_bytes(8, "big"))....
119
21.71
101
20
1,090
python
[]
0
true
2024-11-19T02:31:39.555884+00:00
1,457,705,472,000
a325bcfea43d982235de9729e8c1196aa688a902
2
{ "blob_id": "a325bcfea43d982235de9729e8c1196aa688a902", "branch_name": "refs/heads/master", "committer_date": 1457705472000, "content_id": "167849d4875e2bb1b16f78d42dec6f58d0de9933", "detected_licenses": [ "MIT" ], "directory_id": "b90c926dff84caec1f1b3c0be7f08f3227d2de59", "extension": "py", "fi...
2.4375
stackv2
""" Views for the User model. """ import functools from flask import Blueprint, render_template, url_for, redirect from flask_oauthlib.client import OAuth from flask_oauthlib.contrib.apps import github from flask_login import login_required, current_user, login_user, logout_user from codegolf import login_manager, app ...
93
26.6
119
15
583
python
[]
0
true
2024-11-19T02:31:40.029818+00:00
1,575,560,574,000
a76d9a0332b36e19f2069293661da22210bc4566
3
{ "blob_id": "a76d9a0332b36e19f2069293661da22210bc4566", "branch_name": "refs/heads/master", "committer_date": 1575560574000, "content_id": "c5e8982e91787edac97d55c10bf7d62e4c95d486", "detected_licenses": [ "MIT" ], "directory_id": "fb6048334f7e09253cb290fcd60766496495b4a9", "extension": "py", "fi...
3.046875
stackv2
# coding = utf8 """ @author: Yantong Lai @date: 2019.10.30 """ import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F torch.manual_seed(1) word_to_idx = {"hello": 0, "world": 1} # 2 words in vocab, 5 dimensional embeddings embeds = nn.Embedding(2, 5) print("embeds = {}".forma...
36
25.44
104
9
253
python
[]
0
true
2024-11-19T02:31:40.246574+00:00
1,489,202,249,000
b55f0648ff3834c76b0e295d59d39831a5060298
2
{ "blob_id": "b55f0648ff3834c76b0e295d59d39831a5060298", "branch_name": "refs/heads/master", "committer_date": 1489202249000, "content_id": "53b0ffa9bc8e0ba6d150c58cc59c6c2077f0371c", "detected_licenses": [ "MIT", "BSD-3-Clause" ], "directory_id": "d7ca385a9a584a2d72b4868f870b4793c9dffd7b", "ext...
2.5
stackv2
#! /usr/bin/python # -*- coding: utf-8 -*- """ ========================================================================= This file is part of LyX Notebook, which works with LyX but is an independent project. License details (MIT) can be found in the file COPYING. Copyright (c) 2012 Allen Barker =====================...
213
40.98
90
11
2,130
python
[]
0
true
2024-11-19T02:31:40.337380+00:00
1,573,236,096,000
b9d8ef1dedfcf55f4b199775f6a7598db555e5a6
3
{ "blob_id": "b9d8ef1dedfcf55f4b199775f6a7598db555e5a6", "branch_name": "refs/heads/master", "committer_date": 1573236096000, "content_id": "a4d66be333057497c93518c3919eca4e362bb748", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9a705d12a6c1368d292d848489883656f33aca9b", "extension": "py"...
2.9375
stackv2
import datetime import re from .utility import * WEEK_DURATION = re.compile(r'''# start ^P # duration designator (\d+) # capture the number of weeks W$ # week designator ''', re.VERBOSE) SIMPLE_DURATION = re.compile(r"""# start ^P # duration designator ((?P<years>\d*[\.,]?\d+)Y)? #...
93
32.28
81
19
738
python
[]
0
true
2024-11-19T02:31:40.404717+00:00
1,505,508,185,000
9a0804bbddc88ca1dcadd62493e48914bbfcb754
3
{ "blob_id": "9a0804bbddc88ca1dcadd62493e48914bbfcb754", "branch_name": "refs/heads/master", "committer_date": 1505508494000, "content_id": "9099403c9faafe8480eb10e13eb061afd9f553a6", "detected_licenses": [ "Apache-2.0" ], "directory_id": "418f115e30db2b6e8ab504b39ca1992ab8a2a07f", "extension": "py"...
2.65625
stackv2
#!/usr/bin/env python3 import json import urllib.request class slackWebHook: def __init__(self, url="", name="pybot", icon = "", channel = ""): self.url = url self.name = name self.icon = icon self.channel = channel def send(self, payload='', attachment=''): """ ...
26
31.35
105
14
189
python
[]
0
true
2024-11-19T02:31:40.505688+00:00
1,625,714,492,000
3bb470ee9f4ff9e0c885b3d3847e7d8374eab731
3
{ "blob_id": "3bb470ee9f4ff9e0c885b3d3847e7d8374eab731", "branch_name": "refs/heads/master", "committer_date": 1625714492000, "content_id": "bf57729a58942aa3d60a785b81cad19cba3aac4b", "detected_licenses": [ "MIT" ], "directory_id": "327c6c770ef214717f269f4f55d872b204b86765", "extension": "py", "fi...
3.1875
stackv2
import binascii as _binascii from psec import des as _des from psec import tools as _tools __all__ = ["generate_cvv"] def generate_cvv( cvk: bytes, pan: str, expiry: str, service_code: str, ) -> str: r"""Generate Visa/MasterCard Card Verification Value. Parameters ---------- cvk : b...
91
31.88
80
13
831
python
[]
0
true
2024-11-19T02:31:40.923390+00:00
1,542,159,129,000
ec30cc4dce8a0f9983889f480bd4f124de6e625c
3
{ "blob_id": "ec30cc4dce8a0f9983889f480bd4f124de6e625c", "branch_name": "refs/heads/master", "committer_date": 1542159129000, "content_id": "eeaf16c276899f338628747e77bce195f1873ad7", "detected_licenses": [ "MIT" ], "directory_id": "6009e70fcafe1d82861d891cc949819e948f5dd1", "extension": "py", "fi...
3.109375
stackv2
# -*- coding: utf-8 -*- """ https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.80 """ from Chapter2.exercises.exercise2_79 import equals from Chapter2.themes.data_directed_programming_and_additivity import ( apply_generic ) from Chapter2.themes.generic_arithmetic_operations import ( install_c...
48
26.08
72
11
354
python
[]
0
true
2024-11-19T02:31:41.041210+00:00
1,340,226,962,000
5cf59b1ea61d22a4f0965ef6a58de12c606ea52a
3
{ "blob_id": "5cf59b1ea61d22a4f0965ef6a58de12c606ea52a", "branch_name": "refs/heads/master", "committer_date": 1340226962000, "content_id": "03a7c9a1cf0deb9ed2c37310ecf468cb28024191", "detected_licenses": [ "MIT" ], "directory_id": "ea9d1dd1aa80b05fd09ac02779094de6ed0e8ae4", "extension": "py", "fi...
3.046875
stackv2
import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import colorsys def randrange(n, vmin, vmax): return (vmax-vmin)*np.random.rand(n) + vmin fig = plt.figure() ax = fig.add_subplot(111, projection='3d') n = 100 xs = [] ys = [] zs = [] xs2 = [] ys2 = [] zs2 = [] f = open("b...
47
19.87
55
13
361
python
[]
0
true
2024-11-19T02:31:41.241095+00:00
1,664,476,466,000
8495ae4fa407522bdffbeec297a0d918112a4b36
3
{ "blob_id": "8495ae4fa407522bdffbeec297a0d918112a4b36", "branch_name": "refs/heads/master", "committer_date": 1664476466000, "content_id": "ef75c3176118118c83af648b421e128e3601b220", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d2b7014943bb26a050da4d9157a250faad66cfc3", "extension": "py"...
2.53125
stackv2
"""Command line interfaces for blocking Workers""" import logging import click import csv from amti import actions from amti import settings from amti import utils logger = logging.getLogger(__name__) @click.command( context_settings={ 'help_option_names': ['--help', '-h'] }) @click.argument( ...
81
28.23
88
17
545
python
[]
0
true
2024-11-19T02:31:41.371349+00:00
1,514,964,937,000
0d0fc740e7bac048686edf6352dacf951333f9f5
2
{ "blob_id": "0d0fc740e7bac048686edf6352dacf951333f9f5", "branch_name": "refs/heads/master", "committer_date": 1514964937000, "content_id": "e79f307c1a256ddf14e1098f9e4e9028bac9bcda", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9d73d5bb50e9ed3640ccb9946137f84a8d0e9981", "extension": "py"...
2.375
stackv2
__autor__ = 'Roman' from pony.orm import * from datetime import datetime from model.project import Project from pymysql.converters import decoders class ORMFixture: db = Database() class ORMProject(db.Entity): _table_ = 'mantis_project_table' id = PrimaryKey(int, column='id') name = ...
32
26.97
100
15
196
python
[]
0
true
2024-11-19T02:31:41.435187+00:00
1,607,808,605,000
ffb82c711921628b4480aef2030b5250dc3cab84
4
{ "blob_id": "ffb82c711921628b4480aef2030b5250dc3cab84", "branch_name": "refs/heads/main", "committer_date": 1607808605000, "content_id": "999c0d1ad359257ca9bfb786adb78b7bb7d2fcab", "detected_licenses": [ "CC0-1.0" ], "directory_id": "9b134c826663310f316944c85ab7644b9a0f1fa8", "extension": "py", "...
3.640625
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 26 16:10:21 2020 @author: y3 """ import prime_calc_package from prime_calc_package import prime3 x = int(input("what number to test? ")) primes = prime3(x-1) print(primes) prime = True for z in primes: if x%z == 0: prime = False ...
22
18.59
45
10
141
python
[]
0
true
2024-11-19T02:31:41.603183+00:00
1,684,854,476,000
0b0f8e5a8e8817d9013ae1e9fd249b656f7b4e9c
3
{ "blob_id": "0b0f8e5a8e8817d9013ae1e9fd249b656f7b4e9c", "branch_name": "refs/heads/master", "committer_date": 1684854476000, "content_id": "c295c200e0d2d7f01aa1620225f690c3f47c8aea", "detected_licenses": [], "directory_id": "997ff610c50e044233923e3828ee338f7002ba08", "extension": "py", "filename": "com...
2.90625
stackv2
# -*- coding: utf-8 -*- __package__='odmltables' import os.path import datetime import xlwt from .compare_section_table import CompareSectionTable from .xls_style import XlsStyle class CompareSectionXlsTable(CompareSectionTable): """ class to write a CompareSectionTable to a xls-file :param sheet_name...
138
37.94
79
22
1,093
python
[]
0
true
2024-11-19T02:31:42.208720+00:00
1,495,563,360,000
1cf5697d9d3b7316f164893a3acfc744afaabd68
3
{ "blob_id": "1cf5697d9d3b7316f164893a3acfc744afaabd68", "branch_name": "refs/heads/master", "committer_date": 1495563360000, "content_id": "692d9c90f791d70c30a7b02c1cc55979d416ffdc", "detected_licenses": [ "Apache-2.0" ], "directory_id": "3a3f01a5cdef6ba4fef3a0b4f907241fc2274e81", "extension": "py"...
2.515625
stackv2
# Copyright 2014 NeuroData (http://neurodata.io) # # 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...
77
37.45
158
20
780
python
[]
0
true
2024-11-19T02:31:43.198601+00:00
1,441,070,882,000
21a1b4826eca7b593146cfbbd2e2a809debfd955
3
{ "blob_id": "21a1b4826eca7b593146cfbbd2e2a809debfd955", "branch_name": "refs/heads/master", "committer_date": 1441070882000, "content_id": "54809e9eccb2b6c3b18e48f5c1ceb179df943ee7", "detected_licenses": [ "MIT" ], "directory_id": "2c5bebe29aa8fe13cec303cdc0908c13390cda34", "extension": "py", "fi...
2.90625
stackv2
#!/usr/bin/python # coding:utf-8 '''存储模块,用于从data队列中取出数据并存入sqlite数据库 存储模块对外的接口即data队列,它只负责从data队列取出数据 进行存储 ''' import os import time import sqlite3 from mylogger import logger from threadPool import WorkRequest class Storage(WorkRequest): '''继承自线程池中的WorkRequest类,并实现线程执行函数''' def __init__(self, dbN...
76
28.79
135
17
541
python
[]
0
true
2024-11-19T02:31:43.271115+00:00
1,674,313,675,000
fc81fb393f4f7f5882c899edf6023835c1620716
3
{ "blob_id": "fc81fb393f4f7f5882c899edf6023835c1620716", "branch_name": "refs/heads/master", "committer_date": 1674313675000, "content_id": "3d030ff871542ee7786bb07db9099c3fe63cbb97", "detected_licenses": [ "Apache-2.0" ], "directory_id": "c2d26a7b01b071635250a0eacf4f95bb273ed427", "extension": "py"...
2.984375
stackv2
""" Execute module """ import os import os.path import sys from .db2qa import DB2QA from .decompress import Decompress from .sift import Sift from .xml2db import XML2DB class Execute: """ Main execution method to build a consolidated questions.db file from Stack Exchange Data Dumps. """ # List of s...
113
23.2
99
14
605
python
[]
0
true
2024-11-19T02:31:43.622761+00:00
1,531,545,953,000
08a4cbb95dbda8ff75e445368fbee467273b7ad8
3
{ "blob_id": "08a4cbb95dbda8ff75e445368fbee467273b7ad8", "branch_name": "refs/heads/master", "committer_date": 1531545953000, "content_id": "2cd54d34b0683688b15047c6bb86c9fe1035bb50", "detected_licenses": [ "MIT" ], "directory_id": "edf63129a0cbeac0205ebf8d1a6609ce35e2c57d", "extension": "py", "fi...
2.859375
stackv2
import sys import os import dlib import cv2 import openface # Please download the trained face detection model on # http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 # (the file is too big, so I can't add it in the repo) predictor_model = "shape_predictor_68_face_landmarks.dat" output_path = "output/alig...
44
32.41
112
12
363
python
[]
0
true
2024-11-19T02:31:43.925697+00:00
1,533,699,168,000
919c084053f9f33083a9b03aa3348cef931405b7
4
{ "blob_id": "919c084053f9f33083a9b03aa3348cef931405b7", "branch_name": "refs/heads/master", "committer_date": 1533699168000, "content_id": "c6ca9f18216caa165d46b77b5522acc1d6aa1f07", "detected_licenses": [ "MIT" ], "directory_id": "d8c35f71daa6f6ad4ca403fec5e32a840b246558", "extension": "py", "fi...
3.515625
stackv2
def search_in_rotated_array(alist, k, leftix=0, rightix=None): if not rightix: rightix = len(alist) midpoint = (leftix + rightix) / 2 aleft, amiddle = alist[leftix], alist[midpoint] if k == amiddle: return midpoint if k == aleft: return leftix if aleft > amiddle: ...
21
37.71
73
13
278
python
[]
0
true
2024-11-19T02:31:44.041465+00:00
1,565,101,426,000
ad2eb182be251df48e7817a3605ecc832850bcb2
2
{ "blob_id": "ad2eb182be251df48e7817a3605ecc832850bcb2", "branch_name": "refs/heads/master", "committer_date": 1565101426000, "content_id": "9986cf3660428efa26c98d796d6921e2614b10ca", "detected_licenses": [ "Apache-2.0" ], "directory_id": "8bdf8a7b3cb22638e3d4fff4e5582cb520bed56d", "extension": "py"...
2.5
stackv2
#!/usr/bin/env python # coding: utf-8 # Imports from luigi.contrib.spark import PySparkTask from luigi.parameter import IntParameter from luigi import LocalTarget, Task, WrapperTask from luigi.format import UTF8 from os import listdir import pandas as pd import datetime class Importer(Task): # Date for Outpu...
41
28.78
84
15
291
python
[]
0
true
2024-11-19T02:31:44.163405+00:00
1,597,930,677,000
14829b9e5f9e899748f6c9a1a0a11ff850ceedd4
2
{ "blob_id": "14829b9e5f9e899748f6c9a1a0a11ff850ceedd4", "branch_name": "refs/heads/master", "committer_date": 1597930677000, "content_id": "ce8962b66c2551df85785757cc0ad94088d9743a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "f75bb6373cb2271b416e2f673c1ee3a6601f6c3f", "extension": "py"...
2.421875
stackv2
import functools import gin import tensorflow as tf import torch from torch.utils.data import Dataset def raw_to_tsv(in_fnames, out_fname, mode="r"): # TODO remove mode, set mode="r" by default with tf.io.gfile.GFile(out_fname, "w") as outfile: for attribute, in_fname in in_fnames: with tf.io.gfile.GFile...
147
37.91
118
23
1,336
python
[]
0
true
2024-11-19T02:31:44.243895+00:00
1,693,214,350,000
04781aa2a15e88b87edfce2773a31f89a47ef0d2
2
{ "blob_id": "04781aa2a15e88b87edfce2773a31f89a47ef0d2", "branch_name": "refs/heads/master", "committer_date": 1693214350000, "content_id": "4bbd3d9769d18e3fdf4b035205b780e4e5c8a547", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e53dd2252d82e19794a7763c7aab015112546001", "extension": "py"...
2.328125
stackv2
# Copyright 2017-2022 John Snow Labs # # 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...
98
29.66
130
10
652
python
[]
0
true
2024-11-19T02:31:44.384693+00:00
1,600,015,438,000
583c4c4607e117b88fcee61563793b09f3153fa8
4
{ "blob_id": "583c4c4607e117b88fcee61563793b09f3153fa8", "branch_name": "refs/heads/master", "committer_date": 1600015438000, "content_id": "6dca1d68bf66aa1acc7cebda809a7e5b51be47c5", "detected_licenses": [ "Apache-2.0" ], "directory_id": "4df0a5e3fe936e11bd750bc15015edd506c96c01", "extension": "py"...
4.03125
stackv2
# Python Class 2344 # Lesson 6 Problem 5 # Author: snowapple (471208) import random ### Die class that we previously wrote ### class Die: '''Die class''' def __init__(self,sides=6): '''Die(sides) creates a new Die object int sides is the number of sides (default is 6) ...
206
31.62
104
19
1,647
python
[]
0
true
2024-11-19T02:31:44.445593+00:00
1,584,658,255,000
3972dd3db402f32d4178b26c732316c06fe4ebf1
3
{ "blob_id": "3972dd3db402f32d4178b26c732316c06fe4ebf1", "branch_name": "refs/heads/master", "committer_date": 1584658255000, "content_id": "911458adc3431f60663cf2b513e2a141e5422f34", "detected_licenses": [ "MIT" ], "directory_id": "79d02f88b0f29b5ecfcc918504035f54e3176614", "extension": "py", "fi...
2.890625
stackv2
""" This module contins utilities for parsing the Pardot API documentation and dumping the information to stdout. This can be used to populate the RESOURCE_OPERATIONS constant in constants.py """ import re import html import string from pprintpp import pprint import requests def get_resource_urls(): """ R...
103
29.05
76
18
709
python
[]
0
true
2024-11-19T02:31:44.555901+00:00
1,490,928,542,000
ecdbd005668f376343e80dbd0589c67fb72be4fe
3
{ "blob_id": "ecdbd005668f376343e80dbd0589c67fb72be4fe", "branch_name": "refs/heads/master", "committer_date": 1490928542000, "content_id": "6ac5af699e11a19b806be1b142fd2a7b38d016ca", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "d201cfaabee232d88c6507ed72b977c61b102e64", "extension": "p...
3.171875
stackv2
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: Queue Utils Created: 2017/1/3 """ import unittest import threading import time try: from queue import Empty except: from Queue import Empty #---------------------------------------------------------------------- def sync_dispatch(...
86
31.92
72
13
611
python
[]
0
true
2024-11-19T02:31:44.664370+00:00
1,599,214,248,000
96c01bd35cd22bfae6ed5303c089f5eb77c4af6e
2
{ "blob_id": "96c01bd35cd22bfae6ed5303c089f5eb77c4af6e", "branch_name": "refs/heads/master", "committer_date": 1599214248000, "content_id": "a7dd9b7f4d84de041d8c358631340873de9ebe7b", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "741f62b29a88e10758435c49caf07e56cd9dacfb", "extension": "p...
2.4375
stackv2
import torch import numpy as np from .miss_mec import MissMec class FactorizedMissMec(MissMec): def __init__(self, device, config_file, eps=1e-5): """ :param str config_file: configuration file path :param device: :param float eps: """ with open(config_file, 'r') a...
83
42.07
105
16
897
python
[]
0
true
2024-11-19T02:31:44.777074+00:00
1,495,827,794,000
7cb5cec6b3ec39015afc8c23e99cd830e501ee46
3
{ "blob_id": "7cb5cec6b3ec39015afc8c23e99cd830e501ee46", "branch_name": "refs/heads/master", "committer_date": 1495829900000, "content_id": "3be4876f502b875c7bdaab9560e602604667e40e", "detected_licenses": [ "MIT" ], "directory_id": "44f0260e24330d90891aa42180db5f42ad343817", "extension": "py", "fi...
2.78125
stackv2
#!/usr/bin/env python import socket import re HOST = 'localhost' PORT = 4080 def _handle_trial(data): m = re.match("^(ADD|SUBTRACT|MULTIPLY):([0-9a-fA-F]{32}):([0-9:-]+)", data) if not m: return None task = m.group(1) uuid = m.group(2) numbers = [int(n) for n in m.group(3).split(':')] if task == "ADD": r...
35
24.46
77
14
282
python
[]
0
true
2024-11-19T02:31:44.824492+00:00
1,580,757,844,000
13a255bc4b33d9542506d49d00c577abeb81950c
2
{ "blob_id": "13a255bc4b33d9542506d49d00c577abeb81950c", "branch_name": "refs/heads/master", "committer_date": 1580757844000, "content_id": "dd134ce8186e369035095541a8618c362cf8f9cc", "detected_licenses": [ "MIT", "Python-2.0" ], "directory_id": "fc1c1e88a191b47f745625688d33555901fd8e9a", "exten...
2.40625
stackv2
# -*- coding: utf-8 -*- """ meraki_sdk This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class Wan2Model(object): """Implementation of the 'Wan2' model. WAN 2 settings (only for MX devices) Attributes: wan_enabled (WanEnabledEnum): Enable o...
97
32.02
94
12
652
python
[]
0
true
2024-11-19T02:31:44.883538+00:00
1,558,074,219,000
924c7a0a43892edd88ebdbfd898a9fa644fc8a13
3
{ "blob_id": "924c7a0a43892edd88ebdbfd898a9fa644fc8a13", "branch_name": "refs/heads/master", "committer_date": 1558074219000, "content_id": "8b7aee5a5a3a88022db007a73b2ecc7ed0eeff9e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0531b458355185c06a0656fd24fc8530813ac037", "extension": "py"...
3.265625
stackv2
"""Actor-Critic using TD-error as the Advantage, Reinforcement Learning. Actor Critic History ---------------------- A3C > DDPG > AC Advantage ---------- AC converge faster than Policy Gradient. Disadvantage (IMPORTANT) ------------------------ The Policy is oscillated (difficult to converge), DDPG can solve this pr...
206
36.14
144
21
1,969
python
[]
0
true
2024-11-19T02:31:45.053387+00:00
1,464,416,788,000
1174b89334dfd6eca3550f73138064f464aa6eb1
3
{ "blob_id": "1174b89334dfd6eca3550f73138064f464aa6eb1", "branch_name": "refs/heads/master", "committer_date": 1464416788000, "content_id": "d007054bc2600898429a147934aebdb7b7a93e4e", "detected_licenses": [ "MIT" ], "directory_id": "d121ef13628c768efbc26e10d5f6421fdab553bd", "extension": "py", "fi...
2.609375
stackv2
import readline class autocomplete(object): def __init__(self, options): self.options = sorted(options) return def complete(self, text, state): response = None if state == 0: if text: self.matches = [s for s in self.options ...
49
23.02
65
17
255
python
[]
0
true
2024-11-19T02:31:45.162553+00:00
1,521,635,169,000
794acb4258b3ece0a847be85f1ebeac68cc9da48
3
{ "blob_id": "794acb4258b3ece0a847be85f1ebeac68cc9da48", "branch_name": "refs/heads/master", "committer_date": 1521635169000, "content_id": "11207aae10001c66f8c9601c0d41b5aec4e049d8", "detected_licenses": [ "MIT" ], "directory_id": "e34c6bc02609b4e11710cef5b753f65bb2844277", "extension": "py", "fi...
3.125
stackv2
import search class VacWorld(search.Problem): def actions(self, state): actions = [] if state["loc"] == "A": if state["A"] == "Dirty": actions.append("Suck") actions.append("Right") elif state["A"] == "Clean": actions.append(...
110
30.17
111
16
842
python
[]
0
true
2024-11-19T02:31:45.257432+00:00
1,536,571,544,000
62d8cb1b8edadf0b8f08ccd7759b03163045b92c
3
{ "blob_id": "62d8cb1b8edadf0b8f08ccd7759b03163045b92c", "branch_name": "refs/heads/master", "committer_date": 1536571544000, "content_id": "36b902edd1dceb15ce3ff26394a66acdfddb6e32", "detected_licenses": [ "MIT" ], "directory_id": "2f5502382977b15a0ad1f72dc1528cbe74922a1b", "extension": "py", "fi...
3.015625
stackv2
import numpy as np import math class alpine1: ''' Alpine1 function :param bounds: the box constraints to define the domain in which the function is optimized. :param sd: standard deviation, to generate noisy evaluations of the function. ''' def __init__(self, input_dim, bounds=None): ...
165
24.16
95
17
1,219
python
[]
0
true
2024-11-19T02:31:45.642843+00:00
1,611,140,158,000
ba6b531b4f2fafd5424705f12812b484911163c3
2
{ "blob_id": "ba6b531b4f2fafd5424705f12812b484911163c3", "branch_name": "refs/heads/master", "committer_date": 1611140158000, "content_id": "6ebca9fcaf142a0ee04614f3872f5bb621165f69", "detected_licenses": [ "MIT" ], "directory_id": "966d1bed7b05155919aa790cf2adcfb20a271d49", "extension": "py", "fi...
2.4375
stackv2
from flask import Flask,request import requests app = Flask(__name__) HOST = '127.0.0.1' PORT = '5000' @app.route('/upload', methods=['POST', 'GET']) def upload(): if request.method == 'POST': username = request.form['name'] print(username) status = request.form['pass'] print(st...
23
15.87
46
11
104
python
[]
0
true
2024-11-19T02:31:45.884551+00:00
1,513,201,398,000
51c29a45411b8c9c1585ea2ca2254883e51e7565
2
{ "blob_id": "51c29a45411b8c9c1585ea2ca2254883e51e7565", "branch_name": "refs/heads/master", "committer_date": 1513201398000, "content_id": "6888509511631ee4e7554ed447f13d4c0c3c92b8", "detected_licenses": [ "Apache-2.0" ], "directory_id": "b85cbf7a316f2f9f8e5d4913501e0ec14fb2efc7", "extension": "py"...
2.390625
stackv2
#!/usr/bin/env python import tensorflow as tf import time tf.flags.DEFINE_bool("use_tpu", True, "Use TPUs rather than plain CPUs") tf.flags.DEFINE_bool("use_sloppy", True, "Use sloppy=True in parallel_intereleave") tf.flags.DEFINE_bool("use_sloppy_interleave", True, "Use sloppy_interleave rather than interleave") tf....
61
51.8
136
17
727
python
[]
0
true
2024-11-19T02:31:45.985130+00:00
1,592,852,212,000
afcdbf0dc01fefc4695db1cd50b84f2a4e8f3be0
3
{ "blob_id": "afcdbf0dc01fefc4695db1cd50b84f2a4e8f3be0", "branch_name": "refs/heads/master", "committer_date": 1592852212000, "content_id": "2e471b15365998866b35b4e2b8b563ab11630843", "detected_licenses": [ "MIT" ], "directory_id": "db1b89c43fa3b9073f4e3af537638ac1358d8ad8", "extension": "py", "fi...
3.203125
stackv2
#!/usr/bin/python # -*- coding: utf-8 -*- # Daniel González Arribas (dangonza@ing.uc3m.es) import numpy as np G = 6.67384e-11 # Gravitational constant norm = np.linalg.norm def string_to_list(s): """Splits the input string by whitespace, returning a list of non-whitespace components Parameters ---...
306
31.74
117
22
2,666
python
[]
0
true
2024-11-19T02:31:46.228587+00:00
1,588,412,990,000
43e39d209e0f4d0efca23033c0f4d6ae6fb86f0f
3
{ "blob_id": "43e39d209e0f4d0efca23033c0f4d6ae6fb86f0f", "branch_name": "refs/heads/master", "committer_date": 1588413017000, "content_id": "d54329f2e6cafa59757518b9f60ffe25263305c9", "detected_licenses": [ "MIT" ], "directory_id": "ec456507b06aef9574829734163c6840411b3970", "extension": "py", "fi...
3.265625
stackv2
from ._utility import read_name, write_name, read_short, write_short class DnsRecord: def __new__(cls, *args, **kwargs): if cls is DnsRecord: raise Exception('Cannot instantiate abstract class {0}'.format(cls.__name__)) else: return super().__new__(cls) def __init__(self...
72
29.46
89
14
528
python
[]
0
true
2024-11-19T02:31:46.273412+00:00
1,603,972,014,000
4c0d755f26cb7e43b5536077294aa22a9a481f8a
4
{ "blob_id": "4c0d755f26cb7e43b5536077294aa22a9a481f8a", "branch_name": "refs/heads/master", "committer_date": 1603972014000, "content_id": "d017bc488e0015b289c14855068c4240b884bc8d", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "f37d6ef95723567daa95310ccc06586fcf9c3d14", "extension": "p...
3.515625
stackv2
import numpy as np class SixSigma (): '''Implementation of SixSigma method for anomaly detection. Six Sigma uses three standard deviations below the mean and three standard deviations above the mean to predict anomalies. Attributes: time_window : type int (default = 2) ...
52
26.87
107
20
295
python
[]
0
true
2024-11-19T02:31:46.387959+00:00
1,496,767,389,000
32134ba1991ea4793c2f91e3cc725b5351d4a9ea
3
{ "blob_id": "32134ba1991ea4793c2f91e3cc725b5351d4a9ea", "branch_name": "refs/heads/master", "committer_date": 1496767389000, "content_id": "4ecef16ad31b50dd44674a4a5a50c25ea4e0b453", "detected_licenses": [ "MIT" ], "directory_id": "f5ac7a06292e357c750b923f216dfaaee7011341", "extension": "py", "fi...
3.1875
stackv2
import pandas as pd import numpy as np # read csv ratings = pd.read_csv('app/movie_ratings.csv') def find_similar(df, id): """Find similarities between specific movie and dataset""" # user movie movie = df[id] # correlate with dataset similar = df.corrwith(movie).dropna() # group by movie i...
26
30.65
77
13
212
python
[]
0
true
2024-11-19T02:31:46.766308+00:00
1,610,788,327,000
ee2f0b076d07c36ec26a1503f2bc75e86f52a282
2
{ "blob_id": "ee2f0b076d07c36ec26a1503f2bc75e86f52a282", "branch_name": "refs/heads/master", "committer_date": 1610788327000, "content_id": "1a67e7aa68be175f45866e5edfdfae5672f7e1b5", "detected_licenses": [ "Apache-2.0" ], "directory_id": "6185292fdf7f40fade89c6c4fed50b21f56749f6", "extension": "py"...
2.390625
stackv2
from ..remote import RemoteModel from infoblox_netmri.utils.utils import check_api_availability class DeviceRouteRemote(RemoteModel): """ The routing table entries for each device. | ``DataSourceID:`` The internal NetMRI identifier for the collector NetMRI that collected this data record. | ``attr...
140
34.59
155
14
1,128
python
[]
0
true
2024-11-19T02:31:47.733487+00:00
1,614,033,453,000
11fc46a52139ddfe29b3a1553191933227ff9f36
3
{ "blob_id": "11fc46a52139ddfe29b3a1553191933227ff9f36", "branch_name": "refs/heads/master", "committer_date": 1614033531000, "content_id": "7d3e6a8dfae53c09efbfec3845c3c3f3742e6ff4", "detected_licenses": [ "Apache-2.0" ], "directory_id": "17bbfe96bc39cdca799cb08ad04aa2f381fcad26", "extension": "py"...
2.703125
stackv2
import collections from dataclasses import dataclass from typing import List import torch from detectron2.structures import Boxes, Instances @dataclass class Schema: """ A Schema defines how to flatten a possibly hierarchical object into tuple of primitive objects, so it can be used as inputs/outputs of ...
173
30.29
98
18
1,218
python
[]
0
true
2024-11-19T02:31:48.220130+00:00
1,568,873,011,000
46b0b1f50661a84173e2a3ee38063ebe8c9dd521
3
{ "blob_id": "46b0b1f50661a84173e2a3ee38063ebe8c9dd521", "branch_name": "refs/heads/master", "committer_date": 1568873011000, "content_id": "b5df9e6618e6546f8650d7d5d3df7437ed478342", "detected_licenses": [ "MIT" ], "directory_id": "0102f9fb2b454be416e7cda805a59f8b053a7ada", "extension": "py", "fi...
2.734375
stackv2
import cv2 import numpy as np import argparse import math import OpenEXR, Imath def load_exr(in_file): pt = Imath.PixelType(Imath.PixelType.FLOAT) golden = OpenEXR.InputFile(in_file) dw = golden.header()['dataWindow'] size = (dw.max.x - dw.min.x + 1, dw.max.y - dw.min.y + 1) redstr = golden.channe...
56
30.55
87
12
544
python
[]
0
true
2024-11-19T02:31:48.394053+00:00
1,545,960,995,000
37a5a018db12f0dbf80163ff767301676367f36c
2
{ "blob_id": "37a5a018db12f0dbf80163ff767301676367f36c", "branch_name": "refs/heads/master", "committer_date": 1545960995000, "content_id": "06eff01829b7501bc09aaabfd6e3c07d4f610137", "detected_licenses": [ "Apache-2.0" ], "directory_id": "f7230609f47bc5e479fc1eb2c3a12f81310f565f", "extension": "py"...
2.3125
stackv2
# -*- coding: utf-8 -*- import sys import os import pickle import argparse import itertools import math import random import shutil import cv2 from tqdm import tqdm import pandas as pd import numpy as np import SimpleITK as sitk from skmultilearn.model_selection import iterative_train_test_split from skmultilearn.mode...
258
30.73
146
20
1,814
python
[{"finding_id": "codeql_py/clear-text-storage-sensitive-data_e54fd24a8a9bbc7d_62d02109", "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 (private)](1) as clear text.",...
2
true
2024-11-19T02:31:48.445875+00:00
1,635,816,189,000
f78e6f367393c2b302fad874ddeafcd332d29c50
2
{ "blob_id": "f78e6f367393c2b302fad874ddeafcd332d29c50", "branch_name": "refs/heads/master", "committer_date": 1635816189000, "content_id": "58efb0d9d03b739610660f00ff6a2d7e7aa7db0f", "detected_licenses": [ "CC0-1.0", "MIT" ], "directory_id": "be4e6f6aa058e45b4f08732b3d502a676d4428c1", "extensio...
2.390625
stackv2
import os import random import torch import requests import json import zipfile ## Download json file cc0_tex_dir = '../cc0_textures' json_fpath = os.path.join(cc0_tex_dir, 'cc0_textures_full_json.json') headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103....
66
31.3
133
14
569
python
[]
0
true
2024-11-19T02:31:49.473974+00:00
1,588,510,808,000
122585ed62eaf9bc7c6b8774cf4d7f70c7e5feaf
2
{ "blob_id": "122585ed62eaf9bc7c6b8774cf4d7f70c7e5feaf", "branch_name": "refs/heads/master", "committer_date": 1588510808000, "content_id": "fa689298041b9860f491c3808ccf90c66a36ff60", "detected_licenses": [ "MIT" ], "directory_id": "e5490904f32f5952005dd73834a60f833bd3317c", "extension": "py", "fi...
2.390625
stackv2
import datetime from docxtpl import DocxTemplate, InlineImage from docx.shared import Cm import csv import json t_start = datetime.datetime.now() def age_years(date_brth): z = [1904, 1908, 1912, 1916, 1920, 1924, 1928, 1932, 1936, 1940, 1944, 1948, 1952, 1956, 1960, 1964, 1968, 1972, 1976, 1980, 1984, 1988, 1...
84
36.2
116
16
1,125
python
[]
0
true
2024-11-19T02:31:49.578304+00:00
1,448,053,284,000
87ed57bfc06c0db4d5c551a32111932d3e8d2b6c
2
{ "blob_id": "87ed57bfc06c0db4d5c551a32111932d3e8d2b6c", "branch_name": "refs/heads/master", "committer_date": 1448053341000, "content_id": "f897c94dcf7824fe38b1f0730ae36de11cb32253", "detected_licenses": [ "MIT" ], "directory_id": "2af777328b5af158d26e5bebfb84ceeddb907f6f", "extension": "py", "fi...
2.390625
stackv2
#!/usr/bin/env python from pyfann import libfann from nnot_params import * connection_rate = 1 learning_rate = 0.7 num_hidden = max(5, min(100, (gridDim[0] + gridDim[1]) / 2)) desired_error = 0.0005 max_iterations = 100000 iterations_between_reports = 200 nn_file = "objtrack.net" ...
44
25.52
92
12
319
python
[]
0
true
2024-11-19T02:31:49.628345+00:00
1,565,922,072,000
dd07a5aecb9fbc791331baebc310a4a28846cbdf
3
{ "blob_id": "dd07a5aecb9fbc791331baebc310a4a28846cbdf", "branch_name": "refs/heads/master", "committer_date": 1565922072000, "content_id": "5d1d02b5a9d46f13bbac541d1d63f219c6aeff53", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "1884ee092b28b2a61747968134ca80ee815ecfbb", "extension": "p...
2.53125
stackv2
""" These types are wrappers to FreeType structs not currently supported in freetype-py as of v2.1.0.post1. Code conventions for this file follow those of freetype-py for possible inclusion in future PR. Structs are documented at https://www.freetype.org/freetype2/docs/reference/ft2-multiple_master...
89
36.38
90
10
756
python
[]
0
true
2024-11-19T02:31:49.934241+00:00
1,620,420,964,000
c74275d7f17da7bfdd57f9983df09943e3a7981f
2
{ "blob_id": "c74275d7f17da7bfdd57f9983df09943e3a7981f", "branch_name": "refs/heads/master", "committer_date": 1620420964000, "content_id": "b8c4b1e44ecaf2e6e7fce9ef8dd4b4a6fd444a9a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "4da3cd30f0b606621bf903e1db67e425671a2fca", "extension": "py"...
2.453125
stackv2
from gitcd.interface.cli.abstract import BaseCommand from gitcd.git.branch import Branch class Finish(BaseCommand): def run(self, branch: Branch): remote = self.getRemote() testBranch = self.config.getTest() masterBranch = self.config.getMaster() if branch.getName() == masterBra...
49
32.8
77
20
296
python
[]
0
true
2024-11-19T02:31:49.976004+00:00
1,597,710,554,000
e219389e9b3af405afecae7848a2091ce9c501c6
3
{ "blob_id": "e219389e9b3af405afecae7848a2091ce9c501c6", "branch_name": "refs/heads/master", "committer_date": 1597710554000, "content_id": "2770064c8e9fe137295e336aa25a53b3967fafc6", "detected_licenses": [ "MIT" ], "directory_id": "392546e98b7f6bc1d31d454024f7913135ad32d1", "extension": "py", "fi...
2.65625
stackv2
import subprocess import logging import pty import os import sys def highlight(string): prefix = "\033[32m" return prefix + string + "\033[m" def de_ret(line): thelist = [] index = 0 for char in line: if char == "\r": index = 0 continue if index == len(thel...
51
22.25
61
14
288
python
[]
0
true
2024-11-19T02:31:50.164915+00:00
1,600,852,280,000
789d1bf7af3549bcb5525aae53773a9b42527877
3
{ "blob_id": "789d1bf7af3549bcb5525aae53773a9b42527877", "branch_name": "refs/heads/master", "committer_date": 1600852280000, "content_id": "359db9fea85f2c6902d2eb19d98b29a30c9d37b1", "detected_licenses": [ "Apache-2.0" ], "directory_id": "1050b1351f419241aeac5ab64a1acd2f3499c9e9", "extension": "py"...
2.9375
stackv2
""" Common basic modules """ import torch.nn as nn import torch.nn.functional as F class ConvBlock(nn.Module): """ Basis convolutional layer with leaky relu """ def __init__(self, in_channels, out_channels, kernel_size=3, stride=2, padding=1): super(ConvBlock, self).__init__() self.co...
62
28.73
113
13
485
python
[]
0
true
2024-11-19T02:31:50.218337+00:00
1,519,759,649,000
8cb0bb60f2f61f72558dadd92370d6bdb4e3d38a
2
{ "blob_id": "8cb0bb60f2f61f72558dadd92370d6bdb4e3d38a", "branch_name": "refs/heads/master", "committer_date": 1519759649000, "content_id": "342cb83873832987720ce9d830fbc159a7fbcd84", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "aace3933448965ed044d3f34ce153edcbd29a77c", "extension": "p...
2.359375
stackv2
import argparse import os from tensorflowFiles.GeneratePointCloud import generate from tensorflowFiles.predict import predict def main(): # Parse arguments parser = argparse.ArgumentParser() parser.add_argument('model_path', help='Converted parameters for the model') parser.add_argument('image_paths'...
24
21.83
80
9
114
python
[]
0
true
2024-11-19T02:31:50.391153+00:00
1,392,214,891,000
125f9339bfa36f543b6cf1d96eab576d57f3db51
3
{ "blob_id": "125f9339bfa36f543b6cf1d96eab576d57f3db51", "branch_name": "refs/heads/master", "committer_date": 1392214891000, "content_id": "52a260ada8c0849d7dd498bdd29f664123d59381", "detected_licenses": [ "MIT" ], "directory_id": "20228bec324a6b8e9d85f33b219c594c9b3d5bbe", "extension": "py", "fi...
2.59375
stackv2
import datetime import logging import json import re import subprocess import sys import traceback logging.basicConfig(level=logging.DEBUG) log = logging.getLogger() def _query_tutor(command_parameters): """ :param command_parameters: :return: the json-parsed output of the tutor command """ comma...
195
33.41
116
20
1,510
python
[]
0
true
2024-11-19T02:31:50.910670+00:00
1,578,431,451,000
5b98bb2f037f3087a14f33a71071f3f1f2949edc
2
{ "blob_id": "5b98bb2f037f3087a14f33a71071f3f1f2949edc", "branch_name": "refs/heads/master", "committer_date": 1578431451000, "content_id": "c91c5b10a93cd614b70f2105ac57713e1a7faee3", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5a5c984947f2de470f5c5276e448b38bcfe87a8e", "extension": "py"...
2.4375
stackv2
# Name: login.py (Login response in python) # Project: Fasten Your Seatbelts (FYS) # Creation date: 4-12-2019 # Author: Trisna Quebe ic106-2 # Taken from older version: wsgi.py by Trisna import mysql.conne...
267
35.85
100
14
2,686
python
[]
0
true
2024-11-19T02:31:50.978057+00:00
1,674,827,037,000
60940181d7f28db59a1b60c79feeafb47706d29f
2
{ "blob_id": "60940181d7f28db59a1b60c79feeafb47706d29f", "branch_name": "refs/heads/master", "committer_date": 1674827037000, "content_id": "2e5717ce9412bffbe212312f8fe5f813c231c615", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d17f030ad4daba95a75e0a949eb2c72c31b1e33b", "extension": "py"...
2.3125
stackv2
from copy import copy from hca_ingest.api.ingestapi import IngestApi from hca_ingest.template.schema_template import SchemaTemplate from hca_ingest.template.vanilla_spreadsheet_builder import VanillaSpreadsheetBuilder from hca_ingest.template.tab_config import TabConfig from broker.service.spreadsheet_generation impo...
375
41.89
171
24
3,270
python
[]
0
true
2024-11-19T02:31:51.162169+00:00
1,417,185,757,000
e6c1c9ccf454556feca54d7c96c59448f3ad5800
2
{ "blob_id": "e6c1c9ccf454556feca54d7c96c59448f3ad5800", "branch_name": "refs/heads/master", "committer_date": 1417185757000, "content_id": "a475b70a7c11348ae5952637b0bc0e3cb84f2242", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5aa5bfc9464d7b75eec58af0d5af8d29789b5906", "extension": "py"...
2.421875
stackv2
import subprocess import pcap import dpkt import socket import os from packet import Packet from utils.time import TimeUtils from utils.path import list_files def parse_pcap(pcap_file, filters=''): pcap_obj = pcap.pcap(pcap_file) if filters != '': pcap_obj.setfilter(filters) for ts, pkt in pcap_o...
59
31.66
102
12
520
python
[]
0
true
2024-11-19T02:31:51.273456+00:00
1,532,175,833,000
34fa7d41adad30a2d2a8338f9d3060a0038fbe33
2
{ "blob_id": "34fa7d41adad30a2d2a8338f9d3060a0038fbe33", "branch_name": "refs/heads/master", "committer_date": 1532175833000, "content_id": "74a388f45d85d280e83ada3f425d92fe6d001495", "detected_licenses": [ "Apache-2.0" ], "directory_id": "26e28f9bc9b076cbcde41589175c6cfbe54571fe", "extension": "py"...
2.421875
stackv2
import numpy as np import theano as theano import theano.tensor as T from Evaluate import * class RNNtheano: def __init__(self, user_dim=30, poi_dim=30, hidden_dim=13, top_K=10, regu_para=0.0001, num_user=5000, num_poi=100000): # Assign instance variables self.user_dim = user_dim ...
130
46.62
130
20
1,476
python
[]
0
true
2024-11-19T02:31:51.390189+00:00
1,505,961,427,000
a336340212c9c56bf88f0b148e468d8705423189
2
{ "blob_id": "a336340212c9c56bf88f0b148e468d8705423189", "branch_name": "refs/heads/master", "committer_date": 1505961427000, "content_id": "82f9ec5b81a4050f47e2c64da9ee02cf9a5917da", "detected_licenses": [ "MIT" ], "directory_id": "33b7b563f519327411ca5b9a153d5e4292f8f138", "extension": "py", "fi...
2.390625
stackv2
from job_progress import states def fail_staled_jobs(session): """Mark staled jobs as FAILURE. Staled definition is controlled through ``heartbeat_expiration``. """ jobs = session.query(is_ready=False) for job in jobs: if job.is_staled: job.state = states.FAILURE def cleanu...
30
20.1
69
11
139
python
[]
0
true
2024-11-19T02:31:52.544999+00:00
1,618,853,804,000
5cf04a96dd42b2ff903fe16c4e1e6105167d4450
3
{ "blob_id": "5cf04a96dd42b2ff903fe16c4e1e6105167d4450", "branch_name": "refs/heads/master", "committer_date": 1618853804000, "content_id": "4a36c53f5ecc5effceef30ec2bec45a019153871", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c3c3cddf6232f35739054dfafa08c7610fc97552", "extension": "p...
2.578125
stackv2
# This file is part of the Pattern and Anomaly Detection Library (openclean_pattern). # # Copyright (C) 2021 New York University. # # openclean_pattern is released under the Revised BSD License. See file LICENSE for # full license details. """Collector class which clusters similar tokens and returns the clusters""" f...
283
34.51
126
19
2,227
python
[]
0
true
2024-11-19T02:31:52.662309+00:00
1,644,468,051,000
2d19d046ead7a53642fc7886e7ff131f5a492787
2
{ "blob_id": "2d19d046ead7a53642fc7886e7ff131f5a492787", "branch_name": "refs/heads/master", "committer_date": 1644468051000, "content_id": "810b6d333e84303a5ba46263f6c835b0fac0d98e", "detected_licenses": [ "MIT" ], "directory_id": "f52d7616dbf9781bf3c525ab4e5b778f660e278b", "extension": "py", "fi...
2.40625
stackv2
from __future__ import absolute_import import json from createsend.createsend import CreateSendBase from createsend.utils import json_to_py class Campaign(CreateSendBase): """Represents a campaign and provides associated functionality.""" def __init__(self, auth=None, campaign_id=None): self.campai...
193
43.52
105
13
1,816
python
[]
0
true
2024-11-19T02:31:52.728246+00:00
1,581,086,606,000
63dafc8e26cf836fd0bf33d9a7630c117169128f
4
{ "blob_id": "63dafc8e26cf836fd0bf33d9a7630c117169128f", "branch_name": "refs/heads/master", "committer_date": 1581086606000, "content_id": "65e9a9d829cb3d5288e7259c3b2ff5eb6ab8ef39", "detected_licenses": [ "MIT" ], "directory_id": "e7e31e62978878a028b909c62948f97469b6e2eb", "extension": "py", "fi...
3.5625
stackv2
import tkinter as tk # helpful for GUI: http://newcoder.io/gui/part-3 # https://www.youtube.com/watch?v=jE-SpRI3K5g&list=PLDyQo7g0_nsULCDha3lv7rw2t6AnhNTHV&index=4 # https://stackoverflow.com/questions/17466561/best-way-to-structure-a-tkinter-application/17470842 class Sudoku_GUI: def __init__(self, win_HT=800, wi...
61
29.05
99
12
479
python
[]
0
true
2024-11-19T02:31:53.093737+00:00
1,646,602,405,000
afb13f02879c0e3d5ec1381525869f546a2e0d5a
3
{ "blob_id": "afb13f02879c0e3d5ec1381525869f546a2e0d5a", "branch_name": "refs/heads/main", "committer_date": 1646602405000, "content_id": "0a7b326a9f2eb33a776b2111c042271881354651", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "02245c4d166f01dd769c25c313234b49e19d5506", "extension": "py"...
2.84375
stackv2
#!/usr/bin/env python """This example outputs a user's list of trophies. This program demonstrates the use of ``asyncprawcore.ReadOnlyAuthorizer`` that does not require an access token to make authenticated requests to Reddit. """ import asyncio import os import sys import asyncprawcore async def main(): """P...
49
28.31
89
17
323
python
[]
0
true
2024-11-19T02:31:53.197246+00:00
1,535,283,305,000
2d4a54d612b57123a5ab2c59a4faf395d276b57b
2
{ "blob_id": "2d4a54d612b57123a5ab2c59a4faf395d276b57b", "branch_name": "refs/heads/master", "committer_date": 1535283305000, "content_id": "7df166ec2330419fae82ea7e4d398fb8b9ef467a", "detected_licenses": [ "MIT" ], "directory_id": "efb37b5bc774138cb2f55e664bcc0c4642a4ebe9", "extension": "py", "fi...
2.34375
stackv2
import getpass import os import requests from datetime import datetime from textwrap import dedent from pathlib import Path from pythonanywhere.exceptions import SanityException from pythonanywhere.snakesay import snakesay PYTHON_VERSIONS = { '2.7': 'python27', '3.4': 'python34', '3.5': 'python35', '...
176
32.52
117
18
1,237
python
[]
0
true
2024-11-19T02:31:53.373775+00:00
1,480,600,293,000
96d0f563fd0e3fdd51b56499dce01b5513379bc0
3
{ "blob_id": "96d0f563fd0e3fdd51b56499dce01b5513379bc0", "branch_name": "refs/heads/master", "committer_date": 1480600293000, "content_id": "44f374e9ab8d455c8528a6d6909a071e73ffcbbe", "detected_licenses": [ "MIT" ], "directory_id": "d0288e216610c6fd8c32052694bfb5438f328006", "extension": "py", "fi...
2.84375
stackv2
from pymono.models.Cell import Cell from pymono.lib.popup import PopupBuilder class PenaltyCell(Cell): def __init__(self, name, amount): super().__init__(name) self.amount = amount def on_step(self, board_ctrl, on_end): def on_close_click(purchase_popup): purchase_popup...
29
26.55
66
20
184
python
[]
0
true
2024-11-19T02:31:53.430279+00:00
1,631,480,257,000
56f4a1e267e062e34279c4cbd02a7a2f74726a8b
3
{ "blob_id": "56f4a1e267e062e34279c4cbd02a7a2f74726a8b", "branch_name": "refs/heads/master", "committer_date": 1631480257000, "content_id": "9367487820578353207887c2a8c66a3fb5eb4d33", "detected_licenses": [ "MIT" ], "directory_id": "618749cffe737fb0e716dc7ce86c4d7ef765d267", "extension": "py", "fi...
2.546875
stackv2
# -*- coding: utf-8 -*- # Copyright 2018-2021 by Boris Feld import logging VERBOSE_LOG_FORMAT = "[%(asctime)s] %(pathname)s:%(lineno)d: %(message)s" def setup_logging(verbose=False, debug=False): logger = logging.getLogger("balto") logger.propagate = False logger.setLevel(logging.DEBUG) # Reset h...
29
22.38
73
11
150
python
[]
0
true
2024-11-19T02:31:53.563681+00:00
1,586,657,718,000
1743966b0a78c2c2bf5f746280db7d53a4627a60
3
{ "blob_id": "1743966b0a78c2c2bf5f746280db7d53a4627a60", "branch_name": "refs/heads/master", "committer_date": 1586657718000, "content_id": "3ca8c668ccf93f3df1ff6d60849ddce9625e590b", "detected_licenses": [ "ISC" ], "directory_id": "c5b7c53277800aa02faa5db22d79ae788d3142f3", "extension": "py", "fi...
2.578125
stackv2
from lib.widget import Fullscreen, Printable, TextBox class Wallpaper(Fullscreen): pass class Effect (Fullscreen): def _handler(self): self._callback = self._idle def _idle(self): pass def _blinker(self): if self._display_art == '': self.show() else:...
73
31.45
104
14
552
python
[]
0
true
2024-11-19T02:31:53.907120+00:00
1,625,163,688,000
3b2c47abc8ff04b6bbb4ebfa2dcb565ee398d7be
3
{ "blob_id": "3b2c47abc8ff04b6bbb4ebfa2dcb565ee398d7be", "branch_name": "refs/heads/main", "committer_date": 1625163688000, "content_id": "f8cb0b94ccf26ee1573a3c6810d2a6e1f0d336a9", "detected_licenses": [ "MIT" ], "directory_id": "75f99a1a3f790119bdc3665f6912ac482494eb96", "extension": "py", "file...
2.578125
stackv2
from principal_DNN_MNIST import * import matplotlib.pyplot as plt import tensorflow as tf import numpy as np # Reloading modules just in case if __name__ == "__main__" : (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data(path="mnist.npz") data_mnist = scale_and_read_img(x_train) test_...
170
43.82
126
14
2,186
python
[]
0
true
2024-11-19T02:31:53.967786+00:00
1,549,730,300,000
fbb7874bbbeac79bee19a73084900db661d3ce57
4
{ "blob_id": "fbb7874bbbeac79bee19a73084900db661d3ce57", "branch_name": "refs/heads/master", "committer_date": 1549730300000, "content_id": "84efc17370fe9cbc74ab8fd4afaedd21567d98d1", "detected_licenses": [ "Apache-2.0" ], "directory_id": "3fece069d73b431484fb8108e259d7904212d8cd", "extension": "py"...
3.875
stackv2
# -*- coding: utf-8 -*- import math def fibonacci(n): if n == 0 or n == 1: return n else: return fibonacci(n - 1) + fibonacci(n - 2) def fibonacci2(n): if n < 2: return n else: x, y = 1, 0 for i in range(2, n + 1): x, y = y, x x = x + y...
59
22.17
64
12
478
python
[]
0
true
2024-11-19T02:31:54.383332+00:00
1,687,281,129,000
10360753462db76e0b77d94484128187bd8ce4a4
2
{ "blob_id": "10360753462db76e0b77d94484128187bd8ce4a4", "branch_name": "refs/heads/main", "committer_date": 1687281129000, "content_id": "1bb48749e6d1634e74fdbf8d81dd8a72a5474617", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "ab87d15cfe5f7c8f2eb95921b8a39a7d96e7f7af", "extension": "py"...
2.484375
stackv2
import os import re import argparse def combine_all_mdl_files(sys): output_file = "training.txt" head,tail = os.path.split(sys) allfile = open(os.path.join(head,output_file),"w") cnt = 0 for file in os.listdir(sys): print(cnt) with open(os.path.join(sys,file),'r') as f: #print(f.read()) result = f.read(...
28
30.86
96
15
223
python
[]
0
true
2024-11-19T02:31:54.428843+00:00
1,664,846,979,000
3765c61319bfbc2e829effb4442d5c9a15456996
4
{ "blob_id": "3765c61319bfbc2e829effb4442d5c9a15456996", "branch_name": "refs/heads/master", "committer_date": 1664846979000, "content_id": "e76c63c8882de49cecdd60a4c1360b50b1b39d25", "detected_licenses": [ "MIT" ], "directory_id": "c6a101547c2b7f36fe83a725974a8a7f02cf176d", "extension": "py", "fi...
4.40625
stackv2
# Given a tree, print all the full nodes of it # A full node is such that both its children are present class Node: def __init__(self, val): self.val = val self.right = None self.left = None def print_full(root): if not root: return if root.left and root.right: pr...
30
17.4
56
11
146
python
[]
0
true
2024-11-19T02:31:54.490426+00:00
1,569,064,111,000
08dd54f9fdca9fc5a4ec1c64e30304f26b3fa117
3
{ "blob_id": "08dd54f9fdca9fc5a4ec1c64e30304f26b3fa117", "branch_name": "refs/heads/master", "committer_date": 1569064111000, "content_id": "718348e071cb919e0818f6ad80d3722a7729e596", "detected_licenses": [ "MIT" ], "directory_id": "0755df4db0f976d24f31f75696724554bb9e92fc", "extension": "py", "fi...
2.625
stackv2
import requests import time from requests import ConnectionError as rConnectionError import logging class Connect: @classmethod def request(cls, url, max_repeat=1): res = None for i in range(max_repeat): try: res = requests.get(url) break ...
20
25.1
57
20
106
python
[]
0
true
2024-11-19T02:31:54.633410+00:00
1,677,918,035,000
6054d74cd43c35a932f22eaee2b9dbef79ca55d9
3
{ "blob_id": "6054d74cd43c35a932f22eaee2b9dbef79ca55d9", "branch_name": "refs/heads/main", "committer_date": 1677918035000, "content_id": "6aa3b1412e3156e455704ff2a24ffaf034ba321d", "detected_licenses": [ "MIT" ], "directory_id": "2829825dc7e4d118e37e76924af9355983b02283", "extension": "py", "file...
3.09375
stackv2
from abaqusConstants import * from .MohrCoulombHardening import MohrCoulombHardening from .TensionCutOff import TensionCutOff class MohrCoulombPlasticity: """The MohrCoulombPlasticity object specifies the extended Mohr-Coulomb plasticity model. Notes ----- This object can be accessed by: .. code...
97
30.89
98
10
749
python
[]
0
true
2024-11-19T02:31:54.743570+00:00
1,548,950,401,000
d680e52167c21ae2665c124508cb992f209d12eb
2
{ "blob_id": "d680e52167c21ae2665c124508cb992f209d12eb", "branch_name": "refs/heads/master", "committer_date": 1548950401000, "content_id": "3711c7cff509ba831a69748fe8cab9c30866cd7a", "detected_licenses": [ "MIT" ], "directory_id": "97a675217ca46f5193c6b8ddb9264dbb1e9337db", "extension": "py", "fi...
2.390625
stackv2
#@ File (label = "Input directory", style = "directory") srcFile #@ String (label = "File extension", value=".dv") ext #@ Integer (label = "Number of beads", value=10) beads #@ Float (label = "Correction Factor (x)", value=1.186) corr_factor_x #@ Float (label = "Correction Factor (y)", value=1.186) corr_factor_y...
222
29.5
166
21
1,894
python
[]
0
true
2024-11-19T02:31:54.804857+00:00
1,580,973,363,000
23bfcb8a72ea7025d2ae2b32e812e0666a9998a1
3
{ "blob_id": "23bfcb8a72ea7025d2ae2b32e812e0666a9998a1", "branch_name": "refs/heads/master", "committer_date": 1580973363000, "content_id": "af015baacb1309797071e288157cf868aac53905", "detected_licenses": [ "Apache-2.0" ], "directory_id": "7c17ee1ccf295820f1dd1171577c5c137b99c1bc", "extension": "py"...
2.53125
stackv2
from model.data_utils import CoNLLDataset from model.keras_model import Word_BLSTM from model.keras_blstm_crf import BLSTMCRF from model.config import Config from keras.models import load_model def main(): # create instance of config config = Config() # build model model = BLSTMCRF(config) # Word_BL...
44
27.25
94
10
295
python
[]
0
true
2024-11-19T02:31:54.861408+00:00
1,429,974,480,000
e79a3d2ccbc9c4a4cb7836c75b27d6e865d105b2
2
{ "blob_id": "e79a3d2ccbc9c4a4cb7836c75b27d6e865d105b2", "branch_name": "refs/heads/master", "committer_date": 1429974480000, "content_id": "4480933d9d6e8c8e048fabf02387fffd6e5db2cc", "detected_licenses": [ "Apache-2.0" ], "directory_id": "bdef7f2529cc5306633f0f901b51d3aef870dd4b", "extension": "py"...
2.4375
stackv2
#!/usr/bin/env python import argparse import sqlite3 import yaml from tempmon import db parser = argparse.ArgumentParser() parser.add_argument('infile') parser.add_argument('outfile') args = parser.parse_args() print('Setting up database %s' % args.outfile) conn, ignore = db.open_db(args.outfile) print('Reading i...
27
24.04
85
11
166
python
[]
0
true
2024-11-19T02:31:55.092168+00:00
1,591,906,842,000
a1fef5379335bfc23d099af008427fc6aa568dee
4
{ "blob_id": "a1fef5379335bfc23d099af008427fc6aa568dee", "branch_name": "refs/heads/master", "committer_date": 1591906858000, "content_id": "fc610724e5d1697016c8325a8a82fef51eecba45", "detected_licenses": [ "MIT" ], "directory_id": "8c62f5ba18e932cedc7a3ef50e9e9533921ad582", "extension": "py", "fi...
4.40625
stackv2
# Python program to detect cycle in a graph """ Depth First Traversal can be used to detect a cycle in a Graph. DFS for a connected graph produces a tree. There is a cycle in a graph only if there is a back edge present in the graph. A back edge is an edge that is from a node to itself (self-loop) or one of its ancesto...
76
33.14
79
14
622
python
[]
0
true
2024-11-19T02:31:55.315303+00:00
1,596,555,946,000
dd8ce57540c86fe510dffbfda1632bed2076db55
4
{ "blob_id": "dd8ce57540c86fe510dffbfda1632bed2076db55", "branch_name": "refs/heads/master", "committer_date": 1596555946000, "content_id": "6e456dfb95ab032e2377f753e4711ead5b386426", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "7be2397ccb3cee0f2acc24081934e0ecb146115f", "extension": "p...
3.53125
stackv2
# 给定一个二维的矩阵,包含 'X' 和 'O'(字母 O)。 # # 找到所有被 'X' 围绕的区域,并将这些区域里所有的 'O' 用 'X' 填充。 # # 示例: # # X X X X # X O O X # X X O X # X O X X # # # 运行你的函数后,矩阵变为: # # X X X X # X X X X # X X X X # X O X X # # # 解释: # # 被围绕的区间不会存在于边界上,换句话说,任何边界上的 'O' 都不会被填充为 'X'。 任何不在边界上,或不与边界上的 'O' 相连的 'O' 最终都会被 # 填充为 'X'。如果两个元素...
82
23.73
80
16
739
python
[]
0
true
2024-11-19T02:31:55.590192+00:00
1,581,532,178,000
3dffd4d8937cf4f2f2567922fad003b0c1aae845
3
{ "blob_id": "3dffd4d8937cf4f2f2567922fad003b0c1aae845", "branch_name": "refs/heads/master", "committer_date": 1581532178000, "content_id": "86c58eac495803ca661554b5bb4d27d50142cb21", "detected_licenses": [ "MIT" ], "directory_id": "f5ba4b4c9ea824abf24af0b87e50af994a80a8b7", "extension": "py", "fi...
3.109375
stackv2
""" Example 13a_ode_single_ver_a Solving a single ODE for a level tank charles stanier charles.stanier@gmail.com Oct 2, 2019 simple version - everything hard coded, derivative function and driver in same file constants hard-coded into derivative file note: I am using solve_ivp (solve initial value problem) which is...
96
26.88
91
10
871
python
[]
0
true
2024-11-19T02:31:55.648305+00:00
1,633,047,648,000
153f4fc87685494b64baff61b048af73596a1116
3
{ "blob_id": "153f4fc87685494b64baff61b048af73596a1116", "branch_name": "refs/heads/main", "committer_date": 1633047648000, "content_id": "ac71e6060b60adcf480e1864018ff1a57fa5d8b8", "detected_licenses": [ "MIT" ], "directory_id": "530ff1bf5dcd2427f9dbd12921cab43f464e5f62", "extension": "py", "file...
2.71875
stackv2
#!/usr/bin/env python """Demonstrates graph visualization with Graphviz.""" import logging import numpy as np import shutil import subprocess import pytato as pt logger = logging.getLogger(__name__) GRAPH_DOT = "graph.dot" GRAPH_SVG = "graph.svg" def main(): n = pt.make_size_param("n") array = pt.make_p...
41
22.49
83
11
248
python
[]
0
true
2024-11-19T02:31:55.698855+00:00
1,689,230,611,000
623421971bc04a337276984d2d8d8fa87365d92b
4
{ "blob_id": "623421971bc04a337276984d2d8d8fa87365d92b", "branch_name": "refs/heads/master", "committer_date": 1689230611000, "content_id": "b8d1cd5f2a21a7dd37b8c1cfb7a60407d058557f", "detected_licenses": [ "MIT" ], "directory_id": "5c3d487c1f48e33c507a8aca1c2fc178cf95e17f", "extension": "py", "fi...
3.5625
stackv2
#!/usr/bin/env python3 class Solution(object): def uniquePaths(self, m, n): """ :type m: int :type n: int :rtype: int """ num, den = 1, 1 for i in range(0, m-1): num *= (n+i) den *= (i+1) return num // den def uniquePaths2...
23
20.96
36
12
158
python
[]
0
true
2024-11-19T02:31:55.805423+00:00
1,650,825,473,000
7b6b0ef31ab947a950e96d70fb245ae2bc43cfcb
3
{ "blob_id": "7b6b0ef31ab947a950e96d70fb245ae2bc43cfcb", "branch_name": "refs/heads/master", "committer_date": 1650825473000, "content_id": "c7747b5cfb8e69a275a5560ef621f53b7d54e644", "detected_licenses": [ "MIT" ], "directory_id": "9d4d6d9f5eebe8205c29ea2ea07b306f9d4fb558", "extension": "py", "fi...
2.828125
stackv2
import numpy as np import pandas as pd import time import matplotlib.pyplot as plt import seaborn as sns import os import sys import random from bayes_opt import BayesianOptimization from pprint import pprint import json sns.set() file = sys.argv[1] df = pd.read_csv(file) df.head() df0 = df.iloc[:503,:] df1 = df.ilo...
298
32.38
108
20
2,284
python
[]
0
true
2024-11-19T02:31:55.995927+00:00
1,611,516,369,000
0b2af0f7e355640377b129ad13d37d4b50cd7997
3
{ "blob_id": "0b2af0f7e355640377b129ad13d37d4b50cd7997", "branch_name": "refs/heads/main", "committer_date": 1611516369000, "content_id": "d2a6d40dac3dc36f36ad850a6ef54aac6fca9fe7", "detected_licenses": [ "MIT" ], "directory_id": "16056a180570323b425d3bb715ce5679d28bbbc0", "extension": "py", "file...
3.109375
stackv2
import ast from itertools import combinations, permutations, product from typing import ( Iterator, Callable, List, Mapping, Set, Type, ) from pythoneer.context import Context from pythoneer.expression import AnnotatedExpression from pythoneer.annotation import TypeAnnotation class Expression...
285
35.27
127
24
2,235
python
[]
0
true
2024-11-19T02:31:56.088429+00:00
1,568,144,501,000
783e7582a265be96e40c613c7aa696d61badd9b0
4
{ "blob_id": "783e7582a265be96e40c613c7aa696d61badd9b0", "branch_name": "refs/heads/master", "committer_date": 1568144501000, "content_id": "5de214c10e4168c2b6772557509d7160dd98005c", "detected_licenses": [ "Apache-2.0" ], "directory_id": "f516b7561b93f640bcb376766a7ecc3440dcbb99", "extension": "py"...
3.671875
stackv2
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def closestValue(self, root: TreeNode, target: float) -> int: if root.left and target < root.val: result = self.close...
24
28.96
65
14
156
python
[]
0
true
2024-11-19T02:31:56.206387+00:00
1,335,347,479,000
8cfe87f223cd6feddfad1e887a876d076c7b10b6
3
{ "blob_id": "8cfe87f223cd6feddfad1e887a876d076c7b10b6", "branch_name": "refs/heads/master", "committer_date": 1335347479000, "content_id": "3ccab73430f309c760ea4ce04f1b378e95114591", "detected_licenses": [ "ISC" ], "directory_id": "61012ed6b51db4470c100697e1c5fbaad2e05a00", "extension": "py", "fi...
3.234375
stackv2
""" Some handy vector routines """ import itertools import numpy def zero(v): """ Check if a vector is all zeros """ return (v == numpy.zeros(v.shape, v.dtype)).all() def decompose(v): """ Split into prime components """ c, r = itertools.chain, itertools.repeat dims = v.shape[0] axes = (numpy...
37
26.24
89
17
270
python
[]
0
true
2024-11-19T02:31:56.255313+00:00
1,487,352,250,000
b7da1c95e6e9ff59d8e3139e899b7a00210106eb
3
{ "blob_id": "b7da1c95e6e9ff59d8e3139e899b7a00210106eb", "branch_name": "refs/heads/master", "committer_date": 1487352250000, "content_id": "81020caac75f2cf4f6ef0a1195e972a3c8df1eb2", "detected_licenses": [ "MIT" ], "directory_id": "671d9bae6f9177c9e91dab744178d8c7ca831dbe", "extension": "py", "fi...
3.296875
stackv2
class Node(object): def __init__(self, inbound_nodes=[]): """A base node in a computational graph.""" self.inbound_nodes = inbound_nodes self.outbound_nodes = [] self.value = None # Init first value as None self.gradients = {} # Append this node to all nodes that poi...
19
34.84
77
12
134
python
[]
0
true
2024-11-19T02:31:57.050102+00:00
1,600,053,438,000
a285c770fc10fec9e642d4802c67b976a98af264
3
{ "blob_id": "a285c770fc10fec9e642d4802c67b976a98af264", "branch_name": "refs/heads/master", "committer_date": 1600053438000, "content_id": "524714f34c51c5c8dec83ff3feb40db05c434676", "detected_licenses": [ "MIT" ], "directory_id": "37948b062bf2ad36499ae2da6432d6dd576e15cd", "extension": "py", "fi...
2.53125
stackv2
import cv2 as cv import sys import numpy as np import tifffile as ti import argparse import itertools max_lowThreshold = 100 window_name = 'Edge Map' title_trackbar = 'Min Threshold:' ratio = 3 kernel_size = 3 def CannyThreshold(val): low_threshold = val #img_blur = cv.blur(src_gray, (3,3)) detected_edges...
193
33.5
124
24
1,944
python
[]
0
true
2024-11-19T02:31:57.124870+00:00
1,567,376,654,000
3b752e379257955cc0d83c990b0b712bc7f9ac4f
3
{ "blob_id": "3b752e379257955cc0d83c990b0b712bc7f9ac4f", "branch_name": "refs/heads/master", "committer_date": 1567376654000, "content_id": "aaeac1d809963becaa92c46d1ad50b7375c14ef9", "detected_licenses": [ "Apache-2.0" ], "directory_id": "7dc837ea08313d542d5eb9facb0d10d0fa898f0b", "extension": "py"...
2.625
stackv2
import http import json import urllib.parse from datetime import datetime, timezone class GitterException(Exception): """Base exception for this library.""" class HTTPException(GitterException): """A general exception to represent HTTP responses.""" def __init__(self, status_code, *args): sel...
253
34.16
87
25
1,902
python
[]
0
true