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-18T20:48:13.763592+00:00
1,578,126,095,000
ee0ed0abe88cff35ba113e95541ae91d735643e4
2
{ "blob_id": "ee0ed0abe88cff35ba113e95541ae91d735643e4", "branch_name": "refs/heads/master", "committer_date": 1578126095000, "content_id": "608a8bc7880752ea123e09514ab6a15dd15848d0", "detected_licenses": [ "MIT" ], "directory_id": "db9bfa96f739f1a699377e3c05f1c0783d7b0927", "extension": "py", "fi...
2.421875
stackv2
import os import codecs import sys from shutil import rmtree from setuptools import setup, find_packages, Command here = os.path.abspath(os.path.dirname(__file__)) # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's ea...
69
27.2
79
14
447
python
[]
0
true
2024-11-18T20:48:13.841016+00:00
1,599,140,775,000
e84e6f6110f1975279605bae2f332f34c9ed5800
3
{ "blob_id": "e84e6f6110f1975279605bae2f332f34c9ed5800", "branch_name": "refs/heads/master", "committer_date": 1599140775000, "content_id": "e04dae4718d524d217847b640a6350229a0d4ea6", "detected_licenses": [ "MIT" ], "directory_id": "942d19049ff1620a85102cc2b9ad4439f28487b9", "extension": "py", "fi...
2.546875
stackv2
import new from monocle.stack.eventloop import queue_task from monocle.callback import Callback def next_tick(): cb = Callback() cb(None) return cb def immediate(val): cb = Callback() cb(val) return cb def delayed(seconds, val): cb = Callback() queue_task(seconds, cb, val) ret...
44
17.64
57
14
205
python
[]
0
true
2024-11-18T20:48:13.901693+00:00
1,589,434,531,000
1723a340e95faf5909ab8ade084224b35356bb6c
2
{ "blob_id": "1723a340e95faf5909ab8ade084224b35356bb6c", "branch_name": "refs/heads/master", "committer_date": 1589434531000, "content_id": "e15208358d8f3be83850e04136d866bc553cfeee", "detected_licenses": [ "MIT" ], "directory_id": "21bc3b8fc76ca5af2870bf7f62a22b43fab3b4f8", "extension": "py", "fi...
2.484375
stackv2
from typing import Dict, Any, Optional import re from atcodertools.codegen.code_style_config import CodeStyleConfig from atcodertools.fmtprediction.models.format import Pattern, SingularPattern, ParallelPattern, TwoDimensionalPattern, \ Format from atcodertools.fmtprediction.models.type import Type from atcodertoo...
388
44.99
120
25
3,127
python
[]
0
true
2024-11-18T20:48:14.022724+00:00
1,691,758,963,000
669ca3385a01e28a89cf03716a4b45c00d03c712
4
{ "blob_id": "669ca3385a01e28a89cf03716a4b45c00d03c712", "branch_name": "refs/heads/master", "committer_date": 1691758963000, "content_id": "8406abb0718113d6e367f8e70422644220b14e34", "detected_licenses": [ "MIT" ], "directory_id": "751d837b8a4445877bb2f0d1e97ce41cd39ce1bd", "extension": "py", "fi...
4.4375
stackv2
#!/usr/bin/env python """ Challenge So, um, it seems that, while we have plenty of challenges that work with square numbers or numbers of other shapes, we don't have one that simply asks: Given an integer n (where n>=0) as input return a truthy value if n is a perfect square or a falsey value if not. Rules You may ...
47
24.13
152
10
332
python
[]
0
true
2024-11-18T20:48:14.208961+00:00
1,630,098,373,000
b49e8e8889cd5444edcce2728ef75bf904e989a9
2
{ "blob_id": "b49e8e8889cd5444edcce2728ef75bf904e989a9", "branch_name": "refs/heads/main", "committer_date": 1630098373000, "content_id": "d701818d70d36f314bbf61c2798d9c72ae93e34a", "detected_licenses": [ "MIT" ], "directory_id": "7343b74ea3d783ddf43816e207671c3324ae841b", "extension": "py", "file...
2.453125
stackv2
from .ping import Ping def init_app(app): """ I'm using init_app to call the app.load_extension function because if I just call the setup function directly, the extension name would not be added to the __extensions attribute of the app. """ app.load_extension(__name__) def setup(app): module...
20
23.25
102
10
113
python
[]
0
true
2024-11-18T20:48:14.526932+00:00
1,692,365,125,000
317198ef9d9b866d97ce62fb0d81b4b341f1edd2
3
{ "blob_id": "317198ef9d9b866d97ce62fb0d81b4b341f1edd2", "branch_name": "refs/heads/master", "committer_date": 1692365125000, "content_id": "7212cb66957e5a5e9126f4cb364c4955d4c97d7b", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "fe5d16cef63488c5ef3f73be54a0981243288d1d", "extension": "p...
3.171875
stackv2
#!/usr/bin/env python """ Checker for repeated tokens ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Helper script to find suspicious lexers which produce the same token repeatedly, i.e. for example: .. code:: 'd' Text 'a' Text 't' Text 'a' Text ...
78
29.05
79
13
505
python
[]
0
true
2024-11-18T20:48:15.050884+00:00
1,606,420,219,000
b4780df87fef3012376512efda3a5dfc297cd1d5
4
{ "blob_id": "b4780df87fef3012376512efda3a5dfc297cd1d5", "branch_name": "refs/heads/main", "committer_date": 1606420219000, "content_id": "2363a1fefe6f667ffed06e66bc59751693404c2c", "detected_licenses": [ "MIT" ], "directory_id": "9834875740c6fa5218dd26a75b12a8fbc2ed39d2", "extension": "py", "file...
4.4375
stackv2
''' String = cadeira de caracter = frase Para cada caracter é denominado um indice começado em 0, sendo o espaço é contado maiusculo e diferenciado de minusculo ''' frase='Teste para a video aula' print(frase[9]) #ira ate o indice 12, o final é sempre -1 print(frase[9:15]) # imprime pulando de 2 em 2 print(frase[9:2...
79
22.65
81
9
581
python
[]
0
true
2024-11-18T20:48:15.170765+00:00
1,615,321,907,000
031d5690811f5547c32f86396aead5fcff9f5336
4
{ "blob_id": "031d5690811f5547c32f86396aead5fcff9f5336", "branch_name": "refs/heads/main", "committer_date": 1615321907000, "content_id": "7d9ace8b14bebdbfb88fd52a709113b97c75ce65", "detected_licenses": [ "MIT" ], "directory_id": "8c9c3e0290d711769aa49fe74efddd71364e2d8a", "extension": "py", "file...
4.34375
stackv2
n = int(input('Digite um número inteiro: ')) maior = menor = n contador = 1 continuar = str(input('Deseja continuar? (S/N): ')) while continuar in 'Ss': n1 = int(input('Digite um número inteiro: ')) n += n1 contador += 1 continuar = str(input('Deseja continuar? (S/N): ')) if n1 > maior: maio...
17
32.82
71
11
168
python
[]
0
true
2024-11-18T20:48:15.213224+00:00
1,597,078,699,000
eb6c8ec581c9fd64a97b183a4753c1705b20252e
3
{ "blob_id": "eb6c8ec581c9fd64a97b183a4753c1705b20252e", "branch_name": "refs/heads/master", "committer_date": 1597078699000, "content_id": "9e9d4625c30bf3b002bc686e06b55bac2dcf34ad", "detected_licenses": [ "MIT" ], "directory_id": "c7e4ac2dabeb251858756e44b9a0f309ada05fb0", "extension": "py", "fi...
3.15625
stackv2
''' author: Anmol Durgapal || @slothfulwave612 A Python module for plotting radar-chart. The radar-chart theme is inspired from @Statsbomb. ''' ## import necessary packages/modules import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Polygon from . import utils def plot_radar(ranges, p...
349
34.17
155
18
3,065
python
[]
0
true
2024-11-18T20:48:15.270582+00:00
1,606,469,576,000
47b7a18570c895d6f1538b3769778a96fd830dc6
4
{ "blob_id": "47b7a18570c895d6f1538b3769778a96fd830dc6", "branch_name": "refs/heads/main", "committer_date": 1606469576000, "content_id": "30009b32d0d01e0e83139c3d03b7195d5dea2818", "detected_licenses": [ "MIT" ], "directory_id": "f219b8c35d2c5e2a6a50fd529a5a952f7230e3e6", "extension": "py", "file...
3.890625
stackv2
import random from consts import * class Game(object): def __init__(self, length=GAME_LENGTH): self.length = length self.initial = [] self.turns = 0 self.is_won = False self.is_ended = False # process the initial state of colors while len(self.initial) < sel...
72
31.29
111
16
524
python
[]
0
true
2024-11-18T20:48:15.427121+00:00
1,620,723,556,000
bc10d8fa683766f0e436da4aa3c8ff5dca4808f1
3
{ "blob_id": "bc10d8fa683766f0e436da4aa3c8ff5dca4808f1", "branch_name": "refs/heads/master", "committer_date": 1620723556000, "content_id": "2c69bb84c201cc69513e3add759ccc2b8008379f", "detected_licenses": [ "MIT" ], "directory_id": "62096e1511805b49fb8027fb31e55a51ce6e599b", "extension": "py", "fi...
3
stackv2
import random from typing import Dict, List, Union, Tuple from pypokerengine.utils.card_utils import estimate_hole_card_win_rate, gen_cards from pypokerengine.players import BasePokerPlayer NB_SIMULATION = 1000 class BaselinePlayer(BasePokerPlayer): """ Documentation for callback arguments given here: h...
91
43.27
125
17
867
python
[]
0
true
2024-11-18T20:48:15.554800+00:00
1,588,050,274,000
d7bf9963039149ced723adbaf4d0d72dd7a14bad
2
{ "blob_id": "d7bf9963039149ced723adbaf4d0d72dd7a14bad", "branch_name": "refs/heads/master", "committer_date": 1588050274000, "content_id": "faa834cb80f3bbf808757c4149d9aad501d3288e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "04eeda7d8ab415eb68921eb35ca310efdcad2180", "extension": "py"...
2.484375
stackv2
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from config import DATABASE_URI from models import Base, CVE, CPE, Junction class Database: def __init__(self): self.engine = create_engine(DATABASE_URI) self.connection = self.engine.connect() self.Session = ses...
42
26.6
53
12
240
python
[]
0
true
2024-11-18T20:48:15.604429+00:00
1,546,137,507,000
9ed7e8635d5a8f3b2f7b0a27ac0f693c63a144a5
3
{ "blob_id": "9ed7e8635d5a8f3b2f7b0a27ac0f693c63a144a5", "branch_name": "refs/heads/master", "committer_date": 1546137507000, "content_id": "f71b599c49ef3382050c2d01eff0c192906c1d7b", "detected_licenses": [ "MIT" ], "directory_id": "553952885882cecd83680aaebc0d28b1aa1d32fe", "extension": "py", "fi...
3
stackv2
""" The player's AI code Functions here are called by clock.py to run the AI code """ import random import math from clientLogic.logging import logPrint from clientLogic import clientData, commands def onConnect(): """ Called when the player initially connects to the server but before the tank first spaw...
56
27.21
92
17
367
python
[]
0
true
2024-11-18T20:48:15.719384+00:00
1,381,272,885,000
b76e76cc40a1b062f0bdc347856fb9dbb2b50321
3
{ "blob_id": "b76e76cc40a1b062f0bdc347856fb9dbb2b50321", "branch_name": "refs/heads/master", "committer_date": 1381272885000, "content_id": "0a867ba4a357b1e368f889b9903c3c0336c582fc", "detected_licenses": [ "Apache-2.0" ], "directory_id": "fa01f015df46f02a748a475c45146d3ed69be5be", "extension": "py"...
2.59375
stackv2
from xml.dom import minidom import html5lib import symboltypes import flags import linkify def GenerateHtmlDocs(namespace_map): for filepath, document in GenerateDocuments(namespace_map): content = document.documentElement.toxml('utf-8') yield filepath, content def GenerateDocuments(namespace_map): for ...
291
29.6
83
15
1,985
python
[]
0
true
2024-11-18T20:48:15.782866+00:00
1,435,497,628,000
69c8d7607e793e0c36344b1360e8c5d6a6c48bf0
3
{ "blob_id": "69c8d7607e793e0c36344b1360e8c5d6a6c48bf0", "branch_name": "refs/heads/master", "committer_date": 1435497628000, "content_id": "3dd7797815f7935b1da433f6e41f5070a1284fab", "detected_licenses": [ "MIT" ], "directory_id": "a09a8cd9e52918c587b55a5c0587330f6b00e244", "extension": "py", "fi...
2.8125
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def _collect_edges(graph): from itertools import product result = [] for (u, v) in product(range(len(graph)), range(len(graph))): if graph[u][v] != 0: result.append((u, v)) return result def _detect_nwc_for_src(graph): if len(gr...
150
27.65
79
19
1,315
python
[]
0
true
2024-11-18T20:48:15.954551+00:00
1,613,645,886,000
f05706e475c266189ffd8f94499a3f3251859c1d
3
{ "blob_id": "f05706e475c266189ffd8f94499a3f3251859c1d", "branch_name": "refs/heads/master", "committer_date": 1613645886000, "content_id": "a7a0838db8deac46bfcb2530484a83ee47ff7099", "detected_licenses": [ "MIT" ], "directory_id": "fe72c322c894a4212edb576f8e826c54dfbc5490", "extension": "py", "fi...
2.625
stackv2
# asyncio version # The MIT License (MIT) # # Copyright (c) 2016, 2017 Robert Hammelrath (basic driver) # 2016 Peter Hinch (asyncio extension) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
176
41.01
105
21
1,958
python
[]
0
true
2024-11-18T20:48:16.319868+00:00
1,685,468,889,000
bb42dffff228071752c3ae699460db6bb065454e
4
{ "blob_id": "bb42dffff228071752c3ae699460db6bb065454e", "branch_name": "refs/heads/master", "committer_date": 1685468889000, "content_id": "43ee1d4b0f5fd09b8583052db30dee40c388a21c", "detected_licenses": [ "MIT" ], "directory_id": "9e1f60a867f66b1f4e4fc84fa4252c581e5e1a36", "extension": "py", "fi...
4.03125
stackv2
"""Clean Code in Python - Chapter 6: Descriptors > A Pythonic Implementation """ class HistoryTracedAttribute: """Trace the values of this attribute into another one given by the name at ``trace_attribute_name``. """ def __init__(self, trace_attribute_name: str) -> None: self.trace_attribut...
85
28.28
79
13
577
python
[]
0
true
2024-11-18T20:48:16.369205+00:00
1,630,409,346,000
1c84b42379b83d7111a86f83512561654894268d
3
{ "blob_id": "1c84b42379b83d7111a86f83512561654894268d", "branch_name": "refs/heads/master", "committer_date": 1630409346000, "content_id": "1e6f97adac7ed842e97eeddb23e22199fdf8e06b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2cd54a665f5387947550f24168e3e133d938800b", "extension": "py"...
2.75
stackv2
import numpy as np import gym import matplotlib.pyplot as plt import seaborn as sns import os, time import threading sns.set() ep_rewards = [] def run_episodes(env, number_episodes, max_steps): for episode in range(number_episodes): obs = env.reset() ep_score = 0 for t in range(max_steps...
52
25.21
115
14
342
python
[]
0
true
2024-11-18T20:48:16.419174+00:00
1,598,184,895,000
36b87a72365d94b5bfa89e963edcf93f413a44eb
3
{ "blob_id": "36b87a72365d94b5bfa89e963edcf93f413a44eb", "branch_name": "refs/heads/master", "committer_date": 1598184895000, "content_id": "243ee4496ee2e597ac8eeb4b367c02ebdc967f3d", "detected_licenses": [ "MIT" ], "directory_id": "d09b06ab29e7bd1acb4ab544ccc8573560c37e58", "extension": "py", "fi...
2.765625
stackv2
from find_landings import all_landings import numpy as np from direct_keys import * import time from figures import piece_weight, find_figure from digit import get_field import keyboard FIELD_SIZE = [20, 10] class AI: def __init__(self, play_safe): self.play_safe = play_safe self.start_time = tim...
288
34.65
129
20
2,646
python
[]
0
true
2024-11-18T20:48:16.935169+00:00
1,421,257,246,000
05db36c7f8770199d339d33c3318e65793ceb2e3
3
{ "blob_id": "05db36c7f8770199d339d33c3318e65793ceb2e3", "branch_name": "refs/heads/master", "committer_date": 1421257246000, "content_id": "dc0d7b417641df65cf32bdb75d1c81ca0e4005c5", "detected_licenses": [ "MIT" ], "directory_id": "e20ed90b9be7a0bcdc1603929d65b2375a224bf6", "extension": "py", "fi...
2.5625
stackv2
from netapp.netapp_object import NetAppObject class SystemImagePackageAttributes(NetAppObject): """ These attributes provide details about the software packages available on the system. When returned as part of the output, all elements of this typedef are reported, unless limited by a set of desire...
65
29.83
89
13
446
python
[]
0
true
2024-11-18T20:48:17.162805+00:00
1,508,909,596,000
55f1789b2faa99731f180bd770defbad490d1188
3
{ "blob_id": "55f1789b2faa99731f180bd770defbad490d1188", "branch_name": "refs/heads/master", "committer_date": 1508909596000, "content_id": "d2ec3c32bd4159034b29639bd5d12a9aa59c4b76", "detected_licenses": [ "MIT" ], "directory_id": "eabbc9604e7454c25c542450e89ea397f137b8ae", "extension": "py", "fi...
3.4375
stackv2
from zope.interface import Interface, Attribute class IStudent(Interface): """ Интерфейс компонент, представляющих студентов """ name = Attribute("Имя студента") code = Attribute("Номер зачетки") group = Attribute("Группа, к которой приписан студент или None") def add_to_group(group): ...
49
18.8
68
9
223
python
[]
0
true
2024-11-18T20:48:17.214254+00:00
1,644,337,681,000
2c9934c01ecea5ef6840b059708b5ee8d4a55d1f
3
{ "blob_id": "2c9934c01ecea5ef6840b059708b5ee8d4a55d1f", "branch_name": "refs/heads/master", "committer_date": 1644388851000, "content_id": "2721f9a146814ca07bb8ad470ac98f943b5413f1", "detected_licenses": [ "Apache-2.0" ], "directory_id": "b39b31269db70d72d57959feaa0b063eb2b37e12", "extension": "py"...
2.90625
stackv2
from app.util.log import get_logger from app.util.ordered_set_queue import OrderedSetQueue from app.util.safe_thread import SafeThread from app.master.slave import SlaveMarkedForShutdownError class SlaveAllocator(object): """ The SlaveAllocator class is responsible for allocating slaves to prepared builds. ...
69
40.7
114
16
542
python
[]
0
true
2024-11-18T20:48:17.307807+00:00
1,693,347,563,000
f6bd573d871655223faa2f99276f2b4ec5043dae
3
{ "blob_id": "f6bd573d871655223faa2f99276f2b4ec5043dae", "branch_name": "refs/heads/master", "committer_date": 1693347563000, "content_id": "32f3fc92097ddb3bcda1f08da125af7cfe9a36ea", "detected_licenses": [ "Apache-2.0", "MIT" ], "directory_id": "c085f61a0f9da8ccd2f56ab9142799a4dcfd1052", "exten...
3.03125
stackv2
from functools import total_ordering from .base import PydeckType @total_ordering class Function(PydeckType): """Indicate a function type with arguments and set already in pydeck Parameters ---------- name : str Function name **kwargs arguments and value of each argument to be s...
34
20.97
83
12
173
python
[]
0
true
2024-11-18T20:48:17.355613+00:00
1,526,596,684,000
8f02c58cc927da28edc6dfa1cd2f1e715f027a61
3
{ "blob_id": "8f02c58cc927da28edc6dfa1cd2f1e715f027a61", "branch_name": "refs/heads/master", "committer_date": 1526596684000, "content_id": "b631b8bfb8e823aa046621de4836f200a1e8cebd", "detected_licenses": [ "MIT" ], "directory_id": "f203fbdb0e3d1be3c5d43e78faeada6b2c15cd34", "extension": "py", "fi...
2.96875
stackv2
""" Script plots the multi-observational data set mean to demonstrate changing moving averages (# of months) Notes ----- Author : Zachary Labe Date : 10 May 2018 """ ### Import modules import numpy as np import matplotlib.pyplot as plt import matplotlib import nclcmaps as ncm import datetime import cmocean ...
143
29.32
83
13
1,154
python
[]
0
true
2024-11-18T20:48:17.404862+00:00
1,583,793,809,000
6f2a3ec9eb2df1b702abdb7373268d0600f69fa6
2
{ "blob_id": "6f2a3ec9eb2df1b702abdb7373268d0600f69fa6", "branch_name": "refs/heads/master", "committer_date": 1583793809000, "content_id": "72fcafe7ebe80bfe9e47699eab467e703dd2ac7b", "detected_licenses": [ "MIT" ], "directory_id": "9bb22edc4cd39c5d4d689a13abff0fc9ed66af9f", "extension": "py", "fi...
2.453125
stackv2
import csv import datetime as dt import requests from discord.ext import commands from typing import List import asyncio import logging import os import discord import src.utils as utils from src.plotting import plot_csv from src.database import db logger = logging.getLogger("covid-19") class AutoUpdater(commands....
128
38.3
161
20
1,098
python
[]
0
true
2024-11-18T20:48:17.489714+00:00
1,457,928,896,000
11b75ccb3fdedf546c5aea49970fcd65798049b5
4
{ "blob_id": "11b75ccb3fdedf546c5aea49970fcd65798049b5", "branch_name": "refs/heads/master", "committer_date": 1457928896000, "content_id": "d59da32090e652aeedc6e1836709c4b457507d8e", "detected_licenses": [ "MIT" ], "directory_id": "f3fb929efff8168a89ffb09a25c5f20136ea6b11", "extension": "py", "fi...
4.375
stackv2
""" An Armstrong number is an n-digit number that is equal to the sum of the n'th powers of its digits. Determine if the input numbers are Armstrong numbers. INPUT SAMPLE: Your program should accept as its first argument a path to a filename. Each line in this file has a positive integer. E.g. 6 153 351 OUTPUT SAMP...
46
20.28
77
14
234
python
[]
0
true
2024-11-18T20:48:17.535616+00:00
1,629,306,016,000
a1516e9d5a77b650e40d3e8c1162f518f248a693
2
{ "blob_id": "a1516e9d5a77b650e40d3e8c1162f518f248a693", "branch_name": "refs/heads/master", "committer_date": 1629306016000, "content_id": "49fdabe443258b9e2783ba587387c058e69cdb05", "detected_licenses": [ "MIT" ], "directory_id": "3570814e010ca1fdb146fe9eaa1ea9e014da9a94", "extension": "py", "fi...
2.40625
stackv2
# Compute ODT mean and rms velocity profiles. Plot results versus DNS. # Run as: python3 stats.py case_name # Values are in wall units (y+, u+). # Scaling is done in the input file (not explicitly here). import numpy as np import glob as gb import yaml import sys import matplotlib matplotlib.use('PDF') import m...
171
29.49
105
11
1,838
python
[]
0
true
2024-11-18T20:48:17.779831+00:00
1,634,167,704,000
73b55d8af88df0b178f8b4c8d4426bbc7e44776d
3
{ "blob_id": "73b55d8af88df0b178f8b4c8d4426bbc7e44776d", "branch_name": "refs/heads/master", "committer_date": 1634167704000, "content_id": "5528dd631aed0326f54fdb35c6de8dedca91053b", "detected_licenses": [ "MIT" ], "directory_id": "2f017d3059c4215062bb3a3e7cf24e7d571b512d", "extension": "py", "fi...
2.921875
stackv2
from PySDDP.dessem.script.templates.ilstri import IlstriTemplate import numpy as np from typing import IO import os COMENTARIO = '&' class Ilstri(IlstriTemplate): """ Classe que contem todos os elementos comuns a qualquer versao do arquivo Ils_tri do Dessem. Esta classe tem como intuito fornecer duck ty...
86
31.81
118
22
619
python
[]
0
true
2024-11-18T20:48:18.323081+00:00
1,601,955,335,000
93d2fe242712401523fe1819fc7ee1695ea6a35a
3
{ "blob_id": "93d2fe242712401523fe1819fc7ee1695ea6a35a", "branch_name": "refs/heads/main", "committer_date": 1601955335000, "content_id": "ed27291c76f9a7a7aa28725b7b77cbbf0d7de67b", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "5c3c62a159ae267ceb75ac24c5f59d4b211ad514", "extension": "py"...
2.96875
stackv2
import numpy as np from .shape import check, check_value def pluralize(noun, count): return noun if count == 1 else "{}s".format(noun) def raise_dimension_error(*input_values): messages = [ "{} {}".format(input_value.ndim, pluralize("dimension", input_value.ndim)) for input_value in input_va...
73
29.55
86
17
601
python
[]
0
true
2024-11-18T20:48:18.389713+00:00
1,576,018,589,000
3a927ce08958163ce6c0c37139decd4f70a98c33
3
{ "blob_id": "3a927ce08958163ce6c0c37139decd4f70a98c33", "branch_name": "refs/heads/master", "committer_date": 1576018589000, "content_id": "e11278eaed2eead73192c1ad6cb4b3afd2c03f26", "detected_licenses": [ "MIT" ], "directory_id": "eec5f55d93148c6d7483a5fa86bcb58fa68ed610", "extension": "py", "fi...
2.875
stackv2
from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait import EncypData import json class WebAutomated(): def __init__(self): #call the driver to run the webapp self.driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chromedriver_win32\chr...
103
31.18
158
14
741
python
[]
0
true
2024-11-18T20:48:19.514107+00:00
1,542,884,002,000
e4ffcd64cae18e88d45bf4649a2d4b1e07dae1f8
3
{ "blob_id": "e4ffcd64cae18e88d45bf4649a2d4b1e07dae1f8", "branch_name": "refs/heads/master", "committer_date": 1542884002000, "content_id": "bd77488b6fed555d3375f3b415817b1b8922a2e1", "detected_licenses": [ "MIT" ], "directory_id": "1c924ea9b89ed514d3eab6cff6eed30da2fa07e1", "extension": "py", "fi...
2.5625
stackv2
import subprocess, os, itertools, time from mpi4py import MPI as pyMPI from fill_mesh import fill_mesh import numpy as np from dolfin import (Mesh, mpi_comm_world, mpi_comm_self, MeshPartitioning) def msh_read(msh_file): '''Get nodes and 3-cells from msh_file''' assert os.path.splitext(msh_file)[1] == '.msh'...
95
29.48
83
18
783
python
[]
0
true
2024-11-18T20:48:20.227172+00:00
1,557,363,234,000
ab4ec73aa2e7c24ec260bc842bb723eaac148eac
3
{ "blob_id": "ab4ec73aa2e7c24ec260bc842bb723eaac148eac", "branch_name": "refs/heads/master", "committer_date": 1557363234000, "content_id": "f099e2b02dfe77921cb7b41853e9e20ac1b4b338", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "1e75cec574ed3399751dcf5eedd9fd6ffe903c5a", "extension": "p...
2.9375
stackv2
import os import torch import random from collections import Counter class Dictionary(object): def __init__(self): self.word2idx = {} self.idx2word = [] self.counter = Counter() self.total = 0 def add_word(self, word): if word not in self.word2idx: self.id...
75
28.03
67
15
484
python
[]
0
true
2024-11-18T20:48:20.342116+00:00
1,601,553,746,000
71e82378b10d2f92e24de4db9b8582cb36c3b628
3
{ "blob_id": "71e82378b10d2f92e24de4db9b8582cb36c3b628", "branch_name": "refs/heads/master", "committer_date": 1601553746000, "content_id": "1abd2e0e675674252bef3ce03a5058722bf82678", "detected_licenses": [ "MIT" ], "directory_id": "fed304f2033a738670793cb70f5098e37df34118", "extension": "py", "fi...
2.6875
stackv2
import os.path import classify_numbers import extract_grid import extract_numbers import sudoku_solver image_path = str(input("Enter the image file path")) # if os.path.exists("Output_Images"): # os.rmdir("Output_Images") if os.path.exists(image_path): sudoku_image = extract_grid.SudokuImage(image_path) else:...
33
31.58
80
9
216
python
[]
0
true
2024-11-18T20:48:20.459223+00:00
1,566,439,625,000
463755bb07a195f47cb3be0029d84f270127d2d8
2
{ "blob_id": "463755bb07a195f47cb3be0029d84f270127d2d8", "branch_name": "refs/heads/master", "committer_date": 1566439625000, "content_id": "33a40bf4b6e8834b2cb35104b16eed47b7924cd2", "detected_licenses": [ "Apache-2.0" ], "directory_id": "7cc6addf6bbeb6368205196fea3d44feba975bcc", "extension": "py"...
2.3125
stackv2
import sys sys.path.append("..") from SyntheticFunctions import * from SlidingWindow import * from Laplacian import * from CSMSSMTools import * import matplotlib.pyplot as plt from PulseExperiments import * from CircularCoordinates import * import glob import os from sys import exit PREFIX = "temp" if __name__ == '_...
45
25.44
65
13
407
python
[]
0
true
2024-11-18T20:48:20.522459+00:00
1,475,763,867,000
7aba203ca65dc4a55bd6be9c831d0d154792f6eb
3
{ "blob_id": "7aba203ca65dc4a55bd6be9c831d0d154792f6eb", "branch_name": "refs/heads/master", "committer_date": 1475763867000, "content_id": "337f0306455e8bacd8c1f4b446b85673c659b066", "detected_licenses": [ "MIT" ], "directory_id": "d490c6408851678b4346ca6ec8dc08d3547b88d3", "extension": "py", "fi...
2.5625
stackv2
from flask import Flask, render_template, request, redirect,session,Markup from random import randint from datetime import datetime, date, time app = Flask(__name__) app.secret_key = "Dan" @app.route('/',methods=['GET','POST']) def index(): if not session.has_key('log'): session['log'] = [] if not sess...
44
32.68
80
15
398
python
[{"finding_id": "codeql_py/flask-debug_802f01f1d1071e61_8550d253", "tool_name": "codeql", "rule_id": "py/flask-debug", "finding_type": "problem", "severity": "medium", "confidence": "high", "message": "A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger.", ...
1
true
2024-11-18T20:48:20.622947+00:00
1,562,332,915,000
7dd03e5831768a972f63540df5ab5b194889f138
3
{ "blob_id": "7dd03e5831768a972f63540df5ab5b194889f138", "branch_name": "refs/heads/master", "committer_date": 1562332915000, "content_id": "7f4aadf182f5951a1439f8b60ac0664fe2896ab2", "detected_licenses": [ "MIT" ], "directory_id": "ec1de82b189c3b12ad6943f5995e294aebb281db", "extension": "py", "fi...
3.15625
stackv2
import requests from .parser import createResultArray baseURL = "https://news.ycombinator.com/" # all the functions below take number of pages as optional parameter. # Default value is 1 ie., a single page is fetched. Valid range is 1 - 5 # The first page is fetched regardless of the argument passed def getArticles(...
50
40.72
103
14
478
python
[]
0
true
2024-11-18T20:48:21.031114+00:00
1,616,449,407,000
b9faf9508138c607caf24b0d0aeb3b43bda9d1ed
3
{ "blob_id": "b9faf9508138c607caf24b0d0aeb3b43bda9d1ed", "branch_name": "refs/heads/master", "committer_date": 1616449407000, "content_id": "6cc063e5eb6bcc4b8068a441c1550d8b8728e86a", "detected_licenses": [ "MIT" ], "directory_id": "9491ec2a6ee861b4fb68065ec14c81c10806d746", "extension": "py", "fi...
2.859375
stackv2
# -*- coding: utf-8 -*- """Negative sampling algorithm based on the work of of Bordes *et al.*.""" from typing import Collection, Optional, Tuple import torch from .negative_sampler import NegativeSampler from ..triples import TriplesFactory __all__ = [ 'BasicNegativeSampler', ] LOOKUP = {'h': 0, 'r': 1, 't':...
110
41.29
119
18
1,079
python
[]
0
true
2024-11-18T20:48:21.262405+00:00
1,573,993,469,000
2418a660d913b106300b3c23e0bec1d7cdb83c5c
2
{ "blob_id": "2418a660d913b106300b3c23e0bec1d7cdb83c5c", "branch_name": "refs/heads/master", "committer_date": 1573993469000, "content_id": "35830786ba81ad8f47054c1ff5872da1826b9386", "detected_licenses": [ "MIT" ], "directory_id": "cd270da569019f43ae4a980cdc3c1307d712a672", "extension": "py", "fi...
2.453125
stackv2
# -*- coding: utf-8 -*- """ Created on Sun Oct 27 15:10:52 2019 @author: Wentao """ import requests import pandas as pd from time import time from multiprocessing import Pool import os import traceback #from bs4 import BeautifulSoup #url = 'https://api.github.com/repos/hashicorp/terraform/stargazers?page=2' def star...
255
33.38
144
19
2,214
python
[]
0
true
2024-11-18T20:48:21.319326+00:00
1,418,959,639,000
6c9223e83594c65bbb24a28f7cef745181c66482
2
{ "blob_id": "6c9223e83594c65bbb24a28f7cef745181c66482", "branch_name": "refs/heads/master", "committer_date": 1418959639000, "content_id": "63bff7d28ed7b1a582b0d8658c3e8a3c88f06f7a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "6e2333d1aeea4805fe465d3e768bbd6af1abd898", "extension": "py"...
2.328125
stackv2
from ansi2html import Ansi2HTMLConverter from flask import current_app from werkzeug.utils import escape from changes.api.serializer import Serializer, register from changes.models.log import LogChunk @register(LogChunk) class LogChunkSerializer(Serializer): def serialize(self, instance, attrs): conv = ...
28
29.43
93
15
166
python
[]
0
true
2024-11-18T20:48:21.422521+00:00
1,690,111,694,000
61692dfa3979d09e9c5598ab19463037efdec684
5
{ "blob_id": "61692dfa3979d09e9c5598ab19463037efdec684", "branch_name": "refs/heads/main", "committer_date": 1690111694000, "content_id": "0c4df71af153197dbc6aba1dc583c45a92a89f4a", "detected_licenses": [ "MIT" ], "directory_id": "f41a47376d9a0cf69114d8050f7d69c2100c4974", "extension": "py", "file...
4.9375
stackv2
""" For a given positive integer n determine if it can be represented as a sum of two Fibonacci numbers (possibly equal). Example For n = 1, the output should be fibonacciSimpleSum2(n) = true. Explanation: 1 = 0 + 1 = F0 + F1. For n = 11, the output should be fibonacciSimpleSum2(n) = true. Explanation: 11 = 3 + ...
71
17.97
48
12
464
python
[]
0
true
2024-11-18T20:48:22.521386+00:00
1,580,906,793,000
c7a4a0837d01b9d16d5183824e983308a3b7601a
2
{ "blob_id": "c7a4a0837d01b9d16d5183824e983308a3b7601a", "branch_name": "refs/heads/master", "committer_date": 1580906793000, "content_id": "eef24aaadc42c88da9505999cb982100f21ad829", "detected_licenses": [ "MIT" ], "directory_id": "6527dbc1a07cb0c214f3b8efa76258a709ff7458", "extension": "py", "fi...
2.3125
stackv2
""" Handle the email *forward* and *reply*. phase. There are 3 actors: - website: who sends emails to alias@sl.co address - SL email handler (this script) - user personal email: to be protected. Should never leak to website. This script makes sure that in the forward phase, the email that is forwarded to user personal...
397
34.56
136
22
2,838
python
[]
0
true
2024-11-18T20:48:22.624183+00:00
1,693,052,794,000
86075fd2940dd024cd40a677a07e565544ba4f3e
3
{ "blob_id": "86075fd2940dd024cd40a677a07e565544ba4f3e", "branch_name": "refs/heads/master", "committer_date": 1693052794000, "content_id": "593b818bc08cbfe3b4c9f973f8dfa56ef74031c7", "detected_licenses": [ "MIT" ], "directory_id": "ccf975c869d2bda9929262986574a1560a887872", "extension": "py", "fi...
2.515625
stackv2
import copy import numpy as np import open3d as o3 import transforms3d as t3d def estimate_normals(pcd, params): pcd.estimate_normals(search_param=params) pcd.orient_normals_to_align_with_direction() def prepare_source_and_target_rigid_3d(source_filename, noise_amp=0.0...
55
40.16
104
15
534
python
[]
0
true
2024-11-18T20:48:22.760663+00:00
1,435,578,712,000
3595df34a91f0a72fff1a27e84c1230c04c04c46
3
{ "blob_id": "3595df34a91f0a72fff1a27e84c1230c04c04c46", "branch_name": "refs/heads/master", "committer_date": 1435578712000, "content_id": "944491f7e107da42590ff491a7c1b9b77a015b48", "detected_licenses": [ "MIT" ], "directory_id": "08e65159ee9629668f894a245093dde6cd168ce9", "extension": "py", "fi...
2.8125
stackv2
""" a script that will remove all the unwanted installed willie modules from site.sitepackages() """ import os, site, sys from errno import EACCES whitelist = ["__init__", "admin", "reload"] def rm_rf(site_packages_dir): path = "%s/willie/modules/" % site_packages_dir deleted = 0 if os.path.isdir(path): ...
38
29.55
67
17
258
python
[]
0
true
2024-11-18T20:48:22.812262+00:00
1,594,897,783,000
5647633ee6d66d41482204447b944dc8b80fa389
3
{ "blob_id": "5647633ee6d66d41482204447b944dc8b80fa389", "branch_name": "refs/heads/master", "committer_date": 1594897783000, "content_id": "c37e793aa276512f931ff747ea40598b9d110865", "detected_licenses": [ "MIT" ], "directory_id": "bafd4a10f9d8a6da63a98ac47007e45d3f3e53bb", "extension": "py", "fi...
3.125
stackv2
import datetime as dt import numpy as np import pandas_datareader.data as wb import matplotlib.pyplot as plt from scipy.stats import norm StockList = ['ADBE','CSCO','IBM','NVDA','MSFT','HPQ'] StartDay = dt.datetime(2019, 1, 1) EndDay = dt.datetime(2019, 12, 31) StockData = wb.DataReader(StockList, 'yahoo',StartDay,...
51
27.1
79
8
527
python
[]
0
true
2024-11-18T20:48:22.935956+00:00
1,602,906,356,000
a89fd5c5f67ea7fca175180872e61ab815f65059
3
{ "blob_id": "a89fd5c5f67ea7fca175180872e61ab815f65059", "branch_name": "refs/heads/main", "committer_date": 1602906356000, "content_id": "cdaf67d0d447505ba4911d21daafaa089438bce8", "detected_licenses": [ "Apache-2.0" ], "directory_id": "59eb2ba876ab4b9c5ff94b113b861a90acb2959e", "extension": "py", ...
3.078125
stackv2
"""Ghose Filter This runs a Ghose filter for drug-likeliness. Ghose filter filters molecules by Molecular weight (MW), the number of atoms, and the logP value. The upper bound of MW is relaxed from 480Da to 500Da. This is less restrictive and works in conjunction with Lipinski. This is also to retro-match AutoGrow 3.1....
110
35.23
92
12
1,080
python
[]
0
true
2024-11-18T20:48:23.050056+00:00
1,607,940,269,000
a57e4902ce2e228af738b26fcfee9e0957dabdec
3
{ "blob_id": "a57e4902ce2e228af738b26fcfee9e0957dabdec", "branch_name": "refs/heads/master", "committer_date": 1607940269000, "content_id": "f1f0c401cbac2ca064f32bdcc0178f23cd2c8071", "detected_licenses": [ "MIT" ], "directory_id": "e943cae50ba6c46a84870d1b3f1f0f9569aeea7d", "extension": "py", "fi...
3.3125
stackv2
from typing import Dict, Generic, TypeVar, Union import json V = TypeVar("V") class ConfigClass(Generic[V]): """ A lot of config usually exists as JSON objects, when parsed in Python, it results in a dict being generated which can be accessed as dict['key'] However, this looks less cleaner than writi...
38
35.68
113
14
320
python
[]
0
true
2024-11-18T20:48:23.114940+00:00
1,631,796,538,000
136879e54dc75479725137993e6f3ff9327831b9
2
{ "blob_id": "136879e54dc75479725137993e6f3ff9327831b9", "branch_name": "refs/heads/main", "committer_date": 1631796538000, "content_id": "afc70ba6197f904484129df98f636fffb85b5c34", "detected_licenses": [ "MIT" ], "directory_id": "4c849a36b15478c18be38631a9a3a036b9184733", "extension": "py", "file...
2.359375
stackv2
from dataset import make_dataset, Dataloader from model.model_utils import get_net from early_stop import EarlyStopping from options import opt from torch.optim.lr_scheduler import ReduceLROnPlateau from torch.utils.tensorboard import SummaryWriter from torch.autograd import Variable from tqdm import tqdm import torch...
160
32.53
109
15
1,259
python
[]
0
true
2024-11-18T20:48:23.156114+00:00
1,421,854,138,000
70c0f31783242b0415341c57df0b87e1dedeed01
3
{ "blob_id": "70c0f31783242b0415341c57df0b87e1dedeed01", "branch_name": "refs/heads/master", "committer_date": 1421854138000, "content_id": "b5184a72455a4eff76ac41f86936bf9cbcb2293e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2a5d8501b0dc06d36a06571beac69630fbf6b33c", "extension": "py"...
3.4375
stackv2
# Completed version of the Mortar Spark tutorial script. # To follow the tutorial go to https://help.mortardata.com/technologies/spark/spark_tutorial import string import json from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer from pyspark import Spa...
72
37.89
110
14
671
python
[]
0
true
2024-11-18T20:48:23.237225+00:00
1,526,272,186,000
48d525122015b720d80638fed6d10b836eb910df
3
{ "blob_id": "48d525122015b720d80638fed6d10b836eb910df", "branch_name": "refs/heads/master", "committer_date": 1526272186000, "content_id": "40b14edadc9ab9a8b2d80dae5fa43254ae1f4201", "detected_licenses": [ "MIT" ], "directory_id": "166ca3fb2d774a3fe681e45afedd0e02c1c53130", "extension": "py", "fi...
3.34375
stackv2
from trie import Node, Trie testTrie = Trie() #test cannot find string in empty Trie fail = testTrie.find('anything') print('expect None for empty match =', fail) #test add da, dad testTrie.insert('da') testTrie.insert('dad') print('expect None for d: ', testTrie.find('d')) print('expect da for da: ', testTrie.fin...
20
26.65
52
8
157
python
[]
0
true
2024-11-18T20:48:23.300036+00:00
1,660,829,837,000
bfb242ad2ff7dd725682382cef21a57a9b999710
3
{ "blob_id": "bfb242ad2ff7dd725682382cef21a57a9b999710", "branch_name": "refs/heads/master", "committer_date": 1660829837000, "content_id": "9d87962c5d4306fcc96511d1596d4420365c5b25", "detected_licenses": [ "MIT" ], "directory_id": "a06ac5090ede57c73cb05a6e20430893715983ee", "extension": "py", "fi...
2.609375
stackv2
from dataclasses import dataclass, field from enum import Enum from typing import Dict, List, Optional, Type, TypeVar, Union from urllib.parse import urlparse ArgumentsType = Dict[str, Union[str, bool, int]] class ExchangeType(Enum): topic = "topic" direct = "direct" fanout = "fanout" @dataclass(frozen...
63
26.7
78
16
410
python
[]
0
true
2024-11-18T20:48:23.362451+00:00
1,692,558,045,000
14fb1cf6fdaa99e9e50be8b41c235378d750c5e2
3
{ "blob_id": "14fb1cf6fdaa99e9e50be8b41c235378d750c5e2", "branch_name": "refs/heads/main", "committer_date": 1692558045000, "content_id": "be2368cfc62a1e9b66fe2c79832aff424fff2979", "detected_licenses": [ "MIT" ], "directory_id": "518bf342bc4138982af3e2724e75f1d9ca3ba56c", "extension": "py", "file...
3.203125
stackv2
class Solution: def reverseEvenLengthGroups(self, head: Optional[ListNode]) -> Optional[ListNode]: # Prev -> (head -> ... -> tail) -> next -> ... dummy = ListNode(0, head) prev = dummy tail = head next = head.next groupLength = 1 def getTailAndLength(head: Optional[ListNode], groupLength:...
44
25.57
103
15
295
python
[]
0
true
2024-11-18T20:48:23.480460+00:00
1,473,013,723,000
381b6a21411b9fcf7093f8137d9d2125409dc062
3
{ "blob_id": "381b6a21411b9fcf7093f8137d9d2125409dc062", "branch_name": "refs/heads/master", "committer_date": 1473013723000, "content_id": "99e2c0d483c05c27055ca153859b2b7e227635e6", "detected_licenses": [ "MIT" ], "directory_id": "226b56fb4b8cb4c11e235bebba72f3e803d58e2d", "extension": "py", "fi...
2.609375
stackv2
import tensorflow as tf from colorbot import tf_util, constants class Encoder(object): def __init__(self, hidden_size, vocab_size): cell = tf.nn.rnn_cell.GRUCell(hidden_size) state_size = cell.state_size output_w = tf_util.weights([state_size, constants.COLOR_SIZE]) output_b = tf_...
48
28.71
75
14
329
python
[]
0
true
2024-11-18T20:48:23.527025+00:00
1,357,341,515,000
12c9e704b25a4b14b1b921e869ab9465246ff4ea
3
{ "blob_id": "12c9e704b25a4b14b1b921e869ab9465246ff4ea", "branch_name": "refs/heads/master", "committer_date": 1357341515000, "content_id": "17863b41c14305cd11e58cece2094edbb3848e3c", "detected_licenses": [ "MIT" ], "directory_id": "ddf01aae79897eebc3e8e46bc26e772585e8fcc0", "extension": "py", "fi...
2.78125
stackv2
""" wifi.py Christopher Lee, Ashima Research, 2013 lee@ashimaresearch.COM This module provides and XBee WiFi (802.11) API library """ import struct from xbee.base import XBeeBase class XBeeWifi(XBeeBase): """ Implements the XBee-WiFi API. Commands may be sent to a device by instansiating this class w...
142
52.11
103
14
1,627
python
[]
0
true
2024-11-18T20:48:23.680800+00:00
1,629,304,891,000
88fa871a3c7a7051e1dc241163ffa0822f48171c
4
{ "blob_id": "88fa871a3c7a7051e1dc241163ffa0822f48171c", "branch_name": "refs/heads/main", "committer_date": 1629304891000, "content_id": "187797c71434d81fe356afcca198e67951671036", "detected_licenses": [ "Unlicense" ], "directory_id": "6df9b291a49609c802b0e0b33f6561cdf92c73c5", "extension": "py", ...
3.546875
stackv2
## kstrikis' solution for project euler problem 5 ## released under The Unlicense ## What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? ## the answer will be the product of all primes less than 20 times ## any repeated factors (e.g. 16 = 2*2*2*2 and 9 = 3*3) ## for 1 to 20...
19
31.32
100
9
201
python
[]
0
true
2024-11-18T20:48:24.068733+00:00
1,425,326,912,000
7aa7c1dbb1b069ebd30e2dfaa658872dd2cabf88
2
{ "blob_id": "7aa7c1dbb1b069ebd30e2dfaa658872dd2cabf88", "branch_name": "refs/heads/master", "committer_date": 1425326912000, "content_id": "be404ba24cbde9a76d3226aba1e2394cd421668b", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0a25ea42bd8aff27c939b7de9d9a8ea036b0c66f", "extension": "py"...
2.46875
stackv2
# Copyright (C) 2013-2014 Computer Sciences 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 a...
60
38.33
128
16
495
python
[]
0
true
2024-11-18T20:48:24.244185+00:00
1,626,863,532,000
c1b400683d0c248ad6b15ac12c3831e2b32e658a
3
{ "blob_id": "c1b400683d0c248ad6b15ac12c3831e2b32e658a", "branch_name": "refs/heads/master", "committer_date": 1626863532000, "content_id": "3aa01357bf60022494d3197c59bd183e24ce3680", "detected_licenses": [ "MIT" ], "directory_id": "3bc654990bea5acc2c1160c848271f5a4ec4e4cb", "extension": "py", "fi...
2.953125
stackv2
import math import numpy as np from prepare_dataset import epoch_sep import tensorflow.keras.backend as K import tensorflow_datasets as tfds import tensorflow as tf class DataGenerator(tf.keras.utils.Sequence): def __init__(self, dataset_path, batch_size=1): 'Initialization' self.batch_size = batc...
80
45.08
144
17
880
python
[]
0
true
2024-11-18T20:48:24.344353+00:00
1,689,850,979,000
cd1be11a2308ab217327a7d361138cb7f6c25106
3
{ "blob_id": "cd1be11a2308ab217327a7d361138cb7f6c25106", "branch_name": "refs/heads/master", "committer_date": 1689850979000, "content_id": "549ea7b5f4a4087445fd948e97015a809ec5488b", "detected_licenses": [ "MIT" ], "directory_id": "81e6b06b63ab06bcef6a86a91f17aa4a91ceac0a", "extension": "py", "fi...
2.609375
stackv2
import sys from external import align_warp, reslice, softmean, slicer, convert def align_reslice(anatomy_image, reference_image): anatomy_header = anatomy_image[:-3] + "hdr" reference_header = reference_image[:-3] + "hdr" warp = align_warp(anatomy_image, anatomy_header, reference_imag...
25
33.96
68
10
207
python
[]
0
true
2024-11-18T20:48:24.465349+00:00
1,443,938,519,000
0713f3a5f9ce44cbc05cd5bc1d1640cfeff85ea3
3
{ "blob_id": "0713f3a5f9ce44cbc05cd5bc1d1640cfeff85ea3", "branch_name": "refs/heads/master", "committer_date": 1443938519000, "content_id": "54f9702d0aa2337b0c4cabafd1e337d6fb1e5230", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9c72f4923b5c9537385620ee0bd5b41d872333f9", "extension": "py"...
3.234375
stackv2
from abc import ABCMeta, abstractmethod import random import math from ggplot import * import pandas as pd from board_base import BoardBase class Board(BoardBase): def __init__(self): self.limit = 8 self.board = [[None for y in xrange(self.limit)] for x in xrange(self.limit)] for ...
123
33.02
109
21
1,003
python
[]
0
true
2024-11-18T20:48:24.837378+00:00
1,468,640,562,000
2d089b2d4ddcc9fed5046eb1ecda2a1f98994e77
3
{ "blob_id": "2d089b2d4ddcc9fed5046eb1ecda2a1f98994e77", "branch_name": "refs/heads/master", "committer_date": 1468640562000, "content_id": "85c98011cc919eadf93a5ac6690a2a0cf0f60c65", "detected_licenses": [ "MIT" ], "directory_id": "af291d70499553e7fd0b435183117814479f403a", "extension": "py", "fi...
2.6875
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import collections import fnmatch import os import pkg_resources import subprocess import sys import pathspec import yaml #Python2 support try: from autolint.runners import Runner except ImportError: from .runners import Runner __conf_file__ = "....
407
35.96
79
21
3,013
python
[]
0
true
2024-11-18T20:48:24.894480+00:00
1,639,681,726,000
68a4282b7355f5b0af34712559f145f0ded8064e
2
{ "blob_id": "68a4282b7355f5b0af34712559f145f0ded8064e", "branch_name": "refs/heads/master", "committer_date": 1639681726000, "content_id": "aa98210d19a59a48d1d6f27af321962f49363a38", "detected_licenses": [ "Apache-2.0" ], "directory_id": "25768ca580e72e3b890a4dc66a0bf028308d3711", "extension": "py"...
2.5
stackv2
from typing import Dict from typing import Optional from argparse import ArgumentParser from rkd.api.contract import ExecutionContext from ...formatting import development_formatting from ...exception import MissingDeploymentConfigurationError from .base import BaseDeploymentTask class SSHTask(BaseDeploymentTask): ...
93
33.82
116
15
716
python
[]
0
true
2024-11-18T20:48:24.941576+00:00
1,486,771,566,000
9888d5a9ea5c491102f6de50a8b448333e69fbe4
4
{ "blob_id": "9888d5a9ea5c491102f6de50a8b448333e69fbe4", "branch_name": "refs/heads/master", "committer_date": 1486771566000, "content_id": "84ac1c9e5da0ff909e8f1b8f4b78654fe6db2a41", "detected_licenses": [ "MIT" ], "directory_id": "c115917f23adc7bc252c81848bb5eb84df6e4ac0", "extension": "py", "fi...
3.78125
stackv2
## 1. Counting in Python ## import sqlite3 conn = sqlite3.connect('factbook.db') facts = conn.cursor().execute('select * from facts;').fetchall() print(facts) facts_count = len(facts) ## 2. Counting in SQL ## conn = sqlite3.connect("factbook.db") birth_rate_count = conn.cursor().execute('select count(birth_rate) fro...
68
34.51
128
10
607
python
[]
0
true
2024-11-18T20:48:25.155242+00:00
1,513,450,527,000
c18ed2acc1bf562c1a78a2827913048b6ff36b52
3
{ "blob_id": "c18ed2acc1bf562c1a78a2827913048b6ff36b52", "branch_name": "refs/heads/master", "committer_date": 1513450527000, "content_id": "7e005755ff199b295ebf583ff4370c2650c5f0e9", "detected_licenses": [ "MIT" ], "directory_id": "a37dce61efb6280c72335fb50ff4bf412ee65c89", "extension": "py", "fi...
2.546875
stackv2
import numpy as np import manga_elines as mel class BPT(object): ''' compute BPT classes ''' labels = ['None', 'SF', 'Li(N)ER', 'AGN', 'Comp.'] class_labels = dict(enumerate(labels)) class_numbers = {v: k for k, v in class_labels.items()} lines = ['Hb-4862', 'Ha-6564', 'OIII-5008', 'NII-65...
51
27.76
69
14
473
python
[]
0
true
2024-11-18T20:48:25.294990+00:00
1,564,765,803,000
23460459628658d52bd4ab6ae5e98aa6eb91fa21
3
{ "blob_id": "23460459628658d52bd4ab6ae5e98aa6eb91fa21", "branch_name": "refs/heads/master", "committer_date": 1564765803000, "content_id": "41f5e56beac71ec1c7fd9093747a2ce71096f5c3", "detected_licenses": [ "MIT" ], "directory_id": "87453de1749efae79272df3744b1fc7d92927737", "extension": "py", "fi...
3
stackv2
# Because main is always too cluttered... import json import requests import argparse from colorama import Fore, Back, Style, init # The secret sauce behind the personality of this program def inform(msg): print('{}{}{}{}'.format(Style.BRIGHT, Back.BLACK, Fore.MAGENTA, msg)) # Just a simple abstraction of readin...
47
37.4
131
12
422
python
[]
0
true
2024-11-18T20:48:25.452442+00:00
1,690,045,657,000
d97afd9e7615365da6f8c39ee66a7e26a8639f2a
2
{ "blob_id": "d97afd9e7615365da6f8c39ee66a7e26a8639f2a", "branch_name": "refs/heads/master", "committer_date": 1690045657000, "content_id": "7b5ca44769f06b1aea3cdb178d454286fb051be7", "detected_licenses": [ "Apache-2.0" ], "directory_id": "518c7e2514194f5c4ebe8f52a53730e447637339", "extension": "py"...
2.421875
stackv2
import datetime from gpxpy.geo import Location from raw_instr_data import RawInstrData class DestInfo: def __init__(self): self.wpt = None # Destination waypoint self.org_wpt = None # Origin waypoint self.flw_wpt = None # Waypoint following the destination self.dtw = None # D...
77
29.61
118
9
598
python
[]
0
true
2024-11-18T20:48:25.978396+00:00
1,520,533,550,000
1084dd07bb2e539bbc399ee55673d50016c7f95f
3
{ "blob_id": "1084dd07bb2e539bbc399ee55673d50016c7f95f", "branch_name": "refs/heads/master", "committer_date": 1520533550000, "content_id": "1dd4a1f772ed6975369c971f18864dd8ccda06d3", "detected_licenses": [ "MIT" ], "directory_id": "bab947f0a75277b9e81e420d6e020e82e2c92410", "extension": "py", "fi...
2.71875
stackv2
import calendar import requests import datetime from core.abstract.input import ExternalDataSource, EnergyData, Device class SmireAPI(ExternalDataSource): def __init__(self, usr: str, pwd: str, site: str): """ Blue Saphire Smire API. https://test.smire.bluesafire.io :param usr: Username...
62
31.65
96
14
482
python
[]
0
true
2024-11-18T20:48:26.042816+00:00
1,590,296,028,000
dadcdd42c357b7159b102f54c252d498ce43e3cd
3
{ "blob_id": "dadcdd42c357b7159b102f54c252d498ce43e3cd", "branch_name": "refs/heads/master", "committer_date": 1590296028000, "content_id": "9c762cf65815568c78f0eafde880d03be096dba4", "detected_licenses": [ "MIT" ], "directory_id": "f1e540140594bf5a003a154f217ca9bc0d6f4374", "extension": "py", "fi...
2.75
stackv2
import numpy as np import matplotlib.pyplot as plt import pandas as pd from sklearn import decomposition #df.to_csv('iris.csv') from sklearn.preprocessing import StandardScaler from sklearn import metrics from sklearn.svm import SVC # 'rbf' import time as t from sklearn.model_selection import train_test_split ...
70
37.9
81
12
735
python
[]
0
true
2024-11-18T20:48:26.092585+00:00
1,692,107,265,000
22d552bc8abc2b1f02a3ec85e89982e8f2d33ed1
3
{ "blob_id": "22d552bc8abc2b1f02a3ec85e89982e8f2d33ed1", "branch_name": "refs/heads/master", "committer_date": 1692107265000, "content_id": "1088e3e5af7d3a263fc30b683cca69e8e0eb64c3", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "23fb7793e9d94e56714b618faacc4e85db8d74f9", "extension": "p...
3.046875
stackv2
r""" For information about polarised and magnetic scattering, see the :ref:`magnetism` documentation. Definition ---------- The 1D scattering intensity is calculated in the following way (Guinier, 1955) .. math:: I(q) = \frac{\text{scale}}{V} \cdot \left[ 3V(\Delta\rho) \cdot \frac{\sin(qr) - qr\cos(qr)...
184
43.23
84
10
3,224
python
[]
0
true
2024-11-18T20:48:26.731253+00:00
1,661,450,284,000
1ffad46ae660b2982f60c2a6f32f256689981012
3
{ "blob_id": "1ffad46ae660b2982f60c2a6f32f256689981012", "branch_name": "refs/heads/master", "committer_date": 1661450284000, "content_id": "841ca3d8cb8d089271fd7f83e31f7fa6e5da297a", "detected_licenses": [ "MIT" ], "directory_id": "a2f3597364f5b6fb6fc9786f4efd837a0a293e88", "extension": "py", "fi...
2.671875
stackv2
# # author: Jungtaek Kim (jtkim@postech.ac.kr) # last updated: February 4, 2022 # """It is utilities for Bayesian optimization.""" import numpy as np try: from scipydirect import minimize as directminimize except: # pragma: no cover directminimize = None try: import cma except: # pragma: no cover cma =...
318
30.62
97
15
2,493
python
[]
0
true
2024-11-18T20:48:26.896686+00:00
1,691,676,412,000
95a70c2170157ab7c8959dc0da4284788900385b
4
{ "blob_id": "95a70c2170157ab7c8959dc0da4284788900385b", "branch_name": "refs/heads/master", "committer_date": 1691676412000, "content_id": "d908b636a76452250b7926d456339bce1bc54fcc", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e59a07b832669f55b91f314903344b97f49b227b", "extension": "py"...
3.71875
stackv2
""" Exact Berk-Jones statistics for goodness-of-fit testing. This code includes computation of the M_n, M_n^+ and M_n^- statistics. See paper for details: http://arxiv.org/abs/1311.3190 To use this code, you must install the Python language interpreter and then install the NumPy and SciPy packages. Alternatively, you...
71
41.23
175
10
778
python
[]
0
true
2024-11-18T20:48:27.216170+00:00
1,692,307,499,000
4d6e8c1c37b428604c3bbb9c4a2151f611ee87cb
2
{ "blob_id": "4d6e8c1c37b428604c3bbb9c4a2151f611ee87cb", "branch_name": "refs/heads/master", "committer_date": 1692307499000, "content_id": "552dea37f94b0323b76719c5fe8226c13ad52c45", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2ae0b8d95d439ccfd55ea7933ad4a2994ad0f6c5", "extension": "py"...
2.46875
stackv2
# Copyright (C) 2018-2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import networkx as nx from openvino.tools.mo.ops.gather import Gather from openvino.tools.mo.ops.transpose import Transpose from openvino.tools.mo.front.common.partial_infer.utils import int64_array from openvino.tools.mo.graph.graph im...
244
52.89
119
17
3,012
python
[]
0
true
2024-11-18T20:48:27.347134+00:00
1,502,843,523,000
52af7a8ed1c945d8eea90b01f476e960e30905d6
3
{ "blob_id": "52af7a8ed1c945d8eea90b01f476e960e30905d6", "branch_name": "refs/heads/master", "committer_date": 1502843523000, "content_id": "b90805ecd45466670142dfbefe9857f0ecc43b43", "detected_licenses": [ "MIT" ], "directory_id": "0abdc6869b473ad55cfd5788d0401cad0e4ea3c9", "extension": "py", "fi...
2.5625
stackv2
import azurerm import json import sys Summary = False def print_region_quota(region): print(region + ':') quota = azurerm.get_compute_usage(access_token, subscription_id, region) if Summary == False: print(json.dumps(quota, sort_keys=False, indent=2, separators=(',', ': '))) try: for r...
50
27.8
108
20
336
python
[]
0
true
2024-11-18T20:48:27.477325+00:00
1,528,670,183,000
cd771e702ed8e5c8eb4d0f7df6fb9a33121eb571
3
{ "blob_id": "cd771e702ed8e5c8eb4d0f7df6fb9a33121eb571", "branch_name": "refs/heads/master", "committer_date": 1528670183000, "content_id": "fee83a1fa107fbc67d715fbcb9f8a9086f7311e3", "detected_licenses": [ "CC0-1.0" ], "directory_id": "c09f6d45b59e9b759757984eadb4db762fa2bf4b", "extension": "py", ...
2.65625
stackv2
import pandas as pd import numpy as np import datetime as dt import matplotlib.pyplot as plt import seaborn as sns import datetime from sklearn.cross_validation import train_test_split from sklearn.cross_validation import cross_val_score from sklearn.metrics import roc_curve, auc from sklearn import metrics pd.option...
167
29.38
101
11
1,196
python
[]
0
true
2024-11-18T20:48:27.870199+00:00
1,668,627,057,000
d4acc1a0de68a5f966cb9604bd729be3b60292d2
3
{ "blob_id": "d4acc1a0de68a5f966cb9604bd729be3b60292d2", "branch_name": "refs/heads/master", "committer_date": 1668627057000, "content_id": "61d021467e7bf220233e9957ac8c51ce3a4f2586", "detected_licenses": [ "MIT" ], "directory_id": "f25d5f95844ea005ef7809348489e42de4ea75c9", "extension": "py", "fi...
2.625
stackv2
from typing import Type from jivago.lang.annotations import Override from jivago.serialization.deserialization_strategy import DeserializationStrategy from jivago.wsgi.invocation.incorrect_attribute_type_exception import IncorrectAttributeTypeException class ListDeserializationStrategy(DeserializationStrategy): ...
18
33.78
101
12
121
python
[]
0
true
2024-11-18T20:48:27.985505+00:00
1,573,148,949,000
b274ab6e3ca3ed3d1dbf7a2f93f4cd53136a37ba
3
{ "blob_id": "b274ab6e3ca3ed3d1dbf7a2f93f4cd53136a37ba", "branch_name": "refs/heads/master", "committer_date": 1573148949000, "content_id": "258601702c97b43c984a103ba03091c929368293", "detected_licenses": [ "MIT" ], "directory_id": "308ff3931781ba97355e610f20356f7df5a684bc", "extension": "py", "fi...
2.921875
stackv2
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ tunacell package ============ filters/trees.py module ~~~~~~~~~~~~~~~~~~~~~~~~~~ Classes to filter trees. """ import numpy as np import warnings from tunacell.filters.main import FilterGeneral, bounded, intersect class FilterTree(FilterGeneral): "General class...
75
25.37
76
17
431
python
[]
0
true
2024-11-18T20:48:28.038055+00:00
1,663,245,489,000
89945b39787506c27e90918c4fdae63211b62f20
3
{ "blob_id": "89945b39787506c27e90918c4fdae63211b62f20", "branch_name": "refs/heads/master", "committer_date": 1663245489000, "content_id": "fbe3a2bf7f061c96a2939d4eceb8b27757c40cdd", "detected_licenses": [ "MIT" ], "directory_id": "b4f49e5039ab6691bd8871668867939d6d881a6f", "extension": "py", "fi...
2.578125
stackv2
import numpy as np import torch.nn as nn """ The code is: Copyright (c) 2018 Erik Linder-Norén Licensed under MIT (https://github.com/eriklindernoren/PyTorch-GAN/blob/master/LICENSE) """ class Generator(nn.Module): def __init__(self, opt): super().__init__() self.img_shape = (opt.channels, opt.i...
84
27.2
68
17
604
python
[]
0
true
2024-11-18T20:48:28.086572+00:00
1,580,365,842,000
04c05f2c24b2feb447ce73e477e5f859dc8fb829
2
{ "blob_id": "04c05f2c24b2feb447ce73e477e5f859dc8fb829", "branch_name": "refs/heads/master", "committer_date": 1580365842000, "content_id": "7141054e7993250c54989cb11eb02ce32923e380", "detected_licenses": [ "Apache-2.0" ], "directory_id": "7b8bb9e6359b181865d39af68547dacbef8e6b36", "extension": "py"...
2.3125
stackv2
# -*- coding: utf-8 -*- """ Created on Thu Dec 19 16:48:40 2019 @author: SUPERMAN """ import cv2 import numpy as np import os #path = fol= ['training', 'testing', 'validation'] classes = ['forehand_openstands','forehand_volley','forehead_slice','kick_service','slice_service', 'smash'] for path in fol: for clss i...
30
19.8
108
15
185
python
[]
0
true
2024-11-18T20:48:28.145394+00:00
1,487,584,423,000
018e0f5a494b3da3deb31acfbf39ed1ef05bcb5a
3
{ "blob_id": "018e0f5a494b3da3deb31acfbf39ed1ef05bcb5a", "branch_name": "refs/heads/master", "committer_date": 1487584423000, "content_id": "8c2a8313377b097a8d2b5d787d0a913227f89402", "detected_licenses": [ "MIT" ], "directory_id": "24981a0d2bc1833826959e315eeeef511cb6209b", "extension": "py", "fi...
2.578125
stackv2
import numpy import pyopencl as cl from simple_gene import SimpleGene class ShufflerChromosome: # ShufflerChromosome - a chromosome contains a list of Genes. # __genes - an ordered list of Genes # __name - name of the chromosome # dna - an listed of Gene's dna # dna_total_length - sum of the lengh...
240
43.35
98
16
2,212
python
[]
0
true
2024-11-18T20:48:28.225247+00:00
1,691,588,353,000
0ad9cf0feffe0cb9b3440fa38c1b9fc846e1f072
3
{ "blob_id": "0ad9cf0feffe0cb9b3440fa38c1b9fc846e1f072", "branch_name": "refs/heads/main", "committer_date": 1691588353000, "content_id": "94cddc32a1c356325834d3dd3801c705f3538790", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "ee8a7d7e502c1152cc80906c698b0a64b8f2c17a", "extension": "py"...
3.078125
stackv2
"""Cement core config module.""" import os from abc import abstractmethod from ..core.interface import Interface from ..core.handler import Handler from ..utils.fs import abspath from ..utils.misc import minimal_logger LOG = minimal_logger(__name__) class ConfigInterface(Interface): """ This class defines ...
228
26.4
79
14
1,287
python
[]
0
true
2024-11-18T20:48:28.321762+00:00
1,629,052,445,000
88758cea0bbeab817dc88eb5f7b47154cd755386
3
{ "blob_id": "88758cea0bbeab817dc88eb5f7b47154cd755386", "branch_name": "refs/heads/main", "committer_date": 1629052445000, "content_id": "edfe38f3c9008f929f5770f576fb22ac19ca3bec", "detected_licenses": [ "MIT" ], "directory_id": "5bc9bc81d84059b4c7f13b59450399e1b35af506", "extension": "py", "file...
2.703125
stackv2
try: import pipeline.detector as dt except: import TCTracker.pipeline.detector as dt try: import pipeline.classifier as cl except: import TCTracker.pipeline.classifier as cl try: from TCTracker.data.dataset import COCOInputDataset except: from TCTracker.data.dataset import COCOInputDataset try: from data.dataset impo...
88
48.05
175
21
962
python
[]
0
true
2024-11-18T20:48:28.588265+00:00
1,525,663,480,000
5ff5741278cb39bc71411172d908d4cf8270469e
2
{ "blob_id": "5ff5741278cb39bc71411172d908d4cf8270469e", "branch_name": "refs/heads/master", "committer_date": 1525663480000, "content_id": "40ad4d1024b4c0f1ecc6edef18ed5fdea5d9e01f", "detected_licenses": [ "MIT" ], "directory_id": "1296506a42321c3737ca53f3dbde7e611d5601e1", "extension": "py", "fi...
2.46875
stackv2
#!/usr/bin/env python3 import sys import os import numpy import scipy.stats import matplotlib matplotlib.use("Agg") import pylab import seaborn seaborn.set(context="paper", style="white", palette="deep") #nonrandom data=[numpy.loadtxt("learningON/trial"+str(i+1)+"/time_explore.csv", delimiter=",")[:,1] for i in range...
55
32.96
123
13
591
python
[]
0
true
2024-11-18T20:48:28.723385+00:00
1,641,036,951,000
31d855550f078f955c0ca6bcb8901686fb76b803
3
{ "blob_id": "31d855550f078f955c0ca6bcb8901686fb76b803", "branch_name": "refs/heads/master", "committer_date": 1641036951000, "content_id": "26c7e11b9663e6c6773925cde350b6ad393bb1ba", "detected_licenses": [ "MIT" ], "directory_id": "c40045b23a2580447f237c23cd9fe8a986aae41a", "extension": "py", "fi...
2.875
stackv2
#!/usr/bin/env python3 # coding=utf-8 import argparse import logging import logging.config import os logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def start_and_end_time_orca(test_path): '''Determine the start and end call of orcas in the acoustic sample''' i = 1 dur = 0 ...
58
25.4
79
16
397
python
[]
0
true
2024-11-18T20:48:28.875795+00:00
1,600,137,049,000
d69c3800577513f6ff27a65be34db38c01d11de3
3
{ "blob_id": "d69c3800577513f6ff27a65be34db38c01d11de3", "branch_name": "refs/heads/master", "committer_date": 1600137049000, "content_id": "61007795dd6e04242ba850d3a303c05369b87388", "detected_licenses": [ "MIT" ], "directory_id": "52b5beb1d7e09017ae4e85fc179e1bb8326e74e8", "extension": "py", "fi...
2.6875
stackv2
import numpy as np import matplotlib.pyplot as plt import all_paths as ap import engformat as ef def create(): data = np.loadtxt(ap.MODULE_DATA_PATH + 'basic_raw_data.csv', skiprows=1, delimiter=',').T x = data[0] y = data[1] ps = np.polyfit(x, y, deg=2) y_fit = ps[0] * x ** 2 + ps[1] * x + ps[2]...
33
36.64
99
11
414
python
[]
0
true
2024-11-18T20:48:29.009640+00:00
1,622,640,754,000
6a13a18f38b9c29a89647854dde515eb74102f98
3
{ "blob_id": "6a13a18f38b9c29a89647854dde515eb74102f98", "branch_name": "refs/heads/main", "committer_date": 1622640754000, "content_id": "0a19399283be5e4e062386a04723def499e6cb98", "detected_licenses": [ "MIT" ], "directory_id": "9a634078fb23524a38563835a2b2ff28647b26e0", "extension": "py", "file...
3.203125
stackv2
import turtle import os colors = ["red", "purple", "blue", "green", "orange", "yellow"] def spiral(t, size): for i in range(size): t.pencolor(colors[i % 6]) t.width(i/100 + 1) t.forward(i) t.left(59) def draw(size, save = False, filename = None): window = turtle.Screen() w...
25
25.6
72
12
190
python
[]
0
true
2024-11-18T20:48:29.084551+00:00
1,636,145,170,000
4b51a7b76bf92f8670aab6f39627ed03f3945887
3
{ "blob_id": "4b51a7b76bf92f8670aab6f39627ed03f3945887", "branch_name": "refs/heads/master", "committer_date": 1636145170000, "content_id": "2118a891dabd91b78236f327ebebe174303ffb5f", "detected_licenses": [ "Apache-2.0" ], "directory_id": "4053b0c49d7974cc20e9f8fa5ce9190e0a253668", "extension": "py"...
2.765625
stackv2
from ..imports import * from ..predictor import Predictor from .preprocessor import TextPreprocessor, TransformersPreprocessor, detect_text_format from .. import utils as U class TextPredictor(Predictor): """ ``` predicts text classes ``` """ def __init__(self, model, preproc, batch_size=U.DEF...
228
46.23
168
19
2,271
python
[]
0
true
2024-11-18T20:48:29.554300+00:00
1,552,338,156,000
849d34b63490a4705d82f4e49d2074e715b686a5
2
{ "blob_id": "849d34b63490a4705d82f4e49d2074e715b686a5", "branch_name": "refs/heads/master", "committer_date": 1552338156000, "content_id": "30dea573091eb42e545d416051aa4869371c735a", "detected_licenses": [], "directory_id": "f7ca8a7507d885e37d405c99ed19818f7ffe5e11", "extension": "py", "filename": "sto...
2.40625
stackv2
from flask import jsonify, request from ..model import StoryLine from . import api from .. import db @api.route('/story_lines', methods=['POST']) def create_story_line(): story_line = StoryLine( position=request.json.get('position'), story_id=request.json.get('story_id') ) # story_line.int...
30
25.93
51
13
193
python
[]
0
true
2024-11-18T20:48:29.605702+00:00
1,678,137,174,000
77f0d6bc1a4ef56336d14c6cfca328b8ec261a23
4
{ "blob_id": "77f0d6bc1a4ef56336d14c6cfca328b8ec261a23", "branch_name": "refs/heads/master", "committer_date": 1678137174000, "content_id": "df7b9adadcc785995bc80751d874c059f3ac62be", "detected_licenses": [ "MIT" ], "directory_id": "2e7aaf5367b9555554ae22338b9184c616e3f69e", "extension": "py", "fi...
3.734375
stackv2
import math import time def triangle(n): return int(n * (n + 1) / 2.0) def divisors(n): lowers = [i for i in range(1, math.ceil(math.sqrt(n)) + 1) if n % i == 0] uppers = [int(n / low) for low in reversed(lowers)] return len(set(lowers + uppers)) def divisor_count(stop): i = 1 while True: ...
34
24.18
77
15
265
python
[]
0
true
2024-11-18T20:48:30.022648+00:00
1,561,620,622,000
9be802d461389ca1b1143be341984a37ca3e5454
3
{ "blob_id": "9be802d461389ca1b1143be341984a37ca3e5454", "branch_name": "refs/heads/master", "committer_date": 1561620622000, "content_id": "18ff6c2d1b58bc923f4f3ea518d12b8142109eb9", "detected_licenses": [ "MIT" ], "directory_id": "0bdd797b3e95429e03108152cacfbb26069f1d76", "extension": "py", "fi...
2.8125
stackv2
class Solution: def maxProfitAssignment(self, difficulty, profit, worker): """ :type difficulty: List[int] :type profit: List[int] :type worker: List[int] :rtype: int """ def findKey(lis, key): left, right = 0, len(lis)-1 while left < r...
37
31.38
62
18
287
python
[]
0
true
2024-11-18T20:48:30.197163+00:00
1,591,900,993,000
d1ef215bfc03c0268a8a218138985bb427594bc8
3
{ "blob_id": "d1ef215bfc03c0268a8a218138985bb427594bc8", "branch_name": "refs/heads/master", "committer_date": 1591901486000, "content_id": "bfaed749264f3911719a646d4bf17e011108f517", "detected_licenses": [ "MIT" ], "directory_id": "2ccd9dad942b7afe6e8c8cabdf48146e3169d5b7", "extension": "py", "fi...
2.59375
stackv2
import tensorflow as tf import numpy as np class AutoEncoder(tf.keras.layers.Layer): def __init__(self, units, l2_const=1e-4, share_weights=False): super().__init__() self.units = units self.l2_const = l2_const self.share_weights = share_weights def build(self, input_shape): ...
148
39.33
126
18
1,290
python
[]
0
true
2024-11-18T20:48:30.242593+00:00
1,593,882,917,000
c14474b6562d69ab43d3ca4f16b52a0ca41601be
3
{ "blob_id": "c14474b6562d69ab43d3ca4f16b52a0ca41601be", "branch_name": "refs/heads/master", "committer_date": 1593882917000, "content_id": "4d500efe29be0d887b0b2cb7f17310e9d411bf66", "detected_licenses": [ "MIT" ], "directory_id": "1c5d40cde2248e643b354b199374192218b2e731", "extension": "py", "fi...
3.1875
stackv2
import pygame class Board: def __init__(self, board_x, board_y, block_size, colors, font, font_size, board_offset): self.board_x = board_x self.board_y = board_y self.block_size = block_size self.right_border = (self.board_x + 4) * self.block_size self.left_border = board_...
180
37.51
134
21
1,670
python
[]
0
true
2024-11-18T20:48:30.295046+00:00
1,617,098,203,000
3d7c097fb2873e1246b5689a09e651f27cf6032b
3
{ "blob_id": "3d7c097fb2873e1246b5689a09e651f27cf6032b", "branch_name": "refs/heads/master", "committer_date": 1617098203000, "content_id": "e2cd4bbd9137bf1a6a0e55d6359898a45b7fbdfe", "detected_licenses": [ "MIT" ], "directory_id": "3b4cd52a75859d57054127e644212fa0bcd5bb73", "extension": "py", "fi...
2.640625
stackv2
import numpy as np import torch from concorde.tsp import TSPSolver import collections as C def solve_batch_graphs(batch, first_cities, tmp_name='tmpname'): def create_concorde_file_xy_coord(arr, name="route", template=''): n_cities = arr.shape[0] assert len(arr.shape) == 2 # space delim...
58
35.71
145
18
532
python
[]
0
true
2024-11-18T20:48:30.402286+00:00
1,505,295,246,000
4c4a0534b5fe22a0bc109d8227bf08a351e687fc
3
{ "blob_id": "4c4a0534b5fe22a0bc109d8227bf08a351e687fc", "branch_name": "refs/heads/master", "committer_date": 1505295246000, "content_id": "53b5259562e5ec416d943077b9a5e9080c654bc4", "detected_licenses": [ "MIT" ], "directory_id": "ad035abbfd2470215b0cfc5884105e90c02d8c99", "extension": "py", "fi...
2.96875
stackv2
import os import pickle import numpy as np from sklearn.preprocessing import LabelBinarizer from utils import Cifar10, unpickle preprocessed_data_path = "preprocessed-cifar10-data" lb = LabelBinarizer() lb.fit(range(Cifar10.num_classes)) if not os.path.exists(preprocessed_data_path): os.makedirs(preprocessed_da...
128
34.44
110
17
940
python
[]
0
true
2024-11-18T20:48:30.486758+00:00
1,607,650,454,000
985327b4c42aa78d8d3dad62d8025486c04c2683
3
{ "blob_id": "985327b4c42aa78d8d3dad62d8025486c04c2683", "branch_name": "refs/heads/master", "committer_date": 1607650454000, "content_id": "98a2f75a62954deeefd9bd01bcd32ad19f4bd15c", "detected_licenses": [ "MIT" ], "directory_id": "fb748834fe2f16e360a4de6b89dca84b148ae2fa", "extension": "py", "fi...
2.6875
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Python example script showing Cisco Secure Workload (Tetration). Copyright (c) 2020 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.1 (the "License"). You may obtain a copy of the License at ...
97
34.15
114
14
691
python
[]
0
true
2024-11-18T20:48:30.769335+00:00
1,498,926,991,000
b59b80267b7e47ad227019d42bd9f027d4c80fa7
2
{ "blob_id": "b59b80267b7e47ad227019d42bd9f027d4c80fa7", "branch_name": "refs/heads/master", "committer_date": 1498926991000, "content_id": "1889a0b384251fda31dcb6bb8cbaf91db7dec181", "detected_licenses": [ "Apache-2.0" ], "directory_id": "a916ea8c4619f8ccf218e26453b56cd8d586cebb", "extension": "py"...
2.375
stackv2
from baseline.pytorch.torchy import * class TaggerModel(nn.Module): def save(self, outname): torch.save(self, outname) def create_loss(self): return SequenceCriterion(len(self.labels)) @staticmethod def load(dirname, base): name = '%s/%s.model' % (dirname, base) retur...
108
35.84
117
17
1,096
python
[]
0
true
2024-11-18T20:48:30.945807+00:00
1,657,910,712,000
4695abfb967c3a1d16ce368f52c6309aae8c5f53
3
{ "blob_id": "4695abfb967c3a1d16ce368f52c6309aae8c5f53", "branch_name": "refs/heads/master", "committer_date": 1657910712000, "content_id": "632a3dd387924ffd091ca3b9b0fc0d2ac009f3ac", "detected_licenses": [ "MIT" ], "directory_id": "6661b4d8aa95cd4125c368f7a70c529fcc10bd45", "extension": "py", "fi...
2.953125
stackv2
# Generally useful functions. Uses cgs units unless specified otherwise. import math import sys import numpy as np from scipy.interpolate import interp1d ### physical constants Lsun = 3.839e33 # solar luminosity in erg/s G = 6.674e-8 # gravitational constant in cm**3 g**-1 s**-2 Msun = 1.989e33 # mass of the sun in gr...
279
36.47
163
17
3,745
python
[]
0
true
2024-11-18T20:48:31.152886+00:00
1,614,283,968,000
288f7e191492b0a47b6a53abe14a328f1390c346
2
{ "blob_id": "288f7e191492b0a47b6a53abe14a328f1390c346", "branch_name": "refs/heads/main", "committer_date": 1614283968000, "content_id": "e8b3845279f8a28774c7b5e9762a29e960842616", "detected_licenses": [ "MIT" ], "directory_id": "9ed7ba12d6c337d15e213c53d6d57cbe83d85756", "extension": "py", "file...
2.375
stackv2
import cbprocharts import json import getpass config_file = "./config.json" with open('config.json') as file: api_config = json.load(file) passphrase = getpass.getpass() charter = cbprocharts.ProCharter( api_config["api_key"], api_config["api_secret"], passphrase) balance = cbprocharts.Balance(charter) bala...
19
21.84
64
9
107
python
[]
0
true
2024-11-18T20:48:31.328633+00:00
1,585,784,439,000
95a51f3fc00fcde3184629be9b84617f1f224a04
2
{ "blob_id": "95a51f3fc00fcde3184629be9b84617f1f224a04", "branch_name": "refs/heads/master", "committer_date": 1585784439000, "content_id": "1375aaaab803742e0f411f451e94bdcfa4225430", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "7013b5ec3be23891411d9979525af551c984ec10", "extension": "p...
2.375
stackv2
#! /usr/bin/env python # # Copyright (C) 2016 Rich Lewis <rl403@cam.ac.uk> # License: 3-clause BSD """ # skchem.features.descriptors.charge Charge descriptors for scikit-chem. """ from collections import OrderedDict import numpy as np from rdkit.Chem import rdPartialCharges from .caching import cache from .fundame...
353
23.44
85
16
1,992
python
[]
0
true
2024-11-18T20:48:32.687273+00:00
1,632,679,968,000
25993fddcb6f19cbd66823ce29f96314ff3d09a9
3
{ "blob_id": "25993fddcb6f19cbd66823ce29f96314ff3d09a9", "branch_name": "refs/heads/main", "committer_date": 1632679968000, "content_id": "bc9eeec13dafdde4c8b6defee704e56e5f5079b3", "detected_licenses": [ "Apache-2.0" ], "directory_id": "63f0ca44a91c1c4eed7eb2b255b9431c54ad931e", "extension": "py", ...
2.984375
stackv2
""" Distance measures that can be used for various torch.tensor operations """ import torch import numpy as np import torch.nn.functional as F from torch.distributions import Categorical from torch.autograd import Variable from scipy.spatial.distance import cosine def get_predict_token_vector(pred, target, k=10, s=1,...
101
32.62
105
17
996
python
[]
0
true
2024-11-18T20:48:32.817705+00:00
1,559,273,002,000
bd4e8529d137e4df206ba63a069f4525b9e1587f
3
{ "blob_id": "bd4e8529d137e4df206ba63a069f4525b9e1587f", "branch_name": "refs/heads/master", "committer_date": 1559273002000, "content_id": "88325d8db67f52eabc93ab0af13f8535230a4b4e", "detected_licenses": [ "MIT" ], "directory_id": "b3b104acc91e26c14d8d1d3211f5e7a6094041a5", "extension": "py", "fi...
2.90625
stackv2
""" This script gives a simple example on that how to train an Recurrent Neural Networks (RNN). Author: Hailiang Zhao """ import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import input_data import argparse from src.utils.global_settings import remove_avx_warning remove_avx_warni...
81
45.75
106
14
881
python
[]
0
true
2024-11-18T20:48:32.875015+00:00
1,655,846,464,000
c3ad7a5a5955e9112e9858032a432de66948dd54
2
{ "blob_id": "c3ad7a5a5955e9112e9858032a432de66948dd54", "branch_name": "refs/heads/master", "committer_date": 1655846464000, "content_id": "7ba9b37e16373d3d19250da35a72dc15130350fd", "detected_licenses": [ "MIT" ], "directory_id": "33e5e4b883671f7f40a48e6e0a4b544b3f8f839a", "extension": "py", "fi...
2.328125
stackv2
#!/usr/bin/env python import json import logging import os import shutil import subprocess import tempfile from astropy.io import fits from astropy.io.ascii import SExtractor as SexToAstropy logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) class Executable(object): def __init__(self,...
222
29.59
91
18
1,721
python
[]
0
true
2024-11-18T20:48:33.094032+00:00
1,621,835,523,000
aa661dd9b4fb41247df931755de7a9efab8d099a
3
{ "blob_id": "aa661dd9b4fb41247df931755de7a9efab8d099a", "branch_name": "refs/heads/main", "committer_date": 1621835523000, "content_id": "7549ea5ba5a2fcf8d2725d7badeee037a34ed5ff", "detected_licenses": [ "MIT" ], "directory_id": "e6bd5bdd18961ad1f310fab33c5f287cd1eac346", "extension": "py", "file...
3.34375
stackv2
# Gesture Recognizer from tkinter import Tk, Canvas, Label, Button from pickle import load, dump from tkinter.simpledialog import askstring from math import floor defaultDir = 'CursiveRec Files/defaultGestures.pkl' customDir = 'CursiveRec Files/customGestures.pkl' uiFont = ("Segoe UI Light", 14) displayFont = ("Segoe ...
201
42.14
120
22
2,315
python
[]
0
true