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:23:43.156949+00:00 | 1,621,103,468,000 | e145ad58b715bb7ca1648ee8f70b433cba9cbd0a | 3 | {
"blob_id": "e145ad58b715bb7ca1648ee8f70b433cba9cbd0a",
"branch_name": "refs/heads/master",
"committer_date": 1621103468000,
"content_id": "91d046d0948a3434f127e5f633d10d9893c0124c",
"detected_licenses": [
"MIT"
],
"directory_id": "33dcf36ae514a1a172d83e31bc65fba38ee16642",
"extension": "py",
"fi... | 2.65625 | stackv2 | # Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Provides map data for users.
import glob
import os
import sys
try:
sys.path.append(glob.glob(... | 284 | 40.33 | 117 | 20 | 2,628 | python | [] | 0 | true | |
2024-11-18T21:23:43.561632+00:00 | 1,599,730,946,000 | f5b4b2a2cbdae8a26ec147cbcef03abfe12cf1f8 | 2 | {
"blob_id": "f5b4b2a2cbdae8a26ec147cbcef03abfe12cf1f8",
"branch_name": "refs/heads/master",
"committer_date": 1599730946000,
"content_id": "96974b4047f8d5910ad4afc0bee6577aa734b983",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "aeec092fec6a6c95ccb65590be53fa73dfa31cf7",
"extension": "p... | 2.46875 | stackv2 | """
Visualize the bases found during POD by exporting to .vtp, which can then be
viewed in paraview.
For problems other than skewed lid driven cavity, adjust how the components
are extracted from the bases (currently velocity and pressur in lines 43-54).
"""
# Author: Arturs Berzins <berzins@cats.rwth-aachen.de>
# Lice... | 65 | 30.11 | 77 | 13 | 546 | python | [] | 0 | true | |
2024-11-18T21:23:43.671316+00:00 | 1,510,661,664,000 | d50e2750c843826d2818075b67ddfa40f5f7838a | 2 | {
"blob_id": "d50e2750c843826d2818075b67ddfa40f5f7838a",
"branch_name": "refs/heads/master",
"committer_date": 1510661664000,
"content_id": "07c7ac9dc73c88d7bc7906d9f80a43c4a45b4172",
"detected_licenses": [
"MIT"
],
"directory_id": "0966cbea28e6315d8d87f1bc3677d2bd33077092",
"extension": "py",
"fi... | 2.421875 | stackv2 | from cloudant import Cloudant
from flask import Flask, render_template, request, jsonify
import atexit
import cf_deployment_tracker
import os
import json
import psycopg2
def sq(inString):
return chr(39)+inString+chr(39)
# Emit Bluemix deployment event
cf_deployment_tracker.track()
app = Flask(__name__)
db_name = ... | 111 | 27.43 | 169 | 17 | 868 | python | [{"finding_id": "codeql_py/flask-debug_164cef20b6764b51_1dfd89f5", "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.", ... | 2 | true | |
2024-11-18T21:23:43.856732+00:00 | 1,548,998,276,000 | 05ca7f96ad4f3f3dee7e8804f86346f5a553c245 | 3 | {
"blob_id": "05ca7f96ad4f3f3dee7e8804f86346f5a553c245",
"branch_name": "refs/heads/master",
"committer_date": 1548998276000,
"content_id": "dbcc13f1785c3c5001d462eaf9729d960ce8c792",
"detected_licenses": [
"MIT"
],
"directory_id": "e91f477713556f14b288b89ecce89754d4bd93f7",
"extension": "py",
"fi... | 3.171875 | stackv2 | #!/usr/bin/env python
"""Get all page names of a given language."""
import json
import requests
def query(lang, query):
query = "&".join(query)
q = (u"https://{lang}.wikipedia.org/w/api.php?action=query&{query}"
"&format=json"
.format(lang=lang, query=query))
r = requests.get(q)
re... | 42 | 29.14 | 74 | 13 | 301 | python | [] | 0 | true | |
2024-11-18T21:23:44.068728+00:00 | 1,609,922,166,000 | 830cddcc2b45e2f0ab6eb33a009c4c2aaff1365e | 3 | {
"blob_id": "830cddcc2b45e2f0ab6eb33a009c4c2aaff1365e",
"branch_name": "refs/heads/master",
"committer_date": 1609922166000,
"content_id": "b5431da92708ab83653a1aaf18b73f20fa3dc3ae",
"detected_licenses": [
"MIT"
],
"directory_id": "85890357379d64d393efc8d20d3367b9f4bbcbe4",
"extension": "py",
"fi... | 3.171875 | stackv2 | """
UserService
author: chen
date: 2019-03-16
desc: 内部调用了UserDao的函数,并提供了python下易用的函数
"""
from dao.userdao import user_dao
from utils import encrypt
import re, time
class UserService:
def __init__(self):
"""
生成正则表达式 匹配 电话/邮箱/6-8位数字的 user_id
"""
self.tel = re.compile(r"^\d{11}$")
... | 73 | 23.05 | 73 | 14 | 535 | python | [] | 0 | true | |
2024-11-18T21:23:44.115357+00:00 | 1,598,961,158,000 | 78cca89cd159a40eb9df9257a22595be51d9ea6e | 3 | {
"blob_id": "78cca89cd159a40eb9df9257a22595be51d9ea6e",
"branch_name": "refs/heads/master",
"committer_date": 1598961158000,
"content_id": "09e8707c4fa92782900eebd9729079646bddca8d",
"detected_licenses": [
"MIT"
],
"directory_id": "50d9e9c7a47e55b6f0fa59ca1d9ddeb67f8f4462",
"extension": "py",
"fi... | 2.953125 | stackv2 | """
Estimate frequencies for a given tree and save the output in a JSON file.
Usage:
# Use defaults.
python frequencies.py tree.json frequencies.json
# Specify custom parameters.
python frequencies.py tree.json frequencies.json \
--narrow-bandwidth 0.25 \
--start-date 2006-10-01 --end-date 2018-04-01
"""
imp... | 127 | 39.45 | 146 | 18 | 1,161 | python | [] | 0 | true | |
2024-11-18T21:23:44.166015+00:00 | 1,572,948,267,000 | 776c6a1d24504bc029c79bf256975b64e61f46fc | 2 | {
"blob_id": "776c6a1d24504bc029c79bf256975b64e61f46fc",
"branch_name": "refs/heads/master",
"committer_date": 1572948267000,
"content_id": "739f81d974e07cd10ce378b2bc8ca2ce689979c9",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "5403c02f670da52a9fb8b9183426836345d14ae0",
"extension": "p... | 2.34375 | stackv2 | from onadata.apps.fieldsight.models import Site
from onadata.apps.fsforms.models import FieldSightXF
"""
This module is used to get the site meta attributes answers of a specified site.
The site meta attributes answers that are to be selected from forms are not directly stored in the database.
To remove the overhead c... | 211 | 39.46 | 135 | 21 | 1,775 | python | [] | 0 | true | |
2024-11-18T21:23:44.282185+00:00 | 1,589,828,951,000 | e6a636b9eda9d097e3bf613349fad47bc3ed0e08 | 2 | {
"blob_id": "e6a636b9eda9d097e3bf613349fad47bc3ed0e08",
"branch_name": "refs/heads/master",
"committer_date": 1589828951000,
"content_id": "a18805f1f200b0b3b6dab86ba02fa7639451cfd0",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "5643901f651a8a333223c7db911fd7671080e709",
"extension": "p... | 2.5 | stackv2 | # -*- coding: utf-8 -*-
"""
This module contains functions which create plots.
These deal only with plots created with matplotlib. Functions handling the
creation of ROOT histograms are found in the rootIO module.
"""
from __future__ import (absolute_import, division, print_function,
unicode_... | 320 | 32.39 | 114 | 17 | 2,574 | python | [] | 0 | true | |
2024-11-18T21:23:44.547315+00:00 | 1,686,857,653,000 | 79d20e2919c773014651d4617b7d92df75b9b384 | 2 | {
"blob_id": "79d20e2919c773014651d4617b7d92df75b9b384",
"branch_name": "refs/heads/master",
"committer_date": 1686857653000,
"content_id": "3bc5e62323d44a918552f53be6e51f5dd783a5b6",
"detected_licenses": [
"MIT"
],
"directory_id": "91e96d99bcdf88ce7dc6a1ea3caa36fab829a298",
"extension": "py",
"fi... | 2.421875 | stackv2 | from django.db import models
# Create your models here.
# Creating a Skill table
class Project(models.Model):
project_name = models.CharField(max_length=100)
project_link = models.CharField(max_length=100)
project_order = models.IntegerField(default = 1)
def __str__(self):
return self.project... | 21 | 30.95 | 114 | 10 | 143 | python | [] | 0 | true | |
2024-11-18T21:23:44.601784+00:00 | 1,565,922,233,000 | 2e366c8d054fad3c97a2a3f4b22aa60cce36a824 | 3 | {
"blob_id": "2e366c8d054fad3c97a2a3f4b22aa60cce36a824",
"branch_name": "refs/heads/master",
"committer_date": 1565922233000,
"content_id": "0b34ab3aed7d6373cedca036dae01fe205cf7823",
"detected_licenses": [
"MIT"
],
"directory_id": "bff0af3e02d35fe4b0f1f06312b082871dde8080",
"extension": "py",
"fi... | 2.609375 | stackv2 | from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import time
import os
#Driver for logging into Gmail, and unsubscribing from selected emails.
if __name__ == "__main__":
login_url = "https://accounts.google.com/ServiceLogin?service=mail"
driver_path = os.getcwd()
... | 53 | 35.51 | 71 | 16 | 415 | python | [] | 0 | true | |
2024-11-18T21:23:44.715221+00:00 | 1,637,600,017,000 | 9b96f050285e829369f26e3798569ef262894fdd | 2 | {
"blob_id": "9b96f050285e829369f26e3798569ef262894fdd",
"branch_name": "refs/heads/main",
"committer_date": 1637600017000,
"content_id": "6486669f826dd58959689d0737c6d020eb7364a3",
"detected_licenses": [
"MIT"
],
"directory_id": "1a7421392f3b183b4ec40fca83c94c26671dff14",
"extension": "py",
"file... | 2.359375 | stackv2 | import argparse
from collections import defaultdict
import yaml
import json
import os
from Simulation.TP_with_recovery import TokenPassingRecovery
import RoothPath
from Simulation.simulation_old import Simulation
from Simulation.simulation_new_recovery import SimulationNewRecovery
from Simulation.tasks_and_delays_maker... | 77 | 46.26 | 173 | 24 | 806 | python | [] | 0 | true | |
2024-11-18T21:23:44.931112+00:00 | 1,552,492,801,000 | 21a134b322bd890fe2dbb204aa87a8b2096e5f2f | 2 | {
"blob_id": "21a134b322bd890fe2dbb204aa87a8b2096e5f2f",
"branch_name": "refs/heads/master",
"committer_date": 1552492801000,
"content_id": "df4d4913f34bd15301ab1621261a48fd29ae267d",
"detected_licenses": [
"MIT"
],
"directory_id": "110b59bcdecd637358049700234f5aff9e7008d6",
"extension": "py",
"fi... | 2.375 | stackv2 | # -*- coding: utf8 -*-
"""Functions used within samiTools."""
# Import required modules
from collections import OrderedDict
import datetime
import fileinput
import gc
import getopt
import html
import locale
import os
import re
import string
import sys
import textwrap
import unicodedata
__author__ = 'Victoria Morris... | 106 | 28.85 | 129 | 16 | 739 | python | [] | 0 | true | |
2024-11-18T21:23:45.320502+00:00 | 1,547,972,878,000 | deef7a3201411e412a72f96c8bc29c82100c25d2 | 3 | {
"blob_id": "deef7a3201411e412a72f96c8bc29c82100c25d2",
"branch_name": "refs/heads/master",
"committer_date": 1547972878000,
"content_id": "e43d511a0cdf2bf1bb45d8b2545910094dcf6522",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "1eab65e87e08b2df0cd72959a5db8fc617ca6531",
"extension": "py"... | 2.953125 | stackv2 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 11 22:54:02 2018
@author: tonyd
"""
#run simulation
import numpy as np
from scipy.stats import norm
from BBallSim import BBallSim
matches = [('warriors', 'clippers')]
#ends at 3 jan
f = open('jan6.txt', 'w')
for i in matches:
win = 0
team1 = i[0]
... | 65 | 23.94 | 75 | 13 | 586 | python | [] | 0 | true | |
2024-11-18T21:23:45.499902+00:00 | 1,602,620,845,000 | 304e7e5972f87a14892d3c8e3afc1a1bf00f4b56 | 2 | {
"blob_id": "304e7e5972f87a14892d3c8e3afc1a1bf00f4b56",
"branch_name": "refs/heads/master",
"committer_date": 1602620845000,
"content_id": "c3ae3afb821009873d24b9f09149335ab2acd5a1",
"detected_licenses": [
"MIT"
],
"directory_id": "25f199b685b98ae16071dde1e61a030f59af4d34",
"extension": "py",
"fi... | 2.40625 | stackv2 | from rsdd_enums import *
from decimal import Decimal
from rasterio.warp import transform
from rasterio.crs import CRS
import numpy as np
import logging
import geopy.distance
from random import random
log = logging.getLogger(__name__)
logging.getLogger('rasterio').setLevel(logging.CRITICAL)
def getBandIdFromBandPath(ba... | 145 | 35.99 | 140 | 20 | 1,486 | python | [] | 0 | true | |
2024-11-18T21:23:45.565305+00:00 | 1,692,130,575,000 | 483872e0c53a0079750e76465e3e760d7140e9f9 | 3 | {
"blob_id": "483872e0c53a0079750e76465e3e760d7140e9f9",
"branch_name": "refs/heads/master",
"committer_date": 1692130575000,
"content_id": "301cce6533bd43b3bf816342802a493f5df6d736",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "0225a1fb4e8bfd022a992a751c9ae60722f9ca0d",
"extension": "py"... | 3.28125 | stackv2 | import math
def to_rgb(color_str):
if len(color_str) != 6:
return (0, 0, 0)
r = int(color_str[0:2], 16)
g = int(color_str[2:4], 16)
b = int(color_str[4:], 16)
return (r, g, b)
def blend_colors(rgb_array1, rgb_array2, k):
return (rgb_array1[0] * (1.0 - k) + rgb_array2[0] * k,
... | 128 | 29.8 | 83 | 15 | 1,427 | python | [] | 0 | true | |
2024-11-18T21:23:46.312596+00:00 | 1,520,153,745,000 | 45ac4800aede0b8f832cd80e3f609885f70128ef | 3 | {
"blob_id": "45ac4800aede0b8f832cd80e3f609885f70128ef",
"branch_name": "refs/heads/master",
"committer_date": 1520153745000,
"content_id": "94aaacfc6e87dd31650fc41b6382d77f46abf6a6",
"detected_licenses": [
"MIT"
],
"directory_id": "2914eec447bdef266852e084c6d0e8e890966d48",
"extension": "py",
"fi... | 2.5625 | stackv2 | import csv
from textacy.text_utils import detect_language
from src.utils import preprocess
UBUNTU_CORPUS = 'data/processed/dialogue/ubuntu.csv'
MICROSOFT_CORPUS = 'data/processed/dialogue/microsoft.csv'
MOVIES_CORPUS = 'data/processed/dialogue/movies.csv'
REDDIT_CORPUS = 'data/processed/dialogue/reddit.csv'
OUTPUT_F... | 34 | 35.06 | 69 | 18 | 282 | python | [] | 0 | true | |
2024-11-18T21:23:46.533142+00:00 | 1,622,288,637,000 | 8eb72ad7a7155dd7a6e1e1f690c5d484329e514d | 3 | {
"blob_id": "8eb72ad7a7155dd7a6e1e1f690c5d484329e514d",
"branch_name": "refs/heads/main",
"committer_date": 1622288637000,
"content_id": "762c5532744ae50b187753076e0f7af2e206dbf1",
"detected_licenses": [
"MIT"
],
"directory_id": "3291db193cb46ab44d3a6d8552c0540ac07c59f5",
"extension": "py",
"file... | 2.515625 | stackv2 | from django.shortcuts import render
from .serializers import*
from utils.dropbox.operations import*
from .serializers import *
from .models import *
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework import ... | 130 | 33.95 | 133 | 21 | 958 | python | [] | 0 | true | |
2024-11-18T21:23:46.736552+00:00 | 1,610,313,982,000 | 13da7d2172f518b40113ad68042e4aec79529c6a | 3 | {
"blob_id": "13da7d2172f518b40113ad68042e4aec79529c6a",
"branch_name": "refs/heads/main",
"committer_date": 1610313982000,
"content_id": "95b7c093b9d195908cb6266dbf43763c7c0b6ee8",
"detected_licenses": [
"MIT"
],
"directory_id": "76b96e44a3dc967a8f23dc87766852ca37e98c25",
"extension": "py",
"file... | 2.671875 | stackv2 |
import requests
import pprint as pp
import json
import sys
import os
import time
from requests.auth import HTTPBasicAuth
from datetime import datetime, date, time, timedelta
from bearer_auth import BearerAuth
class AIClient:
def __init__(self):
self.authority = os.environ["MEDIA_AUTHORITY"]
self.... | 71 | 30.32 | 114 | 16 | 505 | python | [] | 0 | true | |
2024-11-18T21:23:46.858817+00:00 | 1,594,181,270,000 | 63e9c9adc2587b2974da346213465dcd2f556b95 | 3 | {
"blob_id": "63e9c9adc2587b2974da346213465dcd2f556b95",
"branch_name": "refs/heads/master",
"committer_date": 1594181270000,
"content_id": "525ddd2eb4667a61583c2792cd970ddcf6d2a337",
"detected_licenses": [
"MIT"
],
"directory_id": "c58a43a7a4d1db9d9ee874cffd88c484474959ac",
"extension": "py",
"fi... | 3.375 | stackv2 | import pandas as pd
import base64
from pandas import DataFrame
def simplify_cols(df):
"""
for pandas dataframe columns:
replace spaces with underscores and changes everything to lowercase
This allows for dot notation. As a side effect, mutiple spaces get
reduced to one, and leading/triling spaces ... | 74 | 29.26 | 92 | 15 | 515 | python | [] | 0 | true | |
2024-11-18T21:23:46.967611+00:00 | 1,688,142,219,000 | 9d7852104cdd5411934c5afb731d5c3cc42a8c77 | 4 | {
"blob_id": "9d7852104cdd5411934c5afb731d5c3cc42a8c77",
"branch_name": "refs/heads/master",
"committer_date": 1688142219000,
"content_id": "8150bc28c248345c121ae57786e5ce2aacf9a51b",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "cd6a55dd4f4a5472699eafd191f75654f2424e8b",
"extension": "p... | 3.53125 | stackv2 | """
======================================================================
Brownian motion
======================================================================
Brownian motion, or pedesis, is the random motion of particles
suspended in a medium. In this animation, path followed by 20 particles
exhibiting brownian mot... | 158 | 32.96 | 81 | 14 | 1,232 | python | [] | 0 | true | |
2024-11-18T21:23:47.150701+00:00 | 1,582,731,671,000 | 782fe34f72d5bf60c1f542f587435b9e8223d8c4 | 2 | {
"blob_id": "782fe34f72d5bf60c1f542f587435b9e8223d8c4",
"branch_name": "refs/heads/master",
"committer_date": 1582731671000,
"content_id": "b8ea3e65aa6c7a4087097373c673c1b676e44515",
"detected_licenses": [
"ISC"
],
"directory_id": "4ce8539ca16dfa0d990ccd83f8b062b8bd4b0924",
"extension": "py",
"fi... | 2.328125 | stackv2 | import telegram
from emoji import emojize
from .base import TextMessageBase
class HelpTextMessage(TextMessageBase):
"""
Help message.
"""
def get_text(self):
message = emojize(
"<b>Dutch Tax Calculation Bot help</b>\n\n"
":exclamation: ATTENTION :exclamation:\n\n"
... | 55 | 45.93 | 167 | 13 | 681 | python | [] | 0 | true | |
2024-11-18T21:23:47.257571+00:00 | 1,626,770,332,000 | fe4f5bca9f2a83dc044c31eb83af0b9ea7977972 | 3 | {
"blob_id": "fe4f5bca9f2a83dc044c31eb83af0b9ea7977972",
"branch_name": "refs/heads/main",
"committer_date": 1626770332000,
"content_id": "68a6d36f6f67451fe509b5ab82433663da484cc2",
"detected_licenses": [
"MIT"
],
"directory_id": "5cc81811ace9ab0f0d6684f751de87df189b0ecc",
"extension": "py",
"file... | 3.21875 | stackv2 | import pandas as pd
import random
class bbga:
def __init__(self):
pass
# MAKE POPULATION
@staticmethod
def make_individual(n: int) -> str:
individual = []
for i in range(2*n):
individual.append(random.choice(['0', '1']))
return ''.join(individual)
... | 230 | 32.29 | 113 | 22 | 1,902 | python | [] | 0 | true | |
2024-11-18T21:23:47.546542+00:00 | 1,672,713,037,000 | 7d55f522b60e2a89c2ed274d631f727c0163b26d | 2 | {
"blob_id": "7d55f522b60e2a89c2ed274d631f727c0163b26d",
"branch_name": "refs/heads/master",
"committer_date": 1672713037000,
"content_id": "5a0d834e81a4e19edf97550c62176386859edbbb",
"detected_licenses": [
"MIT"
],
"directory_id": "a7938dcd0a5a88a32b9e870d5721e6e1dbc39692",
"extension": "py",
"fi... | 2.359375 | stackv2 | import os
import re
from collections import defaultdict
from autobridge.util import get_cli_logger, get_work_dir
from autobridge.Floorplan.Utilities import RESOURCE_TYPES
from autobridge.dotgraph import get_dot_graph
from prettytable import PrettyTable
logger = get_cli_logger()
def get_port_info(config, port_name):... | 165 | 34.36 | 128 | 17 | 1,522 | python | [] | 0 | true | |
2024-11-18T21:23:47.675883+00:00 | 1,488,506,881,000 | 3d89546e2aba3e44897409c399f303d23684c659 | 3 | {
"blob_id": "3d89546e2aba3e44897409c399f303d23684c659",
"branch_name": "refs/heads/master",
"committer_date": 1488506881000,
"content_id": "1773dacbd4ad22ee7f784c21385959833a0e8c67",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "26e84876a28aa27df9fafe2e0eaf75c2484d1fd6",
"extension": "py"... | 2.75 | stackv2 | import matplotlib.pyplot as plt
from keras.applications.vgg16 import VGG16
from keras.models import Model
from keras.layers import Dense, Dropout, Flatten
from keras.layers.normalization import BatchNormalization
import datetime
def getBaseModel():
base_model = VGG16(weights='imagenet')
#Do not train bas... | 101 | 33.72 | 159 | 13 | 889 | python | [] | 0 | true | |
2024-11-18T21:23:47.815618+00:00 | 1,453,536,331,000 | 9aa3f0e08b820e013f060c4568d5f36943a6bea2 | 3 | {
"blob_id": "9aa3f0e08b820e013f060c4568d5f36943a6bea2",
"branch_name": "refs/heads/master",
"committer_date": 1453536331000,
"content_id": "811b31d12ff968c17708f730e6dc1abe335ecf23",
"detected_licenses": [
"MIT"
],
"directory_id": "f2215b6b8b7dcd79be7b45eb56d5c191bb8b6ff6",
"extension": "py",
"fi... | 2.96875 | stackv2 | __author__ = 'github.com/samshadwell'
# Token constants
T_End = -1
T_Plus = 0
T_Minus = 1
T_Times = 2
T_Over = 3
T_Less = 4
T_Greater = 5
T_LParen = 10
T_RParen = 11
T_LBrace = 12
T_RBrace = 13
T_Is = 20
T_If = 21
T_Else = 22
T_True = 30
T_False = 31
T_And = 32
T_Or = 33
T_Not = 34
T_Word = 40
T_Num = 41
T_Quote ... | 50 | 26.36 | 118 | 9 | 445 | python | [] | 0 | true | |
2024-11-18T21:23:47.933395+00:00 | 1,522,468,286,000 | 3c0a05c86bcab74def6999727c2b5fb1d4e94e53 | 2 | {
"blob_id": "3c0a05c86bcab74def6999727c2b5fb1d4e94e53",
"branch_name": "refs/heads/master",
"committer_date": 1522468286000,
"content_id": "8577e4628bad97801e694b4c701cf1d354b5d0d9",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "594fd585821daaae1393a338705e0a3a4b29f0bd",
"extension": "p... | 2.4375 | stackv2 | #!/usr/bin/python
# coding: utf-8
import argparse
import fcntl
import os
import signal
import subprocess
import sys
import threading
from flask import Flask, Response
from flask import render_template
from time import sleep
app = Flask(__name__)
videos = []
subproc = None
playing_video_file = None
script_path = os.p... | 164 | 32.38 | 168 | 19 | 1,160 | python | [{"finding_id": "codeql_py/flask-debug_4ea6f1fb58d613ab_8a973cb9", "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:23:47.991488+00:00 | 1,618,403,225,000 | 490958c60bed2ab5e8e6001db25b7e30549a71c5 | 3 | {
"blob_id": "490958c60bed2ab5e8e6001db25b7e30549a71c5",
"branch_name": "refs/heads/master",
"committer_date": 1618403225000,
"content_id": "5bef5b1bcc1630a3d5a2dd7d79ff30285095fbf7",
"detected_licenses": [
"MIT"
],
"directory_id": "9126fe840c95e59bd718f8d04845cf00de524f97",
"extension": "py",
"fi... | 3.109375 | stackv2 | def mmd_loss(z_tilde, z, z_var):
r"""Calculate maximum mean discrepancy described in the WAE paper.
Args:
z_tilde (Tensor): samples from deterministic non-random encoder Q(Z|X).
2D Tensor(batch_size x dimension).
z (Tensor): samples from prior distributions. same shape with z_tilde.
... | 43 | 43.53 | 107 | 15 | 542 | python | [] | 0 | true | |
2024-11-18T21:23:48.254835+00:00 | 1,566,625,060,000 | cf1e46749c97e781b6a82f7ec77b4e56091bfddc | 3 | {
"blob_id": "cf1e46749c97e781b6a82f7ec77b4e56091bfddc",
"branch_name": "refs/heads/master",
"committer_date": 1566625060000,
"content_id": "ef2f6003da10bbf0f3d1c640dae56ea8ece3aade",
"detected_licenses": [
"MIT"
],
"directory_id": "78a96827bc76f723891ad2503ea22f314c1908bb",
"extension": "py",
"fi... | 3.078125 | stackv2 | import locale
import re
class FieldTransformerBase(object):
"""
IntField(data="1").transform()
"""
def get_method(self):
"""
Should return the function that takes data as input. Ex: str, int, float,
:return:
"""
raise NotImplementedError("This method is no... | 71 | 19.87 | 81 | 14 | 303 | python | [] | 0 | true | |
2024-11-18T21:23:48.461354+00:00 | 1,544,112,311,000 | 5250fc2e7b657bf4c891d24cb40cfb995df19e01 | 3 | {
"blob_id": "5250fc2e7b657bf4c891d24cb40cfb995df19e01",
"branch_name": "refs/heads/master",
"committer_date": 1544112311000,
"content_id": "2736699e2abbf75d230e4a028df8ef24695cfb61",
"detected_licenses": [
"MIT"
],
"directory_id": "9b1e7e19fb4310a795f6e344761f773fd81d188e",
"extension": "py",
"fi... | 2.734375 | stackv2 | #!/usr/bin/env python
# encoding: utf-8
'''
fdr_correction.py
Created by Joan Smith
on 2017-8-4.
Calculate fdr and corrected pvalues for zscore calculations.
'''
import pprint
import argparse
import sys
import os
import fnmatch
import pandas as pd
import statsmodels.stats.multitest as smm
from collections import def... | 102 | 31.88 | 99 | 17 | 892 | python | [] | 0 | true | |
2024-11-18T21:23:48.564936+00:00 | 1,522,253,789,000 | c19a825a40c1c0ea240c9fddd92c5e4d4026f496 | 3 | {
"blob_id": "c19a825a40c1c0ea240c9fddd92c5e4d4026f496",
"branch_name": "refs/heads/master",
"committer_date": 1522253789000,
"content_id": "73a02c2200b4b0f4efff57a096cd0fcb7450b003",
"detected_licenses": [
"MIT"
],
"directory_id": "64041ed0c58605e4ce6be545e68dbc633680991d",
"extension": "py",
"fi... | 2.53125 | stackv2 | #!/usr/local/bin/python2.7
# encoding: utf-8
'''
@author: Sid Probstein
@copyright: RightWhen, Inc. All Rights Reserved.
@license: MIT License (https://opensource.org/licenses/MIT)
@contact: sid@rightwhen.com
'''
import sys
import os
import argparse
import glob
import json
import datetime
import random
# t... | 306 | 34.13 | 122 | 19 | 2,762 | python | [] | 0 | true | |
2024-11-18T21:23:48.745646+00:00 | 1,471,007,556,000 | 648c9c4d178c7516ed960af516adb2adc5f9f7a6 | 3 | {
"blob_id": "648c9c4d178c7516ed960af516adb2adc5f9f7a6",
"branch_name": "refs/heads/master",
"committer_date": 1471007556000,
"content_id": "8daf2fa3001e3cf44ecdea6a73e801e5c30c911b",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "66eaeb04329c2fb31f5d61abf3f92f84418c1593",
"extension": "py"... | 2.5625 | stackv2 | #!/usr/bin/env python
################################################################################
# Created by Oscar Martinez #
# o.rubi@esciencecenter.nl #
#######################################################... | 47 | 45.28 | 108 | 20 | 488 | python | [] | 0 | true | |
2024-11-18T21:23:49.024292+00:00 | 1,578,855,776,000 | 22f8a096bba326b8206d7403753011ec64b7f232 | 4 | {
"blob_id": "22f8a096bba326b8206d7403753011ec64b7f232",
"branch_name": "refs/heads/master",
"committer_date": 1578855776000,
"content_id": "a1536da775f4660680aa3a45574b716ffc3935cc",
"detected_licenses": [
"MIT"
],
"directory_id": "b45559010eb8dbf465e71beabca72f5735864dde",
"extension": "py",
"fi... | 3.734375 | stackv2 | # import all functions from the tkinter
from tkinter import *
# function for removing common characters
# with their respective occurrences
def remove_match_char(list1, list2):
for i in range(len(list1)) :
for j in range(len(list2)) :
# if common character is found
... | 194 | 30.19 | 80 | 16 | 1,478 | python | [] | 0 | true | |
2024-11-18T21:23:49.136504+00:00 | 1,610,395,538,000 | 1053d65f968afb8ae3f05be06f777a982009e795 | 3 | {
"blob_id": "1053d65f968afb8ae3f05be06f777a982009e795",
"branch_name": "refs/heads/master",
"committer_date": 1610395538000,
"content_id": "41c22ea6f596222c4a3fef6174f725aec3fd4899",
"detected_licenses": [
"MIT"
],
"directory_id": "4f2d567d50e69c0d148d78bbd707545d34784a47",
"extension": "py",
"fi... | 2.828125 | stackv2 | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
import typing
import ipaddress
from pyuavcan.transport import MessageDataSpecifier, ServiceDataSpecifier
IPAddress = typing.Union[ipaddress.IPv4Address, ipaddress.IPv6A... | 217 | 42.88 | 118 | 15 | 2,621 | python | [] | 0 | true | |
2024-11-18T21:23:49.445468+00:00 | 1,692,275,085,000 | 30ce24e207027aee112190d6137b239281084981 | 3 | {
"blob_id": "30ce24e207027aee112190d6137b239281084981",
"branch_name": "refs/heads/master",
"committer_date": 1692275085000,
"content_id": "9e1988d5ed4884d687e37f7f707efa732d061fc2",
"detected_licenses": [
"MIT"
],
"directory_id": "f504253210cec1c4ec6c3ea50a45564db7d6cd7f",
"extension": "py",
"fi... | 2.53125 | stackv2 | from __future__ import annotations
import base64
import os
import pathlib
from typing_extensions import Self
from prettyqt import constants, core, gui
from prettyqt.utils import colors, datatypes, serializemixin
class PixmapMixin(serializemixin.SerializeMixin, gui.PaintDeviceMixin):
"""Off-screen image represe... | 154 | 33.45 | 88 | 17 | 1,275 | python | [] | 0 | true | |
2024-11-18T21:23:49.653966+00:00 | 1,533,886,768,000 | 95e580c6037ec7710140d4c8d8408b3bcd17522c | 3 | {
"blob_id": "95e580c6037ec7710140d4c8d8408b3bcd17522c",
"branch_name": "refs/heads/master",
"committer_date": 1533886768000,
"content_id": "204b997a8672bf39259d958a2e961227926c17eb",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "3a8c52ea518110c3e0974198b5fe5db0e837db58",
"extension": "py"... | 2.71875 | stackv2 | import numpy as np
import pandas as pd
import matplotlib.pyplot as pyt
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from sklearn.naive_bayes import BernoulliNB
from sklearn.cluster import KMeans, DBSCAN
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.metric... | 201 | 29.1 | 132 | 15 | 1,520 | python | [] | 0 | true | |
2024-11-18T21:23:49.782541+00:00 | 1,560,382,889,000 | 75e5c17431429a7a12de20fe283cf1db823ca9f6 | 3 | {
"blob_id": "75e5c17431429a7a12de20fe283cf1db823ca9f6",
"branch_name": "refs/heads/master",
"committer_date": 1560382889000,
"content_id": "8d734e1d1a57bae1c47b0a81167c5f9479873a42",
"detected_licenses": [
"MIT"
],
"directory_id": "3dc60bbcb27600ffe7baa4e6187fe2c71bb7b5ab",
"extension": "py",
"fi... | 2.984375 | stackv2 | # https://leetcode.com/problems/divide-two-integers
class Solution:
def divide(self, dividend, divisor):
"""
:type dividend: int
:type divisor: int
:rtype: int
"""
neg = (dividend < 0) ^ (divisor < 0)
dividend, divisor = abs(dividend), abs(divisor)
r... | 26 | 22.38 | 55 | 12 | 158 | python | [] | 0 | true | |
2024-11-18T21:23:49.828956+00:00 | 1,541,543,321,000 | cb579f9f9482204b55e5d167bfacbaef3af12bd2 | 3 | {
"blob_id": "cb579f9f9482204b55e5d167bfacbaef3af12bd2",
"branch_name": "refs/heads/master",
"committer_date": 1541543321000,
"content_id": "18662f6ee2e10b055ddd9f08b7db941f2fc33d92",
"detected_licenses": [
"MIT"
],
"directory_id": "964e10ab8c71cb9336e31cae4b29cb67875b80e7",
"extension": "py",
"fi... | 2.859375 | stackv2 | import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.nn import MultiLabelSoftMarginLoss, BCEWithLogitsLoss
import numpy as np
def bce(y_input, y_target):
loss = BCEWithLogitsLoss()
return loss(y_input, y_target)
def multi_label(y_input, y_target):
loss = MultiLabel... | 165 | 35.01 | 114 | 19 | 1,557 | python | [] | 0 | true | |
2024-11-18T21:23:49.889009+00:00 | 1,550,447,458,000 | d2cfbb14151e7ad9c906ba1f1e1112a860b25234 | 3 | {
"blob_id": "d2cfbb14151e7ad9c906ba1f1e1112a860b25234",
"branch_name": "refs/heads/master",
"committer_date": 1550447458000,
"content_id": "3fd06fe52f4de9eab41206707f2484a26a7e0deb",
"detected_licenses": [
"MIT"
],
"directory_id": "efff5ccaf6277fc88304a4bad713e299f7cf0881",
"extension": "py",
"fi... | 3.09375 | stackv2 | #!/usr/bin/env python
import numpy as np
import pandas as pd
import json
import pytz
def _get_data(file):
return pd.read_csv(file)
def _get_prices(data):
df = data
rome_tz = pytz.timezone('Europe/Rome')
df['time'] = pd.to_datetime(df['Timestamp'], unit='s')
df['time'].dt.tz_localize(pytz.UTC... | 96 | 27.36 | 114 | 16 | 739 | python | [] | 0 | true | |
2024-11-18T21:23:49.938129+00:00 | 1,482,932,859,000 | 4b8ba41b5e3fa5075d03c74f55ca5488ece7df9d | 3 | {
"blob_id": "4b8ba41b5e3fa5075d03c74f55ca5488ece7df9d",
"branch_name": "refs/heads/master",
"committer_date": 1482932859000,
"content_id": "45f3a87db05510c0ee01a461e663a6439491ae9e",
"detected_licenses": [
"MIT"
],
"directory_id": "913ffc22562808949f9a17e874264e693ca00f50",
"extension": "py",
"fi... | 2.828125 | stackv2 | """Do work"""
import argparse
import logging
import os
import sys
from cameracontroller import CameraController
from storage import CloudStorage
from data import create_upload_table
def setup_logger():
"""Create the log directory if
it doesn't exist and setup the
logging configuration
"""
logger... | 148 | 26.05 | 97 | 12 | 886 | python | [] | 0 | true | |
2024-11-18T21:23:49.994208+00:00 | 1,612,981,041,000 | 84f3e15c622fe246f2d33d2fb4f9c0653289a1da | 3 | {
"blob_id": "84f3e15c622fe246f2d33d2fb4f9c0653289a1da",
"branch_name": "refs/heads/main",
"committer_date": 1612981041000,
"content_id": "29f24fc28c4bdb20f99f7fb95692c37058d9a21c",
"detected_licenses": [
"MIT"
],
"directory_id": "bff5702a9023a0bf6efb4f978d6329812a48654d",
"extension": "py",
"file... | 3.28125 | stackv2 | import queue
from chess.board import Board
from chess.figure import Figure
PRE = 0
SOLVING = 1
class Game:
def __init__(self, board_size=(8, 8)):
self.board = Board(board_size)
self.state = PRE
self.judge = False
self.score = 0
self.pre_solve_figures_queue = queue.Queue... | 53 | 18.75 | 70 | 15 | 247 | python | [] | 0 | true | |
2024-11-18T21:23:50.364369+00:00 | 1,577,604,486,000 | e7574caab45d63b82d3e10ab8fbc61c2cbadd35b | 3 | {
"blob_id": "e7574caab45d63b82d3e10ab8fbc61c2cbadd35b",
"branch_name": "refs/heads/master",
"committer_date": 1577604486000,
"content_id": "fadd15d510a9d74b6de23f856dcec5ce6517fc78",
"detected_licenses": [
"MIT"
],
"directory_id": "ad9fe5cd47778ba8111cc695d9dae1132998914c",
"extension": "py",
"fi... | 2.59375 | stackv2 | import keyring, getpass
from flask_bcrypt import Bcrypt
"""
utility script to set the password required to receive a bearer token
"""
bcrypt = Bcrypt()
SERVICE_NAME = 'switchbot'
pw = getpass.getpass(prompt='Login Password (required for receiving bearer token): ')
pw_hash = bcrypt.generate_password_hash(pw)
keyring... | 20 | 33.9 | 105 | 12 | 168 | python | [] | 0 | true | |
2024-11-18T21:23:50.854766+00:00 | 1,619,547,918,000 | 2aff8c4c9bef4cfa6a640cac063f881ba6645afd | 3 | {
"blob_id": "2aff8c4c9bef4cfa6a640cac063f881ba6645afd",
"branch_name": "refs/heads/main",
"committer_date": 1619601916000,
"content_id": "a546346334ef2b69766365e365e3661f099a6a1d",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "a65629762c67280a8bb2c5366a7af4d9114d8256",
"extension": "py",
... | 2.984375 | stackv2 | try:
import ConfigParser as cp # Python 2
except ImportError:
import configparser as cp # Python 3
try:
from StringIO import StringIO # Python 2
except ImportError:
from io import StringIO # Python 3
class Parser(object):
@staticmethod
def get_properties_parser(file_name):
file_p =... | 25 | 26.72 | 110 | 14 | 158 | python | [] | 0 | true | |
2024-11-18T21:23:50.963308+00:00 | 1,388,858,798,000 | f55d0bb839b0462e8a4e3fcf02872902f7f7be35 | 3 | {
"blob_id": "f55d0bb839b0462e8a4e3fcf02872902f7f7be35",
"branch_name": "refs/heads/master",
"committer_date": 1388858798000,
"content_id": "7172c33b8b69f050b4df7b426a879a61ea3d927c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "553cb5d516780c26832214d6a9d38ce714e4592a",
"extension": "py"... | 2.9375 | stackv2 | # coding=utf-8
import regex
from base import Tokenizer
class AdvancedScanner(regex.Scanner):
def scan(self, string):
result = []
append = result.append
match = self.scanner.scanner(string).match
i = 0
while True:
m = match()
if not m:
... | 326 | 24.4 | 79 | 18 | 2,012 | python | [] | 0 | true | |
2024-11-18T21:23:51.015147+00:00 | 1,629,454,326,000 | 6b431635a828bcdb403252ea654d680fa3dbba8d | 2 | {
"blob_id": "6b431635a828bcdb403252ea654d680fa3dbba8d",
"branch_name": "refs/heads/main",
"committer_date": 1629454326000,
"content_id": "8e2f21c70998bd8900f2ee9ac23e482bece1d25a",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "3fdd9e2f5663c6b07420ff0047e20aa1d4dec0e9",
"extension": "py",
... | 2.5 | stackv2 | # -*- coding: utf-8 -*-
# Copyright © 2021 Wacom 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
#
# Unle... | 112 | 27.1 | 76 | 11 | 773 | python | [] | 0 | true | |
2024-11-18T21:23:51.074345+00:00 | 1,692,100,205,000 | 75177fd07051195395ea793005382995f5513a49 | 3 | {
"blob_id": "75177fd07051195395ea793005382995f5513a49",
"branch_name": "refs/heads/master",
"committer_date": 1692100804000,
"content_id": "2d791c4b4db933c6b4934e994ed01efea1b49695",
"detected_licenses": [
"MIT"
],
"directory_id": "27b86f422246a78704e0e84983b2630533a47db6",
"extension": "py",
"fi... | 2.65625 | stackv2 | # Copyright (c) 2023, Manfred Moitzi
# License: MIT License
import ezdxf
from ezdxf.addons.drawing import Frontend, RenderContext, svg, layout, config
def example_doc():
doc = ezdxf.new()
msp = doc.modelspace()
x0, y0, x1, y1 = 0, 0, 10, 10
start = (x0, y0)
end = (x0 + 1, y0)
for color in r... | 51 | 29.02 | 88 | 13 | 468 | python | [] | 0 | true | |
2024-11-18T21:23:51.144012+00:00 | 1,573,114,045,000 | 5378d3c1731448586382ae51cdc21f9d24361853 | 3 | {
"blob_id": "5378d3c1731448586382ae51cdc21f9d24361853",
"branch_name": "refs/heads/master",
"committer_date": 1573114045000,
"content_id": "ae6f8bec1aae19c63255df4eee7c4ef859ff48b8",
"detected_licenses": [
"MIT"
],
"directory_id": "205269e56119dc6a1e8f96a0949f55e7f1506580",
"extension": "py",
"fi... | 2.90625 | stackv2 | # -*- coding: utf-8 -*-
from typing import Text, Union, Callable, Optional, Any
from prompt_toolkit.styles import Style
from prompt_toolkit.validation import Validator
from questionary.question import Question
from questionary.constants import DEFAULT_QUESTION_PREFIX
from questionary.prompts import text
def passwor... | 49 | 36.96 | 80 | 9 | 354 | python | [] | 0 | true | |
2024-11-18T21:23:51.300579+00:00 | 1,592,016,264,000 | 91bae4f2cbba1217111c3fef623944f0b26572c6 | 3 | {
"blob_id": "91bae4f2cbba1217111c3fef623944f0b26572c6",
"branch_name": "refs/heads/master",
"committer_date": 1592016264000,
"content_id": "09b15648de4c440ddcb6cca2ae4a20ba9885df16",
"detected_licenses": [
"Unlicense"
],
"directory_id": "79b50a821f52a1597c0acad4355c673198df4dd6",
"extension": "py",... | 2.734375 | stackv2 | #!/usr/bin/env python
import requests
import tweepy
import re
import os
# create a file twitter_keys.py and add the tokens/keys below as variables
# in the file
from twitter_keys import consumer_key, consumer_secret
# Create the OAuthHandler
auth = tweepy.OAuthHandler(consumer_key=consumer_key, consumer_secret=consu... | 62 | 30.1 | 86 | 13 | 466 | python | [] | 0 | true | |
2024-11-18T21:23:51.354922+00:00 | 1,548,071,820,000 | 2129e1b57ec2ad1d8f5856163173c837a69050da | 2 | {
"blob_id": "2129e1b57ec2ad1d8f5856163173c837a69050da",
"branch_name": "refs/heads/master",
"committer_date": 1548071820000,
"content_id": "c65fca1bfca675b9b143210b1b88418413f763df",
"detected_licenses": [
"MIT"
],
"directory_id": "6b27c422aa5698828d3979bb7b8e1a4a807718df",
"extension": "py",
"fi... | 2.3125 | stackv2 | """
helper functions
"""
def get_all_stage_name_list():
all_stg_name_list = \
['c_req_handle_stg', 'c_respond_stg', 'msg_in_stg', 'msg_out_stg', 'request_response_stg',
# main stages to function in TAD (need for all request), below is 'proc_stg'
'read_stg', 'mutation_stg', 'read_repair_s... | 23 | 41.87 | 115 | 11 | 266 | python | [] | 0 | true | |
2024-11-18T21:23:51.481244+00:00 | 1,623,672,699,000 | 2620856d70502474edafaa5bbb9dd6bc7d919ba0 | 3 | {
"blob_id": "2620856d70502474edafaa5bbb9dd6bc7d919ba0",
"branch_name": "refs/heads/main",
"committer_date": 1623672699000,
"content_id": "558f4a4ae04865d2796f96af06474236e40bbc00",
"detected_licenses": [
"MIT"
],
"directory_id": "51a42d989172e298fb05d1b83602076ef637f593",
"extension": "py",
"file... | 3.140625 | stackv2 | def mergeOverlappingIntervals(intervals):
intervals.sort()
to_pop = []
idx = 0
while idx+1 <= len(intervals)-1:
count = 1
if intervals[idx][1] >= intervals[idx+count][0]:
while intervals[idx][1] >= intervals[idx+count][0]:
if intervals[idx][0] > intervals[... | 33 | 27.39 | 63 | 17 | 227 | python | [] | 0 | true | |
2024-11-18T21:23:51.565543+00:00 | 1,481,620,000,000 | b8edf23f59156dd27fd31a7f03ab2980c24ad4cf | 3 | {
"blob_id": "b8edf23f59156dd27fd31a7f03ab2980c24ad4cf",
"branch_name": "refs/heads/master",
"committer_date": 1481620000000,
"content_id": "1406ecd917ed3d4abcb32d216404ddeddc169ba6",
"detected_licenses": [
"MIT"
],
"directory_id": "da288368c44b7e7ac285b67423e57edd3f466ecd",
"extension": "py",
"fi... | 2.9375 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of global_sewage_signatures.
# https://github.com/josl/Global_Sewage_Signatures
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2016, Jose L. Bellod Cisneros & Kosai Al-Nakked
# <bellod.cisneros@gmail.... | 111 | 36.38 | 77 | 19 | 975 | python | [] | 0 | true | |
2024-11-18T21:23:51.618147+00:00 | 1,690,255,896,000 | 6b1644acb4ba38124940f913046c4890e2c3a604 | 3 | {
"blob_id": "6b1644acb4ba38124940f913046c4890e2c3a604",
"branch_name": "refs/heads/main",
"committer_date": 1690255896000,
"content_id": "d79a56d7509b7e2f6d75ee778d734dd40521730f",
"detected_licenses": [
"MIT"
],
"directory_id": "29af9de5ba3da253d3dcd998b0aa51db173f00f3",
"extension": "py",
"file... | 2.90625 | stackv2 | from __future__ import annotations
import argparse
import sys
from dataclasses import dataclass
from typing import Literal, TextIO
@dataclass
class Node:
name: str
type: Literal["d", "f"]
parent: Node | None = None
size: int = 0
def qual_name(self) -> str:
if self.parent:
ret... | 94 | 29.96 | 110 | 18 | 675 | python | [] | 0 | true | |
2024-11-18T21:23:51.669606+00:00 | 1,478,993,138,000 | 8f4b272c8b4e5fa4553668003c5eae486a387d27 | 3 | {
"blob_id": "8f4b272c8b4e5fa4553668003c5eae486a387d27",
"branch_name": "refs/heads/master",
"committer_date": 1478993196000,
"content_id": "051db2c02a1682dd016549e6a170a448ecae6ccd",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "15619391a76c598b57a40869ce0d0c93aa0eacce",
"extension": "py"... | 2.609375 | stackv2 | #!/usr/bin/env python2
# coding: utf-8
from ctypes import *
libsha3 = CDLL('/srv/exploits/mig/libsha3.so')
def sha3(msg):
buf = create_string_buffer(64)
libsha3.rhash_sha3(32*8, msg, len(msg), buf)
return buf.value
def hmac_sha3(key, data):
if len(key) > 32:
key = sha3(key)
elif len(key)... | 51 | 24.22 | 91 | 14 | 535 | python | [] | 0 | true | |
2024-11-18T21:23:51.842238+00:00 | 1,604,634,440,000 | 689c3ec5b9969081aa37a07e8da47b42018e3f39 | 4 | {
"blob_id": "689c3ec5b9969081aa37a07e8da47b42018e3f39",
"branch_name": "refs/heads/main",
"committer_date": 1604634440000,
"content_id": "29bad4a0caef22bfa38cded16ce8e1f0f74ede45",
"detected_licenses": [
"MIT"
],
"directory_id": "ee5e5b38340840495d5391e7747037577a579615",
"extension": "py",
"file... | 3.8125 | stackv2 | def isPhoneNumber(text):
if len(text) != 12:
return False
for i in range(0,3):
if not text[i].isdecimal():
return False
if text[3] != '-':
return False
for i in range(4,7):
if not text[i].isdecimal():
return False
... | 35 | 25.4 | 43 | 15 | 237 | python | [] | 0 | true | |
2024-11-18T21:23:51.983902+00:00 | 1,458,304,084,000 | 3a37943628235336724ed677efa759ccbb857ebe | 3 | {
"blob_id": "3a37943628235336724ed677efa759ccbb857ebe",
"branch_name": "refs/heads/master",
"committer_date": 1458304084000,
"content_id": "b545c9f855e8a4f3762ecce05a201c80740ab40a",
"detected_licenses": [
"MIT"
],
"directory_id": "240691ef0a774b641f27beda1cd944900164797b",
"extension": "py",
"fi... | 2.890625 | stackv2 | # -*- coding: utf-8 -*-
"""
pyimagediet
~~~~~~~~~~~~
:copyright: (c) 2015 by Marko Samastur
:license: MIT, see LICENSE for more details.
"""
import copy
import filecmp
import magic
import os
from os.path import exists, isfile
from os.path import abspath, dirname, join, exists, isfile
import shutil
from subprocess impo... | 262 | 31.42 | 87 | 20 | 1,812 | python | [] | 0 | true | |
2024-11-18T21:23:52.030684+00:00 | 1,629,750,460,000 | 1c9fd8eeb711866e5dbba812ad85d6c47f3bf01e | 2 | {
"blob_id": "1c9fd8eeb711866e5dbba812ad85d6c47f3bf01e",
"branch_name": "refs/heads/master",
"committer_date": 1629750460000,
"content_id": "da710fc255d3bd1494ab057500df6cf5431bd300",
"detected_licenses": [
"MIT"
],
"directory_id": "2d2764c93b36089e6b32f2bb155e2f9aa576f96b",
"extension": "py",
"fi... | 2.390625 | stackv2 | from numpy import pi, sqrt, array, prod, diff, roll, linspace, meshgrid, real, \
where, isscalar, zeros, ones, reshape, complex128, inf, asarray, append, squeeze, exp
from scipy.sparse import diags, spdiags, kron, eye
from scipy.sparse.linalg import eigs, spsolve
import time
import matplotlib.pyplo... | 116 | 29.02 | 110 | 18 | 1,022 | python | [] | 0 | true | |
2024-11-18T21:23:52.117050+00:00 | 1,511,042,930,000 | 4eb1edb75819de3822886742629148a3b4c3f7b5 | 3 | {
"blob_id": "4eb1edb75819de3822886742629148a3b4c3f7b5",
"branch_name": "refs/heads/master",
"committer_date": 1511042930000,
"content_id": "93d13d481242d621dfb5f14738aff24bdaaa737b",
"detected_licenses": [
"MIT"
],
"directory_id": "f7cc661df160c91bb0264bfc9efcd821e9c5da46",
"extension": "py",
"fi... | 3.09375 | stackv2 | """ Driver for todo.txt parsing and balancing follows format defined at https://github.com/todotxt/todo.txt. """
import todotxt
import unittest
import argparse
def arg_parser():
""" Create an argument parser """
parser = argparse.ArgumentParser(description="Utility for managing todo.txt files.")
parser.ad... | 38 | 28.03 | 113 | 14 | 243 | python | [] | 0 | true | |
2024-11-18T21:23:52.174294+00:00 | 1,681,990,830,000 | 67a121c39090491d2a4c69e3f0c0186cfb0a4f7e | 3 | {
"blob_id": "67a121c39090491d2a4c69e3f0c0186cfb0a4f7e",
"branch_name": "refs/heads/master",
"committer_date": 1681990830000,
"content_id": "b691f7819deb2802b7bdf5a0783a433f6b566903",
"detected_licenses": [
"MIT"
],
"directory_id": "d4c9a21b46877a990d6fb51fd3645d46971bab45",
"extension": "py",
"fi... | 3.140625 | stackv2 | """
Represents a beamline.
BeamlineComponents can be attached at positions(BeamlinePosition), i.e. longitudinal, off-axis and inclined.
We can iterate of the components, find their positions or look for a specific component.
"""
from syned.syned_object import SynedObject
from syned.storage_ring.light_source import Li... | 75 | 38.43 | 114 | 15 | 616 | python | [] | 0 | true | |
2024-11-18T21:23:54.864392+00:00 | 1,570,783,256,000 | 3e0fe07adba55af74bb698fd6f94f02d94a0af28 | 3 | {
"blob_id": "3e0fe07adba55af74bb698fd6f94f02d94a0af28",
"branch_name": "refs/heads/master",
"committer_date": 1570783256000,
"content_id": "55622acd6c15628cf85b5f0eb785f87a4b4cf716",
"detected_licenses": [],
"directory_id": "182841978c0a73f8903ae93685b09684bdca0e64",
"extension": "py",
"filename": "boc... | 2.5625 | stackv2 | # Author: Jan Hendrik Metzen <janmetzen@mailbox.org>
from copy import deepcopy
import numpy as np
from bolero.optimizer import ContextualOptimizer
from bolero.representation.ul_policies import BoundedScalingPolicy
from bolero.utils.validation import check_feedback, check_random_state
from bayesian_optimization impo... | 264 | 42.31 | 80 | 17 | 2,357 | python | [] | 0 | true | |
2024-11-18T21:23:55.218949+00:00 | 1,544,901,814,000 | 2e30223cd754434bd420e9bac81867b03f554afd | 2 | {
"blob_id": "2e30223cd754434bd420e9bac81867b03f554afd",
"branch_name": "refs/heads/master",
"committer_date": 1544901814000,
"content_id": "d0fbdcc59702e6dfd6cd830d41f385c0d0e61432",
"detected_licenses": [
"MIT"
],
"directory_id": "932eb71e1bf43283b928c16a7f352458e8a85bd9",
"extension": "py",
"fi... | 2.453125 | stackv2 | import time
import json
import argparse
import requests
import csv
import io
API_URL = "https://realty.yandex.ru/gate/react-page/get/?rgid={0}&type={1}&category={2}&page={3}&_format=react&_pageType=search&_providers=react-search-data"
class OutputWriter:
def __init__(self, path, converter):
self.converte... | 162 | 37.48 | 157 | 17 | 1,381 | python | [] | 0 | true | |
2024-11-18T21:23:55.493075+00:00 | 1,693,515,274,000 | 293d3ece8c7ce90cacbbe0961ca420607a2fd697 | 3 | {
"blob_id": "293d3ece8c7ce90cacbbe0961ca420607a2fd697",
"branch_name": "refs/heads/master",
"committer_date": 1693515274000,
"content_id": "d8e3d63bdfe6f9dda6d1afe5f9e4062ac7fe81e2",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "a2e145c21db228c0a9764fe0d9cef784ec8ddb79",
"extension": "p... | 2.515625 | stackv2 | """
Convenience methods and constants to facilitate a processing workflow involving BugSwarm artifact images.
"""
import os
import shutil
from ..shell_wrapper import ShellWrapper
from ..rest_api.database_api import DatabaseAPI
REPOS_DIR = '/home/travis/build'
_SANDBOX = 'bugswarm-sandbox'
HOST_SANDBOX = os.path.join(... | 79 | 31.8 | 119 | 12 | 587 | python | [] | 0 | true | |
2024-11-18T21:23:55.722769+00:00 | 1,497,634,994,000 | 9f366353e4e13d1ad82c21725ead5c729187b065 | 3 | {
"blob_id": "9f366353e4e13d1ad82c21725ead5c729187b065",
"branch_name": "refs/heads/master",
"committer_date": 1497634994000,
"content_id": "df7981c151032f4f4a2a86b0f7ec16cf8606f382",
"detected_licenses": [
"MIT"
],
"directory_id": "b342e4db903935fbed18f9976c080ac97a3be71e",
"extension": "py",
"fi... | 2.921875 | stackv2 | import inspect
from behave import *
from goat.matcher import GoatMatcher
from goat.model import Match, Argument
use_step_matcher("re")
@step("Create pattern: (.*)")
def create_pattern(context, pattern: str):
context.pattern = pattern
@step("Create function: (.*)")
def create_function(context, function: str):
... | 71 | 34.31 | 118 | 14 | 491 | python | [] | 0 | true | |
2024-11-18T21:23:55.822103+00:00 | 1,432,183,368,000 | b2861f017c850a1dee5bbb1d825c02324160b53b | 3 | {
"blob_id": "b2861f017c850a1dee5bbb1d825c02324160b53b",
"branch_name": "refs/heads/master",
"committer_date": 1432183368000,
"content_id": "5b07ba3a971c7f5dbc709afa709875086f0d7446",
"detected_licenses": [
"MIT"
],
"directory_id": "7ebd2db6b7011fbc77fc8a50d8cc02bb4b5b2d6a",
"extension": "py",
"fi... | 2.578125 | stackv2 | #!/usr/bin/python
import os
import sys
import web
import etcd
import json
import socket
import getopt
import random
urls = ('/','root')
class Realserver:
name = ''
ip = ''
port = ''
def __init__(self, name, ip, port):
self.name = name
self.ip = ip
self.port ... | 113 | 25.65 | 116 | 15 | 860 | python | [] | 0 | true | |
2024-11-18T21:23:56.182315+00:00 | 1,667,705,957,000 | 4ab0dd311cae09e4bcf9ffd5e2b2fc0ce0c4d99b | 3 | {
"blob_id": "4ab0dd311cae09e4bcf9ffd5e2b2fc0ce0c4d99b",
"branch_name": "refs/heads/master",
"committer_date": 1667705957000,
"content_id": "e207d639bd5fbc2334bfb003855246a662d7ee46",
"detected_licenses": [
"BSD-3-Clause",
"MIT"
],
"directory_id": "444d460973b623d294fef8b6067a8eee36b0ea42",
"ext... | 2.671875 | stackv2 | """ External verifiers in existing works. """
import subprocess
import sys
import tempfile
from datetime import datetime
import random
import string
from pathlib import Path
from typing import Optional, Tuple, List
import torch
from torch import Tensor
sys.path.append(str(Path(__file__).resolve().parent.parent))
fr... | 346 | 34.47 | 119 | 20 | 2,949 | python | [] | 0 | true | |
2024-11-18T21:23:56.254711+00:00 | 1,586,366,792,000 | 5e918ba7a85c561e0a62fe6d184aed74ab67c2e7 | 3 | {
"blob_id": "5e918ba7a85c561e0a62fe6d184aed74ab67c2e7",
"branch_name": "refs/heads/master",
"committer_date": 1586366792000,
"content_id": "1bafbf2076390c5e2d270f4993b2aea904e8447a",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "a950c299e0aab8acde0540bb0efd66ffe66177a2",
"extension": "py"... | 2.8125 | stackv2 | import tweepy
import csv
from twitter_bot import api
# Open/Create a file to append data
csvFile = open('twitter_output.csv', 'a')
# Use csv Writer
csvWriter = csv.writer(csvFile)
for tweet in tweepy.Cursor(api.search,
"CNN",
100,
"en... | 21 | 22.86 | 70 | 11 | 116 | python | [] | 0 | true | |
2024-11-18T21:23:56.727028+00:00 | 1,537,389,005,000 | 684fdad8c23dace1e19d243e8f2881aa0278703b | 3 | {
"blob_id": "684fdad8c23dace1e19d243e8f2881aa0278703b",
"branch_name": "refs/heads/master",
"committer_date": 1537389005000,
"content_id": "07f0d21a3ce366f7336ee5b6d272f092fe283f0f",
"detected_licenses": [
"MIT"
],
"directory_id": "2a290112c72f3771645a6e8b647b92d9e4448185",
"extension": "py",
"fi... | 3.140625 | stackv2 | from typing import List
from enum import Enum
Hand = List[int]
class UserEventEnum(Enum):
BET = 1
CALL = 2
CHECK = 3
class UserEvent:
def __init__(self, event_type: UserEventEnum, bet: (int, int) = (0, 0)):
self.event_type = event_type
self.bet = bet
self.count = bet[0]
... | 27 | 22.41 | 89 | 16 | 176 | python | [] | 0 | true | |
2024-11-18T21:23:56.781040+00:00 | 1,616,152,665,000 | 3ea6d0549f7b407027da9ebadeb2e0df775b8010 | 3 | {
"blob_id": "3ea6d0549f7b407027da9ebadeb2e0df775b8010",
"branch_name": "refs/heads/master",
"committer_date": 1616152665000,
"content_id": "b70b54d19ec7c1c428916a6958e8298f20a87dba",
"detected_licenses": [
"MIT"
],
"directory_id": "5f37a2bcfa4aada51b011dca8b678d9e4114211c",
"extension": "py",
"fi... | 3.109375 | stackv2 | import numpy as np
from torch.utils.data.dataset import Dataset
class ClassificationTask(Dataset):
def __init__(self, task='yin-yang', r_small=0.1, r_big=0.5, size=1000, seed=42):
super(ClassificationTask, self).__init__()
# using the numpy RNG to allow compatibility to other deep learning framewo... | 137 | 37.09 | 107 | 18 | 1,486 | python | [] | 0 | true | |
2024-11-18T21:23:56.852702+00:00 | 1,627,552,351,000 | 40ba232f0a6fbeb9319d0f559eaf9055db7c412a | 2 | {
"blob_id": "40ba232f0a6fbeb9319d0f559eaf9055db7c412a",
"branch_name": "refs/heads/main",
"committer_date": 1627552351000,
"content_id": "fe70fb82000d72d774c631a63094172b50033519",
"detected_licenses": [
"MIT"
],
"directory_id": "ebedea4a5f5783e511061d25642926b12e16fb6c",
"extension": "py",
"file... | 2.375 | stackv2 | from plotly import graph_objects as go
def add_layout(fig, x_label, y_label, title):
fig.update_layout(
template="none",
legend=dict(
orientation="h",
yanchor="bottom",
y=1.02,
xanchor="center",
x=0.5
),
title=dict(
... | 59 | 20.81 | 45 | 14 | 310 | python | [] | 0 | true | |
2024-11-18T21:23:56.914247+00:00 | 1,657,155,155,000 | 95306bfe4825dae413c4b33b56a75668400d14b4 | 4 | {
"blob_id": "95306bfe4825dae413c4b33b56a75668400d14b4",
"branch_name": "refs/heads/master",
"committer_date": 1657155155000,
"content_id": "a23ea16298c70d3c03b804c2204f2ca79cc28c6f",
"detected_licenses": [
"MIT"
],
"directory_id": "d8a1ad97cd53980369e908a5bb5744b5014d9c4e",
"extension": "py",
"fi... | 3.8125 | stackv2 | #!/usr/bin/env python3
# The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
# Find the sum of all the primes below two million.
from math import sqrt,ceil
def is_prime(num,f=2):
if num <2:
return False
if num in [2,3] or f>sqrt(num):
return True
elif num%f==0:
return False
... | 33 | 21.55 | 68 | 16 | 244 | python | [] | 0 | true | |
2024-11-18T21:23:56.960671+00:00 | 1,609,239,228,000 | 21a1b1886946cf10813892e93b3d91a788cc54c7 | 3 | {
"blob_id": "21a1b1886946cf10813892e93b3d91a788cc54c7",
"branch_name": "refs/heads/main",
"committer_date": 1609239228000,
"content_id": "17eadd1bded35cb4d0f5d51acb2d04163345e554",
"detected_licenses": [
"MIT"
],
"directory_id": "29f078ddf856ab0a52b73fb60d80b05dd210796a",
"extension": "py",
"file... | 3.328125 | stackv2 | from agent import GalagaAgent
from environment import GalagaEnvironment
import sys
ag = GalagaAgent()
env = GalagaEnvironment()
#Initialize environment and agent
image, reward = env.init()
ag.init(image, reward)
print("Environment and agent initialized")
#Type of execution (train, play)
if sys.argv[1] == "train":
... | 41 | 23.68 | 64 | 12 | 215 | python | [] | 0 | true | |
2024-11-18T21:23:57.009411+00:00 | 1,677,704,567,000 | 7d446e929c48e123a3eaabbcfe3dbe4c5d18a42d | 3 | {
"blob_id": "7d446e929c48e123a3eaabbcfe3dbe4c5d18a42d",
"branch_name": "refs/heads/master",
"committer_date": 1677704567000,
"content_id": "d8cbc58f5ad2144ffc14b869b9eb3a21a454373f",
"detected_licenses": [],
"directory_id": "0cdd48b5fbe1ec0416f669c0a2666c71c282c57e",
"extension": "py",
"filename": "dat... | 2.90625 | stackv2 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import mne
import numpy as np
from . import download as dl
from scipy.io import loadmat
ALPHAWAVES_URL = 'https://zenodo.org/record/2348892/files/'
class AlphaWaves():
'''Dataset containing EEG recordings of subjects in a simple
resting-state eyes open/closed ex... | 184 | 42.25 | 79 | 14 | 2,139 | python | [] | 0 | true | |
2024-11-18T21:23:57.131625+00:00 | 1,574,229,813,000 | 954a7d7108229188d719c6e8c8a3c5058988e803 | 2 | {
"blob_id": "954a7d7108229188d719c6e8c8a3c5058988e803",
"branch_name": "refs/heads/master",
"committer_date": 1574229813000,
"content_id": "4f23df89448649ffc5e776a1fbc3baee5170cd5a",
"detected_licenses": [
"MIT"
],
"directory_id": "89a026173f837699cd44898cf8323b8f1c6d0581",
"extension": "py",
"fi... | 2.375 | stackv2 | import torch.nn as nn
import torch.utils.data as data
from datasets import build_dataset
__all__ = [
'build_data_loader',
'weights_init',
'count_parameters',
]
def build_data_loader(args, phase='train'):
data_loaders = data.DataLoader(
build_dataset(args, phase),
batch_size=args.batc... | 39 | 28 | 72 | 16 | 282 | python | [] | 0 | true | |
2024-11-18T21:23:57.457009+00:00 | 1,614,775,158,000 | 727552b9d3b6bd5e08ceb6c31ef49f5d94107c83 | 2 | {
"blob_id": "727552b9d3b6bd5e08ceb6c31ef49f5d94107c83",
"branch_name": "refs/heads/main",
"committer_date": 1614775158000,
"content_id": "0751333279ef0d34f57a0c12ae59902029cc7ca4",
"detected_licenses": [
"MIT"
],
"directory_id": "37fd1d8164fd0f29eada1af29096e866aa6aa9c3",
"extension": "py",
"file... | 2.359375 | stackv2 |
import argparse
import torch
import time
import os
import numpy as np
from gym.spaces import Box, Discrete
from pathlib import Path
from torch.autograd import Variable
from tensorboardX import SummaryWriter
from utils.make_env import make_env
from utils.buffer import ReplayBuffer
from utils.env_wrappers import Subproc... | 218 | 41.72 | 118 | 28 | 2,098 | python | [] | 0 | true | |
2024-11-18T21:23:57.518451+00:00 | 1,482,931,916,000 | 39d22b924395bb7a60fd6740ed04259950860f4d | 3 | {
"blob_id": "39d22b924395bb7a60fd6740ed04259950860f4d",
"branch_name": "refs/heads/master",
"committer_date": 1482931916000,
"content_id": "4e2b4179e8d8d717ef539899dfa84090a6cc64bc",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "8b758f11330aa565fe8307170a8595f092b400a4",
"extension": "py"... | 3.046875 | stackv2 | from sys import stdin,stdout
# stdin = open("/Users/seeva92/Workspace/Contests/1.txt","r")
# stdout = open("/Users/seeva92/Workspace/Contests/2.txt","w")
def main():
arr = [0 for i in range(1000007)]
arr[0] = 1; arr[1] = 1
for i in range(2,1000007):
arr[i] = arr[i-1] + ((i-1) * arr[i-2])
arr[i] %= (1000000007)
... | 16 | 26.25 | 62 | 13 | 173 | python | [] | 0 | true | |
2024-11-18T21:23:57.570622+00:00 | 1,421,257,246,000 | b2e1ee35467a0ead9f9c3e0d7b22241f1b2700f0 | 3 | {
"blob_id": "b2e1ee35467a0ead9f9c3e0d7b22241f1b2700f0",
"branch_name": "refs/heads/master",
"committer_date": 1421257246000,
"content_id": "74ede2de89dc2c3fd6b6dea5649ebb972c3b175a",
"detected_licenses": [
"MIT"
],
"directory_id": "e20ed90b9be7a0bcdc1603929d65b2375a224bf6",
"extension": "py",
"fi... | 2.609375 | stackv2 | from netapp.netapp_object import NetAppObject
class StorageSsdInfo(NetAppObject):
"""
Storage info block for solid-state storage devices.
"""
_percent_spares_consumed = None
@property
def percent_spares_consumed(self):
"""
Percentage of device spare blocks that have been us... | 74 | 35.78 | 104 | 13 | 610 | python | [] | 0 | true | |
2024-11-18T21:23:57.691625+00:00 | 1,631,110,938,000 | da16abde7a06761f18d6e8b34d071c027c302057 | 3 | {
"blob_id": "da16abde7a06761f18d6e8b34d071c027c302057",
"branch_name": "refs/heads/master",
"committer_date": 1631110938000,
"content_id": "b25aec4bf9dbaaa5799335c0367ce6d1751b4d64",
"detected_licenses": [
"MIT"
],
"directory_id": "9fa8c280571c099c5264960ab2e93255d20b3186",
"extension": "py",
"fi... | 2.984375 | stackv2 | """
This code was originally published by the following individuals for use with
Scilab:
Copyright (C) 2012 - 2013 - Michael Baudin
Copyright (C) 2012 - Maria Christopoulou
Copyright (C) 2010 - 2011 - INRIA - Michael Baudin
Copyright (C) 2009 - Yann Collette
Copyright (C) 2009 - CEA - Jean-Marc Mart... | 253 | 32.92 | 86 | 19 | 2,758 | python | [] | 0 | true | |
2024-11-18T21:23:57.824755+00:00 | 1,628,725,078,000 | e59eddcc49332adb1c1fca7fd1a6cc67022dddbe | 3 | {
"blob_id": "e59eddcc49332adb1c1fca7fd1a6cc67022dddbe",
"branch_name": "refs/heads/main",
"committer_date": 1628725078000,
"content_id": "8bcdfd84eaf7406c10d7bdc56ef97d14139a8a6d",
"detected_licenses": [
"MIT"
],
"directory_id": "276d305013329e734b841807ca7498607e32d20c",
"extension": "py",
"file... | 2.609375 | stackv2 | from pathlib import Path
from typing import Optional
from .ace_archive import extract_archive as extract_ace_archive
from .rar_archive import extract_archive as extract_rar_archive
from .sevenz_archive import extract_archive as extract_7z_archive
from .tar_archive import extract_archive as extract_tar_archive
from .zi... | 22 | 39.68 | 79 | 9 | 212 | python | [] | 0 | true | |
2024-11-18T21:23:57.896221+00:00 | 1,517,321,807,000 | 2c5c1265fa8be64b4c9babe68fd5eaaba38afd68 | 3 | {
"blob_id": "2c5c1265fa8be64b4c9babe68fd5eaaba38afd68",
"branch_name": "refs/heads/master",
"committer_date": 1517321807000,
"content_id": "7ef66d0f6bd069a5e65b9395f18341cf8bbdc40c",
"detected_licenses": [
"MIT"
],
"directory_id": "f684f803dad6c9d533a29c7352cf04d87fe2ef31",
"extension": "py",
"fi... | 2.65625 | stackv2 | class Bytes(bytearray):
@staticmethod
def from_int( n, size=4, big_endian=True, signed=False ):
if not signed and n <0: raise ValueError("if not signed n cannot be negative")
if n<0:
max_n_for_size = 2 ** (size * 8) - 1
n= max_n_for_size+n+1
curr_byte_i= 0
ret= Bytes(size)
while curr_byte_i < size:
... | 92 | 19.61 | 80 | 16 | 659 | python | [] | 0 | true | |
2024-11-18T21:23:58.012586+00:00 | 1,620,058,473,000 | 17c54040319e15b81cc5020cf9d889be5de37c26 | 2 | {
"blob_id": "17c54040319e15b81cc5020cf9d889be5de37c26",
"branch_name": "refs/heads/master",
"committer_date": 1620058473000,
"content_id": "7e4e29c860792f40e678af2b049c375823d868bf",
"detected_licenses": [
"MIT"
],
"directory_id": "cf774ae599c3c8ba75f4d0813b0c5bd6d435d3f9",
"extension": "py",
"fi... | 2.40625 | stackv2 | import abc
import itertools
import logging
import queue
import sys
import threading
import traceback
from typing import Optional, Union
import av
import numpy as np
from aiortc import MediaStreamTrack
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class VideoTransformerBase(abc.ABC):
... | 139 | 28.22 | 88 | 18 | 858 | python | [] | 0 | true | |
2024-11-18T21:23:58.070223+00:00 | 1,545,229,918,000 | 2635bbdc9963260607c48961da0e7846544be7a4 | 3 | {
"blob_id": "2635bbdc9963260607c48961da0e7846544be7a4",
"branch_name": "refs/heads/master",
"committer_date": 1545229918000,
"content_id": "d1e644b5a1ef7f2a46fcf29fb08dd26fdf10fa57",
"detected_licenses": [
"MIT"
],
"directory_id": "0e907edec524334977828de2a54a61c0ec265be2",
"extension": "py",
"fi... | 2.640625 | stackv2 | import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicBlock(nn.Module):
expansion = 1
def __init__(self,in_channel,out_channel,same_shape=True):
super(BasicBlock,self).__init__()
self.same_shape = same_shape
stride = 1 if self.same_shape else 2
self.conv... | 126 | 33.24 | 120 | 14 | 1,143 | python | [] | 0 | true | |
2024-11-18T21:23:58.173483+00:00 | 1,606,072,514,000 | 07c040c12043c73df474b26c6bc5cfceecbc67f1 | 4 | {
"blob_id": "07c040c12043c73df474b26c6bc5cfceecbc67f1",
"branch_name": "refs/heads/main",
"committer_date": 1606072514000,
"content_id": "59d5644f5ca15622a5af722a497b5a9c00d2bc6a",
"detected_licenses": [
"MIT"
],
"directory_id": "36e3591e0d244884f1604cba832501b6d60e8cf9",
"extension": "py",
"file... | 3.5625 | stackv2 | class SNode:
def __init__(self, data):
self.data = data
self.next = None
def __repr__(self):
return self.data
class SLinkedList:
def __init__(self):
self.head = None
def __repr__(self):
node = self.head
nodes = []
while node is not None:
... | 37 | 21.41 | 44 | 13 | 181 | python | [] | 0 | true | |
2024-11-18T21:23:58.225634+00:00 | 1,570,984,477,000 | 1d74148c0c5db12c4fcbcbd13383cd3b0c6d67d9 | 3 | {
"blob_id": "1d74148c0c5db12c4fcbcbd13383cd3b0c6d67d9",
"branch_name": "refs/heads/master",
"committer_date": 1570984477000,
"content_id": "c27e50c930deeb2d8afeae79f34c3669e09638b5",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "7791895299aa3b7c6736f6d45df9345c0e79c0af",
"extension": "py"... | 2.734375 | stackv2 | import random as rd
import numpy as np
import math
desk ="/Users/lofangyu/Desktop/"
f = open(desk + "training data.txt", "r")
list = f.readlines()
new_list=[]
for i in range(len(list)):
m = list[i]
n = m.replace(","," ")
new_list.append(n.split())
desk ="/Users/lofangyu/Desktop/"
f = open(desk + "testing-d... | 59 | 27.8 | 148 | 14 | 602 | python | [] | 0 | true | |
2024-11-18T21:23:58.415987+00:00 | 1,568,971,953,000 | dcb21c1c2f1b5ff24263c232cc090059bb9c943b | 3 | {
"blob_id": "dcb21c1c2f1b5ff24263c232cc090059bb9c943b",
"branch_name": "refs/heads/master",
"committer_date": 1568971953000,
"content_id": "b09130daa3c82d8ce4cd2a8fc596c51083e301af",
"detected_licenses": [
"MIT"
],
"directory_id": "fcd927827816696d56502979f9c02e4f71695ce9",
"extension": "py",
"fi... | 3.03125 | stackv2 | import scrapy
import time
from getNews.items import teamItem
class teamSpider(scrapy.Spider):
name = "teamSpider"
start_urls = ['https://zh.wikipedia.org/zh-tw/%E7%BE%8E%E5%9C%8B%E8%81%B7%E6%A5%AD%E6%A3%92%E7%90%83%E5%A4%A7%E8%81%AF%E7%9B%9F']
def parse(self, response):
for block in response.xpath('... | 25 | 39.84 | 133 | 15 | 300 | python | [] | 0 | true | |
2024-11-18T21:23:58.487819+00:00 | 1,625,648,469,000 | 0bb7dec63db510151c1944ae1bd83fbc101e42db | 4 | {
"blob_id": "0bb7dec63db510151c1944ae1bd83fbc101e42db",
"branch_name": "refs/heads/main",
"committer_date": 1625648469000,
"content_id": "6e5d64680964191bda43a47176ebbf5ea469d4e2",
"detected_licenses": [
"MIT"
],
"directory_id": "7c8ab8969125a14479ee106ad793931f0124e081",
"extension": "py",
"file... | 3.96875 | stackv2 | """
File: draw_line.py
Name: Jennifer Chueh (1.5hr)
-------------------------
This program creates lines on an instance of GWindow class.
There is a circle indicating the user’s first click. A line appears
at the condition where the circle disappears as the user clicks
on the canvas for the second time.
"""
from campy... | 51 | 20.69 | 79 | 10 | 298 | python | [] | 0 | true | |
2024-11-18T21:23:59.246692+00:00 | 1,662,377,069,000 | 293b6559fd7ee13cfd7e3df224096d6a56642d4c | 3 | {
"blob_id": "293b6559fd7ee13cfd7e3df224096d6a56642d4c",
"branch_name": "refs/heads/master",
"committer_date": 1662377069000,
"content_id": "93915da4ec3140c52885ad0e1ae3fce48cb85647",
"detected_licenses": [
"MIT"
],
"directory_id": "592c8ae293cfc4418b086226843bdeeeeae60899",
"extension": "py",
"fi... | 2.96875 | stackv2 | from numpy import *
from operator import itemgetter
import matplotlib.pyplot as plt
def file2matrix(filename):
file = open(filename)
arraylines = file.readlines()
numberoflines = len(arraylines) - 1
returnMat = zeros((numberoflines, 2))
classLabel = []
index = 0
for line in arraylines[1:]:
... | 54 | 32.41 | 95 | 14 | 515 | python | [] | 0 | true | |
2024-11-18T21:24:00.549490+00:00 | 1,532,094,640,000 | 0f054df6aaa143d1796747b7e3c3ad33664e51c1 | 2 | {
"blob_id": "0f054df6aaa143d1796747b7e3c3ad33664e51c1",
"branch_name": "refs/heads/master",
"committer_date": 1532094649000,
"content_id": "09aaac91911ad73395d971302fa524e86756bda5",
"detected_licenses": [
"MIT"
],
"directory_id": "0c085e5398759710528b895c0e5b1ad2ced7627b",
"extension": "py",
"fi... | 2.359375 | stackv2 | # -*- coding: utf-8 -*-
from __future__ import print_function
from locust import TaskSet, task
# import os
# import sys
# sys.path.append(os.getcwd())
import config
from common.util import get_random,header_maker,payload_maker,is_ok
# 继承的子类命名规则
# 必须和文件名同名,并且首字母要大写
class UserBehavior(TaskSet):
"""
继承的子类命名规则
... | 68 | 30.47 | 148 | 18 | 549 | python | [] | 0 | true | |
2024-11-18T21:24:01.009431+00:00 | 1,591,247,528,000 | a08fec462302ef13174d3deaf93a676c07bedfff | 4 | {
"blob_id": "a08fec462302ef13174d3deaf93a676c07bedfff",
"branch_name": "refs/heads/master",
"committer_date": 1591247528000,
"content_id": "59ddd755c769ff4785f10c42281a3a70ad7bb226",
"detected_licenses": [
"MIT"
],
"directory_id": "d30685458e1da7fc6add6f62954f701e1517e54d",
"extension": "py",
"fi... | 3.765625 | stackv2 | # ARMSTRONG
num = int(input('Enter the maximum limit'))
for i in range(0, num + 1):
# Finding the number of digits
temp = i
count = 0
while temp > 0:
count += 1
temp = temp // 10
# print(f'Count: {count}')
temp = i
total = 0
while temp > 0:
e = temp % 10
... | 21 | 19.71 | 43 | 11 | 139 | python | [] | 0 | true | |
2024-11-18T21:24:01.138426+00:00 | 1,624,360,354,000 | c8ed6a1dcc4283ec710a84513dcfe1e3faa64b8f | 3 | {
"blob_id": "c8ed6a1dcc4283ec710a84513dcfe1e3faa64b8f",
"branch_name": "refs/heads/main",
"committer_date": 1624360354000,
"content_id": "b956aa3d4cd90c1662ba85296169cb6968968c0f",
"detected_licenses": [
"MIT"
],
"directory_id": "e1277818bbe170d844e53d7c018bb052187a4f7e",
"extension": "py",
"file... | 3.09375 | stackv2 | # TN FP
# FN TP
import pandas as pd
import numpy as np
data = pd.read_csv("data.csv")
data.drop(["Unnamed: 32", "id"], axis=1, inplace=True)
# data.info()
# diagnosis object'ten oluştuğundan dolayı onu int yapalım yada kategorical
data.diagnosis = [1 if each == "M" else 0 for each in data.diagnosis]
# scaling (no... | 55 | 23.2 | 90 | 10 | 374 | python | [] | 0 | true | |
2024-11-18T21:24:01.195186+00:00 | 1,597,960,264,000 | 120cfb34c813166f1a004c14464193a7a46758b5 | 4 | {
"blob_id": "120cfb34c813166f1a004c14464193a7a46758b5",
"branch_name": "refs/heads/master",
"committer_date": 1597960264000,
"content_id": "745f8d9007417bbe9409e760f83bf76d10d00de6",
"detected_licenses": [
"MIT"
],
"directory_id": "72c8ab2d9bd69aafd65ff4f2b03886ce50081b90",
"extension": "py",
"fi... | 4.125 | stackv2 | #!/usr/bin/env python3
input = input ("Input your archaic number:")
array1 = list(input)
one = "I"
five = "V"
ten = "X"
fifty = "L"
one_hundred = "C"
five_hundred = "D"
one_thousand = "M"
translatedArray = []
#convert letters to basic number equivalent
for romanNumeral in array1:
if romanNumeral == one:
... | 80 | 22.69 | 84 | 11 | 467 | python | [] | 0 | true | |
2024-11-18T21:24:01.322177+00:00 | 1,593,715,268,000 | 01e57097f11b74e28c402a444795a27c202c3dea | 3 | {
"blob_id": "01e57097f11b74e28c402a444795a27c202c3dea",
"branch_name": "refs/heads/master",
"committer_date": 1593715268000,
"content_id": "e7c586c3af9c7a7957045f410130430cf1c6238f",
"detected_licenses": [
"MIT"
],
"directory_id": "9ea87c10180665db0db6fa36997704acc001692d",
"extension": "py",
"fi... | 3.265625 | stackv2 | ################################################################################
# sanitize.py
# sanitize.py is to define some standard sanitization functions to check for
# invalid or malicious inputs
#
# @Author ToraNova
# @mailto chia_jason96@live.com
# @version 1.1
# @date 22 May 2019
# @changelogs
# 1.0: introduc... | 44 | 29.82 | 91 | 12 | 338 | python | [] | 0 | true | |
2024-11-18T21:24:01.809406+00:00 | 1,588,086,101,000 | ac0d6a244475ff6942a9634e55f48eaffa62ffd4 | 3 | {
"blob_id": "ac0d6a244475ff6942a9634e55f48eaffa62ffd4",
"branch_name": "refs/heads/master",
"committer_date": 1588086101000,
"content_id": "cb50f90cbf266dc0ab1e7edb11130eecbdc527d0",
"detected_licenses": [
"MIT",
"Python-2.0"
],
"directory_id": "c22780fedc40542739d747263e1a21dc5d2df2e1",
"exten... | 2.703125 | stackv2 | from bayetorch.models.base import BayesianModel
from torch import Tensor
import torch
import torch.nn as nn
import torch.nn.functional as F
class ELBO(nn.Module):
def __init__(self, n_samples: int) -> None:
super(ELBO, self).__init__()
self.n_samples = n_samples
def forward(
self,
... | 68 | 28 | 79 | 16 | 500 | python | [] | 0 | true | |
2024-11-18T21:24:02.201586+00:00 | 1,580,420,801,000 | d5bd2b1f883e63ed2dab5363c35771c3b5393bf8 | 2 | {
"blob_id": "d5bd2b1f883e63ed2dab5363c35771c3b5393bf8",
"branch_name": "refs/heads/master",
"committer_date": 1580420801000,
"content_id": "6ce972706be39fc8fe133c21861d034288752762",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "8ea4b7fe3f20a3d6b62c9f1be16227a9fe8e759f",
"extension": "p... | 2.453125 | stackv2 | import numpy as np
import sys, getopt
def write_pin_locs(nets, inst_locs, inst_pins, outfile):
print "net length: ", len(nets)
print "inst_locs length: ", len(inst_locs)
print "inst_pins length: ", len(inst_pins)
uu2dbu = 1000
with open(outfile, 'w') as f:
num_nets = len(nets)
f.wri... | 154 | 36.61 | 119 | 24 | 1,420 | python | [] | 0 | true | |
2024-11-18T21:24:02.577477+00:00 | 1,618,889,948,000 | 6cea7995fc6bc91bbd9f9c85eff48eecaa62c3f8 | 2 | {
"blob_id": "6cea7995fc6bc91bbd9f9c85eff48eecaa62c3f8",
"branch_name": "refs/heads/main",
"committer_date": 1618889948000,
"content_id": "ac1be63b80b1e659ba2dae0d342521ed046f3f1c",
"detected_licenses": [
"MIT"
],
"directory_id": "54931457d24d7d5f0ca9b43d22b4d53c0707cfe9",
"extension": "py",
"file... | 2.484375 | stackv2 | import torch
from determined.pytorch import PyTorchTrialContext
from torch import Tensor, autograd, nn
class GradientPenalty:
def __init__(self, context: PyTorchTrialContext, discriminator: nn.Module) -> None:
super().__init__()
self.context = context
self.discriminator = discriminator
... | 27 | 36.11 | 118 | 14 | 237 | python | [] | 0 | true | |
2024-11-18T21:24:02.620950+00:00 | 1,619,791,887,000 | b6549482462d1e6f6f9feffaebd2900bb02d87a3 | 3 | {
"blob_id": "b6549482462d1e6f6f9feffaebd2900bb02d87a3",
"branch_name": "refs/heads/master",
"committer_date": 1619791887000,
"content_id": "4631f3005ad39a62f1a25f9f2efe51dd83696867",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "f118464036870f18db386e7b05ac7f2220c86a8a",
"extension": "py"... | 2.578125 | stackv2 | from typing import Set, List
import spacy
from lmproof.edit import Edit, Span
def get_edits(
token_idx: int, tokenized_sentence: spacy.tokens.Doc, substitutes: Set[str]
) -> List[Edit]:
candidate_edits = []
replaced_token = tokenized_sentence[token_idx]
for substitute in substitutes:
if repla... | 29 | 32.03 | 83 | 18 | 200 | python | [] | 0 | true | |
2024-11-18T21:24:02.687649+00:00 | 1,625,857,064,000 | 04faf51c10c52980e792c01035b3b355e5327f79 | 3 | {
"blob_id": "04faf51c10c52980e792c01035b3b355e5327f79",
"branch_name": "refs/heads/main",
"committer_date": 1625857064000,
"content_id": "440bbafdfb7c709f3ea6ffdf0a17cd53601964ac",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "aef40813a1b92cec0ea4fc25ec1d4a273f9bfad4",
"extension": "py",
... | 3.046875 | stackv2 | from typing import List
class Solution:
def combine(self, n: int, k: int) -> List[List[int]]:
return self.getAllCombination( n, k )
def getAllCombination(self, n, kLeft):
if kLeft == 1:
return [ [x] for x in range(1, n+1) ]
else:
outList = []
curList... | 18 | 33.33 | 60 | 20 | 159 | python | [] | 0 | true | |
2024-11-18T21:24:02.904836+00:00 | 1,629,943,618,000 | 33f4b7bcb3aa01e5632a06355b8a86f0e74421e9 | 4 | {
"blob_id": "33f4b7bcb3aa01e5632a06355b8a86f0e74421e9",
"branch_name": "refs/heads/master",
"committer_date": 1629943618000,
"content_id": "e2934479dda9764194a6ca1e5b337726cf0dd026",
"detected_licenses": [
"MIT"
],
"directory_id": "854506ceeb3941d7a019fd05a6d2f946f5f1e991",
"extension": "py",
"fi... | 3.59375 | stackv2 | class BasicConceptError(Exception):
def __init__(self, value_):
self.__value = value_
def __str__(self):
print('[Basic Concepts Error!]: ' + self.__value)
class Space:
def __init__(self, initial_list):
if not isinstance(initial_list, list):
raise BasicConceptError('Spa... | 23 | 28.22 | 82 | 12 | 152 | python | [] | 0 | true | |
2024-11-18T21:24:03.182822+00:00 | 1,669,983,054,000 | d3efcdcb7b84df085673eb741e78bdd62728c431 | 2 | {
"blob_id": "d3efcdcb7b84df085673eb741e78bdd62728c431",
"branch_name": "refs/heads/master",
"committer_date": 1669983054000,
"content_id": "be43cb7a9bb4777477eb4fff1955512ff6e7e987",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "56731673c481f872b61f86e9c8c07bb9b0548c94",
"extension": "p... | 2.328125 | stackv2 | import typing
from flask import Flask, Request, Response, jsonify
from jinja2 import Template
from .base import Apiman as _Apiman
class Apiman(_Apiman):
"""Flask extension
>>> app = Flask(__name__)
>>> apiman = Apiman(
... template="./examples/docs/dog_template.yml"
... )
>>> apiman.ini... | 138 | 36 | 94 | 24 | 1,046 | python | [{"finding_id": "codeql_py/jinja2/autoescape-false_a4578d36955f05c5_eb87b9ad", "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... | 2 | true | |
2024-11-18T21:24:03.315342+00:00 | 1,540,373,747,000 | 34f786fceca8c2091f9c6e733761b697f38c6e87 | 3 | {
"blob_id": "34f786fceca8c2091f9c6e733761b697f38c6e87",
"branch_name": "refs/heads/master",
"committer_date": 1540373747000,
"content_id": "270a5827ce10031d43eb42d614dde96322be3eaa",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "ce98a07a6303144c1cfa03f59c7c8148df41fbe4",
"extension": "p... | 2.890625 | stackv2 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# setting up modules being used in the program
import subprocess as sp
import sys
import os
# check os compatibility
if os.name == 'nt':
raise Exception("\nThis codes only compatible with Linux OS!")
# check python environment compatibility
if sys.version_info[0]... | 99 | 22.43 | 78 | 14 | 571 | python | [] | 0 | true | |
2024-11-18T21:24:03.820645+00:00 | 1,550,698,560,000 | 1255eca9e84d70bf288178f0b00cf75e3fb66589 | 3 | {
"blob_id": "1255eca9e84d70bf288178f0b00cf75e3fb66589",
"branch_name": "refs/heads/master",
"committer_date": 1550698560000,
"content_id": "0fdd80187756f82cb720862905ce13b6911418ba",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "7104c173dcd043ac04939d974d2201b7522aeb80",
"extension": "py"... | 2.59375 | stackv2 | #!/usr/bin/env python
import roslib
import rospy
from geometry_msgs.msg import Twist
import sys, select, termios, tty
from std_msgs.msg import String
from sensor_msgs.msg import LaserScan
from geometry_msgs.msg import Vector3
'''
CHRIS's CODE
'''
import time
from std_msgs.msg import UInt16
from sensor_msgs.msg impor... | 117 | 20.02 | 90 | 12 | 793 | python | [] | 0 | true | |
2024-11-18T21:37:17.435586+00:00 | 1,556,571,567,000 | 9bece041b5530a8f993c340b1d67d4984727fbfe | 3 | {
"blob_id": "9bece041b5530a8f993c340b1d67d4984727fbfe",
"branch_name": "refs/heads/master",
"committer_date": 1556571567000,
"content_id": "beee39c72771eaefd45d10304325871fa2e06918",
"detected_licenses": [
"MIT"
],
"directory_id": "07eb897a011a3556ca23c01e90091fd311774a81",
"extension": "py",
"fi... | 3.40625 | stackv2 | import markovify
from nltk import sent_tokenize
def generate_sample(text, n):
"""
Args:
text: the whole corpus as string
n: number of sentences in sample
Returns:
iterator with sentences (strings)
Examples:
>>> text = load_text()
>>> list(generate_sample(text, 2))
['И благословил Ездра Господа Бога ... | 35 | 27.71 | 95 | 14 | 295 | python | [] | 0 | true | |
2024-11-18T21:37:17.478371+00:00 | 1,555,011,312,000 | 5b00b46a8775975af86ee8ddf706fc48e67a89f5 | 4 | {
"blob_id": "5b00b46a8775975af86ee8ddf706fc48e67a89f5",
"branch_name": "refs/heads/master",
"committer_date": 1555011312000,
"content_id": "e35306108942da139e6f8a6b73fd8e3c9db5ea3b",
"detected_licenses": [
"MIT"
],
"directory_id": "9eaeda17f66dc24f23f8297e7e3d30c4b85090e8",
"extension": "py",
"fi... | 4.4375 | stackv2 | from To_Do import *
def taskMenu(toDo):
response = ''
response = input('''Would you like to...
(A)dd a task?
(C)omplete a task?
(L)ist current tasks?
(R)eview completed tasks?
(Q)uit? ''' + '\n')
# Adds a task to the to-do list
if (response == 'A' or response == 'a'):
toDo.add... | 56 | 26.66 | 72 | 14 | 459 | python | [] | 0 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.