hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19dbc515bff1722fbe003bd7ebadc885f0e486ec | 1,031 | py | Python | client_side_methods/send_email.py | loukikstudent/Image_Steganography_and_Encrpytion | 14c153aa091937d13d821e5642b4dabada5432fe | [
"MIT"
] | null | null | null | client_side_methods/send_email.py | loukikstudent/Image_Steganography_and_Encrpytion | 14c153aa091937d13d821e5642b4dabada5432fe | [
"MIT"
] | null | null | null | client_side_methods/send_email.py | loukikstudent/Image_Steganography_and_Encrpytion | 14c153aa091937d13d821e5642b4dabada5432fe | [
"MIT"
] | null | null | null | import base64
from email.mime.text import MIMEText
from typing import Any
from googleAuth import Authenticate
from googleapiclient.errors import HttpError
def create_message(to, jsonData):
message_text = f"ID: {jsonData['uuid']} \nKey: {jsonData['key']}"
message = MIMEText(message_text)
message['to'] = t... | 27.864865 | 83 | 0.659554 |
7ddbf597313601e8b5910568c11420e56de25998 | 749 | py | Python | packages/hunspell/run_instrument.py | orlean-git/isv_hunspell | 0677601a5758c02145f0ac84c3ab8316a970058d | [
"MIT"
] | 1 | 2021-11-20T18:58:47.000Z | 2021-11-20T18:58:47.000Z | packages/hunspell/run_instrument.py | orlean-git/isv_hunspell | 0677601a5758c02145f0ac84c3ab8316a970058d | [
"MIT"
] | 10 | 2021-11-18T01:39:21.000Z | 2021-11-22T21:23:19.000Z | packages/hunspell/run_instrument.py | medzuslovjansky/isv_hunspell_dict | 0677601a5758c02145f0ac84c3ab8316a970058d | [
"MIT"
] | 1 | 2021-11-21T14:05:14.000Z | 2021-11-21T14:05:14.000Z | from argparse import ArgumentParser
from utilities import open_with_dir_create
parser = ArgumentParser()
parser.add_argument('scriptfile', metavar='hunspell_dict_from_OCXML.py', type=ascii, help='Script to run.')
parser.add_argument('settingfile', metavar='settings_lat.py', type=ascii, help='Settings file.')
args = p... | 46.8125 | 107 | 0.740988 |
b41dac4ad1ff9d18ca3732ba6a9c34d9b8462512 | 5,158 | py | Python | keras/layers/rnn/base_cudnn_rnn.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2022-03-21T02:42:58.000Z | 2022-03-21T02:42:58.000Z | keras/layers/rnn/base_cudnn_rnn.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | 1 | 2022-03-31T16:40:51.000Z | 2022-03-31T16:40:51.000Z | keras/layers/rnn/base_cudnn_rnn.py | tsheaff/keras | ee227dda766d769b7499a5549e8ed77b5e88105b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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 applica... | 35.328767 | 80 | 0.665956 |
1832764e1d65264f0c3a4aa732684da581c6ac37 | 573 | py | Python | hiding/unhide.py | kbsletten/AvraeAliases | a392881dcddccc2155d10fd4d231f1be53c54bda | [
"MIT"
] | null | null | null | hiding/unhide.py | kbsletten/AvraeAliases | a392881dcddccc2155d10fd4d231f1be53c54bda | [
"MIT"
] | null | null | null | hiding/unhide.py | kbsletten/AvraeAliases | a392881dcddccc2155d10fd4d231f1be53c54bda | [
"MIT"
] | 1 | 2022-03-17T18:06:25.000Z | 2022-03-17T18:06:25.000Z | embed
<drac2>
argv = &ARGS&
args = argparse(argv)
init = combat()
target = None
if init:
target = init.get_combatant(args.last("t")) if args.last("t") else init.me or init.current
name = target.name if target else name
if target:
for effect in target.effects:
if not effect.name.startswith("Hi... | 23.875 | 106 | 0.652705 |
9159981e27bfb40729eadec57bb025eab49f87f9 | 1,285 | py | Python | website-blocker/websiteBlocker.py | MayankShrivastava17/mini-project | c6fa2c95caba792ec4641eaeafaa5ab18f9e7abd | [
"MIT"
] | 1 | 2021-05-25T13:30:05.000Z | 2021-05-25T13:30:05.000Z | website-blocker/websiteBlocker.py | MayankShrivastava17/mini-project | c6fa2c95caba792ec4641eaeafaa5ab18f9e7abd | [
"MIT"
] | null | null | null | website-blocker/websiteBlocker.py | MayankShrivastava17/mini-project | c6fa2c95caba792ec4641eaeafaa5ab18f9e7abd | [
"MIT"
] | null | null | null | import time
from datetime import datetime as dt
hosts_path = r"/etc/hosts" // r is for raw string
hosts_temp = "hosts"
redirect = "127.0.0.1"
web_sites_list = ["www.facebook.com", "facebook.com"] // users can modify the list of the websites they want to block
while True:
if dt(dt.now().year, dt.now().mon... | 44.310345 | 122 | 0.568093 |
5839c3e887190a248637ce3e411f167643e866ba | 32,395 | py | Python | distributed/comm/tests/test_comms.py | sodre/distributed | 0b68318112b13d70a9cdd741e5db00da2ec6a8f5 | [
"BSD-3-Clause"
] | null | null | null | distributed/comm/tests/test_comms.py | sodre/distributed | 0b68318112b13d70a9cdd741e5db00da2ec6a8f5 | [
"BSD-3-Clause"
] | null | null | null | distributed/comm/tests/test_comms.py | sodre/distributed | 0b68318112b13d70a9cdd741e5db00da2ec6a8f5 | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
import os
import sys
import threading
import warnings
import pytest
from tornado import gen, ioloop, locks, queues
from tornado.concurrent import Future
from distributed.metrics import time
from distributed.utils import get_ip, get_ipv6
from distributed.utils_test import (
gen_test,... | 27.360642 | 98 | 0.639296 |
f4e83041b67b2659f29129666d021090ad31765b | 7,822 | py | Python | tester_S3DIS_Sqn.py | PointCloudYC/SQN_tensorflow | 1fde5085541f051eab7119202152388f95370ed2 | [
"MIT"
] | 8 | 2021-12-26T08:57:08.000Z | 2022-03-27T10:32:55.000Z | tester_S3DIS_Sqn.py | PointCloudYC/SQN_tensorflow | 1fde5085541f051eab7119202152388f95370ed2 | [
"MIT"
] | null | null | null | tester_S3DIS_Sqn.py | PointCloudYC/SQN_tensorflow | 1fde5085541f051eab7119202152388f95370ed2 | [
"MIT"
] | null | null | null | from os import makedirs
from os.path import exists, join
from helper_ply import write_ply
from sklearn.metrics import confusion_matrix
from helper_tool import DataProcessing as DP
import tensorflow as tf
import numpy as np
import time
def log_out(out_str, log_f_out):
log_f_out.write(out_str + '\n')
log_f_out.... | 43.455556 | 147 | 0.523012 |
055a9fed37cdc3ad807987a887f4f3690d1700a2 | 962 | py | Python | kubernetes/test/test_v1beta1_lease_spec.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_lease_spec.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_lease_spec.py | iguazio/python | c2684bb479d44a49a2010ec4ede5ffa7b17349dd | [
"Apache-2.0"
] | 1 | 2019-01-10T11:13:52.000Z | 2019-01-10T11:13:52.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... | 21.377778 | 105 | 0.70894 |
98092674347e0735a1d8ab5c4cf0d4a2f8440562 | 13,109 | py | Python | tests/hwsim/test_owe.py | cargoudel/hostap-15118-8 | 717f236dce3ed571e9a61fcce86d8a37a7f7bc1b | [
"Unlicense"
] | 1,991 | 2017-11-08T04:30:56.000Z | 2022-03-25T12:58:15.000Z | tests/hwsim/test_owe.py | cargoudel/hostap-15118-8 | 717f236dce3ed571e9a61fcce86d8a37a7f7bc1b | [
"Unlicense"
] | 76 | 2017-11-08T06:13:54.000Z | 2021-09-07T10:11:19.000Z | tests/hwsim/test_owe.py | cargoudel/hostap-15118-8 | 717f236dce3ed571e9a61fcce86d8a37a7f7bc1b | [
"Unlicense"
] | 530 | 2017-11-08T04:27:44.000Z | 2022-03-06T02:41:19.000Z | # Test cases for Opportunistic Wireless Encryption (OWE)
# Copyright (c) 2017, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import hostapd
from wpasupplicant import WpaSupplicant
... | 37.241477 | 115 | 0.642307 |
839f80a41134c027013c8ed144510eeedc29f5d0 | 378 | py | Python | examples/computer_vision/mmdetection_pytorch/configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | 1 | 2021-03-29T13:39:45.000Z | 2021-03-29T13:39:45.000Z | examples/computer_vision/mmdetection_pytorch/configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | null | null | null | examples/computer_vision/mmdetection_pytorch/configs/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py | RAbraham/determined | 1161b667ed6d0242f70f9f15d58600f910c8d7f9 | [
"Apache-2.0"
] | null | null | null | _base_ = "./faster_rcnn_r50_fpn_1x_coco.py"
model = dict(
pretrained="open-mmlab://resnext101_64x4d",
backbone=dict(
type="ResNeXt",
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type="BN... | 23.625 | 53 | 0.571429 |
7f705519027a1e6aa5d52d06beda6cfd1aef752e | 346 | py | Python | pacman-arch/test/pacman/tests/remove060.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/remove060.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/remove060.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Remove a group"
lp1 = pmpkg("pkg1")
lp1.groups = ["grp"]
lp2 = pmpkg("pkg2")
lp3 = pmpkg("pkg3")
lp3.groups = ["grp"]
for p in lp1, lp2, lp3:
self.addpkg2db("local", p);
self.args = "-R grp"
self.addrule("PACMAN_RETCODE=0")
self.addrule("!PKG_EXIST=pkg1")
self.addrule("PKG_EXIST=pkg2")
self.a... | 17.3 | 35 | 0.66763 |
e6d47c90e1a00864f2b5dbfef354520cbfe5df92 | 5,762 | py | Python | tensorflow_probability/python/bijectors/softplus_test.py | hephaex/probability | 740d0db0bf2b1e1a04cfd0b55481c44380b3cb05 | [
"Apache-2.0"
] | 4 | 2019-03-07T05:15:13.000Z | 2019-06-13T20:35:45.000Z | tensorflow_probability/python/bijectors/softplus_test.py | hephaex/probability | 740d0db0bf2b1e1a04cfd0b55481c44380b3cb05 | [
"Apache-2.0"
] | 1 | 2019-02-28T21:28:01.000Z | 2019-02-28T21:28:01.000Z | tensorflow_probability/python/bijectors/softplus_test.py | hephaex/probability | 740d0db0bf2b1e1a04cfd0b55481c44380b3cb05 | [
"Apache-2.0"
] | 1 | 2019-09-18T15:17:53.000Z | 2019-09-18T15:17:53.000Z | # Copyright 2018 The TensorFlow Probability 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 o... | 37.415584 | 115 | 0.707046 |
3b72eda1b5a418afdc638d9bfc0761e1247928a9 | 1,025 | py | Python | molsysmt/native/io/molsys/openexplorer_OpenExplorerReporter.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/native/io/molsys/openexplorer_OpenExplorerReporter.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/native/io/molsys/openexplorer_OpenExplorerReporter.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | def from_openexplorer_OpenExplorerReporter (item, molecular_system=None, atom_indices='all', frame_indices='all'):
from molsysmt.native.molsys import MolSys
from molsysmt.native.io.topology import from_openexplorer_OpenExplorerReporter as openexplorer_OpenExplorerReporter_to_molsysmt_Topology
from molsysmt... | 60.294118 | 147 | 0.84 |
ed1af25d9f8bcc016dfe71e2762e8e5f95e50672 | 178 | py | Python | me-manda-no-zap/test/segue_usuario.py | gmonteeeiro/me-manda-no-zap | 257c0159ab23399e746b8e172b37fa09d41832b1 | [
"MIT"
] | 4 | 2021-04-01T12:54:19.000Z | 2021-04-01T13:00:20.000Z | me-manda-no-zap/test/segue_usuario.py | gmonteeeiro/me-manda-no-zap | 257c0159ab23399e746b8e172b37fa09d41832b1 | [
"MIT"
] | 1 | 2021-04-01T13:03:42.000Z | 2021-04-01T16:22:21.000Z | me-manda-no-zap/test/segue_usuario.py | gmonteeeiro/me-manda-no-zap | 257c0159ab23399e746b8e172b37fa09d41832b1 | [
"MIT"
] | null | null | null | import sys
sys.path[0] += '\\..'
from bot.twitter_bot import TwitterBot
twitter = TwitterBot()
id_usuario = twitter.get_id_usuario("sharggg")
twitter.seguir_usuario(id_usuario) | 22.25 | 46 | 0.769663 |
fe2ddb135716622fa635af4a0535b4016465a5e8 | 2,799 | py | Python | koku/koku/test_presto_delete_wrapper_trigger.py | cgoodfred/koku | f1de8bc90d6a818c4f77af710cafe50dc1274700 | [
"Apache-2.0"
] | 157 | 2018-04-30T16:27:53.000Z | 2022-03-31T08:17:21.000Z | koku/koku/test_presto_delete_wrapper_trigger.py | cgoodfred/koku | f1de8bc90d6a818c4f77af710cafe50dc1274700 | [
"Apache-2.0"
] | 3,250 | 2018-04-26T14:14:25.000Z | 2022-03-31T23:49:15.000Z | koku/koku/test_presto_delete_wrapper_trigger.py | cgoodfred/koku | f1de8bc90d6a818c4f77af710cafe50dc1274700 | [
"Apache-2.0"
] | 65 | 2018-05-10T14:11:50.000Z | 2022-03-18T19:22:58.000Z | import uuid
from datetime import datetime
from django.db import connection as conn
from pytz import UTC
from . import database as kdb
from api.iam.test.iam_test_case import IamTestCase
class TestPrestoDeleteLogTrigger(IamTestCase):
def test_presto_delete_log_table_exists(self):
"""
Ensure that t... | 33.321429 | 112 | 0.621293 |
f1ca04c1ec37c93f67890b3b5b9da14f918d9a7f | 312 | py | Python | REMS_model/test.py | zhouhuhq/Relation-aware-Entity-Matching-using-Sentence-BERT | 23d31229676852b243954e94ac5b95ee55d8807a | [
"Apache-2.0"
] | null | null | null | REMS_model/test.py | zhouhuhq/Relation-aware-Entity-Matching-using-Sentence-BERT | 23d31229676852b243954e94ac5b95ee55d8807a | [
"Apache-2.0"
] | null | null | null | REMS_model/test.py | zhouhuhq/Relation-aware-Entity-Matching-using-Sentence-BERT | 23d31229676852b243954e94ac5b95ee55d8807a | [
"Apache-2.0"
] | null | null | null | from nlpaug.util.file.download import DownloadUtil
DownloadUtil.download_word2vec(dest_dir='.') # Download word2vec model
DownloadUtil.download_glove(model_name='glove.6B', dest_dir='.') # Download GloVe model
DownloadUtil.download_fasttext(model_name='wiki-news-300d-1M', dest_dir='.') # Download fasttext model | 78 | 102 | 0.810897 |
d20eca44f3e26ce77cf23f3470e0cb6ac946e24d | 2,143 | py | Python | tests/test_env.py | pahaz/python-decouple | 00921996aa41dd4e568fd7d91918dc9b4d167617 | [
"MIT"
] | 1 | 2019-11-24T23:08:06.000Z | 2019-11-24T23:08:06.000Z | tests/test_env.py | pahaz/python-decouple | 00921996aa41dd4e568fd7d91918dc9b4d167617 | [
"MIT"
] | null | null | null | tests/test_env.py | pahaz/python-decouple | 00921996aa41dd4e568fd7d91918dc9b4d167617 | [
"MIT"
] | 1 | 2019-11-24T23:08:07.000Z | 2019-11-24T23:08:07.000Z | # coding: utf-8
import os
import sys
from mock import patch
import pytest
from decouple import Config, RepositoryEnv, UndefinedValueError
# Useful for very coarse version differentiation.
PY3 = sys.version_info[0] == 3
if PY3:
from io import StringIO
else:
from StringIO import StringIO
ENVFILE = '''
KeyTru... | 24.918605 | 77 | 0.725618 |
e19b540d1cd91e14bd1b8a87e04d402289ad26cc | 9,655 | py | Python | downloads-generation/models_class1_kim_benchmark/curate.py | eyeshoe/mhcflurry | b87aac3cf1a782cb1235f9b724388bbdd933d9fb | [
"Apache-2.0"
] | 1 | 2020-01-01T23:06:01.000Z | 2020-01-01T23:06:01.000Z | downloads-generation/models_class1_kim_benchmark/curate.py | eyeshoe/mhcflurry | b87aac3cf1a782cb1235f9b724388bbdd933d9fb | [
"Apache-2.0"
] | null | null | null | downloads-generation/models_class1_kim_benchmark/curate.py | eyeshoe/mhcflurry | b87aac3cf1a782cb1235f9b724388bbdd933d9fb | [
"Apache-2.0"
] | null | null | null | """
Filter and combine various peptide/MHC datasets to derive a composite training set,
optionally including eluted peptides identified by mass-spec.
"""
import sys
import argparse
import pandas
import mhcnames
def normalize_allele_name(s):
try:
return mhcnames.normalize_allele_name(s)
except Except... | 33.065068 | 84 | 0.641844 |
17e0f8a3184aac0db7bf77270f2344601c4da1a7 | 1,720 | py | Python | k-means/vgg_features_msseg.py | ysx001/IIC | e72eb0833785e867ded0a9bac47ce1d1f9f47b4b | [
"MIT"
] | null | null | null | k-means/vgg_features_msseg.py | ysx001/IIC | e72eb0833785e867ded0a9bac47ce1d1f9f47b4b | [
"MIT"
] | null | null | null | k-means/vgg_features_msseg.py | ysx001/IIC | e72eb0833785e867ded0a9bac47ce1d1f9f47b4b | [
"MIT"
] | null | null | null | import os.path as osp
import numpy as np
import scipy.io as sio
from glob import glob
from sklearn.decomposition import PCA
import torch
import torch.nn
import torchvision.models as models
from torch.autograd import Variable
import torch.cuda
import torchvision.transforms as transforms
from PIL import Image
TARGET... | 29.655172 | 79 | 0.668605 |
08b08e8f08066105571a16d34b3f89d81936a115 | 8,957 | py | Python | Classification/net_util.py | amazon-research/network-deconvolution-pp | 99e27ecec7d27c7c4c3fb230e96005bdcbf6f2ce | [
"Apache-2.0"
] | 6 | 2021-10-16T15:29:06.000Z | 2022-02-17T12:33:52.000Z | Classification/net_util.py | amazon-research/network-deconvolution-pp | 99e27ecec7d27c7c4c3fb230e96005bdcbf6f2ce | [
"Apache-2.0"
] | 3 | 2021-04-02T19:47:05.000Z | 2021-10-12T23:11:18.000Z | Classification/net_util.py | amazon-research/network-deconvolution-pp | 99e27ecec7d27c7c4c3fb230e96005bdcbf6f2ce | [
"Apache-2.0"
] | 1 | 2021-10-30T04:50:14.000Z | 2021-10-30T04:50:14.000Z | from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
import os
import argparse
import time
from copy import deepcopy
from torch.autograd ... | 26.037791 | 97 | 0.585352 |
11a8f647772b4fd931093dd7332cd41a724e58bd | 1,302 | py | Python | .history/ClassFiles/OOP/Encapsulation_20210105152008.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/OOP/Encapsulation_20210105152008.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | .history/ClassFiles/OOP/Encapsulation_20210105152008.py | minefarmer/Comprehensive-Python | f97b9b83ec328fc4e4815607e6a65de90bb8de66 | [
"Unlicense"
] | null | null | null | ''' Encapsulation : Part 1
Encapsulation is the process of restricting access to methods and variables in a class in order to prevent direct data modification so it prevents accidental data modification.
Encapsulation basically allows the internal representation of an object to be hidden from the view o... | 22.842105 | 176 | 0.674347 |
a2b61e4a7592320bea10a8e17830a04e13d14eaa | 281 | py | Python | 0020/Furkan's Solution.py | helizac/leetcode-problem-answers | e643ed1f27ba55aca724ea3208ad247b43d1995c | [
"MIT"
] | 3 | 2021-03-04T18:34:39.000Z | 2021-03-04T21:43:37.000Z | 0020/Furkan's Solution.py | helizac/leetcode-problem-answers | e643ed1f27ba55aca724ea3208ad247b43d1995c | [
"MIT"
] | null | null | null | 0020/Furkan's Solution.py | helizac/leetcode-problem-answers | e643ed1f27ba55aca724ea3208ad247b43d1995c | [
"MIT"
] | 3 | 2021-03-04T18:34:42.000Z | 2021-03-04T18:54:38.000Z | class Solution(object):
def isValid(self, s):
while len(s) > 0:
l = len(s)
s = s.replace("()","")
s = s.replace("[]","")
s = s.replace("{}","")
if l == len(s):
return False
return True
| 25.545455 | 34 | 0.370107 |
39bb3d9cbe0f7ad8959738dc544881d19f28e652 | 782 | py | Python | distributed/dashboard/worker.py | scharlottej13/distributed | c014e5b295546ee039eba5bed09fefa8da253173 | [
"BSD-3-Clause"
] | null | null | null | distributed/dashboard/worker.py | scharlottej13/distributed | c014e5b295546ee039eba5bed09fefa8da253173 | [
"BSD-3-Clause"
] | null | null | null | distributed/dashboard/worker.py | scharlottej13/distributed | c014e5b295546ee039eba5bed09fefa8da253173 | [
"BSD-3-Clause"
] | null | null | null | from tornado.ioloop import IOLoop
from distributed.dashboard.components.worker import (
counters_doc,
profile_doc,
profile_server_doc,
status_doc,
systemmonitor_doc,
)
from distributed.dashboard.core import BokehApplication
template_variables = {"pages": ["status", "system", "profile", "profile-se... | 26.066667 | 82 | 0.7289 |
cca828488a393a93332dfeb7ee01e55d995d28e6 | 28,213 | py | Python | venv/Lib/site-packages/s3transfer/__init__.py | gangareddynachu/CS623_AWS_E2E_Website | 1e248bc50fdbe5882ad8f01902fe49740c64d460 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/s3transfer/__init__.py | gangareddynachu/CS623_AWS_E2E_Website | 1e248bc50fdbe5882ad8f01902fe49740c64d460 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/s3transfer/__init__.py | gangareddynachu/CS623_AWS_E2E_Website | 1e248bc50fdbe5882ad8f01902fe49740c64d460 | [
"MIT"
] | null | null | null | # Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 38.022911 | 83 | 0.614114 |
36387b5c10c1c5db0d520a943c8a8476393d3a85 | 2,634 | py | Python | setup.py | tobbi007/OctoPrint-OctoPlug | 2dc298da8bc581a82cfa2c9a8f77f93e974a878a | [
"MIT"
] | null | null | null | setup.py | tobbi007/OctoPrint-OctoPlug | 2dc298da8bc581a82cfa2c9a8f77f93e974a878a | [
"MIT"
] | null | null | null | setup.py | tobbi007/OctoPrint-OctoPlug | 2dc298da8bc581a82cfa2c9a8f77f93e974a878a | [
"MIT"
] | null | null | null | # coding=utf-8
# The plugin's identifier, has to be unique
plugin_identifier = "octoplug"
# The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique
plugin_package = "octoprint_octoplug"
# The plugin's human readable name. Can be overwritten within OctoPrint's internal data via __plug... | 36.583333 | 156 | 0.773728 |
84457ff8d9e95239945e9b5476cc9f751bbe0fc9 | 17,378 | py | Python | python/ray/tune/trial_runner.py | anuragkh/ray | db0551b36448c092abd9c9f979474511c111a284 | [
"Apache-2.0"
] | 2 | 2019-10-08T13:31:08.000Z | 2019-10-22T18:34:52.000Z | python/ray/tune/trial_runner.py | anuragkh/ray | db0551b36448c092abd9c9f979474511c111a284 | [
"Apache-2.0"
] | 1 | 2018-12-26T01:09:50.000Z | 2018-12-26T01:09:50.000Z | python/ray/tune/trial_runner.py | anuragkh/ray | db0551b36448c092abd9c9f979474511c111a284 | [
"Apache-2.0"
] | 6 | 2019-03-12T05:37:35.000Z | 2020-03-09T12:25:17.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import logging
import os
import re
import time
import traceback
from ray.tune import TuneError
from ray.tune.ray_trial_executor import RayTrialExecutor
from ray.tune.result import TIME_THIS_... | 41.37619 | 79 | 0.59771 |
db6da9784e2e1f2e87f970bdd768b12acad4c33c | 11,594 | py | Python | nnunet/run/run_training.py | zyw19980410/avm | a00e9ac09a5ca394eb18b4f55fc9adeeb2c0f1ec | [
"Apache-2.0"
] | null | null | null | nnunet/run/run_training.py | zyw19980410/avm | a00e9ac09a5ca394eb18b4f55fc9adeeb2c0f1ec | [
"Apache-2.0"
] | null | null | null | nnunet/run/run_training.py | zyw19980410/avm | a00e9ac09a5ca394eb18b4f55fc9adeeb2c0f1ec | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 57.97 | 132 | 0.635674 |
9e55eff5425beffb55a383854e07a5ef2d0dc836 | 297 | py | Python | src/python/__init__.py | casallas/osgswig | 42bd392fefb09771e7cdc0c59eb6b19fa159431e | [
"MIT"
] | 5 | 2015-12-31T06:08:05.000Z | 2021-09-07T08:52:09.000Z | src/python/__init__.py | casallas/osgswig | 42bd392fefb09771e7cdc0c59eb6b19fa159431e | [
"MIT"
] | null | null | null | src/python/__init__.py | casallas/osgswig | 42bd392fefb09771e7cdc0c59eb6b19fa159431e | [
"MIT"
] | 6 | 2015-12-31T06:08:06.000Z | 2019-04-20T13:35:07.000Z | __all__ = ['osg', 'osgAnimation', 'osgDB', 'osgFX', 'osgGA', 'osgManipulator', 'osgSim', 'osgText', 'osgUtil', 'osgViewer']
__osgversion__ = "2.9.11"
__version__ = "0.3.2"
__osgversion_info__ = (2, 9, 11, "OpenSceneGraph")
__version_info__ = (0, 3, 2, "osgswig")
| 27 | 124 | 0.589226 |
bf85c7d638d4dd67c61fa96cbf4aca6c7053554c | 2,477 | py | Python | comments/migrations/0001_initial.py | hoskinsj/django-nested-comments | d1cb71130db57e3fe7dc34392c92f7bc8c2efdc0 | [
"BSD-2-Clause"
] | 1 | 2020-06-26T20:47:46.000Z | 2020-06-26T20:47:46.000Z | comments/migrations/0001_initial.py | hoskinsj/django-nested-comments | d1cb71130db57e3fe7dc34392c92f7bc8c2efdc0 | [
"BSD-2-Clause"
] | 1 | 2019-11-15T22:14:12.000Z | 2019-11-15T22:14:12.000Z | comments/migrations/0001_initial.py | hoskinsj/django-nested-comments | d1cb71130db57e3fe7dc34392c92f7bc8c2efdc0 | [
"BSD-2-Clause"
] | 6 | 2019-08-08T17:09:17.000Z | 2022-01-04T18:03:12.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import mptt.fields
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.fields import JSONField
class Migration(migrations.Migration):
dependencies = [
('content... | 47.634615 | 153 | 0.627776 |
95fb6e5c1030e53cc34126787baf605061f3ccdd | 3,717 | py | Python | 401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/cdk_aws_cookbook_401/cdk_aws_cookbook_401_stack.py | AWSCookbook/Databases | 97445fdfe54458a9d70974259c8beaf53c6e12ed | [
"MIT"
] | 6 | 2021-03-08T10:11:49.000Z | 2022-01-18T01:23:56.000Z | 401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/cdk_aws_cookbook_401/cdk_aws_cookbook_401_stack.py | AWSCookbook/Databases | 97445fdfe54458a9d70974259c8beaf53c6e12ed | [
"MIT"
] | null | null | null | 401-Creating-an-Aurora-Serverless-DB/cdk-AWS-Cookbook-401/cdk_aws_cookbook_401/cdk_aws_cookbook_401_stack.py | AWSCookbook/Databases | 97445fdfe54458a9d70974259c8beaf53c6e12ed | [
"MIT"
] | 3 | 2021-09-23T12:00:59.000Z | 2022-02-25T06:53:45.000Z | from constructs import Construct
from aws_cdk import (
aws_ec2 as ec2,
aws_iam as iam,
Stack,
CfnOutput,
)
class CdkAwsCookbook401Stack(Stack):
def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
isolated_subn... | 30.975 | 151 | 0.585149 |
b2851694891019d3cee02bc6bdc6d8cf0cb6b678 | 17,388 | py | Python | ads/searching/bst.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ads/searching/bst.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ads/searching/bst.py | Aminul-Momin/Algorithms_and_Data_Structures | cba73b36b73ad92fb34bc34a0e03503f7a137713 | [
"MIT"
] | null | null | null | ## taken from: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/
from random import *
from collections import deque
################################ Node: BSTNode ################################
class BSTNode(object):
"""A node in the vanilla BS... | 31.32973 | 142 | 0.490166 |
535227714e092e38975070984dfc18911a93b880 | 15,757 | py | Python | results.py | paolokazemi/Lightning-Network-Anonymity | 12fb9131c142519906526af306e7f06dc86b47be | [
"MIT"
] | null | null | null | results.py | paolokazemi/Lightning-Network-Anonymity | 12fb9131c142519906526af306e7f06dc86b47be | [
"MIT"
] | null | null | null | results.py | paolokazemi/Lightning-Network-Anonymity | 12fb9131c142519906526af306e7f06dc86b47be | [
"MIT"
] | null | null | null | import ast
import nested_dict as nd
import matplotlib.pyplot as plt
import numpy as np
import json
import seaborn as sns
import networkx as nx
import populate_graph as pg
import sys
# USAGE: python3 results.py <demo100 | demo500 | demo1000 | erdos500 | erdos1000 | snapshot> <file | results/results.json>
# Example: py... | 46.895833 | 160 | 0.591991 |
6e8ad72ab5055a47ceba7d8b7a576ba1a611553d | 7,275 | py | Python | ninja_jwt/schema.py | stungkit/django-ninja-jwt | 9844d1208807460faddb552c0d5f06c7e36bb989 | [
"MIT"
] | 17 | 2021-12-09T10:39:57.000Z | 2022-03-28T17:13:31.000Z | ninja_jwt/schema.py | stungkit/django-ninja-jwt | 9844d1208807460faddb552c0d5f06c7e36bb989 | [
"MIT"
] | 1 | 2022-03-19T09:29:07.000Z | 2022-03-19T19:36:57.000Z | ninja_jwt/schema.py | stungkit/django-ninja-jwt | 9844d1208807460faddb552c0d5f06c7e36bb989 | [
"MIT"
] | 3 | 2021-11-25T09:34:25.000Z | 2022-03-15T20:27:20.000Z | from typing import Dict, Optional, Type, cast
from django.conf import settings
from django.contrib.auth import authenticate, get_user_model
from django.contrib.auth.models import AbstractUser, update_last_login
from django.utils.translation import gettext_lazy as _
from ninja_schema import ModelSchema, Schema
f... | 30.439331 | 91 | 0.631753 |
2a9a42d72eb3b76349d590f7e1c8927b95c7fa52 | 285 | py | Python | localemr/urls.py | rafaelleru/localemr | aa6e3e5285e96600e87c51639e75acbe35fbba3a | [
"Apache-2.0"
] | 19 | 2020-05-01T19:57:58.000Z | 2022-02-23T00:24:24.000Z | localemr/urls.py | rafaelleru/localemr | aa6e3e5285e96600e87c51639e75acbe35fbba3a | [
"Apache-2.0"
] | 2 | 2020-09-14T21:17:35.000Z | 2021-02-10T02:39:48.000Z | localemr/urls.py | rafaelleru/localemr | aa6e3e5285e96600e87c51639e75acbe35fbba3a | [
"Apache-2.0"
] | 5 | 2021-03-14T03:00:03.000Z | 2022-02-15T12:42:00.000Z | from __future__ import unicode_literals
from localemr.responses import LocalElasticMapReduceResponse
url_bases = [
"https?://(.+).elasticmapreduce.amazonaws.com",
"https?://elasticmapreduce.(.+).amazonaws.com",
]
url_paths = {"{0}/$": LocalElasticMapReduceResponse.dispatch}
| 28.5 | 61 | 0.750877 |
a500be1779bb83747a48a7db0fed2425d57bbb09 | 2,129 | py | Python | altototxt.py | BL-Labs/poetryhunt | cce687c46d0855f2960a9f944cadf28d16fbaba2 | [
"MIT"
] | null | null | null | altototxt.py | BL-Labs/poetryhunt | cce687c46d0855f2960a9f944cadf28d16fbaba2 | [
"MIT"
] | null | null | null | altototxt.py | BL-Labs/poetryhunt | cce687c46d0855f2960a9f944cadf28d16fbaba2 | [
"MIT"
] | null | null | null | #python3
import re, os
text_p = re.compile(r"CONTENT=\"([^\"]*)\"", re.U)
line_p = re.compile(r"</TextLine>", re.U)
def get_text(alto_filepath):
current = ""
text_content = ""
words = []
with open(alto_filepath, "r", encoding="utf-8") as alto:
for line in alto:
if line_p.search(line) != ... | 38.709091 | 169 | 0.546266 |
5c1f8f94a72dafa2f6dc5a90ca6079bc12a84928 | 14,266 | py | Python | pandas/io/parsers/c_parser_wrapper.py | jordanrmerrick/pandas | e18415e64c66a5c125a6e6a9e9aa9fa97eb01403 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2020-02-20T16:51:55.000Z | 2021-06-15T07:28:32.000Z | pandas/io/parsers/c_parser_wrapper.py | weikhor/pandas | ae6538f5df987aa382ec1499679982aaff1bfd86 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 6 | 2021-05-31T01:10:55.000Z | 2021-07-19T00:37:03.000Z | pandas/io/parsers/c_parser_wrapper.py | weikhor/pandas | ae6538f5df987aa382ec1499679982aaff1bfd86 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-06-15T07:28:08.000Z | 2021-06-15T07:28:08.000Z | from __future__ import annotations
import warnings
import numpy as np
import pandas._libs.parsers as parsers
from pandas._typing import (
ArrayLike,
FilePathOrBuffer,
)
from pandas.errors import DtypeWarning
from pandas.core.dtypes.common import (
is_categorical_dtype,
pandas_dtype,
)
from pandas.co... | 35.051597 | 88 | 0.564349 |
556c9035cbd900315f4b956b7c049e6ad5327e23 | 368 | py | Python | vaccinate/core/migrations/0119_populate_source_location_point.py | MoralCode/vial | cdaaab053a9cf1cef40104a2cdf480b7932d58f7 | [
"MIT"
] | 7 | 2021-06-28T17:33:47.000Z | 2022-02-12T21:54:59.000Z | vaccinate/core/migrations/0119_populate_source_location_point.py | MoralCode/vial | cdaaab053a9cf1cef40104a2cdf480b7932d58f7 | [
"MIT"
] | 104 | 2021-06-17T21:25:30.000Z | 2022-03-28T14:21:57.000Z | vaccinate/core/migrations/0119_populate_source_location_point.py | MoralCode/vial | cdaaab053a9cf1cef40104a2cdf480b7932d58f7 | [
"MIT"
] | 1 | 2021-06-25T17:52:23.000Z | 2021-06-25T17:52:23.000Z | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("core", "0118_source_location_point"),
]
operations = [
migrations.RunSQL(
sql="update source_location set point = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326);",
reve... | 23 | 106 | 0.638587 |
36030d998fd85a8359eeeb0ab93b366efdb702f2 | 3,089 | py | Python | xldlib/gui/views/discoverer/running/close.py | Alexhuszagh/XLDiscoverer | 60937b1f7f2e23af4219eb26519d6b83fb4232d6 | [
"Apache-2.0",
"MIT"
] | null | null | null | xldlib/gui/views/discoverer/running/close.py | Alexhuszagh/XLDiscoverer | 60937b1f7f2e23af4219eb26519d6b83fb4232d6 | [
"Apache-2.0",
"MIT"
] | null | null | null | xldlib/gui/views/discoverer/running/close.py | Alexhuszagh/XLDiscoverer | 60937b1f7f2e23af4219eb26519d6b83fb4232d6 | [
"Apache-2.0",
"MIT"
] | null | null | null | '''
Gui/Views/Crosslink_Discoverer/close
____________________________________
QDialog warning the user if they want to quit while Crosslink
Discoverer is running. Can be permanently ignored.
:copyright: (c) 2015 The Regents of the University of California.
:license: GNU GPL, see licenses/GNU G... | 25.957983 | 79 | 0.682098 |
c8b8840ebfa6b031af425c48c75a2877f724152d | 3,039 | py | Python | he_encryption/el_gamal.py | adiachwal122/he-encription | 1fa0ab02e96359c6bfbc9d36262020d9e0171a60 | [
"MIT"
] | null | null | null | he_encryption/el_gamal.py | adiachwal122/he-encription | 1fa0ab02e96359c6bfbc9d36262020d9e0171a60 | [
"MIT"
] | null | null | null | he_encryption/el_gamal.py | adiachwal122/he-encription | 1fa0ab02e96359c6bfbc9d36262020d9e0171a60 | [
"MIT"
] | 4 | 2019-07-24T12:31:05.000Z | 2021-08-12T19:46:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ElGamal encryption is an public-key cryptosystem. It uses asymmetric key encryption for communicating
between two parties and encrypting the message.This cryptosystem is based on the difficulty of finding
discrete logarithm in a cyclic group that is even if we know g^a ... | 25.754237 | 116 | 0.61336 |
48d2cfdf5bf332cb0e82185fcfb96e4410b1c8fa | 13,305 | py | Python | iterpipes3/__init__.py | kelleyk/py3k-iterpipes | 8eb9a8b7f2d15aad0f3e357303d829d4505270b2 | [
"MIT"
] | 3 | 2015-02-12T20:28:32.000Z | 2016-09-10T11:38:14.000Z | iterpipes3/__init__.py | kelleyk/py3k-iterpipes | 8eb9a8b7f2d15aad0f3e357303d829d4505270b2 | [
"MIT"
] | null | null | null | iterpipes3/__init__.py | kelleyk/py3k-iterpipes | 8eb9a8b7f2d15aad0f3e357303d829d4505270b2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2009-2010 Andrey Vlasovskikh
#
# 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 restriction, including
# without limitation the rights to use, ... | 30.307517 | 81 | 0.663209 |
87ed7889d4a82a95c1e6f8fb6dc100bde5ca3f48 | 10,023 | py | Python | src/ga/Population.py | NickDeGroote/Complex_Systems_SS21 | 7317499dd3ebd8d2b98c15c4006972a1033051ae | [
"MIT"
] | null | null | null | src/ga/Population.py | NickDeGroote/Complex_Systems_SS21 | 7317499dd3ebd8d2b98c15c4006972a1033051ae | [
"MIT"
] | null | null | null | src/ga/Population.py | NickDeGroote/Complex_Systems_SS21 | 7317499dd3ebd8d2b98c15c4006972a1033051ae | [
"MIT"
] | null | null | null | import random
import multiprocessing
from copy import copy
from joblib import Parallel, delayed
from operator import attrgetter
from typing import Callable, Tuple
from src.ga.Chromosome import Chromosome
"""
Class for a Population in the MP GA
"""
class Population:
"""
Structure to hold the chromosomes for ... | 38.110266 | 87 | 0.642622 |
577840d2ebffcbbd81732f453dfa067baf21699e | 4,106 | py | Python | test/population_test.py | denniskb/bsim | bfe02148fc2fee7efff68b16173c626c515a49bb | [
"MIT"
] | 11 | 2019-09-01T16:20:57.000Z | 2022-01-19T08:24:06.000Z | test/population_test.py | denniskb/bsim | bfe02148fc2fee7efff68b16173c626c515a49bb | [
"MIT"
] | 2 | 2020-12-14T17:27:21.000Z | 2020-12-15T09:03:38.000Z | test/population_test.py | CRAFT-THU/BSim | 479c04348312579a7ae9c118c6b987724e540f38 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from ctypes import *
from bsim.env import c_real
from bsim.population import *
class TestPopulationMethods(unittest.TestCase):
def test_model(self):
lif = NeuronModel(
computation='v = exp(-dt/tau) * v + (1-exp(-dt/tau)) * (i_offset * (tau/c) + v_rest) + '
... | 50.691358 | 108 | 0.510716 |
9a4077069f8c8fa623470aef378a445030bcc536 | 1,994 | py | Python | python/hail/expr/expressions/indices.py | maccum/hail | e9e8a40bb4f0c2337e5088c26186a4da4948bed2 | [
"MIT"
] | null | null | null | python/hail/expr/expressions/indices.py | maccum/hail | e9e8a40bb4f0c2337e5088c26186a4da4948bed2 | [
"MIT"
] | 1 | 2022-03-28T19:35:55.000Z | 2022-03-28T19:35:55.000Z | python/hail/expr/expressions/indices.py | maccum/hail | e9e8a40bb4f0c2337e5088c26186a4da4948bed2 | [
"MIT"
] | null | null | null | from hail.typecheck import *
import hail as hl
class Indices(object):
@typecheck_method(source=anytype, axes=setof(str))
def __init__(self, source=None, axes=set()):
self.source = source
self.axes = axes
def __eq__(self, other):
return isinstance(other, Indices) and self.source is... | 30.212121 | 101 | 0.573721 |
92f2e34e5a26aa30685b459b266aae1079757f49 | 5,362 | py | Python | venv/Lib/site-packages/docplex/mp/check_list.py | Infinity8sailor/Quantum-CERN | ce02d9198d9f5a1aa828482fea9b213a725b56bb | [
"MIT"
] | 1 | 2021-05-10T16:29:03.000Z | 2021-05-10T16:29:03.000Z | venv/Lib/site-packages/docplex/mp/check_list.py | shivam675/Quantum-CERN | ce02d9198d9f5a1aa828482fea9b213a725b56bb | [
"MIT"
] | null | null | null | venv/Lib/site-packages/docplex/mp/check_list.py | shivam675/Quantum-CERN | ce02d9198d9f5a1aa828482fea9b213a725b56bb | [
"MIT"
] | 1 | 2021-01-17T16:29:26.000Z | 2021-01-17T16:29:26.000Z | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2020
# --------------------------------------------------------------------------
# gendoc: ignore
impo... | 35.986577 | 169 | 0.628683 |
7bb0256222446c85929461616562c01db47bc3c4 | 3,406 | py | Python | app/app/settings.py | Iannarelli/recipe-app-api | 8d6a9b05f12ed2492e9355f16ae3032ec8782877 | [
"MIT"
] | null | null | null | app/app/settings.py | Iannarelli/recipe-app-api | 8d6a9b05f12ed2492e9355f16ae3032ec8782877 | [
"MIT"
] | null | null | null | app/app/settings.py | Iannarelli/recipe-app-api | 8d6a9b05f12ed2492e9355f16ae3032ec8782877 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib imp... | 25.044118 | 91 | 0.685261 |
b8977eee59cf2ec36b1b363183d4aa5fac412d2d | 96 | py | Python | tests/test_app/apps.py | petar-bibulic/django-base | bf4fd8464ef7699ebfebd8ffe2df1b9eaed18f24 | [
"MIT"
] | 6 | 2019-12-27T15:01:14.000Z | 2022-02-03T19:19:19.000Z | tests/test_app/apps.py | petar-bibulic/django-base | bf4fd8464ef7699ebfebd8ffe2df1b9eaed18f24 | [
"MIT"
] | 6 | 2017-11-14T11:51:39.000Z | 2019-12-13T09:00:38.000Z | tests/test_app/apps.py | petar-bibulic/django-base | bf4fd8464ef7699ebfebd8ffe2df1b9eaed18f24 | [
"MIT"
] | 6 | 2017-11-08T13:34:53.000Z | 2022-02-03T19:19:22.000Z | from django.apps import AppConfig
class TestAppConfig(AppConfig):
name = 'tests.test_app'
| 16 | 33 | 0.760417 |
011728bd653bbe0587ffe125b75d040be42dd793 | 1,753 | py | Python | tyadmin_api_cli/utils.py | a24zlab/django-antd-tyadmin | 49797ecbb477b00fc934b774fbc33a4dc23f9d80 | [
"MIT"
] | 308 | 2021-02-04T08:18:13.000Z | 2022-03-30T10:38:30.000Z | tyadmin_api_cli/utils.py | a24zlab/django-antd-tyadmin | 49797ecbb477b00fc934b774fbc33a4dc23f9d80 | [
"MIT"
] | 23 | 2021-02-02T08:29:02.000Z | 2022-03-08T13:14:55.000Z | tyadmin_api_cli/utils.py | a24zlab/django-antd-tyadmin | 49797ecbb477b00fc934b774fbc33a4dc23f9d80 | [
"MIT"
] | 90 | 2021-02-03T08:03:17.000Z | 2022-03-31T19:03:02.000Z | import os
import sys
import re
import logging
import django
from django.utils import translation
def init_django_env(project_name_settings):
pwd = os.path.dirname(os.path.realpath(__file__))
# 将项目目录加入setting
sys.path.append(pwd)
# manage.py中
os.environ.setdefault("DJANGO_SETTINGS_MODULE", f"{proj... | 21.641975 | 79 | 0.622932 |
4aeef570989026a6db9c1f93399305bba8927ff1 | 11,764 | py | Python | dist/linux/genometools/gtpython/gt/annotationsketch/graphics.py | thmourikis/erv_annotator | 448b2dfc2972f9bf4e743df36fe0232813590fec | [
"MIT"
] | null | null | null | dist/linux/genometools/gtpython/gt/annotationsketch/graphics.py | thmourikis/erv_annotator | 448b2dfc2972f9bf4e743df36fe0232813590fec | [
"MIT"
] | 1 | 2018-09-30T00:45:55.000Z | 2018-09-30T00:45:55.000Z | dist/linux/genometools/gtpython/gt/annotationsketch/graphics.py | thmourikis/erv_annotator | 448b2dfc2972f9bf4e743df36fe0232813590fec | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2010 Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>
# Copyright (c) 2008-2010 Center for Bioinformatics, University of Hamburg
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, prov... | 28.904177 | 74 | 0.597671 |
96567c9301a536ada51b05a9437d942f33ee1ae5 | 725 | py | Python | retrieve_data.py | gwtnb/menoh | 7df4100a2e30ea8133a9fd08ead1ea7d46793401 | [
"MIT"
] | null | null | null | retrieve_data.py | gwtnb/menoh | 7df4100a2e30ea8133a9fd08ead1ea7d46793401 | [
"MIT"
] | null | null | null | retrieve_data.py | gwtnb/menoh | 7df4100a2e30ea8133a9fd08ead1ea7d46793401 | [
"MIT"
] | null | null | null | import sys
import os
def wget( address, target ):
print('wget ' + address + ' -O ' + target)
version = sys.version_info
if not os.path.exists("./data"):
os.mkdir("./data")
if version[0] == 2:
import urllib
urllib.urlretrieve(address, target)
elif version[0] == 3:
imp... | 36.25 | 131 | 0.681379 |
a05c180533791c1e21fe4acf0a3b5ebc812be343 | 3,825 | py | Python | bigquery/setup.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | bigquery/setup.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | bigquery/setup.py | DaveCheez/google-cloud-python | fc03d4d41f13e9d13db7206438163b3a471fdabd | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# 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, s... | 32.142857 | 85 | 0.664052 |
9987626500bbfa0efc8ee55d633e46e73a01a44b | 7,434 | py | Python | voussoirkit/httperrors.py | voussoir/voussoirk | 8d9416cb2f48300baece3e9726447c27fa86d7f9 | [
"BSD-3-Clause"
] | 3 | 2021-10-13T02:00:19.000Z | 2021-12-08T05:47:20.000Z | voussoirkit/httperrors.py | voussoir/voussoirkit | 8d9416cb2f48300baece3e9726447c27fa86d7f9 | [
"BSD-3-Clause"
] | null | null | null | voussoirkit/httperrors.py | voussoir/voussoirkit | 8d9416cb2f48300baece3e9726447c27fa86d7f9 | [
"BSD-3-Clause"
] | null | null | null | '''
This module provides individual exception classes for all HTTP statuses between
400 and 599. This makes try/catch code involving status codes easier to look at.
Instead of:
try:
...
except requests.exceptions.ConnectionError:
...
except requests.exceptions.Timeout:
...
except requests.exceptions.HTTPEr... | 28.26616 | 80 | 0.777912 |
86eba993c7fe19354e9a1c40d35b20b81c633067 | 3,260 | py | Python | src/provlake/utils/args_handler.py | IBM/multi-data-lineage-capture-py | e61e8a937cf5880d01f5545382cf2453aa405536 | [
"Apache-2.0"
] | 4 | 2020-09-09T12:50:28.000Z | 2021-09-29T15:28:30.000Z | src/provlake/utils/args_handler.py | IBM/multi-data-lineage-capture-py | e61e8a937cf5880d01f5545382cf2453aa405536 | [
"Apache-2.0"
] | 2 | 2021-09-17T21:54:28.000Z | 2021-10-01T03:26:41.000Z | src/provlake/utils/args_handler.py | IBM/multi-data-lineage-capture-py | e61e8a937cf5880d01f5545382cf2453aa405536 | [
"Apache-2.0"
] | 3 | 2020-06-29T15:16:35.000Z | 2021-12-13T13:17:56.000Z | from provlake.utils.constants import Vocabulary
def get_dict(_dict: dict) -> dict:
if _dict is None:
return None
if len(_dict) == 0:
return {}
return {
Vocabulary.PROV_ATTR_TYPE: Vocabulary.DICT_TYPE,
Vocabulary.VALUES: _dict
}
def get_list(_list: list) -> dict:
'... | 27.627119 | 88 | 0.660123 |
c6b8ef0bf4d19cba082b170cbc286877739bf87d | 5,354 | py | Python | apimoex/client.py | epogrebnyak/apimoex | c146eaa71e331952002c7f63523ec60bbf8c0c1c | [
"Unlicense"
] | 34 | 2019-09-11T10:26:57.000Z | 2022-03-22T06:43:43.000Z | apimoex/client.py | epogrebnyak/apimoex | c146eaa71e331952002c7f63523ec60bbf8c0c1c | [
"Unlicense"
] | 9 | 2020-09-16T16:01:48.000Z | 2021-11-29T06:56:51.000Z | apimoex/client.py | epogrebnyak/apimoex | c146eaa71e331952002c7f63523ec60bbf8c0c1c | [
"Unlicense"
] | 9 | 2020-06-23T17:27:19.000Z | 2021-12-07T21:07:32.000Z | """Клиент для MOEX ISS."""
from collections import abc
from typing import Dict
from typing import List
from typing import Optional
from typing import Union
import requests
# Стандартные настройки для запроса расширенного представления json без дополнительных метаданных.
BASE_QUERY = {"iss.json": "extended", "iss.meta... | 41.503876 | 120 | 0.634852 |
4552c66a694b19597c81efe40b402e8e8fd8d017 | 1,560 | py | Python | packages/python/plotly/plotly/tests/test_optional/test_subplots/test_make_subplots.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/tests/test_optional/test_subplots/test_make_subplots.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/tests/test_optional/test_subplots/test_make_subplots.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import numpy as np
from unittest import TestCase
import plotly.tools as tls
class TestMakeSubplots(TestCase):
def test_subplot_titles_numpy_array(self):
# Pass numpy array
expected = tls.make_subplots(
insets=[{"cell": (1, 1), "l": 0.7, "b": 0.3}], subplot_titles=("", "Inset")
... | 26.440678 | 87 | 0.564744 |
37d2aafb9f12528c078a7df4a71c8b83b32b7a3d | 22,893 | py | Python | scrape.py | TaranMayer/vexforum_alerts | f2496fb1b2e0c7c1599c53ce256f4f06c432f9c1 | [
"Apache-2.0"
] | null | null | null | scrape.py | TaranMayer/vexforum_alerts | f2496fb1b2e0c7c1599c53ce256f4f06c432f9c1 | [
"Apache-2.0"
] | null | null | null | scrape.py | TaranMayer/vexforum_alerts | f2496fb1b2e0c7c1599c53ce256f4f06c432f9c1 | [
"Apache-2.0"
] | null | null | null | import discord
from discord.ext import commands
import bs4 as bs
from bs4 import BeautifulSoup, CData
import urllib.request
import time as Time
import asyncio
import mysql.connector
from urlextract import URLExtract
import hashlib
from threading import Thread
from queue import Queue
import difflib
import p... | 52.148064 | 163 | 0.404054 |
9697d78eeda75364e5d167979644f9895c1492b3 | 514 | py | Python | engine/tests/test_zones.py | koehlma/momba | 68d6431d2732570696d3c67a9e23006e6e3a7740 | [
"MIT"
] | 12 | 2021-01-18T14:38:32.000Z | 2022-01-17T09:16:52.000Z | engine/tests/test_zones.py | koehlma/momba | 68d6431d2732570696d3c67a9e23006e6e3a7740 | [
"MIT"
] | 3 | 2021-05-16T15:26:34.000Z | 2022-02-21T20:46:55.000Z | engine/tests/test_zones.py | koehlma/momba | 68d6431d2732570696d3c67a9e23006e6e3a7740 | [
"MIT"
] | null | null | null | import pytest
from momba_engine import zones
def test_includes() -> None:
x = zones.Zone.new_i64(4)
y = zones.Zone.new_i64(4)
print(x, y)
assert x.includes(y)
def test_include_different_types() -> None:
x = zones.Zone.new_i64(4)
y = zones.Zone.new_f64(4)
with pytest.raises(ValueError):
... | 20.56 | 51 | 0.661479 |
4ef18f29021b3550a1b8bdc7a1c085f531d18b82 | 4,307 | py | Python | homeassistant/components/wemo/binary_sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-21T18:09:09.000Z | 2022-01-17T08:06:03.000Z | homeassistant/components/wemo/binary_sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | homeassistant/components/wemo/binary_sensor.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-01-11T15:44:13.000Z | 2022-01-17T08:06:09.000Z | """Support for WeMo binary sensors."""
import asyncio
import logging
import async_timeout
import requests
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.exceptions import PlatformNotReady
from . import SUBSCRIPTION_REGISTRY
_LOGGER = logging.getLogger(__name__)
def setup_... | 33.387597 | 82 | 0.652658 |
99e275dbdd88868a95d4fa2d7de5d7095e6bfd52 | 3,935 | py | Python | venv/Lib/site-packages/pyconverter/fromfloat.py | DarkEyeBr/Python | f45239551d19f49eac35185e4f72b067d5820f3a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyconverter/fromfloat.py | DarkEyeBr/Python | f45239551d19f49eac35185e4f72b067d5820f3a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyconverter/fromfloat.py | DarkEyeBr/Python | f45239551d19f49eac35185e4f72b067d5820f3a | [
"MIT"
] | null | null | null |
# ============================================================ #
# ================== SINGLE PRECISION FLOAT ================== #
# ============================================================ #
# ================== BIN ================== #
def floattobin(fl: float):
# Raise error if not float
if not (type(f... | 29.586466 | 90 | 0.485642 |
7de95d5bf14647cfc62f0b3848e2af3315b18ae3 | 805 | py | Python | morningstar/spec/security_type_spec.py | thunderousleader10/morningstar | f2dcacdb6e15c0bb9cdece19659e8c60a4fd7c52 | [
"MIT"
] | null | null | null | morningstar/spec/security_type_spec.py | thunderousleader10/morningstar | f2dcacdb6e15c0bb9cdece19659e8c60a4fd7c52 | [
"MIT"
] | null | null | null | morningstar/spec/security_type_spec.py | thunderousleader10/morningstar | f2dcacdb6e15c0bb9cdece19659e8c60a4fd7c52 | [
"MIT"
] | 1 | 2021-11-18T12:01:20.000Z | 2021-11-18T12:01:20.000Z | from typing import Optional
security_types = {
1: "Not used",
2: "Stocks",
3: "Stock and index options",
4: "Future options",
5: "Spots",
6: "Not used",
7: "Corporate bonds",
8: "Mutual funds / ETFs",
9: "Government bonds",
10: "Indices",
11: "Municipal bonds",
12: "Not ... | 22.361111 | 60 | 0.617391 |
94abbf777b6c3e2cf64dbee7a53f2020af6b8b39 | 6,443 | py | Python | clinicadl/random_search/random_search_utils.py | sophieloiz/clinicadl | d26a1c6ce4f6da9de59e3d15c27ae3be2d33bc9d | [
"MIT"
] | null | null | null | clinicadl/random_search/random_search_utils.py | sophieloiz/clinicadl | d26a1c6ce4f6da9de59e3d15c27ae3be2d33bc9d | [
"MIT"
] | null | null | null | clinicadl/random_search/random_search_utils.py | sophieloiz/clinicadl | d26a1c6ce4f6da9de59e3d15c27ae3be2d33bc9d | [
"MIT"
] | null | null | null | import random
from os import path
from typing import Any, Dict, Tuple
import toml
from clinicadl.train.train_utils import build_train_dict
from clinicadl.utils.exceptions import ClinicaDLConfigurationError
from clinicadl.utils.preprocessing import read_preprocessing
def get_space_dict(launch_directory: str) -> Dict... | 32.215 | 117 | 0.639919 |
341f8f6bae5318901884a97f7a590426b3773d8f | 1,407 | py | Python | src/pytorch_adapt/frameworks/ignite/loggers/basic_loss_logger.py | KevinMusgrave/pytorch-adapt | ff1491e1bfcc586afb8ee619712c8816ddf10358 | [
"MIT"
] | 131 | 2021-11-19T14:29:59.000Z | 2022-03-26T16:33:30.000Z | src/pytorch_adapt/frameworks/ignite/loggers/basic_loss_logger.py | KevinMusgrave/pytorch-adapt | ff1491e1bfcc586afb8ee619712c8816ddf10358 | [
"MIT"
] | 28 | 2021-11-19T17:31:56.000Z | 2022-03-02T18:42:51.000Z | src/pytorch_adapt/frameworks/ignite/loggers/basic_loss_logger.py | KevinMusgrave/pytorch-adapt | ff1491e1bfcc586afb8ee619712c8816ddf10358 | [
"MIT"
] | 8 | 2021-11-22T17:22:45.000Z | 2022-03-08T15:49:28.000Z | from pytorch_metric_learning.utils import common_functions as pml_cf
from .ignite_empty_logger import IgniteEmptyLogger
class BasicLossLogger(IgniteEmptyLogger):
def __init__(self):
from record_keeper import RecordKeeper, RecordWriter
from record_keeper import utils as rk_utils
# Define ... | 34.317073 | 87 | 0.653163 |
019634ca1a33a3aaa06cab65f8b1d482b18d408f | 1,254 | py | Python | mesonbuild/wrap/__init__.py | whot/meson | f89d3642a2972a602dc02e5de014c16cdc1f1663 | [
"Apache-2.0"
] | 1 | 2020-02-29T04:14:06.000Z | 2020-02-29T04:14:06.000Z | mesonbuild/wrap/__init__.py | danvet/meson | 048508c989081f8bcf54d76f5b13138cc3f47738 | [
"Apache-2.0"
] | null | null | null | mesonbuild/wrap/__init__.py | danvet/meson | 048508c989081f8bcf54d76f5b13138cc3f47738 | [
"Apache-2.0"
] | 1 | 2021-03-11T08:12:20.000Z | 2021-03-11T08:12:20.000Z | from enum import Enum
# Used for the --wrap-mode command-line argument
#
# Special wrap modes:
# nofallback: Don't download wraps for dependency() fallbacks
# nodownload: Don't download wraps for all subproject() calls
#
# subprojects are used for two purposes:
# 1. To download and build dependencies by using .wra... | 39.1875 | 63 | 0.740032 |
f5b343bf261dc1dd6d9f72fd26a20c917590a834 | 1,309 | py | Python | crash_course/ch09/exec/number_served.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch09/exec/number_served.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch09/exec/number_served.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null |
class Restaurant():
"""A simple Restaurant class."""
def __init__(self, name, cuisine_type):
"""Initialize restaurant name and cuisine type attributes."""
self.restaurant_name = name
self.cuisine_type = cuisine_type
self.number_served = 0
def describe_restaurant(self):
... | 31.926829 | 90 | 0.686784 |
edc8cfdae52634b1a8b085a3123c67871124daaf | 595 | py | Python | Blender/backupfile/render/lib/TextureScale.py | Zhaoc917/cg | 1ed7e145c466a1eb5b4361d7ee9846204236947d | [
"MIT"
] | 1 | 2019-12-06T04:00:03.000Z | 2019-12-06T04:00:03.000Z | Blender/backupfile/render/lib/TextureScale.py | Zhaoc917/cg | 1ed7e145c466a1eb5b4361d7ee9846204236947d | [
"MIT"
] | 1 | 2019-12-14T06:09:59.000Z | 2019-12-14T06:26:30.000Z | Blender/backupfile/render/lib/TextureScale.py | Zhaoc917/cg | 1ed7e145c466a1eb5b4361d7ee9846204236947d | [
"MIT"
] | 2 | 2020-01-05T10:42:56.000Z | 2020-03-31T05:10:42.000Z | import TextureBasic
from TextureBasic import *
class TextureScale(TextureBasic):
def __init__(self):
super(TextureScale, self).__init__()
self.scale = 1.0
self.scaledTexture = None
def SetScale(self, scale):
self.scale = scale
def SetScaledTexture(self, texture):
self.scaledTexture = texture.GetTextur... | 22.037037 | 61 | 0.744538 |
587f09828cd4c154b0dd8c2cbdbb6e970ad7ad59 | 9,651 | py | Python | test/test_api/test_api.py | timgates42/jedi | 3219f14c6321b1f1789ddebb90e1f4cd56f11d94 | [
"MIT"
] | null | null | null | test/test_api/test_api.py | timgates42/jedi | 3219f14c6321b1f1789ddebb90e1f4cd56f11d94 | [
"MIT"
] | null | null | null | test/test_api/test_api.py | timgates42/jedi | 3219f14c6321b1f1789ddebb90e1f4cd56f11d94 | [
"MIT"
] | null | null | null | """
Test all things related to the ``jedi.api`` module.
"""
import os
import sys
from textwrap import dedent
import pytest
from pytest import raises
from parso import cache
from jedi._compatibility import unicode
from jedi import preload_module
from jedi.inference.gradual import typeshed
@pytest.mark.skipif(sys.ve... | 30.159375 | 81 | 0.635996 |
204d4ea25954c790d49cf64595b04e39446ea4d5 | 1,208 | py | Python | tests/python/test_pysmt.py | cdonovick/smt-switch | 27857defa356b5178935e5e75b5958145eafef1c | [
"BSD-3-Clause"
] | 49 | 2018-02-20T12:47:28.000Z | 2021-08-14T17:06:19.000Z | tests/python/test_pysmt.py | cdonovick/smt-switch | 27857defa356b5178935e5e75b5958145eafef1c | [
"BSD-3-Clause"
] | 117 | 2017-06-30T18:26:02.000Z | 2021-08-17T19:50:18.000Z | tests/python/test_pysmt.py | lstuntz/smt-switch | 15f796bc1692a44a984dfed78425ce084b25d4dc | [
"BSD-3-Clause"
] | 21 | 2019-10-10T22:22:03.000Z | 2021-07-22T14:15:10.000Z | import pytest
import smt_switch as ss
pysmt = pytest.importorskip("pysmt")
from pysmt import shortcuts as sc
from pysmt import typing as st
from pysmt import logics as sl
import smt_switch.pysmt_frontend as fe
@pytest.mark.parametrize('solver_str', fe.SWITCH_SOLVERS.keys())
@pytest.mark.parametrize(('T', 'logic'), [
... | 29.463415 | 64 | 0.616722 |
86fcf3722deecfc9ca3442c591b9826f649c1fb0 | 19,118 | py | Python | wca/runners/allocation.py | Rajpratik71/workload-collocation-agent | 6cf7bdab97ff61d85c21c3effecea632a225c668 | [
"Apache-2.0"
] | null | null | null | wca/runners/allocation.py | Rajpratik71/workload-collocation-agent | 6cf7bdab97ff61d85c21c3effecea632a225c668 | [
"Apache-2.0"
] | 4 | 2019-02-01T08:20:30.000Z | 2020-03-27T10:30:25.000Z | wca/runners/allocation.py | Rajpratik71/workload-collocation-agent | 6cf7bdab97ff61d85c21c3effecea632a225c668 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 43.155756 | 100 | 0.683701 |
d9bd05970844bcdc30a063ac77a03248b9cca131 | 1,537 | py | Python | home/migrations/0028_auto_20210629_1716.py | Fourmeta/iogt | b21dd114ed1e708c9b25dcb17c57270d3c74b765 | [
"BSD-2-Clause"
] | null | null | null | home/migrations/0028_auto_20210629_1716.py | Fourmeta/iogt | b21dd114ed1e708c9b25dcb17c57270d3c74b765 | [
"BSD-2-Clause"
] | null | null | null | home/migrations/0028_auto_20210629_1716.py | Fourmeta/iogt | b21dd114ed1e708c9b25dcb17c57270d3c74b765 | [
"BSD-2-Clause"
] | null | null | null | # Generated by Django 3.1.12 on 2021-06-29 17:16
from django.db import migrations, models
import home.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
import wagtailmarkdown.blocks
class Migration(migrations.Migration):
dependencies = [
('home', '0027_merge_20210... | 53 | 907 | 0.711776 |
dbbb87c869aea7e3c0756540d676b497557260e6 | 350 | py | Python | src/requestlog/tasks.py | tamkovich/requestlog | 788f09581a2c0c8b590220e1ba33d87a304d28e3 | [
"MIT"
] | 3 | 2021-11-19T11:36:16.000Z | 2021-12-29T13:40:54.000Z | src/requestlog/tasks.py | tamkovich/requestlog | 788f09581a2c0c8b590220e1ba33d87a304d28e3 | [
"MIT"
] | 3 | 2021-09-26T18:51:34.000Z | 2022-03-10T11:17:43.000Z | src/requestlog/tasks.py | tamkovich/requestlog | 788f09581a2c0c8b590220e1ba33d87a304d28e3 | [
"MIT"
] | 2 | 2022-02-12T04:21:25.000Z | 2022-03-25T11:35:20.000Z | from celery import shared_task
@shared_task
def delete_old_requestlog_entries(keep_days: int = 30):
"""
Schedule this task with celery beat to clean up old log entries
:param keep_days int number of days to keep the entries
"""
from requestlog.utils import delete_old_entries
delete_old_entri... | 29.166667 | 67 | 0.76 |
1a79e0bc767e472fcf50d74936a79f2d9b99b813 | 6,291 | py | Python | broadinstitute_psp/external_query/external_query.py | cmap/psp | 9389e9d86424e460e577dd1d9027f4a1d1f8227a | [
"BSD-3-Clause"
] | 8 | 2017-08-16T07:43:06.000Z | 2021-09-01T20:18:08.000Z | broadinstitute_psp/external_query/external_query.py | cmap/psp | 9389e9d86424e460e577dd1d9027f4a1d1f8227a | [
"BSD-3-Clause"
] | 8 | 2017-11-14T18:51:39.000Z | 2018-09-12T17:43:03.000Z | broadinstitute_psp/external_query/external_query.py | cmap/psp | 9389e9d86424e460e577dd1d9027f4a1d1f8227a | [
"BSD-3-Clause"
] | 6 | 2018-01-25T17:47:47.000Z | 2020-12-17T16:05:33.000Z | """
external_query.py
Run steep.py (compute similarities) and sip.py (compute connectivities) on an
external gct file. The required inputs are a path to a gct of external profiles
(probes x samples), a path to a gct of internal profiles, and a path to a gct
of the pre-computed similarity matrix of the internal profile... | 42.506757 | 124 | 0.705293 |
80010fb9735477e82d9433d91009bc8a100c2b12 | 1,252 | py | Python | lesson2/exercise4.py | mfeindt0705/pynetmf | 02fc092fd42ce5be5e160fa88b65c63d23408a6a | [
"Apache-2.0"
] | null | null | null | lesson2/exercise4.py | mfeindt0705/pynetmf | 02fc092fd42ce5be5e160fa88b65c63d23408a6a | [
"Apache-2.0"
] | 7 | 2021-03-18T21:28:13.000Z | 2022-02-10T10:39:10.000Z | lesson2/exercise4.py | mfeindt0705/pynetmf | 02fc092fd42ce5be5e160fa88b65c63d23408a6a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Use Netmiko and the send_config_set() method to configure the following on the Cisco3 router.
ip name-server 1.1.1.1
ip name-server 1.0.0.1
ip domain-lookup
Experiment with fast_cli=True to see how long the script takes to execute (with and without this option enabled).
Verify DNS lookups ... | 27.822222 | 113 | 0.71885 |
872d0baa66a519aa8783749a0b7a4985254c1c79 | 2,535 | py | Python | examples/django_app/example_app/settings.py | lucasqiu/ChatterBot | e9a490e8a9d67cd7b73f23878451e8b26371b351 | [
"BSD-3-Clause"
] | 2 | 2021-04-05T03:02:50.000Z | 2021-04-05T05:00:11.000Z | examples/django_app/example_app/settings.py | mesadhan/ChatterBot | e9a490e8a9d67cd7b73f23878451e8b26371b351 | [
"BSD-3-Clause"
] | null | null | null | examples/django_app/example_app/settings.py | mesadhan/ChatterBot | e9a490e8a9d67cd7b73f23878451e8b26371b351 | [
"BSD-3-Clause"
] | null | null | null | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
# SECURITY WARNING: keep the... | 23.915094 | 71 | 0.684813 |
aaabde3c9c54fe3ad121d22034a323d29919da32 | 102 | py | Python | src/web/app.py | hhao99/autoreport | 55a11eb038e456114f050587b1625b960cae4972 | [
"MIT"
] | null | null | null | src/web/app.py | hhao99/autoreport | 55a11eb038e456114f050587b1625b960cae4972 | [
"MIT"
] | null | null | null | src/web/app.py | hhao99/autoreport | 55a11eb038e456114f050587b1625b960cae4972 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Hello,Flash"
| 11.333333 | 24 | 0.656863 |
339f31761b6d1285ad011b372f5407fa8cd166d5 | 296 | py | Python | JumpscaleLibsExtra/servers/radicale/RadicaleFactory.py | threefoldtech/jumpscaleX_libs_extra | 74324027e50d00b08c5b0d609e4492a85d4f8080 | [
"Apache-2.0"
] | 1 | 2020-10-05T08:53:57.000Z | 2020-10-05T08:53:57.000Z | JumpscaleLibsExtra/servers/radicale/RadicaleFactory.py | threefoldtech/jumpscaleX_libs_extra | 74324027e50d00b08c5b0d609e4492a85d4f8080 | [
"Apache-2.0"
] | 17 | 2019-11-14T08:41:37.000Z | 2020-05-27T09:23:51.000Z | JumpscaleLibsExtra/servers/radicale/RadicaleFactory.py | threefoldtech/jumpscaleX_libs_extra | 74324027e50d00b08c5b0d609e4492a85d4f8080 | [
"Apache-2.0"
] | null | null | null | import sys
import os
from Jumpscale import j
class RadicaleFactory(j.baseclasses.object):
__jslocation__ = "j.servers.radicale"
@property
def wsgi_app(self):
sys.path.append(os.path.dirname(__file__))
from .radicale import application
return application
| 17.411765 | 50 | 0.702703 |
de6afb7c3f2e57394b8c13c5696d1b37a725995d | 169 | py | Python | hiring_project/hiring_app/urls.py | cs-fullstack-2019-spring/django-formclassv2-cw-cierravereen24 | ea4a60738295804f622cd8f59197a335c643396e | [
"Apache-2.0"
] | null | null | null | hiring_project/hiring_app/urls.py | cs-fullstack-2019-spring/django-formclassv2-cw-cierravereen24 | ea4a60738295804f622cd8f59197a335c643396e | [
"Apache-2.0"
] | null | null | null | hiring_project/hiring_app/urls.py | cs-fullstack-2019-spring/django-formclassv2-cw-cierravereen24 | ea4a60738295804f622cd8f59197a335c643396e | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = {
path('', views.index, name='index'),
path('info/', views.employeeInfo, name='employeeInfo'),
} | 21.125 | 59 | 0.674556 |
69cb84dabf90c9e9e1101c28dfaa27551befdf1f | 4,536 | py | Python | src/bin/lm_train.py | Secondtonumb/espnet | 6cda4fe3fa722ec60240a6d193af7f19c95fa7eb | [
"Apache-2.0"
] | 1 | 2018-05-15T02:59:45.000Z | 2018-05-15T02:59:45.000Z | src/bin/lm_train.py | Zarana-Parekh/espnet-mt | 1951f54f0b7b721598186ff910ca12a6eea638db | [
"Apache-2.0"
] | 6 | 2018-04-11T21:45:32.000Z | 2018-05-01T11:40:17.000Z | src/bin/lm_train.py | Zarana-Parekh/espnet-mt | 1951f54f0b7b721598186ff910ca12a6eea638db | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
# This code is ported from the following implementation written in Torch.
# https://github.com/chainer/chainer/blob/master/examples/ptb/train_ptb_custom_loop.py
from __future_... | 38.440678 | 104 | 0.599206 |
8d9a205b9b3690dddf2a58066390992c95ff0e49 | 309 | py | Python | Amazing Python Projects_Scripts/role playing game/magic.py | Manas1820/Hacktoberfest2021_awesome-projects | 9a2442e5a082fbd90736ed4a2c64e7a7e5d93cb5 | [
"MIT"
] | 30 | 2021-10-06T18:18:10.000Z | 2022-03-19T05:54:14.000Z | Amazing Python Projects_Scripts/role playing game/magic.py | Manas1820/Hacktoberfest2021_awesome-projects | 9a2442e5a082fbd90736ed4a2c64e7a7e5d93cb5 | [
"MIT"
] | 24 | 2021-10-06T10:09:25.000Z | 2021-12-02T22:21:19.000Z | Amazing Python Projects_Scripts/role playing game/magic.py | Manas1820/Hacktoberfest2021_awesome-projects | 9a2442e5a082fbd90736ed4a2c64e7a7e5d93cb5 | [
"MIT"
] | 12 | 2021-10-08T23:06:02.000Z | 2022-03-27T03:06:33.000Z | import random
class Spell:
def __init__(self,name,cost,dmg,type):
self.name = name
self.cost = cost
self.dmg = dmg
self.type = type
def generate_damage(self):
low = self.dmg-15
high = self.dmg+15
return random.randrange(low,high)
| 22.071429 | 43 | 0.559871 |
2aad30613ec522166a52ff4deea3a04d2f46ebfb | 782 | py | Python | ui/create_session.py | nemero/deck | 1964959e654db9f0598647b30629895c43d7b098 | [
"MIT"
] | null | null | null | ui/create_session.py | nemero/deck | 1964959e654db9f0598647b30629895c43d7b098 | [
"MIT"
] | null | null | null | ui/create_session.py | nemero/deck | 1964959e654db9f0598647b30629895c43d7b098 | [
"MIT"
] | null | null | null | import npyscreen
import curses
class CreateSessionForm(npyscreen.ActionForm):
"""docstring for MainForm"""
def create(self):
self.name = "Create Session:"
self.OK_BUTTON_TEXT = "Continue"
self.CANCEL_BUTTON_TEXT = "Cancel"
self.__class__.OK_BUTTON_BR_OFFSET = (2,6)
self.... | 34 | 102 | 0.671355 |
39b61bdcc88016f24c3ddd0256eb0f2eb1e30e59 | 1,241 | py | Python | Crash Course on Python/Week 5/pygrams/composition.py | garynth41/Google-IT-Automation-with-Python-Professional-Certificate | 6a800b5b995c05f74c824545260207d19877baf7 | [
"MIT"
] | 2 | 2020-01-18T16:01:24.000Z | 2020-02-29T19:27:17.000Z | Crash Course on Python/Week 5/pygrams/composition.py | garynth41/Google-IT-Automation-with-Python-Professional-Certificate | 6a800b5b995c05f74c824545260207d19877baf7 | [
"MIT"
] | null | null | null | Crash Course on Python/Week 5/pygrams/composition.py | garynth41/Google-IT-Automation-with-Python-Professional-Certificate | 6a800b5b995c05f74c824545260207d19877baf7 | [
"MIT"
] | 4 | 2020-08-17T16:49:06.000Z | 2022-02-14T06:45:29.000Z | """
Let’s expand a bit on our Clothing classes from the previous in-video question. Your mission: Finish the "Stock_by_Material" method
and iterate over the amount of each item of a given material that is in stock. When you’re finished, the script should add up to 10
cotton Polo shirts.
"""
class Clothing:
... | 35.457143 | 132 | 0.645447 |
85b368278d7df9cff0d7a6e06f9af0473ea2fd12 | 8,818 | py | Python | .history/pages/intro_20220303151122.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220303151122.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220303151122.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | """
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
st.set_page_config(
page_title='Code Compendium Intro Page',
... | 25.935294 | 228 | 0.659447 |
73447acc8f5bd1a21c4410fc05daeb9b37733a9c | 910 | py | Python | api/api/urls.py | g0vhk-io/fake-news-api-server | cd837dc6bafc1a9a7f963746826604a327670418 | [
"MIT"
] | null | null | null | api/api/urls.py | g0vhk-io/fake-news-api-server | cd837dc6bafc1a9a7f963746826604a327670418 | [
"MIT"
] | 2 | 2020-06-05T22:41:01.000Z | 2021-06-10T21:55:17.000Z | api/api/urls.py | g0vhk-io/fake-news-api-server | cd837dc6bafc1a9a7f963746826604a327670418 | [
"MIT"
] | 1 | 2019-08-24T13:45:03.000Z | 2019-08-24T13:45:03.000Z | """api URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 35 | 77 | 0.705495 |
b325cd0a3d6d90336c173a8f49c8548bbe9adf35 | 61,738 | py | Python | lib/matplotlib/collections.py | bsipocz/matplotlib | 80cd156fa6e17c8420e0c8348e876bb19c0e9462 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2018-01-04T13:50:45.000Z | 2018-01-04T13:50:45.000Z | lib/matplotlib/collections.py | bsipocz/matplotlib | 80cd156fa6e17c8420e0c8348e876bb19c0e9462 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/collections.py | bsipocz/matplotlib | 80cd156fa6e17c8420e0c8348e876bb19c0e9462 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """
Classes for the efficient drawing of large collections of objects that
share most properties, e.g., a large number of line segments or
polygons.
The classes are not meant to be as flexible as their single element
counterparts (e.g., you may not be able to select all line styles) but
they are meant to be fast for c... | 34.279845 | 81 | 0.58008 |
9e46930a96922ac6769a5722d686d7e9275ef74a | 4,654 | py | Python | conda_rpms/tests/unit/build_rpm_structure/test_create_rpmbuild_for_env.py | jamesp/conda-rpms | b033758b68bcb77b06441232ba7129956b7632ca | [
"BSD-3-Clause"
] | null | null | null | conda_rpms/tests/unit/build_rpm_structure/test_create_rpmbuild_for_env.py | jamesp/conda-rpms | b033758b68bcb77b06441232ba7129956b7632ca | [
"BSD-3-Clause"
] | 17 | 2016-12-16T16:07:47.000Z | 2022-01-11T18:53:39.000Z | conda_rpms/tests/unit/build_rpm_structure/test_create_rpmbuild_for_env.py | jamesp/conda-rpms | b033758b68bcb77b06441232ba7129956b7632ca | [
"BSD-3-Clause"
] | 2 | 2017-01-06T10:10:23.000Z | 2021-05-18T09:46:28.000Z | from mock import call, patch, sentinel
import os
import unittest
import conda_rpms.tests as tests
from conda_rpms.build_rpm_structure import create_rpmbuild_for_env
class Test(tests.CommonTest):
def setUp(self):
self.pkgs = [['url1', 'pkg1'],
['url2', 'pkg2']]
self.prefix = '... | 47.489796 | 79 | 0.586162 |
1353e85edef643585ec793896db5fac190284fc6 | 117 | py | Python | gym_cloth/__init__.py | adijunn/Rainbow_ddpg-fork | 424fa47cb3ba59476aa8991d33be08e7ebf64886 | [
"MIT"
] | null | null | null | gym_cloth/__init__.py | adijunn/Rainbow_ddpg-fork | 424fa47cb3ba59476aa8991d33be08e7ebf64886 | [
"MIT"
] | null | null | null | gym_cloth/__init__.py | adijunn/Rainbow_ddpg-fork | 424fa47cb3ba59476aa8991d33be08e7ebf64886 | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='cloth-v0',
entry_point='gym_cloth.envs:ClothEnv',
) | 19.5 | 42 | 0.735043 |
d1a7d358842b4989cc8cf27d5f18630aba192eac | 10,194 | py | Python | src/isle/collection.py | chelseajohn/isle | f610b55a1e8b6d2584896eb649092b0524cc1f8c | [
"MIT"
] | 2 | 2021-01-14T17:47:01.000Z | 2021-07-16T22:31:25.000Z | src/isle/collection.py | chelseajohn/isle | f610b55a1e8b6d2584896eb649092b0524cc1f8c | [
"MIT"
] | 21 | 2018-06-04T07:09:02.000Z | 2020-12-11T09:37:08.000Z | src/isle/collection.py | chelseajohn/isle | f610b55a1e8b6d2584896eb649092b0524cc1f8c | [
"MIT"
] | 3 | 2021-01-18T19:18:29.000Z | 2021-03-26T03:27:15.000Z | r"""!\file
\brief Handle collections of elements.
"""
from logging import getLogger
import math
from copy import deepcopy
def hingeRange(start, end, stepSize):
r"""!
A generator that behaves similarly to the builtin range with two differences:
`%hingeRange`
- keeps going after reaching the end valu... | 37.755556 | 97 | 0.622327 |
69ffd6da2386c013765c906f536bf21fe422da14 | 7,475 | py | Python | examples/WebRPC/volttronwebrpc/volttronwebrpc.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 1 | 2020-05-26T01:29:50.000Z | 2020-05-26T01:29:50.000Z | examples/WebRPC/volttronwebrpc/volttronwebrpc.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | examples/WebRPC/volttronwebrpc/volttronwebrpc.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# 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... | 36.111111 | 79 | 0.653645 |
3e3a7ee2eb82eea03458af47e770d94c14c35f98 | 1,707 | py | Python | python/pulumi_aws_tags/taggable.py | tlinhart/pulumi-aws-tags | 37a0bcb8bf72a6468cceaee1e4440aa1649f8dc3 | [
"MIT"
] | 1 | 2021-04-28T06:39:27.000Z | 2021-04-28T06:39:27.000Z | python/pulumi_aws_tags/taggable.py | tlinhart/pulumi-aws-tags | 37a0bcb8bf72a6468cceaee1e4440aa1649f8dc3 | [
"MIT"
] | 3 | 2021-01-17T06:27:55.000Z | 2021-10-21T12:40:43.000Z | python/pulumi_aws_tags/taggable.py | tlinhart/pulumi-aws-tags | 37a0bcb8bf72a6468cceaee1e4440aa1649f8dc3 | [
"MIT"
] | 3 | 2021-08-25T12:58:14.000Z | 2021-09-21T11:43:53.000Z | import inspect
import pulumi
import pulumi_aws
def _snake_to_camel(s):
"""Convert a string from snake case to camel case."""
return ''.join(word.lower() if index == 0 else word.title()
for index, word in enumerate(s.split('_')))
def _get_taggable_resource_types():
"""Return a generat... | 31.036364 | 76 | 0.644991 |
0427dadea03279861288aefaa425028e70515d0a | 1,389 | py | Python | core/pattern/singleton.py | YorkSu/deepgo | 2f22ad50d2958a4f1c7dfc0af6fcd448f5e7e18d | [
"Apache-2.0"
] | null | null | null | core/pattern/singleton.py | YorkSu/deepgo | 2f22ad50d2958a4f1c7dfc0af6fcd448f5e7e18d | [
"Apache-2.0"
] | null | null | null | core/pattern/singleton.py | YorkSu/deepgo | 2f22ad50d2958a4f1c7dfc0af6fcd448f5e7e18d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Singleton
======
Singleton Patterns
"""
import abc
import threading
abstractmethod = abc.abstractmethod
class SingletonMetaclass(type):
"""Metaclass for defining Singleton Classes
Use this metaclass to create a Singleton Class.
Usage:
```python
class Singleton(m... | 21.703125 | 83 | 0.715623 |
055516e2948bf619611b6ec608bfeff25a55f9c6 | 1,787 | py | Python | neural_network/train.py | dsysoev/fun-with-tensorflow | 3be8ea9dcb7960b946c5b2430b63e2cf981e5437 | [
"MIT"
] | null | null | null | neural_network/train.py | dsysoev/fun-with-tensorflow | 3be8ea9dcb7960b946c5b2430b63e2cf981e5437 | [
"MIT"
] | 1 | 2022-03-12T01:03:22.000Z | 2022-03-12T01:03:22.000Z | neural_network/train.py | dsysoev/fun-with-tensorflow | 3be8ea9dcb7960b946c5b2430b63e2cf981e5437 | [
"MIT"
] | null | null | null |
import time
import numpy as np
from loss import MSE
from optimizer import SGD
from data import BatchIterator
def train(network,
inputs,
targets,
num_epochs=5000,
iterator=BatchIterator(),
loss=MSE(),
optimizer=SGD(),
verbose=False):
for epoc... | 33.716981 | 91 | 0.584779 |
cf2429d0dd52d347fdc3abb6ca73727c4dd8e195 | 1,814 | py | Python | zsl/lol.py | rishabhrishu/activeZSL | af435f73972fa0ea9a9c17948e8381603023dbf8 | [
"MIT"
] | 1 | 2018-12-17T05:53:52.000Z | 2018-12-17T05:53:52.000Z | zsl/lol.py | rishabhrishu/activeZSL | af435f73972fa0ea9a9c17948e8381603023dbf8 | [
"MIT"
] | null | null | null | zsl/lol.py | rishabhrishu/activeZSL | af435f73972fa0ea9a9c17948e8381603023dbf8 | [
"MIT"
] | null | null | null | import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.optimizers import RMSprop
from matplotlib import pyplot as plt
batch_size = 128
num_classes = 10
epochs = 2
# the data, shuffled and split between train and test sets
(x_train, y_train)... | 28.793651 | 60 | 0.705623 |
f5a2124ebc21a9e4d180565b294f47cbd7d51471 | 7,309 | py | Python | setup.py | adammichaelwood/agents | 66ad01b9ae909bc6c344b8f0cb356758cae95236 | [
"Apache-2.0"
] | null | null | null | setup.py | adammichaelwood/agents | 66ad01b9ae909bc6c344b8f0cb356758cae95236 | [
"Apache-2.0"
] | null | null | null | setup.py | adammichaelwood/agents | 66ad01b9ae909bc6c344b8f0cb356758cae95236 | [
"Apache-2.0"
] | 3 | 2019-09-08T22:05:56.000Z | 2020-05-27T08:27:15.000Z | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 32.057018 | 84 | 0.679847 |
09076f9bd9d440aac34cddd62e116782c7156181 | 54 | py | Python | run.py | MatthewUng/fudr | 06a53f0b59b732613b02064b46a1a7806d2b1263 | [
"MIT"
] | null | null | null | run.py | MatthewUng/fudr | 06a53f0b59b732613b02064b46a1a7806d2b1263 | [
"MIT"
] | null | null | null | run.py | MatthewUng/fudr | 06a53f0b59b732613b02064b46a1a7806d2b1263 | [
"MIT"
] | null | null | null | from app import app
app.run(host='0.0.0.0', port=80)
| 13.5 | 32 | 0.666667 |
eb9e10222a37a6b7e9fab0c2384ccaa849f9a016 | 335 | py | Python | src/negf/bp/sub.py | qftphys/Calculation-of-thermal-conductivity-of-graphene-knot-under-strain- | 90537448eef11b034cb252025295868591de0919 | [
"MIT"
] | 2 | 2017-06-19T05:58:58.000Z | 2017-09-28T08:31:29.000Z | src/negf/bp/sub.py | qftphys/Calculation-of-thermal-conductivity-of-graphene-knot-under-strain- | 90537448eef11b034cb252025295868591de0919 | [
"MIT"
] | null | null | null | src/negf/bp/sub.py | qftphys/Calculation-of-thermal-conductivity-of-graphene-knot-under-strain- | 90537448eef11b034cb252025295868591de0919 | [
"MIT"
] | null | null | null | from aces import Aces
class sub(Aces):
def submit(self):
opt=dict(
units="metal",
species="BP",
method="greenkubo",
nodes=1,
procs=12,
queue="q1.1",
runTime=10000000
,runner="negf"
)
app=dict(latx=4,pot=True,laty=2,latz=1,supercell=[1,1,1])
self.commit(opt,app);
if __name__=='__main__':... | 17.631579 | 59 | 0.629851 |
97d9fe7b686bbb341cdb7e592b7a1d10227302e0 | 1,385 | py | Python | fuzz_lightyear/response.py | bbhunter/fuzz-lightyear | 75c1318d2f747a4fac6b55a46649c944528769ba | [
"Apache-2.0"
] | 169 | 2019-11-06T20:30:16.000Z | 2022-01-22T15:55:19.000Z | fuzz_lightyear/response.py | bbhunter/fuzz-lightyear | 75c1318d2f747a4fac6b55a46649c944528769ba | [
"Apache-2.0"
] | 29 | 2019-09-24T19:44:03.000Z | 2021-10-01T09:29:30.000Z | fuzz_lightyear/response.py | bbhunter/fuzz-lightyear | 75c1318d2f747a4fac6b55a46649c944528769ba | [
"Apache-2.0"
] | 27 | 2019-12-27T19:57:28.000Z | 2021-12-08T05:38:10.000Z | from typing import Any
from typing import Dict
from typing import List
from .request import FuzzingRequest
class ResponseSequence:
def __init__(self) -> None:
# Collection of response objects returned by API calls.
self.responses = [] # type: List[Any]
# Collection of items produced... | 29.468085 | 76 | 0.59639 |
07382c2138b42323aa1c177748991e3b98de4759 | 17,892 | py | Python | descqa/CheckColors.py | adam-broussard/descqa | d9681bd393553c31882ec7e28e6c1c7b6e482dd3 | [
"BSD-3-Clause"
] | null | null | null | descqa/CheckColors.py | adam-broussard/descqa | d9681bd393553c31882ec7e28e6c1c7b6e482dd3 | [
"BSD-3-Clause"
] | 1 | 2018-08-28T02:40:57.000Z | 2018-08-28T11:37:43.000Z | descqa/CheckColors.py | adam-broussard/descqa | d9681bd393553c31882ec7e28e6c1c7b6e482dd3 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, unicode_literals, absolute_import, division
import os
import sys
import numpy as np
import numexpr as ne
from .base import BaseValidationTest, TestResult
from .plotting import plt
from astropy.table import Table
from scipy.spatial import distance_matrix
import ot
from numba import... | 45.876923 | 157 | 0.57808 |
d01b0def08ec8a95898045df97ac31149c02d55c | 4,501 | py | Python | tests/test_app/tests/custom_storage_class_tests.py | shaheeqa/django-minio-storage | 625a2ff3f40e4bf2d27861d2db62a2a61d58b916 | [
"Apache-2.0",
"MIT"
] | 94 | 2017-07-01T23:08:34.000Z | 2022-02-15T16:31:11.000Z | tests/test_app/tests/custom_storage_class_tests.py | elisco-latour/django-minio-storage | 8ce77cd8eae0d86fa3200e74cde64144c0338f37 | [
"Apache-2.0",
"MIT"
] | 91 | 2017-05-30T11:38:10.000Z | 2022-02-05T21:46:27.000Z | tests/test_app/tests/custom_storage_class_tests.py | elisco-latour/django-minio-storage | 8ce77cd8eae0d86fa3200e74cde64144c0338f37 | [
"Apache-2.0",
"MIT"
] | 38 | 2017-05-30T10:02:22.000Z | 2022-02-17T02:49:47.000Z | import io
import os
import shutil
import tempfile
from django.core.files.base import ContentFile
from django.test import TestCase, override_settings
from django.utils.deconstruct import deconstructible
from minio_storage.files import ReadOnlyMinioObjectFile
from minio_storage.storage import (
MinioStorage,
cr... | 34.098485 | 88 | 0.639191 |
8627bc6bc7298d3ab669e3a439ae51d75a42bce5 | 8,611 | py | Python | stellargraph/layer/attri2vec.py | ashikrafi/stellargraph | 0f6f24d21ec9c016bb370c2d705af4e876495cb4 | [
"Apache-2.0"
] | 2 | 2020-03-27T07:02:09.000Z | 2020-05-30T16:46:18.000Z | stellargraph/layer/attri2vec.py | ashikrafi/stellargraph | 0f6f24d21ec9c016bb370c2d705af4e876495cb4 | [
"Apache-2.0"
] | null | null | null | stellargraph/layer/attri2vec.py | ashikrafi/stellargraph | 0f6f24d21ec9c016bb370c2d705af4e876495cb4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Data61, CSIRO
#
# 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 applicabl... | 35.879167 | 152 | 0.631518 |
8d0be307388a913900b7a49a7413b3c835e92897 | 1,000 | py | Python | btsapi/modules/vendors/models.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 2 | 2018-04-25T01:12:06.000Z | 2018-06-27T22:08:08.000Z | btsapi/modules/vendors/models.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 1 | 2019-03-03T09:15:29.000Z | 2019-03-03T09:19:03.000Z | btsapi/modules/vendors/models.py | bodastage/bts-ce-api | ed93b2f70e3ae7c1d364099b767d7cd1272470eb | [
"Apache-2.0"
] | 4 | 2018-03-10T23:30:00.000Z | 2019-12-10T06:21:52.000Z | from flask_sqlalchemy import SQLAlchemy
from btsapi.common.model_helpers import dump_datetime;
from btsapi import db, ma;
import datetime
class Vendor(db.Model):
"""Vendors model"""
__tablename__ = 'vendors'
pk = db.Column(db.Integer, db.Sequence('seq_vendors_pk',), primary_key=True, nullable=False )
... | 32.258065 | 109 | 0.716 |
80540ff1d4a74411111c1641e62822347cfff86a | 2,687 | py | Python | sharingan/summrizer/summary.py | nathanhere/sharingan | fa779d56f291f719aa4d627a9ec09c68d8397073 | [
"Unlicense",
"MIT"
] | 225 | 2017-03-03T14:51:32.000Z | 2021-11-20T11:09:59.000Z | sharingan/summrizer/summary.py | vipul-sharma20/sharingan | 25504394fccbade08a3903adfebeccab61410340 | [
"Unlicense",
"MIT"
] | 2 | 2020-12-01T11:42:28.000Z | 2020-12-29T14:49:22.000Z | sharingan/summrizer/summary.py | nathanhere/sharingan | fa779d56f291f719aa4d627a9ec09c68d8397073 | [
"Unlicense",
"MIT"
] | 30 | 2017-03-13T21:41:22.000Z | 2021-09-06T08:57:44.000Z | # -*- coding: utf-8 -*-
"""
Script to score sentences to get summary
"""
from nltk.corpus import stopwords
import util
import re
class Summrizer:
def format_sentence(self, sentence):
sentence = re.sub(r'\W+', '', sentence)
return sentence
def score_sentences(self, sen1, sen2):
"""
... | 30.534091 | 71 | 0.549684 |
c009cce70041ef036c124b7f0bb29e5ba1d5e318 | 4,626 | py | Python | launch_rosetta_global.py | fraser-lab/ROSETTA_EM_REFINEMENT | f76cf18ca1e1ea2e89ed8c1317e5014d13176a26 | [
"MIT"
] | 3 | 2018-08-20T16:50:41.000Z | 2019-05-25T11:45:15.000Z | launch_rosetta_global.py | fraser-lab/ROSETTA_EM_REFINEMENT | f76cf18ca1e1ea2e89ed8c1317e5014d13176a26 | [
"MIT"
] | null | null | null | launch_rosetta_global.py | fraser-lab/ROSETTA_EM_REFINEMENT | f76cf18ca1e1ea2e89ed8c1317e5014d13176a26 | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--pdb", help="pdb file name output from idealize",required=True)
parser.add_argument("--map", help="map file name ",required=True)
parser.add_argument("--rms", help="rms to sample ",default=2.0)
parser.add_argument("--resolution", help="reported re... | 44.912621 | 357 | 0.677475 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.