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.34
source
stringclasses
1 value
text
stringlengths
259
23.5k
num_lines
int64
16
648
avg_line_length
float64
15
60.9
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
276k
sast_codeql_findings_count
int64
0
33
sast_codeql_success
bool
1 class
sast_codeql_error
stringclasses
1 value
2024-11-19T02:04:21.038054+00:00
1,579,081,657,000
165a9c8d541c3eaf91bb3387e19cf86f2d7574f2
2
{ "blob_id": "165a9c8d541c3eaf91bb3387e19cf86f2d7574f2", "branch_name": "refs/heads/master", "committer_date": 1579081657000, "content_id": "308ca7b4862854ebb58c3e0241f371a9158afab2", "detected_licenses": [ "MIT" ], "directory_id": "144b76a7a1083a110ed506af7e8bb7a2d95ff4eb", "extension": "py", "fi...
2.5
stackv2
from typing import Optional, Iterable import torch import torch.nn as nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from svae import RNN_TYPES from svae.utils.modules import ResidualBlock class RNNDecoder(nn.Module): def __init__(self, rnn_type: str = 'gru', ...
67
33.82
72
14
536
python
[]
0
true
2024-11-19T02:04:21.612783+00:00
1,582,050,116,000
63740476baddb91c9f41a0a1cad288062ad9d008
3
{ "blob_id": "63740476baddb91c9f41a0a1cad288062ad9d008", "branch_name": "refs/heads/master", "committer_date": 1582050116000, "content_id": "fb8a7c6bedfdeebeed13b3b90edbb53c80dfa710", "detected_licenses": [ "MIT" ], "directory_id": "4d827c10251027136c216c2518b05ba9a3098c9a", "extension": "py", "fi...
2.78125
stackv2
from typing import List from .common import LOOKUP_TABLE, S_BOX Word = bytes def key_expension(key: bytes, rounds: int) -> List[Word]: if len(key) != 16: raise ValueError(f"Wrong key length: {len(key)}") expended_key = [key[i : i + len(key) // 4] for i in range(0, len(key), 4)] for r in range(1,...
62
31.15
79
15
590
python
[]
0
true
2024-11-19T02:04:22.201888+00:00
1,565,991,100,000
3dce1bd0dd8b57e326725981db4c373b578f43c0
3
{ "blob_id": "3dce1bd0dd8b57e326725981db4c373b578f43c0", "branch_name": "refs/heads/master", "committer_date": 1565991100000, "content_id": "b52dc5cbb6df912ca43fb3d993a5d00e4ffd20fa", "detected_licenses": [ "Apache-2.0" ], "directory_id": "25feabaab181efff592a20a5e3397909d3bc8efd", "extension": "py"...
2.6875
stackv2
# -------------------------------------------------------------------------------------------------- # Name: Layer Manager # Purpose: Manages and displays current Sprite's layers; # # Author: Rafael Vasco # # Created: 04/08/2013 # Copyright: (c) Rafael 2013 # Licence: <your licence> #---------...
204
24.61
100
16
1,106
python
[]
0
true
2024-11-19T02:04:22.285531+00:00
1,451,761,496,000
bf15ff8f57bf045c379146d83cc77f21b1817aa9
3
{ "blob_id": "bf15ff8f57bf045c379146d83cc77f21b1817aa9", "branch_name": "refs/heads/master", "committer_date": 1451761496000, "content_id": "8ff14e71da044fb852d97c7528cd614dbb30b301", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "b52a30e38f517091fa17ede66d5dcc8649bd0c14", "extension": "p...
2.734375
stackv2
""" datasets.py =========== Access geographical datasets. Commands -------- list_datasets() : get a list of available datasets. describe_dataset(dataset_name) : get metadata on specified dataset. load_dataset(dataset_name) : load dataset. Returns a numpy array. """ import json import os import ...
42
21.14
69
10
210
python
[]
0
true
2024-11-19T02:04:22.456196+00:00
1,594,063,464,000
632b400f03924612cf333b7add235b5dd1bf2215
2
{ "blob_id": "632b400f03924612cf333b7add235b5dd1bf2215", "branch_name": "refs/heads/master", "committer_date": 1594063464000, "content_id": "0ba18c98d812140ebb6ff00f8a1d3b5f0028f850", "detected_licenses": [ "MIT" ], "directory_id": "d80d822dfbfede6a113374b2cc2139112b5f68a5", "extension": "py", "fi...
2.4375
stackv2
import ast import util import joblib import numpy as np SAVED_MODEL = joblib.load(util.MODEL_PATH) def predict(x): try: x = ast.literal_eval(x) pred = SAVED_MODEL.predict(np.array(x)) return {"prices": pred.tolist()} except (ValueError, SyntaxError): return ( "Inv...
22
22.32
57
12
127
python
[]
0
true
2024-11-19T02:04:23.389605+00:00
1,628,718,996,000
e7fd77d918f23e9a318c9af8a3b3864409ec225e
3
{ "blob_id": "e7fd77d918f23e9a318c9af8a3b3864409ec225e", "branch_name": "refs/heads/master", "committer_date": 1628718996000, "content_id": "20997b76cc331210d93113b770155d75970756d9", "detected_licenses": [ "MIT" ], "directory_id": "8c66d6cc13ee2627f9c572bbd24e53065c6b2c39", "extension": "py", "fi...
2.515625
stackv2
""" Flask app factory @date: 6/12/2018 @author: Larry Shi """ import os from flask import Flask, render_template # Constant PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def create_app(): flask_app = Flask(__name__) if 'APP_SETTINGS' in os.environ: flask_app.config.from_...
39
22.51
73
11
218
python
[]
0
true
2024-11-19T02:04:23.603268+00:00
1,687,270,223,000
60496e42f1d9af87738cb5387f57030b30a6482d
3
{ "blob_id": "60496e42f1d9af87738cb5387f57030b30a6482d", "branch_name": "refs/heads/main", "committer_date": 1687270223000, "content_id": "9f0e08587b873f0e28ba6b8335b047460f4f7971", "detected_licenses": [ "MIT" ], "directory_id": "361e4f53c74f58c7fd1e9eb922f4f51d1027482d", "extension": "py", "file...
3.265625
stackv2
from enum import Enum from typing import List class Location: def __init__(self, name: str, name_nepali: str): self.__name = name self.__name_nepali = name_nepali def __str__(self): return self.name def __repr__(self): return self.name @property def name(self): ...
105
26.33
84
11
695
python
[]
0
true
2024-11-19T02:04:23.728578+00:00
1,617,470,018,000
0f34b7976ca7f126c4cd39271b316a1cbe1aebe5
3
{ "blob_id": "0f34b7976ca7f126c4cd39271b316a1cbe1aebe5", "branch_name": "refs/heads/main", "committer_date": 1617470018000, "content_id": "c6a857295696c55e26476d25d025e7a09aa3aa57", "detected_licenses": [ "MIT" ], "directory_id": "7c8b5f35cad9d47b750ee26f2ee0f2701a049918", "extension": "py", "file...
3.34375
stackv2
""" Random processes exist everywhere. Roughly speaking, a random process is a system of related random variables, usually indexed with respect to time t ≥ 0, for a continuous random process, or by natural numbers n = 1, 2, ..., for a discrete random process. This module examine the Poisson process, which is a simple ...
45
29.38
79
11
349
python
[]
0
true
2024-11-19T02:04:23.771587+00:00
1,634,484,659,000
367e7c33aecde46dc56f3a6839301c54f2b7e366
2
{ "blob_id": "367e7c33aecde46dc56f3a6839301c54f2b7e366", "branch_name": "refs/heads/main", "committer_date": 1634484659000, "content_id": "94f615705a75695f9e94af2801f00ed132fc5bf9", "detected_licenses": [ "MIT" ], "directory_id": "fc34331c15da63d504dcacfa3b35d6995a75e105", "extension": "py", "file...
2.34375
stackv2
from django.db import models from django.contrib.auth.models import BaseUserManager, \ AbstractBaseUser, PermissionsMixin from django.core.validators import RegexValidator from django.conf import settings from django.utils.translation import gettext_lazy as _ class UserManager(BaseUserManager): """User manager f...
105
33.92
150
16
846
python
[]
0
true
2024-11-19T02:04:23.972583+00:00
1,306,516,789,000
bcaafd1af3a72d0f6ac3071cef0f73569d3f7001
3
{ "blob_id": "bcaafd1af3a72d0f6ac3071cef0f73569d3f7001", "branch_name": "refs/heads/master", "committer_date": 1306516789000, "content_id": "3222ad88819bce2deb9617a2476d98fa42417fb0", "detected_licenses": [ "Apache-2.0" ], "directory_id": "7068d02c0abdd0775b7e5717fea2bccec28f656b", "extension": "py"...
2.734375
stackv2
import scipy from py2scad import * import params class BackPlate(object): def __init__(self,params=params): self.params = params self.__make() def __str__(self): return self.part.__str__() def __make(self): # Create main plate cap_numb = self.params.base_pcb['cap...
61
30.48
85
14
507
python
[]
0
true
2024-11-19T02:04:24.070791+00:00
1,456,750,078,000
093e1f0b029a40ab6760b6ba2704287ed559abea
3
{ "blob_id": "093e1f0b029a40ab6760b6ba2704287ed559abea", "branch_name": "refs/heads/master", "committer_date": 1456750078000, "content_id": "4d42c177b7302f6834fbf293bd6c10a7eaa50a00", "detected_licenses": [ "MIT" ], "directory_id": "5e9257762ce6bec4f13bac4b0007d1227f3c949e", "extension": "py", "fi...
2.734375
stackv2
from matplotlib import pyplot as plt from matplotlib import animation import numpy as np import yaml class BoidFlock(object): def __init__(self, config = 0): if config == 0: #if no config file, default values self.number = 50 self.lowlim = lowerposlimit = np.array([-450.0,300.0]) self.uplim = up...
177
26.65
93
19
1,411
python
[]
0
true
2024-11-19T02:04:24.271957+00:00
1,667,412,759,000
1875d1eac01479c649aba6575fb1552bf1a54fae
3
{ "blob_id": "1875d1eac01479c649aba6575fb1552bf1a54fae", "branch_name": "refs/heads/master", "committer_date": 1667412759000, "content_id": "76c007982229544adfed281c8fc41a0b16e992b1", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "8eae734c653a47fd88bc4c07fbc1d7693155e2cc", "extension": "p...
2.609375
stackv2
import goodtiming.core.i18n from goodtiming.core.parser import CompositeParser from goodtiming.core.processor import CompositeProcessor from goodtiming.core.renderer import CompositeRenderer import goodtiming.core.database import goodtiming.modules.addtodo import goodtiming.modules.reporttiming import goodtiming.mod...
53
35.7
166
13
391
python
[]
0
true
2024-11-19T02:04:24.388324+00:00
1,622,457,171,000
a4196bf50086e9b5d3acd1e3513b0db48d727479
3
{ "blob_id": "a4196bf50086e9b5d3acd1e3513b0db48d727479", "branch_name": "refs/heads/master", "committer_date": 1622457171000, "content_id": "b07da73fc77bf6ea3e23440451194f23f035684a", "detected_licenses": [ "MIT" ], "directory_id": "84a19fe0b89bb19caa1641aeadc9623c1a181767", "extension": "py", "fi...
3.109375
stackv2
from fractions import gcd from itertools import accumulate # 入力 N = int(input()) A = list(map(int, input().split())) # 先頭から連続する要素の最大公約数の列 L = [0] + list(accumulate(A, gcd)) # 末尾から連続する要素の最大公約数の列 R = [0] + list(accumulate(reversed(A), gcd)) # Aの各要素について、それを使用しない場合の最大公約数の最大値をL, Rを用いて求める ans = max( gcd(L[k], R[-(k + ...
20
17.3
44
12
155
python
[]
0
true
2024-11-19T02:04:24.781765+00:00
1,580,473,755,000
79e18c08407b8393e2cc3b35e8f83de457e86589
3
{ "blob_id": "79e18c08407b8393e2cc3b35e8f83de457e86589", "branch_name": "refs/heads/master", "committer_date": 1580473755000, "content_id": "98383d212a2e3e17fb7f5db96acd5a20f4cc5bbf", "detected_licenses": [ "MIT" ], "directory_id": "360ca176a67f5333f75f1737efb4df2b5966c453", "extension": "py", "fi...
2.5625
stackv2
from typing import List, Any, Tuple import random import string import time import statistics import torch from pytorch_fast_elmo import batch_to_char_ids, FastElmo class SentenceGenerator: def __init__( self, word_min: int, word_max: int, sent_min: int, ...
123
24.71
87
16
713
python
[]
0
true
2024-11-19T02:04:24.842002+00:00
1,602,577,796,000
e97b4164749745bcced6590953ca710fb6fa9862
2
{ "blob_id": "e97b4164749745bcced6590953ca710fb6fa9862", "branch_name": "refs/heads/master", "committer_date": 1602577796000, "content_id": "0de5fc2438c469231ab0dec6d29c509cef066026", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0ad009211f492645b5441c048b57e7abe5095a88", "extension": "py"...
2.34375
stackv2
import torch import torch.nn as nn import torch.optim as optim import numpy as np from torchtext.data import BucketIterator import random import math import time # Import Data Pre-process Files and Config File from Model.CNNSeq2Seq import data_preprocess as dp from Model.CNNSeq2Seq import config from Model.CNNSeq2Se...
178
26.7
112
16
1,253
python
[]
0
true
2024-11-19T02:04:24.903805+00:00
1,572,690,647,000
78c03d86261e8d7f1b87ac7a1a12772e46e8a11d
3
{ "blob_id": "78c03d86261e8d7f1b87ac7a1a12772e46e8a11d", "branch_name": "refs/heads/master", "committer_date": 1572690647000, "content_id": "cbc9812ef168a2ac1db4bc1ef01e24de2f7ba069", "detected_licenses": [ "MIT" ], "directory_id": "97eb2aba7c6299bcfbdd8fa998d35ca33988978e", "extension": "py", "fi...
2.796875
stackv2
import json class AST(object): def __init__(self, ast): self.ast = ast def generate(self): proc = self.get_proc(self.ast) return proc(self.ast, 1) def proc(self, ast, deep): return self.get_proc(ast)(ast, deep) def get_proc(self, ast): key = "type_{}".format(ast["type"]) if hasattr(self, key): r...
192
24.69
97
17
1,406
python
[]
0
true
2024-11-19T02:04:25.121314+00:00
1,586,779,918,000
db4fccf8581f12774be6789bf37eb53ad3001256
3
{ "blob_id": "db4fccf8581f12774be6789bf37eb53ad3001256", "branch_name": "refs/heads/master", "committer_date": 1586779918000, "content_id": "7d6941e1a59d0e06687ac393e269b318c1e2917a", "detected_licenses": [ "MIT" ], "directory_id": "d6cf2862c79859674d9abd2bafe7b603ff657870", "extension": "py", "fi...
2.53125
stackv2
import sys import os import logging from . import config logger = logging.getLogger('carson') _init = None _debug = False def initLogging(debug=False): global _init, _debug if _init is not None: return _init = True _debug = debug formatter = logging.Formatter('{asctime} {levelname[0]}...
117
30.74
173
20
897
python
[]
0
true
2024-11-19T02:04:25.333885+00:00
1,405,560,494,000
74d6f093484b8ac56ad4527fecbdcab241fa2e57
3
{ "blob_id": "74d6f093484b8ac56ad4527fecbdcab241fa2e57", "branch_name": "refs/heads/master", "committer_date": 1405560494000, "content_id": "fabff4b84d3dbc128fa61e23432a7d163081527f", "detected_licenses": [ "Apache-2.0" ], "directory_id": "31fdb98eea5b6323166d740198f9f56e78265cb7", "extension": "py"...
2.9375
stackv2
import time import RPi.GPIO as GPIO class GarageDoor: RELAY1 = 18 ON = 1 OFF = 0 #Time in seconds to keep the action on. ACTION_TIME = 0.5 def __init__(self): self.__setup() print "GarageDoor:Init" def __setup(self): GPIO.setmode(GPIO.BCM) GPIO.output(self.RELAY1, self.ON) GPIO.setup(self.RELAY1,...
40
16.27
40
10
206
python
[]
0
true
2024-11-19T02:04:25.403731+00:00
1,575,641,976,000
8b4057b390fa379bd21889d351a78c85b4f107c9
3
{ "blob_id": "8b4057b390fa379bd21889d351a78c85b4f107c9", "branch_name": "refs/heads/master", "committer_date": 1575641976000, "content_id": "4718766207552ff5b7910ce37ae53cee0b04571a", "detected_licenses": [ "Unlicense" ], "directory_id": "15998eacb7f19de6ac29fd8b3d446ce8190db35a", "extension": "py",...
2.671875
stackv2
from django.db import models from django.contrib.auth.models import User import uuid import datetime # Função auxiliar para definir o tempo default # De uma reserva def get_data(): return datetime.datetime.now() + datetime.timedelta(days=7) # Classe para o model Propriedade, com campos que descrevem # Uma propri...
130
33.57
124
11
1,171
python
[]
0
true
2024-11-19T02:04:25.867014+00:00
1,555,600,191,000
60521934a42f0a563468c9c6707e1bd3364981cb
3
{ "blob_id": "60521934a42f0a563468c9c6707e1bd3364981cb", "branch_name": "refs/heads/master", "committer_date": 1555600191000, "content_id": "48b7ef07b4a323ecb61f730823fed782c07e99ca", "detected_licenses": [ "MIT" ], "directory_id": "dae622609b9807005bfeee31d14576916b6ce693", "extension": "py", "fi...
3
stackv2
""" Transformations and stats for quantized, categorical, and collection features. """ import attr import typing import numpy as np import warnings from trickster.utils.counter import ExpansionCounter, CounterLimitExceededError def expand_quantized_increment(sample, feat_idxs): """ Get the neighbouring val...
316
27.09
96
17
2,020
python
[]
0
true
2024-11-19T02:04:25.931183+00:00
1,395,579,750,000
92759c4cfade3f61b3402721f04a8abc93a6e86f
2
{ "blob_id": "92759c4cfade3f61b3402721f04a8abc93a6e86f", "branch_name": "refs/heads/master", "committer_date": 1395579750000, "content_id": "1174760e4815f83f18d5d31829a599f1c0589d3c", "detected_licenses": [ "MIT" ], "directory_id": "88762da8b952258847956c4befb3648b0deb66e5", "extension": "py", "fi...
2.421875
stackv2
import sys import base as New def reload_modules(modlist): for x in modlist: if x in sys.modules: reload(sys.modules[x]) print x + ' has been reloaded.' else: sys.modules[x] = __import__(x) print x + ' has been loaded.' class CustomBot(New....
74
46.85
122
16
791
python
[]
0
true
2024-11-19T02:04:25.980024+00:00
1,557,783,992,000
dc7d5082bb19de913d94455b11c2f99812d0bd12
3
{ "blob_id": "dc7d5082bb19de913d94455b11c2f99812d0bd12", "branch_name": "refs/heads/master", "committer_date": 1557789613000, "content_id": "80ea5395dea3253930825c3ecff70f64b8bc20f5", "detected_licenses": [ "MIT" ], "directory_id": "369c462d43cb05bce0a970c85add3203dc7fb5d2", "extension": "py", "fi...
2.734375
stackv2
# vim:ts=4 sw=4 expandtab softtabstop=4 from jsonmerge.exceptions import HeadInstanceError, \ BaseInstanceError, \ SchemaError from jsonmerge.jsonvalue import JSONValue import jsonschema import re class Strategy(object): """Base class for merge stra...
295
34.87
118
20
2,335
python
[]
0
true
2024-11-19T02:04:26.041045+00:00
1,583,916,895,000
f9f4e9d1ee6bf2d0126a41cda93445a6aee2470c
3
{ "blob_id": "f9f4e9d1ee6bf2d0126a41cda93445a6aee2470c", "branch_name": "refs/heads/master", "committer_date": 1583916895000, "content_id": "acd9cefdba8199cda6296f5989839b4c760aa693", "detected_licenses": [ "MIT" ], "directory_id": "cdb9983779cbc282fec4938e1a653ce0b0b028fc", "extension": "py", "fi...
3.484375
stackv2
""" analyze.py ==================================== The Analysis Module for Moss (For info. on how this works contact varshneybhupesh@gmail.com) """ class Node: """A Single Submitted file""" def __init__(self, name): self.name = name self.tag = None self.links = [] def pointTo(se...
128
29.43
75
19
883
python
[]
0
true
2024-11-19T02:04:26.093594+00:00
1,612,192,404,000
9afe3c49ecde3acbca55296ae3dabb79bcf5ee54
3
{ "blob_id": "9afe3c49ecde3acbca55296ae3dabb79bcf5ee54", "branch_name": "refs/heads/main", "committer_date": 1612192404000, "content_id": "1fc2322a531451e4672c195a28c20c822f41acfb", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9d2106f30d3bb3907c11c4422dd67a75992bdba2", "extension": "py", ...
3.46875
stackv2
""" Returns a dataset of one-hot-encoded sequences of DNA and whether the motif of interest is present or absent in the data. """ import pandas as pd import numpy as np from sklearn.preprocessing import LabelEncoder, OneHotEncoder from sklearn.model_selection import train_test_split import joblib as jb class MakeOH...
114
28.75
121
16
814
python
[]
0
true
2024-11-19T02:04:26.184627+00:00
1,498,021,142,000
274e7fa5130e5b74de30aad75fef2816fdb285ce
3
{ "blob_id": "274e7fa5130e5b74de30aad75fef2816fdb285ce", "branch_name": "refs/heads/master", "committer_date": 1498021142000, "content_id": "f476f838a3954808029d1e5b82bacbcfb5bd944f", "detected_licenses": [ "Apache-2.0" ], "directory_id": "fdbc09cc5a33b83967c1d03284d03a837637945b", "extension": "py"...
3
stackv2
# -*- coding: utf-8 -*- from __future__ import unicode_literals from six import string_types, text_type, add_metaclass from prettytable import PrettyTable from neutronclient.v2_0 import client from termcolor import cprint from utils import format_tree, printo import abc import sys import json @add_metaclass(abc.ABCMe...
144
28.28
73
16
1,001
python
[]
0
true
2024-11-19T02:04:26.393969+00:00
1,531,366,899,000
994556178cc868c4fa432f51196554928a81e775
2
{ "blob_id": "994556178cc868c4fa432f51196554928a81e775", "branch_name": "refs/heads/master", "committer_date": 1531366899000, "content_id": "10df63b9fec2f703e49804f8910ea7fbcb5e371d", "detected_licenses": [ "MIT" ], "directory_id": "bd98f806de5a2beb819bf92d572395da2b34e897", "extension": "py", "fi...
2.40625
stackv2
# References: https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html # import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models import numpy as np import random class EncoderCNN(nn.Module): def __init__(self, embed_size, deep=False): s...
155
35.25
129
17
1,309
python
[]
0
true
2024-11-19T02:04:26.499679+00:00
1,690,168,616,000
f6392ae8d7bd69cdc88cdbee494b3254004bfae0
2
{ "blob_id": "f6392ae8d7bd69cdc88cdbee494b3254004bfae0", "branch_name": "refs/heads/master", "committer_date": 1690168616000, "content_id": "8d04184dd530a1856b35fa32fca4e82248b188ca", "detected_licenses": [ "Apache-2.0" ], "directory_id": "975df98f4897c0bbf7e508789c5b6ff10aad2647", "extension": "py"...
2.46875
stackv2
# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. # # WSO2 Inc. licenses this file to you 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/LICE...
35
34.09
94
17
302
python
[]
0
true
2024-11-19T02:04:26.956045+00:00
1,615,119,280,000
139f132a65fa38eb7887492f840da5dd51c12119
3
{ "blob_id": "139f132a65fa38eb7887492f840da5dd51c12119", "branch_name": "refs/heads/master", "committer_date": 1615119280000, "content_id": "238ee39ccec2d320a1148c8fca7cb5e7c38c4ed4", "detected_licenses": [ "MIT" ], "directory_id": "d8cda3656281d7a4b7ce8c1b8d1a92bc8ec362f0", "extension": "py", "fi...
2.53125
stackv2
import numpy as np from model import SkipGramModel from torch.autograd import Variable import torch import torch.nn as nn import torch.optim as optim import sys from data_handler import DataHanlder class Word2Vec: def __init__(self, log_filename: str, output_filename: str, embedd...
87
41.83
114
19
847
python
[]
0
true
2024-11-19T02:04:27.116547+00:00
1,618,062,731,000
d1f68394a7a85cc2ad47bea5d55c6ee0d3d374ea
4
{ "blob_id": "d1f68394a7a85cc2ad47bea5d55c6ee0d3d374ea", "branch_name": "refs/heads/main", "committer_date": 1618062731000, "content_id": "a8ae618a5ca0d0208d791077726e09a238564793", "detected_licenses": [ "MIT" ], "directory_id": "13d315c52759c6163c4d866d0d582b0751a0e7a2", "extension": "py", "file...
3.6875
stackv2
from typing import List, Union my_list: List[str] = ["first", "last", "something"] if my_list: result = " ".join(x for x in my_list) print(result) else: print("The list is empty") def show_name(name: str) -> str: if not name: return "Do not allowed empty name" return name.upper() x: Un...
36
16.39
62
9
176
python
[]
0
true
2024-11-19T02:04:27.233610+00:00
1,554,648,996,000
b5722a016e88b49a48904e47904bca95aee51cb5
3
{ "blob_id": "b5722a016e88b49a48904e47904bca95aee51cb5", "branch_name": "refs/heads/master", "committer_date": 1554648996000, "content_id": "c4daddc0b1b7509fea840b1b6726a5a476f0a044", "detected_licenses": [ "MIT" ], "directory_id": "0889a6d48198f591b36a56ef2aed2e98ab951ae8", "extension": "py", "fi...
3.25
stackv2
import socket def Main(): host = '127.0.0.1' port = 5000 #Create a communication port for the UDP protocolo using DATAGRAM s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #Associating the address and the port to a process s.bind((host, port)) print("Server started.") while True...
29
26.03
69
12
202
python
[]
0
true
2024-11-19T02:04:27.352101+00:00
1,692,794,308,000
2ff095d3215182fcf39afb63e1785975ca60abaf
2
{ "blob_id": "2ff095d3215182fcf39afb63e1785975ca60abaf", "branch_name": "refs/heads/main", "committer_date": 1692794308000, "content_id": "3f809e0e5dc682845d2712095bf1c6d95ecea6c5", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "bb78dac07e7f4afc2a57e10dc2047687fb917169", "extension": "py"...
2.359375
stackv2
# YouCompleteMe (https://github.com/ycm-core/YouCompleteMe) configuration file # that enables it to find the LLVM and Python includes from a conda # environment, independent of the Conda environment location and Python and # LLVM versions. import os import sys from pathlib import Path CONDA_PREFIX = os.environ['COND...
40
27.93
78
9
296
python
[]
0
true
2024-11-19T02:04:27.459391+00:00
1,595,355,098,000
6b2d4b6878ff9d55c6575e3e01b9a5bcce0c1a15
3
{ "blob_id": "6b2d4b6878ff9d55c6575e3e01b9a5bcce0c1a15", "branch_name": "refs/heads/master", "committer_date": 1595355098000, "content_id": "e5479e5f9890a2456cae02f99de32ad0412b9c7a", "detected_licenses": [ "MIT" ], "directory_id": "8367320f201518a8cf74261110b0db91519e155e", "extension": "py", "fi...
2.953125
stackv2
from datetime import timezone import pandas as pd def get_utc_naive(dt): """Convert timezone aware timestamp to UTC naive timestamp.""" return dt.astimezone(timezone.utc).replace(tzinfo=None) def parse_timestamp_str(time): """Get naive datetime in UTC.""" # manual version # datetime.strptime(ti...
17
31.12
83
10
133
python
[]
0
true
2024-11-19T02:04:28.277829+00:00
1,619,792,770,000
98f8e1202637330001070418826e77409c6d4683
3
{ "blob_id": "98f8e1202637330001070418826e77409c6d4683", "branch_name": "refs/heads/master", "committer_date": 1619792770000, "content_id": "39a2efaa8cb79dd22fec3050418a2e41f302754f", "detected_licenses": [ "MIT" ], "directory_id": "0747c5f48b4681bfbb0caddac0adcafaa584bc25", "extension": "py", "fi...
2.609375
stackv2
#!/usr/bin/env python3 from typing import Dict, Optional import qcelemental as qcel import qcengine as qcng from pydantic import Field, PositiveInt, validator from qubekit.utils.datastructures import SchemaBase from qubekit.utils.exceptions import SpecificationError class BaseEngine(SchemaBase): """ A comm...
75
29.53
110
14
522
python
[]
0
true
2024-11-19T02:04:28.332789+00:00
1,505,157,942,000
f67ceb11dd187b85a480ebbdee5c1c6ea9007273
4
{ "blob_id": "f67ceb11dd187b85a480ebbdee5c1c6ea9007273", "branch_name": "refs/heads/master", "committer_date": 1505157942000, "content_id": "d94f5463494f6d95d38e85fefa7235d0fea8fb87", "detected_licenses": [ "MIT-feh" ], "directory_id": "2e46ef9411a8e84074d35338240a69f65b7a6a5d", "extension": "py", ...
3.5
stackv2
import matplotlib.pyplot as plt def plotFile(filename, plot_title): xpoints = [] ypoints = [] ypointsExpected = [] ypointsErrorPlus = [] ypointsErrorMinus = [] with open(filename, 'r') as f: f.readline() # skip the first line expected = float(f.readline().split()[1]) ...
34
30.35
91
15
274
python
[]
0
true
2024-11-19T02:04:28.381006+00:00
1,586,446,517,000
de71f5922bb1fe77237d72d2d91ab7dd17b1fe92
3
{ "blob_id": "de71f5922bb1fe77237d72d2d91ab7dd17b1fe92", "branch_name": "refs/heads/master", "committer_date": 1586446517000, "content_id": "3416016178a0b156b58314b0e84b3a506c9b9a79", "detected_licenses": [ "MIT" ], "directory_id": "2df02a50773f87d2d507cadf4ecad10d7a176c0b", "extension": "py", "fi...
3.3125
stackv2
from pymongo import MongoClient class Database: """ The class for the Database. """ def __init__(self): """Initialize the Database.""" self.client = MongoClient() self.db = self.client.highscores def insert(self, name, score): """"Insert a record into the database."...
40
26.25
88
15
254
python
[]
0
true
2024-11-19T02:04:28.444494+00:00
1,613,926,231,000
644d479fa7837e8964c802c1548bb47e6096880c
4
{ "blob_id": "644d479fa7837e8964c802c1548bb47e6096880c", "branch_name": "refs/heads/master", "committer_date": 1613926231000, "content_id": "f0a8a8e1fe27a65b0ac5c3422c6b38fd7d091a70", "detected_licenses": [ "MIT" ], "directory_id": "7366f292ede1ce81481e4b07fab70433a854012f", "extension": "py", "fi...
3.6875
stackv2
""" 230. Kth Smallest Element in a BST """ # Definition for a binary tree node. class TreeNode: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right class Solution: def kthSmallest(self, root: TreeNode, k: int) -> int: A = [] ...
30
22.8
57
14
170
python
[]
0
true
2024-11-19T02:04:28.539591+00:00
1,691,093,966,000
342c93c1032ca64df157907f9ee040f0072759c7
3
{ "blob_id": "342c93c1032ca64df157907f9ee040f0072759c7", "branch_name": "refs/heads/master", "committer_date": 1691093966000, "content_id": "2d6740a8d36ddc07f7ff459709b4761460af4e57", "detected_licenses": [ "MIT" ], "directory_id": "7b97691e0493885e85cce9cc6f0f19ee54024a1d", "extension": "py", "fi...
2.53125
stackv2
# -*- coding: utf-8 -*- """ EPA REI """ import re import pandas as pd import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.fbs_allocation import direct_allocation_method def rei_url_helper(*, build_url, config, **_): """ This helper ...
206
37.1
88
24
1,932
python
[]
0
true
2024-11-19T02:04:28.906183+00:00
1,567,875,768,000
5e3f9c57e95b287501bc111936081a6bfcc55b3e
3
{ "blob_id": "5e3f9c57e95b287501bc111936081a6bfcc55b3e", "branch_name": "refs/heads/master", "committer_date": 1567875768000, "content_id": "2f1bee32e8899b5f6f16b271a5fefb08dca449df", "detected_licenses": [ "MIT" ], "directory_id": "b072a98e605a8325cf79efec92ffc564bd588916", "extension": "py", "fi...
2.515625
stackv2
''' example for extracting faces extract all faces from images from path - directory (with all subdirectories) upload_path - directory, where faces will be stored ''' import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import facextr path = r'\\123tb\Media\Photo\Pictures\2019' upload_path...
20
22.45
77
10
125
python
[]
0
true
2024-11-19T02:04:29.007477+00:00
1,534,813,260,000
dc77b0cd0fd0a0fa0280efb26927b7aafe8308d1
3
{ "blob_id": "dc77b0cd0fd0a0fa0280efb26927b7aafe8308d1", "branch_name": "refs/heads/master", "committer_date": 1534813260000, "content_id": "acd31c02f17d1b85e837a202584efcd7273867ac", "detected_licenses": [], "directory_id": "ae0da6810a81a442ad1dc737071d3da5a926444c", "extension": "py", "filename": "dem...
2.984375
stackv2
from kernel_exp_family.estimators.finite.gaussian import KernelExpFiniteGaussian from kernel_exp_family.examples.demo_simple import ground_truth from kernel_exp_family.examples.tools import pdf_grid, visualise_array import matplotlib.pyplot as plt import numpy as np if __name__ == '__main__': """ Simple examp...
73
28.1
80
13
581
python
[]
0
true
2024-11-19T02:04:29.129440+00:00
1,491,765,360,000
2837cd0768ab896f4ede14912110fe1f95da023e
3
{ "blob_id": "2837cd0768ab896f4ede14912110fe1f95da023e", "branch_name": "refs/heads/master", "committer_date": 1491765360000, "content_id": "429075b18c26fafc1c078460c2ba17a659e40feb", "detected_licenses": [ "MIT" ], "directory_id": "4afc9596fc050d86be513f2ce8f13ac0203c6df0", "extension": "py", "fi...
3.046875
stackv2
import random import datetime import discord from asteval import Interpreter from discord.ext import commands from dog import Cog from dog.util import pretty_timedelta, make_profile_embed, american_datetime class Utility(Cog): @commands.command() async def avatar(self, ctx, target: discord.User=None): ...
87
32.32
85
18
584
python
[]
0
true
2024-11-19T02:04:29.472429+00:00
1,582,193,433,000
e8000f7b5c442376c3d838d3625b705e6d0b2575
2
{ "blob_id": "e8000f7b5c442376c3d838d3625b705e6d0b2575", "branch_name": "refs/heads/master", "committer_date": 1582193433000, "content_id": "1cbebb0ca1313739b0fe47f6d54aaa9f17675ecf", "detected_licenses": [ "Apache-2.0" ], "directory_id": "0806f688477a0bdc229930cc3457f59b9b5c029f", "extension": "py"...
2.4375
stackv2
import base64 import json import jwt import requests from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend USER_MODEL = get_user_model() class ALBAuth(ModelBackend): def authenticate(self, request, **kwargs): if request: ...
64
29.45
75
14
442
python
[]
0
true
2024-11-19T02:04:29.798132+00:00
1,610,491,514,000
aa55fa9faec2a2b3f373f6cc6ea03a68c2fd8e04
3
{ "blob_id": "aa55fa9faec2a2b3f373f6cc6ea03a68c2fd8e04", "branch_name": "refs/heads/master", "committer_date": 1610491514000, "content_id": "62baaf5b81ad0b9e5c1c3d24505b500eb9f65ff0", "detected_licenses": [ "MIT" ], "directory_id": "834f1ea1e83de05bfc0fc70d2a6ab2adb21a7858", "extension": "py", "fi...
2.59375
stackv2
# -*- coding: utf-8 -*- import numpy as np from tqdm import tqdm import os import re import nltk # nltk.download('punkt', 'stopwords') from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.tokenize import TweetTokenizer tweet_tokenizer = TweetTokenizer() from nltk.stem.lancaster import L...
168
38.74
137
20
1,582
python
[]
0
true
2024-11-19T02:04:29.994840+00:00
1,499,844,634,000
dbfb225895a6bcf9990def7b63fd39b7b07b02e1
3
{ "blob_id": "dbfb225895a6bcf9990def7b63fd39b7b07b02e1", "branch_name": "refs/heads/master", "committer_date": 1499844634000, "content_id": "09fd489538c01dfbe294f5ff0a0a1f55275430d4", "detected_licenses": [ "Apache-2.0" ], "directory_id": "53c275639e60f68ec2805f162c022fa5442207c0", "extension": "py"...
2.625
stackv2
from data import * if __name__ == "__main__": df, stats_df = create_training_set("data/fb.csv") ''' for i in range(len(df.columns)-1): for j in range(i+1,len(df.columns)-1): x = df.columns[i] y = df.columns[j] plotModel = PlotModel(title="Log Reg", xlabel=x, ylabel=y) plot_logistic_regression_data(df...
99
31.93
90
10
1,079
python
[]
0
true
2024-11-19T02:04:40.736762+00:00
1,571,567,087,000
550a81009c37b50a71f30978c8b0fdcd08da3a97
3
{ "blob_id": "550a81009c37b50a71f30978c8b0fdcd08da3a97", "branch_name": "refs/heads/master", "committer_date": 1571567087000, "content_id": "4fd43051fc1ecd5b1f65ced67a93d4c6bde5593f", "detected_licenses": [ "MIT" ], "directory_id": "8581a7f6537f37e5446833248bde354ab8d04eee", "extension": "py", "fi...
3.03125
stackv2
from fbprophet import Prophet import requests import pandas as pd from datetime import datetime def find(num): i = int(num**(0.5)) while(num%i != 0): i -= 1 return i,int(num/i) def find(num): i = int(num**(0.5)) while(num%i != 0): i -= 1 return i,int(num/i) def mlfun (co...
51
29.73
130
15
494
python
[]
0
true
2024-11-19T02:04:40.880322+00:00
1,536,247,035,000
c871a66ff9da43ce314d1d4bdea95dfad4cc0caa
3
{ "blob_id": "c871a66ff9da43ce314d1d4bdea95dfad4cc0caa", "branch_name": "refs/heads/master", "committer_date": 1536247035000, "content_id": "c7456dbbc39a8d06a41c593f65f400ae892c235f", "detected_licenses": [ "MIT" ], "directory_id": "56f1416a81ded9e6c31fe87ac771453141c1a216", "extension": "py", "fi...
2.828125
stackv2
import read_file from random import shuffle import math import pandas as pd import copy import timeout_decorator people_org, heavy_shifts_org, night_shifts_org, other_shifts_org = read_file.get_info() avg_hours = 33 @timeout_decorator.timeout(2) def allocate(): people = copy.deepcopy(people_org) heavy_shifts...
93
30.09
143
14
687
python
[]
0
true
2024-11-19T02:04:40.929742+00:00
1,683,555,061,000
1092e170aad9759d90e40a41ddacfd17368c98ab
3
{ "blob_id": "1092e170aad9759d90e40a41ddacfd17368c98ab", "branch_name": "refs/heads/main", "committer_date": 1683555061000, "content_id": "331c52ad8b3ce38ad9ef9428e5b628d4d70b699b", "detected_licenses": [ "MIT" ], "directory_id": "7a5c7352e5b5452a95f09d2b99a032d9e72738f4", "extension": "py", "file...
3.125
stackv2
import numpy as np from numpy import ndarray def ravel_hash_func(data: ndarray, dimensions: ndarray) -> ndarray: assert data.shape[1] == dimensions.shape[0] hash_values = data[:, 0].copy() for i in range(1, dimensions.shape[0]): hash_values *= dimensions[i] hash_values += data[:, i] re...
80
41.38
117
15
782
python
[]
0
true
2024-11-19T02:04:41.265299+00:00
1,573,405,324,000
6277f8ba4c1637d446714c29bd7860ec51b2f59a
3
{ "blob_id": "6277f8ba4c1637d446714c29bd7860ec51b2f59a", "branch_name": "refs/heads/master", "committer_date": 1573405460000, "content_id": "f015de089985d37f1558cd19beccb8b0623dbe56", "detected_licenses": [ "MIT" ], "directory_id": "bfc67c3a3b70043e3ea0dc3a7c4d38133bdbb843", "extension": "py", "fi...
2.90625
stackv2
#!/usr/bin/env python3 import cv2 import glob import numpy as np class Model: def calibrate(self, nx, ny): images = list() image_paths = glob.glob("camera_cal/*.jpg") print("Loading calibration images ...") for path in image_paths: images.append(cv2.imread(path)) ...
58
30.47
73
13
415
python
[]
0
true
2024-11-19T02:04:41.381646+00:00
1,389,212,414,000
5b08e640518236cb903209bd33cb48f11fa48bcb
3
{ "blob_id": "5b08e640518236cb903209bd33cb48f11fa48bcb", "branch_name": "refs/heads/master", "committer_date": 1389212414000, "content_id": "26e32cb094c93d8d1f4f262d02ecaa2ab6954b53", "detected_licenses": [ "Apache-2.0" ], "directory_id": "9f3175348f460560548c56ecfadfff00f1890a9f", "extension": "py"...
2.546875
stackv2
# # Copyright 2013 Xavier Bruhiere # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
79
36.47
79
22
613
python
[]
0
true
2024-11-19T02:04:41.510255+00:00
1,675,317,880,000
3a72f0d06b0877817278e11802f25744efd39cc5
3
{ "blob_id": "3a72f0d06b0877817278e11802f25744efd39cc5", "branch_name": "refs/heads/master", "committer_date": 1675317880000, "content_id": "5531208acd60aeccff5b46341fa72eb7d6e8ea70", "detected_licenses": [ "MIT" ], "directory_id": "fcd29745ed7a66b46f5039c2ad07f2fa5cb457a2", "extension": "py", "fi...
3.390625
stackv2
import re import logging from locators.book_locators import BookLocators logger = logging.getLogger('scraping.book_parser') class BookParser: """ A class to take in an HTML page or content, and find properties of an item in it. """ RATINGS = { 'One': 1, 'Two': 2, 'Three'...
72
29.69
78
14
521
python
[]
0
true
2024-11-19T02:04:41.641593+00:00
1,625,766,041,000
1bd6573324e513b2aceee7da92ee9662a056804a
2
{ "blob_id": "1bd6573324e513b2aceee7da92ee9662a056804a", "branch_name": "refs/heads/main", "committer_date": 1625766041000, "content_id": "c933893ce7da4d6c0357312c586558890931865f", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "1c5b0d9086a4006a7ddd88a7c3de6be331f037c6", "extension": "py"...
2.484375
stackv2
#!/usr/bin/python3 import rospy import time import math import threading from sensor_msgs.msg import LaserScan from std_msgs.msg import String import numpy as np from autonomous_traversal.srv import ClearService, ClearServiceResponse class SickAvoider: def __init__(self): self.np_ranges = None s...
76
38.46
95
18
845
python
[]
0
true
2024-11-19T02:04:41.699572+00:00
1,684,690,217,000
5e24fb1d03bf3882896f00b166aecf8532d3489e
3
{ "blob_id": "5e24fb1d03bf3882896f00b166aecf8532d3489e", "branch_name": "refs/heads/master", "committer_date": 1684690217000, "content_id": "f2c5a3c8c77f0b8b926cd330642aa8cc30724f37", "detected_licenses": [ "MIT" ], "directory_id": "434cc3982d25f1d83b9f0a7ec9c72b588652bc1d", "extension": "py", "fi...
3.46875
stackv2
import turtle from mpmath import mp # Für die Ziffern von Pi pieter = turtle.Turtle() mp.dps = 1000 pi = (f"{(mp.pi)}") digits = [int(s) for s in pi if s != "."] for m in digits: if m == 0: pieter.forward(10) if m == 1: pieter.right(90) pieter.forward(10) if m == 2: pie...
40
19.73
49
9
291
python
[]
0
true
2024-11-19T02:04:41.766353+00:00
1,619,259,210,000
b36a02b089a3a959748e2fdc452418170a9d64b2
3
{ "blob_id": "b36a02b089a3a959748e2fdc452418170a9d64b2", "branch_name": "refs/heads/master", "committer_date": 1619259210000, "content_id": "e5a103fd825fdf88e6f4dc7846a390ab14376072", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "544e0c8d5dee137a4ef133a53267c6eca489015b", "extension": "p...
3
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on May 31 2019 @author: Nathan de Lara <ndelara@enst.fr> @author: Thomas Bonald <bonald@enst.fr> """ from typing import Union, Optional import numpy as np from scipy import sparse from scipy.sparse.linalg import LinearOperator from sknetwork.linalg.ppr_solver...
176
34.96
119
15
1,558
python
[]
0
true
2024-11-19T02:04:41.821283+00:00
1,631,906,914,000
036dc8b8f084fe63a3dd14c18786f19f401ecce7
3
{ "blob_id": "036dc8b8f084fe63a3dd14c18786f19f401ecce7", "branch_name": "refs/heads/main", "committer_date": 1631906914000, "content_id": "5554e5398ee621f8d1e39b5c932e2599cfe9888f", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "60e0360d02af05ea15b21ae29ba6c3d4b1cf113b", "extension": "py"...
2.546875
stackv2
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # cylinder.py # ffsas: free-form inversion for small-angle scattering # Copyright © 2021 SciML, STFC, UK. All rights reserved. """ cylinder model class """ import math import torch from scipy.special import j1 from ffsas.models.base import SASModel class Cylinder(...
77
30.35
80
18
724
python
[]
0
true
2024-11-19T02:04:41.877721+00:00
1,581,657,781,000
b1ac079699673bf66ff10f7f74bb3ec8d607d792
2
{ "blob_id": "b1ac079699673bf66ff10f7f74bb3ec8d607d792", "branch_name": "refs/heads/master", "committer_date": 1581657781000, "content_id": "07ed9b1065a658a75fb4cbb5222c4f122ac6012e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "6b791247919f7de90c8402abcca64b32edd7a29b", "extension": "py"...
2.46875
stackv2
# uncompyle6 version 3.2.4 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] # Embedded file name: direct.showutil.Rope from panda3d.core import * import types class Rope(NodePath): showRope = ConfigVariableBool('show-rope', True,...
88
36.2
109
19
835
python
[]
0
true
2024-11-19T02:04:41.927281+00:00
1,618,673,596,000
8a1721516d8bfe9f321a203dd54a3549d4ff0bbf
3
{ "blob_id": "8a1721516d8bfe9f321a203dd54a3549d4ff0bbf", "branch_name": "refs/heads/main", "committer_date": 1618673596000, "content_id": "94a0c0fb5bcb605eb36778f511099dc3643b6add", "detected_licenses": [ "MIT" ], "directory_id": "41ac9e7877350b8da446c670d781f08ccc1b1d48", "extension": "py", "file...
2.515625
stackv2
""" An RFC8771-compliant implementation of the Internationalized Deliberately Unreadable Network Notation (shortened as I-DUNNO) """ import collections import functools import ipaddress import itertools import random from . import data __all__ = ['encode', 'decode'] __version__ = '0.1.3' utf8_lengths = [(0, 7)...
171
31.19
144
15
1,419
python
[]
0
true
2024-11-19T02:04:42.028090+00:00
1,629,239,727,000
450f77fe766187244556e046e1d12e3f8557a364
3
{ "blob_id": "450f77fe766187244556e046e1d12e3f8557a364", "branch_name": "refs/heads/master", "committer_date": 1629239727000, "content_id": "cb54e653a02f6c97c7bef15366e714d20d68e384", "detected_licenses": [ "MIT" ], "directory_id": "d594e26a17a8bea079b2dbeba764cfc95cc786c7", "extension": "py", "fi...
3.125
stackv2
# -*- coding: utf-8 -*- #################################################################################################### # File: path_finding_utils.py # Purpose: Path finding utility functions used in the various algorithms. Includes the main cost # function used as the metric on the graphs. # # Auth...
341
32.53
157
18
3,134
python
[]
0
true
2024-11-19T02:04:42.139323+00:00
1,532,437,961,000
93385cf4eab54715ab5866d11fb986067272f75c
3
{ "blob_id": "93385cf4eab54715ab5866d11fb986067272f75c", "branch_name": "refs/heads/master", "committer_date": 1532437961000, "content_id": "27240dd15beedc727cbdcf4dea0fe160959a0325", "detected_licenses": [ "MIT" ], "directory_id": "8923fe8a8a7ff6bdafacb2af6c4439bbe0ad0559", "extension": "py", "fi...
2.8125
stackv2
import gzip import os import re import xmltodict from lxml import etree import constants as c def get_docs_list_by_subdir(wikipedia_dir): """ read into the dataset_dir and yield subdirs and files. :param wikipedia_dir: the path to the dataset directory :return: a tuple (current_subdir, list_of_filepaths), wher...
185
28.01
105
19
1,515
python
[]
0
true
2024-11-19T02:04:42.188925+00:00
1,658,770,485,000
83cca729ddb3e8f3e349c13c140044c2f5c3adea
2
{ "blob_id": "83cca729ddb3e8f3e349c13c140044c2f5c3adea", "branch_name": "refs/heads/master", "committer_date": 1658770485000, "content_id": "377b5597a95885a5a7b185498dc28d5b2734e8b8", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "344308d52715284af5d401116b10e77fce4172b3", "extension": "p...
2.34375
stackv2
from dataclasses import dataclass from enum import Enum from typing import List, Dict, Union from loguru import logger from dome9 import Dome9Resource, Client, BaseDataclassRequest from dome9.consts import CloudVendors from dome9.exceptions import UnsupportedRuleEntitySeverity, UnsupportedCloudVendor class RuleEnti...
133
26.1
117
15
957
python
[]
0
true
2024-11-19T02:04:42.247058+00:00
1,607,362,745,000
56b7529383076fe42c70539c617881412fac29f5
2
{ "blob_id": "56b7529383076fe42c70539c617881412fac29f5", "branch_name": "refs/heads/master", "committer_date": 1607362745000, "content_id": "32f694cbe00f7d539d16cafe0f85fe655fe1109e", "detected_licenses": [ "Apache-2.0" ], "directory_id": "16a2ac198a36d7633c62d41f4604356cd0ae732e", "extension": "py"...
2.484375
stackv2
#!/usr/bin/python import argparse, sys, subprocess, re, os import GenePredBasics from shutil import rmtree from random import randint # Pre: Take a sorted BAM file and find novel regions at various depths. # It also can take read annotations from annotate_psl_with_gpd.py # But if no read annotation is given,...
162
37.4
178
29
1,695
python
[]
0
true
2024-11-19T02:04:42.446225+00:00
1,527,155,846,000
bf14a7d3788abf9edb6731d3d3977a0cdb49cb66
3
{ "blob_id": "bf14a7d3788abf9edb6731d3d3977a0cdb49cb66", "branch_name": "refs/heads/master", "committer_date": 1527155846000, "content_id": "a2ef33375579295818da5ab6efe0a62d4e9a8cd1", "detected_licenses": [ "MIT" ], "directory_id": "cc100e9362222e140e3088e1d2dcc38872d811fd", "extension": "py", "fi...
2.625
stackv2
import pymysql import pymysql.cursors from config.config import * # API Reference: http://pymysql.readthedocs.io/en/latest/modules/ class SqlHelper: '''mysql helper''' def __init__(self): self.connection = None self.connect() def connect(self): if not self.connection: self.connection = pymysql.connect( ...
78
21.86
65
15
454
python
[]
0
true
2024-11-19T02:04:42.613152+00:00
1,534,083,540,000
ee29cf0e354f63a6a20deba978905719febe2ebe
3
{ "blob_id": "ee29cf0e354f63a6a20deba978905719febe2ebe", "branch_name": "refs/heads/master", "committer_date": 1534083540000, "content_id": "e8363e86512ebf18a4978b99fca86cbbc6b0f678", "detected_licenses": [ "MIT" ], "directory_id": "769664f52bc154557537f6f42e616fa9b4fcf8d9", "extension": "py", "fi...
2.828125
stackv2
from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.validation import check_X_y, check_array, check_is_fitted from sklearn.utils.multiclass import unique_labels from sklearn.metrics import euclidean_distances import numpy as np class TemplateClassifier(BaseEstimator, ClassifierMixin): def ...
85
31.47
100
17
623
python
[]
0
true
2024-11-19T02:04:42.672088+00:00
1,692,365,184,000
b68fecbcec91982b71dbc45588fc141f234932df
2
{ "blob_id": "b68fecbcec91982b71dbc45588fc141f234932df", "branch_name": "refs/heads/master", "committer_date": 1692365184000, "content_id": "fd67725d6ff923506dbc99844a844b3d54f7c3ae", "detected_licenses": [ "MIT" ], "directory_id": "5809048b0ef54940da88b4fcabcca7784d09cb87", "extension": "py", "fi...
2.34375
stackv2
#!/usr/bin/python # # [ DEPRECATED ] # Use md2conf.py which has been written using the REST API instead of XMLRPC # # # @rmoff 20140330 # # "A Hack But It Works" #---------------------------------------- # # This will import specified Markdown file into Confluence # # It uses [depreciated] XMLRPC API for Confluence. S...
140
40.14
167
22
1,592
python
[]
0
true
2024-11-19T02:04:42.765361+00:00
1,669,618,498,000
694770acda05221aa0db63e65c31acf112fe924f
2
{ "blob_id": "694770acda05221aa0db63e65c31acf112fe924f", "branch_name": "refs/heads/master", "committer_date": 1669618498000, "content_id": "7d227a4c39bd2e8352378a8244d2dff354ff8171", "detected_licenses": [ "MIT" ], "directory_id": "d1adff95d1e1685cac220db38c770a4036b6e4a4", "extension": "py", "fi...
2.3125
stackv2
""" Michael duPont - michael@mdupont.com config.py - Shared METAR display settings """ import json import logging from os import path from pathlib import Path # Seconds between server pings update_interval = 600 # Seconds between connection retries timeout_interval = 60 # Set log level - CRITICAL, ERROR, WARNING, I...
61
21.61
63
10
365
python
[]
0
true
2024-11-19T02:04:43.020821+00:00
1,625,680,501,000
5c40098283d430757ab3e73623e533451bc8b04e
3
{ "blob_id": "5c40098283d430757ab3e73623e533451bc8b04e", "branch_name": "refs/heads/main", "committer_date": 1625680501000, "content_id": "c4c5dd8b285f3906f1e39175b8df0f1e46bb2032", "detected_licenses": [ "Apache-2.0" ], "directory_id": "72b4e39803a129fc9a84d4422f55bea7ddc7068a", "extension": "py", ...
2.828125
stackv2
import ujson as json from util.line_corpus import jsonl_lines import argparse parser = argparse.ArgumentParser() parser.add_argument("--predictions_a", default=None, type=str, required=True) parser.add_argument("--predictions_b", default=None, type=str, required=True) args = parser.parse_args() def qid2predictions(...
36
30.64
84
15
342
python
[]
0
true
2024-11-19T02:04:43.154451+00:00
1,602,419,808,000
1b1ab3c557a3dcecf2cfc9b5840ce381387df762
4
{ "blob_id": "1b1ab3c557a3dcecf2cfc9b5840ce381387df762", "branch_name": "refs/heads/master", "committer_date": 1602419808000, "content_id": "d838316b4f1e6d6505ec5c5e30824ab2e284f8a6", "detected_licenses": [ "MIT" ], "directory_id": "c364fca8ae4c896dee2c8b0dc545f4d73c8c8314", "extension": "py", "fi...
3.5
stackv2
#!/usr/bin/env python3 """ Write a function that performs a random crop of an image: image is a 3D tf.Tensor containing the image to crop size is a tuple containing the size of the crop Returns the cropped image """ import tensorflow as tf import numpy as np def crop_image(image, size): """Crop image""" hei...
22
27.64
60
9
144
python
[]
0
true
2024-11-19T02:04:43.274883+00:00
1,635,450,788,000
4e5d20cb8ad2ef9657365d342aa4ae74d1595616
3
{ "blob_id": "4e5d20cb8ad2ef9657365d342aa4ae74d1595616", "branch_name": "refs/heads/master", "committer_date": 1635450788000, "content_id": "18122a660b71c7f52adc3c1947e341483a2fd6ac", "detected_licenses": [ "MIT" ], "directory_id": "d4c930fb2732b8b658e624acfdc4967e9d41db20", "extension": "py", "fi...
2.9375
stackv2
""" domonic.webapi.permissions ==================================== https://developer.mozilla.org/en-US/docs/Web/API/Permissions """ class PermissionStatus: """ The PermissionStatus interface represents the current state of a permission. """ def __init__(self, status): self.status =...
70
19.16
80
10
289
python
[]
0
true
2024-11-19T02:04:43.348608+00:00
1,590,640,815,000
fa21462c13c3ba79f704ecc22d49ed300a49bf4f
3
{ "blob_id": "fa21462c13c3ba79f704ecc22d49ed300a49bf4f", "branch_name": "refs/heads/master", "committer_date": 1590640815000, "content_id": "a1d998d75e00a0bf119d6797a39cc090c2b78e1b", "detected_licenses": [ "MIT" ], "directory_id": "52d186ab5ac3381442043f9602e8c360ce018a9a", "extension": "py", "fi...
2.625
stackv2
#!/usr/bin/python3 # -*- coding:utf-8 -*- from tensorflow import keras from MultiHeadAttention import MultiHeadAttention from FFN import feed_forward_network # Encoder Layer class EncoderLayer(keras.layers.Layer): """ x -> self attention -> add & normalize & dropout -> feed_forward -> add & normalize & dropou...
36
40.28
97
11
376
python
[]
0
true
2024-11-19T02:04:43.406560+00:00
1,549,573,934,000
9634046727e376a63f63bc0ff38d491b9017a366
3
{ "blob_id": "9634046727e376a63f63bc0ff38d491b9017a366", "branch_name": "refs/heads/master", "committer_date": 1549573934000, "content_id": "36b724c1a18cb6a74c83b9b1b178583355b7112c", "detected_licenses": [ "MIT" ], "directory_id": "58b74e3dcf7c67de2ce84b6b408c2a9b0484d67b", "extension": "py", "fi...
2.546875
stackv2
from flask import Flask from flask import request import requests import json app = Flask(__name__) @app.route("/") def index(): response = requests.get('https://api.etsy.com/v2/listings/active?api_key=cdwxq4soa7q4zuavbtynj8wx&keywords=bicycle&includes=Images,Shop&sort_on=score') data = response.json() ...
40
17.57
155
12
190
python
[]
0
true
2024-11-19T02:04:43.586918+00:00
1,614,395,396,000
16e2bf29fb9222f92244aacca5a5818ed3ea1a52
3
{ "blob_id": "16e2bf29fb9222f92244aacca5a5818ed3ea1a52", "branch_name": "refs/heads/main", "committer_date": 1614395396000, "content_id": "a98381961bf547a9ee39c01aca9f005a5d39fdf4", "detected_licenses": [ "MIT" ], "directory_id": "a3196b27e2847968aabe367ff3ea869d13cb5bb1", "extension": "py", "file...
2.546875
stackv2
import json from dataclasses import dataclass from functools import cached_property from typing import (Any, ClassVar, Dict, List, Literal, Optional, Sequence, Union) from eth_utils import to_checksum_address from hexbytes import HexBytes from web3 import Web3 class EtherscanClientException(Excep...
108
38.06
142
15
1,038
python
[]
0
true
2024-11-19T02:04:43.851935+00:00
1,355,772,926,000
64917b3158788fe931f078fdc4d74cf0f5e64256
2
{ "blob_id": "64917b3158788fe931f078fdc4d74cf0f5e64256", "branch_name": "refs/heads/master", "committer_date": 1355772926000, "content_id": "ac6577857625b086c72cdf364b0554afa92cc21b", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "334e89507cd561ae90cadffd396917cb47c3e4cc", "extension": "p...
2.4375
stackv2
__author__ = 'Dr. Masroor Ehsan' __email__ = 'masroore@gmail.com' __copyright__ = 'Copyright 2013, Dr. Masroor Ehsan' __license__ = 'BSD' __version__ = '0.1.1' try: import simplejson as json except ImportError: try: import json except ImportError: try: from django.utils import s...
22
31.68
91
15
181
python
[]
0
true
2024-11-19T02:04:43.969053+00:00
1,518,459,997,000
5d99b871112d565c91812d00cbf40319e90507cf
3
{ "blob_id": "5d99b871112d565c91812d00cbf40319e90507cf", "branch_name": "refs/heads/master", "committer_date": 1518459997000, "content_id": "a4c3a9713d9b2a29497b1fe7b6112437624ccb83", "detected_licenses": [ "MIT" ], "directory_id": "0ae8b5fa69215be09001c27ae40a5059fb4e4189", "extension": "py", "fi...
3.265625
stackv2
"""P Neuron""" import random class PNeuron: """ each neuron has a unique nid, connects to other neurons (targets), follows a set of charge transformation rules, can be an internal or output neuron with output neurons terminating the computation """ nid = 0 @staticmethod def get_n...
69
27.77
113
16
451
python
[]
0
true
2024-11-19T02:04:44.328202+00:00
1,511,464,349,000
58c6a645e6b75bc7d6cc60be9526dcb6c638da54
3
{ "blob_id": "58c6a645e6b75bc7d6cc60be9526dcb6c638da54", "branch_name": "refs/heads/master", "committer_date": 1511464349000, "content_id": "e59d3557dd2edec3a2f8661e205eb9dc8dfa45b6", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "b202cef481853c4ebe89f5a7bea4881d0c7d7832", "extension": "p...
3.359375
stackv2
# coding=utf-8 __author__ = 'Sereni' """This module checks the task files filled in by evaluators and gives the number of correct answers. Input: the keys file generated with tasks and a filled-in task file with unchanged structure: task number: original text (optional) machine translation reference translation with {g...
76
31.51
113
17
596
python
[]
0
true
2024-11-19T02:04:44.490149+00:00
1,436,945,700,000
0a729f63a83c080db387695055be1277ab869bf7
3
{ "blob_id": "0a729f63a83c080db387695055be1277ab869bf7", "branch_name": "refs/heads/master", "committer_date": 1436945700000, "content_id": "f69d07b80e0a572f430a2dc4d0f5407f4cbf7c8b", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "381ca98e1848960ce40c32f230d9b0fc1a2e0009", "extension": "p...
2.640625
stackv2
# -*- coding: utf-8 -*- """ Base classes for all TSIP packets """ import struct from tsip.constants import DLE, DLE_STRUCT, ETX, ETX_STRUCT def _extract_code_from_packet(packet): code = struct.unpack('>B', packet[0])[0] if code in [0x8f, 0x8e]: return struct.unpack('>H', packet[0:2])[0] return...
82
18.79
59
13
406
python
[]
0
true
2024-11-19T02:04:44.542551+00:00
1,675,335,449,000
26d1bebd82034db5b2caba60de188d95148e6b90
2
{ "blob_id": "26d1bebd82034db5b2caba60de188d95148e6b90", "branch_name": "refs/heads/main", "committer_date": 1675337890000, "content_id": "229cf0dd3102804e5b6549a39cdfddc0bb128dcc", "detected_licenses": [ "MIT" ], "directory_id": "8da2df96b51e8691059c99cd4bb09b6b59f5d31a", "extension": "py", "file...
2.390625
stackv2
""" Multitask Model trained on the Unified DB - The four datasets QM9, Alchemy, OE62, and HOPV, with the unified split (split v2) are used. - One set of molecular energies is trained: (HOMO, LUMO, gap) x (PBE0) - The network has the Set2Set + molecule-level output module with six outputs, Same as multitask_model_v0...
59
29.86
83
11
496
python
[]
0
true
2024-11-19T02:04:44.670702+00:00
1,626,706,234,000
5e37d19689bb854d497f495802da84001d848231
3
{ "blob_id": "5e37d19689bb854d497f495802da84001d848231", "branch_name": "refs/heads/main", "committer_date": 1626706234000, "content_id": "c89cf2944db28fce1ad66c99df60be7f0cd78f34", "detected_licenses": [ "MIT" ], "directory_id": "5e31c1eeec6abe32f5294b034e86709985720384", "extension": "py", "file...
3.34375
stackv2
import sys from data.point import Point from asciimatics.event import KeyboardEvent class InputServiceAscii: """Detects player input. The responsibility of the class of objects is to detect and communicate player keypresses. Stereotype: Service Provider Attributes: _screen (Screen): An A...
37
29.7
119
14
291
python
[]
0
true
2024-11-19T02:04:44.780700+00:00
1,431,544,408,000
13b3347b228545e8e65765bd5d64e5122f5052a1
3
{ "blob_id": "13b3347b228545e8e65765bd5d64e5122f5052a1", "branch_name": "refs/heads/master", "committer_date": 1431544408000, "content_id": "4d0f5c546d6fc24897eada99b9dc11c9e252c783", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d864df0a56edb80b3d476b6fe17ac92f30276cea", "extension": "py"...
3.34375
stackv2
"""Functions for working with data that does not contain a spatial component This data will be the same for all observations in a given period, but will vary over time, e.g. weather data, scheduled events, etc. """ import csv from s3_utils import get_from_s3 def get_weather_data(path): """Helper function to get...
36
27.94
87
13
249
python
[]
0
true
2024-11-19T02:04:45.037821+00:00
1,636,207,959,000
ca8f8709fb641a3198a12e164e4ca30d7157c134
3
{ "blob_id": "ca8f8709fb641a3198a12e164e4ca30d7157c134", "branch_name": "refs/heads/master", "committer_date": 1636207959000, "content_id": "423a33c6358a923a99b4af66c9986cca5dd7ea11", "detected_licenses": [ "MIT" ], "directory_id": "3a94afddd371ef0244ab13962479870f1d5a88f2", "extension": "py", "fi...
2.65625
stackv2
import os import sys from sage.all import ZZ from sage.all import continued_fraction path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(os.path.abspath(__file__))))) if sys.path[1] != path: sys.path.insert(1, path) from attacks.factorization import known_phi def attack(N, e): """ R...
31
30.26
136
15
244
python
[]
0
true
2024-11-19T02:04:45.277647+00:00
1,614,181,199,000
f677b103bd34dae45164485af97d4b592aa9b8af
3
{ "blob_id": "f677b103bd34dae45164485af97d4b592aa9b8af", "branch_name": "refs/heads/master", "committer_date": 1614181199000, "content_id": "6b5306b82372ffd200947a0c6ad90a42ea4ab48c", "detected_licenses": [ "MIT", "Python-2.0" ], "directory_id": "50008b3b7fb7e14f793e92f5b27bf302112a3cb4", "exten...
2.625
stackv2
from __future__ import nested_scopes import types found='found' def deepindex(sequence, goal): """deepindex(sequence,goal) -> index list""" def helper(sequence,index_list): for item in sequence: if item==goal: index_list.append(sequence.index(item)) raise fo...
20
32.1
85
16
136
python
[]
0
true
2024-11-19T02:04:45.696888+00:00
1,654,143,092,000
4d77d7b714b0ad08d00b95a745ab8aea267a992a
2
{ "blob_id": "4d77d7b714b0ad08d00b95a745ab8aea267a992a", "branch_name": "refs/heads/master", "committer_date": 1654143092000, "content_id": "3a68991dac17842e26ccd94b7d64be7489fbfb06", "detected_licenses": [ "BSD-2-Clause" ], "directory_id": "b1213c567536bf490d45c0ab2de77ceeec9865e9", "extension": "p...
2.46875
stackv2
# Copyright 2019 VMware, Inc. # SPDX-License-Identifier: BSD-2-Clause import csv from network_insight_sdk_generic_datasources.common.log import py_logger import os class CsvWriter(object): CSV_EXTENSION = '.csv' @staticmethod def write(path, filename, table): if table is None: py_log...
47
38.4
99
20
366
python
[]
0
true
2024-11-19T02:04:45.759561+00:00
1,547,603,140,000
c0929ed1294c1064674a841481a7591d5e2ca37c
3
{ "blob_id": "c0929ed1294c1064674a841481a7591d5e2ca37c", "branch_name": "refs/heads/master", "committer_date": 1547603140000, "content_id": "1f6932286a85de5a9d96e42b7afb5dd85e029e34", "detected_licenses": [ "MIT" ], "directory_id": "6f0766bc05052e94787db575da36bdfbfbfad841", "extension": "py", "fi...
3.203125
stackv2
# -*- coding: utf-8 -*- """ Created on Tue Mar 13 17:24:21 2018 @author: corey """ def vader_tweet(tweet): '''returns vader polarity scores with the addition of a overall polarity score''' results = analyzer.polarity_scores(tweet) return results def tweet_sentiments(user): # Counter counter = 1...
54
26.94
85
14
329
python
[]
0
true
2024-11-19T02:04:45.805835+00:00
1,535,704,760,000
283c158eb7cf095ba9509482a9fa2bf5dd711089
3
{ "blob_id": "283c158eb7cf095ba9509482a9fa2bf5dd711089", "branch_name": "refs/heads/master", "committer_date": 1535704760000, "content_id": "9f5d6b174214709d1cb322508d8efe9306aafb53", "detected_licenses": [ "Apache-2.0" ], "directory_id": "98fa1dbfe9a8b4e29624137ed3ef8ba7b46de939", "extension": "py"...
2.84375
stackv2
# Copyright (C) 2018 GuQiangJs. # Licensed under Apache License 2.0 <see LICENSE file> import pandas as pd from pandas import read_excel def get_stock_holdings(index: str): """ 从 中证指数有限公司 获取指数的成分列表 Args: index: 指数代码 Returns: ``pandas.DataFrame``: Examples: .. code-block:: p...
79
28.29
87
11
713
python
[]
0
true
2024-11-19T02:04:46.053389+00:00
1,617,720,893,000
647d96632be9659812ac379f4046ed921f8ef8b9
4
{ "blob_id": "647d96632be9659812ac379f4046ed921f8ef8b9", "branch_name": "refs/heads/main", "committer_date": 1617720893000, "content_id": "49da52f46f0a75cc11e1a6afd12ef0e2bcb651c5", "detected_licenses": [ "MIT" ], "directory_id": "cdade1a368a069ab6ec61104c831d0760e87c141", "extension": "py", "file...
3.6875
stackv2
# Lesson 3.10 - Types of "join" import pandas as pd def test_run(): start_date = '2010-01-22' end_date = '2010-01-26' dates = pd.date_range(start_date, end_date) df1 = pd.DataFrame(index=dates) dfSPY = pd.read_csv("C:/Code/Python/Udacity/data/SPY.csv", index_col='Date',parse_dates=True, ...
18
25.5
62
11
157
python
[]
0
true
2024-11-19T02:04:46.103228+00:00
1,634,923,031,000
ace132019b9e9bf7b0f9ad0707898315919937c3
3
{ "blob_id": "ace132019b9e9bf7b0f9ad0707898315919937c3", "branch_name": "refs/heads/master", "committer_date": 1634923031000, "content_id": "3b69e328d86be19b75e92480fb3a9d46023e9197", "detected_licenses": [ "MIT" ], "directory_id": "2a61b02c26e77686e38cd9039e6f4b0530ddb7c9", "extension": "py", "fi...
2.703125
stackv2
import cv2 from cv_bridge import CvBridge import VisionExtensions import numpy as np from .candidate import Candidate, CandidateFinder import itertools import random import rospy from .live_fcnn_03 import FCNN03 class FcnnHandler(CandidateFinder): """ The :class:`.FcnnHandler` handles Fully Convolutional Neur...
267
39.7
156
20
2,506
python
[]
0
true
2024-11-19T02:04:46.321532+00:00
1,587,749,519,000
713a1cd2635af5e7b47581ab73e836a259faddc2
2
{ "blob_id": "713a1cd2635af5e7b47581ab73e836a259faddc2", "branch_name": "refs/heads/master", "committer_date": 1587749519000, "content_id": "ba1afbe07429fe75860621c3c051ab62df3b6877", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "c5c49a82f049057156d23095e4578fa5ce886ed6", "extension": "p...
2.375
stackv2
import argparse import h5py import numpy as np parser = argparse.ArgumentParser(description='Create a test file for H5Dread() profiling.') parser.add_argument('-c', action='store_true', help='Create a chunked dataset.') parser.add_argument('-F', action='store_true', help='Use the latest file format') parser.add_argume...
23
30.61
91
11
202
python
[]
0
true
2024-11-19T02:04:46.368812+00:00
1,627,355,724,000
9f025816e5cfa295dec885100e04dcfb22f83d33
4
{ "blob_id": "9f025816e5cfa295dec885100e04dcfb22f83d33", "branch_name": "refs/heads/main", "committer_date": 1627355724000, "content_id": "1ebcb9c59cdf88f100d7352b3c0c391d6a55e793", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d7e17ff5160cc61a07d82ec450f240e4a6dde093", "extension": "py", ...
3.75
stackv2
""" Бустрая сортировка методом разделяй и влавствуй Базовый случай: [] -> [] [x] -> [x] """ import unittest def my_quicksort(arr): if len(arr) < 2: return arr else: pivot = arr[0] less = [i for i in arr[1:] if i <= pivot] greater = [i for i in arr[1:] if i > pivot] r...
40
20.68
67
13
265
python
[]
0
true
2024-11-19T02:04:46.476904+00:00
1,548,799,199,000
e7571af783e0471181da9807b051cb8d1eddb8a6
2
{ "blob_id": "e7571af783e0471181da9807b051cb8d1eddb8a6", "branch_name": "refs/heads/master", "committer_date": 1548799199000, "content_id": "8dc4bb7af4b7f7f4f103615326f0778888cc0854", "detected_licenses": [ "MIT" ], "directory_id": "caad906678ae245cdfc9d7015fa5ea84881f370e", "extension": "py", "fi...
2.484375
stackv2
##################################################################################### # MIT License # # # # Copyright (C) 2019 Charly Lamothe ...
225
35.97
135
16
1,751
python
[]
0
true
2024-11-19T02:04:46.594698+00:00
1,528,026,015,000
d45e5cad85099467205f84c0726314ccea1e6040
3
{ "blob_id": "d45e5cad85099467205f84c0726314ccea1e6040", "branch_name": "refs/heads/master", "committer_date": 1528026015000, "content_id": "489786d4b2cc81884fe850cbc19de7dec1a53b2f", "detected_licenses": [ "MIT" ], "directory_id": "0a0790d8e587d95200b5d7097f361315562045d1", "extension": "py", "fi...
2.6875
stackv2
# -*- coding: utf-8 -*- """ Module to get and parse the product info on Amazon """ import requests from urllib.parse import urljoin from bs4 import BeautifulSoup _BASE_URL = "https://www.amazon.com/" _DEFAULT_BEAUTIFULSOUP_PARSER = "html.parser" CSS_SELECTORS_1 = { "product": "#resultItems > li", "title": "a ...
142
40.65
79
22
1,319
python
[]
0
true
2024-11-19T02:04:46.695230+00:00
1,692,767,210,000
bdd72aed9d2e9717c1ec2a5cce0ed684c3a087fc
3
{ "blob_id": "bdd72aed9d2e9717c1ec2a5cce0ed684c3a087fc", "branch_name": "refs/heads/main", "committer_date": 1692767210000, "content_id": "86413eaf893e0776ce8a2a2be90939d0e62ad3c1", "detected_licenses": [ "MIT" ], "directory_id": "8fafdc8ec12d895cd34299ecc1568c046f8c5252", "extension": "py", "file...
2.984375
stackv2
## Brian Blaylock ## September 22, 2020 """ =========== Other Tools =========== Other tools for handeling NOAA GOES data files. """ import numpy as np import cartopy.crs as ccrs import warnings try: import metpy # Need accessors to get projection info. except: # Not sure why sphinx can't import metpy?? ...
192
35.18
87
18
1,846
python
[]
0
true
2024-11-19T02:04:46.755414+00:00
1,498,497,881,000
d7c3c4de74f12366797d0f32d6523e08d565dae5
2
{ "blob_id": "d7c3c4de74f12366797d0f32d6523e08d565dae5", "branch_name": "refs/heads/master", "committer_date": 1498497881000, "content_id": "11458a5d8e2427d645783256d65e4443974943f9", "detected_licenses": [ "MIT" ], "directory_id": "fa1ab49fad5e9fa3f36577c74561fccd216a0162", "extension": "py", "fi...
2.5
stackv2
from .verificate_diff import VerificateDiff class Verificate: def __init__(self, inputfile, outputfile, correctoutput, isolator=None): Verificator = VerificateDiff self._verif = Verificator(inputfile, outputfile, correctoutput) self._isol = isolator def verificate(self): self...
19
25.68
77
11
123
python
[]
0
true
2024-11-19T02:04:46.813903+00:00
1,586,720,863,000
4656069eb49f3b9fa123b13dc23909b5148b5811
2
{ "blob_id": "4656069eb49f3b9fa123b13dc23909b5148b5811", "branch_name": "refs/heads/master", "committer_date": 1586720863000, "content_id": "2a1e04b2d26d0fb2f95b70d3768ac865d56efcbf", "detected_licenses": [ "Apache-2.0" ], "directory_id": "630cdfde8f46fbce1545f8f98d85335d316ad64f", "extension": "py"...
2.484375
stackv2
_PATH = '../../../datasets/' import os, sys if _PATH not in sys.path: sys.path.insert(0, _PATH) import tensorflow as tf import tensorflow_datasets as tfds from trainer.datasets.utils import normalize, random_jitter import numpy as np from skimage.transform import radon,iradon import glob def deeplesion(config_na...
193
35.81
169
19
1,877
python
[]
0
true
2024-11-19T02:04:47.102375+00:00
1,367,830,479,000
e075c0d05cc8c15c8c1b9b00893ffa38902996c7
3
{ "blob_id": "e075c0d05cc8c15c8c1b9b00893ffa38902996c7", "branch_name": "refs/heads/master", "committer_date": 1367830479000, "content_id": "c859373415818e62df0f198599381cd9f61192ff", "detected_licenses": [ "MIT" ], "directory_id": "06073e2f5564ac55ceeda35bd14df569b73b27dd", "extension": "py", "fi...
2.8125
stackv2
# coding=utf-8 import sublime import sublime_plugin import webbrowser import urllib class GoogleItCommand(sublime_plugin.TextCommand): def run(self, edit, include_language=False): """Google the selected text. """ view = self.view # Get the highlighted string to search for selecte...
32
31.88
103
16
226
python
[]
0
true
2024-11-19T02:04:47.593491+00:00
1,593,544,242,000
88eb91e657a4dd8d319cf08ba513d5716d00fb0e
2
{ "blob_id": "88eb91e657a4dd8d319cf08ba513d5716d00fb0e", "branch_name": "refs/heads/master", "committer_date": 1593544242000, "content_id": "519618ca9251a6a2246749d54615734e6b17fff2", "detected_licenses": [ "MIT" ], "directory_id": "5184f6470f9cf1e45a35330880e54df6267f8de6", "extension": "py", "fi...
2.375
stackv2
## regular imports import sys, os, socket, qdarkstyle ## PyQt5 imports from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5 import QtCore from PyQt5 import QtGui from PyQt5.QtGui import * class ConnectionHandler: def __init__(self, port, ID): self.s = socket.socket(socket.AF_INET, socket....
175
36.43
101
16
1,373
python
[]
0
true
2024-11-19T02:04:47.787799+00:00
1,538,497,930,000
237cd10becce29ca02e20045027b95960b2065e6
3
{ "blob_id": "237cd10becce29ca02e20045027b95960b2065e6", "branch_name": "refs/heads/master", "committer_date": 1538497930000, "content_id": "36c74e86570238b389a812855ea421de9a3baf93", "detected_licenses": [ "BSD-2-Clause-Views" ], "directory_id": "e3ed3f09396bbce16a5ec571ea0ec26a4193ad2e", "extensio...
3.421875
stackv2
import os from collections import OrderedDict from shutil import rmtree from artemis.general.display import surround_with_header from artemis.general.should_be_builtins import izip_equal from six.moves import input def crawl_directory(directory, ignore_hidden = True): """ Given a directory, return a dict repr...
195
34.52
136
20
1,526
python
[]
0
true
2024-11-19T02:04:47.854303+00:00
1,397,230,323,000
9b65cd6ee19eaa0c58dd0164c858ca2dc11f6d95
3
{ "blob_id": "9b65cd6ee19eaa0c58dd0164c858ca2dc11f6d95", "branch_name": "refs/heads/master", "committer_date": 1397230323000, "content_id": "c9c6774c1291471684480d8c5a10ab0c0b817a3c", "detected_licenses": [ "Apache-2.0" ], "directory_id": "d60ce42682dfab71a308844da0adf952238bed90", "extension": "py"...
2.9375
stackv2
import nltk from xml.dom import minidom import csv import re from nltk.stem.snowball import SnowballStemmer class PreprocessUtils(): def __init__(self): self.porterStemmer = nltk.PorterStemmer() self.stopwordsList = nltk.corpus.stopwords.words("english") self.wordNetLemmatizer = nltk.WordN...
77
38.83
126
20
783
python
[]
0
true
2024-11-19T02:04:48.011520+00:00
1,583,245,369,000
df58f019f5bb5f167d07ca01126d0f085ec4ae20
3
{ "blob_id": "df58f019f5bb5f167d07ca01126d0f085ec4ae20", "branch_name": "refs/heads/master", "committer_date": 1583245369000, "content_id": "bbcd7f71d84c8897ef010518f0a21d0b3f33ddb2", "detected_licenses": [ "MIT" ], "directory_id": "979793b6e47a759aff2389d44f13c8deef129ac7", "extension": "py", "fi...
2.953125
stackv2
import time import numpy as np from dataclasses import dataclass @dataclass class ObjectDetection: coord: np.array conf: float crop: np.array cls: int timestamp: float = time.time() """ Representation of a detection on an Image. This is model agnostic. """ @staticmethod def fro...
35
24.8
70
16
239
python
[]
0
true
2024-11-19T02:04:48.118235+00:00
1,624,777,150,000
f53a5ac44af80c16bb6e4800f24db5f33c3cfe2a
3
{ "blob_id": "f53a5ac44af80c16bb6e4800f24db5f33c3cfe2a", "branch_name": "refs/heads/master", "committer_date": 1624777150000, "content_id": "64db9318ff7e49773437ad90a667e8c219979f49", "detected_licenses": [ "Apache-2.0" ], "directory_id": "b6e5066821355294a9174be80af90312a071a5c2", "extension": "py"...
2.796875
stackv2
import subprocess from os import path def __getattr__(name): name = name.replace('_', '-') def callback(): file_name = 'scripts/%s.sh' % name if path.exists(file_name): p = subprocess.Popen(['bash', file_name]) p.wait() out, err = p.communicate() ...
18
25.44
64
15
102
python
[]
0
true
2024-11-19T02:04:48.289951+00:00
1,609,658,252,000
abd4b30b015843def93eaaee2f22587abae2b8c7
3
{ "blob_id": "abd4b30b015843def93eaaee2f22587abae2b8c7", "branch_name": "refs/heads/master", "committer_date": 1609658252000, "content_id": "0d8001e2a6c5b01cc3a4dd82bd1dab80be1fe626", "detected_licenses": [ "MIT" ], "directory_id": "983f118d7a430d2a0e15f7c773454933d76f42bc", "extension": "py", "fi...
3.421875
stackv2
""" compare recpie API """ def is_comparable(ask_ing, user_ing): """tell if the ingredients are comparable Args: ask_ing: ingredient from recipe user_ing: ingredient from user Returns: return True if they have same name and same quantity_unit """ if (ask_ing["name"] == user...
85
23.69
79
12
496
python
[]
0
true
2024-11-19T02:04:48.492938+00:00
1,614,286,382,000
8f71a5345717261e6e4dc957f87f1e7996182dfb
2
{ "blob_id": "8f71a5345717261e6e4dc957f87f1e7996182dfb", "branch_name": "refs/heads/main", "committer_date": 1614286382000, "content_id": "15edb98beda3fdd1c48f8c6922464840c9f66ca5", "detected_licenses": [ "MIT" ], "directory_id": "1c8bcd2d8e129a92e3328f47d2a452814c033327", "extension": "py", "file...
2.5
stackv2
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load in # import numpy as np # linear algebra # import pandas as pd # data processing, CSV file...
89
35.67
115
12
825
python
[]
0
true
2024-11-19T02:04:48.554613+00:00
1,350,258,440,000
075a213e79ae5c6e70fac5387ebf5c0eee0bfbad
3
{ "blob_id": "075a213e79ae5c6e70fac5387ebf5c0eee0bfbad", "branch_name": "refs/heads/master", "committer_date": 1350258440000, "content_id": "fb6df17f5cd270a995f2a7bedd08a609d85d6a50", "detected_licenses": [ "BSD-3-Clause" ], "directory_id": "7dbe7a85f3b3ee3d163bb1864233a2cea084f1bd", "extension": "p...
2.53125
stackv2
from rupypy.module import ClassDef from rupypy.objects.objectobject import W_Object class W_NumericObject(W_Object): classdef = ClassDef("Numeric", W_Object.classdef) @classdef.method("<=>") def method_comparator(self, space, w_other): if self == w_other: return space.newint(0) ...
21
28.43
56
13
147
python
[]
0
true
2024-11-19T02:04:48.604029+00:00
1,640,304,154,000
e3e40a06c3f12d7e57b53aa99e87de667fe9d5a2
2
{ "blob_id": "e3e40a06c3f12d7e57b53aa99e87de667fe9d5a2", "branch_name": "refs/heads/master", "committer_date": 1640304154000, "content_id": "fb95c739144c7e6524d50caee7d82f8fe99e2ca1", "detected_licenses": [ "MIT" ], "directory_id": "40218b64840f4eec1866e33300a8395bdfa4c33b", "extension": "py", "fi...
2.40625
stackv2
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import time import random import sys from mindset.MindSet import * class TestGraphics(): def __init__( self ): pass def run( self ): #sys.setcheckinterval( 100 ) attentionESense = [0]*10...
101
30.16
68
14
923
python
[]
0
true