hexsha
stringlengths
40
40
size
int64
2
1.02M
ext
stringclasses
10 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
245
max_stars_repo_name
stringlengths
6
130
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
191k
⌀
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
⌀
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
⌀
max_issues_repo_path
stringlengths
4
245
max_issues_repo_name
stringlengths
6
130
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
67k
⌀
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
⌀
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
⌀
max_forks_repo_path
stringlengths
4
245
max_forks_repo_name
stringlengths
6
130
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
⌀
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
⌀
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
⌀
content
stringlengths
2
1.02M
avg_line_length
float64
1
958k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
2 classes
is_sharp_comment_removed
bool
1 class
f77c81ebef2a01539533e716d4ee9e77d602f887
586
py
Python
applications/tensorflow/contrastive_divergence_vae/main_test.py
xihuaiwen/chinese_bert
631afbc76c40b0ac033be2186e717885246f446c
[ "MIT" ]
null
null
null
applications/tensorflow/contrastive_divergence_vae/main_test.py
xihuaiwen/chinese_bert
631afbc76c40b0ac033be2186e717885246f446c
[ "MIT" ]
null
null
null
applications/tensorflow/contrastive_divergence_vae/main_test.py
xihuaiwen/chinese_bert
631afbc76c40b0ac033be2186e717885246f446c
[ "MIT" ]
null
null
null
# Copyright 2020 Graphcore Ltd import os import pytest from examples_tests.test_util import SubProcessChecker working_path = os.path.dirname(__file__) class Test(SubProcessChecker): """ Test the contrastive divergence vae model. """ @pytest.mark.ipus(1) @pytest.mark.category1 def test_train_one_epoch...
32.555556
93
0.708191
import os import pytest from examples_tests.test_util import SubProcessChecker working_path = os.path.dirname(__file__) class Test(SubProcessChecker): @pytest.mark.ipus(1) @pytest.mark.category1 def test_train_one_epoch_one_ipu(self): self.run_command( "python3 main.py --no-testing --...
true
true
f77c82a8461d45911fdb2ca9c80250283f37b9e1
14,289
py
Python
batch_demo.py
JiwonCocoder/da-faster-rcnn-PyTorch-master
9ba9ffac51f1926bec4950b5f8cf3556250ddb59
[ "MIT" ]
null
null
null
batch_demo.py
JiwonCocoder/da-faster-rcnn-PyTorch-master
9ba9ffac51f1926bec4950b5f8cf3556250ddb59
[ "MIT" ]
null
null
null
batch_demo.py
JiwonCocoder/da-faster-rcnn-PyTorch-master
9ba9ffac51f1926bec4950b5f8cf3556250ddb59
[ "MIT" ]
null
null
null
# -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick # -------------------------------------------------------- from __future__ import absolute_import from __...
37.801587
119
0.589334
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import sys import numpy as np import argparse import pprint import pdb import time import cv2 import torch from torch.autograd import Variable import torch.nn as nn import torch.opt...
true
true
f77c8390d1640e81a7bc6a4ae596e11f5ef49b56
2,393
py
Python
api/src/app/batch/db_data_exporter.py
Zettai-Nikoru-Man/GijiNikoru
daf1269e2f26606f7367d9fa5467a4842fdd83b8
[ "MIT" ]
2
2016-10-09T10:14:55.000Z
2016-10-09T11:16:44.000Z
api/src/app/batch/db_data_exporter.py
Zettai-Nikoru-Man/GijiNikoru
daf1269e2f26606f7367d9fa5467a4842fdd83b8
[ "MIT" ]
null
null
null
api/src/app/batch/db_data_exporter.py
Zettai-Nikoru-Man/GijiNikoru
daf1269e2f26606f7367d9fa5467a4842fdd83b8
[ "MIT" ]
null
null
null
import csv import os import subprocess from src.app.config.hard_constants import HardConstants from src.app.helpers.db_helper import db_session from src.app.models.job_log import JobLogStatus, JobLogDAO from src.app.models.job_log import JobLogType from src.app.models.nicoru import NicoruDAO from src.app.services.nico...
37.390625
117
0.641872
import csv import os import subprocess from src.app.config.hard_constants import HardConstants from src.app.helpers.db_helper import db_session from src.app.models.job_log import JobLogStatus, JobLogDAO from src.app.models.job_log import JobLogType from src.app.models.nicoru import NicoruDAO from src.app.services.nico...
true
true
f77c859c76f2bb85afd8e069072842a86456e969
2,015
py
Python
nipype/interfaces/afni/tests/test_auto_FWHMx.py
effigies/nipype
18fe222557cf3b9627e06b2a66fba589feaca581
[ "Apache-2.0" ]
null
null
null
nipype/interfaces/afni/tests/test_auto_FWHMx.py
effigies/nipype
18fe222557cf3b9627e06b2a66fba589feaca581
[ "Apache-2.0" ]
2
2017-10-05T21:08:38.000Z
2018-10-09T23:01:23.000Z
nipype/interfaces/afni/tests/test_auto_FWHMx.py
effigies/nipype
18fe222557cf3b9627e06b2a66fba589feaca581
[ "Apache-2.0" ]
null
null
null
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..preprocess import FWHMx def test_FWHMx_inputs(): input_map = dict(acf=dict(argstr='-acf', usedefault=True, ), args=dict(argstr='%s', ), arith=dict(argstr='-arith', xor=['geom'], ), aut...
23.988095
78
0.611911
from ....testing import assert_equal from ..preprocess import FWHMx def test_FWHMx_inputs(): input_map = dict(acf=dict(argstr='-acf', usedefault=True, ), args=dict(argstr='%s', ), arith=dict(argstr='-arith', xor=['geom'], ), automask=dict(argstr='-automask', usedefault=True, ...
true
true
f77c871feba7ad6636231966dfc2c0ba0ae088e7
22,467
py
Python
recognition/eval/verification.py
stupiding/insightface
85a3b65c07b39e7ad02aabddd6cb6529baf4e605
[ "MIT" ]
4
2019-11-13T10:49:40.000Z
2021-01-08T04:45:11.000Z
recognition/eval/verification.py
stupiding/insightface
85a3b65c07b39e7ad02aabddd6cb6529baf4e605
[ "MIT" ]
7
2020-01-02T12:44:03.000Z
2021-06-10T20:19:20.000Z
recognition/eval/verification.py
stupiding/insightface
85a3b65c07b39e7ad02aabddd6cb6529baf4e605
[ "MIT" ]
3
2020-10-05T02:32:59.000Z
2021-12-14T10:06:53.000Z
"""Helper for evaluation on the Labeled Faces in the Wild dataset """ # MIT License # # Copyright (c) 2016 David Sandberg # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restric...
38.015228
151
0.660168
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import argparse import sys import numpy as np from scipy import misc from sklearn.model_selection import KFold from scipy import interpolate import sklearn import cv2 import math import datetime imp...
true
true
f77c876c75f57dba657af852fca23d037eb122ef
249
py
Python
setup.py
hxzhao527/aiospider
b23bc49fc9702ed9e0928a048971f3eccec1a1cd
[ "MIT" ]
1
2020-04-20T15:44:33.000Z
2020-04-20T15:44:33.000Z
setup.py
hxzhao527/aiospider
b23bc49fc9702ed9e0928a048971f3eccec1a1cd
[ "MIT" ]
null
null
null
setup.py
hxzhao527/aiospider
b23bc49fc9702ed9e0928a048971f3eccec1a1cd
[ "MIT" ]
1
2018-08-29T00:50:30.000Z
2018-08-29T00:50:30.000Z
from distutils.core import setup setup(name='aiospider', description='Python asyncio spider', author='HeartUnchange', author_email='haoxiangzhao@outlook.com', version='0.0.1', packages=['aiospider',"examples"], )
27.666667
46
0.658635
from distutils.core import setup setup(name='aiospider', description='Python asyncio spider', author='HeartUnchange', author_email='haoxiangzhao@outlook.com', version='0.0.1', packages=['aiospider',"examples"], )
true
true
f77c8838758726459254e6f8ddbe46e7babb78a2
2,404
py
Python
testsuite/tests/ui/tokens/conftest.py
dlaso99/3scale-tests
b31a3b3596af6d632b393e383c0417ea56bd95ca
[ "Apache-2.0" ]
5
2021-11-04T14:09:24.000Z
2021-12-23T13:48:36.000Z
testsuite/tests/ui/tokens/conftest.py
dlaso99/3scale-tests
b31a3b3596af6d632b393e383c0417ea56bd95ca
[ "Apache-2.0" ]
41
2021-11-03T14:27:21.000Z
2022-03-29T14:46:16.000Z
testsuite/tests/ui/tokens/conftest.py
dlaso99/3scale-tests
b31a3b3596af6d632b393e383c0417ea56bd95ca
[ "Apache-2.0" ]
12
2021-11-03T17:28:31.000Z
2021-11-30T12:28:25.000Z
"""Tokens conftest""" from urllib.parse import urljoin import pytest import requests from threescale_api.resources import InvoiceState @pytest.fixture(scope="module") def api_client(testconfig): """ New and different 3scale api client is needed because the one we regularly use needs token upon creation a...
32.486486
116
0.565724
from urllib.parse import urljoin import pytest import requests from threescale_api.resources import InvoiceState @pytest.fixture(scope="module") def api_client(testconfig): def _api_client(method, path, token, params=None, headers=None, **kwargs): url = urljoin(testconfig["threescale"]["admin"]["url"], ...
true
true
f77c8962abc71bff21bd9dbc9ea8f04c72d3894f
15,910
py
Python
ScotlandPYard/config/gameconfig.py
AhmadZakaria/ScotlandPYard
131e4b5c884319cb01a0c666dd54519986e515fa
[ "MIT" ]
6
2017-12-12T08:45:16.000Z
2020-05-15T19:34:09.000Z
ScotlandPYard/config/gameconfig.py
AhmadZakaria/ScotlandPYard
131e4b5c884319cb01a0c666dd54519986e515fa
[ "MIT" ]
139
2017-12-15T22:29:27.000Z
2022-03-01T15:01:24.000Z
ScotlandPYard/config/gameconfig.py
AhmadZakaria/ScotlandPYard
131e4b5c884319cb01a0c666dd54519986e515fa
[ "MIT" ]
2
2018-10-09T17:38:55.000Z
2020-06-21T21:28:28.000Z
#!/usr/bin/env python map3 = {"filename": "map3.jpg", "connections": { "Underground": [[1, 9, 46], [13, 23, 22, 34, 47, 46], [13, 50, 67], [13, 14, 15, 16, 29, 55, 71, 89], [46, 45, 58, 7...
32.669405
61
0.176116
map3 = {"filename": "map3.jpg", "connections": { "Underground": [[1, 9, 46], [13, 23, 22, 34, 47, 46], [13, 50, 67], [13, 14, 15, 16, 29, 55, 71, 89], [46, 45, 58, 74], ...
true
true
f77c8a31bdc10620deccb932465f81b93ed594b8
27,371
py
Python
dashboard/dashboard/list_tests_test.py
Martijnve23/catapult
5c63b19d221af6a12889e8727acc85d93892cab7
[ "BSD-3-Clause" ]
1,894
2015-04-17T18:29:53.000Z
2022-03-28T22:41:06.000Z
dashboard/dashboard/list_tests_test.py
Martijnve23/catapult
5c63b19d221af6a12889e8727acc85d93892cab7
[ "BSD-3-Clause" ]
4,640
2015-07-08T16:19:08.000Z
2019-12-02T15:01:27.000Z
dashboard/dashboard/list_tests_test.py
Martijnve23/catapult
5c63b19d221af6a12889e8727acc85d93892cab7
[ "BSD-3-Clause" ]
698
2015-06-02T19:18:35.000Z
2022-03-29T16:57:15.000Z
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function from __future__ import division from __future__ import absolute_import import json import unittest import webapp2 imp...
30.311185
80
0.524168
from __future__ import print_function from __future__ import division from __future__ import absolute_import import json import unittest import webapp2 import webtest from google.appengine.ext import ndb from dashboard import list_tests from dashboard.common import datastore_hooks from dashboard.common import laye...
true
true
f77c8b4bce9ebc3616ab5f16dd9424092f6be9dc
1,013
py
Python
beam11.py
Brlaney/python-matrix-fem
4dd0e1ee4db994cef896c57a0522fc48529a2d01
[ "MIT", "Unlicense" ]
null
null
null
beam11.py
Brlaney/python-matrix-fem
4dd0e1ee4db994cef896c57a0522fc48529a2d01
[ "MIT", "Unlicense" ]
null
null
null
beam11.py
Brlaney/python-matrix-fem
4dd0e1ee4db994cef896c57a0522fc48529a2d01
[ "MIT", "Unlicense" ]
null
null
null
# beam11.py # UNITS: METRIC (meters & kN) from lib.beams import * import numpy as np # Node coordinates (modeled with 4 nodes) nodes = np.array([[0], [4], [6], [11]]) # Member/element connection matrix members = np.array([[1, 2], [2, 3], [3, 4]]) # Pre-define arrays to contain each members n = len(nodes) # nu...
29.794118
60
0.595262
from lib.beams import * import numpy as np nodes = np.array([[0], [4], [6], [11]]) members = np.array([[1, 2], [2, 3], [3, 4]]) n = len(nodes) m = len(members) L = [] E = np.repeat(1, 5) I = np.repeat(1, 5) Kl = [] dgf = np.array([0, 0, 1, 1, 0, 1, 0, 1]) fg = np.array([[2, -100]]) ...
true
true
f77c8ba4c003dcab5215c6636783460bed53d817
584
py
Python
setup.py
ahmed-masud/meson-cmake-wrapper
54497d0609524327be67e8ff3a6ee6b2d4f19514
[ "MIT" ]
null
null
null
setup.py
ahmed-masud/meson-cmake-wrapper
54497d0609524327be67e8ff3a6ee6b2d4f19514
[ "MIT" ]
null
null
null
setup.py
ahmed-masud/meson-cmake-wrapper
54497d0609524327be67e8ff3a6ee6b2d4f19514
[ "MIT" ]
null
null
null
from setuptools import setup setup( name='meson-cmake-wrapper', version='0.3.2', description='Build system wrapper that provides Meson integration in CMake IDE\'s', author='Niclas Moeslund Overby', author_email='noverby@prozum.dk', url='http://github.com/prozum/meson-cmake-wrapper', package...
34.352941
97
0.69863
from setuptools import setup setup( name='meson-cmake-wrapper', version='0.3.2', description='Build system wrapper that provides Meson integration in CMake IDE\'s', author='Niclas Moeslund Overby', author_email='noverby@prozum.dk', url='http://github.com/prozum/meson-cmake-wrapper', package...
true
true
f77c8bbcbe3afaad13cd1c78d675d338a12c2725
9,926
py
Python
sql/query.py
sunnywalden/Archery
5d0319617f0fb7e29314f7895a90f1e78208752a
[ "Apache-2.0" ]
1
2022-01-07T03:33:06.000Z
2022-01-07T03:33:06.000Z
sql/query.py
sunnywalden/Archery
5d0319617f0fb7e29314f7895a90f1e78208752a
[ "Apache-2.0" ]
1
2019-11-26T15:21:09.000Z
2019-11-26T15:21:09.000Z
sql/query.py
sunnywalden/Archery
5d0319617f0fb7e29314f7895a90f1e78208752a
[ "Apache-2.0" ]
null
null
null
# -*- coding: UTF-8 -*- import datetime import logging import re import time import traceback import simplejson as json from django.contrib.auth.decorators import permission_required from django.db import connection, OperationalError from django.db.models import Q from django.http import HttpResponse from common.confi...
39.07874
107
0.624118
import datetime import logging import re import time import traceback import simplejson as json from django.contrib.auth.decorators import permission_required from django.db import connection, OperationalError from django.db.models import Q from django.http import HttpResponse from common.config import SysConfig from ...
true
true
f77c8be8c45f4fa37295588661f6cafb0a397f12
208
py
Python
app/main/errors.py
Gomax-07/news_api
ca296c94871857a1548c941f43b3bc06b072a5cd
[ "MIT" ]
null
null
null
app/main/errors.py
Gomax-07/news_api
ca296c94871857a1548c941f43b3bc06b072a5cd
[ "MIT" ]
null
null
null
app/main/errors.py
Gomax-07/news_api
ca296c94871857a1548c941f43b3bc06b072a5cd
[ "MIT" ]
null
null
null
from flask import render_template from . import main @main.app_errorhandler(404) def four_Ow_four(error): """funtion to render the 404 error page """ return render_template('fourOwfour.html'),404
26
49
0.745192
from flask import render_template from . import main @main.app_errorhandler(404) def four_Ow_four(error): return render_template('fourOwfour.html'),404
true
true
f77c8c75f4219767515785ba5950dbe55cc30c91
4,291
py
Python
optional-container-engine/config.py
caustin1990/GoogleAppEngine
0b6ca207616660b78fdf367f3aefd1e4a4d9a6bd
[ "Apache-2.0" ]
2
2019-11-21T18:41:58.000Z
2021-07-18T05:14:31.000Z
optional-container-engine/config.py
caustin1990/GoogleAppEngine
0b6ca207616660b78fdf367f3aefd1e4a4d9a6bd
[ "Apache-2.0" ]
null
null
null
optional-container-engine/config.py
caustin1990/GoogleAppEngine
0b6ca207616660b78fdf367f3aefd1e4a4d9a6bd
[ "Apache-2.0" ]
1
2022-02-06T00:02:27.000Z
2022-02-06T00:02:27.000Z
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
39.731481
79
0.762992
import os SECRET_KEY = 'secret' DATA_BACKEND = 'datastore' PROJECT_ID = 'your-project-id' CLOUDSQL_USER = 'root' CLOUDSQL_PASSWORD = 'your-cloudsql-password' CLOUDSQL_DATABASE = 'bookshelf' CLOUDSQL_CONNECTION_NAME = 'your-cloudsql-connection-name' LOCAL_SQLALCHEMY_DATABASE_URI = ( 'mysql+pymysql://{user}:{p...
true
true
f77c8d2d6cfa263aa58b206c61ca5fc832923314
948
py
Python
scripts/createGreenCageDeformer.py
ryusas/maya_greenCageDeformer
1bccf8923da7e88ac49dc9d67d2be3ea6e8a99b4
[ "MIT" ]
42
2016-07-16T09:10:57.000Z
2021-07-09T03:29:52.000Z
scripts/createGreenCageDeformer.py
ryusas/maya_greenCageDeformer
1bccf8923da7e88ac49dc9d67d2be3ea6e8a99b4
[ "MIT" ]
null
null
null
scripts/createGreenCageDeformer.py
ryusas/maya_greenCageDeformer
1bccf8923da7e88ac49dc9d67d2be3ea6e8a99b4
[ "MIT" ]
14
2016-10-14T15:15:50.000Z
2021-04-14T02:38:10.000Z
# -*- coding: utf-8 -*- u""" greenCageDeformer を作成し、ターゲットとケージをバインドするスクリプト例。 ケージ(一つのmesh)、ターゲット(任意のシェイプ、部分的なポイントや複数も可) の順に選択してスクリプトを実行するとバインドされる。 """ import maya.cmds as cmds def doit(cage_tgt=None): if not cage_tgt: cage_tgt = cmds.ls(sl=True, o=True) cage = cage_tgt[0] tgt = cage_tgt[1:] cm...
27.882353
89
0.656118
import maya.cmds as cmds def doit(cage_tgt=None): if not cage_tgt: cage_tgt = cmds.ls(sl=True, o=True) cage = cage_tgt[0] tgt = cage_tgt[1:] cmds.loadPlugin('greenCageDeformer.py', qt=True) deformer = cmds.deformer(tgt, type='greenCageDeformer')[0] freezer = cmds.createNode('transfor...
true
true
f77c8d6a74c834461dabd2c5b7e7cc3d6b12b0e3
2,162
py
Python
count_min_sketch/count_min_sketch.py
AWNystrom/CoutnMinSketch
2a8455321fe5fc1f42d858a145216908e8c714b3
[ "Apache-2.0" ]
3
2020-08-01T15:23:54.000Z
2022-02-04T22:23:38.000Z
count_min_sketch/count_min_sketch.py
AWNystrom/CoutnMinSketch
2a8455321fe5fc1f42d858a145216908e8c714b3
[ "Apache-2.0" ]
1
2015-07-23T18:19:02.000Z
2015-07-23T18:19:02.000Z
count_min_sketch/count_min_sketch.py
AWNystrom/CoutnMinSketch
2a8455321fe5fc1f42d858a145216908e8c714b3
[ "Apache-2.0" ]
2
2015-07-23T05:34:34.000Z
2019-02-10T23:28:03.000Z
from array import array from random import randint from math import log, e, ceil from itertools import izip class CountMinSketch(object): def __init__(self, w=None, d=None, delta=None, epsilon=None): """ CountMinSketch is an implementation of the count min sketch algorithm that probabilistically count...
33.261538
83
0.663275
from array import array from random import randint from math import log, e, ceil from itertools import izip class CountMinSketch(object): def __init__(self, w=None, d=None, delta=None, epsilon=None): """ CountMinSketch is an implementation of the count min sketch algorithm that probabilistically count...
false
true
f77c8f9a79949103e362eb59968f6a841682ce9d
1,731
py
Python
code-homework/ML/ex1_Linear Regression/ex1_batch.py
phww/Andrew.Ng-ML-Study
f0a84814bd538b0e0ec0d2a64d89338b730d1632
[ "MIT" ]
null
null
null
code-homework/ML/ex1_Linear Regression/ex1_batch.py
phww/Andrew.Ng-ML-Study
f0a84814bd538b0e0ec0d2a64d89338b730d1632
[ "MIT" ]
null
null
null
code-homework/ML/ex1_Linear Regression/ex1_batch.py
phww/Andrew.Ng-ML-Study
f0a84814bd538b0e0ec0d2a64d89338b730d1632
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import matplotlib.pyplot as plt data = pd.read_csv("ex1data1.txt",names = ['population','profit']) x = data.population y = data.profit "初始化,所有变量都是matrix" df = data.copy()#因为insert会改变原数组,所以先复制一份,坑1. df.insert(0,"one",1) X = df.iloc[:,0:df.shape[1]-1] y = df.iloc[:,df.shape[1]-1:df....
29.844828
89
0.65569
import numpy as np import pandas as pd import matplotlib.pyplot as plt data = pd.read_csv("ex1data1.txt",names = ['population','profit']) x = data.population y = data.profit df = data.copy()df.insert(0,"one",1) X = df.iloc[:,0:df.shape[1]-1] y = df.iloc[:,df.shape[1]-1:df.shape[1]]theta = np.zeros(X.shape[1]) y = np.ma...
true
true
f77c91629ed87a4cef1cf50e473989bb2e98d19a
5,266
py
Python
iconsdk/utils/templates.py
geometry-labs/icon-sdk-python
e530df02eb16b394c3022d2d7d0383bd972e129a
[ "Apache-2.0" ]
51
2018-08-29T04:15:36.000Z
2022-03-14T10:02:08.000Z
iconsdk/utils/templates.py
geometry-labs/icon-sdk-python
e530df02eb16b394c3022d2d7d0383bd972e129a
[ "Apache-2.0" ]
24
2018-09-03T03:16:19.000Z
2022-01-17T08:28:04.000Z
iconsdk/utils/templates.py
geometry-labs/icon-sdk-python
e530df02eb16b394c3022d2d7d0383bd972e129a
[ "Apache-2.0" ]
44
2018-09-06T22:36:16.000Z
2022-03-15T06:46:05.000Z
from collections import namedtuple from enum import Enum from iconsdk.utils.convert_type import convert_hex_str_to_bytes, convert_hex_str_to_int def addVersion(key, value, new_obj): new_obj[key] = value if value != '' else 2 def convert_data_content_to_bytes(key, value, new_obj): if new_obj["dataType"] == ...
28.934066
87
0.66749
from collections import namedtuple from enum import Enum from iconsdk.utils.convert_type import convert_hex_str_to_bytes, convert_hex_str_to_int def addVersion(key, value, new_obj): new_obj[key] = value if value != '' else 2 def convert_data_content_to_bytes(key, value, new_obj): if new_obj["dataType"] == ...
true
true
f77c91b903cdf2d41578007b65792e15daa6fa7f
3,986
py
Python
smac/initial_design/single_config_initial_design.py
brenting/SMAC3
f628d8b83f9f1803054d6e39bce7a51ab033dff1
[ "BSD-3-Clause" ]
51
2019-02-01T19:43:37.000Z
2022-03-16T09:07:03.000Z
smac/initial_design/single_config_initial_design.py
brenting/SMAC3
f628d8b83f9f1803054d6e39bce7a51ab033dff1
[ "BSD-3-Clause" ]
2
2019-02-23T18:54:22.000Z
2019-11-09T01:30:32.000Z
smac/initial_design/single_config_initial_design.py
brenting/SMAC3
f628d8b83f9f1803054d6e39bce7a51ab033dff1
[ "BSD-3-Clause" ]
35
2019-02-08T02:00:31.000Z
2022-03-01T23:17:00.000Z
from ConfigSpace import Configuration import numpy as np from smac.initial_design.initial_design import InitialDesign from smac.tae.execute_ta_run import ExecuteTARun, StatusType from smac.stats.stats import Stats from smac.utils.io.traj_logging import TrajLogger from smac.scenario.scenario import Scenario from smac.u...
34.66087
80
0.593828
from ConfigSpace import Configuration import numpy as np from smac.initial_design.initial_design import InitialDesign from smac.tae.execute_ta_run import ExecuteTARun, StatusType from smac.stats.stats import Stats from smac.utils.io.traj_logging import TrajLogger from smac.scenario.scenario import Scenario from smac.u...
true
true
f77c91ea4f8087d2b48a5862d8e0a97e38cf9792
3,403
py
Python
gygax/gygax/models.py
tmacro/hitman
525100ddb5939a3aa9b51df9d2e6449dc3035bbe
[ "BSD-3-Clause" ]
4
2017-07-21T01:39:17.000Z
2019-02-24T08:29:44.000Z
gygax/gygax/models.py
tmacro/hitman-old
525100ddb5939a3aa9b51df9d2e6449dc3035bbe
[ "BSD-3-Clause" ]
null
null
null
gygax/gygax/models.py
tmacro/hitman-old
525100ddb5939a3aa9b51df9d2e6449dc3035bbe
[ "BSD-3-Clause" ]
1
2017-06-23T21:01:51.000Z
2017-06-23T21:01:51.000Z
from sqlalchemy import Column, Integer, String, ForeignKey, Table, Text, Boolean, DateTime from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declarative_base from datetime import datetime from .app import Session from .api.slack import Slack as SlackApi from .util.crypto import ran...
31.220183
90
0.724361
from sqlalchemy import Column, Integer, String, ForeignKey, Table, Text, Boolean, DateTime from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declarative_base from datetime import datetime from .app import Session from .api.slack import Slack as SlackApi from .util.crypto import ran...
true
true
f77c9309a3df517aec11d3e2272815562607ca21
115
py
Python
run_api_f.py
phucty/mtab_dev
1334b65f77454b7188e1a80d42c5cbc123799edd
[ "MIT" ]
null
null
null
run_api_f.py
phucty/mtab_dev
1334b65f77454b7188e1a80d42c5cbc123799edd
[ "MIT" ]
null
null
null
run_api_f.py
phucty/mtab_dev
1334b65f77454b7188e1a80d42c5cbc123799edd
[ "MIT" ]
null
null
null
import uvicorn from api_f import app if __name__ == "__main__": uvicorn.run(app, host="localhost", port=8000)
19.166667
49
0.721739
import uvicorn from api_f import app if __name__ == "__main__": uvicorn.run(app, host="localhost", port=8000)
true
true
f77c930d026e7ad9ac7af108d29656bfeaa10fe7
6,942
py
Python
ruins/processing/sdm.py
hydrocode-de/RUINSapp
2dd0f8b0b0ed04e95ef2ace9154414b1f83a89dc
[ "MIT" ]
2
2022-02-28T15:07:16.000Z
2022-03-16T15:31:26.000Z
ruins/models/sdm.py
hydrocode-de/RUINSapp
2dd0f8b0b0ed04e95ef2ace9154414b1f83a89dc
[ "MIT" ]
45
2022-02-18T11:23:21.000Z
2022-03-31T09:16:20.000Z
sdm.py
hydrocode-de/RUINSapp
2dd0f8b0b0ed04e95ef2ace9154414b1f83a89dc
[ "MIT" ]
null
null
null
# BIAS CORRECTION import numpy as np import pandas as pd from scipy.stats import gamma from scipy.stats import norm from scipy.signal import detrend ''' Scaled distribution mapping for climate data This is a excerpt from pyCAT and the method after Switanek et al. (2017) containing the functions to perform a relative ...
40.835294
305
0.682368
import numpy as np import pandas as pd from scipy.stats import gamma from scipy.stats import norm from scipy.signal import detrend def relSDM(obs, mod, sce, cdf_threshold=0.9999999, lower_limit=0.1): obs_r = obs[obs >= lower_limit] mod_r = mod[mod >= lower_limit] sce_r = sce[sce >= lower_limit] obs...
true
true
f77c952b55a1420c1e8ac44844297f885f397aa6
1,709
py
Python
scipy/io/data_store.py
lesserwhirls/scipy-cwt
ee673656d879d9356892621e23ed0ced3d358621
[ "BSD-3-Clause" ]
8
2015-10-07T00:37:32.000Z
2022-01-21T17:02:33.000Z
scipy/io/data_store.py
lesserwhirls/scipy-cwt
ee673656d879d9356892621e23ed0ced3d358621
[ "BSD-3-Clause" ]
null
null
null
scipy/io/data_store.py
lesserwhirls/scipy-cwt
ee673656d879d9356892621e23ed0ced3d358621
[ "BSD-3-Clause" ]
8
2015-05-09T14:23:57.000Z
2018-11-15T05:56:00.000Z
""" Load or save values to a file. Shelves work well for storing data, but they are slow to access repeatedly - especially for large data sets. This module allows you to store data to a file and then load it back into the workspace. When the data is stored, a python module is also created as the "namespace for the da...
23.094595
74
0.645992
__all__ = ['save_as_module'] import dumb_shelve import os def _create_module(file_name): if not os.path.exists(file_name+'.py'): module_name = os.path.split(file_name)[-1] f = open(file_name+'.py','w') f.write('import scipy.io.data_store as data_store\n') f.write('import %s\n' % ...
true
true
f77c95c40e6289220be506a1c1726628b68e7527
3,679
py
Python
dis_snek/models/discord/application.py
Astrea49/dis_snek
c899a6f1caa3c2a45323dbe50ed8ed62676be9d6
[ "MIT" ]
null
null
null
dis_snek/models/discord/application.py
Astrea49/dis_snek
c899a6f1caa3c2a45323dbe50ed8ed62676be9d6
[ "MIT" ]
null
null
null
dis_snek/models/discord/application.py
Astrea49/dis_snek
c899a6f1caa3c2a45323dbe50ed8ed62676be9d6
[ "MIT" ]
null
null
null
from typing import TYPE_CHECKING, List, Optional, Dict, Any from dis_snek.client.const import MISSING from dis_snek.client.utils.attr_utils import define, field from dis_snek.client.utils.converters import optional from dis_snek.models.discord.asset import Asset from dis_snek.models.discord.enums import ApplicationFla...
48.407895
131
0.696657
from typing import TYPE_CHECKING, List, Optional, Dict, Any from dis_snek.client.const import MISSING from dis_snek.client.utils.attr_utils import define, field from dis_snek.client.utils.converters import optional from dis_snek.models.discord.asset import Asset from dis_snek.models.discord.enums import ApplicationFla...
true
true
f77c97140aa1c0c28de1b99a81b0e8bc13b34066
13,516
py
Python
python_code/train_tp_si.py
IBM/oct-glaucoma-vf-estimate
ea79352547f33fe05ee532ab9faad6a5e4811a76
[ "Apache-2.0" ]
null
null
null
python_code/train_tp_si.py
IBM/oct-glaucoma-vf-estimate
ea79352547f33fe05ee532ab9faad6a5e4811a76
[ "Apache-2.0" ]
null
null
null
python_code/train_tp_si.py
IBM/oct-glaucoma-vf-estimate
ea79352547f33fe05ee532ab9faad6a5e4811a76
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/struture_function1 python # File: train_tp.py # Author: Yasmeen George import tensorflow as tf #from tensorflow import keras import argparse from tensorpack.tfutils.summary import * from oct_dataflow_tp import * import tensorflow.contrib.slim as slim from keras import backend as K from contextlib import con...
42.2375
216
0.623631
import tensorflow as tf import argparse from tensorpack.tfutils.summary import * from oct_dataflow_tp import * import tensorflow.contrib.slim as slim from keras import backend as K from contextlib import contextmanager def model_summary(): model_vars = tf.trainable_variables() slim.model_analyzer.analyze_vars(...
true
true
f77c98a40adcf05760c0e2e4bdd7d60b28bb6ae9
856
py
Python
src/pretalx/orga/forms/schedule.py
xhub/pretalx
33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e
[ "Apache-2.0" ]
null
null
null
src/pretalx/orga/forms/schedule.py
xhub/pretalx
33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e
[ "Apache-2.0" ]
null
null
null
src/pretalx/orga/forms/schedule.py
xhub/pretalx
33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e
[ "Apache-2.0" ]
null
null
null
from django.forms import BooleanField, ModelForm, ValidationError from django.utils.translation import gettext_lazy as _ from pretalx.schedule.models import Schedule class ScheduleReleaseForm(ModelForm): notify_speakers = BooleanField( label=_('Notify speakers of changes'), required=False, initial=True ...
32.923077
110
0.689252
from django.forms import BooleanField, ModelForm, ValidationError from django.utils.translation import gettext_lazy as _ from pretalx.schedule.models import Schedule class ScheduleReleaseForm(ModelForm): notify_speakers = BooleanField( label=_('Notify speakers of changes'), required=False, initial=True ...
true
true
f77c991645ec606f19bdd8af4dbfbbda3a018cc3
25,946
py
Python
tensorflow/contrib/rnn/python/kernel_tests/lstm_ops_test.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
null
null
null
tensorflow/contrib/rnn/python/kernel_tests/lstm_ops_test.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
null
null
null
tensorflow/contrib/rnn/python/kernel_tests/lstm_ops_test.py
uve/tensorflow
e08079463bf43e5963acc41da1f57e95603f8080
[ "Apache-2.0" ]
null
null
null
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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...
40.41433
81
0.619826
from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import numpy as np from tensorflow.contrib.rnn.python.kernel_tests import benchmarking from tensorflow.contrib.rnn.python.ops import lstm_ops from tensorflow.p...
true
true
f77c9984c6af43bdbc2d63c0a188873004d3e2eb
2,163
py
Python
bokeh/sampledata/tests/test_periodic_table.py
al-yakubovich/bokeh
3d88647a5d10160cfef440278a2b0ae23258f290
[ "BSD-3-Clause" ]
1
2020-12-28T20:23:28.000Z
2020-12-28T20:23:28.000Z
bokeh/sampledata/tests/test_periodic_table.py
al-yakubovich/bokeh
3d88647a5d10160cfef440278a2b0ae23258f290
[ "BSD-3-Clause" ]
null
null
null
bokeh/sampledata/tests/test_periodic_table.py
al-yakubovich/bokeh
3d88647a5d10160cfef440278a2b0ae23258f290
[ "BSD-3-Clause" ]
null
null
null
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
34.333333
89
0.312991
from __future__ import absolute_import, division, print_function, unicode_literals import pytest ; pytest from bokeh._testing.util.api import verify_all ALL = ( 'elements', ) Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.periodic_table", ALL)) @pytest.mark.sampledata def test_elemen...
true
true
f77c99972ca802f8b062e0b2ba4053c70c968ac8
6,632
py
Python
sdk/python/pulumi_azure_native/alertsmanagement/get_health_alert.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/alertsmanagement/get_health_alert.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/alertsmanagement/get_health_alert.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from ...
33.494949
182
0.628166
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from . import outputs __all__ = [ 'GetHealthAlertResult', 'AwaitableGetHealthAlertResult', 'get_health_alert', ] @pulumi.output_type class GetHealthAlertResult...
true
true
f77c9ae6e80af52f616783ad898ec33452ebcfb8
15,050
py
Python
tests/gis_tests/rasterapp/test_rasterfield.py
vdboor/django
d4da39685b5974849c73e4c4dc6e07dfdf21c67a
[ "PSF-2.0", "BSD-3-Clause" ]
null
null
null
tests/gis_tests/rasterapp/test_rasterfield.py
vdboor/django
d4da39685b5974849c73e4c4dc6e07dfdf21c67a
[ "PSF-2.0", "BSD-3-Clause" ]
null
null
null
tests/gis_tests/rasterapp/test_rasterfield.py
vdboor/django
d4da39685b5974849c73e4c4dc6e07dfdf21c67a
[ "PSF-2.0", "BSD-3-Clause" ]
null
null
null
import json from django.contrib.gis.db.models.fields import BaseSpatialField from django.contrib.gis.db.models.functions import Distance from django.contrib.gis.db.models.lookups import DistanceLookupBase, GISLookup from django.contrib.gis.gdal import GDALRaster from django.contrib.gis.geos import GEOSGeometry from dj...
41.922006
119
0.606312
import json from django.contrib.gis.db.models.fields import BaseSpatialField from django.contrib.gis.db.models.functions import Distance from django.contrib.gis.db.models.lookups import DistanceLookupBase, GISLookup from django.contrib.gis.gdal import GDALRaster from django.contrib.gis.geos import GEOSGeometry from dj...
true
true
f77c9b3645e275d541a815b4170fea712460ed6b
48,566
py
Python
ela/spatial.py
DennisHgj/pyela
bbdbf1a55b31cd2ae4dc1877d220ad32589ead4c
[ "Intel", "MIT" ]
null
null
null
ela/spatial.py
DennisHgj/pyela
bbdbf1a55b31cd2ae4dc1877d220ad32589ead4c
[ "Intel", "MIT" ]
2
2019-08-13T06:14:35.000Z
2019-10-06T08:09:19.000Z
ela/spatial.py
DennisHgj/pyela
bbdbf1a55b31cd2ae4dc1877d220ad32589ead4c
[ "Intel", "MIT" ]
null
null
null
import numpy as np import pandas as pd from ela.textproc import EASTING_COL, NORTHING_COL, DEPTH_FROM_AHD_COL, DEPTH_FROM_COL, DEPTH_TO_AHD_COL, DEPTH_TO_COL, BORE_ID_COL KNN_WEIGHTING = 'distance' from sklearn import neighbors def read_raster_value(dem,band_1,easting,northing): """Read a value in a raster gri...
46.297426
213
0.665774
import numpy as np import pandas as pd from ela.textproc import EASTING_COL, NORTHING_COL, DEPTH_FROM_AHD_COL, DEPTH_FROM_COL, DEPTH_TO_AHD_COL, DEPTH_TO_COL, BORE_ID_COL KNN_WEIGHTING = 'distance' from sklearn import neighbors def read_raster_value(dem,band_1,easting,northing): if (np.isnan(easting) or np.isn...
true
true
f77c9b74cefdb66c20eb9a0a0395d65c782da5b3
16,234
py
Python
footmark/slb/connection.py
Jogesh-Click2Cloud/AliCloudAnsibleFootmark
559eca674647ee012d8ef86e44dba05bf28ce5ef
[ "Apache-2.0" ]
null
null
null
footmark/slb/connection.py
Jogesh-Click2Cloud/AliCloudAnsibleFootmark
559eca674647ee012d8ef86e44dba05bf28ce5ef
[ "Apache-2.0" ]
null
null
null
footmark/slb/connection.py
Jogesh-Click2Cloud/AliCloudAnsibleFootmark
559eca674647ee012d8ef86e44dba05bf28ce5ef
[ "Apache-2.0" ]
null
null
null
# encoding: utf-8 """ Represents a connection to the SLB service. """ import warnings import six import time import json from footmark.connection import ACSQueryConnection from footmark.slb.regioninfo import RegionInfo from footmark.slb.securitygroup import SecurityGroup from footmark.exception import SLBResponseErr...
49.343465
120
0.598805
import warnings import six import time import json from footmark.connection import ACSQueryConnection from footmark.slb.regioninfo import RegionInfo from footmark.slb.securitygroup import SecurityGroup from footmark.exception import SLBResponseError class SLBConnection(ACSQueryConnection): SDKVersion = '2014-05...
true
true
f77c9c0099a730888de9dfb3dccc56a5cd278afd
3,975
py
Python
test/system/auto/simple/simpleBalancer.py
marciosilva/accumulo
70404cbd1e0a2d2b7c2235009e158979abeef35f
[ "Apache-2.0" ]
3
2021-11-11T05:18:23.000Z
2021-11-11T05:18:43.000Z
test/system/auto/simple/simpleBalancer.py
jatrost/accumulo
6be40f2f3711aaa7d0b68b5b6852b79304af3cff
[ "Apache-2.0" ]
1
2021-06-22T09:52:37.000Z
2021-06-22T09:52:37.000Z
test/system/auto/simple/simpleBalancer.py
isabella232/accumulo-1
70404cbd1e0a2d2b7c2235009e158979abeef35f
[ "Apache-2.0" ]
1
2021-06-22T09:33:38.000Z
2021-06-22T09:33:38.000Z
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
33.974359
79
0.612075
import os import logging import unittest import time import sleep from TestUtils import TestUtilsMixin, ACCUMULO_DIR log = logging.getLogger('test.auto') from readwrite import SunnyDayTest, Interleaved from delete import DeleteTest class SimpleBalancerFairness(SunnyDayTest): order = 80 settings = TestUt...
true
true
f77c9cd129d9a54eedde4592a89281bd413726b8
768
py
Python
migrations/versions/166ae4251208_.py
ianterrell/uva-covid19-testing-communicator
ac80c44b5437a86b25778880b0b9df03ae5d683c
[ "MIT" ]
1
2020-12-07T21:47:02.000Z
2020-12-07T21:47:02.000Z
migrations/versions/166ae4251208_.py
ianterrell/uva-covid19-testing-communicator
ac80c44b5437a86b25778880b0b9df03ae5d683c
[ "MIT" ]
14
2020-09-24T15:38:27.000Z
2021-03-29T19:23:46.000Z
migrations/versions/166ae4251208_.py
ianterrell/uva-covid19-testing-communicator
ac80c44b5437a86b25778880b0b9df03ae5d683c
[ "MIT" ]
1
2020-09-22T18:01:29.000Z
2020-09-22T18:01:29.000Z
"""empty message Revision ID: 166ae4251208 Revises: Create Date: 2020-09-10 11:25:13.286571 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '166ae4251208' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
22.588235
65
0.669271
from alembic import op import sqlalchemy as sa revision = '166ae4251208' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table('contact', sa.Column('id', sa.Integer(), nullable=False), sa.Column('email', sa.String(), nullable=True), sa.Column('phone', sa.Stri...
true
true
f77c9d96ece01744180dd78ef75523866f11d504
10,382
py
Python
extensions/privacy/__init__.py
simra/msrflute
c28e2e6bcfa9464b8640ccd625393bbed28491c3
[ "MIT" ]
29
2021-11-30T16:18:04.000Z
2022-03-29T13:47:20.000Z
extensions/privacy/__init__.py
simra/msrflute
c28e2e6bcfa9464b8640ccd625393bbed28491c3
[ "MIT" ]
2
2022-01-07T19:53:26.000Z
2022-01-21T05:10:17.000Z
extensions/privacy/__init__.py
simra/msrflute
c28e2e6bcfa9464b8640ccd625393bbed28491c3
[ "MIT" ]
5
2021-12-07T05:14:12.000Z
2022-03-22T16:17:26.000Z
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import numpy as np import torch as T import logging import math import json from utils import print_rank from azureml.core import Run from scipy.special import betainc, betaln run = Run.get_context() def compute_LDP_noise_std(eps, max_sensitivi...
39.777778
149
0.629166
import numpy as np import torch as T import logging import math import json from utils import print_rank from azureml.core import Run from scipy.special import betainc, betaln run = Run.get_context() def compute_LDP_noise_std(eps, max_sensitivity, delta): return np.sqrt(2 * np.log(1.25 / delta)) * max_sensitivit...
true
true
f77c9db7a37ad8f92768c66f88b00e063174e557
538
py
Python
game/inputs.py
cat-in-the-dark/ludum_43_game
737bc08e6e2b7e3a92bb958b7c0a8ec0674d5a20
[ "MIT" ]
null
null
null
game/inputs.py
cat-in-the-dark/ludum_43_game
737bc08e6e2b7e3a92bb958b7c0a8ec0674d5a20
[ "MIT" ]
null
null
null
game/inputs.py
cat-in-the-dark/ludum_43_game
737bc08e6e2b7e3a92bb958b7c0a8ec0674d5a20
[ "MIT" ]
null
null
null
import jvcr class InputEx: def __init__(self, release_time=0.2) -> None: self.release_time = release_time self._history = {} def btnp(self, id, player_id=0): if jvcr.btn(id, player_id): time_not_pressed = self._history.get(id, self.release_time + 0.1) if time_n...
26.9
77
0.578067
import jvcr class InputEx: def __init__(self, release_time=0.2) -> None: self.release_time = release_time self._history = {} def btnp(self, id, player_id=0): if jvcr.btn(id, player_id): time_not_pressed = self._history.get(id, self.release_time + 0.1) if time_n...
true
true
f77c9f2988a52bf12261b25fe8728ff029c75940
14,735
py
Python
cf_xarray/datasets.py
ocefpaf/cf-xarray
7bdb033395c8959a5d8147fe148ec987c1122387
[ "Apache-2.0" ]
91
2020-06-01T16:24:17.000Z
2022-03-30T23:17:45.000Z
cf_xarray/datasets.py
ocefpaf/cf-xarray
7bdb033395c8959a5d8147fe148ec987c1122387
[ "Apache-2.0" ]
245
2020-06-01T16:16:48.000Z
2022-03-31T14:15:59.000Z
cf_xarray/datasets.py
ocefpaf/cf-xarray
7bdb033395c8959a5d8147fe148ec987c1122387
[ "Apache-2.0" ]
29
2020-06-01T15:57:27.000Z
2022-01-19T16:44:14.000Z
import numpy as np import xarray as xr airds = xr.tutorial.open_dataset("air_temperature").isel(time=slice(4), lon=slice(50)) airds.air.attrs["cell_measures"] = "area: cell_area" airds.air.attrs["standard_name"] = "air_temperature" airds.coords["cell_area"] = ( xr.DataArray(np.cos(airds.lat * np.pi / 180)) * x...
31.825054
105
0.409501
import numpy as np import xarray as xr airds = xr.tutorial.open_dataset("air_temperature").isel(time=slice(4), lon=slice(50)) airds.air.attrs["cell_measures"] = "area: cell_area" airds.air.attrs["standard_name"] = "air_temperature" airds.coords["cell_area"] = ( xr.DataArray(np.cos(airds.lat * np.pi / 180)) * x...
true
true
f77c9fbb7b050612a9aef3eef2dd36d1f383adc0
19,610
py
Python
Model/data_util.py
m1258218761/p-score
6031d0352561ba3b5baa352645c6cfdf560224f2
[ "MIT" ]
7
2019-09-16T13:14:29.000Z
2019-09-18T01:47:51.000Z
Model/data_util.py
m1258218761/p-score
6031d0352561ba3b5baa352645c6cfdf560224f2
[ "MIT" ]
null
null
null
Model/data_util.py
m1258218761/p-score
6031d0352561ba3b5baa352645c6cfdf560224f2
[ "MIT" ]
null
null
null
# coding=utf-8 import os import numpy as np import pandas as pd from sklearn.preprocessing import MaxAbsScaler class data(object): def __init__(self, workpath, label_number, features_norm=False, Standardization=False, discretization=0, run_model='Train', train_file='', validation_file='', test_fi...
52.857143
120
0.507139
import os import numpy as np import pandas as pd from sklearn.preprocessing import MaxAbsScaler class data(object): def __init__(self, workpath, label_number, features_norm=False, Standardization=False, discretization=0, run_model='Train', train_file='', validation_file='', test_file='', discreti...
true
true
f77c9fd3ed6a35c25e7251e57c40b72fcd1a1ed3
1,495
py
Python
ansible/venv/lib/python2.7/site-packages/ansible/module_utils/aws/s3.py
gvashchenkolineate/gvashchenkolineate_infra_trytravis
0fb18850afe0d8609693ba4b23f29c7cda17d97f
[ "MIT" ]
17
2017-06-07T23:15:01.000Z
2021-08-30T14:32:36.000Z
ansible/venv/lib/python2.7/site-packages/ansible/module_utils/aws/s3.py
gvashchenkolineate/gvashchenkolineate_infra_trytravis
0fb18850afe0d8609693ba4b23f29c7cda17d97f
[ "MIT" ]
9
2017-06-25T03:31:52.000Z
2021-05-17T23:43:12.000Z
ansible/venv/lib/python2.7/site-packages/ansible/module_utils/aws/s3.py
gvashchenkolineate/gvashchenkolineate_infra_trytravis
0fb18850afe0d8609693ba4b23f29c7cda17d97f
[ "MIT" ]
3
2018-05-26T21:31:22.000Z
2019-09-28T17:00:45.000Z
# Copyright (c) 2018 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) try: from botocore.exceptions import BotoCoreError, ClientError except ImportError: pass # Handled by the calling module HAS_MD5 = True try: from hashlib import md5 except Imp...
31.145833
92
0.585953
try: from botocore.exceptions import BotoCoreError, ClientError except ImportError: pass HAS_MD5 = True try: from hashlib import md5 except ImportError: try: from md5 import md5 except ImportError: HAS_MD5 = False def calculate_etag(module, filename, etag, s3, bucket, obj, ver...
true
true
f77c9fea5dde625ee983abcf5e62f7d3253242de
2,084
py
Python
api/conf/urls.py
uktrade/lite-ap
4e1a57956bd921992b4a6e2b8fbacbba5720960d
[ "MIT" ]
3
2019-05-15T09:30:39.000Z
2020-04-22T16:14:23.000Z
api/conf/urls.py
uktrade/lite-ap
4e1a57956bd921992b4a6e2b8fbacbba5720960d
[ "MIT" ]
85
2019-04-24T10:39:35.000Z
2022-03-21T14:52:12.000Z
api/conf/urls.py
uktrade/lite-ap
4e1a57956bd921992b4a6e2b8fbacbba5720960d
[ "MIT" ]
1
2021-01-17T11:12:19.000Z
2021-01-17T11:12:19.000Z
from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from django.conf import settings import api.core.views urlpatterns = [ path("healthcheck/", include("health_check.urls")), path("applications/", include("api.applications.urls")), path("audi...
41.68
78
0.684741
from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from django.conf import settings import api.core.views urlpatterns = [ path("healthcheck/", include("health_check.urls")), path("applications/", include("api.applications.urls")), path("audi...
true
true
f77ca0bea693877d034f4394c806bed8658af85c
114,604
py
Python
tests/unit/log_processing_test.py
Kami/scalyr-agent-2
b26ebb6a74c2670ae28052079f2fac95d88e832a
[ "Apache-2.0" ]
null
null
null
tests/unit/log_processing_test.py
Kami/scalyr-agent-2
b26ebb6a74c2670ae28052079f2fac95d88e832a
[ "Apache-2.0" ]
1
2020-06-03T13:19:37.000Z
2020-06-03T13:35:28.000Z
tests/unit/log_processing_test.py
Kami/scalyr-agent-2
b26ebb6a74c2670ae28052079f2fac95d88e832a
[ "Apache-2.0" ]
null
null
null
# Copyright 2014 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
38.626222
242
0.651155
from __future__ import absolute_import from __future__ import unicode_literals __author__ = "czerwin@scalyr.com" import atexit import os import shutil import tempfile import unittest import sys import time from io import open import scalyr_agent.util as scalyr_util from scalyr_agent.scalyr_client import EventSequen...
true
true
f77ca145a467e937d7dce616fad9279243eb3cdd
836
py
Python
train.py
maroomir/deep-rl-stock-simple
45101312056c7c7d222c391a875c024b97022809
[ "MIT" ]
null
null
null
train.py
maroomir/deep-rl-stock-simple
45101312056c7c7d222c391a875c024b97022809
[ "MIT" ]
null
null
null
train.py
maroomir/deep-rl-stock-simple
45101312056c7c7d222c391a875c024b97022809
[ "MIT" ]
null
null
null
import gym import numpy as np from stable_baselines3.ddpg.policies import MlpPolicy from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise from stable_baselines3 import DDPG from stable_baselines3.common.monitor import Monitor from env import Stock from utils.callbacks import getB...
33.44
108
0.825359
import gym import numpy as np from stable_baselines3.ddpg.policies import MlpPolicy from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise from stable_baselines3 import DDPG from stable_baselines3.common.monitor import Monitor from env import Stock from utils.callbacks import getB...
true
true
f77ca17a5c20d8edebf98b333cf0c0f07668a120
725
py
Python
Scanner/Minigames/Sabotage3.py
City-College-Norwich/Digi-Yr2-Project-AmongUs
ffd8f7e70cb3fccc01d37000dc6ef0554425d671
[ "MIT" ]
1
2022-02-17T00:40:54.000Z
2022-02-17T00:40:54.000Z
Scanner/Minigames/Sabotage3.py
City-College-Norwich/Sus-AmongUs
ffd8f7e70cb3fccc01d37000dc6ef0554425d671
[ "MIT" ]
null
null
null
Scanner/Minigames/Sabotage3.py
City-College-Norwich/Sus-AmongUs
ffd8f7e70cb3fccc01d37000dc6ef0554425d671
[ "MIT" ]
null
null
null
from Minigames.Minigame import Minigame from TimerHelper import TimerHelper class Sabotage3(Minigame): def __init__(self, parent,sabotagedStation): super().__init__(parent) self.parent = parent self.__target_station = sabotagedStation self.alreadyScanned = False def update(sel...
36.25
80
0.653793
from Minigames.Minigame import Minigame from TimerHelper import TimerHelper class Sabotage3(Minigame): def __init__(self, parent,sabotagedStation): super().__init__(parent) self.parent = parent self.__target_station = sabotagedStation self.alreadyScanned = False def update(sel...
true
true
f77ca190eec1ec0085972537ef900ec10fb26eb7
343
py
Python
main/CompuCellPythonTutorial/clusterMitosis/Simulation/clusterMitosis.py
JulianoGianlupi/nh-cc3d-4x-base-tool
c0f4aceebd4c5bf3ec39e831ef851e419b161259
[ "CC0-1.0" ]
null
null
null
main/CompuCellPythonTutorial/clusterMitosis/Simulation/clusterMitosis.py
JulianoGianlupi/nh-cc3d-4x-base-tool
c0f4aceebd4c5bf3ec39e831ef851e419b161259
[ "CC0-1.0" ]
null
null
null
main/CompuCellPythonTutorial/clusterMitosis/Simulation/clusterMitosis.py
JulianoGianlupi/nh-cc3d-4x-base-tool
c0f4aceebd4c5bf3ec39e831ef851e419b161259
[ "CC0-1.0" ]
1
2021-02-26T21:50:29.000Z
2021-02-26T21:50:29.000Z
from cc3d import CompuCellSetup from .clusterMitosisSteppables import VolumeParamSteppable from .clusterMitosisSteppables import MitosisSteppableClusters CompuCellSetup.register_steppable(steppable=VolumeParamSteppable(frequency=10)) CompuCellSetup.register_steppable(steppable=MitosisSteppableClusters(frequency=10)) ...
31.181818
83
0.889213
from cc3d import CompuCellSetup from .clusterMitosisSteppables import VolumeParamSteppable from .clusterMitosisSteppables import MitosisSteppableClusters CompuCellSetup.register_steppable(steppable=VolumeParamSteppable(frequency=10)) CompuCellSetup.register_steppable(steppable=MitosisSteppableClusters(frequency=10)) ...
true
true
f77ca3f3e2545745746ae3223367c958c49b42fd
44
py
Python
test-data/packages/typedpkg_ns_a/typedpkg_ns/a/bbb.py
ooprathamm/mypy
1ac9c77bb0b5b95a9b3ee8936ac74a52e6e641ac
[ "PSF-2.0" ]
null
null
null
test-data/packages/typedpkg_ns_a/typedpkg_ns/a/bbb.py
ooprathamm/mypy
1ac9c77bb0b5b95a9b3ee8936ac74a52e6e641ac
[ "PSF-2.0" ]
null
null
null
test-data/packages/typedpkg_ns_a/typedpkg_ns/a/bbb.py
ooprathamm/mypy
1ac9c77bb0b5b95a9b3ee8936ac74a52e6e641ac
[ "PSF-2.0" ]
null
null
null
def bf(a: bool) -> bool: return not a
14.666667
25
0.545455
def bf(a: bool) -> bool: return not a
true
true
f77ca4339f4e24328a5a5ce39a46d0e149044c49
616
py
Python
Utilities/pickles_to_csvs.py
labs15-baseball-pitch-predictor/flask_app
86e63b94d12d309e5080926b5e75333cc09cb2f1
[ "MIT" ]
null
null
null
Utilities/pickles_to_csvs.py
labs15-baseball-pitch-predictor/flask_app
86e63b94d12d309e5080926b5e75333cc09cb2f1
[ "MIT" ]
3
2021-03-31T19:48:32.000Z
2021-12-13T20:34:45.000Z
Utilities/pickles_to_csvs.py
labs15-baseball-pitch-predictor/flask_app
86e63b94d12d309e5080926b5e75333cc09cb2f1
[ "MIT" ]
1
2020-09-13T03:38:40.000Z
2020-09-13T03:38:40.000Z
## Takes Pickle Files and Exports Them to CSVs import pandas as pd source_path = "Season_pickles/" destination_path = "" filenames = [str(i) + '.pkl' for i in range(2010,2020)] seasons = ['df_' + str(i) for i in range(10,20)] season_dataframes = {} for i in list(zip(filenames, seasons)): path = source_path ...
24.64
55
0.621753
import pandas as pd source_path = "Season_pickles/" destination_path = "" filenames = [str(i) + '.pkl' for i in range(2010,2020)] seasons = ['df_' + str(i) for i in range(10,20)] season_dataframes = {} for i in list(zip(filenames, seasons)): path = source_path + i[0] df = pd.read_pickle(path, compre...
true
true
f77ca48b5e1d80af3180c196c8c4631040c285b4
2,440
py
Python
models/modules/batch_norm.py
vuiseng9/CalibTIP
69077c92611b079234706784c344e8c9156f3283
[ "MIT" ]
354
2017-02-02T14:28:11.000Z
2022-03-10T07:37:30.000Z
models/modules/batch_norm.py
vuiseng9/CalibTIP
69077c92611b079234706784c344e8c9156f3283
[ "MIT" ]
18
2017-08-13T02:37:30.000Z
2021-10-01T03:34:00.000Z
models/modules/batch_norm.py
vuiseng9/CalibTIP
69077c92611b079234706784c344e8c9156f3283
[ "MIT" ]
97
2017-02-05T11:41:42.000Z
2021-11-25T14:39:56.000Z
import torch import torch.nn as nn from torch.nn import BatchNorm1d as _BatchNorm1d from torch.nn import BatchNorm2d as _BatchNorm2d from torch.nn import BatchNorm3d as _BatchNorm3d """ BatchNorm variants that can be disabled by removing all parameters and running stats """ def has_running_stats(m): ...
32.972973
85
0.623361
import torch import torch.nn as nn from torch.nn import BatchNorm1d as _BatchNorm1d from torch.nn import BatchNorm2d as _BatchNorm2d from torch.nn import BatchNorm3d as _BatchNorm3d def has_running_stats(m): return getattr(m, 'running_mean', None) is not None\ or getattr(m, 'running_var', None)...
true
true
f77ca607e144bc3670ede8d1811e7ef47e627543
4,679
py
Python
syria_tr.py
anandpopat9/Twitter-Search
72cb54c26deb0be4c3b1f0bbd8347c418e2d2c17
[ "0BSD" ]
null
null
null
syria_tr.py
anandpopat9/Twitter-Search
72cb54c26deb0be4c3b1f0bbd8347c418e2d2c17
[ "0BSD" ]
null
null
null
syria_tr.py
anandpopat9/Twitter-Search
72cb54c26deb0be4c3b1f0bbd8347c418e2d2c17
[ "0BSD" ]
null
null
null
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import requests from requests_oauthlib import OAuth1 from urlparse import parse_qs import json import time global m m=1 file1 = open("/Users/anandpopat/Downloads/a/syria_tr.json","a") file2 = open("/Users/anandpopat/Downloads/a/syria_tr2.json","a") REQ...
36.554688
211
0.572131
from __future__ import unicode_literals import requests from requests_oauthlib import OAuth1 from urlparse import parse_qs import json import time global m m=1 file1 = open("/Users/anandpopat/Downloads/a/syria_tr.json","a") file2 = open("/Users/anandpopat/Downloads/a/syria_tr2.json","a") REQUEST_TOKEN_URL = "https://...
false
true
f77ca6353873d266024e00e322aa9cd52d69d3bb
1,224
py
Python
spinta/manifests/commands/error.py
atviriduomenys/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
2
2019-03-14T06:41:14.000Z
2019-03-26T11:48:14.000Z
spinta/manifests/commands/error.py
sirex/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
44
2019-04-05T15:52:45.000Z
2022-03-30T07:41:33.000Z
spinta/manifests/commands/error.py
sirex/spinta
77a10e201f8cdc63143fce7996fd0898acb1ff58
[ "MIT" ]
1
2019-04-01T09:54:27.000Z
2019-04-01T09:54:27.000Z
from typing import Dict from spinta import commands from spinta.components import Config from spinta.components import Node from spinta.manifests.components import Manifest @commands.get_error_context.register(Config) def get_error_context(config: Config, *, prefix='this') -> Dict[str, str]: return { 'co...
28.465116
78
0.642974
from typing import Dict from spinta import commands from spinta.components import Config from spinta.components import Node from spinta.manifests.components import Manifest @commands.get_error_context.register(Config) def get_error_context(config: Config, *, prefix='this') -> Dict[str, str]: return { 'co...
true
true
f77ca66febc32ddf9cc389e515ced49a56e5a290
656
py
Python
app.py
mkrenicki/web-scraping-challenge
7daf0e26ed4ce4849c149faed149b9dc6e3d5fbc
[ "ADSL" ]
null
null
null
app.py
mkrenicki/web-scraping-challenge
7daf0e26ed4ce4849c149faed149b9dc6e3d5fbc
[ "ADSL" ]
null
null
null
app.py
mkrenicki/web-scraping-challenge
7daf0e26ed4ce4849c149faed149b9dc6e3d5fbc
[ "ADSL" ]
null
null
null
from flask import Flask, render_template, redirect import pymongo import scrape_mars app = Flask(__name__) # Set up pymongo connection and link db client = pymongo.MongoClient('mongodb://localhost:27017') db = client.mission_to_mars_2 listings = db.listings @app.route("/") def index(): listings = mo...
26.24
60
0.698171
from flask import Flask, render_template, redirect import pymongo import scrape_mars app = Flask(__name__) client = pymongo.MongoClient('mongodb://localhost:27017') db = client.mission_to_mars_2 listings = db.listings @app.route("/") def index(): listings = mongo.db.listings.find_one() return re...
true
true
f77ca6df0afc0a3e6f0957472b56a6a85d82e5d0
1,068
py
Python
setup.py
tkgamegroup/AssetStudio
41b2d16bc93d3d447ebc1a9e5c88b40351bcdb54
[ "MIT" ]
null
null
null
setup.py
tkgamegroup/AssetStudio
41b2d16bc93d3d447ebc1a9e5c88b40351bcdb54
[ "MIT" ]
null
null
null
setup.py
tkgamegroup/AssetStudio
41b2d16bc93d3d447ebc1a9e5c88b40351bcdb54
[ "MIT" ]
null
null
null
import os import pathlib import urllib.request import subprocess os.system("chcp 65001") current_directory = pathlib.Path.cwd() print("Current Directory: " + str(current_directory)) os.system("vswhere.exe -latest -property installationPath > temp.txt") file = open("temp.txt") vs_path = pathlib.Path(file.read().strip...
28.864865
156
0.694757
import os import pathlib import urllib.request import subprocess os.system("chcp 65001") current_directory = pathlib.Path.cwd() print("Current Directory: " + str(current_directory)) os.system("vswhere.exe -latest -property installationPath > temp.txt") file = open("temp.txt") vs_path = pathlib.Path(file.read().strip...
true
true
f77ca7256e60454eae6db0f9d412b8d69d3f4940
292
py
Python
codepoints.py
dcecile/bitfontmake
43e9856a49849f9fa91cff813e29b181982040f2
[ "MIT" ]
2
2017-09-05T01:24:12.000Z
2018-07-28T22:41:39.000Z
codepoints.py
dcecile/bitfontmake
43e9856a49849f9fa91cff813e29b181982040f2
[ "MIT" ]
1
2017-09-10T19:41:25.000Z
2017-09-10T19:41:25.000Z
codepoints.py
dcecile/bitfontmake
43e9856a49849f9fa91cff813e29b181982040f2
[ "MIT" ]
null
null
null
import unicodedata replacement_character = unicodedata.lookup('REPLACEMENT CHARACTER') spaces = list(map(unicodedata.lookup, [ 'SPACE', 'NO-BREAK SPACE', 'THIN SPACE', 'IDEOGRAPHIC SPACE', ])) def is_uppercase(codepoint): return unicodedata.category(codepoint) == 'Lu'
20.857143
67
0.708904
import unicodedata replacement_character = unicodedata.lookup('REPLACEMENT CHARACTER') spaces = list(map(unicodedata.lookup, [ 'SPACE', 'NO-BREAK SPACE', 'THIN SPACE', 'IDEOGRAPHIC SPACE', ])) def is_uppercase(codepoint): return unicodedata.category(codepoint) == 'Lu'
true
true
f77ca72f2ae55652bcb233abf965e2c96347a979
1,518
py
Python
models/__init__.py
hqjenny/PyTorch-VAE
afd1ebed15e5bb95ce7ece9dbeb601315fa68764
[ "Apache-2.0" ]
null
null
null
models/__init__.py
hqjenny/PyTorch-VAE
afd1ebed15e5bb95ce7ece9dbeb601315fa68764
[ "Apache-2.0" ]
null
null
null
models/__init__.py
hqjenny/PyTorch-VAE
afd1ebed15e5bb95ce7ece9dbeb601315fa68764
[ "Apache-2.0" ]
null
null
null
from .base import * from .vanilla_vae import * from .vanilla_vae_label import * from .vanilla_vae_norm import * from .gamma_vae import * from .beta_vae import * from .wae_mmd import * from .cvae import * from .hvae import * from .vampvae import * from .iwae import * from .dfcvae import * from .mssim_vae import MSSIMVAE...
26.631579
49
0.604084
from .base import * from .vanilla_vae import * from .vanilla_vae_label import * from .vanilla_vae_norm import * from .gamma_vae import * from .beta_vae import * from .wae_mmd import * from .cvae import * from .hvae import * from .vampvae import * from .iwae import * from .dfcvae import * from .mssim_vae import MSSIMVAE...
true
true
f77ca750200aad9eb3e07da1e11b4435a1cd8d78
27,479
py
Python
syft/generic/pointers/pointer_tensor.py
Rahul-160/PySyft
182627db2369d6f93aa0667f5ea2abee5b878d58
[ "Apache-2.0" ]
1
2020-10-02T20:36:40.000Z
2020-10-02T20:36:40.000Z
syft/generic/pointers/pointer_tensor.py
Rahul-160/PySyft
182627db2369d6f93aa0667f5ea2abee5b878d58
[ "Apache-2.0" ]
null
null
null
syft/generic/pointers/pointer_tensor.py
Rahul-160/PySyft
182627db2369d6f93aa0667f5ea2abee5b878d58
[ "Apache-2.0" ]
null
null
null
from typing import List, Union import syft from syft.generic.frameworks.hook.hook_args import one from syft.generic.frameworks.hook.hook_args import register_type_rule from syft.generic.frameworks.hook.hook_args import register_forward_func from syft.generic.frameworks.hook.hook_args import register_backward_func from...
40.589365
100
0.627788
from typing import List, Union import syft from syft.generic.frameworks.hook.hook_args import one from syft.generic.frameworks.hook.hook_args import register_type_rule from syft.generic.frameworks.hook.hook_args import register_forward_func from syft.generic.frameworks.hook.hook_args import register_backward_func from...
true
true
f77ca82bb1372b270257ddf4abd18b172c7d8b83
312
py
Python
aws_dynamodb_policies/aws_dynamodb_table_ttl_enabled.py
glerb/panther-analysis
bc8518644e0a8fc7735576a700aa7269b3257546
[ "Apache-2.0" ]
null
null
null
aws_dynamodb_policies/aws_dynamodb_table_ttl_enabled.py
glerb/panther-analysis
bc8518644e0a8fc7735576a700aa7269b3257546
[ "Apache-2.0" ]
null
null
null
aws_dynamodb_policies/aws_dynamodb_table_ttl_enabled.py
glerb/panther-analysis
bc8518644e0a8fc7735576a700aa7269b3257546
[ "Apache-2.0" ]
null
null
null
from panther_base_helpers import IN_PCI_SCOPE, deep_get def policy(resource): if not IN_PCI_SCOPE(resource): return True if not resource['TimeToLiveDescription']: return False return deep_get(resource, 'TimeToLiveDescription', 'TimeToLiveStatus') == 'ENABLED'
24
55
0.682692
from panther_base_helpers import IN_PCI_SCOPE, deep_get def policy(resource): if not IN_PCI_SCOPE(resource): return True if not resource['TimeToLiveDescription']: return False return deep_get(resource, 'TimeToLiveDescription', 'TimeToLiveStatus') == 'ENABLED'
true
true
f77ca8495f7ff34c9ebce080664f6bd7b1c1fbe9
1,719
py
Python
was/lib/tuning/actions/DataSource.py
rocksun/ucmd
486de31324195f48c4110e327d635aaafe3d74d6
[ "Apache-2.0" ]
2
2019-10-09T06:59:47.000Z
2019-10-10T03:20:17.000Z
was/lib/tuning/actions/DataSource.py
rocksun/ucmd
486de31324195f48c4110e327d635aaafe3d74d6
[ "Apache-2.0" ]
null
null
null
was/lib/tuning/actions/DataSource.py
rocksun/ucmd
486de31324195f48c4110e327d635aaafe3d74d6
[ "Apache-2.0" ]
1
2021-11-25T06:41:17.000Z
2021-11-25T06:41:17.000Z
minConnections="10" maxConnections="80" connectionTimeout="60" unusedTimeout="300" webSphereDefaultIsolationLevel="2" statementCacheSize="100" internalds="DefaultEJBTimerDataSource,DefaultEJBTimerDataSource,OTiSDataSource" def modifyProps(ds_confid): propertySet = AdminConfig.showAttribute(ds_confid,'propertySet...
38.2
106
0.70797
minConnections="10" maxConnections="80" connectionTimeout="60" unusedTimeout="300" webSphereDefaultIsolationLevel="2" statementCacheSize="100" internalds="DefaultEJBTimerDataSource,DefaultEJBTimerDataSource,OTiSDataSource" def modifyProps(ds_confid): propertySet = AdminConfig.showAttribute(ds_confid,'propertySet...
false
true
f77ca8ce42c994ce6a4451708936a740eee6e19c
3,920
py
Python
iaso/tests/api/test_setup_account.py
ekhalilbsq/iaso
e6400c52aeb4f67ce1ca83b03efa3cb11ef235ee
[ "MIT" ]
29
2020-12-26T07:22:19.000Z
2022-03-07T13:40:09.000Z
iaso/tests/api/test_setup_account.py
ekhalilbsq/iaso
e6400c52aeb4f67ce1ca83b03efa3cb11ef235ee
[ "MIT" ]
150
2020-11-09T15:03:27.000Z
2022-03-07T15:36:07.000Z
iaso/tests/api/test_setup_account.py
ekhalilbsq/iaso
e6400c52aeb4f67ce1ca83b03efa3cb11ef235ee
[ "MIT" ]
4
2020-11-09T10:38:13.000Z
2021-10-04T09:42:47.000Z
from iaso.test import APITestCase from iaso import models as m class SetupAccountApiTestCase(APITestCase): @classmethod def setUpTestData(cls): account = m.Account(name="Zelda") source = m.DataSource.objects.create(name="Korogu") cls.source = source version = m.SourceVersion.ob...
39.59596
104
0.646429
from iaso.test import APITestCase from iaso import models as m class SetupAccountApiTestCase(APITestCase): @classmethod def setUpTestData(cls): account = m.Account(name="Zelda") source = m.DataSource.objects.create(name="Korogu") cls.source = source version = m.SourceVersion.ob...
true
true
f77ca91a57256febacf643385d0b50e6e2d1ed62
10,507
py
Python
python_modules/dagster/dagster/core/selector/subset_selector.py
dagster-io/dagster
5b834cee42670307157e9c6a4193a7fda1437841
[ "Apache-2.0" ]
4,606
2018-06-21T17:45:20.000Z
2022-03-31T23:39:42.000Z
python_modules/dagster/dagster/core/selector/subset_selector.py
dagster-io/dagster
5b834cee42670307157e9c6a4193a7fda1437841
[ "Apache-2.0" ]
6,221
2018-06-12T04:36:01.000Z
2022-03-31T21:43:05.000Z
python_modules/dagster/dagster/core/selector/subset_selector.py
dagster-io/dagster
5b834cee42670307157e9c6a4193a7fda1437841
[ "Apache-2.0" ]
619
2018-08-22T22:43:09.000Z
2022-03-31T22:48:06.000Z
import re import sys from collections import defaultdict from typing import TYPE_CHECKING, AbstractSet, List, NamedTuple, Optional from dagster.core.definitions.dependency import DependencyStructure, Node from dagster.core.errors import DagsterExecutionStepNotFoundError, DagsterInvalidSubsetError from dagster.utils im...
36.231034
117
0.643666
import re import sys from collections import defaultdict from typing import TYPE_CHECKING, AbstractSet, List, NamedTuple, Optional from dagster.core.definitions.dependency import DependencyStructure, Node from dagster.core.errors import DagsterExecutionStepNotFoundError, DagsterInvalidSubsetError from dagster.utils im...
true
true
f77ca9bf916d75fba85547944809dd77e4b4fed1
310
py
Python
Problems/0153/solve.py
luanshiyinyang/LCNotes
093b109aefd65c2263f59472f7118059d7eeb256
[ "MIT" ]
3
2021-09-04T05:24:20.000Z
2022-02-19T08:31:28.000Z
Problems/0153/solve.py
luanshiyinyang/LCNotes
093b109aefd65c2263f59472f7118059d7eeb256
[ "MIT" ]
null
null
null
Problems/0153/solve.py
luanshiyinyang/LCNotes
093b109aefd65c2263f59472f7118059d7eeb256
[ "MIT" ]
null
null
null
class Solution: def findMin(self, nums: List[int]) -> int: left, right = 0, len(nums) - 1 while left < right: mid = (left + right) // 2 if nums[mid] < nums[right]: right = mid else: left = mid + 1 return nums[left]
31
46
0.445161
class Solution: def findMin(self, nums: List[int]) -> int: left, right = 0, len(nums) - 1 while left < right: mid = (left + right) // 2 if nums[mid] < nums[right]: right = mid else: left = mid + 1 return nums[left]
true
true
f77ca9d116525242fee973e40c8d9b4811120de8
1,489
py
Python
test/functional/wallet_fallbackfee.py
danecoin/Danecoin
73d21d335c11a8966c995b7e8c520c2b55695c04
[ "MIT" ]
3
2021-05-14T20:46:07.000Z
2022-03-07T13:06:28.000Z
test/functional/wallet_fallbackfee.py
danecoin/Danecoin
73d21d335c11a8966c995b7e8c520c2b55695c04
[ "MIT" ]
null
null
null
test/functional/wallet_fallbackfee.py
danecoin/Danecoin
73d21d335c11a8966c995b7e8c520c2b55695c04
[ "MIT" ]
1
2021-11-18T23:16:38.000Z
2021-11-18T23:16:38.000Z
#!/usr/bin/env python3 # Copyright (c) 2017-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test wallet replace-by-fee capabilities in conjunction with the fallbackfee.""" from test_framework.tes...
48.032258
178
0.731363
from test_framework.test_framework import DanecoinTestFramework from test_framework.util import assert_raises_rpc_error class WalletRBFTest(DanecoinTestFramework): def set_test_params(self): self.num_nodes = 1 self.setup_clean_chain = True def skip_test_if_missing_module(self): self.sk...
true
true
f77caa27f29e9455b26f8689a704aa5bbd822523
18,436
py
Python
src/sage/schemes/product_projective/point.py
fchapoton/sage
765c5cb3e24dd134708eca97e4c52e0221cd94ba
[ "BSL-1.0" ]
4
2020-07-17T04:49:44.000Z
2020-07-29T06:33:51.000Z
src/sage/schemes/product_projective/point.py
Ivo-Maffei/sage
467fbc70a08b552b3de33d9065204ee9cbfb02c7
[ "BSL-1.0" ]
null
null
null
src/sage/schemes/product_projective/point.py
Ivo-Maffei/sage
467fbc70a08b552b3de33d9065204ee9cbfb02c7
[ "BSL-1.0" ]
3
2020-03-29T17:13:36.000Z
2021-05-03T18:11:28.000Z
r""" Points for products of projective spaces This class builds on the projective space class and its point and morphism classes. EXAMPLES: We construct products projective spaces of various dimensions over the same ring.:: sage: P1xP1.<x,y, u,v> = ProductProjectiveSpaces(QQ, [1, 1]) sage: P1xP1([2, 1, 3, 1...
31.676976
116
0.520286
from copy import copy from sage.categories.integral_domains import IntegralDomains from sage.categories.number_fields import NumberFields from sage.rings.fraction_field import FractionField from sage.rings.number_field.order import is_NumberFieldOrder from sage.rings.qqbar import QQbar from sage.schemes.generic.morphis...
true
true
f77cac602ef8ddbd376b3c49a5ae0de69082d121
2,721
py
Python
app/user/tests/test_ingredients_api.py
Tantelitiana22/recette-app-api
deb176a8fe6b2c4796121f5c5cec177c18743ef9
[ "MIT" ]
null
null
null
app/user/tests/test_ingredients_api.py
Tantelitiana22/recette-app-api
deb176a8fe6b2c4796121f5c5cec177c18743ef9
[ "MIT" ]
3
2021-04-08T20:46:52.000Z
2021-06-10T19:20:42.000Z
app/user/tests/test_ingredients_api.py
Tantelitiana22/recette-app-api
deb176a8fe6b2c4796121f5c5cec177c18743ef9
[ "MIT" ]
null
null
null
from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient from core.models import Ingredient from recette.serializers import IngredientSerializer INGREDIENT_URL = reverse('recette:ingredi...
32.783133
78
0.674752
from django.contrib.auth import get_user_model from django.urls import reverse from django.test import TestCase from rest_framework import status from rest_framework.test import APIClient from core.models import Ingredient from recette.serializers import IngredientSerializer INGREDIENT_URL = reverse('recette:ingredi...
true
true
f77cacabeea19fd5d0215735ca5558e93f20902c
5,083
py
Python
recipes/qt/6.x.x/test_package/conanfile.py
nadzkie0/conan-center-index
fde12bf20f2c4cb6a7554d09a5c9433a0f5cb72c
[ "MIT" ]
1
2022-01-29T20:39:09.000Z
2022-01-29T20:39:09.000Z
recipes/qt/6.x.x/test_package/conanfile.py
nadzkie0/conan-center-index
fde12bf20f2c4cb6a7554d09a5c9433a0f5cb72c
[ "MIT" ]
5
2020-05-29T16:26:17.000Z
2020-12-29T20:44:10.000Z
recipes/qt/6.x.x/test_package/conanfile.py
nadzkie0/conan-center-index
fde12bf20f2c4cb6a7554d09a5c9433a0f5cb72c
[ "MIT" ]
4
2021-06-03T23:24:03.000Z
2022-03-03T17:16:09.000Z
import os import shutil from conans import ConanFile, tools, Meson, RunEnvironment, CMake from conans.errors import ConanException class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "qt", "cmake", "cmake_find_package_multi", "cmake_find_package", "pkg_config", "...
38.507576
109
0.580169
import os import shutil from conans import ConanFile, tools, Meson, RunEnvironment, CMake from conans.errors import ConanException class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "qt", "cmake", "cmake_find_package_multi", "cmake_find_package", "pkg_config", "...
true
true
f77cad89ba1435ad49b4c1df8bc5940bb7786b4f
38,893
bzl
Python
transpiler/javatests/com/google/j2cl/transpiler/integration/optimized_js_list.bzl
VishrutMehta/j2cl
79e21aeaa5529aee2b6490fdc1b7cfa5575db283
[ "Apache-2.0" ]
1
2020-05-04T12:54:11.000Z
2020-05-04T12:54:11.000Z
transpiler/javatests/com/google/j2cl/transpiler/integration/optimized_js_list.bzl
VishrutMehta/j2cl
79e21aeaa5529aee2b6490fdc1b7cfa5575db283
[ "Apache-2.0" ]
3
2020-04-10T11:41:38.000Z
2020-04-23T11:32:23.000Z
transpiler/javatests/com/google/j2cl/transpiler/integration/optimized_js_list.bzl
VishrutMehta/j2cl
79e21aeaa5529aee2b6490fdc1b7cfa5575db283
[ "Apache-2.0" ]
1
2021-01-15T17:44:15.000Z
2021-01-15T17:44:15.000Z
"""DO NOT EDIT - generated by make_size_report.py """ OPTIMIZED_JS_LIST = [ "//transpiler/javatests/com/google/j2cl/transpiler/integration/abstractinnerclass:optimized_js", "//transpiler/javatests/com/google/j2cl/transpiler/integration/abstractinnerclass:optimized_js.esnext", "//transpiler/javatests/com/go...
102.891534
126
0.822436
OPTIMIZED_JS_LIST = [ "//transpiler/javatests/com/google/j2cl/transpiler/integration/abstractinnerclass:optimized_js", "//transpiler/javatests/com/google/j2cl/transpiler/integration/abstractinnerclass:optimized_js.esnext", "//transpiler/javatests/com/google/j2cl/transpiler/integration/alllongoperations:opt...
true
true
f77cadf3c827c565d87589a73db0dc2267af255a
8,673
py
Python
neodroidvision/classification/procedures/classification_procedures.py
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
[ "Apache-2.0" ]
1
2019-07-03T04:33:51.000Z
2019-07-03T04:33:51.000Z
neodroidvision/classification/procedures/classification_procedures.py
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
[ "Apache-2.0" ]
5
2019-07-03T04:38:07.000Z
2021-09-10T15:40:44.000Z
neodroidvision/classification/procedures/classification_procedures.py
aivclab/vision
6c644dd72f68bca608a2900e5d9461e90fe841eb
[ "Apache-2.0" ]
3
2019-10-03T06:14:40.000Z
2021-01-31T14:31:39.000Z
import copy import numpy import string import time import torch import tqdm from draugr.numpy_utilities import Split from draugr.python_utilities import ( rgb_drop_alpha_batch_nhwc, torch_vision_normalize_batch_nchw, ) from draugr.torch_utilities import ( TorchEvalSession, TorchTrainSession, global_...
34.553785
116
0.547561
import copy import numpy import string import time import torch import tqdm from draugr.numpy_utilities import Split from draugr.python_utilities import ( rgb_drop_alpha_batch_nhwc, torch_vision_normalize_batch_nchw, ) from draugr.torch_utilities import ( TorchEvalSession, TorchTrainSession, global_...
true
true
f77cae028046478a85ca5f8e3b07b7377953bfc9
3,175
py
Python
test/pypendency/neo4j_backend/test_cypher.py
Taschenbergerm/pypendency
d941f584cabd0e6acc56ec3df43be174198ae4b7
[ "Apache-2.0" ]
null
null
null
test/pypendency/neo4j_backend/test_cypher.py
Taschenbergerm/pypendency
d941f584cabd0e6acc56ec3df43be174198ae4b7
[ "Apache-2.0" ]
1
2021-06-23T15:05:40.000Z
2021-06-23T15:05:40.000Z
test/pypendency/neo4j_backend/test_cypher.py
Taschenbergerm/pypendency
d941f584cabd0e6acc56ec3df43be174198ae4b7
[ "Apache-2.0" ]
null
null
null
import dataclasses import pytest from pypendency.backend.neo4j.neo import Neo4jBackend from pypendency.backend.neo4j.cypher import Credentials from pypendency.backend.neo4j.cypher import CypherDialect from pypendency.backend.neo4j.cypher import graph_storage @dataclasses.dataclass() class FakeGraph: id = "g1" ...
30.528846
116
0.67874
import dataclasses import pytest from pypendency.backend.neo4j.neo import Neo4jBackend from pypendency.backend.neo4j.cypher import Credentials from pypendency.backend.neo4j.cypher import CypherDialect from pypendency.backend.neo4j.cypher import graph_storage @dataclasses.dataclass() class FakeGraph: id = "g1" ...
true
true
f77caeeb6d3c50267bdf71b3776d5400ee60518c
3,633
py
Python
reinvent_scoring/scoring/score_components/synthetic_accessibility/sas_component.py
MolecularAI/reinvent-scoring
f7e052ceeffd29e17e1672c33607189873c82a45
[ "MIT" ]
null
null
null
reinvent_scoring/scoring/score_components/synthetic_accessibility/sas_component.py
MolecularAI/reinvent-scoring
f7e052ceeffd29e17e1672c33607189873c82a45
[ "MIT" ]
2
2021-11-01T23:19:42.000Z
2021-11-22T23:41:39.000Z
reinvent_scoring/scoring/score_components/synthetic_accessibility/sas_component.py
MolecularAI/reinvent-scoring
f7e052ceeffd29e17e1672c33607189873c82a45
[ "MIT" ]
2
2021-11-18T13:14:22.000Z
2022-03-16T07:52:57.000Z
import pickle from typing import List import numpy as np from rdkit.Chem import Mol from rdkit.Chem.Descriptors import ExactMolWt from reinvent_chemistry import Descriptors from reinvent_scoring.scoring.component_parameters import ComponentParameters from reinvent_scoring.scoring.score_components import BaseScoreCom...
41.758621
117
0.701349
import pickle from typing import List import numpy as np from rdkit.Chem import Mol from rdkit.Chem.Descriptors import ExactMolWt from reinvent_chemistry import Descriptors from reinvent_scoring.scoring.component_parameters import ComponentParameters from reinvent_scoring.scoring.score_components import BaseScoreCom...
true
true
f77cafa17a70e3fe78f3dd70270da85314096b2b
14,851
py
Python
lstchain/visualization/plot_calib.py
cta-observatory/cta-lstchain
d2d22567a6d0028737dd3b663f45c6206e43c437
[ "BSD-3-Clause" ]
19
2018-05-30T14:13:16.000Z
2022-03-10T14:04:04.000Z
lstchain/visualization/plot_calib.py
cta-observatory/cta-lstchain
d2d22567a6d0028737dd3b663f45c6206e43c437
[ "BSD-3-Clause" ]
868
2018-05-31T12:02:25.000Z
2022-03-30T16:02:42.000Z
lstchain/visualization/plot_calib.py
cta-observatory/cta-lstchain
d2d22567a6d0028737dd3b663f45c6206e43c437
[ "BSD-3-Clause" ]
76
2018-05-31T09:59:02.000Z
2022-01-29T17:57:49.000Z
from matplotlib import pyplot as plt from ctapipe.visualization import CameraDisplay import numpy as np from matplotlib.backends.backend_pdf import PdfPages from ctapipe_io_lst import load_camera_geometry from ctapipe.coordinates import EngineeringCameraFrame # read back the monitoring containers written with the tool...
38.775457
112
0.520908
from matplotlib import pyplot as plt from ctapipe.visualization import CameraDisplay import numpy as np from matplotlib.backends.backend_pdf import PdfPages from ctapipe_io_lst import load_camera_geometry from ctapipe.coordinates import EngineeringCameraFrame from ctapipe.containers import ( FlatFieldContainer, ...
true
true
f77caffa00f56bcea8a84c3c17448168e6237d34
3,775
py
Python
object_webcam.py
AndyLiu11037/card-detector
c4917f0235b623cb439e91a5e74d4acd08d03887
[ "MIT" ]
null
null
null
object_webcam.py
AndyLiu11037/card-detector
c4917f0235b623cb439e91a5e74d4acd08d03887
[ "MIT" ]
null
null
null
object_webcam.py
AndyLiu11037/card-detector
c4917f0235b623cb439e91a5e74d4acd08d03887
[ "MIT" ]
null
null
null
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Suppress TensorFlow logging (1) import pathlib import tensorflow as tf import sys tf.get_logger().setLevel('ERROR') # Suppress TensorFlow logging (2) import time from object_detection.utils import label_map_util from object_detection.utils import visual...
37.376238
111
0.740662
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import pathlib import tensorflow as tf import sys tf.get_logger().setLevel('ERROR') import time from object_detection.utils import label_map_util from object_detection.utils import visualization_utils as viz_utils from object_detection.builders import mod...
true
true
f77cb0a9f41746498a2d76230d85f2b302b6757c
7,054
py
Python
test/functional/walletbackup.py
blockledgerltd/SKBL
12660d623126c5a12d6bb1c56c21b0a5fef6fb36
[ "MIT" ]
32
2018-03-16T18:19:33.000Z
2022-01-22T13:13:45.000Z
test/functional/walletbackup.py
blockledgerltd/SKBL
12660d623126c5a12d6bb1c56c21b0a5fef6fb36
[ "MIT" ]
16
2018-08-10T03:26:42.000Z
2020-11-12T13:50:56.000Z
test/functional/walletbackup.py
blockledgerltd/SKBL
12660d623126c5a12d6bb1c56c21b0a5fef6fb36
[ "MIT" ]
17
2018-04-12T21:15:31.000Z
2021-05-20T12:16:30.000Z
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Copyright (c) Flo Developers 2013-2018 # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet backup features. Test case is: 4 nodes. 1 2 a...
35.447236
91
0.649986
from random import randint import shutil from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class WalletBackupTest(BitcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 4 s...
true
true
f77cb0e2e7df56ded5e4f5a7b825628b3a098094
217
py
Python
templates/foo.py
corenel/lintcode
e985cc8541ad26352a4ae2c8c8e4a572a5368e43
[ "MIT" ]
1
2019-02-24T13:40:26.000Z
2019-02-24T13:40:26.000Z
templates/foo.py
corenel/leetcode
83c6072b65d682854f378fe2eaf0974b2918c2de
[ "MIT" ]
null
null
null
templates/foo.py
corenel/leetcode
83c6072b65d682854f378fe2eaf0974b2918c2de
[ "MIT" ]
null
null
null
""" Problem 1 --------- Description for problem 1. """ import unittest def foo(): pass class TestFoo(unittest.TestCase): def test_foo(self): pass if __name__ == '__main__': unittest.main()
9.863636
33
0.603687
import unittest def foo(): pass class TestFoo(unittest.TestCase): def test_foo(self): pass if __name__ == '__main__': unittest.main()
true
true
f77cb111122052113e478c115be33496aa93c59a
786
py
Python
urllib/UrlHandle/urlparsedemo.py
pengchenyu111/SpiderLearning
d1fca1c7f46bfb22ad23f9396d0f2e2301ec4534
[ "Apache-2.0" ]
3
2020-11-21T13:13:46.000Z
2020-12-03T05:43:32.000Z
urllib/UrlHandle/urlparsedemo.py
pengchenyu111/SpiderLearning
d1fca1c7f46bfb22ad23f9396d0f2e2301ec4534
[ "Apache-2.0" ]
null
null
null
urllib/UrlHandle/urlparsedemo.py
pengchenyu111/SpiderLearning
d1fca1c7f46bfb22ad23f9396d0f2e2301ec4534
[ "Apache-2.0" ]
1
2020-12-03T05:43:53.000Z
2020-12-03T05:43:53.000Z
from urllib.parse import urlparse, urlunparse result = urlparse('https://search.jd.com/Searchprint;hello?keyword=Python从菜鸟到高手&enc=utf-8#comment') print('scheme:', result.scheme) print('netloc:', result.netloc) print('path:', result.path) print('params:', result.params) print('query:', result.query) print('fragment:',...
34.173913
105
0.698473
from urllib.parse import urlparse, urlunparse result = urlparse('https://search.jd.com/Searchprint;hello?keyword=Python从菜鸟到高手&enc=utf-8#comment') print('scheme:', result.scheme) print('netloc:', result.netloc) print('path:', result.path) print('params:', result.params) print('query:', result.query) print('fragment:',...
true
true
f77cb12fae31e31a8ea79c5daea92843a6506b49
5,837
py
Python
netapp/santricity/models/symbol/pit_view_membership.py
NetApp/santricity-webapi-pythonsdk
1d3df4a00561192f4cdcdd1890f4d27547ed2de2
[ "BSD-3-Clause-Clear" ]
5
2016-08-23T17:52:22.000Z
2019-05-16T08:45:30.000Z
netapp/santricity/models/symbol/pit_view_membership.py
NetApp/santricity-webapi-pythonsdk
1d3df4a00561192f4cdcdd1890f4d27547ed2de2
[ "BSD-3-Clause-Clear" ]
2
2016-11-10T05:30:21.000Z
2019-04-05T15:03:37.000Z
netapp/santricity/models/symbol/pit_view_membership.py
NetApp/santricity-webapi-pythonsdk
1d3df4a00561192f4cdcdd1890f4d27547ed2de2
[ "BSD-3-Clause-Clear" ]
7
2016-08-25T16:11:44.000Z
2021-02-22T05:31:25.000Z
# coding: utf-8 """ PITViewMembership.py The Clear BSD License Copyright (c) – 2016, NetApp, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met...
36.943038
844
0.631317
from pprint import pformat from six import iteritems class PITViewMembership(object): def __init__(self): self.swagger_types = { 'view_type': 'str', 'cg_view_ref': 'str' } self.attribute_map = { 'view_type': 'viewType', 'cg_view_ref': 'c...
true
true
f77cb2c32323082edcda161b7f9f96be0ffd2e25
12,755
py
Python
.history/qfunction/quantum/quantum_circuit_20210710225508.py
gpftc/qfunction
5c3ceed0e270d343d51ee0b69d98d4fffad47b24
[ "MIT" ]
null
null
null
.history/qfunction/quantum/quantum_circuit_20210710225508.py
gpftc/qfunction
5c3ceed0e270d343d51ee0b69d98d4fffad47b24
[ "MIT" ]
null
null
null
.history/qfunction/quantum/quantum_circuit_20210710225508.py
gpftc/qfunction
5c3ceed0e270d343d51ee0b69d98d4fffad47b24
[ "MIT" ]
null
null
null
######################## ## Author: Reinan Br. ## ## Date_init:01/07/21 ## ######################## from qfunction import q_sin,q_exp,q_cos,radian,limit import numpy as np from numpy import sqrt,array from math import atan ############ quantum equations ############# def q_rho(u,q=1,cpx=False,israd=True): u = radian(u...
30.73494
93
0.489063
from qfunction import q_sin,q_exp,q_cos,radian,limit import numpy as np from numpy import sqrt,array from math import atan def q_rho(u,q=1,cpx=False,israd=True): u = radian(u) if(not israd) else u u = u*1j if cpx: return sqrt(q_exp(u,q)*q_exp(-u,q)) else: return (sqrt(q_exp(u,q)*q_exp(-u,q))).real def q_psi(...
true
true
f77cb2d54aa81406903eb314f9569eb7f9e28f3f
36,362
py
Python
test/integration/test_integration__io.py
davidbrochart/rioxarray
6587726a019f46ec68ca94d6cea866abea956a2a
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
test/integration/test_integration__io.py
davidbrochart/rioxarray
6587726a019f46ec68ca94d6cea866abea956a2a
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
test/integration/test_integration__io.py
davidbrochart/rioxarray
6587726a019f46ec68ca94d6cea866abea956a2a
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
import contextlib import itertools import os import pickle import shutil import sys import tempfile import warnings import dask.array as da import mock import numpy as np import pytest import rasterio import xarray as xr from affine import Affine from numpy.testing import assert_almost_equal from rasterio.errors impor...
38.519068
88
0.519581
import contextlib import itertools import os import pickle import shutil import sys import tempfile import warnings import dask.array as da import mock import numpy as np import pytest import rasterio import xarray as xr from affine import Affine from numpy.testing import assert_almost_equal from rasterio.errors impor...
true
true
f77cb316e363140d624f306451c5899927d63c89
1,376
py
Python
data_structures/Graph/even_tree.py
cosadiz69/python
c680d6a9d9903d5739c5597f9ad7ed67051b392b
[ "MIT" ]
1
2021-07-21T06:51:51.000Z
2021-07-21T06:51:51.000Z
data_structures/Graph/even_tree.py
cosadiz69/python
c680d6a9d9903d5739c5597f9ad7ed67051b392b
[ "MIT" ]
null
null
null
data_structures/Graph/even_tree.py
cosadiz69/python
c680d6a9d9903d5739c5597f9ad7ed67051b392b
[ "MIT" ]
1
2018-01-04T18:39:21.000Z
2018-01-04T18:39:21.000Z
""" You are given a tree(a simple connected graph with no cycles). The tree has N nodes numbered from 1 to N and is rooted at node 1. Find the maximum number of edges you can remove from the tree to get a forest such that each connected component of the forest contains an even number of nodes. Constraints 2 <= 2 <= 1...
19.657143
77
0.555959
""" You are given a tree(a simple connected graph with no cycles). The tree has N nodes numbered from 1 to N and is rooted at node 1. Find the maximum number of edges you can remove from the tree to get a forest such that each connected component of the forest contains an even number of nodes. Constraints 2 <= 2 <= 1...
false
true
f77cb43915388554679c8434738e808e226c1c41
3,760
py
Python
main.py
KrypticSilver/parking-garage-problem
26f3389df142f28ab6a017f7f3ff2a86d228422c
[ "MIT" ]
null
null
null
main.py
KrypticSilver/parking-garage-problem
26f3389df142f28ab6a017f7f3ff2a86d228422c
[ "MIT" ]
null
null
null
main.py
KrypticSilver/parking-garage-problem
26f3389df142f28ab6a017f7f3ff2a86d228422c
[ "MIT" ]
null
null
null
# makes a string of 50 equals signs for a line break separator = "=" * 50 if True: print("hi") else: print("no") # creates a 2d list with 10 rows car_park = [[] for i in range(10)] # filling the car park for i in range(10): for j in range(6): car_park[i].append("E") # e stands for empty # creates the interfa...
22.117647
113
0.615426
separator = "=" * 50 if True: print("hi") else: print("no") car_park = [[] for i in range(10)] for i in range(10): for j in range(6): car_park[i].append("E") def leave_menu(): print(separator) print("Do you want to try again or exit to main menu?") print("1 = Try again.") print("2 = Exit to main menu...
false
true
f77cb535d69356583ac4d3ce3156d23f7b732eeb
6,380
py
Python
src/bioregistry/parse_iri.py
Adafede/bioregistry
9b6a281354554005d985499f9d61aecb58a0a84c
[ "MIT" ]
17
2021-09-14T17:58:16.000Z
2022-03-11T06:22:11.000Z
src/bioregistry/parse_iri.py
Adafede/bioregistry
9b6a281354554005d985499f9d61aecb58a0a84c
[ "MIT" ]
148
2021-09-18T08:52:46.000Z
2022-03-23T15:57:35.000Z
src/bioregistry/parse_iri.py
Adafede/bioregistry
9b6a281354554005d985499f9d61aecb58a0a84c
[ "MIT" ]
9
2021-09-28T20:18:53.000Z
2022-03-14T17:23:35.000Z
# -*- coding: utf-8 -*- """Functionality for parsing IRIs.""" from typing import List, Mapping, Optional, Tuple, Union from .resolve import parse_curie from .resource_manager import prepare_prefix_list from .uri_format import get_prefix_map __all__ = [ "curie_from_iri", "parse_iri", "parse_obolibrary_pu...
33.403141
116
0.669592
from typing import List, Mapping, Optional, Tuple, Union from .resolve import parse_curie from .resource_manager import prepare_prefix_list from .uri_format import get_prefix_map __all__ = [ "curie_from_iri", "parse_iri", "parse_obolibrary_purl", ] OLS_URL_PREFIX = "https://www.ebi.ac.uk/ols/ontologies...
true
true
f77cb5f90aa4b55544e22ee89bcea85a3b217c06
1,601
py
Python
wiki_category.py
loganlebanoff/correct_summarization
cec0d5401ddb5f7c33aca14f31da68b2f8092c53
[ "BSD-3-Clause" ]
2
2019-07-20T14:57:39.000Z
2020-06-01T11:14:40.000Z
wiki_category.py
loganlebanoff/correct_summarization
cec0d5401ddb5f7c33aca14f31da68b2f8092c53
[ "BSD-3-Clause" ]
null
null
null
wiki_category.py
loganlebanoff/correct_summarization
cec0d5401ddb5f7c33aca14f31da68b2f8092c53
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- # import wptools # page = wptools.page('Dog') # page.get_more() # # # from wikitools import wiki # from wikitools import category # # site = wiki.Wiki("https://en.wikipedia.org/w/api.php?action=query&titles=Stack%20Overflow&prop=categories&clshow=!hidden") # site.login("username", "pas...
15.696078
125
0.655215
import wikipedia as w orig_article = "dog" reached_categories = [] wiki_top_categories = '''Academic disciplines Arts‎ Business‎ Concepts‎ Culture‎ Education‎ Entertainment‎ Events‎ Geography‎ Health‎ History‎ Humanities‎ Language‎ Law‎ Life‎ Mathematics Nature‎ People Philosophy Politics‎ ...
true
true
f77cb67abafd7117c5edbd312511509d64ce6e7c
5,376
py
Python
graph_tfds/graphs/graph_saint/graph_saint.py
jackd/graph-tfds
c843e485b931cc25370a151ae2326e1eec009792
[ "Apache-2.0" ]
null
null
null
graph_tfds/graphs/graph_saint/graph_saint.py
jackd/graph-tfds
c843e485b931cc25370a151ae2326e1eec009792
[ "Apache-2.0" ]
null
null
null
graph_tfds/graphs/graph_saint/graph_saint.py
jackd/graph-tfds
c843e485b931cc25370a151ae2326e1eec009792
[ "Apache-2.0" ]
null
null
null
"""graph_saint dataset.""" import json import os from typing import Dict import numpy as np import scipy.sparse as sp import tensorflow as tf import tensorflow_datasets as tfds import gdown _DESCRIPTION = """\ Datasets used in/provided by [GraphSAINT](https://github.com/GraphSAINT/GraphSAINT).""" _CITATION = """\ ...
32.981595
103
0.576265
import json import os from typing import Dict import numpy as np import scipy.sparse as sp import tensorflow as tf import tensorflow_datasets as tfds import gdown _DESCRIPTION = """\ Datasets used in/provided by [GraphSAINT](https://github.com/GraphSAINT/GraphSAINT).""" _CITATION = """\ @inproceedings{graphsaint-i...
true
true
f77cba016c9db38a8357e9b79839c267bbbde362
4,754
py
Python
disaster_data/sources/noaa_coast/spider.py
cognition-gis/cognition-disaster-data
5441bd282d36b2d998d1d366d714d38fc5b92c8f
[ "Apache-2.0" ]
null
null
null
disaster_data/sources/noaa_coast/spider.py
cognition-gis/cognition-disaster-data
5441bd282d36b2d998d1d366d714d38fc5b92c8f
[ "Apache-2.0" ]
1
2022-03-02T14:58:21.000Z
2022-03-02T14:58:21.000Z
disaster_data/sources/noaa_coast/spider.py
cognition-gis/cognition-disaster-data
5441bd282d36b2d998d1d366d714d38fc5b92c8f
[ "Apache-2.0" ]
null
null
null
import os import scrapy from scrapy.crawler import CrawlerProcess import requests from disaster_data.sources.noaa_coast.utils import get_geoinfo, get_fgdcinfo class NoaaImageryCollections(scrapy.Spider): name = 'noaa-coast-imagery-collections' start_urls = [ 'https://coast.noaa.gov/htdata/raster2/...
34.955882
121
0.446782
import os import scrapy from scrapy.crawler import CrawlerProcess import requests from disaster_data.sources.noaa_coast.utils import get_geoinfo, get_fgdcinfo class NoaaImageryCollections(scrapy.Spider): name = 'noaa-coast-imagery-collections' start_urls = [ 'https://coast.noaa.gov/htdata/raster2/...
true
true
f77cbc2c530ea76e4662032a2a3a2182becac77b
8,718
py
Python
electrum_cadex/gui/kivy/uix/drawer.py
cadexproject/electrum-cadex
5f8b80feee8be2c4f6f7a3245f896aadd966777c
[ "MIT" ]
null
null
null
electrum_cadex/gui/kivy/uix/drawer.py
cadexproject/electrum-cadex
5f8b80feee8be2c4f6f7a3245f896aadd966777c
[ "MIT" ]
1
2021-11-15T17:48:24.000Z
2021-11-15T17:48:24.000Z
electrum_cadex/gui/kivy/uix/drawer.py
cadexproject/electrum-cadex
5f8b80feee8be2c4f6f7a3245f896aadd966777c
[ "MIT" ]
null
null
null
'''Drawer Widget to hold the main window and the menu/hidden section that can be swiped in from the left. This Menu would be only hidden in phone mode and visible in Tablet Mode. This class is specifically in lined to save on start up speed(minimize i/o). ''' from kivy.app import App from kivy.factory import ...
33.922179
81
0.600252
from kivy.app import App from kivy.factory import Factory from kivy.properties import OptionProperty, NumericProperty, ObjectProperty from kivy.clock import Clock from kivy.lang import Builder import gc app = None class Drawer(Factory.RelativeLayout): state = OptionProperty('closed', ...
true
true
f77cbc3e7d2f1017b94d70a263ee1e3c92383ab5
26,610
py
Python
pyzoo/zoo/zouwu/model/MTNet_keras.py
GZHoffie/analytics-zoo
d0258aa113ffd1a5c4927376fb32b09fb0baf73c
[ "Apache-2.0" ]
null
null
null
pyzoo/zoo/zouwu/model/MTNet_keras.py
GZHoffie/analytics-zoo
d0258aa113ffd1a5c4927376fb32b09fb0baf73c
[ "Apache-2.0" ]
null
null
null
pyzoo/zoo/zouwu/model/MTNet_keras.py
GZHoffie/analytics-zoo
d0258aa113ffd1a5c4927376fb32b09fb0baf73c
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 Analytics Zoo Authors. # # 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 i...
43.198052
100
0.593611
import numpy as np import time from tensorflow.keras.models import Model from tensorflow.keras.layers import * from tensorflow.keras.initializers import TruncatedNormal, Constant import tensorflow.keras.backend as K import tensorflow as tf from zoo.automl.common.metrics import Evaluator from zoo.automl.model.abstract ...
true
true
f77cbca578ffc0f016bccc21131a6cdc80437562
6,820
py
Python
src/icemac/addressbook/browser/tests/test_form.py
icemac/icemac.addressbook
6197e6e01da922feb100dd0943576523050cd703
[ "BSD-2-Clause" ]
1
2020-03-26T20:16:44.000Z
2020-03-26T20:16:44.000Z
src/icemac/addressbook/browser/tests/test_form.py
icemac/icemac.addressbook
6197e6e01da922feb100dd0943576523050cd703
[ "BSD-2-Clause" ]
2
2020-02-21T13:04:23.000Z
2020-02-21T13:06:10.000Z
src/icemac/addressbook/browser/tests/test_form.py
icemac/icemac.addressbook
6197e6e01da922feb100dd0943576523050cd703
[ "BSD-2-Clause" ]
null
null
null
from ..form import zope_i18n_pattern_to_jquery_pattern from datetime import datetime from icemac.addressbook.interfaces import IKeyword from icemac.addressbook.testing import WebdriverPageObjectBase, Webdriver from mock import patch, Mock from pytz import utc, timezone from selenium.webdriver.common.by import By from s...
37.888889
131
0.711584
from ..form import zope_i18n_pattern_to_jquery_pattern from datetime import datetime from icemac.addressbook.interfaces import IKeyword from icemac.addressbook.testing import WebdriverPageObjectBase, Webdriver from mock import patch, Mock from pytz import utc, timezone from selenium.webdriver.common.by import By from s...
true
true
f77cbcf189de99afeb5c6357129143a1b7fe930e
3,056
py
Python
proxypool/tester.py
BevisShao/IPsPool
197c95789487899cc680d25faa17112bf7fe77af
[ "Apache-2.0" ]
null
null
null
proxypool/tester.py
BevisShao/IPsPool
197c95789487899cc680d25faa17112bf7fe77af
[ "Apache-2.0" ]
null
null
null
proxypool/tester.py
BevisShao/IPsPool
197c95789487899cc680d25faa17112bf7fe77af
[ "Apache-2.0" ]
null
null
null
import asyncio import aiohttp import time import sys try: from aiohttp import ClientError except: from aiohttp import ClientProxyConnectionError as ProxyConnectionError from proxypool.db import RedisClient from proxypool.setting import * class Tester(object): def __init__(self): self.redis = Redis...
37.728395
140
0.563809
import asyncio import aiohttp import time import sys try: from aiohttp import ClientError except: from aiohttp import ClientProxyConnectionError as ProxyConnectionError from proxypool.db import RedisClient from proxypool.setting import * class Tester(object): def __init__(self): self.redis = Redis...
true
true
f77cbd940b2414ce1f364505335f06e985a851d6
3,887
py
Python
curl/final_tests/comments.py
PrestoConFuoco1/News-Server
e54173a58c60bba0832541f5fce0229db85fbb38
[ "BSD-3-Clause" ]
null
null
null
curl/final_tests/comments.py
PrestoConFuoco1/News-Server
e54173a58c60bba0832541f5fce0229db85fbb38
[ "BSD-3-Clause" ]
1
2021-11-08T22:13:29.000Z
2021-11-08T22:13:29.000Z
curl/final_tests/comments.py
PrestoConFuoco1/News-Server
e54173a58c60bba0832541f5fce0229db85fbb38
[ "BSD-3-Clause" ]
null
null
null
#!/bin/python3 import sys import json import subprocess import random import string # for running this test make sure that you have a post with id = 1 # usage: ./test_authors.py | grep False # (should produce no input) def randomstring(length): letters = string.ascii_lowercase return ''.join(random.choice(lett...
22.864706
92
0.617185
import sys import json import subprocess import random import string def randomstring(length): letters = string.ascii_lowercase return ''.join(random.choice(letters) for i in range(length)) basicArgs = ['curl', '-G', '-d'] token = 'token=' post_id = 'post_id=' content = 'content=' comment_id = 'comment_id=' ...
true
true
f77cbe227b988272e6245a27dddd5067b8f0abb2
39,815
py
Python
mojo/public/tools/mojom/mojom/generate/module.py
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
mojo/public/tools/mojom/mojom/generate/module.py
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
mojo/public/tools/mojom/mojom/generate/module.py
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # This module's classes provide an interface to mojo modules. Modules are # collections of interfaces and structs to be used by mojo ipc clients and # server...
29.492593
80
0.666658
# collections of interfaces and structs to be used by mojo ipc clients and # servers. # # A simple interface would be created this way: # module = mojom.generate.module.Module('Foo') # interface = module.AddInterface('Bar') # method = interface.AddMethod('Tat', 0) # method.AddParameter('baz', 0, mojom.INT32) import p...
true
true
f77cbe97dbbdb2623b70aa28688e3b2ee19d3f76
127
py
Python
Beta_VAE/paths.py
FengNiMa/VAE-TracIn-pytorch
72ea08349d5b860f0f191cebbeeb3f2052895f43
[ "MIT" ]
9
2021-06-04T02:28:28.000Z
2021-11-01T07:38:45.000Z
Beta_VAE/paths.py
FengNiMa/VAE-TracIn-pytorch
72ea08349d5b860f0f191cebbeeb3f2052895f43
[ "MIT" ]
null
null
null
Beta_VAE/paths.py
FengNiMa/VAE-TracIn-pytorch
72ea08349d5b860f0f191cebbeeb3f2052895f43
[ "MIT" ]
null
null
null
ROOT_MNIST = '/tmp2/MNIST' ROOT_CIFAR = '/tmp2/CIFAR' ROOT_EMNIST = '/tmp2/EMNIST' ROOT_CELEBA = '/tmp2/celebA/CelebA64/CelebA'
31.75
44
0.740157
ROOT_MNIST = '/tmp2/MNIST' ROOT_CIFAR = '/tmp2/CIFAR' ROOT_EMNIST = '/tmp2/EMNIST' ROOT_CELEBA = '/tmp2/celebA/CelebA64/CelebA'
true
true
f77cbf1837f2ad0eebaa6a47e5b2ee391d335241
18,633
py
Python
haystack/indexes.py
vcodx/django-haystack
4e13e0ca446ef6ab286b7a73044982c9aa013119
[ "BSD-3-Clause" ]
1
2019-12-22T23:38:56.000Z
2019-12-22T23:38:56.000Z
haystack/indexes.py
joshtechnologygroup/django-haystack
42e81b2758936681e18381249342674be232d425
[ "BSD-3-Clause" ]
2
2019-05-01T14:30:04.000Z
2019-05-30T15:35:14.000Z
haystack/indexes.py
joshtechnologygroup/django-haystack
42e81b2758936681e18381249342674be232d425
[ "BSD-3-Clause" ]
1
2019-01-24T15:56:51.000Z
2019-01-24T15:56:51.000Z
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import copy import threading import warnings from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import force_text from django.utils.six import with_metaclass from haystack import conn...
34.063985
93
0.614555
from __future__ import absolute_import, division, print_function, unicode_literals import copy import threading import warnings from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import force_text from django.utils.six import with_metaclass from haystack import connection_router, con...
true
true
f77cc067eb5667c5dadfdaf7622c60b024ae8bc5
2,004
py
Python
rlo/test/rlo/test_factory.py
tomjaguarpaw/knossos-ksc
8fa75e67c0db8f632b135379740051cd10ff31f2
[ "MIT" ]
31
2021-09-09T16:09:55.000Z
2022-02-20T02:15:19.000Z
rlo/test/rlo/test_factory.py
tomjaguarpaw/knossos-ksc
8fa75e67c0db8f632b135379740051cd10ff31f2
[ "MIT" ]
40
2021-08-06T14:30:08.000Z
2022-01-19T08:49:52.000Z
rlo/test/rlo/test_factory.py
tomjaguarpaw/knossos-ksc
8fa75e67c0db8f632b135379740051cd10ff31f2
[ "MIT" ]
5
2021-08-06T11:20:31.000Z
2022-01-07T19:39:40.000Z
import pytest from rlo import factory @pytest.mark.parametrize("use_subtree_match_edges", [True, False]) @pytest.mark.parametrize("loss", ["pinball=0.6", "huber"]) def test_torch_model_from_config(use_subtree_match_edges, loss): # Check we can construct a Model config = { "num_embeddings": 3, ...
31.809524
68
0.657685
import pytest from rlo import factory @pytest.mark.parametrize("use_subtree_match_edges", [True, False]) @pytest.mark.parametrize("loss", ["pinball=0.6", "huber"]) def test_torch_model_from_config(use_subtree_match_edges, loss): config = { "num_embeddings": 3, "hidden_dim": 2, "num_gn...
true
true
f77cc0ac3a7be04889cebd874b86a9c913795af6
10,695
py
Python
heat/tests/test_swift.py
redhat-openstack/heat
6b9be0a868b857e942c1cc90594d0f3a0d0725d0
[ "Apache-2.0" ]
null
null
null
heat/tests/test_swift.py
redhat-openstack/heat
6b9be0a868b857e942c1cc90594d0f3a0d0725d0
[ "Apache-2.0" ]
null
null
null
heat/tests/test_swift.py
redhat-openstack/heat
6b9be0a868b857e942c1cc90594d0f3a0d0725d0
[ "Apache-2.0" ]
null
null
null
# # 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 # ...
36.626712
78
0.625432
import mox import swiftclient.client as sc from heat.common import exception from heat.common import template_format from heat.engine.resources import swift from heat.engine import scheduler from heat.tests.common import HeatTestCase from heat.tests import utils swift_template = ''' { "AWSTemplateFormatVersion" ...
true
true
f77cc2842eadca841dd2327c37d4b16196a0fcf5
424
py
Python
ipfsspec/__init__.py
fsspec/ipfsspec
8eb96dfb0ffdebb099a47a77d2b4653988b4a0b8
[ "MIT" ]
4
2021-12-01T04:21:25.000Z
2022-01-20T21:10:50.000Z
ipfsspec/__init__.py
fsspec/ipfsspec
8eb96dfb0ffdebb099a47a77d2b4653988b4a0b8
[ "MIT" ]
3
2022-01-11T20:29:29.000Z
2022-03-18T13:09:55.000Z
ipfsspec/__init__.py
fsspec/ipfsspec
8eb96dfb0ffdebb099a47a77d2b4653988b4a0b8
[ "MIT" ]
2
2022-01-04T07:10:35.000Z
2022-02-07T19:52:48.000Z
from .core import IPFSFileSystem from .async_ipfs import AsyncIPFSFileSystem from fsspec import register_implementation from ._version import get_versions __version__ = get_versions()['version'] del get_versions # register_implementation(IPFSFileSystem.protocol, IPFSFileSystem) register_implementation(AsyncIPFSFileSy...
32.615385
74
0.849057
from .core import IPFSFileSystem from .async_ipfs import AsyncIPFSFileSystem from fsspec import register_implementation from ._version import get_versions __version__ = get_versions()['version'] del get_versions register_implementation(AsyncIPFSFileSystem.protocol, AsyncIPFSFileSystem) __all__ = ["__version__", "IPF...
true
true
f77cc420a38cef81a9e5e6be5ef2c8c6829cf740
3,946
py
Python
deepchem/trans/tests/test_normalization.py
micimize/deepchem
651df9f9d8e6f1b33d3af8f0be251e9e8095fe88
[ "MIT" ]
1
2020-08-19T17:25:27.000Z
2020-08-19T17:25:27.000Z
deepchem/trans/tests/test_normalization.py
swpper/deepchem
510b9bf1805bc5a472c1a519700e6b128e06c651
[ "MIT" ]
1
2020-09-22T18:42:21.000Z
2020-09-22T18:42:21.000Z
deepchem/trans/tests/test_normalization.py
swpper/deepchem
510b9bf1805bc5a472c1a519700e6b128e06c651
[ "MIT" ]
1
2022-03-11T00:10:23.000Z
2022-03-11T00:10:23.000Z
import os import deepchem as dc import numpy as np import pytest def load_unlabelled_data(): current_dir = os.path.dirname(os.path.abspath(__file__)) featurizer = dc.feat.CircularFingerprint(size=1024) tasks = [] input_file = os.path.join(current_dir, "../../data/tests/no_labels.csv") loader = dc.data.CSVLo...
39.069307
78
0.742017
import os import deepchem as dc import numpy as np import pytest def load_unlabelled_data(): current_dir = os.path.dirname(os.path.abspath(__file__)) featurizer = dc.feat.CircularFingerprint(size=1024) tasks = [] input_file = os.path.join(current_dir, "../../data/tests/no_labels.csv") loader = dc.data.CSVLo...
true
true
f77cc42ca4c2d107123fa2362680896ec4265456
12,571
py
Python
semi-supervised/read_functions.py
NightmareNyx/semi-supervised-pytorch
43bb86bc6757345bd7a4eb37d6948ee62a268f7e
[ "MIT" ]
null
null
null
semi-supervised/read_functions.py
NightmareNyx/semi-supervised-pytorch
43bb86bc6757345bd7a4eb37d6948ee62a268f7e
[ "MIT" ]
null
null
null
semi-supervised/read_functions.py
NightmareNyx/semi-supervised-pytorch
43bb86bc6757345bd7a4eb37d6948ee62a268f7e
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 6 15:40:14 2017 Functions needed to read the data from different databases @author: anazabal, olmosUC3M, ivaleraM """ import csv import os import torch import numpy as np from sklearn.metrics import mean_squared_error def read_data(data_file, t...
40.682848
120
0.568213
import csv import os import torch import numpy as np from sklearn.metrics import mean_squared_error def read_data(data_file, types_file, miss_file, true_miss_file): with open(types_file) as f: types_dict = [{k: v for k, v in row.items()} for row in csv.DictReader(f, skipinitials...
true
true
f77cc4485f8a95bc8730a33617bd68ddeab07b2e
38,401
py
Python
myjdapi/myjdapi.py
dbiesecke/My.Jdownloader-API-Python-Library
f593ee421e9cf492d0eb28eb4ec8ca2c6192727a
[ "MIT" ]
null
null
null
myjdapi/myjdapi.py
dbiesecke/My.Jdownloader-API-Python-Library
f593ee421e9cf492d0eb28eb4ec8ca2c6192727a
[ "MIT" ]
null
null
null
myjdapi/myjdapi.py
dbiesecke/My.Jdownloader-API-Python-Library
f593ee421e9cf492d0eb28eb4ec8ca2c6192727a
[ "MIT" ]
null
null
null
# -*- encoding: utf-8 -*- import hashlib import hmac import json import time try: # from urllib.request import urlopen from urllib.parse import quote except: # For Python 2 from urllib import quote # from urllib import urlopen import base64 import requests from Crypto.Cipher import AES from .exceptio...
33.626095
152
0.538397
import hashlib import hmac import json import time try: from urllib.parse import quote except: from urllib import quote import base64 import requests from Crypto.Cipher import AES from .exception import ( MYJDException, MYJDApiException, MYJDConnectionException, MYJDDecodeException, ...
true
true
f77cc503119b835a56febb4c3a2aa72d3f981673
1,512
py
Python
oop_playground/adapters.py
jaclark5/design_patterns
dc008b59cdef95d39441f2f20d4b10850da03807
[ "BSD-3-Clause" ]
null
null
null
oop_playground/adapters.py
jaclark5/design_patterns
dc008b59cdef95d39441f2f20d4b10850da03807
[ "BSD-3-Clause" ]
null
null
null
oop_playground/adapters.py
jaclark5/design_patterns
dc008b59cdef95d39441f2f20d4b10850da03807
[ "BSD-3-Clause" ]
null
null
null
import mdtraj as md import MDAnalysis as mda import numpy as np import factory from interface import TrajectoryAdapter # We made an abstract class,that both packages can be handled in the same way. Each package exported information from pdb files in different ways so we will have those be private variables. class M...
32.170213
189
0.729497
import mdtraj as md import MDAnalysis as mda import numpy as np import factory from interface import TrajectoryAdapter class MDTrajAdapter(TrajectoryAdapter): def __init__(self, filename): self.filename = filename self._trajectory = md.load_pdb(filename) print("MDTraj") def compute...
true
true
f77cc542cabdc45ba4198fda2ae4593d312531cd
3,691
py
Python
exporter/kity.py
czfshine/MarkAll
0b3d0ccf5cf0da9957273024bc942cae7441a026
[ "MIT" ]
2
2016-09-16T02:24:30.000Z
2018-03-07T04:48:27.000Z
exporter/kity.py
czfshine/MarkAll
0b3d0ccf5cf0da9957273024bc942cae7441a026
[ "MIT" ]
null
null
null
exporter/kity.py
czfshine/MarkAll
0b3d0ccf5cf0da9957273024bc942cae7441a026
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- ''' export to baidu kity minder json The kityminder website : https://github.com/fex-team/kityminder from kityminder to json: In brower console type: editor.minder.exportData("json").fulfillValue from json to kityminder: type: editor.minder.importData("json","The json string"...
29.766129
94
0.506638
import json import re import hashlib class kity(object): def __init__(self): self.dict={} self.json={} self. md5 = hashlib.md5() self.rules=''' bookmark data to kityminder data[type] add_date-->created[int] url-->hyperlink[str] title-->hyperlinkT...
true
true
f77cc5662c2c03c4c89ef6033bfa715f89af2bc1
73
py
Python
arquivos-py/fmaior_xy.py
byancasantos/exercicios-python
b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c
[ "MIT" ]
null
null
null
arquivos-py/fmaior_xy.py
byancasantos/exercicios-python
b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c
[ "MIT" ]
null
null
null
arquivos-py/fmaior_xy.py
byancasantos/exercicios-python
b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c
[ "MIT" ]
null
null
null
def maior (x,y): if x>y: print(x) else: print(y)
12.166667
16
0.410959
def maior (x,y): if x>y: print(x) else: print(y)
true
true
f77cc62617a4a68110041bb5128a281749ce5013
24,694
py
Python
arcade/texture.py
64-bit/arcade
a99d85992f8e8a7620bf30ed9f90379be6291f34
[ "MIT" ]
null
null
null
arcade/texture.py
64-bit/arcade
a99d85992f8e8a7620bf30ed9f90379be6291f34
[ "MIT" ]
null
null
null
arcade/texture.py
64-bit/arcade
a99d85992f8e8a7620bf30ed9f90379be6291f34
[ "MIT" ]
null
null
null
""" Code related to working with textures. """ import math from pathlib import Path import PIL.Image import PIL.ImageOps import PIL.ImageDraw from typing import Optional from typing import List from typing import Union from arcade import lerp from arcade import RectList from arcade import Color from arcade import c...
40.884106
117
0.599741
import math from pathlib import Path import PIL.Image import PIL.ImageOps import PIL.ImageDraw from typing import Optional from typing import List from typing import Union from arcade import lerp from arcade import RectList from arcade import Color from arcade import calculate_hit_box_points_simple from arcade impo...
true
true
f77cc6aded50a8f8bd3463b77e4e18f3fc7c9dea
4,825
py
Python
example/tutorial_tfrecord.py
IAmSuyogJadhav/tensorlayer
b9115e027f8a47f5b8c3c92ade30603560c5e987
[ "Apache-2.0" ]
1
2021-09-10T09:27:31.000Z
2021-09-10T09:27:31.000Z
example/tutorial_tfrecord.py
IAmSuyogJadhav/tensorlayer
b9115e027f8a47f5b8c3c92ade30603560c5e987
[ "Apache-2.0" ]
null
null
null
example/tutorial_tfrecord.py
IAmSuyogJadhav/tensorlayer
b9115e027f8a47f5b8c3c92ade30603560c5e987
[ "Apache-2.0" ]
1
2018-08-12T20:06:21.000Z
2018-08-12T20:06:21.000Z
#! /usr/bin/python # -*- coding: utf-8 -*- """You will learn. 1. How to save data into TFRecord format file. 2. How to read data from TFRecord format file by using Queue and Thread. Reference: ----------- English : https://indico.io/blog/tensorflow-data-inputs-part1-placeholders-protobufs-queues/ https://ww...
40.889831
130
0.665492
import os import numpy as np import tensorflow as tf from PIL import Image import tensorlayer as tl classes = ['/data/cat', '/data/dog'] cwd = os.getcwd() writer = tf.python_io.TFRecordWriter("train.tfrecords") for index, name in enumerate(classes): class_path = cwd + name + "/" for img_name in os.listdir(...
true
true