added stringdate 2024-11-18 17:59:49 2024-11-19 03:44:43 | created int64 0 2,086B | id stringlengths 40 40 | int_score int64 2 5 | metadata dict | score float64 2.31 5.5 | source stringclasses 1
value | text stringlengths 258 23.4k | num_lines int64 16 649 | avg_line_length float64 15 61 | max_line_length int64 31 179 | ast_depth int64 8 40 | length int64 101 3.8k | lang stringclasses 1
value | sast_codeql_findings stringlengths 2 265k | sast_codeql_findings_count int64 0 45 | sast_codeql_success bool 1
class | sast_codeql_error stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2024-11-19T02:32:45.860388+00:00 | 1,689,373,253,000 | 623038f78ca2a9d10a2a6c78791d3a0a34b979ae | 2 | {
"blob_id": "623038f78ca2a9d10a2a6c78791d3a0a34b979ae",
"branch_name": "refs/heads/main",
"committer_date": 1689373253000,
"content_id": "a27a98eb65d2f1ac67c586a0e1988d0b56ed9b86",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "2163574cca2c7eb172f4fea4adeca1142df43e62",
"extension": "py",
... | 2.484375 | stackv2 | from . import SubCommand
from .common import *
class CombineSubtitlesCommand(SubCommand):
@property
def name(self):
return "combine-subtitles"
def build_argparse(self, subparser):
combine_video_subtitles_parser = subparser.add_parser(
"combine-subtitles",
help="Com... | 126 | 31.79 | 82 | 13 | 842 | python | [] | 0 | true | |
2024-11-19T02:32:45.927990+00:00 | 1,379,720,381,000 | d3171303b3476e8199adc8edc15772d62aa39803 | 3 | {
"blob_id": "d3171303b3476e8199adc8edc15772d62aa39803",
"branch_name": "refs/heads/master",
"committer_date": 1379720381000,
"content_id": "a7eb53f1210b07c65be10c1072f5b049f39baa1a",
"detected_licenses": [
"CC0-1.0"
],
"directory_id": "a9d8274dcf05f9cdd819ded6c3d5a4c3b158993f",
"extension": "py",
... | 2.671875 | stackv2 | import csv
import rtyaml
def convert():
data = rtyaml.load(open("legislators-current.yaml", "rb"))
reps = [x for x in data if x["terms"][-1]["type"] == "rep"]
fields = [
"official_full",
"first",
"middle",
"last",
"birthday",
"gender",
"start",
... | 47 | 31.68 | 84 | 16 | 391 | python | [] | 0 | true | |
2024-11-19T02:32:46.466634+00:00 | 1,653,525,926,000 | 76e73f92695bd0f45916382d142c5cd7284ea73c | 3 | {
"blob_id": "76e73f92695bd0f45916382d142c5cd7284ea73c",
"branch_name": "refs/heads/main",
"committer_date": 1653525926000,
"content_id": "c75e88417cc36478599280cbda657ec453a8c323",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "add92b0b1e36f40504708b2712900734ee1c4d1a",
"extension": "py",
... | 2.53125 | stackv2 | import pandas as pd
import numpy as np
import random
import matplotlib.pyplot as plt
import cv2
import matplotlib.image as mpimg
import math
import json
import h5py
import keras
from keras.models import Sequential, Model
from keras.layers import Convolution2D, Flatten, MaxPooling2D, Lambda, ELU
from keras.layers.core i... | 217 | 32.51 | 136 | 15 | 1,809 | python | [] | 0 | true | |
2024-11-19T02:32:46.536698+00:00 | 1,564,072,438,000 | 7d0699537d0fd214a15c2c1561dd76497b9587e3 | 2 | {
"blob_id": "7d0699537d0fd214a15c2c1561dd76497b9587e3",
"branch_name": "refs/heads/master",
"committer_date": 1564072438000,
"content_id": "c16366b7e47dfac0fa1ddfc533b31e1b5a2ff980",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "c13eb5059229f030d27c0ae1f946280caa98e25c",
"extension": "py"... | 2.34375 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
H2 molecule with Quantum Phase Estimation (QPE) algorithm
'''
from collections import OrderedDict
import time
from qiskit import Aer
from qiskit.transpiler import PassManager
from qiskit.aqua import AquaError
from qiskit.aqua import QuantumInstance
from qiskit.aqua... | 80 | 34.51 | 141 | 12 | 833 | python | [] | 0 | true | |
2024-11-19T02:32:46.648197+00:00 | 1,527,861,181,000 | fbf1674c70296700273b35cdfce3c331ae6d9271 | 3 | {
"blob_id": "fbf1674c70296700273b35cdfce3c331ae6d9271",
"branch_name": "refs/heads/master",
"committer_date": 1527861181000,
"content_id": "22a8084e9d41fc0e02e142d90e804c20bc0ff42e",
"detected_licenses": [
"MIT"
],
"directory_id": "84b7835a9b88bba1e437a26255a96756c6d18cf1",
"extension": "py",
"fi... | 2.6875 | stackv2 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 8 14:01:16 2018
@author: kartikaya
"""
import os
import re
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
import operator
from article_data_preprocessor_util import word_count, hit_count
import docx
import pandas as pd
import numpy as np
im... | 82 | 35.89 | 167 | 15 | 895 | python | [] | 0 | true | |
2024-11-19T02:32:46.717131+00:00 | 1,623,014,851,000 | d20fa5d42118b72582189a38baafa23415044fbe | 3 | {
"blob_id": "d20fa5d42118b72582189a38baafa23415044fbe",
"branch_name": "refs/heads/main",
"committer_date": 1623014851000,
"content_id": "77069ec37a201945b8136f07a0c6cc2ce648b6f3",
"detected_licenses": [
"MIT"
],
"directory_id": "3539d0e3ddd7849a14876e95f0332428ec28ebf7",
"extension": "py",
"file... | 2.828125 | stackv2 | from reviews import baby_counter, baby_training, instant_video_counter, instant_video_training, video_game_counter, video_game_training
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import MultinomialNB
review = "this game was violent"
baby_review_counts = baby_counter.transform... | 26 | 45.88 | 135 | 10 | 284 | python | [] | 0 | true | |
2024-11-19T02:32:46.829580+00:00 | 1,688,477,007,000 | 924401b24d0ead321bcacc566a2aeb455857cb8e | 3 | {
"blob_id": "924401b24d0ead321bcacc566a2aeb455857cb8e",
"branch_name": "refs/heads/master",
"committer_date": 1688477007000,
"content_id": "0113b27420956b70b6550d0de263021639f6516d",
"detected_licenses": [
"MIT"
],
"directory_id": "fdf452e610a4a0739ea4df95865cabe90d9f6bdc",
"extension": "py",
"fi... | 2.90625 | stackv2 | # -*- coding: utf-8 -*-
from dataclasses import dataclass
import textwrap
import asyncio
import enum
import logging
import shlex
import re
from typing import Callable, List, Iterable, Dict, Tuple, Any
from chatbot.api import MessageType, ChatMessage
@dataclass
class CommandHandle:
callback: Callable
argc: in... | 365 | 35.96 | 119 | 22 | 2,946 | python | [] | 0 | true | |
2024-11-19T02:32:47.124024+00:00 | 1,631,126,026,000 | 61539c3ca53457a1ea18ea8f16715a4cdbe5f338 | 3 | {
"blob_id": "61539c3ca53457a1ea18ea8f16715a4cdbe5f338",
"branch_name": "refs/heads/master",
"committer_date": 1631126026000,
"content_id": "e43811f105a1737d99f9f7b18fd0aebff3e0171b",
"detected_licenses": [
"MIT",
"CC0-1.0"
],
"directory_id": "251f5c092d4b7760cec8c2b6324e5290b917721f",
"extensio... | 2.84375 | stackv2 | # -*- coding: utf-8 -*-
import scrapy
import re
import json
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
'Monday': 'Mo',
'Tuesday': 'Tu',
'Wednesday': 'We',
'Thursday': 'Th',
'Friday': 'Fr',
'Saturday': 'Sa',
'Sunday': 'Su'
}
class... | 74 | 33.14 | 107 | 17 | 616 | python | [] | 0 | true | |
2024-11-19T02:32:47.589504+00:00 | 1,602,199,814,000 | 06002acf4a7c37a567638bb26294529b6bd7e011 | 2 | {
"blob_id": "06002acf4a7c37a567638bb26294529b6bd7e011",
"branch_name": "refs/heads/master",
"committer_date": 1602199814000,
"content_id": "e015b3c32ef51bd92611acc978e5a37455da7a00",
"detected_licenses": [
"MIT"
],
"directory_id": "7ddfc4083c49291f3a4afddfe43537a896f7dd6d",
"extension": "py",
"fi... | 2.3125 | stackv2 | from flask import Blueprint, render_template, redirect, url_for, request, abort, flash
from flask_login import current_user, login_user, logout_user, login_required
from urllib.parse import urlparse, urljoin
from app.forms import LoginForm, RegisterForm, AddLicenseForm, EditLicenseForm, RemoveLicenseForm, SetupForm
fro... | 243 | 31.96 | 108 | 17 | 1,688 | python | [{"finding_id": "codeql_py/url-redirection_f978e9f2566ab9d7_0deaffd9", "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-19T02:32:47.834532+00:00 | 1,477,251,242,000 | 1a6723035fba65be62c9b9351e3413cde8ab4fc5 | 3 | {
"blob_id": "1a6723035fba65be62c9b9351e3413cde8ab4fc5",
"branch_name": "refs/heads/master",
"committer_date": 1477251242000,
"content_id": "9e967d81fc8c43e8c1c620d2aa61b2f7663cb308",
"detected_licenses": [
"MIT"
],
"directory_id": "0866e58ee280f14208b21542d5f0b8345c162ef6",
"extension": "py",
"fi... | 2.546875 | stackv2 | from flask import make_response, jsonify
class RequestErrorHandling():
def __init__(self, app):
@app.errorhandler(NotFoundException)
@app.errorhandler(ParametersException)
@app.errorhandler(UnprocessibleEntryException)
def return_response(error):
return error.message
... | 46 | 31.83 | 76 | 21 | 294 | python | [] | 0 | true | |
2024-11-19T02:32:47.999629+00:00 | 1,570,686,788,000 | c5ab468a3d6ac0c34c9e52f0e688c7920ef9355e | 3 | {
"blob_id": "c5ab468a3d6ac0c34c9e52f0e688c7920ef9355e",
"branch_name": "refs/heads/master",
"committer_date": 1570686915000,
"content_id": "fb40d459b1507281d33961589c630e41500222e2",
"detected_licenses": [
"MIT"
],
"directory_id": "0cccd542de98fedb4c0e8ee2dd6178660661ad34",
"extension": "py",
"fi... | 2.875 | stackv2 | from dataset.impl.sbu_kinect import DatasetSBUKinect
# ----------------------------------------------------------------------------------------------------------------------
class DataFactory:
"""
A factory class for instantiating different datasets
"""
dataset_names = [
'sbu',
]
... | 25 | 28.88 | 120 | 15 | 135 | python | [] | 0 | true | |
2024-11-19T02:32:48.163129+00:00 | 1,515,435,561,000 | d2a7d481b129d38362ff3f072c8c86d097345dcf | 3 | {
"blob_id": "d2a7d481b129d38362ff3f072c8c86d097345dcf",
"branch_name": "refs/heads/master",
"committer_date": 1515435561000,
"content_id": "441557c29da635df7cd71f0aca7bb0a57a69afc6",
"detected_licenses": [
"MIT"
],
"directory_id": "f3f95241cb84847f6d6e9fbc5ab1844e45065701",
"extension": "py",
"fi... | 2.515625 | stackv2 | import argparse
import gzip
import itertools
import os
import pickle
import sys
import time
import matplotlib.pyplot as plt
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import precision_score, recall_score
from sklearn.t... | 298 | 39.78 | 132 | 19 | 2,904 | python | [] | 0 | true | |
2024-11-19T02:32:48.298350+00:00 | 1,625,186,378,000 | 06bff5483f10baac3cf2e69afdcb70e2e68e18c1 | 3 | {
"blob_id": "06bff5483f10baac3cf2e69afdcb70e2e68e18c1",
"branch_name": "refs/heads/main",
"committer_date": 1625186378000,
"content_id": "17a0d04c79b33cc4d35d5a7c40271e8378c0d396",
"detected_licenses": [
"MIT"
],
"directory_id": "e7eded45940c450ea893fce1de04dcf2b46dc218",
"extension": "py",
"file... | 2.515625 | stackv2 | # https://learn.adafruit.com/mqtt-in-circuitpython/circuitpython-wifi-usage
# https://learn.adafruit.com/mqtt-in-circuitpython/connecting-to-a-mqtt-broker
# required from adafruit_bundle:
# - adafruit_requests
# - adafruit_minimqtt
# - adafruit_bus_device
# - adafruit_register
# - adafruit_si7021
import time
import ssl... | 85 | 29.25 | 78 | 12 | 636 | python | [{"finding_id": "codeql_py/clear-text-logging-sensitive-data_2782a3e5a2c5b089_4ad331ba", "tool_name": "codeql", "rule_id": "py/clear-text-logging-sensitive-data", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "This expression logs [sensitive data (secret)](1) as clear text.", "r... | 2 | true | |
2024-11-19T02:32:48.486216+00:00 | 1,543,389,295,000 | 26f294325fd99906f375cd368523e1cada66240b | 3 | {
"blob_id": "26f294325fd99906f375cd368523e1cada66240b",
"branch_name": "refs/heads/master",
"committer_date": 1543389295000,
"content_id": "906d0503565a4d526d26f72f56c7221b6a51562d",
"detected_licenses": [
"MIT"
],
"directory_id": "8944cce7a6553cc7e23cd8d822986c34ab5a5997",
"extension": "py",
"fi... | 2.90625 | stackv2 | # License: MIT License https://github.com/passalis/sef/blob/master/LICENSE.txt
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import sklearn
from sklearn.decomposition import PCA
from sef_dr.classification import evaluate_svm
from sef_dr.linear import LinearSEF
fr... | 52 | 35.27 | 109 | 13 | 473 | python | [] | 0 | true | |
2024-11-19T02:32:48.656825+00:00 | 1,633,296,311,000 | 1ed66e297c39eb6499dbff08fd1e413124fb8dd0 | 3 | {
"blob_id": "1ed66e297c39eb6499dbff08fd1e413124fb8dd0",
"branch_name": "refs/heads/main",
"committer_date": 1633296311000,
"content_id": "88d99527c9adaee4ad03bcb29e3e72d6cab00cb4",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "a7ab2c2d344c7261f76fba0d3dd146d573aca2b8",
"extension": "py",
... | 3.25 | stackv2 | """
Logos - a mission toolkit for cooperative logging through space and time
------------------------------------------------------------------------
Submodule: texts
"""
from datamodel import LogosUpdateableSingleton
class Texts(LogosUpdateableSingleton):
"""
Singleton to handle texts
================... | 175 | 24.87 | 79 | 20 | 890 | python | [] | 0 | true | |
2024-11-19T02:32:48.986616+00:00 | 1,619,038,712,000 | 0b172dc1ac1d8fa86bb6a35d3f6a64d6ebd6cf5a | 4 | {
"blob_id": "0b172dc1ac1d8fa86bb6a35d3f6a64d6ebd6cf5a",
"branch_name": "refs/heads/main",
"committer_date": 1619038712000,
"content_id": "8fdd73e29d5b4f2d17e1a5a7bd69807eacd5203c",
"detected_licenses": [
"MIT"
],
"directory_id": "354f52a263d1ec1b0ec4558f09a87036daf422bd",
"extension": "py",
"file... | 4.03125 | stackv2 | '''Crie um programa onde 4 jogadores joguem um dado e tenham resultados aleatórios.
Guarde esses resultados em um dicionário em Python. No final, coloque esse dicionário em ordem,
sabendo que o vencedor tirou o maior número no dado.'''
from random import randint
from time import sleep
from operator import itemgetter
... | 21 | 32.76 | 95 | 10 | 222 | python | [] | 0 | true | |
2024-11-19T02:32:49.058445+00:00 | 1,485,209,076,000 | 88a14871def7058d7515daeaefdd5189ba6f95bb | 2 | {
"blob_id": "88a14871def7058d7515daeaefdd5189ba6f95bb",
"branch_name": "refs/heads/master",
"committer_date": 1485209076000,
"content_id": "69c9e73ed02875283eb01d393b61a63eb53c72a7",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "7b7bdff33b92ee52dd96cb8768ace745b7861acc",
"extension": "py"... | 2.453125 | stackv2 | #!/usr/bin/python
#
# Copyright 2016, 2017 Deany Dean
#
# 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 appli... | 168 | 24.11 | 75 | 16 | 954 | python | [] | 0 | true | |
2024-11-19T02:32:49.239891+00:00 | 1,693,406,835,000 | 4d414656167578d6c40939022efad661a81027bd | 2 | {
"blob_id": "4d414656167578d6c40939022efad661a81027bd",
"branch_name": "refs/heads/main",
"committer_date": 1693406835000,
"content_id": "2d46b10a459a04469a5cec8de589cc861836faf2",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "b24457559eff579d6e2f5723d188c894cae4029a",
"extension": "py"... | 2.484375 | stackv2 | """
Immutable annotation
--------------------
"""
from __future__ import annotations
import typing as t
import sqlalchemy as sa
from sqlalchemy.orm.attributes import NEVER_SET, NO_VALUE
from .annotations import annotation_wrapper, annotations_configured
__all__ = ['immutable', 'cached', 'ImmutableColumnError']
i... | 81 | 31.77 | 88 | 17 | 574 | python | [] | 0 | true | |
2024-11-19T02:32:49.412685+00:00 | 1,429,265,520,000 | 58f0071d975017bb350189dec39eac833b8964c9 | 2 | {
"blob_id": "58f0071d975017bb350189dec39eac833b8964c9",
"branch_name": "refs/heads/master",
"committer_date": 1429265520000,
"content_id": "660a0fd5ad65a9695d3ad97960c2aacb2415c6f9",
"detected_licenses": [
"MIT"
],
"directory_id": "0df8b38a9885d82ed5d721c36932be0739a12875",
"extension": "py",
"fi... | 2.359375 | stackv2 | #!/usr/bin/env python
import sys
import topological_navigation.testing
import rospy
from mongodb_store.message_store import MessageStoreProxy
from topological_navigation.publisher import map_publisher
from topological_navigation.msg import GotoNodeAction, GotoNodeResult, GotoNodeFeedback
import actionlib
from actionl... | 122 | 33.59 | 148 | 15 | 896 | python | [] | 0 | true | |
2024-11-19T02:32:49.732847+00:00 | 1,692,262,471,000 | a0e0d6f6b5e4e3d98365013add5e516b44a02edb | 3 | {
"blob_id": "a0e0d6f6b5e4e3d98365013add5e516b44a02edb",
"branch_name": "refs/heads/master",
"committer_date": 1692262471000,
"content_id": "221ffc632afd22d71ffef1487a2c86b247065347",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "73744790709a75fa15bd3a9c141777b81acf6402",
"extension": "py"... | 2.515625 | stackv2 | from cloudify_rest_client import constants, utils
from cloudify_rest_client.exceptions import CloudifyClientError
from cloudify_rest_client.responses import ListResponse
class Filter(dict):
def __init__(self, filter_obj):
super(Filter, self).__init__()
self.update(filter_obj)
@property
de... | 183 | 33.24 | 79 | 19 | 1,276 | python | [] | 0 | true | |
2024-11-19T02:32:49.847883+00:00 | 1,598,258,756,000 | 5ba79d646d1b502980fb7b7abe476182667308c2 | 2 | {
"blob_id": "5ba79d646d1b502980fb7b7abe476182667308c2",
"branch_name": "refs/heads/master",
"committer_date": 1598258756000,
"content_id": "60a66a3d509f7fd6e81e19408c4dd8d10cf84a45",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "3f0db46d7e19a4afaafba06d1a92866a3c92290f",
"extension": "p... | 2.5 | stackv2 | from pokeman import Pokeman, ConnectionParameters, Exchange, Queue, RoutingKey
from pokeman.coatings import BasicMessage, Ptypes
# Always, first declare the Pokeman
# The AMQP resources will be attached to the first (default) Pokeman instance
poker = Pokeman()
# Set the connection parameters
connection_parameters = C... | 37 | 39.19 | 111 | 9 | 358 | python | [] | 0 | true | |
2024-11-19T02:32:49.908086+00:00 | 1,619,000,563,000 | 28f303201ec4367d47efe49fc7c6ab31e6f7e418 | 3 | {
"blob_id": "28f303201ec4367d47efe49fc7c6ab31e6f7e418",
"branch_name": "refs/heads/main",
"committer_date": 1619000563000,
"content_id": "84dedb10e24500fe8611b75855829674095f7fe3",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "653eaef652627b155569b5fe9ab9bb3607fc1e78",
"extension": "py"... | 2.640625 | stackv2 | import numpy as np
from lifelines import KaplanMeierFitter
from sksurv.metrics import concordance_index_ipcw
##### WEIGHTED C-INDEX & BRIER-SCORE
def CensoringProb(Y, T):
T = T.reshape([-1]) # (N,) - np array
Y = Y.reshape([-1]) # (N,) - np array
kmf = KaplanMeierFitter()
kmf.fit(T, event_observed=(Y... | 55 | 35.31 | 111 | 14 | 643 | python | [] | 0 | true | |
2024-11-19T02:32:50.058689+00:00 | 1,343,943,976,000 | b6b6a63b6ce2ec6304e0242d084aa66fbe07ea88 | 3 | {
"blob_id": "b6b6a63b6ce2ec6304e0242d084aa66fbe07ea88",
"branch_name": "refs/heads/master",
"committer_date": 1343943976000,
"content_id": "cf04b197a34c868ae6187d7d68081e63bcd31c92",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "42d3d37a3dd22402154da4f4bd020afd7b7bad58",
"extension": "py"... | 2.71875 | stackv2 | #!/usr/bin/python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 50 | 23.6 | 76 | 10 | 293 | python | [] | 0 | true | |
2024-11-19T02:32:50.229706+00:00 | 1,415,967,878,000 | 612701edb1fc13cbc0fdb7ed6cdfcc40bdff1da7 | 3 | {
"blob_id": "612701edb1fc13cbc0fdb7ed6cdfcc40bdff1da7",
"branch_name": "refs/heads/master",
"committer_date": 1415967878000,
"content_id": "f2f59ddd683e91648673daa2c3c676a3e9662a34",
"detected_licenses": [
"MIT"
],
"directory_id": "58955a715fbb72196a51349e853a2a0f35b42312",
"extension": "py",
"fi... | 3.0625 | stackv2 | #!/usr/bin/python
import re
import sys
class Entry:
""" a soft link/forward declaration to a section """
def __init__(self, id, name):
self.id = id
self.name = name
self.parent = None
def is_file(self):
return False
def set_parent(self, parent):
self.parent = parent
def visit(self, fn, depth):
fn(... | 162 | 23.85 | 69 | 20 | 1,050 | python | [] | 0 | true | |
2024-11-19T02:32:50.320912+00:00 | 1,613,756,204,000 | a225f97d7b2b808b20f733c4727ed4a7b2ab4c21 | 2 | {
"blob_id": "a225f97d7b2b808b20f733c4727ed4a7b2ab4c21",
"branch_name": "refs/heads/main",
"committer_date": 1613756204000,
"content_id": "35f81aab6cb1324b40ac0a7ef086eca0b6c45e8c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "042ccf2bf355308e7a584e750c502846c55700af",
"extension": "py",
... | 2.46875 | stackv2 | from sqlitedb.fields import IntegerField, TextField, DateField
from sqlitedb.models import BaseModel
from sqlitedb.query import Q
from sqlitedb.utils import Singleton
class PersonDbTemplates(BaseModel, metaclass=Singleton):
id = IntegerField(name='id', primary_key=True)
name = TextField(name='name')
birth... | 26 | 22.88 | 62 | 11 | 155 | python | [] | 0 | true | |
2024-11-19T02:32:50.617015+00:00 | 1,596,641,148,000 | ebab42ffcbb719a041db95707100e66ad342407a | 3 | {
"blob_id": "ebab42ffcbb719a041db95707100e66ad342407a",
"branch_name": "refs/heads/main",
"committer_date": 1596641148000,
"content_id": "bb642197a357882aef635f3f575e4537e0f55e3c",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "30bffdfa55f3e50d5d3c119797961d2fe84e3af1",
"extension": "py",
... | 2.75 | stackv2 | # Copyright 2020 Google LLC
#
# 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 in writing, ... | 76 | 27.57 | 74 | 16 | 551 | python | [] | 0 | true | |
2024-11-19T02:32:50.890498+00:00 | 1,501,881,485,000 | 71d4e313c132100e5547740976e0fb1784650a21 | 4 | {
"blob_id": "71d4e313c132100e5547740976e0fb1784650a21",
"branch_name": "refs/heads/master",
"committer_date": 1501881485000,
"content_id": "6cf2cc53a83593bba88293615eeedea2250899c7",
"detected_licenses": [
"MIT"
],
"directory_id": "79a7d6bdb04d887a1f217756d80c13c643b0a8e3",
"extension": "py",
"fi... | 3.953125 | stackv2 | def tokenize_inward(word: str, dictionary: set) -> set:
""" Tokenizes compound words using fairly naive approach of shrinking window forward and backward
from the head and tail of the word. This has the advantage of locating only what are likely to be
the most significant parts of the compound word -- at le... | 48 | 37.15 | 117 | 12 | 434 | python | [] | 0 | true | |
2024-11-19T02:32:50.948974+00:00 | 1,612,370,499,000 | 595d28ad7cb9936f3e7a8977f55c242fe0df68dc | 2 | {
"blob_id": "595d28ad7cb9936f3e7a8977f55c242fe0df68dc",
"branch_name": "refs/heads/master",
"committer_date": 1612370499000,
"content_id": "9d7918fc78ba04fc41736f506765f5548019fc3f",
"detected_licenses": [
"MIT"
],
"directory_id": "d05c50ca741e4c33646380cecaf62ee149409d5c",
"extension": "py",
"fi... | 2.5 | stackv2 | import gym
import gym.spaces
import numpy as np
from air_hockey import AirHockey
from gym_air_hockey import DataProcessor
class AirHockeyEnv(gym.Env):
def __init__(self):
self.game = AirHockey()
self.processor = DataProcessor()
self.height = self.width = self.processor.dim
self.... | 170 | 34.85 | 116 | 22 | 1,349 | python | [] | 0 | true | |
2024-11-19T02:32:51.383540+00:00 | 1,541,424,626,000 | c82f3db0f37dde4f35a041cfd940811127b25bb5 | 3 | {
"blob_id": "c82f3db0f37dde4f35a041cfd940811127b25bb5",
"branch_name": "refs/heads/master",
"committer_date": 1541424626000,
"content_id": "5bfa85f51444e4b5e503fa30e947163052e8f6f8",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "ca6b3aa9af540f410ebb002325bb057323aad882",
"extension": "p... | 2.59375 | stackv2 | # Description: Lambda to shutdown AWS resources.
#
# Author: Nitin Patil (cloudnineapps.com)
#
# Usage:
# - Optional: Set the 'ec2NameFilter' global variable to specify a name pattern for the EC2 instances. Examples
# *dev*
# c9-membership-app-*
# c9-membership-app-dev
# - Schedule via cron (CloudWatch schedule... | 57 | 34.96 | 111 | 15 | 505 | python | [] | 0 | true | |
2024-11-19T02:32:51.767629+00:00 | 1,660,187,902,000 | d312ea88de957717c0831c3c8884490e2b095bf6 | 3 | {
"blob_id": "d312ea88de957717c0831c3c8884490e2b095bf6",
"branch_name": "refs/heads/master",
"committer_date": 1660187902000,
"content_id": "ff59182e3bb4dd489f94d7e494cb5c852d2883fe",
"detected_licenses": [
"MIT",
"Python-2.0"
],
"directory_id": "8afb5afd38548c631f6f9536846039ef6cb297b9",
"exten... | 3.4375 | stackv2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import namedtuple
Point = namedtuple("Point", ["x", "y"])
p = Point(1, 2)
print("Point:", p.x, p.y)
from collections import deque
q = deque(["a", "b", "c"])
q.append("x")
q.appendleft("y")
print(q)
from collections import defaultdict
dd = defaultdict... | 29 | 17.17 | 39 | 8 | 161 | python | [] | 0 | true | |
2024-11-19T02:32:52.082521+00:00 | 1,478,532,236,000 | bba3874e257ec557917c353c3d2150bfe0718f51 | 3 | {
"blob_id": "bba3874e257ec557917c353c3d2150bfe0718f51",
"branch_name": "refs/heads/master",
"committer_date": 1478532236000,
"content_id": "12b96935364eb62d9f7d2e0577a5cfa2cd992937",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "b30ee3ff769b8baba21afb813cad0ec087f43d30",
"extension": "p... | 2.53125 | stackv2 | from django.core.cache import cache
from django.utils.functional import SimpleLazyObject
from django.utils.html import mark_safe
from content_editor.contents import contents_for_item
__all__ = ('TemplatePluginRenderer',)
def default_context(plugin, context):
return {'plugin': plugin}
class Regions(object):
... | 189 | 31.72 | 79 | 16 | 1,167 | python | [] | 0 | true | |
2024-11-19T02:32:52.138181+00:00 | 1,442,511,198,000 | 22fda538a8e0ce34362b2ada98817fc8ffe9ffc2 | 4 | {
"blob_id": "22fda538a8e0ce34362b2ada98817fc8ffe9ffc2",
"branch_name": "refs/heads/master",
"committer_date": 1442511198000,
"content_id": "ec01903d5b31cae50fe63a3190ff962738cd88e9",
"detected_licenses": [
"MIT"
],
"directory_id": "002a8c8c9c3d11f9ff8876e4caaff3ac609959cd",
"extension": "py",
"fi... | 4.34375 | stackv2 | # Write a procedure, convert_seconds, which takes as input a non-negative
# number of seconds and returns a string of the form
# '<integer> hours, <integer> minutes, <number> seconds' but
# where if <integer> is 1 for the number of hours or minutes,
# then it should be hour/minute. Further, <number> may be an intege... | 36 | 39.5 | 121 | 11 | 437 | python | [] | 0 | true | |
2024-11-19T02:32:52.201306+00:00 | 1,638,220,484,000 | 543b05ca459e762ab42efa1383620eb140d9fda5 | 3 | {
"blob_id": "543b05ca459e762ab42efa1383620eb140d9fda5",
"branch_name": "refs/heads/master",
"committer_date": 1638220484000,
"content_id": "aa53f60282652905c5760114bbca72388cce065e",
"detected_licenses": [
"MIT"
],
"directory_id": "5ee588306775a448a3ff01aca915969b5a804cb4",
"extension": "py",
"fi... | 2.515625 | stackv2 | """
Copyright 2013 LORD MicroStrain All Rights Reserved.
Distributed under the Simplified BSD License.
See file license.txt
"""
from datetime import datetime
NANOSECONDS_PER_SECOND = 1000000000
UNIX_EPOCH = datetime(1970, 1, 1)
def nanosecond_to_timestamp(nanoseconds):
return datetime.utcfromtimestamp(nanosecon... | 18 | 24.5 | 81 | 12 | 127 | python | [] | 0 | true | |
2024-11-19T02:32:52.470595+00:00 | 1,674,902,415,000 | 2039ca19d95a20a5ed10a8452d1e69a2e60e3eab | 3 | {
"blob_id": "2039ca19d95a20a5ed10a8452d1e69a2e60e3eab",
"branch_name": "refs/heads/main",
"committer_date": 1674902415000,
"content_id": "2986cfbb6dae1c3d12328f009507ea00d081f0de",
"detected_licenses": [
"MIT"
],
"directory_id": "32e174a47026edf3e4946d5185151e43cabc6f83",
"extension": "py",
"file... | 2.515625 | stackv2 | #!/usr/bin/env python
# coding=utf-8
#------------------------------------------------------------------------------#
import os
import logging
from relfs import open_repository, RelFsError, print_error
#
from relfs.metadata import \
get_file_metadata_date_time, \
get_file_metadata_picture_info, \
... | 65 | 35.17 | 80 | 15 | 425 | python | [] | 0 | true | |
2024-11-19T02:32:52.724030+00:00 | 1,557,457,514,000 | 16aec934a8f9df6485c1f2169c26e5b306975bae | 2 | {
"blob_id": "16aec934a8f9df6485c1f2169c26e5b306975bae",
"branch_name": "refs/heads/master",
"committer_date": 1557457514000,
"content_id": "aae13bea8e37ebe64f7903ab74def542433a2b73",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "ed3dbed9193ee0cf133b0e905ac6bb72cd975709",
"extension": "p... | 2.5 | stackv2 | import logging
log = logging.getLogger('gravy.db.models')
class CurrentUserFieldRegistry(object):
_registry = {}
def add_field(self, model, field):
reg = self.__class__._registry.setdefault(model, [])
reg.append(field)
def get_fields(self, model):
fields = []
for m, f in ... | 20 | 26.75 | 72 | 15 | 120 | python | [] | 0 | true | |
2024-11-19T02:32:52.788847+00:00 | 1,632,799,239,000 | cc860ed3a7a2748aa899b48bdb8503d387d3385e | 3 | {
"blob_id": "cc860ed3a7a2748aa899b48bdb8503d387d3385e",
"branch_name": "refs/heads/main",
"committer_date": 1632799239000,
"content_id": "0850b3e87dba7a3af9ba6e15bb253e4e68c2dc73",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "4ef5b3dc2d39ec86dfc598715e80bd22a201ab18",
"extension": "py",
... | 3.0625 | stackv2 | import os
def list_all_files(path_dir:str)-> [str]:
if os.path.isfile(path_dir):
return [path_dir]
files = []
for (dirpath, dirnames, filenames) in os.walk(path_dir):
for filename in filenames:
files.append(os.path.join(dirpath, filename))
return files
def write_response_t... | 27 | 25.96 | 79 | 14 | 161 | python | [] | 0 | true | |
2024-11-19T02:32:52.913631+00:00 | 1,544,315,709,000 | d67709be855f4266a4dad32496ea689cd484cdd4 | 3 | {
"blob_id": "d67709be855f4266a4dad32496ea689cd484cdd4",
"branch_name": "refs/heads/master",
"committer_date": 1544315709000,
"content_id": "6642cc8a63452e1628dfd9ea1ebfd856fcf89e3c",
"detected_licenses": [
"MIT"
],
"directory_id": "efa579a5b4f4ed9d09bc4db37d388512b4bf0803",
"extension": "py",
"fi... | 3.171875 | stackv2 | #CodeName: separator.py
#Author: Dahir Muhammad Dahir
#Date: 2nd-May-2018
#About: as the name implies
import os
import argparse
thisDir = os.getcwd()
def main():
parser = argparse.ArgumentParser(description="Separate the file lines based on parameter you specify")
parser.add_argument("file", help="specify a input ... | 65 | 28.22 | 148 | 18 | 485 | python | [] | 0 | true | |
2024-11-19T02:32:52.971555+00:00 | 1,587,802,464,000 | d3953fb848501ba1939503a4ef10c3fef3a727b5 | 3 | {
"blob_id": "d3953fb848501ba1939503a4ef10c3fef3a727b5",
"branch_name": "refs/heads/master",
"committer_date": 1587802464000,
"content_id": "814158b0764940b04255f007154364e200165cad",
"detected_licenses": [
"MIT"
],
"directory_id": "420bc162d87f3143d759124a8e8e5cb406443ad8",
"extension": "py",
"fi... | 2.59375 | stackv2 | from fastai import *
from fastai.vision import *
from fastai.callbacks import *
import random
import cv2
import numpy as np
class ImageSequence(ItemBase):
def __init__(self, np_imgs):
self.fastai_imgs = [vision.Image(px=pil2tensor(np_img/255., np.float32)) for np_img in np_imgs]
# we still keep tra... | 38 | 40.53 | 120 | 18 | 392 | python | [] | 0 | true | |
2024-11-19T02:32:53.189802+00:00 | 1,549,451,755,000 | 645e9ab5de88cdd828c87a3bfd2e070192be1f4e | 3 | {
"blob_id": "645e9ab5de88cdd828c87a3bfd2e070192be1f4e",
"branch_name": "refs/heads/master",
"committer_date": 1549451755000,
"content_id": "e57a91f2dc73e97345ee0848b84b91f7be7e1b7d",
"detected_licenses": [
"MIT"
],
"directory_id": "9de77fb83ecfbbed46afe47b46d32319bd591fec",
"extension": "py",
"fi... | 3.25 | stackv2 | # -*- coding: utf-8 -*-
from pyspark.ml import Pipeline
from .transformers import (
set_transformer_in_out,
ColumnDropper,
ColumnRenamer,
)
def build_pipeline(column_transformers):
"""Create a dataframe transformation pipeline.
The created pipeline can be used to apply successive transformations
... | 81 | 35.17 | 98 | 17 | 648 | python | [] | 0 | true | |
2024-11-19T02:32:53.234555+00:00 | 1,437,205,483,000 | b458f107b6535aa0a3fecaa58a8e1f2f39fb1608 | 3 | {
"blob_id": "b458f107b6535aa0a3fecaa58a8e1f2f39fb1608",
"branch_name": "refs/heads/master",
"committer_date": 1437205483000,
"content_id": "17423dab1af1591bff34c94e08b14680165a49f6",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "f721832d053345936d579ec8f2322c6dd229edfa",
"extension": "py"... | 3.015625 | stackv2 | #!usr/bin/env python
def testit(func, *nkwargs, **kwargs):
try:
retval = func(*nkwargs, **kwargs)
result = (True, retval)
except Exception, e:
result = (False, str(e))
return result
def open():
funcs = (int, long, float)
vals = (1234, 12.34, '1234', '12.34')
for eachF... | 28 | 24.75 | 63 | 15 | 208 | python | [] | 0 | true | |
2024-11-19T02:32:53.303744+00:00 | 1,519,387,895,000 | b18ea7f16972331650e96398304dd9b7ce8dfc30 | 3 | {
"blob_id": "b18ea7f16972331650e96398304dd9b7ce8dfc30",
"branch_name": "refs/heads/master",
"committer_date": 1519387895000,
"content_id": "24e6da5facee94c58ab014da3f3e0bd61c687fba",
"detected_licenses": [
"MIT"
],
"directory_id": "d3fb6bf7a904c78e733b053ee2cbaeded0154b89",
"extension": "py",
"fi... | 2.75 | stackv2 | from . import base
from . import fields
from .user import User
from ..utils import helper, markdown
class MessageEntity(base.TelegramObject):
"""
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
https://core.telegram.org/bots/api#messageentity
... | 99 | 34.96 | 109 | 16 | 824 | python | [] | 0 | true | |
2024-11-19T02:32:53.549039+00:00 | 1,463,140,939,000 | b423802c15c0379cc0ac4d7a8ef83e1f71dac486 | 3 | {
"blob_id": "b423802c15c0379cc0ac4d7a8ef83e1f71dac486",
"branch_name": "refs/heads/master",
"committer_date": 1463140939000,
"content_id": "bb578439fd75aeda969074e6ecc680872b117bbe",
"detected_licenses": [
"MIT"
],
"directory_id": "c920e27d9f014e02ddbfd963c264f9ccb005d619",
"extension": "py",
"fi... | 3.0625 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from node import Node
from code import Code
from tokentype import TokenType
""" 構文木二項演算クラス """
class BinExpr(Node):
def __init__(self, op, nodeL, nodeR):
self.op = op
self.nodeL = nodeL
self.nodeR = nodeR
def run(self, writer):
self.nodeL.run(writer)
... | 48 | 22.75 | 38 | 12 | 373 | python | [] | 0 | true | |
2024-11-19T02:32:53.601107+00:00 | 1,479,929,883,000 | e9c9777ea5dc3ae99f3f90a58af9902467a2719c | 3 | {
"blob_id": "e9c9777ea5dc3ae99f3f90a58af9902467a2719c",
"branch_name": "refs/heads/master",
"committer_date": 1479929883000,
"content_id": "e54b8ced254e945372950cc72b2dcc1a22cfa559",
"detected_licenses": [
"MIT"
],
"directory_id": "705a14b5c6a39fb8b8028485e0d0d5fcc7906b48",
"extension": "py",
"fi... | 2.984375 | stackv2 | import sys
import os
import csv
def prepare_data(file):
map_data = {}
with open(file, "r") as f:
data = f.readline()
key = ""
exit_flag = False
while data:
data = data.strip()
if data == "":
if exit_flag:
break
... | 48 | 24.38 | 57 | 17 | 273 | python | [] | 0 | true | |
2024-11-19T02:32:53.673883+00:00 | 1,545,304,400,000 | ce6642d1da90e43730849f14d3d377ebb68f532c | 3 | {
"blob_id": "ce6642d1da90e43730849f14d3d377ebb68f532c",
"branch_name": "refs/heads/master",
"committer_date": 1545304400000,
"content_id": "f9c65ec1df25a07e02353e2005523480903d7329",
"detected_licenses": [
"MIT"
],
"directory_id": "ab7edd51121d0cb869af4a34c42c7e16c649562a",
"extension": "py",
"fi... | 2.609375 | stackv2 | from myproject.settings import BASE_DIR
from language.views_common import *
from russian.models import *
import requests
## @var words_step
# Amount of words per page in the database
words_step = 50
@login_required
def index (request):
data_bases = {
'user': User_Word
}
level = get_level (data_bases, request.u... | 231 | 23.66 | 140 | 20 | 1,538 | python | [] | 0 | true | |
2024-11-19T02:32:53.929307+00:00 | 1,619,899,079,000 | a1caba2a0544e5c9248f0877168107ea97275dfe | 3 | {
"blob_id": "a1caba2a0544e5c9248f0877168107ea97275dfe",
"branch_name": "refs/heads/main",
"committer_date": 1619899079000,
"content_id": "415ce936eb30379d8f615bf3ba1f913200460820",
"detected_licenses": [
"CC0-1.0"
],
"directory_id": "e23f8e1cbdef09be7a251a15c29ef146fa01650b",
"extension": "py",
"... | 2.5625 | stackv2 | from typing import Optional
from sqlalchemy.orm import Session
from sql_app import models, schemas
def get_user(db: Session, user_id: int):
return db.query(models.User).filter(models.User.id == user_id).first()
def get_user_by_email(db: Session, email: str):
return db.query(models.User).filter(models.User.... | 62 | 33.74 | 116 | 18 | 551 | python | [] | 0 | true | |
2024-11-19T02:32:53.972544+00:00 | 1,692,804,985,000 | 9cf90cab947df121115a9912e0ec325bd0b6a08c | 3 | {
"blob_id": "9cf90cab947df121115a9912e0ec325bd0b6a08c",
"branch_name": "refs/heads/main",
"committer_date": 1692804985000,
"content_id": "e0859fbf2850c1688ed0c63be952feec3ab0e3a1",
"detected_licenses": [
"MIT",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
],
"directory_id": "067a18403a308... | 2.828125 | stackv2 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import json
import time
from argparse import ArgumentParser
import numpy as np
from collections import namedtuple
from tqdm import tqdm
TR_UPPER = {ord('i'): 'İ'}
TR_LOWER = {ord('I'): 'ı'}
Vocab = namedtuple('Vocab', ['idx_to_term',... | 177 | 34.17 | 99 | 18 | 1,454 | python | [] | 0 | true | |
2024-11-19T02:32:54.024732+00:00 | 1,512,722,117,000 | 20c028e5a52b1d5c4cd971a6a89eb58045e82bd4 | 3 | {
"blob_id": "20c028e5a52b1d5c4cd971a6a89eb58045e82bd4",
"branch_name": "refs/heads/master",
"committer_date": 1512722117000,
"content_id": "7e78a1fcbdcfd52a62e2bfc996443534407c9ef1",
"detected_licenses": [
"MIT"
],
"directory_id": "025e9d942d75159536feae462ea1ed08b4ae0caf",
"extension": "py",
"fi... | 3.25 | stackv2 | # coding=utf-8
import tensorflow as tf
import collections
a = tf.constant([10, 20])
b = tf.constant([1.0, 2.0])
# 'fetches' 可以为单个数
session = tf.Session()
v = session.run(a)
# v is the numpy array [10, 20]
# 'fetches' 可以为一个list.
v = session.run([a, b])
# v a Python list with 2 numpy arrays: the numpy array [10, 20] an... | 25 | 30 | 71 | 10 | 327 | python | [] | 0 | true | |
2024-11-19T02:32:54.093996+00:00 | 1,593,587,977,000 | 49b86b67ca44e2ece5eadcb29ad8fc993c4d8ae7 | 3 | {
"blob_id": "49b86b67ca44e2ece5eadcb29ad8fc993c4d8ae7",
"branch_name": "refs/heads/master",
"committer_date": 1593587977000,
"content_id": "b883ddc234d3e95988f98d89011ee5430cb00992",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "5d442d79083932540ea54c244121f00a31d0c927",
"extension": "p... | 2.71875 | stackv2 | import functools
import matplotlib.pyplot as plt
import numpy as np
import pickle
import tensorflow as tf
import tfplot
def figure_heatmap(heatmap, points=None, cmap='plasma', log=False):
dims = len(heatmap.shape)
if dims > 2:
heatmap = heatmap[...,0]
if log:
heatmap = np.log(heatmap+1e-7)
... | 143 | 34.31 | 118 | 19 | 1,348 | python | [] | 0 | true | |
2024-11-19T02:32:54.214695+00:00 | 1,505,890,042,000 | 756c8644e7d1ad57c90e9189128f73ba5585598c | 3 | {
"blob_id": "756c8644e7d1ad57c90e9189128f73ba5585598c",
"branch_name": "refs/heads/master",
"committer_date": 1505890042000,
"content_id": "45abc072b33c32836e885b1da57fff042e31a6bd",
"detected_licenses": [
"MIT"
],
"directory_id": "04e088e7e8bfe38d7ba16848555799810c8b341c",
"extension": "py",
"fi... | 3.046875 | stackv2 | import math
from .matcher import Matcher
from .quickSearch import QuickSearcher
class bestMatchingMatcher(Matcher):
"""
基於 bm25 算法取得最佳關聯短語
"""
def __init__(self, segLib="jieba", removeStopWords=False): # segLib="Taiba"
super().__init__(segLib)
self.cleanStopWords = removeStopWords
... | 161 | 26.99 | 99 | 20 | 1,231 | python | [] | 0 | true | |
2024-11-19T02:32:54.488289+00:00 | 1,625,108,490,000 | fbf2a11f7854e9b0c721150a24fa45f889161d0c | 4 | {
"blob_id": "fbf2a11f7854e9b0c721150a24fa45f889161d0c",
"branch_name": "refs/heads/main",
"committer_date": 1625108490000,
"content_id": "a62c40aaeb685530ad3c19a775c5487b0778aff5",
"detected_licenses": [
"MIT"
],
"directory_id": "07eff6b7dca63591c07a5e67c271ee36efd8c481",
"extension": "py",
"file... | 4.15625 | stackv2 | """
Exercise 2: Write a program to prompt for a file name, and then read through the file and look for lines of the form:
X-DSPAM-Confidence: 0.8475
When you encounter a line that starts with “X-DSPAM-Confidence:”
pull apart the line to extract the floating-point number on the line.
Count these lines and then compute ... | 31 | 33.84 | 117 | 16 | 290 | python | [] | 0 | true | |
2024-11-19T02:32:54.534456+00:00 | 1,608,935,276,000 | 2a9887394256ef8b2a348aef7724f1b6c68354b9 | 3 | {
"blob_id": "2a9887394256ef8b2a348aef7724f1b6c68354b9",
"branch_name": "refs/heads/main",
"committer_date": 1609001727000,
"content_id": "d98b0b4efe2e1ddc46dd0fb5b2970cbd9121cc58",
"detected_licenses": [
"MIT"
],
"directory_id": "fd5bd023d10b7f8cb4a8cc9b2b1a57eb541058b3",
"extension": "py",
"file... | 2.828125 | stackv2 | import move
# EXAMPLE CONFIGURATION, PLEASE EDIT BEFORE USING
class motion_parameters:
dynamic_model = [
move.spring_damper_parameters(f_n = 60.5, zeta = 0), # x
move.spring_damper_parameters(f_n = 52, zeta = 0.025), # y
#move.asymmetric_spring_damper_parameters(f_n_negative = 52.5, f_n_pos... | 62 | 40.56 | 147 | 10 | 856 | python | [] | 0 | true | |
2024-11-19T02:32:54.597907+00:00 | 1,692,371,579,000 | 03253ae8adde90c477fe15bca8a060b2442989f9 | 3 | {
"blob_id": "03253ae8adde90c477fe15bca8a060b2442989f9",
"branch_name": "refs/heads/master",
"committer_date": 1692371579000,
"content_id": "bf136d8401bda77b6a82ae3fa265a4166b5a7b0b",
"detected_licenses": [
"MIT"
],
"directory_id": "b2913030cf1646310b08efaa57c2199bb08e37c9",
"extension": "py",
"fi... | 3.09375 | stackv2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2022-12-12 at 13:03
@author: cook
"""
import argparse
import os
import sys
from astropy.io import fits
# =============================================================================
# Define variables
# ========... | 158 | 27.84 | 79 | 16 | 893 | python | [] | 0 | true | |
2024-11-19T02:32:54.649836+00:00 | 1,614,246,187,000 | dc5c6b00ddf89e008f122e61dbe6f920caa47944 | 2 | {
"blob_id": "dc5c6b00ddf89e008f122e61dbe6f920caa47944",
"branch_name": "refs/heads/master",
"committer_date": 1614246265000,
"content_id": "3d910c466770404ca9faa70f03b9720b5876ec40",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "e9dc99e5cc88c0ab93614ddd4b1ba43e6276a0d9",
"extension": "p... | 2.46875 | stackv2 | import base64
import json
from datetime import datetime, timedelta
import pandas as pd
import requests
from jwt import encode
from pydantic import Field
from simplejson import JSONDecodeError
from toucan_connectors.common import (
FilterSchema,
nosql_apply_parameters_to_query,
transform_with_jq,
)
from to... | 151 | 33.91 | 100 | 21 | 1,104 | python | [] | 0 | true | |
2024-11-19T02:32:54.709321+00:00 | 1,554,370,240,000 | 6e2ff743ccc38412956c1d7bf59e6f0afce692d7 | 3 | {
"blob_id": "6e2ff743ccc38412956c1d7bf59e6f0afce692d7",
"branch_name": "refs/heads/master",
"committer_date": 1554370240000,
"content_id": "6f47de6dbe13b524f06644d60ccb546e523de82e",
"detected_licenses": [
"MIT"
],
"directory_id": "43e1c217a496e3337e549c2d27f49dbaba6bad2c",
"extension": "py",
"fi... | 3.0625 | stackv2 | def cen_rot (im, rot, dim_out, offset1=(0,0), offset2=(0,0), order=2):
"""cen_rot - takes a cube of images im, and a set of rotation angles in rot,
and translates the middle of the frame with a size dim_out to the middle of
a new output frame with an additional rotation of rot.
... | 47 | 31.32 | 91 | 13 | 452 | python | [] | 0 | true | |
2024-11-19T02:32:54.885888+00:00 | 1,589,594,712,000 | a435b8383b9569890fdb17ee9ecbbcd798375372 | 3 | {
"blob_id": "a435b8383b9569890fdb17ee9ecbbcd798375372",
"branch_name": "refs/heads/master",
"committer_date": 1589594712000,
"content_id": "0c4c13558517cf7917f26e2ad87618f2e72edb2a",
"detected_licenses": [
"MIT"
],
"directory_id": "b134bfeb208eee955dad53a9ad08c4c587140dbb",
"extension": "py",
"fi... | 2.796875 | stackv2 | from DAO.mensagensDAO import MensagensDAO
from services.edgarService import EdgarService
import json
import dateutil.parser
from datetime import datetime
class MensagensService:
_botService = EdgarService()
_dao = MensagensDAO()
def buscar(self, usuario):
mensagens = self._dao.buscar(usuario)
... | 37 | 36.81 | 105 | 13 | 327 | python | [] | 0 | true | |
2024-11-19T02:32:55.003993+00:00 | 1,688,738,480,000 | 24ee36a290aece758f9f10d3296e24b847c21514 | 3 | {
"blob_id": "24ee36a290aece758f9f10d3296e24b847c21514",
"branch_name": "refs/heads/master",
"committer_date": 1688738480000,
"content_id": "60624bb852f28c039046747dd3320514a51982e2",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "68e2df11645278a9997eeae804a9a075585b59f2",
"extension": "p... | 2.5625 | stackv2 | """
exception-specification:
(until c++17)
dynamic-exception-specification
noexcept-specification
dynamic-exception-specification:
(until c++17)
throw ( type-id-list )
(until c++20)
throw ( )
type-id-list:
type-id ...opt
type-id-list , type-id ...opt
noexcept-specification:
(s... | 140 | 27.96 | 135 | 16 | 1,167 | python | [] | 0 | true | |
2024-11-19T02:32:55.160523+00:00 | 1,631,594,048,000 | 0c94a46fca4b4fe8023847df5094b3646b01d5c7 | 3 | {
"blob_id": "0c94a46fca4b4fe8023847df5094b3646b01d5c7",
"branch_name": "refs/heads/master",
"committer_date": 1631594048000,
"content_id": "02182035f3a6b6de766c93a38c01fc671e13ca2a",
"detected_licenses": [
"MIT"
],
"directory_id": "9ba5d85bc644cc586abc29b6c82047deb4caea1f",
"extension": "py",
"fi... | 2.703125 | stackv2 | '''
Description:
version:
Author: Data Designer
Date: 2021-03-21 21:31:16
LastEditors: Data Designer
LastEditTime: 2021-03-21 21:43:20
'''
#
# @lc app=leetcode.cn id=118 lang=python3
#
# [118] 杨辉三角
#
# @lc code=start
class Solution:
def generate(self, numRows: int) -> List[List[int]]:
if numRows==0:
... | 36 | 20.64 | 57 | 20 | 242 | python | [] | 0 | true | |
2024-11-19T02:32:55.273982+00:00 | 1,511,106,772,000 | e1a6aed5e2be4d5efeaf29c895578b898047ea0f | 3 | {
"blob_id": "e1a6aed5e2be4d5efeaf29c895578b898047ea0f",
"branch_name": "refs/heads/master",
"committer_date": 1511106772000,
"content_id": "8fa5963cff9a302f70f756111b615caeedfca361",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "b6a184b01e36bb812d6224b278957d581b499d33",
"extension": "py"... | 2.515625 | stackv2 | # -*- coding: utf-8 -*-
import re
from bs4 import BeautifulSoup
from .audio_url_decoder import decode_audio_url
from .exceptions import AccessDenied
RE_AUDIO = re.compile(r'audio[-\d]+_\d+_audios\d+')
class VkAudio:
__slots__ = ('_vk',)
def __init__(self, vk):
self._vk = vk
def get(self, own... | 171 | 27.14 | 80 | 16 | 1,122 | python | [] | 0 | true | |
2024-11-19T02:32:55.341826+00:00 | 1,584,157,774,000 | 25cddc86111b8c620d8152adfad4e977b2c3d09a | 3 | {
"blob_id": "25cddc86111b8c620d8152adfad4e977b2c3d09a",
"branch_name": "refs/heads/master",
"committer_date": 1584157774000,
"content_id": "07e2b257bd0823bc716c73ae3b40e82beebc2903",
"detected_licenses": [
"MIT"
],
"directory_id": "02a138997f38e9c331034466052677e3ed2fd85d",
"extension": "py",
"fi... | 2.5625 | stackv2 | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 11:10:24 2019
@author: Chenghai Li
"""
import tensorflow as tf
from AutoEncoder_model import AutoEncoder
AE = AutoEncoder(0.1)
AE.load_weights('./checkpoints/AutoEncoder_ckpt')
class LSTM_Base(tf.keras.Model):
def __init__(self, rate = 0.2, training = True):
... | 45 | 24.76 | 66 | 12 | 351 | python | [] | 0 | true | |
2024-11-19T02:32:55.526421+00:00 | 1,573,177,541,000 | eecf88386b278c68ae6583f5f3279e656609d0fc | 3 | {
"blob_id": "eecf88386b278c68ae6583f5f3279e656609d0fc",
"branch_name": "refs/heads/master",
"committer_date": 1573177541000,
"content_id": "0463974a7ad8386c0a598119895136ed76fb34a9",
"detected_licenses": [
"MIT"
],
"directory_id": "3a914aae9e65c42a85d5290fc2b70fa565738753",
"extension": "py",
"fi... | 3.109375 | stackv2 | import pygame
from pygame.locals import *
from custom.text import Text
from custom.button import Button
class LevelSelectionScreen:
""" Level Selection Screen, where you can select certain levels to play """
def __init__(self, hub):
""" Initialize default values """
self.hub = hub
sel... | 120 | 34.08 | 94 | 17 | 858 | python | [] | 0 | true | |
2024-11-19T02:32:55.659523+00:00 | 1,517,843,773,000 | f788ecb8364aadb569b12ac1d09e2df58e29f7cb | 3 | {
"blob_id": "f788ecb8364aadb569b12ac1d09e2df58e29f7cb",
"branch_name": "refs/heads/master",
"committer_date": 1517843773000,
"content_id": "b09874ac2db705926a419ef44810a1a714ddae8a",
"detected_licenses": [
"BSD-2-Clause"
],
"directory_id": "a03b30ee77b49e19a72b647e984b98f878c2847a",
"extension": "p... | 3.390625 | stackv2 | # Program 9c: Phase portrait and Poincare section of a nonautonomous ODE.
# See Figure 9.11(b).
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
xmin=-2;xmax=2;ymin=-2;ymax=2;
k=0.3;omega=1.25;Gamma=0.5;
def dx_dt(x, t):
return [x[1],x[0]-k*x[1]-x[0]**3+Gamma*np.cos(omega*t)]
... | 35 | 25.63 | 74 | 11 | 378 | python | [] | 0 | true | |
2024-11-19T02:32:56.036023+00:00 | 1,613,455,975,000 | 4a5be7b65774cd4b3c1c7d13703dd298c807c0f7 | 3 | {
"blob_id": "4a5be7b65774cd4b3c1c7d13703dd298c807c0f7",
"branch_name": "refs/heads/master",
"committer_date": 1613455975000,
"content_id": "3e2d1039026f3a22f86b064b51d3aa24549b98ed",
"detected_licenses": [
"MIT"
],
"directory_id": "c6c09aea645f8639594d8da3c4b7f5e0a15b88eb",
"extension": "py",
"fi... | 2.6875 | stackv2 | import os
import random
from keras.preprocessing.image import ImageDataGenerator
from matplotlib import pyplot as plt
image_generator = ImageDataGenerator(rotation_range=30,
width_shift_range=0.2,
height_shift_range=0.2,
... | 42 | 33.24 | 77 | 14 | 338 | python | [] | 0 | true | |
2024-11-19T02:32:56.092456+00:00 | 1,578,867,318,000 | afe307ace8cc54db33f09e6be541fe87bac6e128 | 2 | {
"blob_id": "afe307ace8cc54db33f09e6be541fe87bac6e128",
"branch_name": "refs/heads/master",
"committer_date": 1578867318000,
"content_id": "3dcc078d15230bc4aa20ba2da5cb68ff8a0e4c43",
"detected_licenses": [
"MIT"
],
"directory_id": "8d46e4fd354a7ff66534e1bfc6cf8ace16017f6a",
"extension": "py",
"fi... | 2.3125 | stackv2 | from flask import Flask, request, jsonify
import pandas as pd
from fastai.imports import *
from sklearn.externals import joblib
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!!!"
@app.route('/predict', methods=['POST'])
def predict():
json_ = request.json
query_df = pd.DataFrame... | 26 | 23 | 53 | 12 | 160 | python | [] | 0 | true | |
2024-11-19T02:32:56.214739+00:00 | 1,593,898,362,000 | d0de774ef48664e70932bd5caab2fb5b88714378 | 3 | {
"blob_id": "d0de774ef48664e70932bd5caab2fb5b88714378",
"branch_name": "refs/heads/master",
"committer_date": 1593898362000,
"content_id": "c4f99dd3d865834d82e0076ba853c3ba465f78e4",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "8dd806d1be900b9d7b073261f8c98e8d243be0be",
"extension": "p... | 3 | stackv2 | import numexpr as ne
import numpy as np
from scipy import stats
import uproot
def from_uproot(
ntuple_path, pos_in_file, variable, bins, weight=None, selection_filter=None
):
"""create a single histogram with uproot, return bin yields and statistical
uncertainties on the yield
Args:
ntuple_pa... | 79 | 32.08 | 102 | 11 | 599 | python | [] | 0 | true | |
2024-11-19T02:32:56.277040+00:00 | 1,600,246,765,000 | 0b557a9ee8ed888187d385caa8152a0183465368 | 3 | {
"blob_id": "0b557a9ee8ed888187d385caa8152a0183465368",
"branch_name": "refs/heads/master",
"committer_date": 1600246765000,
"content_id": "b510f8ede0bc6eee4e695df6e191110483de168a",
"detected_licenses": [
"MIT"
],
"directory_id": "2c2de93d0dc90b6efefc34239e50f0e638a19055",
"extension": "py",
"fi... | 2.625 | stackv2 | from flask import render_template,request,redirect,url_for
from . import main
from ..requests import get_news,get_articles, search_news
# Views
@main.route('/')
def index():
'''
View root page function that returns the index page and its data
'''
#getting floods news
title='Home-Welcome to the... | 43 | 25.95 | 70 | 13 | 253 | python | [] | 0 | true | |
2024-11-19T02:32:56.342132+00:00 | 1,571,706,292,000 | 0e80887059e6ba94389fdd3418d94444b62635a9 | 2 | {
"blob_id": "0e80887059e6ba94389fdd3418d94444b62635a9",
"branch_name": "refs/heads/master",
"committer_date": 1571706292000,
"content_id": "09f16deb9abf79f9e2c537e898ed7581988dbf34",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "9d5051b0ee8dfbc6ea7b91c067eff5643c06ede7",
"extension": "py"... | 2.359375 | stackv2 | '''
Created on 2016/2/23
Author: by wang_yang1980@hotmail.com
'''
from ScapyLibrary.keywords.layers import LayersWrapper
from ScapyLibrary.keywords.scapyfunctions import ScapyFunctionWrapper
from ScapyLibrary.keywords.sendrecv import SendRecv
from ScapyLibrary.keywords.pcap import PcapFile
from .version import __vers... | 34 | 26.91 | 76 | 13 | 232 | python | [] | 0 | true | |
2024-11-19T02:32:56.400665+00:00 | 1,559,765,038,000 | e2f2a485a6baa9352b8cd95b8549bd03d079d97e | 3 | {
"blob_id": "e2f2a485a6baa9352b8cd95b8549bd03d079d97e",
"branch_name": "refs/heads/master",
"committer_date": 1559765038000,
"content_id": "a9523f68338fb9406664e1ff96a5bfc1d9e42f70",
"detected_licenses": [
"MIT"
],
"directory_id": "b16f3533bd14d9cdf6b34c144c917f6fb2c90e4b",
"extension": "py",
"fi... | 2.6875 | stackv2 | import sys
import time
import controller
import logger
def sort_by_load(value):
return value[3]
def parse_int(str, fallback):
""" Safely parses string to integer.
Args:
str: (str) Strint to be parsed.
fallback: (str) Default value.
Returns:
(int) Parsed value or default value in case of failure.
"""... | 139 | 29.21 | 137 | 19 | 1,020 | python | [] | 0 | true | |
2024-11-19T02:32:56.468289+00:00 | 1,519,827,765,000 | b1e9ae1bf52476f02eb25aad52a9d1b7a9d64f23 | 2 | {
"blob_id": "b1e9ae1bf52476f02eb25aad52a9d1b7a9d64f23",
"branch_name": "refs/heads/master",
"committer_date": 1519827765000,
"content_id": "7f51e8938ec28208e4905b6e1677fdd5554d5018",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "d8c470cbd90a4d8c9151afd410df5af9cfbd4e58",
"extension": "py"... | 2.328125 | stackv2 | from django.shortcuts import render
# Create your views here.
from rest_framework import generics, permissions
from .permissions import Proprietario
from .serializers import CadastroCurriculoSerializer
from .models import CadastroCurriculo
class CreateView(generics.ListCreateAPIView):
"""Esta classe define a list... | 26 | 40.62 | 85 | 12 | 228 | python | [] | 0 | true | |
2024-11-19T02:32:56.729190+00:00 | 1,551,800,477,000 | 4cc34849d965a6ac91e279baa275ac80ceef07e6 | 4 | {
"blob_id": "4cc34849d965a6ac91e279baa275ac80ceef07e6",
"branch_name": "refs/heads/master",
"committer_date": 1551800477000,
"content_id": "0e27ae83527438b119d8d4cf723acb810eb4d451",
"detected_licenses": [
"MIT"
],
"directory_id": "a789fa93cda2def8bd0e8c32c19fef2ffc4cc067",
"extension": "py",
"fi... | 3.578125 | stackv2 | #PI Value Calculation Using the Neelkantha Series
j = 3.0
k=1
for i in range(2, 400000, 2): #Change the Desired End Step to get a better nth value
k = k+1
if k % 2 ==0:
j = j+ 4/(i*(i+1)*(i+2))
else:
j = j- 4/(i*(i+1)*(i+2))
a = repr(j)
from tkinter import *
top = Tk()
L1 = Label(top, text="... | 19 | 25.47 | 84 | 16 | 187 | python | [] | 0 | true | |
2024-11-19T02:32:56.896886+00:00 | 1,616,378,812,000 | 46f09a266acc679f48e54542ff34878fdea5e504 | 3 | {
"blob_id": "46f09a266acc679f48e54542ff34878fdea5e504",
"branch_name": "refs/heads/master",
"committer_date": 1616378812000,
"content_id": "a1f3333d4e62608f0dc805ce012851531f9915d1",
"detected_licenses": [
"MIT"
],
"directory_id": "b039f3fc9d478fbcdae48a5f97803e7bf651a79d",
"extension": "py",
"fi... | 2.546875 | stackv2 | # Copyright 2020 Robin Scheibler
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | 85 | 34.14 | 88 | 15 | 748 | python | [] | 0 | true | |
2024-11-19T02:32:57.201981+00:00 | 1,513,126,536,000 | 8152a6ec6dcf69256cc7a75f6335d758552886d9 | 3 | {
"blob_id": "8152a6ec6dcf69256cc7a75f6335d758552886d9",
"branch_name": "refs/heads/master",
"committer_date": 1513126640000,
"content_id": "5933a488ca47e4cd7bbcbc7053114878bf5332a9",
"detected_licenses": [
"MIT"
],
"directory_id": "3dd98d4dc8717a95a15346edf8c6167de0e3e064",
"extension": "py",
"fi... | 2.546875 | stackv2 | """
jcoin/josecoin.py - main module for josécoin backend
a neat webserver which handles josécoin transfers,
wallets, database connections, authentication, etc
"""
import logging
import asyncio
import decimal
import asyncpg
from sanic import Sanic
from sanic import response
import config as jconfig
from errors impor... | 175 | 25.14 | 77 | 14 | 1,026 | python | [] | 0 | true | |
2024-11-19T02:32:57.315155+00:00 | 1,511,287,536,000 | 7f0ac23d24e8a2aa9f2e4f1078f4803064e1b9f8 | 3 | {
"blob_id": "7f0ac23d24e8a2aa9f2e4f1078f4803064e1b9f8",
"branch_name": "refs/heads/master",
"committer_date": 1511287536000,
"content_id": "b7d25377df71315d24060112dc0f8ae74bc3236c",
"detected_licenses": [
"MIT"
],
"directory_id": "3d19416bc1c11b5cfb822d743bd8a68f7b29765c",
"extension": "py",
"fi... | 3.109375 | stackv2 | # upload textbook to DB
# for best results, use Python 2
from pymongo import MongoClient
import settings
import csv
client = MongoClient(settings.MONGO_URI)
db = client['textbookTOCs']
collection = db.textbooks
class TOC:
def __init__(self, file_name):
self.raw_data = []
with open('./assets/' + f... | 108 | 34.03 | 78 | 19 | 738 | python | [] | 0 | true | |
2024-11-19T02:32:57.411034+00:00 | 1,632,722,797,000 | 864097400f87bada1ae8db9c6e4c9da8178cfa52 | 3 | {
"blob_id": "864097400f87bada1ae8db9c6e4c9da8178cfa52",
"branch_name": "refs/heads/main",
"committer_date": 1632722797000,
"content_id": "9d4bbaa9dc40454dada5b74a121b8745151888a4",
"detected_licenses": [
"MIT"
],
"directory_id": "20035d7de00f51adbfd43b6c08ecc4f651f45ab4",
"extension": "py",
"file... | 2.640625 | stackv2 | import torch
from services.text_similarity.settings import Settings
class BERTDataset:
def __init__(self, sentence_1, sentence_2, targets):
self.settings = Settings
self.sentence_1 = sentence_1
self.sentence_2 = sentence_2
self.targets = targets
assert len(self.sentence_1)... | 41 | 28.02 | 80 | 13 | 264 | python | [] | 0 | true | |
2024-11-19T02:32:57.466259+00:00 | 1,558,906,874,000 | a6869d5fd92651556f7ccd0b68dc4a98ae294cac | 3 | {
"blob_id": "a6869d5fd92651556f7ccd0b68dc4a98ae294cac",
"branch_name": "refs/heads/master",
"committer_date": 1558906874000,
"content_id": "be81dd69f5b682a000b8f3f38f2d5d22fbf337c1",
"detected_licenses": [
"MIT"
],
"directory_id": "1d35da818d89489f58f0d8e5a8f152c98fbde930",
"extension": "py",
"fi... | 3.484375 | stackv2 | upright = (-1, 1)
down = (1, 0)
def init(order):
return [[0] * order for i in range(order)], (0, order // 2)
def magic(square, position, number=1):
square[position[0]][position[1]] = number
for yoff, xoff in [upright, down]:
y = (position[0] + yoff) % len(square)
x = (position[1] + xoff)... | 19 | 26.26 | 63 | 12 | 165 | python | [] | 0 | true | |
2024-11-19T02:32:57.814206+00:00 | 1,552,581,747,000 | f3b13fb45926ef0cf72592e06c65735682b6e3b4 | 2 | {
"blob_id": "f3b13fb45926ef0cf72592e06c65735682b6e3b4",
"branch_name": "refs/heads/master",
"committer_date": 1552581747000,
"content_id": "cc9c98d754e783f5ce1d6c2e9e5ae4abb75ca0ae",
"detected_licenses": [
"MIT"
],
"directory_id": "5bc47f6e86917f98f2ab05c092248ec8a8ada7e2",
"extension": "py",
"fi... | 2.328125 | stackv2 | #!/usr/bin/env python3
"""
Processes raw hotfilm voltages to velocities.
"""
from asist_nsf_2018.experiments import experiments
from asist_nsf_2018.process_level2 import clean_hotfilm_exp3
from asist.utility import binavg, limit_to_percentile_range, running_mean
from asist.hotfilm import hotfilm_velocity, read_hotfilm_... | 126 | 32.13 | 112 | 15 | 1,425 | python | [] | 0 | true | |
2024-11-19T02:32:57.860300+00:00 | 1,624,414,508,000 | 7c7c77dc03d4e97a0da92c2c1351fa2a1161a38a | 2 | {
"blob_id": "7c7c77dc03d4e97a0da92c2c1351fa2a1161a38a",
"branch_name": "refs/heads/main",
"committer_date": 1624414508000,
"content_id": "5d0bc3ca862908824559508986491cc8f1dc7a5c",
"detected_licenses": [
"MIT"
],
"directory_id": "2503f3a29bc743921c73dbbf274a7fdc7cd1e0a2",
"extension": "py",
"file... | 2.46875 | stackv2 | '''
This file provides a wrapper class for RandMix
(https://worksheets.codalab.org/worksheets/0x822ba2f9005f49f08755a84443c76456/) model for ImageNet dataset.
'''
import sys
import os
THIRD_PARTY_PATH = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../third_party'))
if THIRD_PARTY_PATH ... | 113 | 41.1 | 117 | 16 | 1,285 | python | [] | 0 | true | |
2024-11-19T02:32:58.225069+00:00 | 1,611,601,920,000 | fdb1cb2be63171c416f07fa5e866a843fe655e3d | 4 | {
"blob_id": "fdb1cb2be63171c416f07fa5e866a843fe655e3d",
"branch_name": "refs/heads/master",
"committer_date": 1611601920000,
"content_id": "3acb2ac1dd17ca6cbbacbd4dcaa685603882119d",
"detected_licenses": [
"MIT"
],
"directory_id": "0e4d0ea19dfe64944b209f0faf4a3b1945837608",
"extension": "py",
"fi... | 3.671875 | stackv2 | """
Module: cgcheck
Imports from modules: sys, types, string, cgif (which imports from cgiftok)
Parse a file of conceptual graphs, and print a parse tree for each CG
that is syntactically correct. Otherwise, print an error message.
Separator between CGs must be a line containing nothing but "."
To run this program... | 51 | 34.45 | 75 | 14 | 433 | python | [] | 0 | true | |
2024-11-19T02:32:58.531500+00:00 | 1,676,139,610,000 | 040b627059edeaa79d851426fb8b3379a4335caa | 3 | {
"blob_id": "040b627059edeaa79d851426fb8b3379a4335caa",
"branch_name": "refs/heads/master",
"committer_date": 1676139610000,
"content_id": "7117735376850d33f8896683dc4dc01db7c9f06e",
"detected_licenses": [
"MIT"
],
"directory_id": "255e19ddc1bcde0d3d4fe70e01cec9bb724979c9",
"extension": "py",
"fi... | 2.96875 | stackv2 | #!/usr/bin/python
'''
This script finds missing string translations in Android applicaitons.
Author: Kostya Vasilyev. License: Creative Commons Attribution.
The output format is, I believe, more suitable to working with external
translators than the output of Lint from the Android SDK.
usage: find_missing_translati... | 271 | 30.25 | 106 | 23 | 2,225 | python | [] | 0 | true | |
2024-11-19T02:32:58.584608+00:00 | 1,512,971,222,000 | 8fb5506bb89f700d6af5a7028ba0905a5d756ed9 | 2 | {
"blob_id": "8fb5506bb89f700d6af5a7028ba0905a5d756ed9",
"branch_name": "refs/heads/master",
"committer_date": 1512971222000,
"content_id": "7e6ea6823811357beb6bbd1fc74f48416c586bc7",
"detected_licenses": [
"MIT"
],
"directory_id": "3095780892543de809c82d8eeb8f9949f44a7350",
"extension": "py",
"fi... | 2.34375 | stackv2 | # Author: Muhriddin Ismoilov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute,... | 270 | 33.57 | 125 | 15 | 2,703 | python | [] | 0 | true | |
2024-11-19T02:32:58.705957+00:00 | 1,547,395,070,000 | 9b2e6ada5318d7eecc9797368fa73b53fef11943 | 4 | {
"blob_id": "9b2e6ada5318d7eecc9797368fa73b53fef11943",
"branch_name": "refs/heads/master",
"committer_date": 1547395070000,
"content_id": "716ed0c895af059017004e547b52ba00cb48af73",
"detected_licenses": [
"MIT"
],
"directory_id": "b2a876358b25e056a861ed2749eeae0aa70f6611",
"extension": "py",
"fi... | 3.671875 | stackv2 |
class Argument:
"""Parses a python argument as string.
All whitespace before and after the argument text itself
is stripped off and saved for later reformatting.
"""
def __init__(self, original: str):
original.lstrip()
start = 0
end = len(original) - 1
while orig... | 49 | 27.69 | 98 | 14 | 313 | python | [] | 0 | true | |
2024-11-19T02:32:58.898099+00:00 | 1,619,724,489,000 | d484680ded022002de67f1a9861e25dd776c46e4 | 2 | {
"blob_id": "d484680ded022002de67f1a9861e25dd776c46e4",
"branch_name": "refs/heads/master",
"committer_date": 1619724489000,
"content_id": "bef6c7f359e4c53a6d90dda7bf62a2f8b163a2ed",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "61ac3b99bf55ff8b8ecf029eba8c40b23310644e",
"extension": "py"... | 2.5 | stackv2 | from flask import Flask, request, jsonify, render_template
import logging
import datetime as dt
from typing import Dict, List
from models import (
SELF_TEST_INPUT,
Descriptors600Model,
Word2vecModel,
Descriptors3000Model,
DescriptorsAllModel,
DescriptorsWithTaxonomiesModel,
JustTaxonomiesMo... | 109 | 32.35 | 104 | 14 | 943 | python | [{"finding_id": "codeql_py/stack-trace-exposure_f16c76ca8fa4db5a_0e450975", "tool_name": "codeql", "rule_id": "py/stack-trace-exposure", "finding_type": "path-problem", "severity": "medium", "confidence": "high", "message": "[Stack trace information](1) flows to this location and may be exposed to an external user.", "... | 1 | true | |
2024-11-19T02:32:59.022475+00:00 | 1,603,460,135,000 | d3f9752fb1ea2c2f23181a39c1fa62b39bb86211 | 3 | {
"blob_id": "d3f9752fb1ea2c2f23181a39c1fa62b39bb86211",
"branch_name": "refs/heads/master",
"committer_date": 1603460135000,
"content_id": "65cfd08da5f5fc6362284a1933da630c85914275",
"detected_licenses": [
"MIT"
],
"directory_id": "f047423891dce760479dc55ab6059bf011a27220",
"extension": "py",
"fi... | 3.359375 | stackv2 | from .__init__ import *
def divisionToIntFunc(maxA=25, maxB=25):
a = random.randint(1, maxA)
b = random.randint(1, maxB)
divisor = a * b
dividend = random.choice([a, b])
problem = f"{divisor}/{dividend} = "
solution = int(divisor / dividend)
return problem, solution
int_division = Gene... | 16 | 22.69 | 77 | 9 | 114 | python | [] | 0 | true | |
2024-11-19T02:32:59.077092+00:00 | 1,625,418,820,000 | d201926821d0b3e3676da21b2668e64231bbb36a | 3 | {
"blob_id": "d201926821d0b3e3676da21b2668e64231bbb36a",
"branch_name": "refs/heads/master",
"committer_date": 1625418820000,
"content_id": "183c71ac4d31d7a60267af3b2cbf2a036043ed51",
"detected_licenses": [
"MIT"
],
"directory_id": "f62b1cf082a372971a68b776a1733f61a0801349",
"extension": "py",
"fi... | 2.546875 | stackv2 | import numpy as np
import jax.numpy as jnp
# time line
T_min = 0
T_max = 60
T_R = 45
# discounting factor
beta = 1/(1+0.02)
# utility function parameter
gamma = 4
# relative importance of housing consumption and non durable consumption
alpha = 0.7
# parameter used to calculate the housing consumption
kappa = 0.3
# u... | 137 | 24.13 | 109 | 13 | 1,171 | python | [] | 0 | true | |
2024-11-19T02:32:59.245382+00:00 | 1,584,400,344,000 | 8929da3d2544582c1fcbbb07e7fbc60701574b54 | 3 | {
"blob_id": "8929da3d2544582c1fcbbb07e7fbc60701574b54",
"branch_name": "refs/heads/master",
"committer_date": 1584400344000,
"content_id": "6bf540dd48692b8497b1598650f8bc2d00973827",
"detected_licenses": [
"MIT"
],
"directory_id": "c3861c47b4948208840bc75c914f003b83f1df33",
"extension": "py",
"fi... | 2.59375 | stackv2 | import argparse
from trainer import Trainer
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--train-dataset-path', type=str,
default='data/coco_data', help='path to the training dataset')
parser.add_argument('-e', '--epochs', type=int,
... | 35 | 52.89 | 117 | 9 | 443 | python | [] | 0 | true | |
2024-11-19T02:32:59.307294+00:00 | 1,601,574,671,000 | cccd623d644d05c3acaa3d7e43332a364011d8c6 | 2 | {
"blob_id": "cccd623d644d05c3acaa3d7e43332a364011d8c6",
"branch_name": "refs/heads/main",
"committer_date": 1601574671000,
"content_id": "f8260bbd04420c90b0d37505dcd3c1817826455e",
"detected_licenses": [
"MIT"
],
"directory_id": "88cc70da2c0f802d874dc4875928e6e04cb0f038",
"extension": "py",
"file... | 2.359375 | stackv2 | import signal
import sys
import time
import numpy as np
from matplotlib import animation
from matplotlib import pyplot as plt
from xwr18xx.xwr18xx import XWR18xx
from xwr18xx.tlv import MmwDemoOutputMessageType
from tabulate import tabulate
# For unix systems
xwr = XWR18xx('range_doppler.cfg', '/dev/ttyACM0', '/dev/tt... | 68 | 22.91 | 106 | 14 | 455 | python | [] | 0 | true | |
2024-11-19T02:32:59.369984+00:00 | 1,528,475,992,000 | 53903801c82a7168df676797867e6c90922f0096 | 2 | {
"blob_id": "53903801c82a7168df676797867e6c90922f0096",
"branch_name": "refs/heads/master",
"committer_date": 1528475992000,
"content_id": "9b240b3cbd14313489cc3c215c8c0f09cf91cf54",
"detected_licenses": [
"MIT"
],
"directory_id": "eaa39da354769a84e48c3d1b59ee24c49d365b36",
"extension": "py",
"fi... | 2.46875 | stackv2 | #!/usr/bin/env python
import max7219.led as led
from max7219 import font
import rospy
from mt_led_matrix.msg import Buffer
from std_msgs.msg import String, UInt8
# See https://max7219.readthedocs.io/en/0.2.3/max7219.html#max7219.led.device.brightness
class LedMatrix(object):
"""docstring for LedMatrix."""
... | 48 | 30.9 | 95 | 19 | 374 | python | [] | 0 | true | |
2024-11-19T02:32:59.563344+00:00 | 1,620,497,102,000 | 3a8b1a175d791985de4086b6c3e26f4b7833bdbe | 3 | {
"blob_id": "3a8b1a175d791985de4086b6c3e26f4b7833bdbe",
"branch_name": "refs/heads/main",
"committer_date": 1620497102000,
"content_id": "7685169ad45f68cfa2da0dfff0288f8c7e3dea9c",
"detected_licenses": [
"MIT"
],
"directory_id": "fdffb7d7e3739ea081db43bf2ba489c9c85cdc2e",
"extension": "py",
"file... | 3.03125 | stackv2 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.10.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # 1章 データについて
import pandas ... | 26 | 17.23 | 83 | 8 | 174 | python | [] | 0 | true | |
2024-11-19T02:32:59.607217+00:00 | 1,660,803,454,000 | f0b80d1b33f9ab4a6724c8c77af4e1c5c242ab8f | 4 | {
"blob_id": "f0b80d1b33f9ab4a6724c8c77af4e1c5c242ab8f",
"branch_name": "refs/heads/master",
"committer_date": 1660803454000,
"content_id": "4f813c7c958b24134d5e3d011f05424e9f3766e3",
"detected_licenses": [
"MIT"
],
"directory_id": "d9d71082f7baa4036ced8a7030f4ab62b9e88fce",
"extension": "py",
"fi... | 3.640625 | stackv2 | import pytest
import math
from typing import List
import numpy as np
def find_first_nonnegative(ar, ibegin=None, iend=None):
if ibegin == None:
ibegin = 0
if iend == None:
iend = len(ar) - 1
if ibegin > iend:
return -1
# Find a middle
m = ibegin + (iend - ibegin + 1) // 2... | 63 | 27.84 | 72 | 14 | 555 | python | [] | 0 | true | |
2024-11-19T02:32:59.794504+00:00 | 1,551,992,665,000 | d23f9db6638f5d4b697389962b9d052a437124bd | 3 | {
"blob_id": "d23f9db6638f5d4b697389962b9d052a437124bd",
"branch_name": "refs/heads/master",
"committer_date": 1551992665000,
"content_id": "d26c35c10d165cf8c24c4bafb0434973eb5e7475",
"detected_licenses": [
"MIT"
],
"directory_id": "44c83bf34df7274e555e571dab71755f1e61e138",
"extension": "py",
"fi... | 2.953125 | stackv2 | import argparse
import glob
import imageio
import os
import joblib
import numpy as np
def dir_to_npy(dir, save=False, outfile=None):
"""
This will convert a directory of png images to a single npy file
Parameters
----------
dir : string, directory containing png files
save : boolean, if true... | 80 | 33.86 | 79 | 18 | 635 | python | [] | 0 | true | |
2024-11-19T02:32:59.902088+00:00 | 1,660,824,171,000 | 028342a7e48bc8afd12ce4f86eb13ee12cbc42e3 | 3 | {
"blob_id": "028342a7e48bc8afd12ce4f86eb13ee12cbc42e3",
"branch_name": "refs/heads/master",
"committer_date": 1660824171000,
"content_id": "7a43007cea08c750216187cb894be38c41ef8fae",
"detected_licenses": [
"MIT"
],
"directory_id": "301e55ee3990b2daf135197eac81e1cc244e6cd3",
"extension": "py",
"fi... | 3.4375 | stackv2 | import collections
from typing import List
class Solution:
# BFS approach
# Time complexity: O(V) where V is the length of the array. The indices are considered the nodes of the graph
# Space complexity: O(V)
# Note: If we don't properly optimize it the complexity becomes O(V + E) where E could be V^2
... | 46 | 35.54 | 113 | 17 | 382 | python | [] | 0 | true | |
2024-11-19T02:33:00.285699+00:00 | 1,693,279,054,000 | 99d5ffc1dc9863a9df664557a9d01279f3139c50 | 2 | {
"blob_id": "99d5ffc1dc9863a9df664557a9d01279f3139c50",
"branch_name": "refs/heads/master",
"committer_date": 1693279054000,
"content_id": "7a7bfacf377a496645f157c2cfee6c920b2256c3",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "f1f4cbe62b4ceca683e6e2d82942ed44858e6858",
"extension": "py"... | 2.359375 | stackv2 | import config
import file_utils
from collections import OrderedDict
def generate(models):
types = set()
for model in models.values():
for key, value in model.allitems():
if key == 'property':
name = value.get('name')
type = value.get('type')
... | 51 | 28.55 | 102 | 19 | 333 | python | [] | 0 | true | |
2024-11-19T02:33:00.534995+00:00 | 1,490,051,018,000 | 43e8cf9fb22c3dcb5eb97311725371b7166b338a | 2 | {
"blob_id": "43e8cf9fb22c3dcb5eb97311725371b7166b338a",
"branch_name": "refs/heads/master",
"committer_date": 1490051018000,
"content_id": "cb2a108643f8ddf46fb1129ec9f9aea31ed33099",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "499590ea19cc3d86fe135cffbd34bca1d211811e",
"extension": "py"... | 2.390625 | stackv2 | """ Kotta Library
This module provides a simple interface to the Cloud Kotta system. In addition to the batch-like
submit model, a decorator ``@kottajob`` is provided that allows the user to wrap a python function
and execute it remotely on Cloud Kotta.
"""
import logging
from kotta.kotta import Kotta
from kotta.kott... | 45 | 25.47 | 98 | 9 | 289 | python | [] | 0 | true | |
2024-11-19T02:33:00.614911+00:00 | 1,657,466,043,000 | 77aebb1b358803e708d5ee8899023c1c84cb4c02 | 3 | {
"blob_id": "77aebb1b358803e708d5ee8899023c1c84cb4c02",
"branch_name": "refs/heads/master",
"committer_date": 1657466043000,
"content_id": "170ec9e8cca8ba9133181294df4d53f9cd197250",
"detected_licenses": [
"MIT"
],
"directory_id": "ae8e570e61b268fdf6cabc30ef32788b1d12d4da",
"extension": "py",
"fi... | 2.8125 | stackv2 | import numpy as np
import pandas as pd
import sklearn
from scipy.stats import norm
from scipy.stats import multivariate_normal
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import seaborn as sns
from functions import estimate_gaussian_params, train_validation_splits, selectThreshold, me... | 65 | 29.66 | 97 | 10 | 528 | python | [] | 0 | true | |
2024-11-19T02:33:00.654770+00:00 | 1,689,942,878,000 | af3373e41e032d299225c135b9d4071c29d05bbe | 4 | {
"blob_id": "af3373e41e032d299225c135b9d4071c29d05bbe",
"branch_name": "refs/heads/master",
"committer_date": 1689942878000,
"content_id": "0528264915ff962d71c96dfb3bdc5e92572df3a6",
"detected_licenses": [],
"directory_id": "35cd401ef876bec39366e5724bae71581c0cb658",
"extension": "py",
"filename": "uti... | 3.5 | stackv2 | """
Contains the following helper blocks:
- :class:`BlockSignal`: an exception that allows a block to signal
something (e.g., an error condition) to its parent.
- :class:`SignalBlock`: a block that raises a signal if an error
is raised.
- :class:`LambdaBlock`: a stateless block that simply runs a fixed
function... | 180 | 29.38 | 79 | 14 | 1,311 | python | [] | 0 | true | |
2024-11-19T02:33:01.203497+00:00 | 1,626,675,374,000 | 14414198938f902b73954d90c4a4b4da7e25710d | 3 | {
"blob_id": "14414198938f902b73954d90c4a4b4da7e25710d",
"branch_name": "refs/heads/main",
"committer_date": 1626675374000,
"content_id": "711da6fec49482c15c9d5ca0b0ecb5a827a7c4c8",
"detected_licenses": [
"MIT"
],
"directory_id": "1391f5810eda1c011803515e056bdd54c58ead06",
"extension": "py",
"file... | 3.328125 | stackv2 | """Validate an input string.
This module provides the necessary functions to validate boxes in BoxScript code.
Attributes:
ADJACENT (dict[str, dict[str, str]]): A dictionary of borders and their allowed
neighbors, organized by relative cardinal location.
CHARACTERS (str): The set of valid characters i... | 173 | 33.73 | 88 | 17 | 2,119 | python | [] | 0 | true | |
2024-11-19T02:33:01.671309+00:00 | 1,557,856,975,000 | 3955f73b5c296ae8bf38f1c54fc95cdc02e4f89b | 3 | {
"blob_id": "3955f73b5c296ae8bf38f1c54fc95cdc02e4f89b",
"branch_name": "refs/heads/master",
"committer_date": 1557856975000,
"content_id": "e61bc6e7e8a74397522db0eb592d916fe3a36f8b",
"detected_licenses": [
"MIT"
],
"directory_id": "ed8a82afb78c87e7c9f3514306daaeb88440406d",
"extension": "py",
"fi... | 3.140625 | stackv2 | class Solution(object):
def kEmptySlots(self, flowers, k):
"""
:type flowers: List[int]
:type k: int
:rtype: int
"""
status = [0 for _ in range(len(flowers))]
for i in range(len(flowers)):
status[flowers[i]] = 1
l, m, count = flowers[i]... | 24 | 31 | 67 | 15 | 206 | python | [] | 0 | true | |
2024-11-19T02:33:01.728923+00:00 | 1,561,627,862,000 | 10b18f2a5a2244b8e4b61e6edcfaf502e77bcfa1 | 3 | {
"blob_id": "10b18f2a5a2244b8e4b61e6edcfaf502e77bcfa1",
"branch_name": "refs/heads/master",
"committer_date": 1561627862000,
"content_id": "c36e1a3e14b4c4b032292d4e429c5cee4e512ee5",
"detected_licenses": [
"MIT"
],
"directory_id": "55b65327bc98d1aaa77491e4307f0543b6361bd3",
"extension": "py",
"fi... | 2.59375 | stackv2 | from __future__ import absolute_import
class CustomType(object):
pass
class SpecialType(CustomType):
def __init__(self, base_type):
self.base_type = base_type
class Enum(SpecialType):
def __init__(self, options):
super(Enum, self).__init__(str)
self.options = options
def __... | 71 | 24.39 | 78 | 12 | 452 | python | [] | 0 | true | |
2024-11-19T02:33:01.835389+00:00 | 1,632,972,656,000 | d52c37cadef83ee27d495e26098af6b93193cd77 | 2 | {
"blob_id": "d52c37cadef83ee27d495e26098af6b93193cd77",
"branch_name": "refs/heads/main",
"committer_date": 1632972656000,
"content_id": "a00af255afb793edb78c44ee9d28c082413158a9",
"detected_licenses": [
"BSD-3-Clause"
],
"directory_id": "3abf632ec240bc5577729d920f5c54a1ecfcb337",
"extension": "py"... | 2.46875 | stackv2 | import os
from mayavi import mlab
import numpy as np
import torch
import torch.autograd as ag
from common import tensor
from spinn2d import Plotter2D, App2D, SPINN2D
from pde2d_base import RegularPDE
class CavityPDE(RegularPDE):
def __init__(self, n_nodes, ns, nb=None, nbs=None, sample_frac=1.0):
self.sa... | 211 | 31.49 | 76 | 17 | 2,148 | python | [] | 0 | true | |
2024-11-19T02:33:01.960430+00:00 | 1,482,569,062,000 | 81ffd05f84da015a11c9a88073adbdc0124f81fb | 3 | {
"blob_id": "81ffd05f84da015a11c9a88073adbdc0124f81fb",
"branch_name": "refs/heads/master",
"committer_date": 1482569062000,
"content_id": "c1d1fbd69384ad77d438b8694d265e8e56cc60cf",
"detected_licenses": [
"MIT"
],
"directory_id": "a088482aa63b584cf5368bae60a1bf9f3d498d1a",
"extension": "py",
"fi... | 2.796875 | stackv2 | import sys
import re
import itertools as i
import six
class IP:
pass
def chunks(n, input):
for i in range(0, len(input), n):
yield input[i:i + n]
def parse_ip(line):
ret = IP()
(ret.supers, ret.hypers) = six.moves.zip_longest(
*chunks(2, re.split(r'[][]', line)), fillvalue='')
ret... | 53 | 22.36 | 69 | 14 | 365 | python | [] | 0 | true | |
2024-11-19T02:33:02.131772+00:00 | 1,692,207,092,000 | 16f374e03cf86bd89b3dfb7d609fb35a26de7202 | 2 | {
"blob_id": "16f374e03cf86bd89b3dfb7d609fb35a26de7202",
"branch_name": "refs/heads/master",
"committer_date": 1692207092000,
"content_id": "b2167557ab9894f0c504cf77e48fb86f5a2ad204",
"detected_licenses": [
"Apache-2.0"
],
"directory_id": "30dd4bdf3c18f3b6aa9b0c858043d61b571e2e10",
"extension": "py"... | 2.40625 | stackv2 | #!/usr/bin/env python3
from os import environ, listdir, mkdir
from os.path import isdir, exists, join
from shutil import copytree, make_archive, rmtree
from sys import argv, exit
from jinja2 import Environment, FileSystemLoader
SRCDIR = '../src'
DISTDIR = '../_dist'
ARTIFACT_PREFIX = 'kubestack-starter-'
def repla... | 92 | 31.72 | 78 | 14 | 668 | python | [{"finding_id": "codeql_py/jinja2/autoescape-false_cf8e933136eb1835_02e437ed", "tool_name": "codeql", "rule_id": "py/jinja2/autoescape-false", "finding_type": "problem", "severity": "medium", "confidence": "medium", "message": "Using jinja2 templates with autoescape=False can potentially allow XSS attacks.", "remediati... | 1 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.