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:33.314436+00:00
1,564,613,826,000
a38211db9d463b32507381b30612a11a2e50e91f
3
{ "blob_id": "a38211db9d463b32507381b30612a11a2e50e91f", "branch_name": "refs/heads/master", "committer_date": 1564613826000, "content_id": "b9b22fb7cc3d083c106d00be6430d31d3c560bb7", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "860679e655975afad5721f4c784b025e4b0f05b7", "extension": "p...
2.84375
stackv2
from loguru import logger import numpy as np import torch def describe(x) -> None: logger.info("{} [{}]\n{}".format(x.type(), x.shape, x)) def make_tensor() -> None: describe(torch.FloatTensor(2, 3)) def make_rand_tensors() -> None: describe(torch.rand(2, 3)) describe(torch.randn(4, 2)) def make...
38
18.82
59
12
205
python
[]
0
true
2024-11-18T20:48:33.376258+00:00
1,545,332,990,000
9ac7981bffc2c0b0cb09cc3786159a3f2339c6e5
3
{ "blob_id": "9ac7981bffc2c0b0cb09cc3786159a3f2339c6e5", "branch_name": "refs/heads/master", "committer_date": 1545332990000, "content_id": "9272febffd66cd673a2b283a97de9de587fd68dd", "detected_licenses": [ "MIT" ], "directory_id": "bfc25f1ad7bfe061b57cfab82aba9d0af1453491", "extension": "py", "fi...
3.328125
stackv2
#!/usr/bin/env python ''' Identify the location of a missing word in a sentence using an n-gram model. Print the top N most probable sentences. ''' import sys, argparse, pickle from itertools import islice import numpy as np import kenlm from util import tokenize_words, load_vocab, TopK def max_prob_word_at(words, i...
75
31.23
72
13
620
python
[]
0
true
2024-11-18T20:48:33.463475+00:00
1,572,540,959,000
4be0d9e71de4dfaabd3e2a9671279d6b9215b6e7
3
{ "blob_id": "4be0d9e71de4dfaabd3e2a9671279d6b9215b6e7", "branch_name": "refs/heads/master", "committer_date": 1572540959000, "content_id": "ac7bfcd5e270c3d8e7859c455329fa2177511e88", "detected_licenses": [ "MIT" ], "directory_id": "c809d406778c3312d96f1dba1c2490333f330ac9", "extension": "py", "fi...
2.796875
stackv2
from abc import ABC, abstractmethod import numpy as np from scipy.optimize import minimize from ..model.sources import FarField1DSourcePlacement from ..utils.math import projm, vec from .core import ensure_covariance_size, ensure_n_resolvable_sources def f_nll_stouc(R, array, sources, wavelength, p, sigma): # log|...
362
39.13
85
14
3,687
python
[]
0
true
2024-11-18T20:48:33.635582+00:00
1,295,606,289,000
a589f99723df39a061151b8aab5a2538648aa3f2
3
{ "blob_id": "a589f99723df39a061151b8aab5a2538648aa3f2", "branch_name": "refs/heads/master", "committer_date": 1295606289000, "content_id": "921d824b70d5c8f319d5d3b6d68a0ee3a773de94", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "9587494eebe935202a9cd99bb6ecfaaf1d882b13", "extension": "p...
2.546875
stackv2
# From MCP 2.6 Test 3 import csv def parse_config(filename, renamer_options, miss_crit=True, unk_crit=True): ff = open(filename, 'r') while True: buffer = ff.readline() if not buffer: break buffer = buffer.split('=') if buffer[0].strip() in re...
161
28.52
105
19
1,064
python
[]
0
true
2024-11-18T20:48:33.684150+00:00
1,631,171,593,000
c143879d8ed9da53a0ea35d5b8301021098e6d76
3
{ "blob_id": "c143879d8ed9da53a0ea35d5b8301021098e6d76", "branch_name": "refs/heads/master", "committer_date": 1631171593000, "content_id": "eb3225a2151a33ef9f23a6a2222ef94ad6199fc4", "detected_licenses": [ "MIT" ], "directory_id": "fc5a948714cd9177a4f63408d1c5ff47910000f1", "extension": "py", "fi...
2.71875
stackv2
from typing import List from adversarial_music_generator.interfaces import TuneMutatorInterface from adversarial_music_generator.models.note import Note from adversarial_music_generator.models.tune import Tune from adversarial_music_generator.seed import Seed class NaiveRandomMutator(TuneMutatorInterface): def ...
41
35.27
99
17
322
python
[]
0
true
2024-11-18T20:48:33.746757+00:00
1,627,913,540,000
024dd2530d19a6dfee4c5e32092058634655a85b
3
{ "blob_id": "024dd2530d19a6dfee4c5e32092058634655a85b", "branch_name": "refs/heads/main", "committer_date": 1627913540000, "content_id": "577d5afd387e6afd549b74d08d0216d920b8c973", "detected_licenses": [ "MIT" ], "directory_id": "ca375d5e278c3ba8943d259375c5429206237133", "extension": "py", "file...
2.921875
stackv2
""" Aggregation methods. """ import functools import util class VotingRules: """ Summing composition of votes. """ @staticmethod def multipath_combine(v1, v2): return max(v1, v2) @staticmethod def negative(v): return -v @staticmethod def combine(v1, v2): ...
143
32.9
148
18
1,116
python
[]
0
true
2024-11-18T20:48:33.821008+00:00
1,589,525,088,000
b90cc8c3bf828418a934a3954fc31205f43940f4
2
{ "blob_id": "b90cc8c3bf828418a934a3954fc31205f43940f4", "branch_name": "refs/heads/master", "committer_date": 1589525088000, "content_id": "2bd9b88c203a0d87a90cc4efef806cb6c55fb669", "detected_licenses": [ "MIT" ], "directory_id": "99f3437f3f8752d1aab883cc9e29c6ae48eb435c", "extension": "py", "fi...
2.328125
stackv2
import os, json DOMAIN = 'ha_cloud_music' VERSION = '2.4.1' DOMAIN_API = '/' + DOMAIN + '-api' ROOT_PATH = '/' + DOMAIN + '-local/' + VERSION def TrueOrFalse(val, trueStr, falseStr): if val: return trueStr return falseStr # 获取配置路径 def get_config_path(name): return os.path.join(os.path.dirname(__f...
29
24.48
90
14
205
python
[]
0
true
2024-11-18T20:48:33.879385+00:00
1,570,862,489,000
cd8951d975641c86c3a87204da90ea00f79067ee
3
{ "blob_id": "cd8951d975641c86c3a87204da90ea00f79067ee", "branch_name": "refs/heads/master", "committer_date": 1570862489000, "content_id": "66abdcd1da3330018722e765dd16eee7a5f6dba4", "detected_licenses": [ "MIT" ], "directory_id": "859bb3e856fb68f741414b14282e03053c08a47c", "extension": "py", "fi...
2.9375
stackv2
import pickle from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from data_prep import DataPrep from sklearn.feature_extraction.text import TfidfVectorizer from sklearn import metrics class Model(): def __init__(self): self.rfr = RandomForestRegressor(bootstrap=True, max_fe...
66
35.59
110
15
534
python
[]
0
true
2024-11-18T20:48:34.105604+00:00
1,629,082,577,000
c015d8b322c558153a9fe380f0bc19a7360ff92d
3
{ "blob_id": "c015d8b322c558153a9fe380f0bc19a7360ff92d", "branch_name": "refs/heads/main", "committer_date": 1629082577000, "content_id": "6c4925738e9c7540764bc61839c5c5a07a933064", "detected_licenses": [ "MIT" ], "directory_id": "4c304b381dc08dc5229a2ad6d6fa84b0c11d22dc", "extension": "py", "file...
2.625
stackv2
import json import requests from datetime import datetime import time import re import sys MAXTIMEDIFF = 28 f = "%Y-%m-%dT%H:%M:%SZ" def parsedate(inp, frmt="%Y-%m-%dT%H:%M:%SZ", rms=True): dt = datetime.strptime(inp, frmt) if rms: return dt.timestamp() * 1000 else: return dt now = re.sub...
44
32.68
111
16
530
python
[]
0
true
2024-11-18T20:48:34.222050+00:00
1,626,430,584,000
68e2324f784d5d03f382e998232fa8ce2cdec3eb
4
{ "blob_id": "68e2324f784d5d03f382e998232fa8ce2cdec3eb", "branch_name": "refs/heads/master", "committer_date": 1626430584000, "content_id": "df8c26806855e513c29be6f7b752532db086e3f4", "detected_licenses": [ "Apache-2.0" ], "directory_id": "88308a83f8dfb496c3dcc0149a6657e90991c091", "extension": "py"...
3.65625
stackv2
# Find the smallest positive number missing from an unsorted array N = int(input('')) array = list(map(int, input().split(' ')[:N])) array.sort() for index in range(0, len(array)): if(array[index] > 0): positiveInteger = array[index] positiveIndex = index break if(1 < positiveInteger): ...
21
27.05
66
14
142
python
[]
0
true
2024-11-18T20:48:34.350903+00:00
1,595,381,652,000
f10074309cc48af8b041478416743ff25e4c7b47
3
{ "blob_id": "f10074309cc48af8b041478416743ff25e4c7b47", "branch_name": "refs/heads/master", "committer_date": 1595381652000, "content_id": "0643bf82a281b2a708c9695e76d42350b056f0f0", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "5d484450406cb726cd26b61c1af898856c6057f6", "extension": "p...
2.90625
stackv2
import tensorflow import numpy import matplotlib.pyplot as plt import math from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error import pandas as pd import numpy from .helpers import ...
184
39.4
96
15
2,051
python
[]
0
true
2024-11-18T20:48:34.400061+00:00
1,474,924,104,000
c17e35f4b9625a28f1c1f25d00d59ca5926381a8
3
{ "blob_id": "c17e35f4b9625a28f1c1f25d00d59ca5926381a8", "branch_name": "refs/heads/master", "committer_date": 1474924104000, "content_id": "df38e1d691d4f60fac978b4c8c1495cea17d6d64", "detected_licenses": [ "MIT" ], "directory_id": "5abba2cda976e4ec04b879c73a8b79184c1b5f3b", "extension": "py", "fi...
2.6875
stackv2
""" Prepares features and target inputs, creates and trains an ML model and evaluates it. """ import os # preprocessing import numpy as np import pandas as pd from sklearn.cross_validation import train_test_split from sklearn.preprocessing import LabelEncoder, OneHotEncoder, MinMaxScaler import jsonpickle import jso...
271
33.54
110
15
2,268
python
[]
0
true
2024-11-18T20:48:34.630504+00:00
1,574,105,488,000
1ad39b36394a7cf764e697c77f57be1863b5cca9
3
{ "blob_id": "1ad39b36394a7cf764e697c77f57be1863b5cca9", "branch_name": "refs/heads/master", "committer_date": 1574105488000, "content_id": "20fd7c2287a6dcfcd515547bb5481f327bf60aa8", "detected_licenses": [ "MIT" ], "directory_id": "e91b77e309066f0ab98ff0843fe7accd753a8e81", "extension": "py", "fi...
2.515625
stackv2
#!/usr/bin/env python3 import requests import fileinput import json import glob import os import sys import re results = { "success" : [], "skipped" : [] } options = { "h" : { 'status' : False, 'description': "print this help message and exit (also --help)" }, "i" : { 'status' : False, 'description': "in...
333
22.98
107
21
2,246
python
[]
0
true
2024-11-18T21:11:15.988910+00:00
1,474,501,254,000
c8a1bc1615f3b3db926818708b836097189b8276
2
{ "blob_id": "c8a1bc1615f3b3db926818708b836097189b8276", "branch_name": "refs/heads/master", "committer_date": 1474501254000, "content_id": "22a1ea53f2b62f1fef80eef3f6a1ad7bfab0817a", "detected_licenses": [ "MIT" ], "directory_id": "a143c2e5d045204d4df70612d8c452ae16585fae", "extension": "py", "fi...
2.390625
stackv2
from __future__ import division from __future__ import print_function from PyQt4 import QtCore, QtGui class CollectionView(QtGui.QTableView): ######################################################## # DEFAULT VIEW PROPERTIES ######################################################## # Height of rows ...
67
32.39
125
14
408
python
[]
0
true
2024-11-18T21:11:16.103586+00:00
1,539,000,938,000
37d29e7fd6ba64644a53fe0d76604a55fd29bd07
3
{ "blob_id": "37d29e7fd6ba64644a53fe0d76604a55fd29bd07", "branch_name": "refs/heads/master", "committer_date": 1539000938000, "content_id": "faaa33d18cd5d28c951201ddfd3829ceed68b648", "detected_licenses": [ "MIT" ], "directory_id": "78356b0d7fe7eeb470758a3b19d524fcd3e8cadc", "extension": "py", "fi...
2.75
stackv2
# tables.py import django_tables2 as tables from .models import Exercise class ExerciseTable(tables.Table): time = tables.Column(accessor='time', verbose_name='Time', order_by=('hours', 'minutes')) # aver_speed = tables.Column(verbose_name='Average speed') aver_speed = tables.Column(accessor='average_spee...
82
31.34
105
15
653
python
[]
0
true
2024-11-18T21:11:16.244036+00:00
1,516,830,877,000
e14811b85e6ebc8e1453eaa335b39e60181161ae
3
{ "blob_id": "e14811b85e6ebc8e1453eaa335b39e60181161ae", "branch_name": "refs/heads/master", "committer_date": 1516830877000, "content_id": "eeb605a35c3284dbdde01f1181939be928663d18", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "8356c227dacafc32bec5440a91c1c7fe8a1021bc", "extension": "p...
2.5625
stackv2
#!/usr/bin/env python import os import sys import glob import subprocess import md5 import datetime archivelogfn = "/home/primefocus/bass/archive/bassarchive.log" dtskp = "bokpf@dtskp.kpno.noao.edu" curtime = datetime.datetime.now() logpfx = "[{}] ".format(str(curtime)[:-7]) def check_file_size(year=''): '''List ...
142
32.4
74
18
1,316
python
[]
0
true
2024-11-18T21:11:20.141705+00:00
1,522,186,657,000
f0d1a28c8fbee97aa14687fa572636a0aafaff0a
3
{ "blob_id": "f0d1a28c8fbee97aa14687fa572636a0aafaff0a", "branch_name": "refs/heads/master", "committer_date": 1522186657000, "content_id": "e5bd9846792ca0380e9358b95728eb11553310f8", "detected_licenses": [ "MIT" ], "directory_id": "b2a4090f2098e899d24783a6e51a98c16e643769", "extension": "py", "fi...
2.671875
stackv2
from collections import namedtuple from fbchat import Client from fbchat.models import ThreadType class Bot(Client): Command = namedtuple('Command', ['func', 'admin', 'directed']) def __init__(self, email, password, name, admins=[], protected=[], *args, **kwargs): super(Bot, self).__init__(email=ema...
48
38.31
88
17
433
python
[]
0
true
2024-11-18T21:11:20.191299+00:00
1,463,177,624,000
23cde744886a268c2d423081a10c06167610699c
3
{ "blob_id": "23cde744886a268c2d423081a10c06167610699c", "branch_name": "refs/heads/master", "committer_date": 1463177624000, "content_id": "b86c15f6a9578f8611e22578c24f81f34240173b", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "3147c0900dc985917fdb95124e82b2402428e219", "extension": "p...
2.9375
stackv2
import pandas as pd import re import sys sent=[] inc=[] f = open("t2.txt", 'r') for line in f: row = line.strip().split(',') sent.append(row) f.close() g = open("zincome.csv", 'r') for i in g: irow = i.strip().split(',') inc.append(irow) g.close() sentf=pd.DataFrame(sent) sentf.columns = ['sent', 'zi...
30
18.47
49
10
182
python
[]
0
true
2024-11-18T21:11:20.289609+00:00
1,515,960,000,000
df33939c92e59f6cf7f520ede32396e1d2efa9b2
3
{ "blob_id": "df33939c92e59f6cf7f520ede32396e1d2efa9b2", "branch_name": "refs/heads/master", "committer_date": 1515960000000, "content_id": "7adef7d57d29d801701047520e97360549df549e", "detected_licenses": [ "MIT" ], "directory_id": "a484bd40a5c5c722ab6a0a7ca80e237bb78d14c9", "extension": "py", "fi...
2.5625
stackv2
import json import ply.lex from .. import logger class Lexer: tokens = [ 'IDENTIFIER', 'REGULAR_EXPRESSION', 'MATCH_OPERATOR', 'AND_OPERATOR', 'OR_OPERATOR', ] t_IDENTIFIER = r'\w+' t_REGULAR_EXPRESSION = r'/(?:\\.|[^/])+/' t_MATCH_OPERATOR = '=~' t_AND...
42
20.4
63
13
231
python
[]
0
true
2024-11-18T21:11:20.350313+00:00
1,585,774,472,000
6c562167bd41d5cb20f20069627e654d450a923f
4
{ "blob_id": "6c562167bd41d5cb20f20069627e654d450a923f", "branch_name": "refs/heads/master", "committer_date": 1585774472000, "content_id": "4b03d28ffbedff5db383dbdc1a91d3431ea84fb4", "detected_licenses": [ "MIT" ], "directory_id": "11fbb786b162b16289672d6a6bf6277ac5ef2f40", "extension": "py", "fi...
4.34375
stackv2
# Silvio Dunst # Program that outputs today is a weekday or not import datetime # imports date time function now = datetime.datetime.now() # create a new variable for weekday weekday = now.weekday() # create a new variable for (weekday), extract the weekday out of the now function #if weekday >= 0 & <= 4 : # weeday...
27
34.26
112
9
260
python
[]
0
true
2024-11-18T21:11:24.227664+00:00
1,585,870,303,000
16c95c158787fd2fbed1b5d96b1b34290f1cabfc
3
{ "blob_id": "16c95c158787fd2fbed1b5d96b1b34290f1cabfc", "branch_name": "refs/heads/master", "committer_date": 1585870303000, "content_id": "78c81df9cb8101cc26b496c81f85eb2fc42f4790", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c91475644fe64b3226e55c7cb24edcf362a201a6", "extension": "p...
2.59375
stackv2
import tqdm import argparse import torch import torch.nn as nn import torch.optim as optim import torch.utils.data as data import torch3d.models as models import torch3d.datasets as dsets import torch3d.transforms as transforms from torch3d.metrics import Accuracy import pyvista as pv def main(args): # ToTensor t...
171
30.77
82
18
1,223
python
[]
0
true
2024-11-18T21:11:25.839581+00:00
1,545,408,146,000
e38ad57b8ac35cb6506f819cc4bf617ad2f65101
3
{ "blob_id": "e38ad57b8ac35cb6506f819cc4bf617ad2f65101", "branch_name": "refs/heads/master", "committer_date": 1545408146000, "content_id": "efd221a585d84b0d64407d5260fab91894b40b93", "detected_licenses": [ "MIT" ], "directory_id": "b849b6259d36bf51f387756ed36c5c68cd72213e", "extension": "py", "fi...
3.140625
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Inverse Captcha https://adventofcode.com/2017/day/1 """ # yup, could probably improve this (specially solver), but for now... import solutions.utils as utils def _get_input(fpath): with open(fpath) as f: return int(f.read()) def solver1(n): s = ...
39
17.05
91
16
231
python
[]
0
true
2024-11-18T21:11:25.887697+00:00
1,553,816,050,000
5c2cc5ecd6488dd096b849b7917f0ac8995f3b0e
2
{ "blob_id": "5c2cc5ecd6488dd096b849b7917f0ac8995f3b0e", "branch_name": "refs/heads/master", "committer_date": 1553816050000, "content_id": "66e9f3403aeb4fd7e718e8a8a743bfc014ef3986", "detected_licenses": [ "MIT" ], "directory_id": "4b96fbca2e1b18322428840cb624bab4e6b0a643", "extension": "py", "fi...
2.46875
stackv2
import os from flask import Flask, request import tensorflow as tf from werkzeug.utils import secure_filename from exercices.models import Models app = Flask(__name__) # Flask / Tensorflow fix # https://towardsdatascience.com/deploying-keras-deep-learning-models-with-flask-5da4181436a2 # global graph # graph = tf....
34
23.09
93
11
199
python
[]
0
true
2024-11-18T21:11:25.938186+00:00
1,669,388,897,000
c62fa6790b351d91d7b2983a609495697747906d
2
{ "blob_id": "c62fa6790b351d91d7b2983a609495697747906d", "branch_name": "refs/heads/master", "committer_date": 1669388897000, "content_id": "040cb6ef9224a22287330a82dbc38e5a448e2ffa", "detected_licenses": [ "MIT" ], "directory_id": "47eac81c566e4b35d024d30cc1b7548dbad02450", "extension": "py", "fi...
2.453125
stackv2
""" madstuff: oneliners and debug-useful stuff """ from __future__ import annotations import sys import traceback from ..base import o_repr from .datadiff import _dumprepr from .reprstuff import genreprwrap __all__ = ( "_try", "_try2", "_iter_ar", "_filter", "_filter_n", "_ipdbg", "_ipdb...
199
24.27
96
15
1,388
python
[]
0
true
2024-11-18T21:11:26.158838+00:00
1,690,961,161,000
56b2c6fbfa182e3f8775d7f47e3e96375a8abcf0
3
{ "blob_id": "56b2c6fbfa182e3f8775d7f47e3e96375a8abcf0", "branch_name": "refs/heads/master", "committer_date": 1690961161000, "content_id": "6be146991d6b14b5ab362220d148d33b9b272b2e", "detected_licenses": [ "Apache-2.0", "MIT" ], "directory_id": "ea401c3e792a50364fe11f7cea0f35f99e8f4bde", "exten...
2.90625
stackv2
""" Fixed and improved version based on "extracting from C++ doxygen documented file Author G.D." and py++ code. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Extensively modified by C.M. Bruns April 2010. """ import...
467
30.82
110
16
3,646
python
[]
0
true
2024-11-18T21:11:26.218145+00:00
1,518,163,674,000
de921100a78ad749d810f8b29badb3521c27dc32
4
{ "blob_id": "de921100a78ad749d810f8b29badb3521c27dc32", "branch_name": "refs/heads/master", "committer_date": 1518163674000, "content_id": "9332907f50280ce7e29d12e606793f806ecfd78c", "detected_licenses": [ "MIT" ], "directory_id": "644984edc7bd12c395f20b204e0201aca068c541", "extension": "py", "fi...
4.3125
stackv2
# Problem: Text Justification # Difficulty: Hard # Category: String # Leetcode 68: https://leetcode.com/problems/text-justification/description/ # Description: """ Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You should p...
98
26.27
101
21
746
python
[]
0
true
2024-11-18T21:11:26.267163+00:00
1,559,152,799,000
c37d5479fa8df00c8c486385aac8719f896fde53
4
{ "blob_id": "c37d5479fa8df00c8c486385aac8719f896fde53", "branch_name": "refs/heads/master", "committer_date": 1559152799000, "content_id": "2938f55bc765e10c87a35f031352b863523936ff", "detected_licenses": [ "Apache-2.0" ], "directory_id": "e069b0ae254c4e97766d9865b9550eb2f0be32e3", "extension": "py"...
3.5625
stackv2
""" functional programming on Python example: check if string is a palendrome dependencies: pyfpm for pattern matching python 3.7.1 author: L1ttl3S1st3r 4/14/2019 """ from pyfpm.matcher import Matcher import typing class IncorrectArgException(ValueError): pass # watch a descriptions in pyfmp docs is_p...
59
19.93
73
17
321
python
[]
0
true
2024-11-18T21:11:26.487362+00:00
1,620,218,580,000
8ed25e58ff9633600cbba9eef3a40da6ff0e2642
3
{ "blob_id": "8ed25e58ff9633600cbba9eef3a40da6ff0e2642", "branch_name": "refs/heads/master", "committer_date": 1620218580000, "content_id": "e8b10f57d385b14753d811aba0f52c3133f8145f", "detected_licenses": [ "MIT" ], "directory_id": "4bd23102943b77d47f45630270387d84b034be2c", "extension": "py", "fi...
2.765625
stackv2
import cv2 import imutils import numpy as np from shared.sort_cont import sort_cont from skimage import measure from skimage.filters import threshold_local def segment_chars(plate_img, fixed_width): """ extract Value channel from the HSV format of image and apply adaptive thresholding to reveal the charac...
93
37.18
100
15
883
python
[]
0
true
2024-11-18T21:11:26.766263+00:00
1,592,760,170,000
5440b057a68ad38abd07c6e67e3f7dd0e3bbbe51
4
{ "blob_id": "5440b057a68ad38abd07c6e67e3f7dd0e3bbbe51", "branch_name": "refs/heads/master", "committer_date": 1592760170000, "content_id": "dae678b358c897cf695785b21c56df948ca578d6", "detected_licenses": [ "MIT" ], "directory_id": "80d1fbb1941ad155c8f08b25e71eb1a816cfef87", "extension": "py", "fi...
3.546875
stackv2
import random as r from PIL import Image, ImageDraw def squares(xMax, yMax, draw): step = 25 for a in range(0, xMax, step): for b in range(0, yMax, step): d = r.randint(0, 100) dark = (d, d, d) light = (r.randint(120, 150), r.randint(175, 230), r.randint(240, 255)) ...
27
24.56
83
16
227
python
[]
0
true
2024-11-18T21:11:26.886832+00:00
1,687,931,621,000
c131e07ae910b96cd2058515d6310290be4b1651
3
{ "blob_id": "c131e07ae910b96cd2058515d6310290be4b1651", "branch_name": "refs/heads/master", "committer_date": 1687931621000, "content_id": "bd2900b582d06a156abc565c29655741fa6eae69", "detected_licenses": [ "MIT" ], "directory_id": "49cbc5f4735152ecd0dfff45fd719f2705c0ab30", "extension": "py", "fi...
2.96875
stackv2
import pickle import numpy as np import pandas as pd import matplotlib.pyplot as plt # Load our stored results with open('forum_posts.pkl', "rb") as input_file: posts = pickle.load(input_file) def add_interaction(users, fu, tu): if fu not in users: users[fu] = {} if tu not in users[fu]: us...
46
27.24
60
14
345
python
[]
0
true
2024-11-18T21:11:27.130594+00:00
1,569,928,333,000
142c3a9fcc685658e1b97efd04d63021fadfdbeb
2
{ "blob_id": "142c3a9fcc685658e1b97efd04d63021fadfdbeb", "branch_name": "refs/heads/master", "committer_date": 1586717151000, "content_id": "cc5e22ec2c8678d09dfde8c799929817913dca45", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0d45fa71db161ffe77bda9351d9b3aeccdd8d3c2", "extension": "py"...
2.328125
stackv2
# -*- encoding: utf-8 -*- # # etis.py # import xml.etree.ElementTree as ET import datetime import urllib import urllib2 from HTMLParser import HTMLParser from rjetis.common import namespacify, NS URL_GET_JOURNEY = 'http://www.etis.skanetrafiken.se/Journey/Service.asmx/GetJourney' URL_GET_JOURNEY_PATH = 'http://www.e...
76
24.09
93
12
556
python
[]
0
true
2024-11-18T21:11:27.358813+00:00
1,692,243,220,000
a8398e097f6409bb4500930bb0cd75c5441504d2
3
{ "blob_id": "a8398e097f6409bb4500930bb0cd75c5441504d2", "branch_name": "refs/heads/master", "committer_date": 1692243220000, "content_id": "dc6dcf13e89373c3baaf49a84698481737d74c72", "detected_licenses": [ "MIT" ], "directory_id": "af741f8ada5dc2860faa87534536ccef3d97738e", "extension": "py", "fi...
2.671875
stackv2
from base import Base from sqlalchemy import Column, String, Integer, Date, Boolean, Numeric, ForeignKey, UniqueConstraint, PrimaryKeyConstraint class SituationReport(Base): __tablename__ = 'situation_report_data' country = Column('country', String(128)) cases = Column('cases', Integer) new_cases = C...
28
37.14
122
11
250
python
[]
0
true
2024-11-18T21:11:27.426343+00:00
1,522,855,675,000
492d96213264c8f9ca4e88ebbd8a75146e3e2a69
3
{ "blob_id": "492d96213264c8f9ca4e88ebbd8a75146e3e2a69", "branch_name": "refs/heads/master", "committer_date": 1522855675000, "content_id": "cb60cb0d57c14fe13d947acdf1265d03fa9f7aab", "detected_licenses": [ "MIT" ], "directory_id": "1c997e6b4ca5dc3e5152432dc398860660e366d6", "extension": "py", "fi...
2.640625
stackv2
import networkx as nx import numpy as np import pandas as pd import csv import matplotlib.pyplot as plt # defining which country plays which role per year within the Phoenix dataset: role_dict = {} for i in list(['USA', 'RUS', 'USSR', 'TUR', 'IRN', 'KSA', 'CHN', 'FRA', 'GER', 'GBR', 'CAN', 'IRQ', 'SYR', 'GRC']): r...
224
37.28
115
16
2,519
python
[]
0
true
2024-11-18T21:11:27.496196+00:00
1,535,011,358,000
bde32e8bab8f9fdb274519213a6cd2f73af34a5f
3
{ "blob_id": "bde32e8bab8f9fdb274519213a6cd2f73af34a5f", "branch_name": "refs/heads/master", "committer_date": 1535011358000, "content_id": "249d91bbdef37b0da0c55ad76c84c2f66f187f68", "detected_licenses": [ "MIT" ], "directory_id": "085e766b2fbb31f32bf1fe09396433cd86e0dd12", "extension": "py", "fi...
2.96875
stackv2
"""This is a util that read the data and sample 100 rows from each and save them.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import pandas as pd def sampling(): """ Sample each data file, extract 100 rows from each and save them into new f...
46
31.7
84
9
408
python
[]
0
true
2024-11-18T21:11:27.592920+00:00
1,691,969,733,000
686447c8750dc9d9b74689d4a78b182f77fc71ac
3
{ "blob_id": "686447c8750dc9d9b74689d4a78b182f77fc71ac", "branch_name": "refs/heads/master", "committer_date": 1691969733000, "content_id": "d7940ae14d5521c7cf060245ea925d245ccb5511", "detected_licenses": [ "MIT" ], "directory_id": "f5e61e489e529c47aad126f3a79e4583a869f676", "extension": "py", "fi...
2.890625
stackv2
import ast import operator import statistics from collections import defaultdict from decimal import Decimal from api import settings from api.ext.moneyformat import truncate NO_RATE = Decimal("NaN") MAX_DEPTH = 8 class ExchangePair: def __init__(self, left, right=None): if right is None: pa...
177
34.57
123
20
1,408
python
[]
0
true
2024-11-18T21:11:27.665167+00:00
1,376,578,549,000
e9e32d76b7637dcfd6ce2250949854840056a12d
3
{ "blob_id": "e9e32d76b7637dcfd6ce2250949854840056a12d", "branch_name": "refs/heads/master", "committer_date": 1376578549000, "content_id": "26b993d47ccb6aa6d6b3b44026249f7e64ff93e4", "detected_licenses": [ "Apache-2.0" ], "directory_id": "60d0bae9f7a88bfab5dbb1e71ae19bb654f3ed99", "extension": "py"...
3
stackv2
# This module contains some web-related code common to all web interfaces. import urllib, xml.sax.saxutils # From kpython import kodict from kbase import * # HTTP status codes to return to the user when his request has been processed. KWEB_LIB_STATUS_OK = 200 KWEB_LIB_STATUS_MOVED_TEMPORARILY = 307 KWEB_LIB_STATUS_I...
63
32.19
141
13
520
python
[]
0
true
2024-11-18T21:11:27.876675+00:00
1,525,954,828,000
2f107ab0ce987909583a68c27dcb2d3470b745d0
3
{ "blob_id": "2f107ab0ce987909583a68c27dcb2d3470b745d0", "branch_name": "refs/heads/master", "committer_date": 1525954828000, "content_id": "aae4e0951463f52c303a91cb13f0d34217012639", "detected_licenses": [ "MIT" ], "directory_id": "f1fa9b7f018de3bdca8ba899fae781d32fbc9646", "extension": "py", "fi...
3.34375
stackv2
import numpy as np from np_ml import HMM if __name__ == '__main__': print("--------------------------------------------------------") print("Hidden Markov Model simple example!") print("example in Statistical Learning Method(《统计学习方法》)") print("--------------------------------------------------------") ...
44
26.18
85
10
352
python
[]
0
true
2024-11-18T21:11:28.451939+00:00
1,596,045,418,000
64130709ffc49e8cf68d9b6f32eab2ca1209192f
2
{ "blob_id": "64130709ffc49e8cf68d9b6f32eab2ca1209192f", "branch_name": "refs/heads/master", "committer_date": 1596045418000, "content_id": "002adee6feaccba3748c8ad7ec011bfcdd9de163", "detected_licenses": [ "Apache-2.0" ], "directory_id": "bc8b920a4efa725716b062ac410ce665cef02ade", "extension": "py"...
2.390625
stackv2
from opfu.euro_option import EuroCall, EuroPut from opfu.synthetic import Synthetic class Butterfly(Synthetic): def __init__(self, K1, K3, T, price_1=0, price_2=0, price_3=0, S0=None, r=0.01, sigma=0.1, use_call=True): if use_call: Security = EuroCall else: Security = Euro...
20
40.15
110
11
291
python
[]
0
true
2024-11-18T21:11:28.571417+00:00
1,592,795,778,000
1d15528644c0537153454cc758e37dd1aba3a5d9
3
{ "blob_id": "1d15528644c0537153454cc758e37dd1aba3a5d9", "branch_name": "refs/heads/master", "committer_date": 1592795778000, "content_id": "f9f618e7b7cf86dd8e39fdc4c423e64a280afa1d", "detected_licenses": [ "MIT" ], "directory_id": "0f197956c3ce90c31ae34bbb2e5d706bbeed3d96", "extension": "py", "fi...
3.1875
stackv2
""" Translator functions are all defined here. A translator is simply a function (or callable) that takes field_name and item as the parameters, and returns the translated field value or a tuple of (request, callback_function). If a (request, callback_function) is returned, the callback function is expected to take re...
46
37.98
115
17
457
python
[]
0
true
2024-11-18T21:11:28.705603+00:00
1,624,271,723,000
080a7d0556515bea102a84710834b6b5b8bc5d2e
2
{ "blob_id": "080a7d0556515bea102a84710834b6b5b8bc5d2e", "branch_name": "refs/heads/main", "committer_date": 1624271723000, "content_id": "862600c9d7252137cbe9887c17b09e1cee97f10d", "detected_licenses": [ "MIT" ], "directory_id": "c85f006472aabe62e5e365d5c93627361b3d2bcc", "extension": "py", "file...
2.375
stackv2
import graphene from graphene.types import ResolveInfo from graphql_relay import from_global_id from ..base import BaseMutationPayload from tracker.api.schemas.roles import RoleDeletionSchema from tracker.api.services import validate_input from tracker.api.services.roles import ( check_user_priviliges_for_role_del...
77
32.42
74
16
540
python
[]
0
true
2024-11-18T21:11:28.757296+00:00
1,614,545,361,000
92962fa73d6193b30611593950bfe124748dd9f0
3
{ "blob_id": "92962fa73d6193b30611593950bfe124748dd9f0", "branch_name": "refs/heads/master", "committer_date": 1614545361000, "content_id": "e4c47f103a51ae5637d284d99c926f16c3f57e10", "detected_licenses": [ "Apache-2.0" ], "directory_id": "5b2adecd48b4de2915ec6cf39e265110f25ddfcb", "extension": "py"...
3.0625
stackv2
"""Functions for working with index/columns.""" import numpy as np import pandas as pd from numba import njit from collections.abc import Iterable from vectorbt.utils import checks def get_index(arg, axis): """Get index of `arg` by `axis`.""" checks.assert_type(arg, (pd.Series, pd.DataFrame)) checks.ass...
341
34.26
114
20
2,767
python
[]
0
true
2024-11-18T21:11:29.184890+00:00
1,620,058,079,000
996c5dbd4c2db44cd2501ee1078afdda5ee10dea
2
{ "blob_id": "996c5dbd4c2db44cd2501ee1078afdda5ee10dea", "branch_name": "refs/heads/master", "committer_date": 1620058079000, "content_id": "7f8d156cc57f3d4911e4e8d03899ce3943400727", "detected_licenses": [ "MIT" ], "directory_id": "45320cb725551a5f1be492795c9b5c8a51e279c8", "extension": "py", "fi...
2.328125
stackv2
import os import glob from joblib import Parallel, delayed import multiprocessing import numpy as np import pandas as pd from scipy.stats import kurtosis, skew import traceback import time # from concurrent.futures import ProcessPoolExecutor path_to_data = "/misc/vlgscratch5/RanganathGroup/lily/blood_dist/data_large/d...
75
33.81
91
18
725
python
[]
0
true
2024-11-18T21:11:29.395759+00:00
1,604,081,612,000
0aa7f4ee80c76c98532ccad654954eaa2bdc026c
3
{ "blob_id": "0aa7f4ee80c76c98532ccad654954eaa2bdc026c", "branch_name": "refs/heads/master", "committer_date": 1604081612000, "content_id": "a7948378d936cc144c511e028702f8a080be6698", "detected_licenses": [ "MIT" ], "directory_id": "58f087e76bf4f35c840dd31a4befe8fee12075cc", "extension": "py", "fi...
2.8125
stackv2
import sqlite3 from pathlib import Path from time import sleep from .web_paths import WebPathStructure from .database_factories import SqliteDatabaseFactory class SqliteDatabase: def __init__(self, database_name: str, database_config: str = '', web_path: WebPathStructure = WebPathStructure()): print(f'c...
78
33.27
119
18
535
python
[]
0
true
2024-11-18T21:11:29.458755+00:00
1,632,438,326,000
0da7d3dfd3b84d7e0ae03d7075517f351f8882ec
3
{ "blob_id": "0da7d3dfd3b84d7e0ae03d7075517f351f8882ec", "branch_name": "refs/heads/master", "committer_date": 1632438326000, "content_id": "3191b810e59ad22016f821ee6339f14a6e945016", "detected_licenses": [ "MIT" ], "directory_id": "4274bec659b2eaf147bd667a9854d478fe837524", "extension": "py", "fi...
2.859375
stackv2
"""Functions for adding edges to a PPI Graph from parsed STRING & BIOGRID API call outputs""" # %% # Graphein # Author: Arian Jamasb <arian@jamasb.io>, Ramon Vinas # License: MIT # Project Website: https://github.com/a-r-j/graphein # Code Repository: https://github.com/a-r-j/graphein import logging import networkx as ...
89
28.39
93
14
729
python
[]
0
true
2024-11-18T21:11:29.604234+00:00
1,561,273,547,000
d8aeaeb9d81b35e7d99e98ef3c3795ba573eb2a4
3
{ "blob_id": "d8aeaeb9d81b35e7d99e98ef3c3795ba573eb2a4", "branch_name": "refs/heads/master", "committer_date": 1561273547000, "content_id": "38201834de8931b406799610fe48e026ee8b04ee", "detected_licenses": [ "MIT" ], "directory_id": "7af32d9d5e1b09e11af3c63870f5a159a31dfc5f", "extension": "py", "fi...
2.96875
stackv2
#!/usr/bin/env python3 """Displaying messages on the 8x8 LED matrix on the Sense Hat.""" # 3rd party from sense_hat import SenseHat # custom from colors import ( BLACK, BLUE, GREEN, RED, WHITE,) from shapes import okay # Error codes # reset required # no space on micro SD card...
37
18.51
72
9
178
python
[]
0
true
2024-11-18T21:11:29.798681+00:00
1,622,645,489,000
73703a93d5b4b2c3d74994d21eda62f355c22011
2
{ "blob_id": "73703a93d5b4b2c3d74994d21eda62f355c22011", "branch_name": "refs/heads/master", "committer_date": 1622645489000, "content_id": "1feb28924b6ef90bf1b1ffa3bccfbeab0f304d97", "detected_licenses": [ "MIT" ], "directory_id": "84ea3c7952c154fec8fa3c2396d27353c398c74d", "extension": "py", "fi...
2.4375
stackv2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from shop.models import Product from accounts.models import User class Cart(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, null=True) created = models.DateTimeField(auto_now_add=True) ...
42
27.55
75
13
255
python
[]
0
true
2024-11-18T21:11:29.859005+00:00
1,531,171,612,000
f1343d72d2ce60e3819c67ee9bccecd9b0ec1efe
2
{ "blob_id": "f1343d72d2ce60e3819c67ee9bccecd9b0ec1efe", "branch_name": "refs/heads/master", "committer_date": 1531171612000, "content_id": "7c1d9c067ac5c4c15b3e8e1d7bf8c7f3292cfb8a", "detected_licenses": [ "MIT", "Python-2.0" ], "directory_id": "16c861cf765069c962145b79bae9bb0dc6486f4d", "exten...
2.359375
stackv2
"""Add custom filters to Jinja processor. The original purpose of this module was to be able to put links to general index and module index into sidebar, using manual URL composition with custom Jinja filters. """ import os import posixpath from sphinx.jinja2glue import BuiltinTemplateLoader _template_filters = [] ...
33
24.73
84
13
181
python
[]
0
true
2024-11-18T21:11:30.026321+00:00
1,529,952,921,000
0c248d46e6f300cd054f3aff5710c1ff1c45fe82
3
{ "blob_id": "0c248d46e6f300cd054f3aff5710c1ff1c45fe82", "branch_name": "refs/heads/master", "committer_date": 1529952921000, "content_id": "11efc7568158323bc2acc48689fc992d183be4e5", "detected_licenses": [ "MIT" ], "directory_id": "10067ec802bd38a5a9eecd70633eb95c7fb4acc7", "extension": "py", "fi...
2.953125
stackv2
# -*- coding: utf-8 -*- # option parser specifies the observable to plot and customizes the plot from optparse import OptionParser parser = OptionParser() parser.add_option("-c", "config", action="store", type="string", dest="config_string", help="specify configuration via ':'-separated string") (option...
36
38.11
77
12
322
python
[]
0
true
2024-11-18T21:11:30.079658+00:00
1,560,104,909,000
d5e6af75be5da54f1b02636a7cb1d2de0e44323d
3
{ "blob_id": "d5e6af75be5da54f1b02636a7cb1d2de0e44323d", "branch_name": "refs/heads/master", "committer_date": 1560104909000, "content_id": "5c68272c6e4d2772b94f6e2622f6cc078ebcba6d", "detected_licenses": [ "MIT" ], "directory_id": "6e1b87b2dabd50ebd10986f801bb5c9fd4ca4ed5", "extension": "py", "fi...
2.546875
stackv2
from pymongo import MongoClient, ASCENDING, TEXT, IndexModel import json import datetime with open("../sample.json") as f: users = json.load(f) for user in users: user["date_of_birth"] = datetime.datetime.strptime( user["date_of_birth"], "%d/%m/%Y" ) client = MongoClient() db = client.phonebook...
31
21.1
78
12
158
python
[]
0
true
2024-11-18T21:11:30.139903+00:00
1,552,936,056,000
bb5aae6643d62a174f28b7d492a89daffafc6120
3
{ "blob_id": "bb5aae6643d62a174f28b7d492a89daffafc6120", "branch_name": "refs/heads/master", "committer_date": 1552936056000, "content_id": "1c48d5f9f9521e09c32013b687664465b262cec1", "detected_licenses": [ "MIT" ], "directory_id": "e6ffc0832995c57335bedc8dd4faf7459e12f605", "extension": "py", "fi...
2.671875
stackv2
from ..compound import Compound from ..placeholder import Placeholder from ..primitive import Primitive from .navstate import NavState from .horz import Horz class VertFolder(NavState): """ A vertical state transitioner, that also holds recursive children. VertFolder instances are toggled between by pre...
77
32.14
79
15
565
python
[]
0
true
2024-11-18T21:11:30.262668+00:00
1,550,493,763,000
82ea188a1c12bf31545bccc9a55bc7fee17b97b8
4
{ "blob_id": "82ea188a1c12bf31545bccc9a55bc7fee17b97b8", "branch_name": "refs/heads/master", "committer_date": 1550493763000, "content_id": "85b9c090ecea91988fcbe38780451132e8c2bb06", "detected_licenses": [ "MIT" ], "directory_id": "d2312c375caa59d0b1c8b3cf1744cb33131464cc", "extension": "py", "fi...
3.515625
stackv2
""" Module containing functions for genetic algorithm """ import numpy as np from random import choice, random, randint from math import isinf class GaIndividual: def __init__(self, genes): self.fitness = None self.genes = genes def mutate(individual, prob, values): """ Return a mutated co...
143
26.89
114
19
883
python
[]
0
true
2024-11-18T21:11:30.906395+00:00
1,581,007,773,000
edb0b08943a9231f108085178a71ead6892d830f
2
{ "blob_id": "edb0b08943a9231f108085178a71ead6892d830f", "branch_name": "refs/heads/master", "committer_date": 1581007773000, "content_id": "c3a52bddcf8a51138ca355201285687efa43fdd7", "detected_licenses": [ "Apache-2.0" ], "directory_id": "694140c52d7c52c7509bab8c2e5b6b597fe01900", "extension": "py"...
2.40625
stackv2
#!/usr/bin/env python # obj_factory.py # # Copyright 2020 Jose Jouberto Fonseca Lopes. # # 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 # # U...
28
29.18
74
10
215
python
[]
0
true
2024-11-18T21:11:31.244519+00:00
1,628,131,280,000
1546fa24aa80409a1cb5958a2d7098626f0ea2a4
3
{ "blob_id": "1546fa24aa80409a1cb5958a2d7098626f0ea2a4", "branch_name": "refs/heads/master", "committer_date": 1628131280000, "content_id": "2318cc2a65203fa98e5fcfa07409428c84a86d63", "detected_licenses": [ "MIT" ], "directory_id": "0ae1d2729528a03fc8f42c7dceba84e39be5499b", "extension": "py", "fi...
3.375
stackv2
"""Contains the implementation for the Topics environment. In this environment users have a hidden preference for each topic and each item has a hidden topic assigned to it. """ import collections import numpy as np from . import environment class Topics(environment.DictEnvironment): """ An environment wher...
243
46.56
100
19
2,539
python
[]
0
true
2024-11-18T21:11:31.448906+00:00
1,594,320,936,000
a4c791f43082d29fa1d2cc25acb76977befc7560
4
{ "blob_id": "a4c791f43082d29fa1d2cc25acb76977befc7560", "branch_name": "refs/heads/master", "committer_date": 1594320936000, "content_id": "c9d4fced83f0f589477d21b756615a0e169894b7", "detected_licenses": [ "MIT" ], "directory_id": "b400f73fc6fad2b394fc907c35795c5b92cf08eb", "extension": "py", "fi...
3.6875
stackv2
import constants from copy import deepcopy PLAYERS = deepcopy(constants.PLAYERS) TEAMS = deepcopy(constants.TEAMS) allocated_teams = [] allocated_players = [] players_string = [] user_input = 0 def clean_data(collection): '''This is function that will take a collection and it will clean up the heights key w...
119
27.49
96
18
749
python
[]
0
true
2024-11-18T21:11:31.517174+00:00
1,302,094,201,000
e18125df5e5a78fbc6aaf9bbc5c4c66fbe362429
4
{ "blob_id": "e18125df5e5a78fbc6aaf9bbc5c4c66fbe362429", "branch_name": "refs/heads/master", "committer_date": 1302094201000, "content_id": "7b423ba197409d2eda332d751502080f4ff54bc8", "detected_licenses": [ "MIT" ], "directory_id": "ad65f7978673755397da1d3935ae405bf5e6802b", "extension": "py", "fi...
3.640625
stackv2
#!/usr/bin/env python __author__ = 'Richard Frankel' __email__ = 'richard@frankel.tv' __credits__ = ['Richard Frankel'] __copyright__ = "Copyright 2011, Richard Frankel" __license__ = 'MIT' __version__ = (0, 1, 1) __date__ = '6 April 2011' import copy from random import random, randrange class Candidate(object): ...
184
31.05
80
15
1,371
python
[]
0
true
2024-11-18T21:11:31.573047+00:00
1,491,407,359,000
9336ea692a43e4ca0bad4da56c7ed3719ee39fc0
3
{ "blob_id": "9336ea692a43e4ca0bad4da56c7ed3719ee39fc0", "branch_name": "refs/heads/master", "committer_date": 1491407359000, "content_id": "3d331d0c108f46827a0d9ba60ea9061f28d5ad04", "detected_licenses": [ "MIT" ], "directory_id": "9eddc8421a586ae45d896e6384c05d4caaefb3ca", "extension": "py", "fi...
2.53125
stackv2
#!/usr/bin/env python import pickle import numpy as np import gym from sklearn.model_selection import train_test_split from sklearn.externals import joblib from sklearn.linear_model import Ridge from sklearn.ensemble import RandomForestRegressor def main(): data = pickle.load(open('data-ant.pkl', 'rb')) obse...
35
25.86
76
13
288
python
[]
0
true
2024-11-18T21:11:31.847843+00:00
1,549,969,583,000
cbc07ab914063e0e1c05056d67bd4efb92ccab8f
3
{ "blob_id": "cbc07ab914063e0e1c05056d67bd4efb92ccab8f", "branch_name": "refs/heads/master", "committer_date": 1549969583000, "content_id": "d741d94604f80c16efb7189687ac89dbbc1c5b0b", "detected_licenses": [ "MIT" ], "directory_id": "9bc83158dff307b3e68f4049863a29c93f5c2773", "extension": "py", "fi...
2.703125
stackv2
# -*- coding: utf-8 -*- """ @author: jamin, zhiruiwang """ from __future__ import print_function import pandas import numpy from tableausdk import * try: from tableausdk.Extract import * print("You are using the Tableau SDK, please save the output as .tde format") except: pass try: from tableausdk.HyperExtract i...
215
38.11
146
20
1,588
python
[]
0
true
2024-11-18T21:11:31.951893+00:00
1,590,379,620,000
b5f850b7cce1c05523effe1dccae29b5f1b8b533
3
{ "blob_id": "b5f850b7cce1c05523effe1dccae29b5f1b8b533", "branch_name": "refs/heads/master", "committer_date": 1590379620000, "content_id": "438ace7d7b101320fbec1a447b0badeb3edfb506", "detected_licenses": [ "MIT" ], "directory_id": "566754f63c0d665af01bdad8814873468f8be888", "extension": "py", "fi...
2.78125
stackv2
#!/usr/bin/python3 # -*- coding: utf-8 -*- import re str = '''Train Epoch: 1 Train Iteration: 260 Time 1.609s / 20iters, (0.080) Data load 0.036s / 20iters, (0.001794) Learning rate = [0.1, 0.1] Loss = {ce_loss: 2.3057, loss: 2.3117} ''' print("#+++++++++++#") RE_CLS_IC_TRAIN = re.compile(r'Train Epoch: (?P<epoch>\...
47
39.13
114
12
612
python
[]
0
true
2024-11-18T21:11:32.024310+00:00
1,681,179,316,000
e58128f9a7af38426f4c8f407d03a60bd0da3f15
3
{ "blob_id": "e58128f9a7af38426f4c8f407d03a60bd0da3f15", "branch_name": "refs/heads/main", "committer_date": 1681179316000, "content_id": "2c4d7e118240001765b5b105110ce24dc8c99c20", "detected_licenses": [ "MIT" ], "directory_id": "0cca742d0d5b45b6605e42a8e3c8840d4aca595f", "extension": "py", "file...
2.734375
stackv2
# -*- coding: utf-8 -*- """ Created on 2020.05.19 @author: Jiahua Rao, Weiming Li, Hui Yang, Jiancong Xie Code based on: Shang et al "Edge Attention-based Multi-Relational Graph Convolutional Networks" -> https://github.com/Luckick/EAGCN Coley et al "Convolutional Embedding of Attributed Molecular Graphs for Physical...
198
36.36
150
18
1,782
python
[]
0
true
2024-11-18T21:11:32.255308+00:00
1,632,075,152,000
ff2634daad723529f6c5930986fb3a4c44752537
3
{ "blob_id": "ff2634daad723529f6c5930986fb3a4c44752537", "branch_name": "refs/heads/master", "committer_date": 1632075239000, "content_id": "b2c8b09afd03ac12fdad40963f74d1836feab553", "detected_licenses": [ "Apache-2.0" ], "directory_id": "41db9c4110ef022a7bb5b8da8e3bf2c6bc70c464", "extension": "py"...
2.6875
stackv2
# Implements a DiscordBot class that provides a interface for interacting # with discord's bot API import os import discord import asyncio import logging import threading from twitch_monitor_discord_bot.command_processor import CommandProcessor, twitch_monitor_bot_command_list logger = logging.getLogger(__name__) lo...
128
30.45
107
18
774
python
[]
0
true
2024-11-18T21:11:32.392504+00:00
1,475,408,267,000
0aa1e75833f42a72d18b7ca4662da9ad1e12cc54
3
{ "blob_id": "0aa1e75833f42a72d18b7ca4662da9ad1e12cc54", "branch_name": "refs/heads/master", "committer_date": 1475408526000, "content_id": "1ecea7dbdb4c63510bf392a15748fcd869ef8d4d", "detected_licenses": [ "MIT" ], "directory_id": "99b31155d21793bd0ec3e9bc2073b33925d3a065", "extension": "py", "fi...
2.546875
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- from src.tools import * # Inspect data for any missing datetime and non numeric type. # # Checking non numeric data # # data = grimmData['5-Grimm'] # # for i in range(0,200): # # value = data.iloc[i] # # if isinstance(value,object): # # print(i) if __nam...
51
34.33
85
17
416
python
[]
0
true
2024-11-18T21:11:32.458146+00:00
1,693,477,536,000
cc7403e1efc14fb2e019d85deb300f9a89767386
3
{ "blob_id": "cc7403e1efc14fb2e019d85deb300f9a89767386", "branch_name": "refs/heads/master", "committer_date": 1693477536000, "content_id": "d23b5a46723cb743178657473b0442f807fc0548", "detected_licenses": [ "MIT" ], "directory_id": "c9500ad778b8521aaa85cb7fe3239989efaa4799", "extension": "py", "fi...
2.640625
stackv2
from .base import ViperBase class Tag(ViperBase): pathName = "project/{project_name}/tag/" def __init__(self, config, project_name, **data): super().__init__(config) self.project_name = project_name self.id = data.get("id") self.tag = data.get("tag") def __str__(self): ...
26
29.23
87
14
192
python
[]
0
true
2024-11-18T21:11:32.517614+00:00
1,536,837,014,000
bedddd88aaf2cfd78f5c94fcf81d71204e6635eb
3
{ "blob_id": "bedddd88aaf2cfd78f5c94fcf81d71204e6635eb", "branch_name": "refs/heads/master", "committer_date": 1536837014000, "content_id": "ea3e0364c746b440cdeaa4607adbff26743add5a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "2d91fa8375583ce83a44cb23dca31184f2375667", "extension": "py"...
3.3125
stackv2
""" Class for diffing xmls """ from __future__ import print_function from copy import deepcopy import os from lxml import etree from pyocnos.diff import get_element_path from pyocnos.diff.block import Block class XmlDiff(object): """ Class given two xml produces a diff """ def __init__(self, runnin...
108
30.66
87
18
742
python
[]
0
true
2024-11-18T21:11:32.562057+00:00
1,620,413,327,000
83032cc81d258ffd4f60b666760dca4b39284918
3
{ "blob_id": "83032cc81d258ffd4f60b666760dca4b39284918", "branch_name": "refs/heads/master", "committer_date": 1620413327000, "content_id": "d414cfc09776fa2aa4b323f598f03fe7ab1baadb", "detected_licenses": [ "MIT" ], "directory_id": "fce19b8d911b9ac4bd01f0c521282d739439aa5f", "extension": "py", "fi...
3.078125
stackv2
from __future__ import division try: from collections.abc import Iterable except: from collections import Iterable import warnings from itertools import product import numpy as np # TODO: Incorporate @pablodecm's cover API. __all__ = ["Cover", "CubicalCover"] class Cover: """Helper class that defines ...
285
33.39
142
20
2,562
python
[]
0
true
2024-11-18T21:11:32.654974+00:00
1,460,248,300,000
e0e05d376c82aafcffb8cfe66c9bacdc8d6ab7bc
2
{ "blob_id": "e0e05d376c82aafcffb8cfe66c9bacdc8d6ab7bc", "branch_name": "refs/heads/master", "committer_date": 1460248300000, "content_id": "cc246d1c05a09fd52930bc826e199e0d97b07c28", "detected_licenses": [ "MIT" ], "directory_id": "af430e775b7989d912a4e5747d81e7418193bda0", "extension": "py", "fi...
2.5
stackv2
import os import threading import time class FileMonitor(threading.Thread): def __init__(self, logfile, irc_client): threading.Thread.__init__(self) self._running = False self._irc_client = irc_client self._filehandle = None self._logfile = logfile def abort(self): ...
65
29.6
105
17
426
python
[]
0
true
2024-11-18T21:11:33.022930+00:00
1,555,011,841,000
c50e226b6eb906f7dab0470b3eb14e5d99c5a31a
3
{ "blob_id": "c50e226b6eb906f7dab0470b3eb14e5d99c5a31a", "branch_name": "refs/heads/master", "committer_date": 1555011841000, "content_id": "fed86b5845b935d3215bfcec703a5d9c1fc38f19", "detected_licenses": [ "MIT" ], "directory_id": "dc6f441e595aab2453ca4f0940b0f3386b37c01a", "extension": "py", "fi...
2.765625
stackv2
file = open("test.txt", "r") content=file.read() measurements=content.split('\n') class Log: def __init__(self, alt,temp,acceleration,orientation,pressure): #self.time = time self.alt=float(alt) self.temp = float(temp) self.orientation=[float(i) for i in orientation] self.a...
27
22.48
99
15
186
python
[]
0
true
2024-11-18T21:11:33.463162+00:00
1,637,250,094,000
57e9c92eab42f7d9890dda5a0609e7cf251e692d
2
{ "blob_id": "57e9c92eab42f7d9890dda5a0609e7cf251e692d", "branch_name": "refs/heads/main", "committer_date": 1637250094000, "content_id": "da72ed455444b12c5cada60b39deec9c65ec584e", "detected_licenses": [ "MIT" ], "directory_id": "862d353b20881d1c334884394ffbb8e839aff7d3", "extension": "py", "file...
2.359375
stackv2
import sys import time import requests from API.AesDecrypt import decrypt, example from API import UrlConstants headers = { "Host": "api.laomaoxs.com", "Keep-Alive": "300", "Connection": "Keep-Alive", "Cache-Control": "no-cache", "Accept-Encoding": "gzip", "User-Agent": "Mozilla/5.0 (Windows NT...
43
36.44
130
21
446
python
[]
0
true
2024-11-18T21:11:34.033966+00:00
1,598,949,683,000
d5a6f76edb7618bd539a65feb8fefb4d7df7980d
2
{ "blob_id": "d5a6f76edb7618bd539a65feb8fefb4d7df7980d", "branch_name": "refs/heads/master", "committer_date": 1598949683000, "content_id": "0cf5d98c32b0dba2c93faffb13bc4e531c22a9ba", "detected_licenses": [ "MIT" ], "directory_id": "42593b78ca4414fdbb736ea4fd9ee7280d8c99be", "extension": "py", "fi...
2.4375
stackv2
import torch from torch.utils.data import Sampler, BatchSampler, Dataset, DataLoader import numpy as np import h5py from alcokit.hdf.api import FeatureProxy from alcokit.sources import ScoredSourceMixin, NPSource class FlatSampler(Sampler): """ returns INT indices """ def __init__(self, score, shuffle...
184
29.33
107
18
1,343
python
[]
0
true
2024-11-18T21:11:34.083765+00:00
1,683,103,715,000
68a8297e7a989c1b8333bfb41f289dbb3c034a26
2
{ "blob_id": "68a8297e7a989c1b8333bfb41f289dbb3c034a26", "branch_name": "refs/heads/main", "committer_date": 1683103715000, "content_id": "b439a0b9c43e55ce042d7184312e4083ff881bff", "detected_licenses": [ "MIT" ], "directory_id": "c0cfa8589bcdececd9eca58606e752df6110aaac", "extension": "py", "file...
2.421875
stackv2
from logging import getLogger from typing import List, Set from gnosis.eth import EthereumClient from ..models import EthereumEvent from .transaction_scan_service import TransactionScanService logger = getLogger(__name__) class Erc20EventsServiceProvider: def __new__(cls): if not hasattr(cls, "instance...
98
33.28
96
15
761
python
[]
0
true
2024-11-18T21:11:34.198666+00:00
1,362,065,636,000
912a25c69fd1f444a86db912a924140e9872f5bd
2
{ "blob_id": "912a25c69fd1f444a86db912a924140e9872f5bd", "branch_name": "refs/heads/master", "committer_date": 1362065636000, "content_id": "b9f07c2e48487bf272a52df6669a6ca7cee147e2", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "80b9b95464a68a4e86b035fc40047326a682444d", "extension": "p...
2.40625
stackv2
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2011 Christopher Lenz, Dirkjan Ochtman, Matt Goodall # Copyright (C) 2011 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # Reworked and adapted version...
465
32.62
80
24
3,345
python
[]
0
true
2024-11-18T21:11:34.313799+00:00
1,574,215,389,000
359eff8d4a4e25f98c48efe5e1cbfa2ce6af1ef4
3
{ "blob_id": "359eff8d4a4e25f98c48efe5e1cbfa2ce6af1ef4", "branch_name": "refs/heads/master", "committer_date": 1574215389000, "content_id": "5bc4bf876ffb1d5d107bfd1f9e3ffd41921c9ec2", "detected_licenses": [ "MIT" ], "directory_id": "fac51719e067ee2a70934e3bffdc98802d6dbb35", "extension": "py", "fi...
2.578125
stackv2
import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), '../tools')) import files import fasta import phylogeny def main(argv): lines = files.read_lines(argv[0]) tree = lines[0] strings = fasta.read_from(lines[1:]) output = [] for r in phylogeny.reverse_substitutions(tr...
29
25.1
123
14
204
python
[]
0
true
2024-11-18T21:11:34.764419+00:00
1,412,720,483,000
00c665f7c947f899499afa7ad216bbf9b1a7ba5e
3
{ "blob_id": "00c665f7c947f899499afa7ad216bbf9b1a7ba5e", "branch_name": "refs/heads/master", "committer_date": 1412720483000, "content_id": "ca9bc5a69282c42b9001a8cb302db91e6c7015e0", "detected_licenses": [ "MIT" ], "directory_id": "30ae29822f483c6a9206ddd8ceb7a9368db1907b", "extension": "py", "fi...
3.15625
stackv2
""" Author: Huba Nagy """ import pygame from common_util import * class WorldBase(object): """ Base class for different types of grid based world, this class is absolutely not intended for use outside this package so don't use it, it will throw errors at you. See the tiles and the voxels modules. """ def __i...
175
20.22
79
15
899
python
[]
0
true
2024-11-18T21:11:34.824925+00:00
1,629,131,007,000
d98607a7d763a7f5e86406900155b16ad33ce306
3
{ "blob_id": "d98607a7d763a7f5e86406900155b16ad33ce306", "branch_name": "refs/heads/main", "committer_date": 1629131007000, "content_id": "6250d8234a01c496a65734306bb173de5b40315d", "detected_licenses": [ "MIT" ], "directory_id": "618d02a9264a3004fe8bdf05a33344cf5eb43e7d", "extension": "py", "file...
2.8125
stackv2
from dataclasses import dataclass import re from torchtext.data.utils import get_tokenizer from torchtext.vocab import GloVe from torchtext.vocab import Vocab import torch from typing import List, Union from synthetic_ra.data.constants import PAD_TOKEN from synthetic_ra.data.constants import START_TOKEN from synthetic...
61
30.11
79
16
419
python
[]
0
true
2024-11-18T21:11:34.915618+00:00
1,610,053,339,000
8fc2486928893d18b32ecd60ad07ef546171cdb2
3
{ "blob_id": "8fc2486928893d18b32ecd60ad07ef546171cdb2", "branch_name": "refs/heads/master", "committer_date": 1610053339000, "content_id": "6a755edf3114063845d3e790cf12d771644ad59b", "detected_licenses": [ "MIT" ], "directory_id": "ba65dbb459664e0ae48f5e4db7a0112c46a6b961", "extension": "py", "fi...
2.5625
stackv2
from ..core import Core from ..utils.exchangeversion import ExchangeVersion class ResolveNames(Core): '''Resolve names based on the provided UserConfiguration object. This class is used as an alternative to Autodiscover since ResolveNames endpoint is a common endpoint across all versions of Microsoft...
87
38.05
118
25
696
python
[]
0
true
2024-11-18T21:11:35.041224+00:00
1,649,299,522,000
a328fbe0c82d400dddc4b90b54d344ca18b34ff7
3
{ "blob_id": "a328fbe0c82d400dddc4b90b54d344ca18b34ff7", "branch_name": "refs/heads/master", "committer_date": 1649517510000, "content_id": "8217242458be240d878855e74a1730d757795b32", "detected_licenses": [ "MIT" ], "directory_id": "2871296d9e86493599451001e71485893d322795", "extension": "py", "fi...
2.8125
stackv2
from typing import Any, Dict import torch from torch import nn import torchvision class VisualBackbone(nn.Module): r""" Base class for all visual backbones. All child classes can simply inherit from :class:`~torch.nn.Module`, however this is kept here for uniform type annotations. """ def __...
120
34.55
83
14
952
python
[]
0
true
2024-11-18T21:11:35.101588+00:00
1,426,602,748,000
13b18a9425cd18488510b3fa264c79054239e577
3
{ "blob_id": "13b18a9425cd18488510b3fa264c79054239e577", "branch_name": "refs/heads/master", "committer_date": 1426602748000, "content_id": "24f41a75908db460cdeafb7a355e07b6e5344c00", "detected_licenses": [ "MIT" ], "directory_id": "3fa94ba1ed08f6e0ca0be8e57d333b26c62a9213", "extension": "py", "fi...
3.375
stackv2
from __future__ import division import nltk, re, pprint from nltk.corpus import names import random, string # Fitur ML pada NLTK # NaiveBayesClassifier # EXPERIMEN 1 # Klasifikasi nama cewek atau cowok berdasarkan huruf akhirnya (+ tambah fitur baru sekalian) def gender_features(word): # Frequency of a..z wo...
74
27.69
148
11
564
python
[]
0
true
2024-11-18T21:11:35.153620+00:00
1,593,786,928,000
30f5e3483bcc557df400ae9abbc27c56e2ddfc47
3
{ "blob_id": "30f5e3483bcc557df400ae9abbc27c56e2ddfc47", "branch_name": "refs/heads/master", "committer_date": 1593786928000, "content_id": "4cdf60feaf5965ee444e6b0a53763ef037ad5448", "detected_licenses": [ "MIT" ], "directory_id": "b9c1e8a4f2b94b1036120339a616e773ce0e3526", "extension": "py", "fi...
2.84375
stackv2
import speech_recognition as sr import sys r = sr.Recognizer() filename = sys.argv[1] # with sr.Microphone() as source: # print("Say Something ---") # audio = r.listen(source) # print("Done") with sr.AudioFile(filename) as source: audio = r.listen(source) # text = r.recognize_google(audio, language ...
18
24.44
79
8
119
python
[]
0
true
2024-11-18T21:11:35.253362+00:00
1,508,975,961,000
589852c73ed612b2e841485910c625fb70ed1034
3
{ "blob_id": "589852c73ed612b2e841485910c625fb70ed1034", "branch_name": "refs/heads/master", "committer_date": 1508975961000, "content_id": "09f9432f0ae05d1ac68ab2d169ad0eae91dfc03a", "detected_licenses": [ "MIT" ], "directory_id": "e20cfd4f3a88e7a2eb0d7fb54e2aeda8fe66bc7d", "extension": "py", "fi...
3.203125
stackv2
'''' This is an helper class to the Chilean economic indicator http://mindicador.cl/ using the awesome requests library you can get uf, ivp, dolar, etc. a simple example: >> m = Mindicador() >> m = m.get_uf() >> uf {'fecha': '2017-07-23T04:00:00.000Z', 'nombre': 'Unidad de fomento (UF)', 'codigo': 'uf', 'unidad_medid...
84
26.21
96
14
641
python
[]
0
true
2024-11-18T21:11:35.562461+00:00
1,682,430,535,000
880297d5ea3ce04da55591fac2ce3cee0023f115
3
{ "blob_id": "880297d5ea3ce04da55591fac2ce3cee0023f115", "branch_name": "refs/heads/master", "committer_date": 1682430535000, "content_id": "ef4517833faed67999f5a1ad79dbf5408f0f2ad5", "detected_licenses": [ "MIT" ], "directory_id": "aabe934161efb731552e06c06d798f0e8c5553aa", "extension": "py", "fi...
2.546875
stackv2
import vcr from behave import given, when, then from hamcrest import (assert_that, has_length, greater_than, is_not, empty) @given('I have a performance ID for event with ID "{event_id}"') @vcr.use_cassette('fixtures/cassettes/availability-performances.yaml', record_mode='new_episodes') def give...
58
35.47
98
16
462
python
[]
0
true
2024-11-18T21:11:36.224429+00:00
1,564,729,167,000
06b23218f7e52e5ead1610dd276f226ad88d67a4
3
{ "blob_id": "06b23218f7e52e5ead1610dd276f226ad88d67a4", "branch_name": "refs/heads/master", "committer_date": 1564729167000, "content_id": "c127d80c0cca6ccb253b148803ef334b68f4243d", "detected_licenses": [ "MIT" ], "directory_id": "6e9546382c4c94cdf15a4df6c5d87a446763a125", "extension": "py", "fi...
3.390625
stackv2
#!/bin/python3 import math import os import random import re import sys """ If N is odd, print Weird If N is even and in the inclusive range of 2 to 5, print Not Weird If N is even and in the inclusive range of 6 to 20, print Weird If N is even and greater than , print Not Weird """ if __name__ == '_...
22
21.86
70
11
166
python
[]
0
true
2024-11-18T21:11:36.567015+00:00
1,515,206,626,000
0cc03dab10a92e4e23fa9b5609d0b3d872fce2a0
3
{ "blob_id": "0cc03dab10a92e4e23fa9b5609d0b3d872fce2a0", "branch_name": "refs/heads/master", "committer_date": 1515206626000, "content_id": "c70336e0d6ab880a95ef56867020e9e344dc677e", "detected_licenses": [ "MIT" ], "directory_id": "68621c990ca84dd3cf0226a12160358ad1321540", "extension": "py", "fi...
3.484375
stackv2
from .Board import Board from .LocalBoard import LocalBoard from .Move import Move class GlobalBoard(Board): """ Represents the meta-board composed of a 3x3 grid of smaller tic-tac-toe boards the optional 'board' parameter is used internally clone GlobalBoard objects """ def __init__(self, board=None...
175
37.53
141
20
1,635
python
[]
0
true
2024-11-18T21:11:36.746518+00:00
1,628,883,524,000
6ba30df9404784bebc2504a1d20466fba38d09d1
3
{ "blob_id": "6ba30df9404784bebc2504a1d20466fba38d09d1", "branch_name": "refs/heads/master", "committer_date": 1628883524000, "content_id": "f88fde5f372bfc7d2efa4bec3474deaff41b018b", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "f38a7681c0fb24f68a586909ddcd8b7af43f3565", "extension": "p...
3
stackv2
"""Helpers for working with JWTs. Encapsulates the ``jwt`` lib.""" import copy import datetime import jwt from lms.validation.authentication._exceptions import ExpiredJWTError, InvalidJWTError __all__ = ["decode_jwt", "encode_jwt"] def decode_jwt(jwt_str, secret): """ Return the payload decoded from ``jwt_...
67
26.07
86
15
449
python
[]
0
true
2024-11-18T21:11:36.934574+00:00
1,537,369,684,000
598cd11bdf31e4d96a3421d52d64d72f336efeef
3
{ "blob_id": "598cd11bdf31e4d96a3421d52d64d72f336efeef", "branch_name": "refs/heads/master", "committer_date": 1537369684000, "content_id": "4443af6163ed1fddc8165bba05771221dd8980a0", "detected_licenses": [ "MIT" ], "directory_id": "9d716e3955d3c49ab67c88655fd0f010292c9ded", "extension": "py", "fi...
2.75
stackv2
#!/usr/bin/env python3 import traceback import better_exceptions import numpy as np import soundfile import random import time import sys from SpnAudioSlice import SpnAudioSlice import SpoonModes MODES=SpoonModes.SpoonSliceModes() LOOP_MODES=SpoonModes.SpoonLoopModes() from spoon_logging import D, L, W, E class S...
221
36.1
158
18
1,745
python
[]
0
true
2024-11-18T21:11:37.563266+00:00
1,623,948,822,000
9cd3c0143965f8b590bca9773f0329dcf2d773e6
2
{ "blob_id": "9cd3c0143965f8b590bca9773f0329dcf2d773e6", "branch_name": "refs/heads/main", "committer_date": 1623948822000, "content_id": "266134b9db04dda8f0c4e77d4e0e01107caf1c08", "detected_licenses": [ "MIT" ], "directory_id": "68fb934e899d24e13df4022e0955dce17b5fa13e", "extension": "py", "file...
2.359375
stackv2
#!/usr/bin/env python #--------Include modules--------------- import rospy import tf from numpy import * import numpy as np # Node---------------------------------------------- def node(): rospy.init_node('vrpn_inital_poses', anonymous=False) rate = rospy.Rate(100) listener = tf.TransformListener() listener.w...
47
20.34
84
12
282
python
[]
0
true
2024-11-18T21:11:37.733332+00:00
1,521,466,845,000
da5c90083e360dc00de4cc3920cc5dfce9acd7bb
3
{ "blob_id": "da5c90083e360dc00de4cc3920cc5dfce9acd7bb", "branch_name": "refs/heads/master", "committer_date": 1521466845000, "content_id": "3dc895c54b15a60ef84a263fbcd8b7682c326ae4", "detected_licenses": [ "MIT" ], "directory_id": "a4ae4271616fbac571f47e4afe08e70ebcf7ae18", "extension": "py", "fi...
2.8125
stackv2
import math bigR = 360 ## radius of entire plot c = 10 ## number of emotion categories t = 4 ## number of intensity levels per category (minus 1) p = 0.75 ## proportion of (circle / next biggest circle) g = 0.01 ## gap between category sectors [(gap size) / (circle size * c)] s = 25 ## space between same intensity lev...
181
28.9
112
15
1,828
python
[]
0
true
2024-11-18T21:11:37.793960+00:00
1,584,127,637,000
cf1c45b41d1a0394f0226d5b90dbd67896a94275
3
{ "blob_id": "cf1c45b41d1a0394f0226d5b90dbd67896a94275", "branch_name": "refs/heads/master", "committer_date": 1584127637000, "content_id": "8e87f35a9e26b474993e31bd1687016908c01c8a", "detected_licenses": [ "Apache-2.0" ], "directory_id": "b645d15b85b02197c4f5096fb687e026c8e62ae9", "extension": "py"...
2.703125
stackv2
#!/usr/bin/python #-*- coding: utf-8 -*- """ This script will take all the images from inputfile.txt and classify according the neural net. It will create an output file that have the path from the image, the correct label, and the predict label. """ import logging logger = logging.getLogger(__name__) logging.basicConf...
169
34.66
115
19
1,482
python
[]
0
true
2024-11-18T21:11:38.033141+00:00
1,472,644,243,000
ac8f3062745579ca894a04654dbbb911454d5f4e
3
{ "blob_id": "ac8f3062745579ca894a04654dbbb911454d5f4e", "branch_name": "refs/heads/master", "committer_date": 1472644243000, "content_id": "7df234e61f79ceae9c76df87421bae6a1ae7fb73", "detected_licenses": [ "MIT" ], "directory_id": "62eacefdda6d278335c43c86447e5e6c50d19512", "extension": "py", "fi...
3.328125
stackv2
import pandas as pd from sklearn.feature_selection import SelectKBest, f_classif def select_kbest_clf(data_frame, target, k=4): """ Selecting K-Best features for classification :param data_frame: A pandas dataFrame with the training data :param target: target variable name in DataFrame :param k: de...
32
36.72
78
11
308
python
[]
0
true
2024-11-18T21:11:38.390978+00:00
1,407,147,272,000
5506bf262c357c87a21e8706a5535023af1e4913
3
{ "blob_id": "5506bf262c357c87a21e8706a5535023af1e4913", "branch_name": "refs/heads/master", "committer_date": 1407147272000, "content_id": "f22da3368276f7496712327c094e4e634cc42c8c", "detected_licenses": [ "BSD-3-Clause", "BSD-2-Clause" ], "directory_id": "ba084662496080c9366f5214f45a6d26d563d020...
2.578125
stackv2
# -*- coding: utf-8 -*- from __future__ import ( division, print_function, absolute_import, unicode_literals ) import tempfile import logging import os from operator import itemgetter import click from lxml import etree from __init__ import __version__ log = logging.getLogger(__name__) class Project(object):...
143
34.03
96
17
1,088
python
[]
0
true
2024-11-18T21:11:38.581420+00:00
1,635,287,554,000
8958fc2fccdfdd3bf5a556f1f346fe82fc34d26d
4
{ "blob_id": "8958fc2fccdfdd3bf5a556f1f346fe82fc34d26d", "branch_name": "refs/heads/master", "committer_date": 1635287554000, "content_id": "1aed47b79474e3cba7413e5a4b23adf7117fe484", "detected_licenses": [ "MIT" ], "directory_id": "21fec19cb8f74885cf8b59e7b07d1cd659735f6c", "extension": "py", "fi...
3.5
stackv2
"Message and Entry" ''' The Message and Entry widgets allow for display and input of simple text. Both are essentially functional subsets of the Text widget; Text can do everything Message and Entry can, but not vice versa. ''' "Message" ''' The Message widget is simply a place to display text. Message splits up long ...
20
30.7
82
8
143
python
[]
0
true
2024-11-18T21:11:38.841556+00:00
1,642,189,002,000
95cad73ca34bc933ee28fb31e6b52608ca76a0fe
2
{ "blob_id": "95cad73ca34bc933ee28fb31e6b52608ca76a0fe", "branch_name": "refs/heads/master", "committer_date": 1642189002000, "content_id": "514ac85e76976f7f86b249d3b50983e6d719d648", "detected_licenses": [ "MIT" ], "directory_id": "505d1db79df0408d030f9c005447fbc17f4e04c9", "extension": "py", "fi...
2.421875
stackv2
from ctypes import c_uint32, addressof from bearlibterminal import terminal as blt import pickle # TODO: REFACTOR THESE NAMES?? WTF, PUT THEM UNDER A CLASS OR SOMETHING openables_names = ["gate", "gate (open)", "gate (closed)", "gate (locked)", "door", "...
248
41.29
119
15
3,351
python
[]
0
true
2024-11-18T21:11:38.895098+00:00
1,575,642,118,000
98b2b776bd123494a0128934559e5dda97888035
2
{ "blob_id": "98b2b776bd123494a0128934559e5dda97888035", "branch_name": "refs/heads/master", "committer_date": 1575642118000, "content_id": "75ad61143498b0eb8e1b0ac7457b441f35899739", "detected_licenses": [ "MIT" ], "directory_id": "2fa640b59bd854c67292cb9687ba9c71704a2307", "extension": "py", "fi...
2.359375
stackv2
from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Telefone, Endereco ##### Formulário para cadastro de usuário ##### class PessoaUserForm(UserCreationForm): def __init__(self, *args, **kwargs): super(PessoaUserF...
84
46.86
117
12
968
python
[]
0
true
2024-11-18T21:11:39.041401+00:00
1,624,247,135,000
bcf5db1f0b6c39ccb53d02c370e5258ba1d3b80c
3
{ "blob_id": "bcf5db1f0b6c39ccb53d02c370e5258ba1d3b80c", "branch_name": "refs/heads/master", "committer_date": 1624247135000, "content_id": "d181e18fe397f888eb206b19027b1e1f0d979f2c", "detected_licenses": [ "MIT" ], "directory_id": "7a0f78930ed6c72ac57a41d548ed2bc37ee351d4", "extension": "py", "fi...
2.609375
stackv2
import logging from flask import request, abort, Blueprint from nb_processor_service import NBService from invalid_nb_error import InvalidNotebookError from no_content_nb_error import NoContentNotebookError nb_controller_blue_print = Blueprint("nb_processor_controller", __name__) @nb_controller_blue_print.route('/...
39
31.41
89
11
270
python
[{"finding_id": "codeql_py/log-injection_7edbd42f04da266d_f6adfc5c", "tool_name": "codeql", "rule_id": "py/log-injection", "finding_type": "path-problem", "severity": "medium", "confidence": "medium", "message": "This log entry depends on a [user-provided value](1).", "remediation": "", "location": {"file_path": "unkno...
1
true
2024-11-18T21:11:39.384528+00:00
1,617,231,158,000
c023df1aefe07d91824c594785695a3fdcc39955
4
{ "blob_id": "c023df1aefe07d91824c594785695a3fdcc39955", "branch_name": "refs/heads/main", "committer_date": 1617231158000, "content_id": "d6acee02ba283ee3039e444529cdfa2ef9f8ab88", "detected_licenses": [ "MIT" ], "directory_id": "5c17fba3f5d0845ca8bd972ac62f484c17a63406", "extension": "py", "file...
4.46875
stackv2
# Exercício 037 print('-' * 15) print('''Digite um número inteiro qualquer e logo em seguida digite: 1 para transformar em binário, 2 para transformar em octal e 3 para trans- formar em hexadecimal.''') print('-' * 15) número = int(input('Digite um número inteiro: ')) print('Escolha uma das bases pra conversão:') prin...
28
34.89
68
12
282
python
[]
0
true
2024-11-18T21:11:39.447882+00:00
1,599,758,226,000
3e72848271dabd51d6b6868986468e17369a5a33
3
{ "blob_id": "3e72848271dabd51d6b6868986468e17369a5a33", "branch_name": "refs/heads/master", "committer_date": 1599758226000, "content_id": "c9116bc631ba3d5adc7ce9d9ea3281dfc5d27324", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "533922c205e8298c5ebcc0ba31dc277de46a1017", "extension": "p...
2.890625
stackv2
from kivymd.app import MDApp from kivy.lang import Builder from kivymd.uix.list import OneLineListItem list_helper = """ Screen: ScrollView: MDList: id: container """ class DemoApp(MDApp): def build(self): screen = Builder.load_string(list_helper) return screen def ...
26
18.12
60
17
119
python
[]
0
true
2024-11-18T21:11:39.553696+00:00
1,592,994,217,000
1b0afd34e6b1c41b6d08d562077c2917b054e99e
3
{ "blob_id": "1b0afd34e6b1c41b6d08d562077c2917b054e99e", "branch_name": "refs/heads/master", "committer_date": 1592994217000, "content_id": "0a3bfe54f7b2dab8aecd3da025ea436b7f1db45a", "detected_licenses": [ "MIT" ], "directory_id": "e0950322df54d3276fa1b6e4dc60237f27c4c9f4", "extension": "py", "fi...
3.1875
stackv2
""" The Furniture problem from EngSci391 for the PuLP Modeller Author: Dr Stuart Mitchell 2007 """ from pulp import * Chairs = ["A","B"] costs = {"A":100, "B":150} Resources = ["Lathe","Polisher"] capacity = {"Lathe" : 40, "Polisher" : 48} activity = [ #Chairs #A B ...
31
32.68
77
14
304
python
[]
0
true
2024-11-18T21:11:39.717192+00:00
1,524,175,833,000
57a79ecdb0e6b4fc4da4340b89db2aea00f3883f
3
{ "blob_id": "57a79ecdb0e6b4fc4da4340b89db2aea00f3883f", "branch_name": "refs/heads/master", "committer_date": 1524175833000, "content_id": "ace0d27036c24db7798c53ed57cf244626d9cb2e", "detected_licenses": [ "MIT" ], "directory_id": "a3edfb7d82206fef524516fd9c6056a005d41c59", "extension": "py", "fi...
3.359375
stackv2
#!/usr/bin/python import sys import subprocess #function for taking and storing the raspberry camera module photo def take_photo(filename) : process = subprocess.call(['raspistill', '-o' , filename]) if process == 0: print("Photo taken and saved as " + filename + ".") else: print("An error occured while tryin...
41
28.88
83
14
315
python
[]
0
true
2024-11-18T21:11:40.043718+00:00
1,602,489,728,000
41ce94e5cef150edd67933965454b6f6b73ad96e
4
{ "blob_id": "41ce94e5cef150edd67933965454b6f6b73ad96e", "branch_name": "refs/heads/master", "committer_date": 1602489728000, "content_id": "2a26461a0ace9c0d21b5017fce916c6b2af66e43", "detected_licenses": [ "MIT" ], "directory_id": "83d16752f129150f5e862598d6155782b33055b9", "extension": "py", "fi...
3.734375
stackv2
class User: ''' Class that generates new instances of user ''' user_list = [] def __init__(self, first_name, last_name, email, username, password): ''' method that initiates instances of User class ''' self.first_name = first_name self.last_name = last_name ...
50
27.36
114
13
281
python
[]
0
true
2024-11-18T21:11:40.187204+00:00
1,625,016,454,000
2bf0a8a5fda70e550ee82344226cb6f75dfd87de
3
{ "blob_id": "2bf0a8a5fda70e550ee82344226cb6f75dfd87de", "branch_name": "refs/heads/main", "committer_date": 1625016454000, "content_id": "980adff6fdb4d89a801c4e0c8d293ceb0223b5a8", "detected_licenses": [ "MIT" ], "directory_id": "3e8adfc05b03f619761595068f4fd75bdd470859", "extension": "py", "file...
2.8125
stackv2
import requests import pandas as pd from bs4 import BeautifulSoup from goose3 import Goose # Header para o scraper header = {'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'} # Links dos jornais link_correio_do_povo = "https://www...
107
33.35
148
18
1,012
python
[]
0
true
2024-11-18T21:11:40.424000+00:00
1,692,372,777,000
d29cfbd41d89e5fcfef8abd9b61bccade27ce5df
3
{ "blob_id": "d29cfbd41d89e5fcfef8abd9b61bccade27ce5df", "branch_name": "refs/heads/master", "committer_date": 1692372777000, "content_id": "994bfea790705ea2b1795de51db9a51799039307", "detected_licenses": [ "Apache-2.0" ], "directory_id": "198d9c17c1564dcec45af536af2c54ab2423e398", "extension": "py"...
2.640625
stackv2
# PyZX - Python library for quantum circuit rewriting # and optimization using the ZX-calculus # Copyright (C) 2018 - Aleks Kissinger and John van de Wetering # 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 ...
374
37.38
120
23
3,614
python
[]
0
true
2024-11-18T21:11:40.471624+00:00
1,623,557,659,000
3e7e6e483c7123571810f63c26df6bc308960c2e
3
{ "blob_id": "3e7e6e483c7123571810f63c26df6bc308960c2e", "branch_name": "refs/heads/master", "committer_date": 1623557659000, "content_id": "7e3804be1fccdb8d5e0ea14c1d193035d24dd63a", "detected_licenses": [ "MIT" ], "directory_id": "0df09d6f241c045845f33465842d037da6b34a94", "extension": "py", "fi...
3.4375
stackv2
''' Author: SeoK106 This is the code to practice the concept of data science through python and scikit-learn. Especially It focused on classification, evaluation, and clustering. ''' import numpy as np from sklearn import tree,svm,linear_model,neighbors from sklearn.metrics import confusion_matrix,accuracy_score,preci...
203
31.56
178
14
1,683
python
[]
0
true