blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
be15cb3de0992cd8315932b5b9a8413e561947b0 | 2b958af22e0bc07aa1109f5cdae1ee63b74a2349 | Megscammell/METOD-Algorithm | /tests/test_qing_gradient.py | Python | py | 523 | permissive | import numpy as np
from metod_alg import objective_functions as mt_obj
def test_1():
"""Computational test for mt_obj.qing_gradient() with d = 3."""
d = 3
x = np.array([1, -1, 2])
grad = mt_obj.qing_gradient(x, d)
assert(np.all(grad == np.array([0, 4, 8])))
def test_2():
"""Computational te... |
525365fb5497781fdafd80eb2f1936561db3f55c | a10ed640c3b0844678cd864c0c0f1513be5f230d | AJoh96/BasicTrack_Alida_WS2021 | /Week40/4.9.6.py | Python | py | 332 | no_license | import turtle
window = turtle.Screen()
window.bgcolor("lightgreen")
finn = turtle.Turtle()
finn.color('blue')
def draw_poly (t, n, sz):
angle = 360/n
for _ in range(n):
t.forward(sz)
t.left(angle)
def draw_equitriangle (t, sz):
draw_poly(t, 3, sz)
draw_equitriangle(finn, 50)
window... |
bb6f8ce1fdd8499685b55bf16ac40bf84cf8692b | 0cd4dcd8cb7e43763bf2ffc704f55f2ade437bf7 | rot256/Wargames | /wob-key/wob5.py | Python | py | 5,766 | no_license | #!/usr/bin/python2
import os
import struct
from pprint import pprint
from hashlib import sha1
from pwn import *
def cycleLen(data, place):
seen = {};
count = 0;
while not place in seen:
seen[place] = 1;
count += 1;
place = data[place];
return count;
def realSign(data):
res = 1;
for i in range(256):
... |
026588eb58ef79e9ba8c886469e995136636849c | 086de1aa3ee55e08689f1577243c1f218be22399 | CAVLab-tech/P-CNN-for-CAV | /demo/feature4_1.py | Python | py | 585 | no_license | import numpy as np
import pylab
import pickle as p
import sys
caffe_root = '/home/hadoop/workspace/caffe-master'
sys.path.append('/home/hadoop/workspace/caffe-master/python')
import caffe
caffe.set_mode_gpu()
def f4_1(conv1_2_1,conv1_2_2):
model_def = 'deploy4_1.prototxt'
#model_weights = 'test.caffemodel'
net =... |
22b03b8022a00a4aedf77fb04a7cb3daff66bb17 | 2742e7a227c8c623a47fc8d7d569054cd1012e81 | openstack/openstacksdk | /openstack/identity/version.py | Python | py | 1,208 | permissive | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.