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:10:51.736794+00:00 | 1,633,252,453,000 | 5179ccfe7ba8e05683ac0e6c1514daac1decfa85 | 2 | {
"blob_id": "5179ccfe7ba8e05683ac0e6c1514daac1decfa85",
"branch_name": "refs/heads/master",
"committer_date": 1633252453000,
"content_id": "4266733bd5388e66b370c4d97b704c304b3d8e2e",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "6d8d6c4708c92f79b6d55935e8e05015c0799cd1",
"extension": "py"... | 2.46875 | stackv2 | # This script connects to Kafka and send a few messages
from kafka import KafkaProducer
from kafka.errors import KafkaError
import json
import os
from faker import Faker
# PG_USER_PASS = os.environ['PG_PASS']
from dotenv import load_dotenv
load_dotenv()
SERVER_URL = os.getenv("SERVER_URL")
def producer_run():
... | 87 | 25.52 | 92 | 16 | 466 | python | [] | 0 | true | |
2024-11-18T21:10:51.905896+00:00 | 1,682,930,263,000 | b6404249be7cead8fac2b4629767c40f5e3821c1 | 3 | {
"blob_id": "b6404249be7cead8fac2b4629767c40f5e3821c1",
"branch_name": "refs/heads/master",
"committer_date": 1682930263000,
"content_id": "38f95bcbb511460c5b412f4cb3906670a22284cc",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "10e19b5cfd59208c1b754fea38c34cc1fb14fdbe",
"extension": "py"... | 2.984375 | stackv2 | #! /usr/bin/env python
"""Combine similar index entries into an entry and subentries.
For example:
\item {foobar} (in module flotz), 23
\item {foobar} (in module whackit), 4323
becomes
\item {foobar}
\subitem in module flotz, 23
\subitem in module whackit, 4323
Note that an item which matc... | 101 | 22.14 | 74 | 14 | 671 | python | [] | 0 | true | |
2024-11-18T21:10:51.962628+00:00 | 1,591,470,479,000 | 0c60ed967a00b2cd2492f7447004d1d0377c2b14 | 3 | {
"blob_id": "0c60ed967a00b2cd2492f7447004d1d0377c2b14",
"branch_name": "refs/heads/master",
"committer_date": 1591470479000,
"content_id": "75cdf18a996f42160af9ae69c7db02b277b99540",
"detected_licenses": [
"MIT"
],
"directory_id": "1ba6dc43b8d789b82b097813ea662ae4bc1821dd",
"extension": "py",
"fi... | 3.46875 | stackv2 | # -*- coding: utf-8 -*-
"""
Created on Wed May 20 17:56:56 2020
@author: CatsAndProcurement
The purpose of this script is to extract search-specific data from the
Government Accountability Office (GAO) Recommendations Database.
GAO is the primary legislative branch audit agency of the U.S. government.
This database c... | 161 | 41.6 | 98 | 17 | 1,665 | python | [] | 0 | true | |
2024-11-18T21:10:52.088889+00:00 | 1,498,381,979,000 | bcbd38b4d499c7f992c5bf7a178bb50d10e7aba4 | 3 | {
"blob_id": "bcbd38b4d499c7f992c5bf7a178bb50d10e7aba4",
"branch_name": "refs/heads/master",
"committer_date": 1498381979000,
"content_id": "d681b4808b51126c4078001b723cb3a0449ec4b9",
"detected_licenses": [
"MIT"
],
"directory_id": "17f1a6c63b39ea9ccf3a01d89af8e0aef1b92e07",
"extension": "py",
"fi... | 2.984375 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import string
from keras.models import Sequential
from keras.layers import Activation, Dense, LSTM
from keras.optimizers import SGD, Adam
import numpy as np
import abc
from ClassificationModule import ClassificationModule
from gensim.models import Word2Vec
from Models.Featu... | 118 | 41.19 | 153 | 18 | 1,144 | python | [] | 0 | true | |
2024-11-18T21:10:52.143041+00:00 | 1,561,622,636,000 | 25076f769356bf23cb37eada0c66a48b09e3b7b2 | 3 | {
"blob_id": "25076f769356bf23cb37eada0c66a48b09e3b7b2",
"branch_name": "refs/heads/master",
"committer_date": 1561622636000,
"content_id": "142afd3f6fcdc2d61defb55a565bcddec670e9c2",
"detected_licenses": [
"MIT"
],
"directory_id": "2583a7e61200e16155122dd4992a281fbf9f52df",
"extension": "py",
"fi... | 2.609375 | stackv2 | import csv
import setting as node_analysis_setting
import utils.db_meta as db_meta
def sort_nodes_by_number_peers(all_nodes):
sort_item_name = db_meta.hypertable_nodes_all_header_number_peers['name']
result = sorted(all_nodes.items(), key=lambda x: x[1][sort_item_name], reverse=True)
return result
def f... | 48 | 34 | 88 | 14 | 381 | python | [] | 0 | true | |
2024-11-18T21:10:52.454405+00:00 | 1,601,828,508,000 | 3c06c2a2c6704106735904087d75e16e148c2612 | 3 | {
"blob_id": "3c06c2a2c6704106735904087d75e16e148c2612",
"branch_name": "refs/heads/master",
"committer_date": 1601828508000,
"content_id": "11525551ce940efe6a62c88ccc1a718eb297544f",
"detected_licenses": [
"MIT"
],
"directory_id": "0f31514e700b90a829936cf4ffb58fc747b6bdee",
"extension": "py",
"fi... | 2.609375 | stackv2 | from pymongo import MongoClient, GEOSPHERE
from bson.json_util import dumps, loads
from bson.objectid import ObjectId
import json
from typing import List, Union
import os
import logging
import datetime
log = logging.getLogger(__name__)
PEAKS = [
{"name": "Mont Valier", "altitude": 2838, "position": [42.79778, 1.0... | 135 | 33.67 | 127 | 15 | 1,245 | python | [] | 0 | true | |
2024-11-18T21:10:52.597560+00:00 | 1,392,143,568,000 | 9a62c5754ef4b6e3ebe4dd9c37ccca37c81ae03e | 2 | {
"blob_id": "9a62c5754ef4b6e3ebe4dd9c37ccca37c81ae03e",
"branch_name": "refs/heads/master",
"committer_date": 1392143568000,
"content_id": "6c35306c0a2b416d928d42081baeb311fcb5f5ba",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "439f9cd7f2e5bf9f52b716f3281b96a0366d90e6",
"extension": "py"... | 2.359375 | stackv2 | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 82 | 32.88 | 74 | 16 | 669 | python | [] | 0 | true | |
2024-11-18T21:10:52.772315+00:00 | 1,487,226,935,000 | eefe962fadba4c39c82f34500823ccc066f914f9 | 3 | {
"blob_id": "eefe962fadba4c39c82f34500823ccc066f914f9",
"branch_name": "refs/heads/master",
"committer_date": 1487226935000,
"content_id": "f3d185d79f1ce6cce8ffb9e2f738b04129f856b9",
"detected_licenses": [
"MIT"
],
"directory_id": "834f0bd1ca8d1718dda94fc91a92d9a00614cb20",
"extension": "py",
"fi... | 2.796875 | stackv2 | # -*- coding: utf-8 -*-
import sys
import urllib
import subprocess
import argparse
import datetime
# Constants
URL = "http://www.gifu-nct.ac.jp/gakka/keijiyou/keijiyou.pdf"
LOCALPDF = "keijiyou.pdf"
LOCALTEXT = "keijiyou.txt"
def download():
urllib.urlretrieve(URL, LOCALPDF)
def pre_parse():
cmd = "pdftote... | 88 | 24.82 | 142 | 18 | 653 | python | [] | 0 | true | |
2024-11-18T21:10:52.889090+00:00 | 1,465,284,924,000 | d999819570994375179076d9715d8b19236da75f | 4 | {
"blob_id": "d999819570994375179076d9715d8b19236da75f",
"branch_name": "refs/heads/master",
"committer_date": 1465284924000,
"content_id": "92b0a5173883ba05ead5d87248765840c32b8137",
"detected_licenses": [
"CC0-1.0"
],
"directory_id": "b474d450e72fe4b838f659191c92711245096085",
"extension": "py",
... | 4.1875 | stackv2 | import random
# Defintion of Functions
def output(target, guess, difference):
print """
The target was {}.
Your guess was {}.""".format(target, guess)
if target > guess:
print "Thats under by {}.".format(difference)
elif target < guess:
print "Thats over by {}.".format(difference)
elif target == guess:
print... | 36 | 21.14 | 86 | 11 | 206 | python | [] | 0 | true | |
2024-11-18T21:10:52.944853+00:00 | 1,511,926,799,000 | 8353dba136c093d1ce38f01b4010c0d32b79fa36 | 3 | {
"blob_id": "8353dba136c093d1ce38f01b4010c0d32b79fa36",
"branch_name": "refs/heads/master",
"committer_date": 1511926799000,
"content_id": "7288a43c472613e04be7fa50056cadb909a61dea",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "56e17f97ea298314d9fda81d7adcfdbbf1e6887e",
"extension": "p... | 2.8125 | stackv2 | """
Preprocessing script for MT data.
"""
import re
import json
import os
import glob
import time
def make_dirs(dirs):
for d in dirs:
if not os.path.exists(d):
os.makedirs(d)
def build_vocab(dataset_paths, dst_path, word_count_threshold = 5):
# count up all word counts so that we can t... | 93 | 32.24 | 116 | 20 | 830 | python | [] | 0 | true | |
2024-11-18T21:10:53.122932+00:00 | 1,547,840,012,000 | a8f5ef3b65a57bb81dc224fab0372496e40c7cdc | 3 | {
"blob_id": "a8f5ef3b65a57bb81dc224fab0372496e40c7cdc",
"branch_name": "refs/heads/master",
"committer_date": 1547840012000,
"content_id": "01d547f5a661fbd2aa73e465c06b39ca5d062d10",
"detected_licenses": [
"MIT"
],
"directory_id": "f1183482e47167a9020046c061a53b88179193ec",
"extension": "py",
"fi... | 2.984375 | stackv2 | """
Obtains medications for patients at subsequent time points.
"""
import pandas as pd
from click import *
from logging import *
@command()
@option(
'--medication-input',
required=True,
help='the Feather file to read medications from')
@option(
'--joint-injection-input',
required=True,
help... | 94 | 26.02 | 79 | 14 | 562 | python | [] | 0 | true | |
2024-11-18T21:10:53.579730+00:00 | 1,611,445,336,000 | 471623bbc2e6d55621dc111a94827eb15cd837a1 | 4 | {
"blob_id": "471623bbc2e6d55621dc111a94827eb15cd837a1",
"branch_name": "refs/heads/master",
"committer_date": 1611445336000,
"content_id": "db9eb4c10ec9ccfc219eb1f0e4fef90852fc4a54",
"detected_licenses": [
"MIT"
],
"directory_id": "220d1675123669aae6250b1f51e430731af0ddee",
"extension": "py",
"fi... | 4.46875 | stackv2 | # Melhore o jogo do DESAFIO 028 onde o computador vai "pensar" em um número entre 0 e 10
# Só que agora o jogador vai tentar adivinhar até acertar, mostrando no final quantos palpites foram necessários para vencer
from random import randint
numberRandom = randint(0, 10)
print('Sou seu computador...')
print('Acabei d... | 25 | 31.96 | 124 | 12 | 241 | python | [] | 0 | true | |
2024-11-18T21:10:53.802359+00:00 | 1,351,101,388,000 | ebdae3bf6eb09fffa2a20c9284f434614c42255c | 3 | {
"blob_id": "ebdae3bf6eb09fffa2a20c9284f434614c42255c",
"branch_name": "refs/heads/master",
"committer_date": 1351101388000,
"content_id": "34098921d70b63afa0f452e94b23ca430c37420d",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "69fe55eab4c54ef07a5a67376275f2016bd63b5a",
"extension": "py"... | 2.78125 | stackv2 | #!/usr/bin/env python
"""
Activities.py
Prints the activities stack of a specific package name or the whole system.
Usage: python activities.py [<package name>]
"""
__author__ = 'Udi Cohen <udinic@gmail.com>'
__license__ = "Apache 2.0"
__copyright__ = 'Copyright 2012 Udi Cohen'
import subprocess
impor... | 63 | 27.68 | 87 | 14 | 412 | python | [] | 0 | true | |
2024-11-18T21:10:53.990133+00:00 | 1,692,632,951,000 | e03658d11eaa8b807d9016a7489851e5e6d3df5d | 3 | {
"blob_id": "e03658d11eaa8b807d9016a7489851e5e6d3df5d",
"branch_name": "refs/heads/master",
"committer_date": 1692632951000,
"content_id": "99fd8a4649e15f05848690308ea85748fa3b99cb",
"detected_licenses": [
"MIT"
],
"directory_id": "b0a9d9365b861e0fca2b985191a8e2d2fa8e1336",
"extension": "py",
"fi... | 2.78125 | stackv2 | """
Helpful pages:
* Microbit library source code: https://github.com/bbcmicrobit/micropython/tree/master/source/microbit
* Microbit Python API typings: https://github.com/MrYsLab/pseudo-microbit/blob/master/microbit/__init__.py
"""
from pedal.sandbox.mocked import MockModule
def generic_function_capture(self, func... | 266 | 24.21 | 111 | 17 | 1,630 | python | [] | 0 | true | |
2024-11-18T21:10:54.297846+00:00 | 1,498,878,305,000 | e0df8ec6ec13cf159d44f981fb7dc2df6e799acd | 2 | {
"blob_id": "e0df8ec6ec13cf159d44f981fb7dc2df6e799acd",
"branch_name": "refs/heads/master",
"committer_date": 1498878305000,
"content_id": "61a863dd35fee846036e3b7814bb0dc0bbdfc49e",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "0c5c4edf100de666fd7c2b7450b9c16bf99b951f",
"extension": "py"... | 2.5 | stackv2 | from model import Model
from datetime import datetime, date, timedelta
from google.cloud import datastore
class Courses(Model):
def __init__(self, cid=-1):
self.cid = cid
self.course_name = ""
self.ds = self.get_client()
def get_course(self, cid=None, name=None):
query = self.... | 143 | 32.66 | 79 | 19 | 994 | python | [] | 0 | true | |
2024-11-18T21:10:54.544060+00:00 | 1,629,743,963,000 | fc0eea9074db21d6225eb51cff284a9d3e488a3a | 2 | {
"blob_id": "fc0eea9074db21d6225eb51cff284a9d3e488a3a",
"branch_name": "refs/heads/main",
"committer_date": 1629743963000,
"content_id": "b900179690a86f7960d143d2304bb69d8dd1886f",
"detected_licenses": [
"MIT"
],
"directory_id": "7cac90dde8478a38ed497b53a2380729c2dbc8c7",
"extension": "py",
"file... | 2.34375 | stackv2 | import socket
import pickle
import time
import sys
from src.core_lib.cache_any_client.dto.dto import Operation, Statement
from src.core_lib.cache_any_client.operation_enum import OperationEnum
class CacheAny:
def __init__(self, hostname='localhost', port=65035):
self.__hostname = hostname
self.__... | 167 | 29.96 | 71 | 16 | 994 | python | [] | 0 | true | |
2024-11-18T21:10:54.675100+00:00 | 1,530,642,411,000 | 02279eaba4ae072a5f4bd708ee91301601914923 | 3 | {
"blob_id": "02279eaba4ae072a5f4bd708ee91301601914923",
"branch_name": "refs/heads/master",
"committer_date": 1530642411000,
"content_id": "75c834f6c392bad3b8e83705923aa2dc05c5dd8d",
"detected_licenses": [
"MIT"
],
"directory_id": "1074a8c7936bde7b5a96d6a257232ac829ba3406",
"extension": "py",
"fi... | 3.28125 | stackv2 | import pygame
import settings as settings
from math import sqrt, atan2, sin ,cos
class Player:
def __init__(self, init_x, init_y):
self.image = pygame.image.load("assets/einstein.png")
self.proper_height = 150
self.proper_width = 150
self.mass = 1
self.height = self.proper... | 104 | 33.2 | 116 | 18 | 1,009 | python | [] | 0 | true | |
2024-11-18T21:10:54.731545+00:00 | 1,548,619,653,000 | 3ded6d3692ddfa4f6a43b0038aaa9359a90f098e | 3 | {
"blob_id": "3ded6d3692ddfa4f6a43b0038aaa9359a90f098e",
"branch_name": "refs/heads/master",
"committer_date": 1548619653000,
"content_id": "8e756593e0c2ca23229c20efdf30f8579871f03f",
"detected_licenses": [
"MIT"
],
"directory_id": "d3671982b44da629cb1598d8a06612caca52c09d",
"extension": "py",
"fi... | 2.5625 | stackv2 | # coding: utf-8
"""
Created on 25.08.2018
:author: Polianok Bogdan
"""
import sys
import os
import logging
import datetime
import requests
skyenv = os.environ.get('SKYENV', '/home/skyenv/')
sys.path.append(skyenv)
from vkBot.source.constants import ButtonsEnum, cities
from modules.api import apiRequest
logger = ... | 431 | 31.23 | 127 | 18 | 2,997 | python | [] | 0 | true | |
2024-11-18T21:10:54.849821+00:00 | 1,631,626,395,000 | df47816681914b7d946a0b8346f27d01b1c45eb1 | 3 | {
"blob_id": "df47816681914b7d946a0b8346f27d01b1c45eb1",
"branch_name": "refs/heads/main",
"committer_date": 1631626395000,
"content_id": "daf7c7dc8170c3e5198fbb015b08cb02d7c023a4",
"detected_licenses": [
"MIT"
],
"directory_id": "17d241993faa43aea2b0e9a5f4c562ea3571d33d",
"extension": "py",
"file... | 2.96875 | stackv2 | """Аугментация методом контекстной вставки случайного токена."""
import random
from typing import List, Tuple
import torch
import tqdm
from transformers import BertTokenizerFast, pipeline
def contextual_imputer(
texts: List,
labels: List,
top_k: int,
model_name: str = 'bert-base-uncased') \
-... | 46 | 34.85 | 98 | 13 | 410 | python | [] | 0 | true | |
2024-11-18T21:10:54.914559+00:00 | 1,592,505,119,000 | b438c1590ad35e83cb6908e5939c80c6bf51e61a | 3 | {
"blob_id": "b438c1590ad35e83cb6908e5939c80c6bf51e61a",
"branch_name": "refs/heads/master",
"committer_date": 1592505119000,
"content_id": "133b181bac9c04d80fee954420c238bc0132e105",
"detected_licenses": [
"MIT"
],
"directory_id": "d205bc3e5697538feb9a8421deae5926461ce38e",
"extension": "py",
"fi... | 2.96875 | stackv2 | import requests
url = 'https://exofop.ipac.caltech.edu/tess/download_toi.php?sort=toi&output=csv'
r = requests.get(url, allow_redirects=True)
open('All Rows (CSV)', 'wb').write(r.content) #this downloads and saves the file to wherever this notebook is saved
r.status_code #200 means the request was successful, 404 indi... | 34 | 44.82 | 154 | 14 | 638 | python | [] | 0 | true | |
2024-11-18T21:10:55.035640+00:00 | 1,548,183,200,000 | a4d2e45fb242bec263f596cf2295159322fb5384 | 3 | {
"blob_id": "a4d2e45fb242bec263f596cf2295159322fb5384",
"branch_name": "refs/heads/master",
"committer_date": 1548183200000,
"content_id": "c15ea8a7b53b81c49a01a700541e1b82b4e1971e",
"detected_licenses": [
"MIT"
],
"directory_id": "c461b8f8bc89ea4f358700982b48a1d509c82b43",
"extension": "py",
"fi... | 2.65625 | stackv2 | import re
import pickle
import os.path
import time
import urllib.request
from bs4 import BeautifulSoup
# ROGuard Endless Tower URL
URL = 'http://www.roguard.net/game/endless-tower/'
CACHE_FNAME = 'ET_dump.pickle'
IDMAP_FNAME = 'roguard_mon_id.txt'
def parse_monster_id_map():
id_map = {}
with open(IDMAP_FNAME)... | 137 | 28.32 | 73 | 18 | 995 | python | [] | 0 | true | |
2024-11-18T21:10:55.412040+00:00 | 1,691,049,637,000 | 34dc910d36db34d3fbf15d4898ee70c2d02c3eb4 | 3 | {
"blob_id": "34dc910d36db34d3fbf15d4898ee70c2d02c3eb4",
"branch_name": "refs/heads/main",
"committer_date": 1691049637000,
"content_id": "5a68a096401a5da09cf10e9cbbd01bec0014aefd",
"detected_licenses": [
"MIT"
],
"directory_id": "7607429663127ad7429d0815006dbb6aba2f3fd0",
"extension": "py",
"file... | 3 | stackv2 | import signal
import contextlib
import functools
from veros import logger
def do_not_disturb(function):
"""Decorator that catches SIGINT and SIGTERM signals (e.g. after keyboard interrupt)
and makes sure that the function body is executed before exiting.
Useful for ensuring that output files are written... | 79 | 28.49 | 88 | 17 | 491 | python | [] | 0 | true | |
2024-11-18T21:10:55.474242+00:00 | 1,591,587,881,000 | 24b02c9810b290ad0cc25e1f6d470398b708c2a9 | 3 | {
"blob_id": "24b02c9810b290ad0cc25e1f6d470398b708c2a9",
"branch_name": "refs/heads/master",
"committer_date": 1591587881000,
"content_id": "b99552b9aa4f6d7519fed4f2b37a9e3fc302ea0a",
"detected_licenses": [
"MIT"
],
"directory_id": "9035451fcae99d2b2a2e0639fea23c88e53fcd84",
"extension": "py",
"fi... | 2.75 | stackv2 | from bs4 import BeautifulSoup, element # type: ignore
import re
from typing import List
from urllib.parse import urljoin
from .base import NewsScraper
from .errors import FormatError
from .feed import NewsItem
from .utils import get_base_url, is_covid_related, parse_datetime
SUMMARY_PREFIX_PATTERN = re.compile(r'^SO... | 83 | 37.13 | 107 | 16 | 740 | python | [] | 0 | true | |
2024-11-18T21:10:55.697997+00:00 | 1,650,024,865,000 | e139a54c27e7406a39a8ad3e94a98ada1a383c75 | 2 | {
"blob_id": "e139a54c27e7406a39a8ad3e94a98ada1a383c75",
"branch_name": "refs/heads/master",
"committer_date": 1650024865000,
"content_id": "d0c3e16c424da9b5c633fe1b641a07df7a1b173f",
"detected_licenses": [
"MIT"
],
"directory_id": "fbf6fcd3720d1a5f1f01f91c7ecad68f1b296924",
"extension": "py",
"fi... | 2.40625 | stackv2 | #!/usr/bin/env python
import base64, csv, sys, zlib, time, mmap, os
import numpy as np
import os.path as osp
import cPickle as pickle
def maybe_create(dir_path):
if not osp.exists(dir_path):
os.makedirs(dir_path)
csv.field_size_limit(sys.maxsize)
FIELDNAMES = ['image_id', 'image_w','image_h','num_boxes',... | 45 | 38.84 | 118 | 16 | 464 | python | [] | 0 | true | |
2024-11-18T21:10:55.761588+00:00 | 1,483,064,301,000 | facc370fac7918c33507dec1778225394fa7ac48 | 3 | {
"blob_id": "facc370fac7918c33507dec1778225394fa7ac48",
"branch_name": "refs/heads/master",
"committer_date": 1483064301000,
"content_id": "cd6f19e34c2d2e0cdf4d5299dac9e803de3f1c5a",
"detected_licenses": [
"MIT"
],
"directory_id": "d135ff97fc36ce13d2e1326c8ebbb83275d44246",
"extension": "py",
"fi... | 3.203125 | stackv2 | import matplotlib.pyplot as plt
import numpy as np
SEP = "\t"
# ----------------------------------------------------------------
# Standard Linear Regression
# ----------------------------------------------------------------
def load_data_and_label(file_name):
data, label = [], []
with open(file_name) as ... | 197 | 33.52 | 99 | 17 | 1,646 | python | [] | 0 | true | |
2024-11-18T21:10:55.981139+00:00 | 1,622,977,750,000 | 6de86c02ba92ab83dcfdc49e3edf7ebd7cfb964a | 3 | {
"blob_id": "6de86c02ba92ab83dcfdc49e3edf7ebd7cfb964a",
"branch_name": "refs/heads/main",
"committer_date": 1622977750000,
"content_id": "e2cc31fb962dc4c743ca140e16a7847a592ee388",
"detected_licenses": [
"MIT"
],
"directory_id": "4fb2cc669e2a7fc99a7ed283e87ee0c5c6d893e2",
"extension": "py",
"file... | 2.625 | stackv2 | from os import environ
from pandas import DataFrame, read_csv
from dotenv import load_dotenv
from src.driver import get_driver
from src.all_languages import get_df_with_all_languages
from src.all_languages_details import get_all_languages_details_in_df
from src.consts import (
path_to_links_dataset,
path_to_a... | 61 | 25.13 | 75 | 11 | 374 | python | [] | 0 | true | |
2024-11-18T21:10:56.027431+00:00 | 1,605,088,556,000 | 010deddaa456c410682dbafc12be9817573c43d4 | 3 | {
"blob_id": "010deddaa456c410682dbafc12be9817573c43d4",
"branch_name": "refs/heads/main",
"committer_date": 1605088556000,
"content_id": "db89dc45185aaf94b331570f23e52be8fd242071",
"detected_licenses": [
"MIT"
],
"directory_id": "8a878d95a61b2dec447b1f3ecbbb91d1207011e3",
"extension": "py",
"file... | 2.78125 | stackv2 | import argparse
def read_merged_kitsune_ds(fpath):
with open(fpath, 'r') as fin:
data = fin.readlines()
ds_dict = {}
curr_tag = 'dummy'
for i in range(len(data)):
row = data[i].rstrip('\n')
if '==>' in row and '<==' in row:
ds_category = row.split(" ")[1].split(... | 53 | 40.13 | 95 | 20 | 550 | python | [] | 0 | true | |
2024-11-18T21:10:56.135149+00:00 | 1,641,946,695,000 | 2c8d47543e9cbb767191c8e8bb1751277e3b9d24 | 3 | {
"blob_id": "2c8d47543e9cbb767191c8e8bb1751277e3b9d24",
"branch_name": "refs/heads/master",
"committer_date": 1641946695000,
"content_id": "c32760ec790cdc9d25103ff21153ff44d88ac2a7",
"detected_licenses": [
"MIT"
],
"directory_id": "ef80a747245da45989bfe9ddd4dcc6fe4b3d3ea5",
"extension": "py",
"fi... | 2.71875 | stackv2 | #Draws PRC and ROC curves for predicted and true values
import argparse
from sklearn.metrics import precision_recall_curve,average_precision_score,roc_curve
import matplotlib.pyplot as plt
import h5py
import pickle
import numpy as np
from random import random
from operator import add
from pylab import rcParams
rcParam... | 117 | 32.97 | 116 | 19 | 1,065 | python | [] | 0 | true | |
2024-11-18T21:10:56.412986+00:00 | 1,447,278,432,000 | d2c45942376a8b7f487088d8aca1aa67dcb91cba | 3 | {
"blob_id": "d2c45942376a8b7f487088d8aca1aa67dcb91cba",
"branch_name": "refs/heads/master",
"committer_date": 1447278432000,
"content_id": "32120ce59ba25ed6feaf6cfa005e3adaddd4e3cf",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "dc07969bcc9fa34917c21e71e025bebacd7b5127",
"extension": "py"... | 2.78125 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Parselmouth utilities
"""
# Future-proof
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# Standard Library Imports
import signal
# Local Package Imports
from parsel... | 89 | 30.61 | 81 | 13 | 605 | python | [] | 0 | true | |
2024-11-18T21:10:56.646619+00:00 | 1,631,723,597,000 | 5d023017adf23a83a4c35e5d0072796ed3b83ac3 | 3 | {
"blob_id": "5d023017adf23a83a4c35e5d0072796ed3b83ac3",
"branch_name": "refs/heads/main",
"committer_date": 1631723597000,
"content_id": "b29cac00f5efae01bfda58a48d2da5b2970a6aec",
"detected_licenses": [
"MIT"
],
"directory_id": "6b62e08994bdb3221743bfc329c05656f270e7e0",
"extension": "py",
"file... | 2.921875 | stackv2 | """Basis Model for object detection with tensorflow and distance calculation."""
__version__ = "1.0.0"
__author__ = "Tim Rosenkranz"
__email__ = "tim.rosenkranz:stud.uni-frankfurt.de"
__credits__ = "Special thanks to The Anh Vuong who came up with the original idea." \
"This code is also based off of cod... | 239 | 41.64 | 119 | 23 | 2,285 | python | [] | 0 | true | |
2024-11-18T21:10:56.811497+00:00 | 1,522,816,165,000 | 8e4eb2d33340679da0808c111f9f4b228776b3f5 | 3 | {
"blob_id": "8e4eb2d33340679da0808c111f9f4b228776b3f5",
"branch_name": "refs/heads/master",
"committer_date": 1522816165000,
"content_id": "1662ac612f9df7ef084c442e14710ba64c216eb5",
"detected_licenses": [
"MIT"
],
"directory_id": "7b301234e917ae1b431a58699b3a55f7a4423b77",
"extension": "py",
"fi... | 3.078125 | stackv2 | from maze import Maze, Point
from random import choice
def prune(path, dirpath):
last = path[-1]
if path.count(last) > 1:
a = path.index(last)
path = path[:a + 1]
dirpath = dirpath[:a]
return (path, dirpath)
def generate(w, h):
maze = Maze(w, h)
yield maze
n = maze.ra... | 35 | 24.31 | 68 | 14 | 233 | python | [] | 0 | true | |
2024-11-18T21:10:59.107982+00:00 | 1,634,057,786,000 | 33426bc57c375385a8642da232d671bafab10335 | 3 | {
"blob_id": "33426bc57c375385a8642da232d671bafab10335",
"branch_name": "refs/heads/main",
"committer_date": 1634057786000,
"content_id": "1c1c934c9d2d4bc9cb4014474d3ff0258bb75128",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "bad9ba773b4878a6f46a4a47b1e5380c0c9fe483",
"extension": "py",
... | 2.71875 | stackv2 |
import board
import keypad
class Keypad():
def __init__(self, keys):
self._key_pins = [getattr(board, "KEY%d" % (num + 1)) for num in list(range(12))]
self._keys = keypad.Keys(self._key_pins, value_when_pressed=False, pull=True)
self._key_map = [item for sublist in list(keys) for item in s... | 22 | 35.77 | 89 | 16 | 191 | python | [] | 0 | true | |
2024-11-18T21:23:30.481462+00:00 | 1,658,132,405,000 | ccadc2a20b85f2951215a61ea0d4e44bd6fa85dc | 2 | {
"blob_id": "ccadc2a20b85f2951215a61ea0d4e44bd6fa85dc",
"branch_name": "refs/heads/master",
"committer_date": 1658132405000,
"content_id": "e2cc00ef590bf989ae8c196db042c4dc2f0df42b",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "9e75c138bc5e8fedc948fdd90bc4dd4f6b502ec9",
"extension": "py"... | 2.34375 | stackv2 | import argparse
import logging
import copy
import readers as dp
import numpy as np
from keras.layers import Dense, Input
from keras.models import Model
from keras import losses
from keras.utils import to_categorical
from keras.callbacks import Callback
from sklearn.metrics import accuracy_score
####################... | 184 | 41.78 | 172 | 16 | 1,737 | python | [] | 0 | true | |
2024-11-18T21:23:30.681126+00:00 | 1,596,012,024,000 | d7111ad819912e4f215c769a27c10a502dc02037 | 4 | {
"blob_id": "d7111ad819912e4f215c769a27c10a502dc02037",
"branch_name": "refs/heads/master",
"committer_date": 1596012024000,
"content_id": "6ee25aae3b82b3328a66fc7da6e9daa10b477080",
"detected_licenses": [
"MIT"
],
"directory_id": "f16a5ac92fab06ef132bb00f6ef36a3fefec8c86",
"extension": "py",
"fi... | 3.78125 | stackv2 | def initial_points(starting_n, opt_func, x_bounds, y_bounds):
'''
Picks and evaluates random initial points from the function
Parameters
----------
starting_n : int
Number of initial points picked.
The default is 100.
opt_func : function
The function from which the point... | 44 | 23.68 | 63 | 10 | 284 | python | [] | 0 | true | |
2024-11-18T21:23:30.835585+00:00 | 1,617,820,760,000 | e0c7448e01a87080cbd42d026140833a76e82bdd | 2 | {
"blob_id": "e0c7448e01a87080cbd42d026140833a76e82bdd",
"branch_name": "refs/heads/main",
"committer_date": 1617820760000,
"content_id": "e6d66b7a399d27a24b02aae26b682b3be965039a",
"detected_licenses": [
"MIT"
],
"directory_id": "f2359d41f28ee2c4e0103527168efa483eb6f25a",
"extension": "py",
"file... | 2.5 | stackv2 | from django.db import models
from django.core.validators import MinLengthValidator
class ParadoxUser(models.Model):
"""
Model for Paradox Users
"""
google_id = models.CharField(max_length=255, primary_key=True)
name = models.CharField(max_length=255, blank=False, null=False,
... | 153 | 30.61 | 116 | 14 | 1,133 | python | [] | 0 | true | |
2024-11-18T21:23:31.056100+00:00 | 1,615,616,350,000 | df86cf93437ece423716079917c59992e29f21c2 | 2 | {
"blob_id": "df86cf93437ece423716079917c59992e29f21c2",
"branch_name": "refs/heads/master",
"committer_date": 1615616350000,
"content_id": "914aa520056523f189ed4aad26b7e5e4bbfbcade",
"detected_licenses": [
"MIT"
],
"directory_id": "281b53cb7e7fd80dcbeb14e484526523f4965f91",
"extension": "py",
"fi... | 2.421875 | stackv2 | import numpy as np
import tensorflow as tf
import tree
class StructureList:
def __init__(self, length):
self.length = length
def add_batch(self, values, rows, slots=None):
raise NotImplementedError()
def select(self, indices, slots=None):
raise NotImplementedError()
... | 154 | 34.82 | 93 | 18 | 1,195 | python | [] | 0 | true | |
2024-11-18T21:23:31.207430+00:00 | 1,566,438,278,000 | 82b8fdbe03c53f9774ca98e51379e80fc95d528c | 3 | {
"blob_id": "82b8fdbe03c53f9774ca98e51379e80fc95d528c",
"branch_name": "refs/heads/master",
"committer_date": 1566438278000,
"content_id": "ee333a1a2a9189ba67a7446037567f10fbe04d83",
"detected_licenses": [
"MIT"
],
"directory_id": "9c6f2fe551038bb9648280461a446627b3423f98",
"extension": "py",
"fi... | 2.65625 | stackv2 | import numpy as np
import torch
from PIL import Image
from torch.autograd import Variable
from src.get_nets import PNet, RNet, ONet
from src.box_utils import nms, calibrate_box, get_image_boxes, convert_to_square
from src.first_stage import run_first_stage
from src.visualization_utils import show_bboxes
pnet = PNet()... | 62 | 23.79 | 80 | 10 | 426 | python | [] | 0 | true | |
2024-11-18T21:23:31.388629+00:00 | 1,637,684,893,000 | 1ad302f59c7ac2062195dd048832ab552ab265bf | 2 | {
"blob_id": "1ad302f59c7ac2062195dd048832ab552ab265bf",
"branch_name": "refs/heads/main",
"committer_date": 1637684893000,
"content_id": "5beb662c169fd32192d64e9dada237b1e56fa105",
"detected_licenses": [
"MIT"
],
"directory_id": "0524b8dab82025663d4401e1e3a3cc19460424fb",
"extension": "py",
"file... | 2.3125 | stackv2 | # import numpy as np
# import mido, os, pickle, yaml, hgtk, argparse, math
# from tqdm import tqdm
# import matplotlib.pyplot as plt
# paths = []
# for root, _, files in os.walk('E:/Pattern/Sing/NAMS_MIDI_WAV'):
# for file in files:
# if os.path.splitext(file)[1] != '.wav':
# continue
# ... | 98 | 29.51 | 127 | 8 | 886 | python | [] | 0 | true | |
2024-11-18T21:23:31.450230+00:00 | 1,623,055,577,000 | 7293b218ddd7e4fd222daf470f1aec9e26881dba | 3 | {
"blob_id": "7293b218ddd7e4fd222daf470f1aec9e26881dba",
"branch_name": "refs/heads/master",
"committer_date": 1623055577000,
"content_id": "987ed5f406919d2fe52eae16d3e5bbf47ac37916",
"detected_licenses": [
"MIT"
],
"directory_id": "de363424234cd3a3f929a5ddb8c9a86173e1a88f",
"extension": "py",
"fi... | 3.125 | stackv2 | """
Quantitative Reasoning (All):
- Quantitative|Min/Max|Single entity type - Done
- Quantitative|Min/Max|Mult. entity type - Done
- Quantitative|Atleast/ Atmost/ Approx. the same/Equal|Mult. entity type - Done
- Quantitative|Atleast/ Atmost/ Approx. the same/Equal|Single entity type - Done
Quantitative Reasoning (Cou... | 390 | 40.13 | 135 | 20 | 3,531 | python | [] | 0 | true | |
2024-11-18T21:23:31.894821+00:00 | 1,612,284,209,000 | 1aeaa663dce3a246024ee7713cd051345c74b280 | 3 | {
"blob_id": "1aeaa663dce3a246024ee7713cd051345c74b280",
"branch_name": "refs/heads/master",
"committer_date": 1612284209000,
"content_id": "9f620f960cd70ea5e204d70fed6632dcc7906a09",
"detected_licenses": [
"MIT"
],
"directory_id": "70fee639067b2da06f3a8ab88b16b5ee72de028b",
"extension": "py",
"fi... | 2.515625 | stackv2 | """Definitions for the primitive `scalar_log`."""
import math
from ..lib import (
UniformPrimitiveInferrer,
assert_scalar,
bprop_to_grad_transform,
)
from ..xtype import Float
from . import primitives as P
def pyimpl_scalar_log(x: Float) -> Float:
"""Implement `scalar_log`."""
assert_scalar(x)
... | 46 | 21.37 | 64 | 8 | 256 | python | [] | 0 | true | |
2024-11-18T21:23:31.942290+00:00 | 1,613,427,872,000 | fcb40c907a31e33a551b5adab52d4e0325857727 | 3 | {
"blob_id": "fcb40c907a31e33a551b5adab52d4e0325857727",
"branch_name": "refs/heads/main",
"committer_date": 1613427872000,
"content_id": "e3bf31b0f5b693cd97f7081d8454a9398e087f09",
"detected_licenses": [
"MIT"
],
"directory_id": "2dd6f27ae7f10f7d86ef57f5fe739c484a60b5da",
"extension": "py",
"file... | 3.03125 | stackv2 | from flask import render_template, request, redirect, url_for, flash, session, jsonify
from flask import current_app as app
from datetime import datetime
import pytz
from .database.dao import UserDao, DeviceDao, DeviceOccupancyDao
from .helper.helper import calculate_max_people, is_not_logged_in
user_dao = UserDao()... | 193 | 31.39 | 118 | 16 | 1,373 | python | [{"finding_id": "codeql_py/url-redirection_18aacf20111351fb_4ede1845", "tool_name": "codeql", "rule_id": "py/url-redirection", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "Untrusted URL redirection depends on a [user-provided value](1).", "remediation": "", "location": {"file_... | 1 | true | |
2024-11-18T21:23:32.306232+00:00 | 1,564,564,733,000 | 975ebd73e79a1a1c8cf4886a7d26e5a33f3dd680 | 3 | {
"blob_id": "975ebd73e79a1a1c8cf4886a7d26e5a33f3dd680",
"branch_name": "refs/heads/master",
"committer_date": 1564564733000,
"content_id": "b7bbe3717b96b84eea8217be558622fe9484b3e1",
"detected_licenses": [
"MIT"
],
"directory_id": "e55ab996704f635498268fc10432959ce5e430a3",
"extension": "py",
"fi... | 3.375 | stackv2 | class KVNode(object):
def __init__(self, k, v):
self.key = k
self.value = v
self.next = None
def __repr__(self):
"""
>>> n = KVNode('a', 1)
>>> n
KVNode('a', 1)
"""
return 'KVNode({}, {})'.format(repr(self.key), repr(self.value))
class ... | 159 | 20.68 | 85 | 14 | 966 | python | [] | 0 | true | |
2024-11-18T21:23:32.363509+00:00 | 1,406,123,409,000 | acfd6f85fc934fe492459e3fad109d199be26fef | 3 | {
"blob_id": "acfd6f85fc934fe492459e3fad109d199be26fef",
"branch_name": "refs/heads/master",
"committer_date": 1406123409000,
"content_id": "6f38b8a548d431c0f1c63a6277a8b23919ad6077",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "f94790a262f6d31f91ec0a0b63d5212a36a9ee6d",
"extension": "p... | 2.796875 | stackv2 | """
Logging.
"""
import csv
import os
import numpy as np
from dist_mixtures.base import Struct
def create_logs(psets):
"""
Create CSV logs for given parameter sets.
"""
import analyses.ioutils as io
logs = []
for ii, pset in enumerate(psets):
io.ensure_path(pset.output_dir)
l... | 209 | 31.27 | 80 | 17 | 1,605 | python | [] | 0 | true | |
2024-11-18T21:23:32.410723+00:00 | 1,625,590,104,000 | db33e9f5aab3b339312f230bb810061bf1f25495 | 3 | {
"blob_id": "db33e9f5aab3b339312f230bb810061bf1f25495",
"branch_name": "refs/heads/master",
"committer_date": 1625590104000,
"content_id": "9ba76b9dff8754ecb051bb44832b3cd26cf1cd31",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "9394645646a16a63e9ffa605d0b2026110953139",
"extension": "py"... | 2.609375 | stackv2 | from typing import cast, List, Optional, Tuple, Union
import torch
import torch.nn as nn
import kornia
from kornia.augmentation.base import _AugmentationBase, MixAugmentationBase, TensorWithTransformMat
from kornia.augmentation.container.base import SequentialBase
from .image import ImageSequential, ParamItem
__all... | 205 | 44.41 | 118 | 24 | 2,315 | python | [] | 0 | true | |
2024-11-18T21:23:32.522438+00:00 | 1,617,642,337,000 | 6c68edd442fb7878417ad9530b52283aed908cae | 3 | {
"blob_id": "6c68edd442fb7878417ad9530b52283aed908cae",
"branch_name": "refs/heads/master",
"committer_date": 1617642337000,
"content_id": "d7c4c45f95eb4897a90320365f21022e049f7500",
"detected_licenses": [
"BSD-3-Clause",
"BSD-3-Clause-LBNL"
],
"directory_id": "c7ebea3c97948683b4f0eb8cc6263bf58c1... | 2.96875 | stackv2 | import json
from ase import Atom, Atoms
from ase.calculators.calculator import Calculator
from ase.io import Trajectory
# to get the total energy
def get_total_energy(cjson):
total_energy = cjson["cjson"]["properties"]["energy"]["total"]
return total_energy
def cjson_to_ase(cjson):
coord_start = 0
c... | 170 | 23.52 | 74 | 17 | 926 | python | [] | 0 | true | |
2024-11-18T21:23:32.647890+00:00 | 1,432,725,901,000 | b84e00c65fc199db773ad7bc3b9285981022eace | 2 | {
"blob_id": "b84e00c65fc199db773ad7bc3b9285981022eace",
"branch_name": "refs/heads/master",
"committer_date": 1432725901000,
"content_id": "1de63f89bd34f57265908a4f9f144be68bf22e77",
"detected_licenses": [
"MIT"
],
"directory_id": "9cbb7ef8d89b01410ecc76fa9068c43525cd6d36",
"extension": "py",
"fi... | 2.46875 | stackv2 | # -*- coding: utf-8 -*-
"""
Created on Sat May 02 21:57:16 2015
@author: Sarunya
"""
import os
import sys
import numpy as np
from PIL import Image
import time
import skimage.feature as ft
sys.setrecursionlimit(10000)
def timestamp(tt=time.time()):
st=time.time()
print(" took: %.2f sec"%(st-tt))
r... | 71 | 22.77 | 58 | 15 | 478 | python | [] | 0 | true | |
2024-11-18T21:23:34.166276+00:00 | 1,592,117,995,000 | 2fd19b3c494fc132af0611392a2579c0bb2150b2 | 3 | {
"blob_id": "2fd19b3c494fc132af0611392a2579c0bb2150b2",
"branch_name": "refs/heads/master",
"committer_date": 1592117995000,
"content_id": "7d3d076e5a47c35212204d27f74350e688a9750c",
"detected_licenses": [
"MIT"
],
"directory_id": "64cbc3ac9717e5381af34888b21cfb00af308668",
"extension": "py",
"fi... | 3.25 | stackv2 | class Solution:
def countCharacters(self, words: List[str], chars: str) -> int:
result = 0
chars_counter = collections.Counter(chars)
for word in words:
good = True
for k,v in collections.Counter(word).items():
if k not in chars_counter:
... | 16 | 33 | 67 | 14 | 103 | python | [] | 0 | true | |
2024-11-18T21:23:34.279709+00:00 | 1,554,190,644,000 | 181dbb8fa85cf102a97d4536fc8db66321aafc73 | 3 | {
"blob_id": "181dbb8fa85cf102a97d4536fc8db66321aafc73",
"branch_name": "refs/heads/master",
"committer_date": 1554190644000,
"content_id": "d4ed92b3800e68b218fdcd99d1f3f1c375ce6bcb",
"detected_licenses": [
"MIT"
],
"directory_id": "96063b1bb62340951358d73ff857623d98a07ee1",
"extension": "py",
"fi... | 2.75 | stackv2 |
import pandas as pd
def compare_bom_cost(excel_name, sheet_name, bom_summary_file_name, output_file_name):
try:
df = pd.read_excel(excel_name, sheet_name)
df_cost = pd.read_csv(bom_summary_file_name)
dfr = pd.merge(left=df, right=df_cost, left_on='物料编号', right_on='top', suffixes=('_l', '_... | 20 | 52.05 | 120 | 14 | 320 | python | [] | 0 | true | |
2024-11-18T21:23:34.551607+00:00 | 1,555,764,865,000 | 359b4392c45773e1f8ac37b6f4258585ab47e1df | 3 | {
"blob_id": "359b4392c45773e1f8ac37b6f4258585ab47e1df",
"branch_name": "refs/heads/master",
"committer_date": 1555764865000,
"content_id": "bca5bd440f3661cbae597281827bd783ddb3111e",
"detected_licenses": [
"MIT"
],
"directory_id": "a7b6f5ab1a4f8385c7635be2364127e7b7d95e27",
"extension": "py",
"fi... | 2.734375 | stackv2 | # Python script of tools for operations on TensorFlow models
import argparse
import tensorflow as tf
import cv2
from tensorflow.python import pywrap_tensorflow
class TFModelTools:
def __init__(self, ckpt_path=None, pb_path=None):
self.ckpt_path = ckpt_path
self.pb_path = pb_path
if pb_pat... | 53 | 40.4 | 101 | 17 | 491 | python | [] | 0 | true | |
2024-11-18T21:23:34.791540+00:00 | 1,611,516,369,000 | 5115423eb8a015a0585879989b27c2bcd02ec130 | 3 | {
"blob_id": "5115423eb8a015a0585879989b27c2bcd02ec130",
"branch_name": "refs/heads/main",
"committer_date": 1611516369000,
"content_id": "f1395089efc22f766cd7db0ac36cdae59a183223",
"detected_licenses": [
"MIT"
],
"directory_id": "16056a180570323b425d3bb715ce5679d28bbbc0",
"extension": "py",
"file... | 2.796875 | stackv2 | import ast
import sys
from io import StringIO
from doctest import DocTestParser, DocTest, DocTestRunner
from typing import TextIO
class DoctestValidator:
def __init__(self, docstring: str, globals: dict, name: str):
self.docstring = docstring
self.test = DocTest(
examples=DocTestParse... | 59 | 26.8 | 74 | 15 | 380 | python | [] | 0 | true | |
2024-11-18T21:23:35.010695+00:00 | 1,590,866,963,000 | ee64353fafe88e054c2e10f3d598587e818f5099 | 3 | {
"blob_id": "ee64353fafe88e054c2e10f3d598587e818f5099",
"branch_name": "refs/heads/master",
"committer_date": 1590866963000,
"content_id": "807909f63ff992d08e9b4a3db4ab7174ca1d960c",
"detected_licenses": [
"MIT"
],
"directory_id": "fc4fc403d33dad3d53a6e576b57d0f8bee71d50f",
"extension": "py",
"fi... | 2.75 | stackv2 | import dash_html_components as html
import dash_core_components as dcc
#By Dev Patel from FTC Team Robot Uprising 14607
def Header(app):
return html.Div([get_header(app), html.Br([]), get_menu()])
def get_header(app):
header = html.Div(
[
html.Div(
... | 78 | 27.49 | 96 | 18 | 440 | python | [] | 0 | true | |
2024-11-18T21:23:35.075211+00:00 | 1,515,930,118,000 | 080ba368aeffe63f1612ae2be8d873dafc6a4773 | 3 | {
"blob_id": "080ba368aeffe63f1612ae2be8d873dafc6a4773",
"branch_name": "refs/heads/master",
"committer_date": 1515930118000,
"content_id": "355bdce44d9e2829ad61c25b224da7282b43e583",
"detected_licenses": [
"MIT"
],
"directory_id": "cb81711f4286c7123dbb13dd11c75aa0e776dc4d",
"extension": "py",
"fi... | 2.953125 | stackv2 | """Module for error functions"""
from Util import *
def RaiseNotReachable(pos):
user_print("Locations not reachable! No valid joint solution found!", 'error')
print pos
return 0
def RaisePickFailed():
user_print("Pick action failed!", 'error')
return 0
def RaisePlaceFailed():
user_print("... | 33 | 23.55 | 82 | 10 | 209 | python | [] | 0 | true | |
2024-11-18T21:23:35.190698+00:00 | 1,630,377,983,000 | fdbd6895087def329ab19bb2cf010b611b428aa4 | 3 | {
"blob_id": "fdbd6895087def329ab19bb2cf010b611b428aa4",
"branch_name": "refs/heads/main",
"committer_date": 1630377983000,
"content_id": "69964ea87e2c3d7be35fa304960100b3487449d2",
"detected_licenses": [
"BSD-3-Clause",
"MIT"
],
"directory_id": "ac0101e0671bdfe7a9d78cc035a3cba510724526",
"exten... | 3 | stackv2 | import numpy as np
from .._shared.utils import _to_np_mode
def _validate_window_size(axis_sizes):
"""Ensure all sizes in ``axis_sizes`` are odd.
Parameters
----------
axis_sizes : iterable of int
Raises
------
ValueError
If any given axis size is even.
"""
for axis_size i... | 129 | 33.64 | 78 | 15 | 1,078 | python | [] | 0 | true | |
2024-11-18T21:23:35.317376+00:00 | 1,655,048,420,000 | 1794a937f9daf4cafccbdc927c4988d14f24a683 | 3 | {
"blob_id": "1794a937f9daf4cafccbdc927c4988d14f24a683",
"branch_name": "refs/heads/master",
"committer_date": 1655048420000,
"content_id": "a7e7384187822de798b492d86e676053de531264",
"detected_licenses": [
"MIT"
],
"directory_id": "553b34a101c54090e68f540d96369ac7d5774d95",
"extension": "py",
"fi... | 3.15625 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Related to AboutOpenClasses in the Ruby Koans
#
from runner.koan import *
class AboutMonkeyPatching(Koan):
class Dog:
def bark(self):
return "WOOF"
def test_as_defined_dogs_do_bark(self):
fido = self.Dog()
self.assertEqual... | 49 | 26.84 | 75 | 14 | 316 | python | [] | 0 | true | |
2024-11-18T21:23:35.431642+00:00 | 1,633,535,232,000 | 1c4b2b2a82829153d3b8168f94601c7072c42c3a | 3 | {
"blob_id": "1c4b2b2a82829153d3b8168f94601c7072c42c3a",
"branch_name": "refs/heads/master",
"committer_date": 1633535232000,
"content_id": "e9794ed45f7885a18b9c0ba6dd32e3b3b70de14c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "438c7ce309d6a303329d9c96075fd5a8b18e6332",
"extension": "py"... | 2.515625 | stackv2 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats
import datetime
sns.set_color_codes("dark")
sns.set_style("white")
sns.set_context("talk")
data = {
'QP (parallel)': [10*60 + 46, 60 + 13, 56],
'QP (non-parallel)': [10*60 + 57, 60 + 35, 60 + 12],
'QP HP... | 67 | 33.24 | 104 | 16 | 755 | python | [] | 0 | true | |
2024-11-18T21:23:35.614199+00:00 | 1,692,513,493,000 | cb68718858c97d41340e839fe19b30dfa4e81218 | 4 | {
"blob_id": "cb68718858c97d41340e839fe19b30dfa4e81218",
"branch_name": "refs/heads/master",
"committer_date": 1692513493000,
"content_id": "eb120e96f58e199f8a1792ae6a6321cf968204a6",
"detected_licenses": [
"MIT"
],
"directory_id": "0907388046fb08add6b7e379f0ff3d024ccfb1fe",
"extension": "py",
"fi... | 3.546875 | stackv2 | import collections
import unittest
from random import choice
Card = collections.namedtuple('Card', ['rank', 'suit'])
class FrenchDeck:
ranks = [str(n) for n in range(2, 11)] + list('JQKA')
suits = 'spades diamonds clubs hearts'.split()
def __init__(self):
self._cards = [Card(rank, suit) for suit... | 99 | 29.19 | 86 | 13 | 696 | python | [] | 0 | true | |
2024-11-18T21:23:35.930820+00:00 | 1,564,321,663,000 | 6e795a1fedc2229d4f35b85bab6defca94cecb4b | 2 | {
"blob_id": "6e795a1fedc2229d4f35b85bab6defca94cecb4b",
"branch_name": "refs/heads/master",
"committer_date": 1564321663000,
"content_id": "359be1bba51cc6276285e38cebff0b57dc1dcb29",
"detected_licenses": [
"MIT"
],
"directory_id": "be42ac728c6c5fa2cd8abc772db1389a61b97c50",
"extension": "py",
"fi... | 2.453125 | stackv2 | from flask import g, current_app
from flask_restful import Resource, reqparse, inputs
from flask_restful.inputs import positive
from cache.article import ArticleInfoCache
from rpc import reco_pb2_grpc, reco_pb2
from rpc.constants import USER_RECOMMENDS_COUNT
from utils import parser
from utils.logging import write_tra... | 106 | 31.88 | 103 | 14 | 941 | python | [] | 0 | true | |
2024-11-18T21:23:36.106122+00:00 | 1,693,515,273,000 | e9b339970f04a0cff452778dfa8c96628f00700f | 3 | {
"blob_id": "e9b339970f04a0cff452778dfa8c96628f00700f",
"branch_name": "refs/heads/master",
"committer_date": 1693515273000,
"content_id": "43b882ca18274dcdb273cf35680016453db3c698",
"detected_licenses": [
"BSD-3-Clause",
"MIT"
],
"directory_id": "6a468c1650b3c083f102f19ace0b0d6e4d0686f7",
"ext... | 2.765625 | stackv2 | try:
from ctypes import c_float, c_int, c_double
except ImportError:
pass
import pyglet.gl as pgl
from sympy.core import S
def get_model_matrix(array_type=c_float, glGetMethod=pgl.glGetFloatv):
"""
Returns the current modelview matrix.
"""
m = (array_type*16)()
glGetMethod(pgl.GL_MODELVIE... | 188 | 23.58 | 80 | 14 | 1,479 | python | [] | 0 | true | |
2024-11-18T21:23:36.174680+00:00 | 1,662,363,356,000 | b4e9a3ae8bf4b8e200bf4872393e00985baf44b6 | 3 | {
"blob_id": "b4e9a3ae8bf4b8e200bf4872393e00985baf44b6",
"branch_name": "refs/heads/master",
"committer_date": 1662363356000,
"content_id": "f8f7817ea1022bf8f7d0d64a7ce742890c4726a2",
"detected_licenses": [
"MIT"
],
"directory_id": "1051e6bca955732982932e5946069beb1f9cfd6d",
"extension": "py",
"fi... | 2.59375 | stackv2 | #!/usr/bin/env python3
from stable_baselines import logger, A2C
from stable_baselines.common.cmd_util import make_atari_env, atari_arg_parser
from stable_baselines.common.vec_env import VecFrameStack
from stable_baselines.common.policies import CnnPolicy, CnnLstmPolicy, CnnLnLstmPolicy
def train(env_id, num_timestep... | 53 | 36.96 | 119 | 12 | 512 | python | [] | 0 | true | |
2024-11-18T21:23:36.239115+00:00 | 1,541,567,336,000 | 48a6494b739cc6f6a90f2d57d0f3eb92e83d63bd | 3 | {
"blob_id": "48a6494b739cc6f6a90f2d57d0f3eb92e83d63bd",
"branch_name": "refs/heads/master",
"committer_date": 1541567336000,
"content_id": "ea2a4f2407be5ee335e3023c3e463175800b814b",
"detected_licenses": [
"MIT"
],
"directory_id": "3711a2379e0c40e35e5295a6178a8693c6869cf4",
"extension": "py",
"fi... | 2.546875 | stackv2 | #!/usr/bin/env python
'''Provides access to the Trello REST API via py-trello'''
import trello
import trello.util
from jatdb.secret import get_secret
SECRETS = get_secret('trello')
def create_oauth_token():
return trello.util.create_oauth_token(
key=get_secret('trello','api_key'),
secret=get_sec... | 38 | 22.37 | 58 | 15 | 224 | python | [] | 0 | true | |
2024-11-18T21:23:36.427516+00:00 | 1,579,103,173,000 | 53e949f372d084d9ba89ceefac3c5060c7b9d2ba | 3 | {
"blob_id": "53e949f372d084d9ba89ceefac3c5060c7b9d2ba",
"branch_name": "refs/heads/master",
"committer_date": 1579103173000,
"content_id": "4d8908f867fd399481e856278edff43a3a479671",
"detected_licenses": [
"MIT"
],
"directory_id": "6418b9cb5679926f2fb3c9278329bcb073774e78",
"extension": "py",
"fi... | 2.546875 | stackv2 | import matplotlib.pyplot as plt
import lightgbm as lgb
from sklearn.model_selection import train_test_split
NUM_BOOST_ROUND = 300
EARLY_STOPPING_ROUNDS = 30
def train_evaluate(X, y, params):
X_train, X_valid, y_train, y_valid = train_test_split(X, y, test_size=0.2, random_state=1234)
train_data = lgb.Dataset... | 34 | 31.29 | 97 | 16 | 284 | python | [] | 0 | true | |
2024-11-18T21:23:36.534642+00:00 | 1,582,129,489,000 | a08b1a79b2075b3a4f2f1fb955e86ec3aa73539f | 3 | {
"blob_id": "a08b1a79b2075b3a4f2f1fb955e86ec3aa73539f",
"branch_name": "refs/heads/master",
"committer_date": 1582129489000,
"content_id": "cbe69d5400a5ba3e9e39992ec00425fd967ecb66",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "103074caff02ae560ff82dfa07fa1868d639a98c",
"extension": "py"... | 2.859375 | stackv2 |
CRLF = b'\r\n'
def encode_request(from_pid, to_pid, method, body=None, content_type=None, legacy=False):
"""
Encode a request into a raw HTTP request. This function returns a string
of bytes that represent a valid HTTP/1.0 request, including any libprocess
headers required for communication.
Use the `lega... | 45 | 27.24 | 90 | 15 | 322 | python | [] | 0 | true | |
2024-11-18T21:23:36.714510+00:00 | 1,572,870,400,000 | 2f78f04bbb807f87db578706db72d073c629648c | 3 | {
"blob_id": "2f78f04bbb807f87db578706db72d073c629648c",
"branch_name": "refs/heads/master",
"committer_date": 1572870400000,
"content_id": "cba1155a2aefa7d37fe2acd6e13afce4ac1f79ab",
"detected_licenses": [
"MIT"
],
"directory_id": "bc780e20bfc8bb92820b71f0fe8044028c0894c3",
"extension": "py",
"fi... | 2.734375 | stackv2 | """Wrapper methods."""
import subprocess
from docknv.logger import Logger
from .exceptions import FailedCommandExecution, StoppedCommandExecution
def exec_process(args, cwd=None, shell=False, dry_run=False):
"""
Execute a process.
:param args: Arguments (list)
:param cwd: Working directory ... | 76 | 26.58 | 76 | 15 | 464 | python | [] | 0 | true | |
2024-11-18T21:23:38.387269+00:00 | 1,603,703,341,000 | ac1dba03e6ec7557211b9e6847b7eca244411b2f | 3 | {
"blob_id": "ac1dba03e6ec7557211b9e6847b7eca244411b2f",
"branch_name": "refs/heads/master",
"committer_date": 1603703341000,
"content_id": "7d44922c7a63c343c7d64a42237d986acae9b45d",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "0e82886fa0ed84facbe7366406df6a80577fedfc",
"extension": "py"... | 2.640625 | stackv2 | from __future__ import division
import numpy as np
from ..constants.general import ppm_gtc
"""Gas cycle functions from Generalised Impulse Response Model v1.0.0.
Much of this has been adapted from:
Leach et al., 2020, Geoscientific Model Development
https://www.geosci-model-dev-discuss.net/gmd-2019-379/
"""
def c... | 63 | 37.57 | 104 | 15 | 636 | python | [] | 0 | true | |
2024-11-18T21:23:38.513529+00:00 | 1,638,929,402,000 | b323845d87c018f7707c9db30652e344d2b80936 | 3 | {
"blob_id": "b323845d87c018f7707c9db30652e344d2b80936",
"branch_name": "refs/heads/master",
"committer_date": 1638929402000,
"content_id": "d8a3dcbf2ba6fdef38137420c50e30105c683df4",
"detected_licenses": [
"MIT"
],
"directory_id": "af395c3cb83dfd489565c1f516743b8eec0b547c",
"extension": "py",
"fi... | 3.015625 | stackv2 | #!/usr/bin/env python3
"""
Author : Ken Youens-Clark <kyclark@gmail.com>
Purpose: Python program to write a Python program
"""
import argparse
import os
import platform
import re
import subprocess
import sys
from datetime import date
from pathlib import Path
from typing import NamedTuple
class Args(NamedTuple):
... | 194 | 26.25 | 80 | 16 | 1,032 | python | [] | 0 | true | |
2024-11-18T21:23:38.580432+00:00 | 1,549,520,129,000 | 4f6b10abdd52546310a10c897eb3e1061b5cd7a7 | 4 | {
"blob_id": "4f6b10abdd52546310a10c897eb3e1061b5cd7a7",
"branch_name": "refs/heads/master",
"committer_date": 1549520129000,
"content_id": "523f7c90bb10a7d6f1bc8a869427a87592982b1c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "cc578cec7c485e2c1060fd075ccc08eb18124345",
"extension": "py"... | 3.515625 | stackv2 | __source__ = 'https://leetcode.com/problems/basic-calculator-iii/description/'
# Time: O()
# Space: O()
#
# https://leetcode.com/problems/basic-calculator-iii/discuss/113592/Development-of-a-generic-solution-for-the-series-of-the-calculator-problems
#
# Description: Leetcode # 772. Basic Calculator III
#
# Implement a... | 208 | 28.24 | 143 | 20 | 1,529 | python | [] | 0 | true | |
2024-11-18T21:23:38.773909+00:00 | 1,511,414,424,000 | 5338f30280256cba4aa80c0ed9f52baf8c0b7b0b | 3 | {
"blob_id": "5338f30280256cba4aa80c0ed9f52baf8c0b7b0b",
"branch_name": "refs/heads/master",
"committer_date": 1511414424000,
"content_id": "423002e5417cc6379d2665dc6e82dafacd24ff3d",
"detected_licenses": [
"MIT"
],
"directory_id": "59ada6767f62cc341c12c03bde88bf71e024dc4e",
"extension": "py",
"fi... | 3.046875 | stackv2 | """
Comparing models using Hierarchical modelling.
"""
from __future__ import division
import numpy as np
import pymc3 as pm
import matplotlib.pyplot as plt
## specify the Data
y = np.repeat([0, 1], [3, 6]) # 3 tails 6 heads
with pm.Model() as model:
# Hyperhyperprior:
model_index = pm.DiscreteUniform('mode... | 73 | 27.6 | 82 | 10 | 626 | python | [] | 0 | true | |
2024-11-18T21:23:38.917988+00:00 | 1,543,878,148,000 | 930919cd55033e32d11bd92bee050a6309ebc8d8 | 2 | {
"blob_id": "930919cd55033e32d11bd92bee050a6309ebc8d8",
"branch_name": "refs/heads/master",
"committer_date": 1543878148000,
"content_id": "86a3e85006318e1a61653679f4ac184f2e22ef59",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "562696e49c2d9e083d47fe896b9541d1c592c39a",
"extension": "p... | 2.328125 | stackv2 | import numpy as np
import plotly.graph_objs as go
import param
from ...core.util import basestring
from .plot import PlotlyPlot
from ..plot import GenericElementPlot, GenericOverlayPlot
from .. import util
class ElementPlot(PlotlyPlot, GenericElementPlot):
aspect = param.Parameter(default='cube', doc="""
... | 276 | 35.01 | 84 | 18 | 2,242 | python | [] | 0 | true | |
2024-11-18T21:23:39.033184+00:00 | 1,681,184,046,000 | 0a20d1de2ce8e185e56f0e3b57b450756bf00eb5 | 3 | {
"blob_id": "0a20d1de2ce8e185e56f0e3b57b450756bf00eb5",
"branch_name": "refs/heads/master",
"committer_date": 1681184046000,
"content_id": "45aea9a5889f6c32e6681cf8fb6ae4c6ebb91dd3",
"detected_licenses": [
"MIT"
],
"directory_id": "1a5c1b7f0179b83f3ab26ac3f16ee0e557dc6ac2",
"extension": "py",
"fi... | 2.578125 | stackv2 | import json
from django.http import HttpResponse
from django.views.generic import View
from episodes.episodes_repository import EpisodesRepository as repo
class All(View):
"""
Returns all episode data.
"""
def get(self, request, *args, **kwargs):
data = repo.get_episodes()
return Http... | 25 | 27.72 | 79 | 12 | 140 | python | [] | 0 | true | |
2024-11-18T21:23:39.324464+00:00 | 1,691,450,834,000 | 1b5361c28500a837085e38c4ea0657ef90451686 | 3 | {
"blob_id": "1b5361c28500a837085e38c4ea0657ef90451686",
"branch_name": "refs/heads/master",
"committer_date": 1691450834000,
"content_id": "86fc5a86ad83611cfd57d5f724076c493072889b",
"detected_licenses": [
"MIT"
],
"directory_id": "64a21a39198b1b8b9f8fe74a56dd09516e607a78",
"extension": "py",
"fi... | 2.890625 | stackv2 | import sys
import csv
from random import choice
from urllib.parse import quote_plus as quote
from difflib import SequenceMatcher
svada = {}
with open('svadagenerator.csv', 'r', encoding='utf-8') as csvfile:
svadareader = csv.reader(csvfile, delimiter=';', quotechar="'")
key = None
for row in svadareader:
... | 30 | 30.7 | 108 | 13 | 272 | python | [] | 0 | true | |
2024-11-18T21:23:39.441079+00:00 | 1,617,231,671,000 | 08b252a3adb5936fcca25fbe82288798fabe8547 | 2 | {
"blob_id": "08b252a3adb5936fcca25fbe82288798fabe8547",
"branch_name": "refs/heads/master",
"committer_date": 1617231671000,
"content_id": "baee37d27f8de594be070cc273c7927201aa8008",
"detected_licenses": [
"MIT"
],
"directory_id": "7cecca9246b93308915676c7a8fe4f4faaf2050f",
"extension": "py",
"fi... | 2.390625 | stackv2 | """
Usage:
train.py [--max_epoch=<int>] [--batch_size=<int>] [--alpha=<float>] [--lr=<float>] [--device=<str>] [--seed=<int>] [--noise_scale=<float>]
Options:
-h --help Show this screen.
--max_epoch=<int> Epoch num [default: 10000].
--batch_size=<int> Batch size [default: 256].
--lr=<fl... | 199 | 29.4 | 140 | 19 | 1,464 | python | [] | 0 | true | |
2024-11-18T21:23:39.494134+00:00 | 1,608,238,130,000 | 32d26847eeb0fb052d28df9ef84adad878002759 | 2 | {
"blob_id": "32d26847eeb0fb052d28df9ef84adad878002759",
"branch_name": "refs/heads/main",
"committer_date": 1608238130000,
"content_id": "484f7e9971bc4d86c15b990e6416b1e641a30aae",
"detected_licenses": [
"MIT"
],
"directory_id": "5ae1752c9abadec4dd39249f187fa2f34466ccf3",
"extension": "py",
"file... | 2.328125 | stackv2 | from fastapi import FastAPI, status, Depends, HTTPException, UploadFile, File
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, FileResponse
from fastapi_users import FastAPIUsers
from fastapi_users.authentication import JWTAuthentication
import utils
from database import D... | 154 | 27.82 | 116 | 12 | 1,076 | python | [] | 0 | true | |
2024-11-18T21:23:39.537924+00:00 | 1,570,397,580,000 | 8963d7d5ef5a45269adb3f8dc27b079a53184a65 | 3 | {
"blob_id": "8963d7d5ef5a45269adb3f8dc27b079a53184a65",
"branch_name": "refs/heads/master",
"committer_date": 1570397580000,
"content_id": "e9a4996ed4e4c4ede6e859e98821fdae91c5123e",
"detected_licenses": [
"MIT"
],
"directory_id": "d4493bf1d6ca6ee286b5e51235b6fe0f67700270",
"extension": "py",
"fi... | 2.90625 | stackv2 | import numpy
import logging
import sys
from keras.models import Sequential
from keras.layers import Dense
from keras.losses import mean_squared_error
from keras.callbacks import ModelCheckpoint
from utils.file_names_builder import get_checkpoints_filename, get_model_filename
from utils.logger import create_loggers_hel... | 87 | 37.97 | 115 | 16 | 640 | python | [] | 0 | true | |
2024-11-18T21:23:39.629750+00:00 | 1,434,048,870,000 | b68f9a67f0d34695e62906b67e82d97503d7b4f4 | 3 | {
"blob_id": "b68f9a67f0d34695e62906b67e82d97503d7b4f4",
"branch_name": "refs/heads/master",
"committer_date": 1434048870000,
"content_id": "939fffa9f453f41e62d24b7d9bef4e45ed0309d6",
"detected_licenses": [
"MIT"
],
"directory_id": "68ae57101607928a03c600e2e788a59ca28d7189",
"extension": "py",
"fi... | 2.703125 | stackv2 | ## System main class ##
from DBManager import *
import User
class System:
## Call the DBManager to add a new user or upate if existis
def updateuser(id_, name_, email_):
return update_user(id=id_, name=name_, email=email_)
## Get all atts from a user
def getuser(id):
return str(get_user_atts(id) )
... | 21 | 20.57 | 60 | 11 | 119 | python | [] | 0 | true | |
2024-11-18T21:23:39.682329+00:00 | 1,618,367,539,000 | e4d6efabcfad675ba7a83e7dc120d8e16dedf718 | 3 | {
"blob_id": "e4d6efabcfad675ba7a83e7dc120d8e16dedf718",
"branch_name": "refs/heads/master",
"committer_date": 1618367539000,
"content_id": "03abfb27f751573d36145325c90ee4a7af1d3bc0",
"detected_licenses": [
"MIT"
],
"directory_id": "86001570fee9d01cdde3e0401b12a2299ac7f587",
"extension": "py",
"fi... | 3.0625 | stackv2 | import copy
class Frame:
def __init__(self, _current_time = 0):
self.current_time = _current_time
self.robot_positions = {}
self.trajectories = {}
self.obstacles = []
self.step = 0
def fromFrame(self, frame):
self.robot_positions = copy.deepcopy(frame.robot_posi... | 29 | 26.86 | 67 | 11 | 186 | python | [] | 0 | true | |
2024-11-18T21:23:39.794946+00:00 | 1,564,238,515,000 | d81a814703fe1791d3c9a2fc6d73dc887932aaaa | 3 | {
"blob_id": "d81a814703fe1791d3c9a2fc6d73dc887932aaaa",
"branch_name": "refs/heads/master",
"committer_date": 1564238515000,
"content_id": "8f5ed726af93bc3d502adeff38fb631ea17cf577",
"detected_licenses": [
"MIT"
],
"directory_id": "a175ccccd624a36d130d046cefbf4d0f2df421ac",
"extension": "py",
"fi... | 2.5625 | stackv2 | #!/usr/bin/python
'''
create the SConstruct from all name of the folders in ./ to be build with scons
first hand made line of Sconstruct which build good :
SConscript('ch02-02-event-demo/src/SConscript', variant_dir='build-scons/ch02-02-event-demo', duplicate=0)
'''
import os
import subprocess
lines_of_text=[]
lists... | 44 | 28.77 | 163 | 12 | 346 | python | [] | 0 | true | |
2024-11-18T21:23:39.846637+00:00 | 1,681,956,026,000 | f5b5d16702bc9a55d4736c220d1bcce79944a381 | 3 | {
"blob_id": "f5b5d16702bc9a55d4736c220d1bcce79944a381",
"branch_name": "refs/heads/master",
"committer_date": 1686241810000,
"content_id": "60275ffdbfeb12880211645717d1a555be404c2b",
"detected_licenses": [
"MIT"
],
"directory_id": "b20f125ce198fd26b9048152592a6efd5de8aee7",
"extension": "py",
"fi... | 2.71875 | stackv2 | import os
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='')
parser.add_argument('sample_name', help='sample name')
args = parser.parse_args()
# Grabs name of file.
summmary_csv = str(args.sample_name) + "_summary.csv"
summary_csv_fixed = open(str(args.sample_... | 35 | 25.8 | 76 | 14 | 253 | python | [] | 0 | true | |
2024-11-18T21:23:40.026836+00:00 | 1,624,470,132,000 | 64fc569dc3379e22c31da95972210d34d8b0e335 | 2 | {
"blob_id": "64fc569dc3379e22c31da95972210d34d8b0e335",
"branch_name": "refs/heads/master",
"committer_date": 1624470132000,
"content_id": "01f262515b4d4599dd16b5b54197ecb4e735a198",
"detected_licenses": [
"MIT"
],
"directory_id": "e5a4cf2f4abfa58f16fff32db7b638a304e021e3",
"extension": "py",
"fi... | 2.421875 | stackv2 | import os
import socket
import threading
from json import load
from src.logs.log_config import logger
class TrackerServer:
def __init__(self, protocol, server, model=''):
self.ip, self.port = server.split(':')
self.model = model
self.sock = socket.socket()
self.sock.bind((self.ip, int(self.port)))
self.so... | 29 | 25.69 | 87 | 15 | 207 | python | [] | 0 | true | |
2024-11-18T21:23:40.193801+00:00 | 1,524,021,477,000 | 32b78952761f75ed0466ba792470a3d9beec63e8 | 3 | {
"blob_id": "32b78952761f75ed0466ba792470a3d9beec63e8",
"branch_name": "refs/heads/master",
"committer_date": 1524021477000,
"content_id": "80dfb314cfcfdb63912d38656d3ea225a21e8b4a",
"detected_licenses": [
"Unlicense"
],
"directory_id": "3e579771c413818a7f078e70011c5816d28e6023",
"extension": "py",... | 2.6875 | stackv2 | import pygame
from game import PygamePhraseHolder
import colors
import settings
pygame.init()
pygame.mixer.quit()
clock = pygame.time.Clock()
screen = pygame.display.set_mode((settings.WIDTH, settings.HEIGHT))
background = pygame.Surface(screen.get_size())
background = background.convert()
pygame_phrase_holder = ... | 35 | 22.91 | 71 | 13 | 173 | python | [] | 0 | true | |
2024-11-18T21:23:40.478207+00:00 | 1,565,078,597,000 | 545b72d701c21ee7a5eeb034b470906552e6afe0 | 3 | {
"blob_id": "545b72d701c21ee7a5eeb034b470906552e6afe0",
"branch_name": "refs/heads/master",
"committer_date": 1565078597000,
"content_id": "d489ea82ebb56ee4f0ce71fb73ebf8c8afb3160b",
"detected_licenses": [
"MIT"
],
"directory_id": "c87fb113b04925a5870d53d1aa651c3472adac18",
"extension": "py",
"fi... | 2.78125 | stackv2 | import csv
import cv2
import numpy as np
data_dir = '/opt/data/'
lines = []
with open(data_dir + 'driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
for line in reader:
lines.append(line)
images = []
measurements = []
for line in lines:
image_path = data_dir+'IMG/'
### paths of the i... | 76 | 30.74 | 73 | 11 | 627 | python | [] | 0 | true | |
2024-11-18T21:23:40.534226+00:00 | 1,683,478,818,000 | ee5338b5ac0daab790a7367e7836fc09b93cbb2e | 2 | {
"blob_id": "ee5338b5ac0daab790a7367e7836fc09b93cbb2e",
"branch_name": "refs/heads/master",
"committer_date": 1683478818000,
"content_id": "19fe23f831fe8261aa972903cb3ec2ce33d2343c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "e2ca3205bb5240a1e4c87de0bdb13faa70241f16",
"extension": "py"... | 2.40625 | stackv2 | """
"""
import os
from jinja2 import Template, Environment, FileSystemLoader
from nspawn.base.machine import MachineResult
def this_dir():
return os.path.dirname(os.path.abspath(__file__))
def this_enviro() -> Environment:
return Environment(loader=FileSystemLoader(this_dir()), trim_blocks=True)
def this... | 34 | 22.85 | 77 | 12 | 171 | python | [{"finding_id": "codeql_py/jinja2/autoescape-false_285bd4efefaa69dc_0a2d8344", "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:23:40.601779+00:00 | 1,521,606,814,000 | 3261f2efde6d2b00ab728d701695af5a45672dfe | 2 | {
"blob_id": "3261f2efde6d2b00ab728d701695af5a45672dfe",
"branch_name": "refs/heads/master",
"committer_date": 1521606814000,
"content_id": "af96d1e10d7aaff8d25288ea80abcc1f1559e666",
"detected_licenses": [
"MIT"
],
"directory_id": "cf0a5be1c846e0bc190a7efdb1de3c28dfa4530e",
"extension": "py",
"fi... | 2.328125 | stackv2 | from flask import Flask, render_template, request
from python.dotmapgenerator import *
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['TEMPLATES_AUTO_RELOAD'] = True
@app.route('/')
def index():
return render_template('index.html')
METHOD_AUTOSIZE = 1
METHOD_REPEAT = 2
@app.route('/app.html')
d... | 62 | 21.29 | 75 | 15 | 294 | python | [] | 0 | true | |
2024-11-18T21:23:40.661243+00:00 | 1,596,865,536,000 | 4a4f12008c61a4b6de74adae8ddfba0eb0241598 | 2 | {
"blob_id": "4a4f12008c61a4b6de74adae8ddfba0eb0241598",
"branch_name": "refs/heads/master",
"committer_date": 1596865536000,
"content_id": "237af1346edf416c3db126cb9468e0448c082164",
"detected_licenses": [
"MIT"
],
"directory_id": "1045a65af1c4d9a47a990995446474f256b6548f",
"extension": "py",
"fi... | 2.40625 | stackv2 | #! /usr/bin/env python3
import os
from os.path import getsize
import sys
import fire
import pprint
import time
import sqlite3
from .tools import Tools
from .config import Config
from .progress import ProgressPercentage
class TowerCrane():
def __init__(self):
"""
Make an insta... | 114 | 28.62 | 87 | 12 | 671 | python | [] | 0 | true | |
2024-11-18T21:23:40.922217+00:00 | 1,543,967,070,000 | b4238de81a12854ffd329e37cf6d934f4f6bb760 | 3 | {
"blob_id": "b4238de81a12854ffd329e37cf6d934f4f6bb760",
"branch_name": "refs/heads/master",
"committer_date": 1543967070000,
"content_id": "f7516193dab249c0fba69e960382ce59b8ea7be3",
"detected_licenses": [
"MIT"
],
"directory_id": "b0653128bc312878778f1392fdda26eab454901f",
"extension": "py",
"fi... | 3.140625 | stackv2 | #!/usr/local/bin/python3
# Python Challenge - 20
# http://www.pythonchallenge.com/pc/hex/idiot2.html
# Username: butter; Password: fly
# Keyword: invader, redavni
import base64
import urllib.request
import re
def main():
'''
Hint: go away! Picture is fence with sign 'Private property beyond
this fenc... | 119 | 30.37 | 76 | 15 | 1,089 | python | [] | 0 | true | |
2024-11-18T21:23:41.165351+00:00 | 1,509,585,846,000 | b81624cf878083e8613ac414198715456943282e | 2 | {
"blob_id": "b81624cf878083e8613ac414198715456943282e",
"branch_name": "refs/heads/master",
"committer_date": 1509585846000,
"content_id": "57a39b365c548b45c8c55bb10a2b45b3b6e00797",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "475f79606c5ad54ba12eff2e925c28d9a73abb39",
"extension": "p... | 2.46875 | stackv2 | """DAMN Service client"""
# Standard
import sys
import socket
import logging
# 3rd Party
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
# Damn
from damn_at.serialization.generated.damn import DamnService
sys.path.appe... | 80 | 27.16 | 69 | 15 | 483 | python | [] | 0 | true | |
2024-11-18T21:23:41.225742+00:00 | 1,689,511,088,000 | ae63e4074d64447dad6f040d9eeee985a0f533b3 | 3 | {
"blob_id": "ae63e4074d64447dad6f040d9eeee985a0f533b3",
"branch_name": "refs/heads/master",
"committer_date": 1689511088000,
"content_id": "7daa0b9727d8a1434c73fcef8a1ea5051d933fd4",
"detected_licenses": [
"Unlicense"
],
"directory_id": "214230d0796377be0bfdda286c2c389b92a19555",
"extension": "py",... | 2.671875 | stackv2 | from pwn import *
from Crypto.Cipher import PKCS1_v1_5
from Crypto.PublicKey import RSA
from ast import literal_eval
from binascii import hexlify, unhexlify
import fuckpy3
import subprocess
def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:
g, y, x = egcd(b % a, a)
return (g, x - (b // ... | 104 | 21.61 | 67 | 13 | 795 | python | [] | 0 | true | |
2024-11-18T21:23:41.370497+00:00 | 1,585,665,207,000 | 3c29262a04d7339c0c0cd74712f94d35a4a21361 | 3 | {
"blob_id": "3c29262a04d7339c0c0cd74712f94d35a4a21361",
"branch_name": "refs/heads/master",
"committer_date": 1585665207000,
"content_id": "13d605569ef12996235d244708b13d6262c2de94",
"detected_licenses": [
"MIT"
],
"directory_id": "5e318c42cbc5d7f059ce0729d1efd1eedc9df0e4",
"extension": "py",
"fi... | 3.234375 | stackv2 | def adapt_bool(boolean: bool) -> bytes:
return str(int(boolean)).encode('ascii')
def convert_bool(i: bytes) -> bool:
return bool(int(i))
class IntList(list):
pass
def adapt_int_list(int_list: IntList) -> bytes:
if len(int_list) == 0:
return b''
return ','.join(str(i) for i in int_list)... | 22 | 25.18 | 76 | 12 | 152 | python | [] | 0 | true | |
2024-11-18T21:23:41.474590+00:00 | 1,445,522,184,000 | e000ade19411baf6b09d438dee942f710c0939b2 | 3 | {
"blob_id": "e000ade19411baf6b09d438dee942f710c0939b2",
"branch_name": "refs/heads/master",
"committer_date": 1445522184000,
"content_id": "096dcce6e9480be9688dd9eebed50e06d479b651",
"detected_licenses": [
"MIT"
],
"directory_id": "beacc9475c1d5f9880dc188557f1caa818f527a2",
"extension": "py",
"fi... | 3.453125 | stackv2 | #!/usr/bin/env python
#
# tournament.py -- implementation of a Swiss-system tournament
#
from contextlib import contextmanager
import psycopg2
def connect():
"""Connect to the PostgreSQL database. Returns a database connection."""
return psycopg2.connect("dbname=tournament")
@contextmanager
def get_cursor... | 344 | 34.89 | 79 | 12 | 2,847 | python | [] | 0 | true | |
2024-11-18T21:23:41.591435+00:00 | 1,681,696,616,000 | fa80054dbab4b711ab82876f809e1067696601b3 | 3 | {
"blob_id": "fa80054dbab4b711ab82876f809e1067696601b3",
"branch_name": "refs/heads/main",
"committer_date": 1681696616000,
"content_id": "41b9d643b507f3afc0850d2d2c908b82db40ad80",
"detected_licenses": [
"MIT"
],
"directory_id": "e9b03fe553fb85f798d44607c57c43b3cb20dc50",
"extension": "py",
"file... | 3.03125 | stackv2 | while True:
try:
word = input()
for c in range(len(word)):
for z in range(c):
print("", end=' ')
for i in range((len(word)-c)):
if i == ((len(word)-c)-1):
if ((len(word)-c)-1) == 0:
print(word[i], end... | 17 | 28.76 | 50 | 21 | 109 | python | [] | 0 | true | |
2024-11-18T21:23:41.645311+00:00 | 1,508,368,938,000 | 804f562a35ca9fda24a651dd5e9e0c5336adf94f | 2 | {
"blob_id": "804f562a35ca9fda24a651dd5e9e0c5336adf94f",
"branch_name": "refs/heads/master",
"committer_date": 1508368938000,
"content_id": "a36217cf327476861e0ea5cafb13f91dcd431f61",
"detected_licenses": [
"MIT"
],
"directory_id": "ec023b577c83c3478c4bc171c0f8d0c3a539dd97",
"extension": "py",
"fi... | 2.5 | stackv2 | import numpy as np
import tensorflow as tf
from tqdm import tqdm
import utils
from data import DATASETS, DATASET_LENGTH_GETTERS
def _sample_z(cfg):
return np.random.uniform(
-1., 1., size=[cfg.batch_size, cfg.z_size]
).astype(np.float32)
def train(model, config, sess=None):
# define optimizers a... | 101 | 36.04 | 79 | 20 | 759 | python | [] | 0 | true | |
2024-11-18T21:23:41.711512+00:00 | 1,690,377,671,000 | 61d193fc58220c58e12cb673596575533b8bb25c | 3 | {
"blob_id": "61d193fc58220c58e12cb673596575533b8bb25c",
"branch_name": "refs/heads/master",
"committer_date": 1690377671000,
"content_id": "10acd9132720328571c3908ad6b06c43f32bd7a8",
"detected_licenses": [
"MIT"
],
"directory_id": "a0eb6744e6f7f509b96d21f0bc8b3f8387f6861c",
"extension": "py",
"fi... | 2.625 | stackv2 | import numpy as np
from PIL import Image
src = np.array(Image.open('data/src/lena.jpg'))
mask = np.array(Image.open('data/src/horse_r.png').resize(src.shape[1::-1], Image.BILINEAR))
print(mask.dtype, mask.min(), mask.max())
# uint8 0 255
mask = mask / 255
print(mask.dtype, mask.min(), mask.max())
# float64 0.0 1.0
... | 42 | 21.93 | 105 | 13 | 312 | python | [] | 0 | true | |
2024-11-18T21:23:41.911242+00:00 | 1,635,023,995,000 | fae4aa5ad8280240ce90d1ae66530498cb5ffcf3 | 3 | {
"blob_id": "fae4aa5ad8280240ce90d1ae66530498cb5ffcf3",
"branch_name": "refs/heads/main",
"committer_date": 1635023995000,
"content_id": "ffd69bf7930678c4431480d1e38caeeffd6979d7",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "b78d30aa6dd78f538029b8679afdeff6a4df6268",
"extension": "py",
... | 2.671875 | stackv2 | # Copyright 2020, 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 62 | 32.47 | 125 | 11 | 534 | python | [] | 0 | true | |
2024-11-18T21:23:41.965421+00:00 | 1,583,948,660,000 | 5323bdcac81f5666cd791e95058e98c9bc805af2 | 2 | {
"blob_id": "5323bdcac81f5666cd791e95058e98c9bc805af2",
"branch_name": "refs/heads/master",
"committer_date": 1583948660000,
"content_id": "65c2f1023bfb570ffa1ce2d640bbc9da5eb659a9",
"detected_licenses": [
"MIT"
],
"directory_id": "6b3870bb321d930c34c6f65f19091169425f4dee",
"extension": "py",
"fi... | 2.5 | stackv2 | # -*- coding: utf-8 -*-
import logging
from dipy.core.gradients import gradient_table
from dipy.reconst.csdeconv import auto_response
from dipy.segment.mask import applymask
import numpy as np
from scilpy.utils.bvec_bval_tools import (check_b0_threshold,
is_normalized_bvecs, ... | 128 | 38.9 | 80 | 13 | 1,209 | python | [] | 0 | true | |
2024-11-18T21:23:42.258483+00:00 | 1,541,911,156,000 | af8ae5bef2c24d710bd02fb46ebc5cd0dd12aeb2 | 4 | {
"blob_id": "af8ae5bef2c24d710bd02fb46ebc5cd0dd12aeb2",
"branch_name": "refs/heads/master",
"committer_date": 1541911156000,
"content_id": "b46e1b7a412b487daa5b17c458c9c672b89e88d2",
"detected_licenses": [
"MIT"
],
"directory_id": "74f3c3bef1cea4854c422164ac2b82063fcbc89a",
"extension": "py",
"fi... | 4.0625 | stackv2 | print('\t\t ESCUELA POLITECNCA NACIONAL')
print('INTEGRANTES:')
print('\t\t Edison Osorio')
print('\t\t Micha Cardenas')
print("\t\t Stalin Maza")
import sys
import math
def triangulo():
print('\tTRIANGULO')
lado=int(input('Ingrese la longitud del lado (base):\n'))
altura=int(input('Ingrese la altura:\n'))
... | 101 | 29.89 | 95 | 12 | 969 | python | [] | 0 | true | |
2024-11-18T21:23:42.569551+00:00 | 1,600,690,159,000 | f34792b3a4d79e607b018b77bafac5885c6c1e46 | 3 | {
"blob_id": "f34792b3a4d79e607b018b77bafac5885c6c1e46",
"branch_name": "refs/heads/master",
"committer_date": 1600690159000,
"content_id": "b89f2a980d1869c29e1a7a69059953f1a949fb5b",
"detected_licenses": [
"MIT"
],
"directory_id": "3d5a0d94122570ef20e5224c31d4461919e304aa",
"extension": "py",
"fi... | 2.59375 | stackv2 | import copy
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.optim import Adam
from torch.optim import RMSprop
from torch.optim import SGLD
from torch.optim import ExtraAdam
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# Implementation of Twin D... | 233 | 38.74 | 174 | 20 | 2,229 | python | [] | 0 | true | |
2024-11-18T21:23:42.724215+00:00 | 1,599,348,519,000 | 89114faebffb8e970236b2447363673394e161d5 | 3 | {
"blob_id": "89114faebffb8e970236b2447363673394e161d5",
"branch_name": "refs/heads/master",
"committer_date": 1599348519000,
"content_id": "e9a1e445f8736c515401a672738c4722467f3c8c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "c773ff87e9b0f5e444332b48850f63beee033066",
"extension": "py"... | 2.53125 | stackv2 | import logging
import datetime
from absa import log_path
def configure_logging(level=logging.INFO):
"""Logging configuration
Log formatting.
Pass logs to terminal and to file.
"""
log_path.mkdir(parents=True, exist_ok=True)
log_formatter = logging.Formatter(
"%(asctime)s [%(threadN... | 26 | 28.23 | 91 | 16 | 183 | python | [] | 0 | true | |
2024-11-18T21:23:42.789433+00:00 | 1,553,537,923,000 | 6551f6ed806554d6fe86b367c42d3e0550397e8c | 2 | {
"blob_id": "6551f6ed806554d6fe86b367c42d3e0550397e8c",
"branch_name": "refs/heads/master",
"committer_date": 1553537923000,
"content_id": "a18a1f7b708c4876980f0eed7add556f5119740d",
"detected_licenses": [
"MIT"
],
"directory_id": "5181cc81f45b66a3e382560decc47bb23099e59d",
"extension": "py",
"fi... | 2.4375 | stackv2 | """
Convenience methods for executing programs
"""
import logging
import os
import subprocess # nosec
import sys
import time
from runez.base import decode
from runez.convert import flattened, represented_args, SHELL, short
from runez.system import abort, is_dryrun
LOG = logging.getLogger(__name__)
DEV_FOLDERS = ("... | 190 | 27.29 | 99 | 16 | 1,357 | python | [{"finding_id": "codeql_py/overly-permissive-file_d77003c3f0b36800_8ad76a6c", "tool_name": "codeql", "rule_id": "py/overly-permissive-file", "finding_type": "problem", "severity": "medium", "confidence": "medium", "message": "Overly permissive mask in chmod sets file to world readable.", "remediation": "", "location": ... | 1 | true | |
2024-11-18T21:23:42.885621+00:00 | 1,691,405,711,000 | 7e2e02b76b3248f0ede9738da7ab6c5c0b843d97 | 3 | {
"blob_id": "7e2e02b76b3248f0ede9738da7ab6c5c0b843d97",
"branch_name": "refs/heads/main",
"committer_date": 1691405711000,
"content_id": "9084ae0ae4485722888ba0a23199aba72afc0e12",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "af845ea574fc503f448a8e2a284696239b14e498",
"extension": "py",
... | 2.828125 | stackv2 | """
Provides utilities to preprocess images.
The ImageNet preprocessing from https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/preprocessing.py
"""
import numpy as np
import tensorflow as tf
import tensorflow_datasets as tfds
from zookeeper import Field, component
from zookeeper.tf import Pre... | 246 | 32.84 | 123 | 15 | 2,070 | python | [] | 0 | true | |
2024-11-18T21:23:42.997502+00:00 | 1,562,582,912,000 | e5142cf6961790d86cc8232d85ae57a20594ed2f | 4 | {
"blob_id": "e5142cf6961790d86cc8232d85ae57a20594ed2f",
"branch_name": "refs/heads/master",
"committer_date": 1562582912000,
"content_id": "9c21e81284bf5b49207c11805b5a802277ad557e",
"detected_licenses": [
"MIT"
],
"directory_id": "cd46a4faa10261f038938a426d03d97eb32cad7c",
"extension": "py",
"fi... | 3.890625 | stackv2 | import math
# functions too hard for me to implement at this point.
log10 = math.log10
log2 = math.log2
sin = math.sin
cos = math.cos
tan = math.tan
# constants
pi = math.pi
e = math.e
# factorial function:
def factorial(n):
if n <= 1:
return n
previous = 0
current = 1
for _ in range(n - 1):
... | 34 | 15.38 | 55 | 10 | 170 | python | [] | 0 | true | |
2024-11-18T21:23:43.050712+00:00 | 1,466,164,598,000 | a3e5a4aaf0f861f1a17c9f971c673382f863f27c | 3 | {
"blob_id": "a3e5a4aaf0f861f1a17c9f971c673382f863f27c",
"branch_name": "refs/heads/master",
"committer_date": 1466164598000,
"content_id": "067baff3008091589d1a611bedb5cc718cff9a0c",
"detected_licenses": [
"MIT"
],
"directory_id": "d467dc2e1d3ab7461e7458fd08478d4e58475a35",
"extension": "py",
"fi... | 3.3125 | stackv2 | from mcpi.minecraft import Minecraft
import time
mc = Minecraft.create()
pos_start = mc.player.getTilePos()
x_start = pos_start.x
y_start = pos_start.y
z_start = pos_start.z
mc.postToChat("Ready")
time.sleep(1)
mc.postToChat("Set")
time.sleep(1)
mc.postToChat("Go!")
for t in range(0, 15, 1):
time.sleep(1)
mc... | 34 | 25.32 | 59 | 18 | 274 | python | [] | 0 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.