added
stringdate
2024-11-18 17:59:49
2024-11-19 03:44:43
created
int64
0
2,086B
id
stringlengths
40
40
int_score
int64
2
5
metadata
dict
score
float64
2.31
5.5
source
stringclasses
1 value
text
stringlengths
258
23.4k
num_lines
int64
16
649
avg_line_length
float64
15
61
max_line_length
int64
31
179
ast_depth
int64
8
40
length
int64
101
3.8k
lang
stringclasses
1 value
sast_codeql_findings
stringlengths
2
265k
sast_codeql_findings_count
int64
0
45
sast_codeql_success
bool
1 class
sast_codeql_error
stringclasses
1 value
2024-11-18T21:25:58.035336+00:00
1,619,356,903,000
15bd65fb6deb51eb4ae82833397243369365b4c5
3
{ "blob_id": "15bd65fb6deb51eb4ae82833397243369365b4c5", "branch_name": "refs/heads/master", "committer_date": 1619356903000, "content_id": "13fa6e7c3b6995f9cf4cc77e4667a06c4bba386f", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5d2d586e18092d9800f689644555ad6c948c6f87", "extension": "py"...
3.09375
stackv2
from itertools import permutations import re def is_number(n): is_number = True try: num = float(n) # check for "nan" floats is_number = num == num # or use `math.isnan(num)` except ValueError: is_number = False return is_number def solution(expression): num ...
56
30.55
74
25
350
python
[]
0
true
2024-11-18T21:25:58.113000+00:00
1,623,067,425,000
0ffff446576aa1d774611e43cc62982719eb54ac
3
{ "blob_id": "0ffff446576aa1d774611e43cc62982719eb54ac", "branch_name": "refs/heads/master", "committer_date": 1623067425000, "content_id": "1bf8bac27fca12b5fc5e4a0180cc0752d986d616", "detected_licenses": [ "Apache-2.0" ], "directory_id": "6330ecd271fd3a462c0a6909ae818b65bc3cda48", "extension": "py"...
3.203125
stackv2
import os import torch # 本文件主要是给训练、测试过程提供便捷的取样本操作 categories = ['财经', '房产', '教育', '科技', '军事', '汽车', '体育', '游戏', '娱乐'] # 类别名对应的id labels = {'财经': 0, '房产': 1, '教育': 2, '科技': 3, '军事': 4, '汽车': 5, '体育': 6, '游戏': 7, '娱乐': 8} #这两个改成sample数量-1 MAX_TRAIN_INDEX = 136 MAX_TEST_INDEX = 70 # index 0~235 # labels = ...
53
26.11
119
10
573
python
[]
0
true
2024-11-18T21:25:58.218976+00:00
1,574,402,521,000
6b633699873598f44418df617cbcef81da3daaa2
4
{ "blob_id": "6b633699873598f44418df617cbcef81da3daaa2", "branch_name": "refs/heads/master", "committer_date": 1574402521000, "content_id": "9296202d0688cb066a41dd4625a3687b817396c4", "detected_licenses": [ "MIT" ], "directory_id": "edb10a06f56d9bd19b0b60581728900a03d9732a", "extension": "py", "fi...
4
stackv2
''' Created on 2016年1月16日 @author: Darren ''' ''' Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in place. The program should run in O(1) space complexity and O(nodes) ti...
66
24.89
170
14
420
python
[]
0
true
2024-11-18T21:25:58.276616+00:00
1,632,320,571,000
542276263ba4a34b7949a0144b635f9163f8e404
3
{ "blob_id": "542276263ba4a34b7949a0144b635f9163f8e404", "branch_name": "refs/heads/master", "committer_date": 1632320571000, "content_id": "d6ba2e8f3da62f8a1adc1d0fb0059b8da47d44b7", "detected_licenses": [ "Zlib" ], "directory_id": "839a7d171613496707b807f9e5c87b52d583f4ba", "extension": "py", "f...
3.0625
stackv2
#!/usr/bin/env python # coding: utf-8 class response(object): ''' Response object recognized by sessions as an item to be returned by registered scripts to report their termination status. ''' def __init__(self, success, status): '''Initialize a response object.''' se...
38
27.5
75
15
216
python
[]
0
true
2024-11-18T21:25:58.446209+00:00
1,620,877,222,000
c7ec093a125073925ab3f33fa37ea2c446943db1
3
{ "blob_id": "c7ec093a125073925ab3f33fa37ea2c446943db1", "branch_name": "refs/heads/master", "committer_date": 1620877222000, "content_id": "652b9fd0a9c5580c30556407d58ae198f0be1662", "detected_licenses": [ "MIT" ], "directory_id": "7a3b469ba1602c73ada72fcf2b6d99372faf4a86", "extension": "py", "fi...
3.390625
stackv2
import sys from copy import copy def load_num(): line = sys.stdin.readline() if line == '' or line == '\n': return None return list(map(int, line.rstrip().split())) def find_pos(lst, element): """Find position of element in list""" for i in range(len(lst)): if lst[i] == element: ...
77
22.32
78
17
453
python
[]
0
true
2024-11-18T21:25:59.551181+00:00
1,519,065,312,000
5a2408fe9c9c04d65d2d946d3948f93f6dcf22e3
4
{ "blob_id": "5a2408fe9c9c04d65d2d946d3948f93f6dcf22e3", "branch_name": "refs/heads/master", "committer_date": 1519065312000, "content_id": "298f8b3d7a8e5974dc4eca57011486e846b0b8e7", "detected_licenses": [ "MIT" ], "directory_id": "d87ddc8aff43908afdefff35dfc0e59eee256e63", "extension": "py", "fi...
3.734375
stackv2
"""Solution for https://www.codewars.com/kata/moving-zeros-to-the-end/""" def move_zeros(array): """Return a list with all zeroes moved to the end while keeping original order for all non-zero values.""" out = [] for n in l: if not any([type(n) is int, type(n) is float]): out.append...
17
31.47
82
14
146
python
[]
0
true
2024-11-18T21:25:59.773059+00:00
1,625,989,737,000
1977733e5fdb0cfab921daf7b9b8898aa0593f5c
3
{ "blob_id": "1977733e5fdb0cfab921daf7b9b8898aa0593f5c", "branch_name": "refs/heads/main", "committer_date": 1625989737000, "content_id": "a8bbe49ca05ccd1415c2f4aae2c7c894d2a98018", "detected_licenses": [ "MIT" ], "directory_id": "79c5727d388be68de978c84ae51de7e3e661f854", "extension": "py", "file...
2.6875
stackv2
import _thread from tkinter import * from tkinter.ttk import * from tkinter import messagebox import instaloader class InstaBackup(Frame): def __init__(self): super().__init__() self.master.title("Insta Backup") self.pack(fill=BOTH, expand=True) self.frame = None self.labe...
77
27.51
66
13
481
python
[]
0
true
2024-11-18T21:25:59.826702+00:00
1,628,130,056,000
75394d18b33f8a4175bf5b507422e8c8f5cde730
4
{ "blob_id": "75394d18b33f8a4175bf5b507422e8c8f5cde730", "branch_name": "refs/heads/master", "committer_date": 1628130056000, "content_id": "67bbb0ef4271bb45c5542f8214c31cf94a2a582e", "detected_licenses": [ "MIT" ], "directory_id": "13ffe0def761fa5c61fbf9ee8ab02c15dc1c61eb", "extension": "py", "fi...
3.5625
stackv2
spam_amount = 0 print(spam_amount) # This is single line comment in Python. # This is multi # line comment # in Python if (spam_amount > 0): print("Are you eating Spam today, nah brosky!!!") else: print("Show me what else do we have?") spam_amount = spam_amount + 4 if (spam_amount > 0): print("Are you e...
23
20.22
61
9
135
python
[]
0
true
2024-11-18T21:25:59.927946+00:00
1,681,133,924,000
d21657c6cd046501b1387e270ccad50598e14a4b
3
{ "blob_id": "d21657c6cd046501b1387e270ccad50598e14a4b", "branch_name": "refs/heads/main", "committer_date": 1681133924000, "content_id": "80e787c6835d4045e20ea0cabe49b35a834c21b3", "detected_licenses": [ "MIT" ], "directory_id": "fc661b0224285ad19719cf649ed63d2bf9e1cb16", "extension": "py", "file...
2.5625
stackv2
from heifpy.binary import BinaryFileReader from .basebox import FullBox class CompositionTimeToSample(FullBox): """ ISO/IEC 14496-12 Box Type: ‘ctts’ Container: Sample Table Box (‘stbl’) Mandatory: Yes Quantity: Zero or one """ def __init__(self): super().__init__() ...
45
27.73
79
17
302
python
[]
0
true
2024-11-18T21:26:00.045210+00:00
1,539,943,996,000
cebb07c9b7b9408b559ab41e28e830c98e54c9d4
2
{ "blob_id": "cebb07c9b7b9408b559ab41e28e830c98e54c9d4", "branch_name": "refs/heads/master", "committer_date": 1539943996000, "content_id": "674993763a843df6b19f29d74a40384796f883ca", "detected_licenses": [ "Apache-2.0", "BSD-2-Clause" ], "directory_id": "fc5001beb6e2c2c21875c11396750e9432dc5db0",...
2.4375
stackv2
import datetime import pickle from carnivora.instabot.config import Config class Log: @staticmethod def update(screenshot_path, browser, log_path, text="", image=""): browser.save_screenshot(screenshot_path) date = str(datetime.datetime.now()) log = [] try: with o...
36
27.69
77
18
229
python
[]
0
true
2024-11-18T21:26:00.096221+00:00
1,563,478,483,000
8e5a3880cef05df71bd155f6ec4ae1c771e47d21
3
{ "blob_id": "8e5a3880cef05df71bd155f6ec4ae1c771e47d21", "branch_name": "refs/heads/master", "committer_date": 1563539323000, "content_id": "6598a92faa6968b07f0ab6bec755ca68e13a7001", "detected_licenses": [ "MIT" ], "directory_id": "79cd3e0845e0ef83a7f2e9a18685a7737f49400f", "extension": "py", "fi...
2.640625
stackv2
import numpy as np from hummingbird.parameters.aerosonde_parameters import MavParameters class PlannerParameters: # size of the waypoint array used for the path planner. This is the # maximum number of waypoints that might be transmitted to the path # manager. size_waypoint_array = 100 # airspee...
24
31.42
72
11
207
python
[]
0
true
2024-11-18T21:26:00.213804+00:00
1,634,470,677,000
d99e1c79cbdbbf29f984a9575f13952a1d9b5fd2
3
{ "blob_id": "d99e1c79cbdbbf29f984a9575f13952a1d9b5fd2", "branch_name": "refs/heads/main", "committer_date": 1634470677000, "content_id": "4c9b9848c94094237a5ce3856d90bf15bcaa5cc0", "detected_licenses": [ "MIT" ], "directory_id": "e6992db893e30ae4c10eb75a601b208e8326b272", "extension": "py", "file...
2.546875
stackv2
import os import telegram from telegram.ext import Updater from telegram.ext import CommandHandler from tracker import get_crypto_prices command_name = "track" def read_token(): with open("token.txt", "r") as f: lines = f.readlines() return lines[0].strip() # change to = read_token() if you want ...
36
31.42
159
11
295
python
[]
0
true
2024-11-18T21:26:00.315025+00:00
1,674,036,633,000
a87b6432773cab3e677ce18c0314a674386b9356
3
{ "blob_id": "a87b6432773cab3e677ce18c0314a674386b9356", "branch_name": "refs/heads/master", "committer_date": 1674036633000, "content_id": "58f64ec579a2ff0e90606434b1b22dee5cf89274", "detected_licenses": [ "MIT" ], "directory_id": "33be4b8a076a83adb73ff6b267d8135dbbdd16fc", "extension": "py", "fi...
3.015625
stackv2
#!/usr/bin/env python3 import requests from requests.auth import HTTPDigestAuth from getpass import getpass user=input("Enter user:") password = getpass() url = 'http://httpbin.org/digest-auth/auth/user/pass' response = requests.get(url, auth=HTTPDigestAuth(user, password)) print("Headers request : ") for header, v...
23
27.52
65
12
147
python
[]
0
true
2024-11-18T21:26:00.434185+00:00
1,477,164,085,000
3a28ef9a22d119cab170c53c127d56d90a1ef8a2
3
{ "blob_id": "3a28ef9a22d119cab170c53c127d56d90a1ef8a2", "branch_name": "refs/heads/master", "committer_date": 1477164085000, "content_id": "de1500c2a7350cb3753732ed9ee5d649274735d5", "detected_licenses": [ "Apache-2.0" ], "directory_id": "31ff88a65a4772786f25abfcf114540b76a251e7", "extension": "py"...
3.0625
stackv2
#!/usr/bin/env python import argparse import re import lzma tags_re = re.compile(r'<[^<]+?>') word_re = re.compile(r'(\w[\w\-]*\w|\w)', re.U) def sentences_iter(filename, only_words=False): with smart_open(filename, 'rb') as f: sentence = [] for line in f: try: word, ...
52
23.75
78
17
297
python
[]
0
true
2024-11-18T21:26:00.543184+00:00
1,625,131,867,000
f74a612cde90a7c68ca3fa5653ac4eb613382f2b
2
{ "blob_id": "f74a612cde90a7c68ca3fa5653ac4eb613382f2b", "branch_name": "refs/heads/master", "committer_date": 1625133769000, "content_id": "67927af35554391bbe20825f54ad7aa3bc267541", "detected_licenses": [ "Apache-2.0" ], "directory_id": "1d6c94d29532efe429c8958358519b2f918ce614", "extension": "py"...
2.4375
stackv2
try: from typing import Any except ImportError: pass class FatalError(RuntimeError): """Generic unrecoverable runtime error""" exit_code = 2 def __init__(self, *args, **kwargs): # type: (Any, Any) -> None super(FatalError, self).__init__(*args) exit_code = kwargs.pop('exit_code',...
44
17.98
101
11
197
python
[]
0
true
2024-11-18T21:26:00.602293+00:00
1,459,352,304,000
d356b00b2454d3d8cc29672ee9339518a3552359
2
{ "blob_id": "d356b00b2454d3d8cc29672ee9339518a3552359", "branch_name": "refs/heads/master", "committer_date": 1459352304000, "content_id": "52d05d999b174afc7890c79ed4bef006875028e9", "detected_licenses": [ "Apache-2.0" ], "directory_id": "885b68df35a8ee5bbaa417f1cc824cd23f295da9", "extension": "py"...
2.453125
stackv2
import logging logger = logging.getLogger(__name__) from flyingpigeon.utils import calc_grouping, sort_by_filename, get_frequency # aggregations, from flyingpigeon.ocgis_module import call def aggregatTime(resource=[], variable=None, frequency=None, prefix=None, grouping='mon', calculation='mean', historical_concatin...
53
38.75
141
16
510
python
[]
0
true
2024-11-18T21:26:00.657770+00:00
1,689,814,697,000
edb122fe09b471b78b50544198f8a4c62231524b
3
{ "blob_id": "edb122fe09b471b78b50544198f8a4c62231524b", "branch_name": "refs/heads/main", "committer_date": 1689814697000, "content_id": "f16a31749350a791adc5394a1ac10cb20aecc9d2", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "7824a20fd120e692bbb8f9d973d5bfd8979defee", "extension": "py"...
2.71875
stackv2
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ Container class for the database of emission-line bandpass filters used for non-parameteric measurements of emission-line flux and velocity moments. .. todo:: Combine this with the main emissionlinemoments.py file. Class u...
206
42.46
99
23
1,980
python
[]
0
true
2024-11-18T21:26:00.714328+00:00
1,557,881,058,000
fc354fe393343b0ec4063cd1a8edca5cd6e66c76
3
{ "blob_id": "fc354fe393343b0ec4063cd1a8edca5cd6e66c76", "branch_name": "refs/heads/master", "committer_date": 1557881058000, "content_id": "490d49c6ead3e3bd7947d83aec37d739a9a24fa9", "detected_licenses": [ "MIT" ], "directory_id": "9adccb3dcb7edebeddadcfc84995a3fa1d7d07f2", "extension": "py", "fi...
3.046875
stackv2
import numpy as np from sklearn.feature_extraction.text import CountVectorizer from nltk import FreqDist import nltk import sys """ to install nltk stuff python - great a pyton repl >>> import nltk >>> nltk.download() """ def sampleCount(): texts = ['hi there', 'hello there', 'hello here you are'] vectori...
40
20.18
61
11
214
python
[]
0
true
2024-11-18T21:26:00.949000+00:00
1,596,455,617,000
f870cb13440a48c5908c8842255ae8bbfe93d045
3
{ "blob_id": "f870cb13440a48c5908c8842255ae8bbfe93d045", "branch_name": "refs/heads/master", "committer_date": 1596455617000, "content_id": "d0ffd968b4744def3cbe9c995e4515f6ea44cf7f", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "1cdd4001055571ee9c7bd1c8eaa941ccc23ca4c5", "extension": "p...
2.53125
stackv2
"""Differentiable ILP.""" import keras.backend as K import keras.layers as L from keras.models import Model import models.ima as ima # pylint: disable=line-too-long class RuleTemplate(L.Layer): """Layer that exposes trainable weights as rule templates.""" def __init__(self, goal, num_preds, pred_len, embed_size,...
86
32.37
90
15
700
python
[]
0
true
2024-11-18T21:26:01.065725+00:00
1,665,321,806,000
ee183e2c29a94ab1797cd0527f754f8d4f6ab2c1
2
{ "blob_id": "ee183e2c29a94ab1797cd0527f754f8d4f6ab2c1", "branch_name": "refs/heads/main", "committer_date": 1665321806000, "content_id": "d009fcd11cdade11d541ddbfd54283f3922d8ef7", "detected_licenses": [ "MIT" ], "directory_id": "9c266480b1d96ac8e403d69ca809a72bbc9ed3c1", "extension": "py", "file...
2.5
stackv2
"""Implementation of Rule L030.""" from typing import List, Tuple from sqlfluff.core.rules.crawlers import SegmentSeekerCrawler from sqlfluff.core.rules.doc_decorators import ( document_configuration, document_fix_compatible, document_groups, ) from sqlfluff.rules.L010 import Rule_L010 @document_groups ...
58
21.59
82
14
315
python
[]
0
true
2024-11-18T21:26:01.119593+00:00
1,524,078,563,000
794d845249cdd634e994ffabc15b614511428606
3
{ "blob_id": "794d845249cdd634e994ffabc15b614511428606", "branch_name": "refs/heads/master", "committer_date": 1524078563000, "content_id": "c12da300fed32be0c930b568ebed43980b4a2fd8", "detected_licenses": [ "Apache-2.0" ], "directory_id": "37d6d527ea943e1f93ec16f23b0129ac3dc97241", "extension": "py"...
3.078125
stackv2
#!/usr/bin/env # -*- coding: utf-8 -*- # Copyright (C) Victor M. Mendiola Lau - All Rights Reserved # Unauthorized copying of this file, via any medium is strictly prohibited # Proprietary and confidential # Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, February 2017 import numpy as np from sklearn import gr...
51
32
105
12
386
python
[]
0
true
2024-11-18T21:26:01.551190+00:00
1,540,318,903,000
3369839c6548cbc9fa85b575124b3acaca346592
3
{ "blob_id": "3369839c6548cbc9fa85b575124b3acaca346592", "branch_name": "refs/heads/master", "committer_date": 1540318903000, "content_id": "e740ac7ee4163d47e706a163983b97a5f561ca64", "detected_licenses": [ "MIT" ], "directory_id": "fd7e1efb666526af00a451a1d8a1d3c58b5de4c6", "extension": "py", "fi...
3.046875
stackv2
import sqlite3 import pandas as pd import os class Chronometer(object): """ Interface with the Chronometer Database. """ def __init__(self, chronodb_info, db_type='sqlite3'): """ Args: chronodb_info (dict): the information for the chronometer database depend...
66
35.35
87
18
515
python
[]
0
true
2024-11-18T21:26:01.701649+00:00
1,635,035,166,000
6eceee70aa70ffd3aca6c346692c38bfc9874b95
4
{ "blob_id": "6eceee70aa70ffd3aca6c346692c38bfc9874b95", "branch_name": "refs/heads/master", "committer_date": 1635035166000, "content_id": "798df47a21770e9a76fc1e03f56b1f0b1597f11e", "detected_licenses": [ "MIT" ], "directory_id": "cf1bab7f1bcbd8a8295d61d0fccea4c9a1b457f5", "extension": "py", "fi...
4.21875
stackv2
""" A robot is located at the top-left corner of a m x n grid. The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. How many possible unique paths are there? Example 1: Input: m = 3, n = 2, Output: 3 Explanation: From the top-left corner,...
47
36.13
117
15
495
python
[]
0
true
2024-11-18T21:26:01.761820+00:00
1,360,613,636,000
509d6d9ce805f911f1df649796dce7d1df081a72
2
{ "blob_id": "509d6d9ce805f911f1df649796dce7d1df081a72", "branch_name": "refs/heads/master", "committer_date": 1360613636000, "content_id": "1b4d6456991a6aaa19898d5ba1d6e07bf8564ec6", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "c8d7f2da5ff9e13a5bb6f92b9387a336e7059644", "extension": "p...
2.421875
stackv2
import numpy as np import ctypes global f lib_spline = ctypes.cdll.LoadLibrary('/home/pablo/Programmation/bigeco/dolo/dolo/numeric/interpolation/spline.so') class MultivariateSpline: def __init__(self, smin, smax, orders): self.smin = smin self.smax = smax self.orders = orders ...
214
31.83
138
21
2,043
python
[]
0
true
2024-11-18T21:26:01.814844+00:00
1,599,531,214,000
ee0642c422907a93a8e0ccc2fc67b5072ea62336
4
{ "blob_id": "ee0642c422907a93a8e0ccc2fc67b5072ea62336", "branch_name": "refs/heads/master", "committer_date": 1599531214000, "content_id": "622cd9a45c4d318d648de85d02a649ae36388139", "detected_licenses": [ "MIT" ], "directory_id": "907503d1cdb25531fa63b14964af06c905b1dd53", "extension": "py", "fi...
3.546875
stackv2
# import pykit module # import pykit as pk from pykit import write from pykit import multiply """ Subtract first = int(input("Enter first number")) second = int(input("Enter second number")) print("Result = ", pk.subtraction(first, second)) """ write("This is a program to solve multiplication problem in pykit module...
16
25.88
74
9
106
python
[]
0
true
2024-11-18T21:26:02.120211+00:00
1,693,230,751,000
4b93ac8fb46a00e8db726e188719b781fe75050f
3
{ "blob_id": "4b93ac8fb46a00e8db726e188719b781fe75050f", "branch_name": "refs/heads/master", "committer_date": 1693230751000, "content_id": "5735961a9c1baeb4a44e7899952a24dc08c16fc9", "detected_licenses": [ "Apache-2.0" ], "directory_id": "52a677b94056d3397b4a499bc9185adb68a63f05", "extension": "py"...
2.984375
stackv2
import itertools import uuid # TODO(kleesc): There are probably better key derivation functions, but that would require existing ones to be rotated. # Reference: https://cryptography.io/en/latest/hazmat/primitives/key-derivation-functions.html def convert_secret_key(config_secret_key): """ Conve...
33
31.61
119
15
243
python
[]
0
true
2024-11-18T21:26:02.515382+00:00
1,673,066,907,000
c1c5c194abbc57421d99f48b0969e20fe77ed068
3
{ "blob_id": "c1c5c194abbc57421d99f48b0969e20fe77ed068", "branch_name": "refs/heads/main", "committer_date": 1673066907000, "content_id": "a16a70b203c479f2204facb789955deb67e886e9", "detected_licenses": [ "MIT" ], "directory_id": "7506f51d763d48401d068918a47748abe061a8dd", "extension": "py", "file...
2.703125
stackv2
import requests import csv r = csv.reader(open('stoplist.csv')) # w = csv.writer(open('output.csv','w')) w = csv.writer(open('stopsoutput.csv','w')) headers = r.next() headers.append('coordinates') headers.append('lat') headers.append('long') w.writerow(headers) counter = 1 for line in r: addr = line[0].replace(' '...
41
26.83
157
14
311
python
[]
0
true
2024-11-18T21:26:02.678615+00:00
1,452,672,690,000
f4912bdbc024c79724e8a8b8d146b98f640e1377
3
{ "blob_id": "f4912bdbc024c79724e8a8b8d146b98f640e1377", "branch_name": "refs/heads/master", "committer_date": 1452672690000, "content_id": "5888475a0450d73994f3c98432ba6ffccacfb086", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "b282e41b4f2b45865d66e18dd068e7d1f0674959", "extension": "p...
2.71875
stackv2
""" Object key handler, stores key's model name. """ from django.conf import settings from django.db.models.loading import get_model class ObjectKeyHandler(object): """ The model maintains a table of key->model. """ def __init__(self): """ Initialize handler """ self.c...
72
19.72
75
16
301
python
[]
0
true
2024-11-18T21:26:02.814568+00:00
1,586,536,233,000
822f7df338763db3349922c06f5788f74e1bb750
3
{ "blob_id": "822f7df338763db3349922c06f5788f74e1bb750", "branch_name": "refs/heads/master", "committer_date": 1586536233000, "content_id": "9735ab6bfed6a3ba94178d29544416e85c90bdaa", "detected_licenses": [ "Apache-2.0" ], "directory_id": "1ad419e7512e842ffb55c4e13d654cce920b5328", "extension": "py"...
2.546875
stackv2
import argparse import opentrons.simulate import opentrons.protocol_api.labware import json import urllib def is_labware(maybe_labware): return isinstance(maybe_labware, opentrons.protocol_api.labware.Labware) parser = argparse.ArgumentParser(description="Simulate an Opentrons Python Protocol API script and print...
35
46.83
157
13
436
python
[]
0
true
2024-11-18T21:26:02.870105+00:00
1,536,837,014,000
5e9b97fd50272f8d3edb6af4d844627dacc8d9b6
3
{ "blob_id": "5e9b97fd50272f8d3edb6af4d844627dacc8d9b6", "branch_name": "refs/heads/master", "committer_date": 1536837014000, "content_id": "c28fb73736fcff53ab5395b5410b9f3daa93e7ad", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2d91fa8375583ce83a44cb23dca31184f2375667", "extension": "py"...
3.171875
stackv2
""" Command to expose pyocnos functionality """ from __future__ import print_function import argparse import io import textwrap import yaml from pyocnos.ocnos import OCNOS def process(config_file_path, hostname, actions, save_config_file_path, candidate_file_path): """ Initialize device and call the actions...
131
31.67
118
19
872
python
[]
0
true
2024-11-18T21:26:03.140754+00:00
1,290,103,463,000
bb613c2e2fee3c311736cfe81ac9c37260b855de
4
{ "blob_id": "bb613c2e2fee3c311736cfe81ac9c37260b855de", "branch_name": "refs/heads/master", "committer_date": 1290103463000, "content_id": "2e0b1abd5a55dd56dd8108cab66434e673cf93f0", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "7d482b00cc827e160386b089800d2e3d189bd44d", "extension": "p...
3.5
stackv2
# -*- coding: utf-8 -*- """ pyClanSphere.utils.datastructures ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Various data structures. :copyright: (c) 2009 - 2010 by the pyClanSphere Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from itertools import izip, ...
291
27.45
81
17
2,090
python
[]
0
true
2024-11-18T21:26:03.196138+00:00
1,688,783,067,000
87acd2c8e66c5495d56a847c252b5ee8a0db48e3
2
{ "blob_id": "87acd2c8e66c5495d56a847c252b5ee8a0db48e3", "branch_name": "refs/heads/master", "committer_date": 1688783067000, "content_id": "f2578a3bd18297e9e0acf57bc7ed3684370278ef", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5ce2f600372a589f9b9cf989c99a8175060636ce", "extension": "py"...
2.359375
stackv2
#cloud_function(platforms=[Platform.AWS], memory=512, config=config) def yourFunction(request, context): import json import logging from Inspector import Inspector import time # Import the module and collect data inspector = Inspector() inspector.inspectAll() # Add custom message ...
19
30
80
15
126
python
[]
0
true
2024-11-18T21:26:03.425265+00:00
1,589,529,434,000
e938680f81bc33302e756315f338e8b16990ad33
2
{ "blob_id": "e938680f81bc33302e756315f338e8b16990ad33", "branch_name": "refs/heads/master", "committer_date": 1589529434000, "content_id": "b26d8f43afc9bb76e98aa5e7318659dbaaddeea9", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0e6a67f1794c3a599c88647f5cb293fc5b49f6a0", "extension": "py"...
2.421875
stackv2
# coding: utf-8 """ Open:FactSet Marketplace API Headless CMS API used by the Open:FactSet Marketplace. # noqa: E501 OpenAPI spec version: v2.1.5 Contact: openfactset-frontend-engineering@factset.com """ import pprint import re # noqa: F401 import six class GetProductDtoPreviewLink(object...
138
26.09
87
23
899
python
[]
0
true
2024-11-18T21:26:03.550877+00:00
1,633,683,033,000
381eb7290260725f30d7074bb9097f10c88d5d98
2
{ "blob_id": "381eb7290260725f30d7074bb9097f10c88d5d98", "branch_name": "refs/heads/master", "committer_date": 1633683033000, "content_id": "4bc59d30f5882d3cb749be8c9e573565010b7f7c", "detected_licenses": [ "MIT" ], "directory_id": "cd6536b37675af4c9fcde5aced107719fe26ac57", "extension": "py", "fi...
2.34375
stackv2
from enum import Enum class ERichCurveInterpMode(Enum): RCIM_Linear = 0 RCIM_Constant = 1 RCIM_Cubic = 2 RCIM_None = 3 class ERichCurveTangentMode(Enum): RCTM_Auto = 0 RCTM_User = 1 RCTM_Break = 2 RCTM_None = 3 class ERichCurveTangentWeightMode(Enum): RCTWM_WeightedNone = 0 RC...
31
27.87
73
12
290
python
[]
0
true
2024-11-18T21:26:03.599262+00:00
1,613,592,378,000
354d835a8ca05b54610687fa276dfea543d1a2c6
3
{ "blob_id": "354d835a8ca05b54610687fa276dfea543d1a2c6", "branch_name": "refs/heads/master", "committer_date": 1613592378000, "content_id": "571854765c99b65a47f967882ffd06e5af43f576", "detected_licenses": [ "MIT" ], "directory_id": "f232ebdd808252952845561a69aa4213d97b328f", "extension": "py", "fi...
2.53125
stackv2
import json import requests from src.constants import * class RocketMessageFactory: def __build_text_message(self): return { "token": self.visitor["visitor"]["token"], "rid": self.room["_id"], "msg": self.message["body"], } def __build_media_message(self): ...
34
31.5
99
13
242
python
[]
0
true
2024-11-18T21:26:03.706857+00:00
1,496,440,760,000
5fedb1cbdeca3ae8507d50e55bf4ada6fa5032e1
2
{ "blob_id": "5fedb1cbdeca3ae8507d50e55bf4ada6fa5032e1", "branch_name": "refs/heads/master", "committer_date": 1496440760000, "content_id": "785fd23a5cfd5af3e9a7a6d4df5059ef901ee456", "detected_licenses": [ "MIT" ], "directory_id": "4b9acef2d860f6b36e1097c095892fa7d69d9d8e", "extension": "py", "fi...
2.484375
stackv2
#!/usr/bin/python # multiPY.py # Example cat seqs.fa | multiPY.py -c wc -p 3 # By Simon H. Rasmussen # Bioinformatics Centre # University of Copenhagen # Implementation of multiprocess batch processing import os import sys import threading def multiPY(in_file,command, lines_in_record, procs,batchSize=1000...
95
34.61
126
18
873
python
[]
0
true
2024-11-18T21:26:04.003858+00:00
1,576,189,475,000
365183146bde2d0a106c7349f391243bcbe19bb9
3
{ "blob_id": "365183146bde2d0a106c7349f391243bcbe19bb9", "branch_name": "refs/heads/master", "committer_date": 1576189475000, "content_id": "19caead7b89dbaf0e3ebe9e43666038402d64377", "detected_licenses": [ "MIT" ], "directory_id": "6f3364fbd4069a33ca610370e4fd270edfc99f83", "extension": "py", "fi...
2.65625
stackv2
import logging import product logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) class IncompleteProduct(object): # TODO : Change main_product to no_monitors_product def __init__(self, automata, snb_messages): self._automata = automata self._non_monitors = [auto...
117
48.16
91
21
1,026
python
[]
0
true
2024-11-18T21:26:04.108413+00:00
1,612,113,531,000
c19a4d73e42640cdca6aa430be881b41b388848f
3
{ "blob_id": "c19a4d73e42640cdca6aa430be881b41b388848f", "branch_name": "refs/heads/main", "committer_date": 1612113531000, "content_id": "4cc30364e204348bf26e72c00104ce7b4542d145", "detected_licenses": [ "MIT" ], "directory_id": "470a630ae964ef898f43b7809a5db89dac7751a3", "extension": "py", "file...
3.15625
stackv2
from fractions import Fraction as frac ############################################################### # Programinizi yazmaya bu yorumun altindan baslayiniz. # # Fonksiyon isimlerini ve parametre sayisini degistirmeyiniz. # # Ust satiri kesinlikle silmeyiniz # ######################...
79
33.37
135
8
855
python
[]
0
true
2024-11-18T21:26:04.331755+00:00
1,432,799,776,000
a1c0497f343adea9d612c565454234a6b4acee86
3
{ "blob_id": "a1c0497f343adea9d612c565454234a6b4acee86", "branch_name": "refs/heads/master", "committer_date": 1432799776000, "content_id": "b784cb2c587bb2a243c267e03b66d8d155f82e0f", "detected_licenses": [ "MIT" ], "directory_id": "39f35ffad52e1d553996d77381be7e20a6a5c196", "extension": "py", "fi...
2.515625
stackv2
import xml.etree.ElementTree as ET import os datadir = 'D:/Steam/steamapps/common/Galactic Civilizations III/data' trees = {} def english(key, sources): for source in sources: if source not in trees: sourcePath = os.path.join(datadir, 'English', 'Text', source) if not os.path.isfi...
17
35.24
86
15
150
python
[]
0
true
2024-11-18T21:26:04.851161+00:00
1,573,005,447,000
7b873ce119d9a25b77a29720267f21a13f1a5b46
3
{ "blob_id": "7b873ce119d9a25b77a29720267f21a13f1a5b46", "branch_name": "refs/heads/master", "committer_date": 1573005447000, "content_id": "4c0786756d21c3565ee32fa6708906282319cf84", "detected_licenses": [ "MIT" ], "directory_id": "6a20b2dd262880aeb20678297f1df7addab23d84", "extension": "py", "fi...
3
stackv2
class Server: name="Name" ip="127.0.0.1" hddSize=100 def TurnOn(self, newIp): self.ip = newIp print("New ip: ", self.ip) print("Avaliable space: ", self.hddSize) def TurnOff(self): ip = "127.0.0.1" def Calculations(self): if self.ip != "127.0.0.1": ...
50
20.2
60
15
310
python
[]
0
true
2024-11-18T21:26:04.904771+00:00
1,499,957,355,000
6047657e5fe0c5bc14a5a59085d3c2685605e601
3
{ "blob_id": "6047657e5fe0c5bc14a5a59085d3c2685605e601", "branch_name": "refs/heads/master", "committer_date": 1499957355000, "content_id": "799e04198da72d28d19e8ce1cbfca1b14c6f4ce5", "detected_licenses": [ "MIT" ], "directory_id": "1a4c77c0ef0448cd3c12c27e2f509f4af29733d0", "extension": "py", "fi...
2.71875
stackv2
# -*- coding: utf-8 -*- """ Created on Thu Jul 13 14:30:03 2017 @author: Paul """ import sys sys.path.append('C:\Users\Paul\Documents\These\codes\git\sem-proc') import numpy as np from scipy.optimize import curve_fit from scipy.signal import argrelextrema from Savitzjy_goulay import savitzky_golay from skimage import ...
70
35.27
96
23
803
python
[]
0
true
2024-11-18T21:26:05.064492+00:00
1,603,608,583,000
21593ff864c5decbad18b88796505d8465e00721
4
{ "blob_id": "21593ff864c5decbad18b88796505d8465e00721", "branch_name": "refs/heads/master", "committer_date": 1603608583000, "content_id": "75d60d759c69bac0f3839721590d6ebfce0a589f", "detected_licenses": [ "MIT" ], "directory_id": "3de6f7f6d8497e728101c368ec778e67f769bd6c", "extension": "py", "fi...
3.875
stackv2
class LinkedList: def __init__(self): self.head = None self.tail = None self.size = 0 def insert_at_head(self, val): new_node = ListNode(val, next=self.head) if self.is_empty(): self.tail = new_node else: self.head.prev = new_node ...
139
23.67
71
13
806
python
[]
0
true
2024-11-18T21:26:05.120401+00:00
1,571,753,752,000
bd19307d0c357fcab3631cfdcef0cceea7668a22
3
{ "blob_id": "bd19307d0c357fcab3631cfdcef0cceea7668a22", "branch_name": "refs/heads/master", "committer_date": 1571753752000, "content_id": "f32c4fb53727dbfce15988b2a4464157ddf5e970", "detected_licenses": [ "MIT" ], "directory_id": "0d966c8dd7ea5929ef7a5ccc0bf7c4d427d53a93", "extension": "py", "fi...
3.25
stackv2
import hashlib class EncryptUtil(object): @staticmethod def md5(s): """ md5 :param s: string :return: 32 characters (128bits=16bytes) """ return hashlib.md5(s.encode()).hexdigest() @staticmethod def sha1(s): """ sha1 :param s: st...
45
20.36
53
14
265
python
[]
0
true
2024-11-18T21:26:05.228473+00:00
1,692,120,343,000
3681457a6a94625205fcfdbc16ff91fc17dc600a
3
{ "blob_id": "3681457a6a94625205fcfdbc16ff91fc17dc600a", "branch_name": "refs/heads/master", "committer_date": 1692120343000, "content_id": "4145216dca8f832596c7d6d1b6206b3f5333b124", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d4a31f44cdf0eb8f1f56916d7e1e5fccc2aaf050", "extension": "py"...
2.6875
stackv2
""" Note: the files in this directory have been copied from eccodes-python and retain their original notice. Classes for handling BUFR with a high level interface. ``BufrFiles`` can be treated mostly as regular files and used as context managers, as can ``BufrMessages``. Each of these classes destructs itself and any...
116
31.23
85
14
929
python
[]
0
true
2024-11-18T21:26:05.551711+00:00
1,558,628,442,000
17e01ef177f2dd7dc81ebc00af738fee02114d76
3
{ "blob_id": "17e01ef177f2dd7dc81ebc00af738fee02114d76", "branch_name": "refs/heads/master", "committer_date": 1558628442000, "content_id": "00e196910ec91af60c5afa7ee41e4db095d4349c", "detected_licenses": [ "MIT" ], "directory_id": "b9b9d19d293b3fa3bfd2d3c0162584786cd8ac9a", "extension": "py", "fi...
2.75
stackv2
import torch import torch.nn as nn class Transformer(nn.Module): def __init__(self, embed_dim, hidden_dim, num_embeddings, num_max_positions, num_heads, num_layers, dropout): """ Transformer (GPT-2 architecture) """ super().__init__() self.tokens_embeddings = nn.Embedding(num_embeddings, em...
79
47.01
118
17
820
python
[]
0
true
2024-11-18T21:26:05.669023+00:00
1,523,690,133,000
f80b6b46ab7166bccb4cec1e2bbeca55282f8a9c
3
{ "blob_id": "f80b6b46ab7166bccb4cec1e2bbeca55282f8a9c", "branch_name": "refs/heads/master", "committer_date": 1523690133000, "content_id": "a4a0ae6485f8877aee0ada484889de39f29c6746", "detected_licenses": [ "MIT" ], "directory_id": "46e694ae829cf0d7bc298f663b12e71511f08f61", "extension": "py", "fi...
2.96875
stackv2
import json def load_vistas(filename): vistas = [] with open(filename, 'r') as f: vista_data = json.load(f) for vista in vista_data['vistas']: vistas.append(Vista(**vista)) return vistas class Vista: def __init__(self, entry=0, name="", location="", map_location="", weat...
59
30.73
133
17
454
python
[]
0
true
2024-11-18T21:26:05.725850+00:00
1,632,477,250,000
d6829d4d79b8fd0e06a4ab584129cc167804a3f2
2
{ "blob_id": "d6829d4d79b8fd0e06a4ab584129cc167804a3f2", "branch_name": "refs/heads/main", "committer_date": 1632477250000, "content_id": "c55c7be732f5297bc3156461f52d427af41ca3d0", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e8103947b7fe84c4b6b4bf82b16c71c81430dc0e", "extension": "py", ...
2.328125
stackv2
# Copyright 2019-2021 Cambridge Quantum Computing # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
98
41.07
98
15
994
python
[]
0
true
2024-11-18T21:26:05.845815+00:00
1,570,971,035,000
5932ae7410d96f31204c0f0513e5214e64400777
3
{ "blob_id": "5932ae7410d96f31204c0f0513e5214e64400777", "branch_name": "refs/heads/master", "committer_date": 1570971035000, "content_id": "857b299ef26866b2ffb14f89f7cf0a02b07d4605", "detected_licenses": [ "MIT" ], "directory_id": "82ec442bd158be156c1eabde1d3ceb48c29d5efc", "extension": "py", "fi...
2.9375
stackv2
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * class LogInDialog(QDialog): def __init__(self): super().__init__() self.setupUI() self.id = None self.password = None def setupUI(self): self.setGeometry(1100, 200, 300, 100) self.setWindowTitle...
71
26.18
66
12
452
python
[]
0
true
2024-11-18T21:26:06.373797+00:00
1,581,966,936,000
39a44c1e099ef697768ade1a9badd200564d00c6
3
{ "blob_id": "39a44c1e099ef697768ade1a9badd200564d00c6", "branch_name": "refs/heads/master", "committer_date": 1581966936000, "content_id": "7a2a936d6488ff993f947b3853027d5c0a96116a", "detected_licenses": [ "MIT" ], "directory_id": "1155a5165de77713a3f57c43d2edebf4f699e1b3", "extension": "py", "fi...
2.84375
stackv2
import os from pybud import json_helper from pybud.printout_builders import * from pybud.utils import * class ConsoleLogger: def __init__(self, file_path): self.file_path = file_path def print_log(self): # parse json log file into dict log: dict = json_helper.json_file_to_dict(self.f...
103
46.52
131
22
1,028
python
[]
0
true
2024-11-18T21:26:06.437910+00:00
1,542,965,698,000
5351a02fe858c42d1f0660597f191a14f018cd88
2
{ "blob_id": "5351a02fe858c42d1f0660597f191a14f018cd88", "branch_name": "refs/heads/master", "committer_date": 1542965698000, "content_id": "80e3a517a5abc1625d636bf0e097547885514c0d", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9874a9db8f2458d461dfb8207bd699ede25af47c", "extension": "py"...
2.359375
stackv2
# Copyright (c) Trainline Limited, 2017. All rights reserved. See LICENSE.txt in the project root for license information. import time from envmgr import Upstream, Service from emcli.commands.base import BaseCommand class ToggleCommand(BaseCommand): def __init__(self, options, *args, **kwargs): super(To...
48
38.67
127
17
421
python
[]
0
true
2024-11-18T21:26:06.537326+00:00
1,643,925,749,000
4f91da7607e2d3b3296325b158d0a827c01cc913
3
{ "blob_id": "4f91da7607e2d3b3296325b158d0a827c01cc913", "branch_name": "refs/heads/master", "committer_date": 1643925749000, "content_id": "f10d613d9085d1a5db053510b9487fc1f1598539", "detected_licenses": [ "MIT" ], "directory_id": "baf3ad75a68b210db946d1719130c6e78c0d0fb6", "extension": "py", "fi...
2.71875
stackv2
"""Train a simple neural network (and calibrate post-hoc) while monitoring log-loss and calibration error.""" if __name__ == "__main__": import numpy as np import matplotlib.pyplot as plt import json import os from sklearn.datasets import fetch_openml from sklearn import model_selection as ms...
126
41.83
115
13
1,402
python
[]
0
true
2024-11-18T21:26:06.645828+00:00
1,577,019,166,000
c66b3fec635b82ea90c26b868a02c902dcb253ff
3
{ "blob_id": "c66b3fec635b82ea90c26b868a02c902dcb253ff", "branch_name": "refs/heads/master", "committer_date": 1577019166000, "content_id": "d9d0bbb996a90398e9f4fe99f6012ce7ce255337", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d61a6df81bca12df0b743053643bc386d15a4b56", "extension": "py"...
3.421875
stackv2
''' @Date: 2019-08-26 20:10:58 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-08-26 20:11:34 ''' number = eval(input("Enter a decimal value (0 to 15): ")) if number >= 0 and number <= 9: print("The hex value is ", number) elif number > 9 and number <= 15...
16
25.12
62
16
170
python
[]
0
true
2024-11-18T21:26:06.830975+00:00
1,607,287,113,000
be8b132c15e41e3fd3f564e36d5df0f5737e834b
3
{ "blob_id": "be8b132c15e41e3fd3f564e36d5df0f5737e834b", "branch_name": "refs/heads/main", "committer_date": 1607287113000, "content_id": "72a40cff0d79a0e8008a95b1049190f682fd11a5", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "4dc00a3f8e755c4a1b8b2c1d05bc191ac3238941", "extension": "py"...
3.25
stackv2
#!/usr/bin/env python3 # Example of a service in ROS 2 # # service.py # # Bill Smart # # This is an example of a simple service client in ROS 2. # Pull in the stuff we need from rclpy. import rclpy from rclpy.node import Node # Types for the service call. We only need the base type, which corresponds to the # Dou...
63
27.9
84
12
467
python
[]
0
true
2024-11-18T21:26:07.160590+00:00
1,605,870,250,000
f1baa2d8d60949300fcff87453a32b7f0f52113e
3
{ "blob_id": "f1baa2d8d60949300fcff87453a32b7f0f52113e", "branch_name": "refs/heads/master", "committer_date": 1605870250000, "content_id": "f4b2f6971e677e254947680ea01d259540f9296c", "detected_licenses": [ "Apache-2.0" ], "directory_id": "a73501828caa6f69bcdaf95a55ed3d75382589b6", "extension": "py"...
2.671875
stackv2
from BHsearchBeta import * import re class CandidateCharlie(Candidate): # 黑洞候选体,对应一个成语,getinfo用到具体网站 def __str__(self): return Candidate.__str__(self) + " " + str(self.pinyin) def getinfo(self): # 获取黑洞信息 try: soup = BeautifulSoup(urlopen(self.link), "html.parser") raw...
94
34.82
91
17
910
python
[]
0
true
2024-11-18T21:26:07.482080+00:00
1,691,603,612,000
ad0170f31a8a783f2f20f242c642602bd0364808
3
{ "blob_id": "ad0170f31a8a783f2f20f242c642602bd0364808", "branch_name": "refs/heads/main", "committer_date": 1691603612000, "content_id": "d1e5d5f6a9b96843c512aeab16c5429cfd0e39e0", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "471867d23165069d1b6c4b9fdb43007eb9bf78d2", "extension": "py"...
2.8125
stackv2
import time import txaio from os import environ from ocs import ocs_agent, site_config from ocs.ocs_twisted import TimeoutLock class BarebonesAgent: """Barebone Agent demonstrating writing an Agent from scratch. This Agent is meant to be an example for Agent development, and provides a clean starting p...
196
31.34
88
21
1,321
python
[]
0
true
2024-11-18T21:26:07.900680+00:00
1,629,600,492,000
6768786aac52b4faf36af2410ac62428e16b82e8
3
{ "blob_id": "6768786aac52b4faf36af2410ac62428e16b82e8", "branch_name": "refs/heads/main", "committer_date": 1629600492000, "content_id": "7b6758eecc84e8daa447d1222f4e53c3d8e26b28", "detected_licenses": [ "MIT" ], "directory_id": "0c09a2680b25263b7d3eac2e5c2a09e3265cae35", "extension": "py", "file...
3.0625
stackv2
import requests ENDPOINT = "https://jsonmock.hackerrank.com/api/football_matches" def getNumDraws(year): draws = 0 for goal in range(0,11): params = { 'year': year, 'team1goals': goal, 'team2goals': goal, 'page': 2 } response = requests.get...
16
26.5
67
13
118
python
[]
0
true
2024-11-18T21:26:08.467114+00:00
1,604,504,995,000
9efeb6d22694401157c6997e28e5f04240183e9a
2
{ "blob_id": "9efeb6d22694401157c6997e28e5f04240183e9a", "branch_name": "refs/heads/master", "committer_date": 1604504995000, "content_id": "be54d9d09cd7ac5aea99c83da56f35ee59a65fe7", "detected_licenses": [ "MIT" ], "directory_id": "3ac2258f874cf0d3dd3995507f1a92d4ff985cdd", "extension": "py", "fi...
2.46875
stackv2
import rospy import numpy as np from ...types.detection import Detection from ..assignment.linear_assignment import LinearAssignment from ...utils.bbox_metrics import overlap import cv2 from .monitor import Monitor MAX_DEPTH = 10.0 MIN_EYE_PATCH_WIDTH = 5 MIN_EYE_PATCH_HEIGHT = 3 EYE_INPUT_WIDTH = 60 EYE_INPUT_HEIGHT...
153
39.92
115
21
1,349
python
[]
0
true
2024-11-18T21:26:08.523738+00:00
1,602,221,603,000
acdd89a61024cc323f22f7fa65da9711fd618f22
3
{ "blob_id": "acdd89a61024cc323f22f7fa65da9711fd618f22", "branch_name": "refs/heads/master", "committer_date": 1602221603000, "content_id": "37576b4109d51a803108d0312d9578d4456095cb", "detected_licenses": [ "MIT" ], "directory_id": "81407be1385564308db7193634a2bb050b4f822e", "extension": "py", "fi...
3.078125
stackv2
# 实现pandas DataFrame 和spark dataFrame 相互转换 import pandas as pd from pyspark.sql import SparkSession spark = SparkSession \ .builder \ .appName("dataFrame") \ .getOrCreate() # Loads data. ll3 = pd.DataFrame([[1, 2], [3, 4]], columns=['a', 'b']) cc = ll3.values.tolist() dd = list(ll3.columns) # df=spark....
27
20.67
56
9
160
python
[]
0
true
2024-11-18T21:26:08.706509+00:00
1,590,629,240,000
0bfd6441f4c8dc36d319897f2df6fd0b534d8eef
3
{ "blob_id": "0bfd6441f4c8dc36d319897f2df6fd0b534d8eef", "branch_name": "refs/heads/master", "committer_date": 1590629240000, "content_id": "a004e5b0b6c4f27fa0fbadbc3a8a3c4322cad115", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "e754fd34d40b41cd56adc947309832574094e0b6", "extension": "p...
2.75
stackv2
from __future__ import division import timeit def run_test(img_size, cell_size, block_size): N = 10 setup = """ import numpy as np import amitgroup as ag import matplotlib.pylab as plt import os.path np.random.seed(0) im = np.random.random({0}) """.format(img_size) dt = timeit.Timer("ag.features.hog...
27
27.22
124
14
249
python
[]
0
true
2024-11-18T21:26:08.764243+00:00
1,577,793,083,000
65815ffeed356859be867f33806d08f3f3a0a50b
4
{ "blob_id": "65815ffeed356859be867f33806d08f3f3a0a50b", "branch_name": "refs/heads/master", "committer_date": 1577793083000, "content_id": "9a3a3f434165f3317928c418dd8c4396d6a8e66d", "detected_licenses": [ "MIT" ], "directory_id": "5138b1a27a7514b75d87a7742e47c604dc74b894", "extension": "py", "fi...
3.53125
stackv2
from abc import ABC, abstractmethod from random import randint from time import sleep from typing import NamedTuple, Union from christmas.support import reset_terminal _RANDOM: int = randint(1, 30) def tree_length(from_: int, to_: int = _RANDOM) -> int: return randint(from_, to_) def format_tree(character: Un...
74
22.84
79
15
453
python
[]
0
true
2024-11-18T21:26:08.828258+00:00
1,619,999,927,000
9789928a60bd0b038a520a049ffe24b63dbcf668
3
{ "blob_id": "9789928a60bd0b038a520a049ffe24b63dbcf668", "branch_name": "refs/heads/master", "committer_date": 1619999927000, "content_id": "7041dc05a51b6366481e9951f2b67e571b2cfdc0", "detected_licenses": [ "MIT" ], "directory_id": "f6dcbb9058ca4f4b3846a2bccf14adac6a780d18", "extension": "py", "fi...
2.765625
stackv2
from selenium import webdriver import time from capture import Capture from control import Control def correction(error, rate, negative_correction, positive_correction): rate_limit = error / 40 print('Error:', error, 'Rate:', rate, 'Limit:', rate_limit) if error <= -0.5: # Correct negatively (p...
181
27.88
138
13
1,260
python
[]
0
true
2024-11-18T21:26:09.942539+00:00
1,300,228,670,000
3519e20d082ad2dd183ca148650dd5fa1c08b86d
3
{ "blob_id": "3519e20d082ad2dd183ca148650dd5fa1c08b86d", "branch_name": "refs/heads/master", "committer_date": 1300228670000, "content_id": "85d5c450dec863b16657a09a7a8b10d136419479", "detected_licenses": [ "Apache-2.0" ], "directory_id": "97295be5622977ca74cb180d5624d8d439766ad4", "extension": "py"...
2.5625
stackv2
from collections import defaultdict def queryset_to_dict(qs, key='pk', singular=True): """ Given a queryset will transform it into a dictionary based on ``key``. """ if singular: result = {} for u in qs: result.setdefault(getattr(u, key), u) else: result = defaul...
100
32.03
155
20
741
python
[]
0
true
2024-11-18T21:26:10.340599+00:00
1,467,690,434,000
330ea12b8b7557d456c94c2bfade9fe6ce685e5e
4
{ "blob_id": "330ea12b8b7557d456c94c2bfade9fe6ce685e5e", "branch_name": "refs/heads/master", "committer_date": 1467690434000, "content_id": "815a5718365fe8781aaf0f4134438fc7e5406cd0", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "d57eeb1cf5e25ba02fb70c0f66b04f7282ace7c3", "extension": "p...
3.703125
stackv2
#!/user/bin/python3 #^.^ coding=utf-8 ^.^# # ASCII # Unicode # UTF-8 #ASCII is a subset of Unicode print("'A' ASCII Code:", ord('A')) print("34678 Unicode Char:", chr(34678)) # In Python3, if want to transmit string in network, need to transform string to bytes. str_type = "abc" bytes = b'abc' print("str type:",...
22
21.82
87
12
150
python
[]
0
true
2024-11-18T21:26:10.807977+00:00
1,671,301,296,000
0bb537619622bd265266dfb2d3842ae5d19da7da
3
{ "blob_id": "0bb537619622bd265266dfb2d3842ae5d19da7da", "branch_name": "refs/heads/master", "committer_date": 1671301296000, "content_id": "d452740a98733c4621852cf36f8ea35634c13ecb", "detected_licenses": [ "MIT" ], "directory_id": "36dbfa7b8866f0c5981a2b915e70d745f5d13826", "extension": "py", "fi...
2.765625
stackv2
"""font_loader module This modules enables (and automatically performs) loading of TTF fonts. By default, it loads some Microsoft fonts using load_standard_windows_fonts() and a few open-source fonts in load_standard_open_source_fonts(). However, you can add your fonts using load_ttf_font(). """ import logging impo...
318
29.37
88
18
2,323
python
[]
0
true
2024-11-18T21:26:11.077270+00:00
1,625,183,334,000
5eab7f266cd3935b077286deb45eee556c7c3dd2
2
{ "blob_id": "5eab7f266cd3935b077286deb45eee556c7c3dd2", "branch_name": "refs/heads/main", "committer_date": 1625183334000, "content_id": "2477a754cfb9b888fd478ce9f9cda7dd26cb49bc", "detected_licenses": [ "MIT" ], "directory_id": "3e37643141d524511da4b7850b5bc77ad3584b90", "extension": "py", "file...
2.3125
stackv2
import discord async def quick_embed(ctx, reply=True, send=True, **kwargs): title = kwargs.get("title", "") description = kwargs.get("description", "") timestamp = kwargs.get("timestamp") color = kwargs.get("color", discord.Color.random()) thumbnail = kwargs.get("thumbnail") author = kwar...
61
25.26
85
16
370
python
[]
0
true
2024-11-18T21:26:11.190622+00:00
1,646,573,001,000
f3cb6613d48f44c578c94d0ad0ffa770b212afbe
3
{ "blob_id": "f3cb6613d48f44c578c94d0ad0ffa770b212afbe", "branch_name": "refs/heads/master", "committer_date": 1646573001000, "content_id": "a8830061e3019cf817dcfc6e2329a16ce6e5eb5d", "detected_licenses": [ "MIT" ], "directory_id": "c5bdac83ee38266bbf049a7fc1dd2756217df941", "extension": "py", "fi...
2.84375
stackv2
""" Extract library writer module. Write out Twitter data to a CSV. There are multiple functions here write out a CSV to a required location, based on the data required to be written. The path is variable and the filename part is expected to be descriptive of the method of fetching from the API. Rows are appended so...
181
34.43
118
13
1,399
python
[]
0
true
2024-11-18T21:26:11.319218+00:00
1,598,041,397,000
b34bfb95b2c75aa81f44532d739cb8e58cb95d2a
3
{ "blob_id": "b34bfb95b2c75aa81f44532d739cb8e58cb95d2a", "branch_name": "refs/heads/master", "committer_date": 1598041397000, "content_id": "d14e52e9951f764a9e0e06e85d23a9f2f227d457", "detected_licenses": [ "ISC" ], "directory_id": "709f42f256de783a45e721b04241149935e780d4", "extension": "py", "fi...
2.96875
stackv2
"""Tools for saving and loading trajectories without requiring the `imitation` or `tensorflow` packages to be installed.""" import gzip from pickle import Unpickler from typing import List, NamedTuple, Optional import gym import numpy as np from magical.benchmarks import DEFAULT_PREPROC_ENTRY_POINT_WRAPPERS class M...
150
37.81
79
15
1,341
python
[]
0
true
2024-11-18T21:26:12.374261+00:00
1,610,062,567,000
a81659546fd0c11b5f3d55c4086561bae8f6ff21
3
{ "blob_id": "a81659546fd0c11b5f3d55c4086561bae8f6ff21", "branch_name": "refs/heads/main", "committer_date": 1610062567000, "content_id": "99bd1d8bd28496612320dfa03218d43e79f410a2", "detected_licenses": [ "MIT" ], "directory_id": "599b60f9a8d0ce6dc177a230522ea65ca155c5ef", "extension": "py", "file...
2.6875
stackv2
import sys from pathlib import Path import pandas as pd from ..utils import csv_file_to_df, csv_string_to_df, df_to_flatten_d_list, extraction_df, get_api_response, \ output_csv_from_df, stats_res_formatter, validation_stats_url class StatsIds: """統計表ID一覧を扱うクラス""" def __init__( self, ...
178
28.2
110
14
1,433
python
[]
0
true
2024-11-18T21:26:12.444796+00:00
1,631,550,124,000
273e3f54a3dc6ca2bbf25919d49ff11e63273004
3
{ "blob_id": "273e3f54a3dc6ca2bbf25919d49ff11e63273004", "branch_name": "refs/heads/master", "committer_date": 1631550124000, "content_id": "defeb5c8c9b8371c702a50696f9fe4267f13457e", "detected_licenses": [ "MIT" ], "directory_id": "57b746d46c77c8b084d0ec32a3bd7cfa4ea5fa47", "extension": "py", "fi...
2.625
stackv2
from PIL import Image import os def resizeImages(browserName): try: path = 'build/reports/geb/'+browserName for filename in os.listdir(path): if filename.endswith('.png'): im = Image.open(path+"/"+filename) size =im.size # get the size of the input image ratio = 0.4 # reduced...
36
29.47
65
18
273
python
[]
0
true
2024-11-18T21:26:12.559998+00:00
1,513,449,367,000
8b8edc495b9f3dcdff214f93752d10d84e916ce4
2
{ "blob_id": "8b8edc495b9f3dcdff214f93752d10d84e916ce4", "branch_name": "refs/heads/master", "committer_date": 1513449367000, "content_id": "344f1ec52a7a4ba3cadd53feebbc2334448b66e4", "detected_licenses": [ "MIT" ], "directory_id": "34d25cecda26dac7c068472e142a2e62b8000670", "extension": "py", "fi...
2.34375
stackv2
#!/usr/bin/env python import pika, json, boto3 sqs = boto3.client('sqs') queue_url = 'https://sqs.eu-west-1.amazonaws.com/340053764926/temp-and-humidity.fifo' connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost')) channel = connection.channel() channel.exchange_declare(exchange='temp_and_h...
34
27.65
85
10
228
python
[]
0
true
2024-11-18T21:26:12.849323+00:00
1,333,313,340,000
75020a47dcee95bff4d5b6a519ae0b33eecb6337
3
{ "blob_id": "75020a47dcee95bff4d5b6a519ae0b33eecb6337", "branch_name": "refs/heads/master", "committer_date": 1333313340000, "content_id": "00e50d4f1853e44a9246549148bbf54c51d7e187", "detected_licenses": [ "MIT", "BSD-2-Clause" ], "directory_id": "a8352c16dd25bb11e6d2cb49e862ca1a5bfc22cf", "ext...
3.171875
stackv2
""" Parses array messages as returned by GAE Channel service""" import re class ParseError(StandardError): pass _dquote_search = re.compile('(?<!\\\)"') _squote_search = re.compile('(?<!\\\)\'') _number_matcher = re.compile('(-?\d+)\.?(\d+)?') _digit_strings = [str(i) for i in range(10)] + ['-'] _searchers = {'"...
97
29.22
73
17
683
python
[]
0
true
2024-11-18T21:26:13.054294+00:00
1,621,083,008,000
c4d515f684a735a5ae0fbe246ceb8942a4048eda
2
{ "blob_id": "c4d515f684a735a5ae0fbe246ceb8942a4048eda", "branch_name": "refs/heads/main", "committer_date": 1621083008000, "content_id": "d55594855ec2680585bed4589144d03246e887af", "detected_licenses": [ "MIT" ], "directory_id": "f546cbd3a087d74e7c50bbb9900ae86543cbdd2d", "extension": "py", "file...
2.3125
stackv2
import os import logging import shelve import discord from discord.ext import commands from dotenv import load_dotenv from notgambling.smallgames import SimpleGames class SemidbmShelf(shelve.Shelf): """Shelf implementation using the "semidbm" dbm interface. This is initialized with the filename for the dbm ...
95
27.21
97
19
652
python
[]
0
true
2024-11-18T21:26:13.167500+00:00
1,323,162,652,000
75c8829e7bd8336d294e6655c97cc71d00352c83
3
{ "blob_id": "75c8829e7bd8336d294e6655c97cc71d00352c83", "branch_name": "refs/heads/master", "committer_date": 1323162652000, "content_id": "798cc59e7c6bbf073828b085f01f04123a409368", "detected_licenses": [ "MIT", "BSD-2-Clause" ], "directory_id": "39401f27cb1e35969886ae86b6579b49b406146a", "ext...
2.8125
stackv2
import re import itertools from cStringIO import StringIO from node import Node TAGNAME_REGEX = re.compile("[a-zA-Z_][a-zA-Z0-9_]*") ARGUMENT_REGEX = re.compile("\s+([a-zA-Z_][a-zA-Z0-9_]*)=([^\s\"]+|\"(?:\\\\\"|[^\"])*\")") HEREDOC_REGEX = re.compile("\s+->\s*$") def add_lookahead(iterable): a, b = itertools.t...
101
26.82
112
17
669
python
[]
0
true
2024-11-18T21:26:13.453991+00:00
1,609,962,278,000
0c75092dca15c77e3a127c0b4c2351359cd131f5
4
{ "blob_id": "0c75092dca15c77e3a127c0b4c2351359cd131f5", "branch_name": "refs/heads/master", "committer_date": 1609962278000, "content_id": "5850932c4a6d8d836ae8af3c8eb9b20f26cf748a", "detected_licenses": [ "MIT" ], "directory_id": "2e13f4af4f00a9de41883e6e50f220ba161278cc", "extension": "py", "fi...
3.625
stackv2
lista = list() dados = list() maior = menor = nM = menorN = cad = 0 while True: dados.append(str(input('Nome: '))) dados.append(int(input('Peso: '))) lista.append(dados[:]) dados.clear() cad +=1 r = input('Deseja continuar? [S/N]: ') if r in 'nN': break for p in lista: if p == 0:...
28
23.86
46
12
223
python
[]
0
true
2024-11-18T21:26:13.621384+00:00
1,466,605,876,000
159177df5a56be3480b525e75e9d2c61c7f77b86
3
{ "blob_id": "159177df5a56be3480b525e75e9d2c61c7f77b86", "branch_name": "refs/heads/master", "committer_date": 1466605876000, "content_id": "e545079a81d3e3e602f44f1dcb86f53689c69723", "detected_licenses": [ "MIT" ], "directory_id": "b1ba299c6e08304aee8a9b27f462cafecbd28999", "extension": "py", "fi...
3.125
stackv2
from string import ascii_letters, digits def forTwitter(string): TWITTER_ALLOWED_CHARS = frozenset(ascii_letters + digits + '-._~') if type(string) is not str: string = str(string) encoded = '' for char in string: if char in TWITTER_ALLOWED_CHARS: enco...
16
35.38
76
26
126
python
[]
0
true
2024-11-18T21:26:13.832362+00:00
1,587,675,760,000
03979653576ff54bd2fecbaf01f7cc9e80712a80
4
{ "blob_id": "03979653576ff54bd2fecbaf01f7cc9e80712a80", "branch_name": "refs/heads/master", "committer_date": 1587675760000, "content_id": "47896ddcc1e2aeaf643d5fbbec622d2437a2e2d0", "detected_licenses": [ "MIT" ], "directory_id": "82bdcbda521ea3bb072cba87a5372637720b3b85", "extension": "py", "fi...
3.671875
stackv2
from Player import Player from Hand import Hand from Deck import Deck from Pot import Pot from random import choice, randint ''' Function used by both classes. Return the object of the next player to bid. ''' def get_next_player(prev_player, players): prev_player_index = players.index(prev_player) next_playe...
268
32.74
114
18
2,008
python
[]
0
true
2024-11-18T21:26:13.987330+00:00
1,516,176,325,000
558e3cc47afc582472b793d929f8174d7c70942f
2
{ "blob_id": "558e3cc47afc582472b793d929f8174d7c70942f", "branch_name": "refs/heads/master", "committer_date": 1516176325000, "content_id": "4202c198b5f6b3fce1b6dee56c97f2bc0fbd9c45", "detected_licenses": [ "MIT" ], "directory_id": "41378817356d30dcef65b4132996729266c79c51", "extension": "py", "fi...
2.34375
stackv2
#!/usr/bin/python3 from subprocess import Popen, PIPE; from os import environ from os.path import dirname def popen_proc(cmd): p = Popen(cmd, stdout=PIPE, stderr=PIPE); return p.communicate(), p def popen_shell(cmd): print("-" * 20, "INTERACTIVE", "-"*20) p = Popen(cmd) return (0, 0), p def a...
51
24.18
82
14
356
python
[]
0
true
2024-11-18T21:26:14.114735+00:00
1,535,656,317,000
2bd63e751784093dd38acffcb80466510f90ab84
3
{ "blob_id": "2bd63e751784093dd38acffcb80466510f90ab84", "branch_name": "refs/heads/master", "committer_date": 1535656317000, "content_id": "49cbf659f29d0f591aa918fb7af4d26bf3486b08", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "397dbd34277f873a3d3fb1af4a206272699ba178", "extension": "p...
2.59375
stackv2
from ipywidgets import ValueWidget, Widget from ipywidgets import CallbackDispatcher from ipywidgets import FloatSlider class Filter(object): def __init__(self, func=None, disabled=False): self._disabled = disabled self._func = func self._dispatcher = CallbackDispatcher() def __call__(...
91
24.41
78
16
548
python
[]
0
true
2024-11-18T21:26:14.184375+00:00
1,464,469,720,000
f1d15058b590d16c2f0639a6733bb23548e4cb17
3
{ "blob_id": "f1d15058b590d16c2f0639a6733bb23548e4cb17", "branch_name": "refs/heads/master", "committer_date": 1464469720000, "content_id": "d93e36f9656e2925280b414c2d28ff4ff2e7463d", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "e76ae4b4ba556c4b5e95a8070673ebf24f8fac59", "extension": "p...
2.5625
stackv2
import audiogen import audiogen.util import itertools import contextlib HERTZ = 770 BANDWIDTH = 200 DEFAULT_WPM = 20 # # todo: support parsing of prosigns # # ARRL Morse Transmission Timing Standard # http://www.arrl.org/files/file/Technology/x9004008.pdf # WPM determined by P-A-R-I-S, or 50 dit lengths (with spa...
221
24.1
85
15
1,858
python
[]
0
true
2024-11-18T21:26:14.303528+00:00
1,633,373,470,000
43b238699e7eae3ff9c872a97e384041efb20547
2
{ "blob_id": "43b238699e7eae3ff9c872a97e384041efb20547", "branch_name": "refs/heads/master", "committer_date": 1633373470000, "content_id": "accfb956a2385f06badc6d315356d8a74d7b51fb", "detected_licenses": [ "MIT" ], "directory_id": "5fd6675b9f1679d3061b6d6e0b755d56618a59e6", "extension": "py", "fi...
2.390625
stackv2
import redis import json import threading from truck_delivery_atge.shared_core import configuration from truck_delivery_atge.db_connector import DBConnector def _get_redis(): try: host = configuration.config_from_var('host') port = int(configuration.config_from_var('port')) return redis.R...
74
28.81
69
13
468
python
[]
0
true
2024-11-18T21:26:14.565968+00:00
1,413,808,087,000
4907edb50b59b56af2c962e3d4ce6c3f18a62032
2
{ "blob_id": "4907edb50b59b56af2c962e3d4ce6c3f18a62032", "branch_name": "refs/heads/master", "committer_date": 1413808087000, "content_id": "d9479fae52c55bb60b126908ce385c82c74dc32f", "detected_licenses": [ "MIT" ], "directory_id": "74b7c1cabc01b329e03487d8e1f4b279547e611b", "extension": "py", "fi...
2.328125
stackv2
from Tkinter import * import ttk import os import serial import time import MySQLdb as mdb from time import sleep from compiler.pycodegen import EXCEPT def check(): global shutdown shutdown = connection(1) global restart restart = connection(2) global logout logout = connection(3) global lock lock = connecti...
179
17.28
75
12
950
python
[]
0
true
2024-11-18T21:26:14.668751+00:00
1,611,343,065,000
3e8b02750af0903e62693d7bee1db9cb24162afd
3
{ "blob_id": "3e8b02750af0903e62693d7bee1db9cb24162afd", "branch_name": "refs/heads/master", "committer_date": 1611343065000, "content_id": "82dcb10730c45dd0bfae60627427dcb5307833e1", "detected_licenses": [ "MIT" ], "directory_id": "00121c1666a4c943807995b461e21edc140d5d35", "extension": "py", "fi...
3.046875
stackv2
#!/bin/python3 import math import os import random import re import sys # Complete the equalizeArray function below. def equalizeArray(a): dis=[] f=[] used=[] for i in range(len(a)): if a[i] not in used: c=a.count(a[i]) f.append(c) used.append(a[i]) m=ma...
33
16.67
50
16
156
python
[]
0
true
2024-11-18T21:26:14.727616+00:00
1,423,400,389,000
d0cdde2fa935a022b3017a3a1912adfa12f4ccd5
4
{ "blob_id": "d0cdde2fa935a022b3017a3a1912adfa12f4ccd5", "branch_name": "refs/heads/master", "committer_date": 1423400389000, "content_id": "dec38796637a7160ad29fe4df2e0abc75f34f95e", "detected_licenses": [ "MIT" ], "directory_id": "24ef9a2a44858c55d614e25ffa4f686991530992", "extension": "py", "fi...
3.609375
stackv2
"""Find the minimum fixed monthly payment needed in order pay off a credit card balance within 12 months""" __author__ = 'Nicola Moretto' __license__ = "MIT" def annualPayment(balance, annualInterestRate): ''' Return the minimum fixed monthly payment needed in order pay off a credit card balance within 12 mon...
29
36.38
107
13
243
python
[]
0
true
2024-11-18T21:26:14.960383+00:00
1,461,452,224,000
09f8a895423e43be104e92d946058dfeb6d79863
3
{ "blob_id": "09f8a895423e43be104e92d946058dfeb6d79863", "branch_name": "refs/heads/master", "committer_date": 1461452224000, "content_id": "5b93926011e29c2f5ec638de3b5643a09240e7b9", "detected_licenses": [ "MIT" ], "directory_id": "755c2045ad46a8e6ab19bd6bb9fb350023a5688c", "extension": "py", "fi...
3.40625
stackv2
import re class TemplateError(Exception): pass class TemplateEmpty(TemplateError): pass class TemplateNotFound(TemplateError): pass class Templait: """ A template class for rendering template files. To use, initialize Templait() with the filename of the template and a dictionary of replacement t...
69
29.83
86
15
487
python
[]
0
true
2024-11-18T21:26:15.021397+00:00
1,636,569,976,000
34fd649c52e82bc57ca5a1d81ad8db25b8bc9ebf
2
{ "blob_id": "34fd649c52e82bc57ca5a1d81ad8db25b8bc9ebf", "branch_name": "refs/heads/main", "committer_date": 1636569976000, "content_id": "e83067efd4b2445e97fd3b1507ad247988d7c466", "detected_licenses": [ "MIT" ], "directory_id": "81d532e23d2278e6f72a7c4eaaf46c72b7cdbcb3", "extension": "py", "file...
2.3125
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # %% Libraries import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers from tensorflow.keras.preprocessing.image import ImageDataGenerator import os import datetime #impots for tensorboard, windows import matplotlib.pyplot as plt import p...
177
27.71
122
13
1,262
python
[]
0
true
2024-11-18T21:26:15.073643+00:00
1,614,021,704,000
9b3d18f82cf990077a6a56e8bcf3bf804a45a739
4
{ "blob_id": "9b3d18f82cf990077a6a56e8bcf3bf804a45a739", "branch_name": "refs/heads/main", "committer_date": 1614021704000, "content_id": "ec00b9ee7558b3db121815fc23d31e1068618174", "detected_licenses": [ "MIT" ], "directory_id": "c1542a474b0df42ac0fef4de5f25808f12c8cf91", "extension": "py", "file...
4.46875
stackv2
""" write a function that capitalizes the first and fourth letters of a name ex: capitalize("macdonald") --> MacDonald """ # solution 1 def capitalize(name): first_letter = name[0] in_between = name[1:3] fourth_letter = name[3] rest = name[4:] return first_letter + in_between + fourth_letter + res...
35
18.09
72
8
163
python
[]
0
true
2024-11-18T21:26:15.138503+00:00
1,627,285,446,000
e63eacdfdbe97eee1d08e4f68dda147835a50007
2
{ "blob_id": "e63eacdfdbe97eee1d08e4f68dda147835a50007", "branch_name": "refs/heads/master", "committer_date": 1627285446000, "content_id": "cdbe59edf005c0f039fb9559c4b0d9ade0c6c427", "detected_licenses": [ "Apache-2.0" ], "directory_id": "bd82cb4d8ad0c35e4f5bf904004f3ec2090fcadd", "extension": "py"...
2.421875
stackv2
from trec_car.read_data import * import argparse from tqdm import tqdm # # config # parser = argparse.ArgumentParser() parser.add_argument('--in-file', action='store', dest='in_file', help='trec car paragraph collection file', required=True) parser.add_argument('--out-file', action='store', dest=...
25
26.16
95
17
164
python
[]
0
true
2024-11-18T21:26:15.278563+00:00
1,514,421,526,000
192025409ab81f47396926648a719ba321e82517
3
{ "blob_id": "192025409ab81f47396926648a719ba321e82517", "branch_name": "refs/heads/master", "committer_date": 1514421526000, "content_id": "fff8420784e734bf0bf80e057247a56810ad7663", "detected_licenses": [ "MIT" ], "directory_id": "48bdb063c97edcba31470512e0ecdd5700e4cd2e", "extension": "py", "fi...
2.734375
stackv2
import aiohttp import json from .fetcher import Fetcher class BlockChainInfoAPI(Fetcher): _URL = 'https://blockchain.info/ru/address/{}?format=json' async def get_btc_balance(self, loop, address, symbol='BTC', callback=None): if address is None: raise ValueError("address must be specifi...
21
34.29
80
14
164
python
[]
0
true
2024-11-18T21:26:15.340396+00:00
1,541,542,144,000
1ba253ca992f2ee78b3b22ff9b261e606adf2c02
3
{ "blob_id": "1ba253ca992f2ee78b3b22ff9b261e606adf2c02", "branch_name": "refs/heads/master", "committer_date": 1541542144000, "content_id": "4edfef2537c5dd2223ee09cbceaffb697267a0ad", "detected_licenses": [ "Apache-2.0" ], "directory_id": "df7eeb4f1498bc47bb85ab5f8f44e5bec6734b58", "extension": "py"...
2.859375
stackv2
# -*- coding: utf-8 -*- """ wrapper for the OXO api (reverse engineered! argh!) """ import logging import time import requests from requests import HTTPError __all__ = [ 'OxoClient' ] OXO = 'https://www.ebi.ac.uk/spot/oxo/api' MAXSIZE = 500 logger = logging.getLogger(__name__) class OxoClient: ''' OX...
129
26.59
109
20
877
python
[]
0
true
2024-11-18T21:26:15.565203+00:00
1,595,587,651,000
249538ce57457e5262c1b7b56e9df606dbd9863e
3
{ "blob_id": "249538ce57457e5262c1b7b56e9df606dbd9863e", "branch_name": "refs/heads/master", "committer_date": 1595587651000, "content_id": "6b253dc71822ade681d9550de2714d66139139b1", "detected_licenses": [ "MIT" ], "directory_id": "7c7b5ab5614c9ec72d527a854e643eaa7a4437f4", "extension": "py", "fi...
3.171875
stackv2
# -*- coding: utf-8 -*- """ Classes for defining new chemical relationships """ import copy from itertools import product from .entity import Entity from .utils import KnuthMorrisPratt class Relation(object): """Relation class Essentially a placeholder for related of entities """ def __init__(self, ...
58
25.47
91
14
315
python
[]
0
true
2024-11-18T21:26:15.813213+00:00
1,460,215,909,000
7a37b6e175412d742b52e36098a5482c7215e81d
2
{ "blob_id": "7a37b6e175412d742b52e36098a5482c7215e81d", "branch_name": "refs/heads/master", "committer_date": 1460215909000, "content_id": "2cb37d005a4ba69c33683490b9c362f082ab687e", "detected_licenses": [ "MIT" ], "directory_id": "229f505b252fec747f89c687497995d8946114df", "extension": "py", "fi...
2.40625
stackv2
import os from flask import Flask,render_template, request, jsonify from tweetdump import * from sentAnalysis import * import json app = Flask(__name__) @app.route('/') def hello(): # data = get_all_tweets('#Bahrain') # # tweets = sentimentAnalysis(data) # str = '' # for i in data: # str += i[2]+'\n' data = tr...
59
28.78
88
19
454
python
[{"finding_id": "codeql_py/flask-debug_5a496bc76a2e5406_9aaf5e9b", "tool_name": "codeql", "rule_id": "py/flask-debug", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger.", ...
1
true
2024-11-18T21:26:15.936127+00:00
1,558,041,818,000
a50dd76eef14a7b8ec190d53472023c12e56f374
4
{ "blob_id": "a50dd76eef14a7b8ec190d53472023c12e56f374", "branch_name": "refs/heads/master", "committer_date": 1558041818000, "content_id": "9c37903921d37c7c0526d65c5f9b18eee67d4379", "detected_licenses": [ "MIT" ], "directory_id": "e56f15197a666450912c82aafa6c1a0f890e607a", "extension": "py", "fi...
4.28125
stackv2
#!python """ Bases.py contains function for converting and working with bases. Decode: takes in number and converts to base 10 Encode: takes in number in base 10 and converts to another base Convert: converts number from 1 base to another base """ import string import math # Hint: Use these string constants to encod...
92
35.21
84
14
890
python
[]
0
true
2024-11-18T21:26:16.213573+00:00
1,558,184,537,000
459df39438aedc478d31859d58501e11bd5f0823
2
{ "blob_id": "459df39438aedc478d31859d58501e11bd5f0823", "branch_name": "refs/heads/master", "committer_date": 1558184537000, "content_id": "92219e567a0f04880f66c557695ae7886eaf46ea", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d7d278809f024071b5f6d3083d7c249c7c05c509", "extension": "py"...
2.359375
stackv2
import os import tensorflow as tf import logging log = logging.getLogger('semantic_segmentation') def train_init(config, params, scope='init'): # different situations for initialization: # 1) initialize from init_ckpt_path (log_dir has to be empty from checkpoints) # 2) continue training from log_dir ...
75
52.6
159
24
811
python
[]
0
true
2024-11-18T21:26:16.482947+00:00
1,621,737,801,000
7272f0581a82b320c4ec9ea923dfe9d039e4f19c
3
{ "blob_id": "7272f0581a82b320c4ec9ea923dfe9d039e4f19c", "branch_name": "refs/heads/master", "committer_date": 1621737801000, "content_id": "d424825fecbde94fc34620a079f8f86fc82b6171", "detected_licenses": [ "MIT" ], "directory_id": "18a6b272d4c55b24d9c179ae1e58959674e53afe", "extension": "py", "fi...
2.703125
stackv2
import numpy as np import tensorflow as tf import torch from torch import nn as nn def swish(x): return x * torch.sigmoid(x) def truncated_normal(size, std): # We use TF to implement initialization function for neural network weight because: # 1. Pytorch doesn't support truncated normal # 2. This sp...
37
28.22
107
14
251
python
[]
0
true
2024-11-18T21:26:16.529346+00:00
1,436,320,580,000
cbd3d9cea5bb89c75c8bf9e97bfb60bec4355e44
2
{ "blob_id": "cbd3d9cea5bb89c75c8bf9e97bfb60bec4355e44", "branch_name": "refs/heads/master", "committer_date": 1436320580000, "content_id": "2f6f714db87d83bea2c8ba117f390a004706bb52", "detected_licenses": [ "MIT" ], "directory_id": "5988466205296b0ccd7b185e4b1ec1db6f959312", "extension": "py", "fi...
2.484375
stackv2
######################################################################################## ## This file is a part of YAP package of scripts. https://github.com/shpakoo/YAP ## Distributed under the MIT license: http://www.opensource.org/licenses/mit-license.php ## Copyright (c) 2011-2013 Sebastian Szpakowski #############...
161
34.29
123
20
1,273
python
[]
0
true
2024-11-18T21:26:16.631886+00:00
1,371,522,074,000
785b7174e43ed0fb7204281dd0140a1a6e18f416
3
{ "blob_id": "785b7174e43ed0fb7204281dd0140a1a6e18f416", "branch_name": "refs/heads/master", "committer_date": 1371522074000, "content_id": "27266f4b9bc41d608e57f7f7301a9e234c43bae7", "detected_licenses": [ "MIT" ], "directory_id": "ff3e40517fc3098284fdab608cf1c9d1af1cbe92", "extension": "py", "fi...
2.703125
stackv2
import struct import socket import json import select class LawnConnection: def __init__(self, hostname): self.hostname = hostname self.isWaitingOnReply = False def sendPacket(self, packet): print "sending packet" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s....
36
28
61
13
245
python
[]
0
true
2024-11-18T21:26:16.704671+00:00
1,595,880,077,000
d1f12108e905fb1ebe72d1520ef6fa4be3c7c29c
2
{ "blob_id": "d1f12108e905fb1ebe72d1520ef6fa4be3c7c29c", "branch_name": "refs/heads/master", "committer_date": 1595880077000, "content_id": "57ab1c59f4655660be32266b8e3185f40ca57ca4", "detected_licenses": [ "MIT" ], "directory_id": "68cdae1bfc8443204ede1b292a876a21168f2d20", "extension": "py", "fi...
2.421875
stackv2
""" A custom Agent class for a Mesa simulation. """ from mesa import Agent, Model from .make_python_identifier import make_python_identifier as mpi from collections import Iterable, namedtuple from dataclasses import dataclass, field from typing import Any, List, Dict, Callable import copy import dill import json # --...
374
41.81
119
22
3,544
python
[]
0
true
2024-11-18T21:26:16.749645+00:00
1,428,146,792,000
5de0ea7f90bdb8a7b5621b7ea6e2888f8edbb184
2
{ "blob_id": "5de0ea7f90bdb8a7b5621b7ea6e2888f8edbb184", "branch_name": "refs/heads/master", "committer_date": 1428146792000, "content_id": "1f2d374a27964753d905e8732dad67ac4cc34d00", "detected_licenses": [ "MIT" ], "directory_id": "c13b6251c3b0ab25d8ffd0def1f83202e91aa3d5", "extension": "py", "fi...
2.421875
stackv2
#!/usr/bin/env python2.7 """A web server that barbarically bridges IRC to HTTP to allow chat via computercraft""" __author__ = "Original by Trevor Merrifield, modified by Koaps" import sys import time import json import argparse import threading import cyclone.web import cyclone.escape from twisted.python import log...
149
27.58
78
13
982
python
[]
0
true
2024-11-18T21:26:16.813286+00:00
1,632,438,276,000
f3cea4943295f1ad1a906565dcb6a1ad27116253
3
{ "blob_id": "f3cea4943295f1ad1a906565dcb6a1ad27116253", "branch_name": "refs/heads/main", "committer_date": 1632438276000, "content_id": "9640c2dd0785cc2f279009703c81356b7a7741ac", "detected_licenses": [ "MIT" ], "directory_id": "f629c8304bb95b1f1d15ae4d6687641bc97a4b1b", "extension": "py", "file...
2.71875
stackv2
from flask import Flask, render_template app = Flask(__name__) @app.route("/editor") def editor(): page = {'lines': [ {'raw_data': 'deinde proni ſumus ad iudicandum. Hæc tria Chriſtuus po', 'words': [ {"data-type": "word", # <word | punctuation | unreadable> "data": "deind...
56
29.16
79
19
437
python
[]
0
true
2024-11-18T21:51:43.031970+00:00
1,668,775,898,000
799e70e923d36d0d64741a6c2fa579893c95b73d
3
{ "blob_id": "799e70e923d36d0d64741a6c2fa579893c95b73d", "branch_name": "refs/heads/master", "committer_date": 1668775898000, "content_id": "77dfd26d5e16690538d6bf6de6a133da3793f258", "detected_licenses": [ "MIT" ], "directory_id": "a8aa48ba417d9d6e8569ead55f2f4b2f146b2427", "extension": "py", "fi...
3.125
stackv2
from rulu import * # Data model definition for "X is the father of Y" class IsFatherOf(Fact): father = StringField() son = StringField() # Rule #1: if X is the father of Y, and Y is the father of Z, # then X is the grandfather of Z. # Implicitly defines the data model for IsGrandfatherOf. IsGrandfath...
27
35.89
77
13
271
python
[]
0
true