hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
564fdd8792c345c9521a3589465f58a094c5441f | 1,149 | py | Python | pyenzyme/restful/addModel_schema.py | HannahDi/PyEnzyme | afbd03ab65445b2411307613c9a3cd7ab8ea4ae7 | [
"BSD-2-Clause"
] | 7 | 2020-10-28T22:04:56.000Z | 2022-03-01T12:23:57.000Z | pyenzyme/restful/addModel_schema.py | HannahDi/PyEnzyme | afbd03ab65445b2411307613c9a3cd7ab8ea4ae7 | [
"BSD-2-Clause"
] | 33 | 2021-05-18T15:17:05.000Z | 2022-03-29T13:59:57.000Z | pyenzyme/restful/addModel_schema.py | HannahDi/PyEnzyme | afbd03ab65445b2411307613c9a3cd7ab8ea4ae7 | [
"BSD-2-Clause"
] | 8 | 2020-10-27T13:31:06.000Z | 2022-03-20T10:40:56.000Z | '''
File: addModel_schema.py
Project: restful
Author: Jan Range
License: BSD-2 clause
-----
Last Modified: Tuesday June 22nd 2021 10:19:09 pm
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>)
-----
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart
'''
from marshmallow import... | 26.113636 | 81 | 0.656223 |
fa320267b3993f4927123f90336076e1ea9960aa | 56 | py | Python | summertime.py | AK391/SummerTime | 8f0e664408cc347d990c165eaefe865d9b993598 | [
"Apache-2.0"
] | null | null | null | summertime.py | AK391/SummerTime | 8f0e664408cc347d990c165eaefe865d9b993598 | [
"Apache-2.0"
] | null | null | null | summertime.py | AK391/SummerTime | 8f0e664408cc347d990c165eaefe865d9b993598 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
print("welcome to Summer Time!")
| 14 | 32 | 0.696429 |
fc996e256bc77017c0e484353c16dff3396a61ef | 6,601 | py | Python | pipelinewise/fastsync/postgres_to_snowflake.py | RFAInc/pipelinewise | b5f0ec94f42c15251991d200fe83ea977cc23f30 | [
"Apache-2.0"
] | null | null | null | pipelinewise/fastsync/postgres_to_snowflake.py | RFAInc/pipelinewise | b5f0ec94f42c15251991d200fe83ea977cc23f30 | [
"Apache-2.0"
] | 1 | 2021-05-21T06:26:37.000Z | 2021-05-21T06:26:37.000Z | pipelinewise/fastsync/postgres_to_snowflake.py | RFAInc/pipelinewise | b5f0ec94f42c15251991d200fe83ea977cc23f30 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import multiprocessing
from argparse import Namespace
from typing import Union
from functools import partial
from datetime import datetime
from ..logger import Logger
from .commons import utils
from .commons.tap_postgres import FastSyncTapPostgres
from .commons.target_snowf... | 33.507614 | 111 | 0.59082 |
48d5c47dd7b6e0d022e48a4f9fda7fe8a528725e | 16,751 | py | Python | metal/types/user.py | displague/metal-python | 96e64e9ac41025d85ff6f61693165e29e1c366db | [
"MIT"
] | null | null | null | metal/types/user.py | displague/metal-python | 96e64e9ac41025d85ff6f61693165e29e1c366db | [
"MIT"
] | 3 | 2021-09-27T05:10:36.000Z | 2021-09-27T06:10:57.000Z | metal/types/user.py | displague/metal-python | 96e64e9ac41025d85ff6f61693165e29e1c366db | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Metal API
This is the API for Equinix Metal. The API allows you to programmatically interact with all of your Equinix Metal resources, including devices, networks, addresses, organizations, projects, and your user account. The official API docs are hosted at <https://metal.equinix.com/dev... | 26.716108 | 405 | 0.584741 |
0615e68f48e5857b25266d0130e03209ede34a6a | 6,806 | py | Python | eth_keyfile/keyfile.py | basezer0/eth-keyfile | d8f9ed9e9c232bc69f5b1199f44b5b78c1fa6a34 | [
"MIT"
] | null | null | null | eth_keyfile/keyfile.py | basezer0/eth-keyfile | d8f9ed9e9c232bc69f5b1199f44b5b78c1fa6a34 | [
"MIT"
] | null | null | null | eth_keyfile/keyfile.py | basezer0/eth-keyfile | d8f9ed9e9c232bc69f5b1199f44b5b78c1fa6a34 | [
"MIT"
] | null | null | null | import hashlib
import hmac
import json
import uuid
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import scrypt
from Crypto.Util import Counter
from eth_keys import keys
from eth_utils import (
big_endian_to_int,
decode_hex,
encode_hex,
int_to_big_endian,
is_dict... | 25.207407 | 89 | 0.641199 |
ed16a4b53659a8c6941231d2a7fd66c5d23510bd | 3,531 | py | Python | bindings/python/ensmallen/datasets/string/kibdelosporangiumphytohabitans.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/kibdelosporangiumphytohabitans.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/kibdelosporangiumphytohabitans.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Kibdelosporangium phytohabitans.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein... | 33.628571 | 223 | 0.683093 |
40deb057f50ffe7bfc15e0412498492de27a1bee | 325 | py | Python | admin_panel/config/docs.py | Ravn10/admin_panel | 48273267c114f648ed4d5f9ec87260352997c95b | [
"MIT"
] | null | null | null | admin_panel/config/docs.py | Ravn10/admin_panel | 48273267c114f648ed4d5f9ec87260352997c95b | [
"MIT"
] | null | null | null | admin_panel/config/docs.py | Ravn10/admin_panel | 48273267c114f648ed4d5f9ec87260352997c95b | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/admin_panel"
# docs_base_url = "https://[org_name].github.io/admin_panel"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Admin Pa... | 27.083333 | 68 | 0.729231 |
e5593a5bc9591e8bb3ab1b721ee31144363e9c71 | 11,711 | py | Python | built-in/TensorFlow/Official/cv/detection/ModelZoo_CTPN_TF_HARD/ModelZoo_CTPN_TF_HARD/00-access/utils/rpn_msr/anchor_target_layer.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/TensorFlow/Official/cv/detection/ModelZoo_CTPN_TF_HARD/ModelZoo_CTPN_TF_HARD/00-access/utils/rpn_msr/anchor_target_layer.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/TensorFlow/Official/cv/detection/ModelZoo_CTPN_TF_HARD/ModelZoo_CTPN_TF_HARD/00-access/utils/rpn_msr/anchor_target_layer.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # -*- coding:utf-8 -*-
import numpy as np
import numpy.random as npr
from utils.bbox.bbox import bbox_overlaps
from utils.rpn_msr.bbox import bbox_overlap_tf
from utils.bbox.bbox_transform import bbox_transform
from utils.rpn_msr.config import Config as cfg
from utils.rpn_msr.generate_anchors import generate_anchors
... | 40.804878 | 116 | 0.63752 |
46a943fcbf9d8ed53f641ab1a192989dbed4fb17 | 13,276 | py | Python | src/genie/libs/parser/nxos/tests/ShowInterface/cli/equal/golden1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/nxos/tests/ShowInterface/cli/equal/golden1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/nxos/tests/ShowInterface/cli/equal/golden1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
'Ethernet2/1':
{'auto_mdix': 'off',
'auto_negotiate': False,
'admin_state': 'up',
'bandwidth': 768,
'beacon': 'off',
'counters':
{'in_bad_etype_drop': 0,
'in_broadcast_pkts': 0,
... | 37.502825 | 66 | 0.385432 |
47233dfacb29e9cf5ca8d2bf85cd1f98591aab63 | 1,902 | py | Python | Logistic Regression/Logistic_XOR_Problem.py | marcelkotze007/mk007---ML-Python-library | 307e51762fc821588206440daa2c18a6128f4aec | [
"MIT"
] | null | null | null | Logistic Regression/Logistic_XOR_Problem.py | marcelkotze007/mk007---ML-Python-library | 307e51762fc821588206440daa2c18a6128f4aec | [
"MIT"
] | null | null | null | Logistic Regression/Logistic_XOR_Problem.py | marcelkotze007/mk007---ML-Python-library | 307e51762fc821588206440daa2c18a6128f4aec | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
#The key to solving this problem is to turn it into a 3D-problem ans draw a plan between the 2 datasets
class XOR:
def create_data(self, N = 4, D = 2):
#XOR output for 2 inputs and 1 output
#Input = 1 1, output = 0
#Input = 0 0, o... | 27.171429 | 116 | 0.506835 |
f4969b593aa1f1a8fb7c4e98b0de53b24186010a | 3,060 | py | Python | base/worker.py | ServerHack-The-First-Law-Of-Robotics/data_engineering | 4651d69615eda1eaac518a86b8c9f94b8912146e | [
"MIT"
] | null | null | null | base/worker.py | ServerHack-The-First-Law-Of-Robotics/data_engineering | 4651d69615eda1eaac518a86b8c9f94b8912146e | [
"MIT"
] | null | null | null | base/worker.py | ServerHack-The-First-Law-Of-Robotics/data_engineering | 4651d69615eda1eaac518a86b8c9f94b8912146e | [
"MIT"
] | null | null | null | from typing import Optional, Dict, Tuple
from abc import ABC, abstractmethod
from logging import getLogger
from aiohttp import ClientSession, BasicAuth
from asyncio import sleep
from uuid import uuid4
from .data_objects import Task, Result
from .storage import Storage
from .task_retriever import TaskRetriever
from bas... | 34.772727 | 108 | 0.593137 |
06eff66a52533435fde65a028bddeb3fee4f27ca | 1,152 | py | Python | src/olympia/scanners/migrations/0021_auto_20200122_1347.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/scanners/migrations/0021_auto_20200122_1347.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/scanners/migrations/0021_auto_20200122_1347.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | # Generated by Django 2.2.9 on 2020-01-22 13:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanners', '0020_auto_20200116_1250'),
]
operations = [
migrations.AlterField(
model_name='scannerqueryresult',
name... | 33.882353 | 117 | 0.559028 |
d1f605a2e082c87303e4fc05918d1f0311884dfa | 20,696 | py | Python | test/functional/test_framework/script.py | piilanismith7/bitcoin-1 | df9f71274645a917e2578c52a1c59745bce8112d | [
"MIT"
] | null | null | null | test/functional/test_framework/script.py | piilanismith7/bitcoin-1 | df9f71274645a917e2578c52a1c59745bce8112d | [
"MIT"
] | null | null | null | test/functional/test_framework/script.py | piilanismith7/bitcoin-1 | df9f71274645a917e2578c52a1c59745bce8112d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-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.
"""Functionality to build scripts, as well as SignatureHash().
This file is modified from python-bitcoinl... | 30.25731 | 146 | 0.613307 |
e651d3f2467f74f9bd461dd8640ebb797becd1f1 | 2,110 | py | Python | mmdet/models/dense_heads/__init__.py | ThaddaeusWiedemer/mmdetection | 3e9894111eebe9a3ca31936ff6413be264fe4bc2 | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/__init__.py | ThaddaeusWiedemer/mmdetection | 3e9894111eebe9a3ca31936ff6413be264fe4bc2 | [
"Apache-2.0"
] | null | null | null | mmdet/models/dense_heads/__init__.py | ThaddaeusWiedemer/mmdetection | 3e9894111eebe9a3ca31936ff6413be264fe4bc2 | [
"Apache-2.0"
] | null | null | null | from .anchor_free_head import AnchorFreeHead
from .anchor_head import AnchorHead
from .atss_head import ATSSHead
from .autoassign_head import AutoAssignHead
from .cascade_rpn_head import CascadeRPNHead, StageCascadeRPNHead
from .centernet_head import CenterNetHead
from .centripetal_head import CentripetalHead
from .cor... | 46.888889 | 117 | 0.822749 |
37db2efc275428da01b64ab18bd484fac40ee652 | 17,431 | py | Python | modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py | gaoxiaoyang/webrtc | 21021f022be36f5d04f8a3a309e345f65c8603a9 | [
"BSD-3-Clause"
] | 851 | 2018-02-05T09:54:56.000Z | 2022-03-24T23:13:10.000Z | modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py | gaoxiaoyang/webrtc | 21021f022be36f5d04f8a3a309e345f65c8603a9 | [
"BSD-3-Clause"
] | 200 | 2018-02-06T18:52:39.000Z | 2022-03-24T19:59:14.000Z | modules/audio_processing/test/py_quality_assessment/quality_assessment/simulation.py | gaoxiaoyang/webrtc | 21021f022be36f5d04f8a3a309e345f65c8603a9 | [
"BSD-3-Clause"
] | 197 | 2018-03-20T20:49:55.000Z | 2022-03-21T17:38:14.000Z | # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | 40.822014 | 80 | 0.718031 |
0fa62368bde1b0439c2c9621038e85baf4a46baa | 576 | py | Python | plugins/core/errors/on_command_error.py | Akins2229/MusicBot | fb83bd1e2ab4e0e35c3be94ad9098a6f2eb5a35b | [
"Apache-2.0"
] | null | null | null | plugins/core/errors/on_command_error.py | Akins2229/MusicBot | fb83bd1e2ab4e0e35c3be94ad9098a6f2eb5a35b | [
"Apache-2.0"
] | null | null | null | plugins/core/errors/on_command_error.py | Akins2229/MusicBot | fb83bd1e2ab4e0e35c3be94ad9098a6f2eb5a35b | [
"Apache-2.0"
] | 1 | 2021-11-04T18:09:53.000Z | 2021-11-04T18:09:53.000Z | import discord
from discord.ext import commands
class ErrorHandler(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.Cog.listener()
async def on_command_error(self, ctx, error):
if isinstance(error, commands.CommandNotFound):
return # silence command not found errors
... | 25.043478 | 51 | 0.666667 |
7b7cb0db6fbe75c1c3f314646744fac44bee5846 | 104,101 | py | Python | test/orm/test_unitofwork.py | jorgemorgado/sqlalchemy | 9a30491583d9f63e290c0cf92cccab7b9d2427e0 | [
"MIT"
] | null | null | null | test/orm/test_unitofwork.py | jorgemorgado/sqlalchemy | 9a30491583d9f63e290c0cf92cccab7b9d2427e0 | [
"MIT"
] | null | null | null | test/orm/test_unitofwork.py | jorgemorgado/sqlalchemy | 9a30491583d9f63e290c0cf92cccab7b9d2427e0 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Tests unitofwork operations."""
import datetime
import sqlalchemy as sa
from sqlalchemy import Boolean
from sqlalchemy import Enum
from sqlalchemy import event
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import Integer
from sqlalchemy import literal
from sqlalchemy... | 28.552112 | 79 | 0.513549 |
2e368826913b2dc89fa32b8881a8fd9cdfc0ddaf | 1,595 | py | Python | ninchat/api/messages/file.py | ninchat/ninchat-python | 7e5fcadb7389ca8c7722c32d69839289675d7baa | [
"BSD-2-Clause"
] | null | null | null | ninchat/api/messages/file.py | ninchat/ninchat-python | 7e5fcadb7389ca8c7722c32d69839289675d7baa | [
"BSD-2-Clause"
] | 4 | 2017-10-12T21:05:12.000Z | 2018-05-17T22:19:08.000Z | ninchat/api/messages/file.py | ninchat/ninchat-python | 7e5fcadb7389ca8c7722c32d69839289675d7baa | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2015, Somia Reality Oy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions an... | 45.571429 | 77 | 0.779937 |
a0cd8d2faaf704f1e677da9302519a4f715f13fe | 11,201 | py | Python | tensorflow_federated/python/learning/federated_averaging.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | 1 | 2020-08-27T14:16:06.000Z | 2020-08-27T14:16:06.000Z | tensorflow_federated/python/learning/federated_averaging.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/learning/federated_averaging.py | iahsanujunda/federated | 109a5653a305dc9d4bcbafc259257add4dc70365 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, The TensorFlow Federated 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... | 47.261603 | 80 | 0.745916 |
bfbe1ff99d547b5d78e926018bbf31b11d3dac60 | 464 | py | Python | code/scripts/get_gpt_topk_keywords.py | JiwanChung/tapm | ec42b139d1c012daccc55f85e67744488d526476 | [
"MIT"
] | 14 | 2021-07-14T13:36:52.000Z | 2022-02-05T06:41:27.000Z | code/scripts/get_gpt_topk_keywords.py | JiwanChung/tapm | ec42b139d1c012daccc55f85e67744488d526476 | [
"MIT"
] | 11 | 2021-06-11T13:59:11.000Z | 2022-03-25T03:57:46.000Z | code/scripts/get_gpt_topk_keywords.py | JiwanChung/tapm | ec42b139d1c012daccc55f85e67744488d526476 | [
"MIT"
] | 4 | 2021-08-12T15:47:07.000Z | 2022-02-05T08:00:08.000Z | from .common import load_data, run, GetWords
from transformers import (
GPT2Tokenizer
)
def main():
run(GetTopkWords(), 'gpt_top')
class GetTopkWords(GetWords):
def __init__(self):
super(GetTopkWords, self).__init__()
self.tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
self.to... | 23.2 | 62 | 0.678879 |
45ec8387971b4fece6f741bd71e8db2cbb1219de | 12,703 | py | Python | sayn/tasks/copy.py | robin-173/sayn | d1cf36b92fad6a1798b57ad80abb22e8386e0e86 | [
"Apache-2.0"
] | null | null | null | sayn/tasks/copy.py | robin-173/sayn | d1cf36b92fad6a1798b57ad80abb22e8386e0e86 | [
"Apache-2.0"
] | null | null | null | sayn/tasks/copy.py | robin-173/sayn | d1cf36b92fad6a1798b57ad80abb22e8386e0e86 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, Optional
from pydantic import BaseModel, Field, validator
from sqlalchemy import or_, select, column
from ..core.errors import Err, Exc, Ok
from ..database import Database
from .sql import SqlTask
class Source(BaseModel):
supports_schemas: bool
db_type: str
db_schema: Opti... | 33.965241 | 97 | 0.531134 |
8098bad5cede10f5e6d8eaff641544558376027b | 630 | py | Python | leetcode/weekly156/2_eq_substrs.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | 2 | 2018-01-18T11:01:36.000Z | 2021-12-20T18:14:48.000Z | leetcode/weekly156/2_eq_substrs.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | null | null | null | leetcode/weekly156/2_eq_substrs.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | null | null | null | '''
https://leetcode.com/contest/weekly-contest-156/problems/get-equal-substrings-within-budget/
'''
class Solution:
def equalSubstring(self, s: str, t: str, maxCost: int) -> int:
n = len(s)
diffs = [abs(ord(s[i]) - ord(t[i])) for i in range(n)]
for i in range(1, n):
diffs[i] += ... | 35 | 92 | 0.525397 |
364801501c8aa3c1d9c09d84adcac9a23764b2ae | 279 | py | Python | py_timer.py | jasonjiang8866/find_combo | e8b61dcb46ba012fc2348f311791011b2367ea6e | [
"MIT"
] | null | null | null | py_timer.py | jasonjiang8866/find_combo | e8b61dcb46ba012fc2348f311791011b2367ea6e | [
"MIT"
] | null | null | null | py_timer.py | jasonjiang8866/find_combo | e8b61dcb46ba012fc2348f311791011b2367ea6e | [
"MIT"
] | null | null | null | import functools, time
def py_timer(func):
@functools.wraps(func)
def wrapper_decorator(*args, **kwargs):
starting=time.time()
value = func(*args, **kwargs)
duration=time.time()-starting
return value,duration
return wrapper_decorator
| 25.363636 | 43 | 0.655914 |
abd1b9f7df16f40c7eb6f093f4807daf15cc758f | 1,394 | py | Python | Experiment_1/src/Compress/PCA_compress.py | RyoOzaki/myResearch | a8f8ec63e1b1802517b12db2b6f3e286a3984bcf | [
"MIT"
] | null | null | null | Experiment_1/src/Compress/PCA_compress.py | RyoOzaki/myResearch | a8f8ec63e1b1802517b12db2b6f3e286a3984bcf | [
"MIT"
] | null | null | null | Experiment_1/src/Compress/PCA_compress.py | RyoOzaki/myResearch | a8f8ec63e1b1802517b12db2b6f3e286a3984bcf | [
"MIT"
] | null | null | null | import numpy as np
from pathlib import Path
from sklearn.decomposition import PCA
from argparse import ArgumentParser
def packing(np_objs):
lengths = [data.shape[0] for data in np_objs]
return np.concatenate(np_objs, axis=0), lengths
def unpacking(np_obj, lengths):
cumsum_lens = np.concatenate(([0], np.cu... | 29.659574 | 78 | 0.759684 |
510db0c38cfa9c88cc365e94be8af6d367d6388c | 1,207 | py | Python | python/tree/1022_sum_of_root_to_leaf_binary_numbers.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/tree/1022_sum_of_root_to_leaf_binary_numbers.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/tree/1022_sum_of_root_to_leaf_binary_numbers.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | # Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def sumRootToLeaf(self, root):
"""
:type root: TreeNode
:rtype: int
"""
values = [0]
... | 23.211538 | 59 | 0.508699 |
2a23a4b5b2764c3a46c99857d31de227ddeefe6d | 964 | py | Python | freewvs/tests/test_codingstyle.py | hannob/testtest | 20ec8923acc23dbcb0efd10085ae042c1c66fb23 | [
"Unlicense"
] | 34 | 2019-12-13T02:05:20.000Z | 2022-01-18T14:40:21.000Z | freewvs/tests/test_codingstyle.py | hannob/testtest | 20ec8923acc23dbcb0efd10085ae042c1c66fb23 | [
"Unlicense"
] | 2 | 2022-01-16T14:15:17.000Z | 2022-01-17T08:00:44.000Z | tests/test_codingstype.py | schokokeksorg/freewvs | 707f64de143a9e137898a92f61dfca8a9c73f0bf | [
"CC0-1.0"
] | 3 | 2019-12-31T08:03:44.000Z | 2021-07-28T11:59:30.000Z | import unittest
import subprocess
import glob
class TestCodingstyle(unittest.TestCase):
@staticmethod
def test_codingstyle():
pyfiles = ["freewvs", "update-freewvsdb",
"setup.py"] + glob.glob("tests/*.py")
subprocess.run(["pycodestyle", "--ignore=W503"]
... | 34.428571 | 76 | 0.56639 |
e8ea797d93e087df808e206bbb932dad4e636a08 | 19,658 | py | Python | starlette/datastructures.py | rajeev/starlette | 7e1bfa8c01a697f95291b27cbe59fee5e3d35944 | [
"BSD-3-Clause"
] | 2 | 2019-03-15T02:44:45.000Z | 2019-04-29T04:25:17.000Z | starlette/datastructures.py | cfhamlet/starlette | 7e1bfa8c01a697f95291b27cbe59fee5e3d35944 | [
"BSD-3-Clause"
] | null | null | null | starlette/datastructures.py | cfhamlet/starlette | 7e1bfa8c01a697f95291b27cbe59fee5e3d35944 | [
"BSD-3-Clause"
] | null | null | null | import tempfile
import typing
from collections import namedtuple
from collections.abc import Sequence
from shlex import shlex
from urllib.parse import SplitResult, parse_qsl, urlencode, urlsplit
from starlette.concurrency import run_in_threadpool
from starlette.types import Scope
Address = namedtuple("Address", ["hos... | 31.252782 | 87 | 0.56781 |
4355af286ac6795322034ed5d1805fe9a8e3cd7d | 12,266 | py | Python | sklearn/tests/test_docstring_parameters.py | maksymborukh/scikit-learn | bee668e49333dcce8ef2886ac17966f6edc026d0 | [
"BSD-3-Clause"
] | null | null | null | sklearn/tests/test_docstring_parameters.py | maksymborukh/scikit-learn | bee668e49333dcce8ef2886ac17966f6edc026d0 | [
"BSD-3-Clause"
] | null | null | null | sklearn/tests/test_docstring_parameters.py | maksymborukh/scikit-learn | bee668e49333dcce8ef2886ac17966f6edc026d0 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Raghav RV <rvraghav93@gmail.com>
# License: BSD 3 clause
import inspect
import warnings
import importlib
from pkgutil import walk_packages
from inspect import signature
import numpy as np
import sklearn
from sklearn.utils import IS_PYPY
from skl... | 34.747875 | 87 | 0.638024 |
ef86198b918a9109afcc0eafc205810ac61a7ff3 | 335,856 | py | Python | Tensorflow/source/google/protobuf/unittest_pb2.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 39 | 2016-12-05T14:36:37.000Z | 2021-07-29T18:22:34.000Z | Tensorflow/source/google/protobuf/unittest_pb2.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 68 | 2016-12-12T20:38:47.000Z | 2020-07-26T18:28:49.000Z | Tensorflow/source/google/protobuf/unittest_pb2.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 120 | 2016-08-18T14:53:03.000Z | 2020-06-16T13:27:20.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/unittest.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf imp... | 49.852457 | 37,115 | 0.783336 |
e6485077f29f5857e79e9fcf628270032240645e | 12,786 | py | Python | kubernetes/client/models/v1beta2_stateful_set_status.py | itholic/python | dffe577a062e17057270ae80fa677ffd83e9d183 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta2_stateful_set_status.py | itholic/python | dffe577a062e17057270ae80fa677ffd83e9d183 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta2_stateful_set_status.py | itholic/python | dffe577a062e17057270ae80fa677ffd83e9d183 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1beta2Sta... | 37.605882 | 235 | 0.669717 |
03b04d81ddf9fb4596f2c1354ad12abe0fa4951d | 4,488 | py | Python | operational_graphics/toolboxes/scripts/CreateGRG.py | helyx-rterry/solutions-geoprocessing-toolbox | ddd12da92e58ea39a4d6f3beac05fa755499539a | [
"Apache-2.0"
] | null | null | null | operational_graphics/toolboxes/scripts/CreateGRG.py | helyx-rterry/solutions-geoprocessing-toolbox | ddd12da92e58ea39a4d6f3beac05fa755499539a | [
"Apache-2.0"
] | null | null | null | operational_graphics/toolboxes/scripts/CreateGRG.py | helyx-rterry/solutions-geoprocessing-toolbox | ddd12da92e58ea39a4d6f3beac05fa755499539a | [
"Apache-2.0"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright 2014 Esri
# 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/LICENS... | 39.026087 | 182 | 0.690062 |
b18c0c3e69746373722983249b62597e084d7f5c | 1,078 | py | Python | napari/utils/status_messages.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | 1 | 2021-04-04T21:25:04.000Z | 2021-04-04T21:25:04.000Z | napari/utils/status_messages.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | 1 | 2020-10-15T19:31:09.000Z | 2020-10-15T19:39:33.000Z | napari/utils/status_messages.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | null | null | null | from collections.abc import Iterable
import numpy as np
def format_float(value):
"""Nice float formatting into strings."""
return f'{value:0.3g}'
def status_format(value):
"""Return a "nice" string representation of a value.
Parameters
----------
value : Any
The value to be printed... | 26.292683 | 76 | 0.580705 |
eeef80fa339bc952b7ecfa93d575e403eaadc6e3 | 1,149 | py | Python | convbot/force_async.py | ffreemt/convbot | aba2637f7c97c468ff75bca4c83cad2fb17283eb | [
"MIT"
] | null | null | null | convbot/force_async.py | ffreemt/convbot | aba2637f7c97c468ff75bca4c83cad2fb17283eb | [
"MIT"
] | null | null | null | convbot/force_async.py | ffreemt/convbot | aba2637f7c97c468ff75bca4c83cad2fb17283eb | [
"MIT"
] | null | null | null | """Turn a sync func to async."""
from concurrent.futures import ThreadPoolExecutor
import asyncio
import functools
def force_async(func):
"""Turn a sync func to async.
Args:
func: a sync func
Return:
async func
Usage:
@force_async
def normal_func():
...
... | 25.533333 | 70 | 0.550914 |
7d58b72e8d754f440b4832e3f4db533e5ba20017 | 19,622 | py | Python | venv/Lib/site-packages/tensorflow/lite/experimental/microfrontend/ops/gen_audio_microfrontend_op.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/lite/experimental/microfrontend/ops/gen_audio_microfrontend_op.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/lite/experimental/microfrontend/ops/gen_audio_microfrontend_op.py | rexliu3/StockTradingBotCloud | 46b732b9c05f73bc0e856a3c4a16854b6d12e18e | [
"MIT"
] | 1 | 2020-06-28T11:47:47.000Z | 2020-06-28T11:47:47.000Z | """Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: audio_microfrontend_op.cc
"""
import collections
from tensorflow.python import pywrap_tfe as pywrap_tfe
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as ... | 49.928753 | 451 | 0.683722 |
6c035aebfd5ec80fe806cd210dc0da6714296018 | 5,906 | py | Python | userbot/modules/mega_downloader.py | deansammy17/dean17 | 21ad49e8979e4518b6f1a9d66f03c2f555811bb1 | [
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"FTL",
"X11",
"MS-PL"
] | 8 | 2020-04-29T13:27:23.000Z | 2021-07-10T16:52:29.000Z | userbot/modules/mega_downloader.py | deansammy17/dean17 | 21ad49e8979e4518b6f1a9d66f03c2f555811bb1 | [
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"FTL",
"X11",
"MS-PL"
] | 1 | 2020-06-28T09:11:11.000Z | 2020-06-28T09:11:11.000Z | userbot/modules/mega_downloader.py | deansammy17/dean17 | 21ad49e8979e4518b6f1a9d66f03c2f555811bb1 | [
"CNRI-Python",
"Condor-1.1",
"Naumen",
"Xnet",
"FTL",
"X11",
"MS-PL"
] | 16 | 2020-04-27T19:11:14.000Z | 2020-08-09T03:45:51.000Z | # Copyright (C) 2020 Adek Maulana.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following d... | 36.45679 | 94 | 0.635794 |
942a6526540d259d8a7f467563776e0b1a03b8fa | 1,073 | py | Python | vulnscan/API/Report.py | imfiver/Sec-Tools | a828e31c2e371c37f1256f0a574707a24776530d | [
"Apache-2.0"
] | 144 | 2021-11-05T10:45:05.000Z | 2022-03-31T03:17:19.000Z | vulnscan/API/Report.py | imfiver/Sec-Tools | a828e31c2e371c37f1256f0a574707a24776530d | [
"Apache-2.0"
] | 6 | 2021-11-07T02:47:41.000Z | 2022-03-06T05:50:15.000Z | vulnscan/API/Report.py | imfiver/Sec-Tools | a828e31c2e371c37f1256f0a574707a24776530d | [
"Apache-2.0"
] | 41 | 2021-11-07T13:35:02.000Z | 2022-03-29T00:09:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .Base import Base
import requests
class Report(Base):
def __init__(self, api_base_url, api_key):
super().__init__(api_base_url, api_key)
self.logger = self.get_logger
def get_all(self):
try:
response = requests.get(self.re... | 31.558824 | 105 | 0.587139 |
29b6c4e6cb4afc3c3ff62a6915de8182ba1fe46f | 15,057 | py | Python | testICP.py | ctralie/SiRPyGL | e06c317ed60321d492725e39fd8fcc0ce56ff4c0 | [
"Apache-2.0"
] | 7 | 2017-10-06T05:33:28.000Z | 2021-04-20T20:06:53.000Z | testICP.py | ctralie/SiRPyGL | e06c317ed60321d492725e39fd8fcc0ce56ff4c0 | [
"Apache-2.0"
] | null | null | null | testICP.py | ctralie/SiRPyGL | e06c317ed60321d492725e39fd8fcc0ce56ff4c0 | [
"Apache-2.0"
] | 4 | 2015-03-20T13:14:36.000Z | 2019-04-19T10:34:51.000Z | #Based off of http://wiki.wxpython.org/GLCanvas
#Lots of help from http://wiki.wxpython.org/Getting%20Started
from OpenGL.GL import *
import wx
from wx import glcanvas
from Primitives3D import *
from PolyMesh import *
from LaplacianMesh import *
from Geodesics import *
from PointCloud import *
from Cameras3D import *
... | 34.613793 | 131 | 0.724115 |
c675f480d0e79d688f118da048c11d0c6d98a1d1 | 7,480 | py | Python | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py | Azure/autorest.python | c36f5c1a2d614a1eeba6fec6a2c02517f2d1cce7 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py | Azure/autorest.python | c36f5c1a2d614a1eeba6fec6a2c02517f2d1cce7 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/v2/operations/_multiapi_service_client_operations.py | Azure/autorest.python | c36f5c1a2d614a1eeba6fec6a2c02517f2d1cce7 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 37.969543 | 133 | 0.662166 |
c7e30b4061a480bda57d9503998d9302087f0eeb | 26,319 | py | Python | poetry/core/utils/toml.py | bennylut/relaxed-poetry-core | 36cdd56503fe678dc168a13507fd3861db967f1f | [
"MIT"
] | null | null | null | poetry/core/utils/toml.py | bennylut/relaxed-poetry-core | 36cdd56503fe678dc168a13507fd3861db967f1f | [
"MIT"
] | null | null | null | poetry/core/utils/toml.py | bennylut/relaxed-poetry-core | 36cdd56503fe678dc168a13507fd3861db967f1f | [
"MIT"
] | null | null | null | import re
from copy import copy
from numbers import Number
from pathlib import Path
from typing import Optional, Dict, Any, Mapping, List, Tuple, Union, NoReturn, MutableMapping, Callable
from dataclasses import dataclass
_KEY_RX = re.compile(r'[a-zA-Z0-9\-_]+')
KEY_T = Tuple
DUMPS_T = Callable[[Dict[str, Any]], str]... | 33.65601 | 115 | 0.558684 |
d439a8f5296b2ee51b185c1268de00a631b88f9e | 2,903 | py | Python | translation.py | David-raj123/YouTube-DL-V2 | 3ade4acf5bc79751b531562bb6090ddf28c51460 | [
"MIT"
] | null | null | null | translation.py | David-raj123/YouTube-DL-V2 | 3ade4acf5bc79751b531562bb6090ddf28c51460 | [
"MIT"
] | null | null | null | translation.py | David-raj123/YouTube-DL-V2 | 3ade4acf5bc79751b531562bb6090ddf28c51460 | [
"MIT"
] | null | null | null | from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
class Translation(object):
START_TEXT = """
<b>Hai {} , I Am A YouTube DL Bot</b>
"""
HELP_TEXT = """
<b>⁍ Send Me A YouTube Link</b>
<b>⁍ Next Choose The Option Which You Want</b>
<b>⁍ I Will Upload The Media To Telegram</b>
<b>⁍ Send /sho... | 45.359375 | 140 | 0.64175 |
a0883e8bf63b76b7e3e9cedcc3e20d9721a952ad | 20,546 | py | Python | zproject/prod_settings_template.py | The-Interns/zulip | cf24a201856a1b2c73352af63ace588d9a6201de | [
"Apache-2.0"
] | 1 | 2019-10-16T20:33:37.000Z | 2019-10-16T20:33:37.000Z | zproject/prod_settings_template.py | The-Interns/zulip | cf24a201856a1b2c73352af63ace588d9a6201de | [
"Apache-2.0"
] | null | null | null | zproject/prod_settings_template.py | The-Interns/zulip | cf24a201856a1b2c73352af63ace588d9a6201de | [
"Apache-2.0"
] | 1 | 2019-04-09T12:18:15.000Z | 2019-04-09T12:18:15.000Z | from typing import Optional
################################################################
# Zulip Server settings.
#
# This file controls settings that affect the whole Zulip server.
# See our documentation at:
# https://zulip.readthedocs.io/en/latest/production/settings.html
#
# For developer documentation on th... | 41.34004 | 102 | 0.758006 |
fa3bf2e7b4e123c23819bd2b078ec9d30f7a5bec | 14,210 | py | Python | arancino/port/ArancinoSerialPort.py | smartmeio/arancino-daemon | 952b4d0d5ad99c21bb6e7f46e57dd48b0a4c6134 | [
"Apache-2.0"
] | 2 | 2021-05-26T10:00:23.000Z | 2021-10-13T08:01:40.000Z | arancino/port/ArancinoSerialPort.py | smartmeio/arancino-daemon | 952b4d0d5ad99c21bb6e7f46e57dd48b0a4c6134 | [
"Apache-2.0"
] | null | null | null | arancino/port/ArancinoSerialPort.py | smartmeio/arancino-daemon | 952b4d0d5ad99c21bb6e7f46e57dd48b0a4c6134 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
SPDX-license-identifier: Apache-2.0
Copyright (c) 2020 SmartMe.IO
Authors: Sergio Tomasello <sergio@smartme.io>
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.apac... | 36.435897 | 297 | 0.615482 |
56bd784438d65b98a72c3275edddd587a8697333 | 4,053 | py | Python | data_reader.py | maxifischer/pytorch-sgns | b802aa7ea241b62499bbb749465d5c5e42e06d0c | [
"MIT"
] | null | null | null | data_reader.py | maxifischer/pytorch-sgns | b802aa7ea241b62499bbb749465d5c5e42e06d0c | [
"MIT"
] | null | null | null | data_reader.py | maxifischer/pytorch-sgns | b802aa7ea241b62499bbb749465d5c5e42e06d0c | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torch.utils.data import Dataset
np.random.seed(12345)
class DataReader:
NEGATIVE_TABLE_SIZE = 1e8
def __init__(self, inputFileName, min_count):
self.negatives = []
self.discards = []
self.negpos = 0
self.word2id = dict() # word2idx
... | 36.513514 | 119 | 0.556625 |
dd2ce92a171089806ce6df53e5237240b022a212 | 4,891 | py | Python | tensorflow/python/debug/examples/v1/debug_tflearn_iris.py | zhupengyang/tensorflow | 584cd92f6a2ff3ba63e653e2e3d0c6f78e3d15eb | [
"Apache-2.0"
] | 2 | 2022-02-08T15:05:53.000Z | 2022-02-08T15:05:55.000Z | tensorflow/python/debug/examples/v1/debug_tflearn_iris.py | zhupengyang/tensorflow | 584cd92f6a2ff3ba63e653e2e3d0c6f78e3d15eb | [
"Apache-2.0"
] | 19 | 2021-12-28T12:44:55.000Z | 2022-01-13T08:11:28.000Z | tensorflow/python/debug/examples/v1/debug_tflearn_iris.py | zhupengyang/tensorflow | 584cd92f6a2ff3ba63e653e2e3d0c6f78e3d15eb | [
"Apache-2.0"
] | 1 | 2022-01-26T18:52:28.000Z | 2022-01-26T18:52:28.000Z | # 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 applica... | 33.272109 | 80 | 0.673277 |
25a38a29067fe14556e969044bca49efd75a8356 | 436 | py | Python | dashboard/tokens.py | HemanthJella/ewallet | cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a | [
"Apache-2.0"
] | null | null | null | dashboard/tokens.py | HemanthJella/ewallet | cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a | [
"Apache-2.0"
] | null | null | null | dashboard/tokens.py | HemanthJella/ewallet | cc7f9b5abb7aa552b8769b9324c3d79630e5ea6a | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils import six
class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
return (
six.text_type(user.pk) + six.text_type(timestamp) +
six.... | 33.538462 | 68 | 0.736239 |
d76a6201d90cf5d5dc96404b55b8ad137ed40e73 | 1,887 | py | Python | RQSSFramework/Security/TLSExistanceChecking.py | seyedahbr/RQSSFramework | fbd19cc1ad2dfa2538a3e1823b4d5420045d1980 | [
"CC0-1.0"
] | null | null | null | RQSSFramework/Security/TLSExistanceChecking.py | seyedahbr/RQSSFramework | fbd19cc1ad2dfa2538a3e1823b4d5420045d1980 | [
"CC0-1.0"
] | null | null | null | RQSSFramework/Security/TLSExistanceChecking.py | seyedahbr/RQSSFramework | fbd19cc1ad2dfa2538a3e1823b4d5420045d1980 | [
"CC0-1.0"
] | null | null | null | from typing import Iterator, List, NamedTuple
import requests
from rdflib import URIRef
class TLSExist(NamedTuple):
uri: URIRef
support: bool
def __repr__(self):
return "URI:{0:85}, TLS:{1}".format(self.uri, self.support)
class TLSChecker:
_uris = []
results: List[TLSExist] = None
... | 29.952381 | 97 | 0.567568 |
74cad6b2db97a02592c3d7c6158d69a4bf89cfb8 | 6,031 | py | Python | ePaperPython/epd7in5_V2.py | NickEngmann/rpi-magicmirror-eink | 9b2e2a5107be9e0255b18ed730897e9863a7fea0 | [
"MIT"
] | null | null | null | ePaperPython/epd7in5_V2.py | NickEngmann/rpi-magicmirror-eink | 9b2e2a5107be9e0255b18ed730897e9863a7fea0 | [
"MIT"
] | null | null | null | ePaperPython/epd7in5_V2.py | NickEngmann/rpi-magicmirror-eink | 9b2e2a5107be9e0255b18ed730897e9863a7fea0 | [
"MIT"
] | null | null | null | # *****************************************************************************
# * | File : epd7in5.py
# * | Author : Waveshare team
# * | Function : Electronic paper driver
# * | Info :
# *----------------
# * | This version: V4.0
# * | Date : 2019-06-20
# # | Info : py... | 35.269006 | 84 | 0.583817 |
4633da50b4f258fdb9b00b59a2081607e4814e14 | 347 | py | Python | code/src/system/controller/python/messaging/messages/ack.py | mcelhennyi/NXP-HoverGames-2 | 7826d153b870ff46952e7b2d3b6822960fed9c23 | [
"BSD-3-Clause"
] | 1 | 2020-08-30T16:25:53.000Z | 2020-08-30T16:25:53.000Z | code/src/system/controller/python/messaging/messages/ack.py | mcelhennyi/NXP-HoverGames-2 | 7826d153b870ff46952e7b2d3b6822960fed9c23 | [
"BSD-3-Clause"
] | 1 | 2021-02-02T00:36:07.000Z | 2021-02-02T00:36:07.000Z | code/src/system/controller/python/messaging/messages/ack.py | mcelhennyi/NXP-HoverGames-2 | 7826d153b870ff46952e7b2d3b6822960fed9c23 | [
"BSD-3-Clause"
] | null | null | null | import struct
from src.system.controller.python.messaging.messages import Message, ack
class AckMessage(Message):
def __init__(self, raw_bytes):
Message.__init__(self, raw_bytes)
# Parse this message
self._ack_tuple = self.unpack(ack)
def get_acked_message_timestamp(self):
r... | 23.133333 | 72 | 0.714697 |
229faf85310fd82aa170759849f2159296982825 | 3,257 | py | Python | telegram_notifier.py | romanlegeza/chia-hpool-checker | 3a7dafe8ede8cff4c89a4a2d416e97bc0e36a76f | [
"Apache-2.0"
] | 10 | 2021-02-01T21:48:12.000Z | 2022-03-25T09:59:30.000Z | telegram_notifier.py | romanlegeza/chia-hpool-checker | 3a7dafe8ede8cff4c89a4a2d416e97bc0e36a76f | [
"Apache-2.0"
] | null | null | null | telegram_notifier.py | romanlegeza/chia-hpool-checker | 3a7dafe8ede8cff4c89a4a2d416e97bc0e36a76f | [
"Apache-2.0"
] | 2 | 2021-05-04T12:25:07.000Z | 2021-05-31T22:11:01.000Z | # Copyright 2019 Gabriele Valvano
#
# 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... | 35.021505 | 114 | 0.69082 |
4eb52fa10acc311d9b075174c67308167eca9955 | 6,644 | py | Python | search.py | perrytsao/leopart | 106aecafa140098151f7ca56ed8f11b21ecff5bc | [
"MIT"
] | 3 | 2020-02-01T13:20:28.000Z | 2020-02-05T16:24:00.000Z | search.py | perrytsao/leopart | 106aecafa140098151f7ca56ed8f11b21ecff5bc | [
"MIT"
] | 6 | 2020-02-01T15:58:43.000Z | 2020-02-07T13:11:22.000Z | search.py | perrytsao/leopart | 106aecafa140098151f7ca56ed8f11b21ecff5bc | [
"MIT"
] | 1 | 2020-02-09T16:49:32.000Z | 2020-02-09T16:49:32.000Z | import json
from models.items import Item
from models.files import File
from models.repos import Repo
from models.base import Base
from models.part import Part
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import os.path
# Init SQLAlchemy
engine = create_engine('sqlite:///./database/pars... | 29.0131 | 105 | 0.552529 |
a8e92779935c13faae8293404567f0278d30ae7e | 138 | py | Python | scripts/reactor/autogen_ludiquest2.py | hsienjan/SideQuest-Server | 3e88debaf45615b759d999255908f99a15283695 | [
"MIT"
] | null | null | null | scripts/reactor/autogen_ludiquest2.py | hsienjan/SideQuest-Server | 3e88debaf45615b759d999255908f99a15283695 | [
"MIT"
] | null | null | null | scripts/reactor/autogen_ludiquest2.py | hsienjan/SideQuest-Server | 3e88debaf45615b759d999255908f99a15283695 | [
"MIT"
] | null | null | null | # ParentID: 2202002
# Character field ID when accessed: 220020000
# ObjectID: 1000016
# Object Position X: -228
# Object Position Y: -198
| 23 | 45 | 0.746377 |
88e356e3e7bdabad53d5fa60611350730ef17fd6 | 5,414 | py | Python | Wrappers/Python/test/test_DataProcessor.py | KrisThielemans/CCPi-Framework | fed2e86a65fa67aa89d0a690438bf76f4828266e | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_DataProcessor.py | KrisThielemans/CCPi-Framework | fed2e86a65fa67aa89d0a690438bf76f4828266e | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_DataProcessor.py | KrisThielemans/CCPi-Framework | fed2e86a65fa67aa89d0a690438bf76f4828266e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL).
# Copyright 2017 UKRI-STFC
# Copyright 2017 University of Manchester
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 36.093333 | 107 | 0.602143 |
749f77fa5e878ad4136c94032a39ba03f965c0ba | 1,581 | py | Python | setup.py | gabrielmacedoanac/kgextension | 0551ca278bc3de5c39baf663467be3220ad20edd | [
"MIT"
] | 67 | 2021-01-17T20:12:44.000Z | 2022-03-07T06:57:01.000Z | setup.py | gabrielmacedoanac/kgextension | 0551ca278bc3de5c39baf663467be3220ad20edd | [
"MIT"
] | null | null | null | setup.py | gabrielmacedoanac/kgextension | 0551ca278bc3de5c39baf663467be3220ad20edd | [
"MIT"
] | 3 | 2021-04-17T09:19:31.000Z | 2021-10-03T21:29:56.000Z | import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.rst").read_text()
# This call to setup() does all the work
setup(
name="kgextension",
version="0.1.1",
description="The kgextension ... | 29.830189 | 107 | 0.607211 |
f20c480ce9f879fd60e30050b2864f93a2dae19d | 39,623 | py | Python | build/plugins/ytest.py | mikiec84/catboost | d16aa349ba7af265b053967b1938917fbddbca9d | [
"Apache-2.0"
] | null | null | null | build/plugins/ytest.py | mikiec84/catboost | d16aa349ba7af265b053967b1938917fbddbca9d | [
"Apache-2.0"
] | null | null | null | build/plugins/ytest.py | mikiec84/catboost | d16aa349ba7af265b053967b1938917fbddbca9d | [
"Apache-2.0"
] | null | null | null | import os
import re
import sys
import json
import copy
import base64
import shlex
import _common
import _metric_resolvers as mr
import _test_const as consts
import _requirements as reqs
import StringIO
import subprocess
import collections
import ymake
MDS_URI_PREFIX = 'https://storage.yandex-team.ru/get-devtools/'
M... | 41.840549 | 251 | 0.63188 |
71e0ed05441baed5707c7f6a8eec3424fe035107 | 4,901 | py | Python | src/encode_bam2ta.py | gurkanbebek/atac-seq-pipeline | 6ec6800cbf2ecaa7155cc28391504155477088c1 | [
"MIT"
] | 1 | 2018-06-05T02:28:43.000Z | 2018-06-05T02:28:43.000Z | src/encode_bam2ta.py | gurkanbebek/atac-seq-pipeline | 6ec6800cbf2ecaa7155cc28391504155477088c1 | [
"MIT"
] | null | null | null | src/encode_bam2ta.py | gurkanbebek/atac-seq-pipeline | 6ec6800cbf2ecaa7155cc28391504155477088c1 | [
"MIT"
] | 1 | 2019-05-13T17:17:46.000Z | 2019-05-13T17:17:46.000Z | #!/usr/bin/env python
# ENCODE DCC BAM 2 TAGALIGN wrapper
# Author: Jin Lee (leepc12@gmail.com)
import sys
import os
import argparse
from encode_common_genomic import *
def parse_arguments():
parser = argparse.ArgumentParser(prog='ENCODE DCC BAM 2 TAGALIGN.',
description='... | 32.456954 | 71 | 0.561518 |
b498e9eb35ac8e12797c64aa4f2254ab504c94dd | 12,178 | py | Python | daphneplus/server.py | humptydumptyeiz/daphneplus | fe8a75f15baa446261bd90e947ee259098b419da | [
"BSD-3-Clause"
] | null | null | null | daphneplus/server.py | humptydumptyeiz/daphneplus | fe8a75f15baa446261bd90e947ee259098b419da | [
"BSD-3-Clause"
] | null | null | null | daphneplus/server.py | humptydumptyeiz/daphneplus | fe8a75f15baa446261bd90e947ee259098b419da | [
"BSD-3-Clause"
] | null | null | null | # This has to be done first as Twisted is import-order-sensitive with reactors
import sys # isort:skip
import warnings # isort:skip
from twisted.internet import asyncioreactor # isort:skip
current_reactor = sys.modules.get("twisted.internet.reactor", None)
if current_reactor is not None:
if not isinstance(curre... | 40.324503 | 111 | 0.61997 |
87c9bf0e368c27839a4c8697ab5ec0a77c830054 | 68 | py | Python | Latest/venv/Lib/site-packages/pyface/ui/qt4/timer/__init__.py | adamcvj/SatelliteTracker | 49a8f26804422fdad6f330a5548e9f283d84a55d | [
"Apache-2.0"
] | 1 | 2022-01-09T20:04:31.000Z | 2022-01-09T20:04:31.000Z | Latest/venv/Lib/site-packages/pyface/ui/qt4/wizard/__init__.py | adamcvj/SatelliteTracker | 49a8f26804422fdad6f330a5548e9f283d84a55d | [
"Apache-2.0"
] | 1 | 2022-02-15T12:01:57.000Z | 2022-03-24T19:48:47.000Z | Latest/venv/Lib/site-packages/pyface/ui/qt4/workbench/__init__.py | adamcvj/SatelliteTracker | 49a8f26804422fdad6f330a5548e9f283d84a55d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2007-2011 by Enthought, Inc.
# All rights reserved.
| 22.666667 | 44 | 0.720588 |
c2af723ccdf922de497fa6ac33956fc959ebc138 | 1,654 | py | Python | convergence.py | Yatharth9607/lid_driven_cavity_python | dd7cee80607eceebc314894ff4428155facea941 | [
"MIT"
] | null | null | null | convergence.py | Yatharth9607/lid_driven_cavity_python | dd7cee80607eceebc314894ff4428155facea941 | [
"MIT"
] | null | null | null | convergence.py | Yatharth9607/lid_driven_cavity_python | dd7cee80607eceebc314894ff4428155facea941 | [
"MIT"
] | null | null | null | # residuals calculation function
import numpy as np
def convergence(u_vel, u_coeff, v_vel, v_coeff, pressure, u_ref, dx, dy, rho, L):
Ap_u = u_coeff[0]
Aw_u = u_coeff[1]
Ae_u = u_coeff[2]
As_u = u_coeff[3]
An_u = u_coeff[4]
Ap_v = v_coeff[0]
Aw_v = v_coeff[1]
Ae_v = v_coeff[2]
As_... | 31.807692 | 81 | 0.562273 |
c541b7d4859400457c6a97f92e8dedebc5feb597 | 2,404 | gyp | Python | node_modules/multi-hashing/binding.gyp | MerlinMagic2018/zny-nomp | 968f1be3bf55fd522dbe4a538dde081b87847ba3 | [
"MIT"
] | null | null | null | node_modules/multi-hashing/binding.gyp | MerlinMagic2018/zny-nomp | 968f1be3bf55fd522dbe4a538dde081b87847ba3 | [
"MIT"
] | 1 | 2020-05-01T04:09:52.000Z | 2020-05-01T04:09:52.000Z | node_modules/multi-hashing/binding.gyp | lightningcashgold/zny-nomp | dc0f55eb91ac83c5d61276e8eb9b24b2bdf2b072 | [
"MIT"
] | 3 | 2019-12-27T10:46:59.000Z | 2021-06-25T00:57:17.000Z | {
"targets": [
{
"target_name": "multihashing",
"sources": [
"multihashing.cc",
"scryptjane.c",
"scryptn.c",
"yespower/yespower-opt.c",
"yespower/yespower.c",
"yescrypt/sha256_Y.c",
"yescrypt/yescrypt... | 29.317073 | 49 | 0.363977 |
b734e9c42da3411c91146d93dcfa96701516dc7c | 1,234 | py | Python | mdjango/visualization/management/commands/save_chart.py | Nove-Scrope/mova_project | 7382bda6f61ad0c8e4293ac31b0e7c72f49962d2 | [
"MIT"
] | null | null | null | mdjango/visualization/management/commands/save_chart.py | Nove-Scrope/mova_project | 7382bda6f61ad0c8e4293ac31b0e7c72f49962d2 | [
"MIT"
] | null | null | null | mdjango/visualization/management/commands/save_chart.py | Nove-Scrope/mova_project | 7382bda6f61ad0c8e4293ac31b0e7c72f49962d2 | [
"MIT"
] | 1 | 2018-12-28T05:54:00.000Z | 2018-12-28T05:54:00.000Z | # save_chart.py -- 一个文件复制脚本
# 原先采用的数据报表方案是前端在命令行中执行该脚本,将生成的图表文件复制到指定文件夹中
# 后面采用将图表写入pdf文件的方法
# 原方案被废弃,脚本也失去了意义
from django.core.management.base import BaseCommand
import shutil
import os
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument('func-selected', nargs='+',... | 35.257143 | 81 | 0.599676 |
4ae9092d5a70dd4d47ba838020a6337d8ed744ab | 50,872 | py | Python | var/spack/repos/builtin/packages/python/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-10-22T00:14:43.000Z | 2020-10-22T00:14:43.000Z | var/spack/repos/builtin/packages/python/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 14 | 2021-07-20T01:04:53.000Z | 2022-03-02T01:08:36.000Z | var/spack/repos/builtin/packages/python/package.py | jonglezb/spack | ebc871abbf8f082000617e1798c75260652f0770 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-05-06T00:17:46.000Z | 2021-05-06T00:17:46.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import ast
import os
import platform
import re
import llnl.util.tty as tty
from llnl.util.lang import match_predicate
fro... | 43.968885 | 112 | 0.606345 |
0427ad14356facad993ea5a00cfb0c5fc221df10 | 1,947 | py | Python | cogdl/utils/evaluator.py | Shiguang-Guo/cogdl | b43a2ca5518180dbe7d24e27711efa7d7a6f2610 | [
"MIT"
] | 2 | 2021-06-25T08:18:36.000Z | 2021-06-25T08:51:00.000Z | cogdl/utils/evaluator.py | sofyc/cogdl | 1dec0dddf9e2103f578ad2170cedc12ee76769f6 | [
"MIT"
] | null | null | null | cogdl/utils/evaluator.py | sofyc/cogdl | 1dec0dddf9e2103f578ad2170cedc12ee76769f6 | [
"MIT"
] | null | null | null | import torch
from sklearn.metrics import f1_score
# def multilabel_f1(y_pred, y_true, sigmoid=False):
# if sigmoid:
# y_pred[y_pred > 0.5] = 1
# y_pred[y_pred <= 0.5] = 0
# else:
# y_pred[y_pred > 0] = 1
# y_pred[y_pred <= 0] = 0
# preds = y_pred.cpu().detach()
# labels... | 29.953846 | 74 | 0.613251 |
7e6463e4b27c8963c49b8c3a7e365117b333e531 | 6,256 | py | Python | sdk/python/pulumi_azure_nextgen/apimanagement/v20191201/api_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/apimanagement/v20191201/api_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/apimanagement/v20191201/api_policy.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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... | 45.007194 | 629 | 0.646739 |
3b1edd81ead928c9cf95461cef3046f7b2f7d964 | 4,020 | py | Python | neon/hyperopt/gen_yaml_and_run.py | tambetm/neon | 1597082ad0bab59102f1ceb20feb08c5a0bf9d04 | [
"Apache-2.0"
] | 3 | 2017-02-02T05:20:48.000Z | 2021-07-07T16:50:41.000Z | neon/hyperopt/gen_yaml_and_run.py | tambetm/neon | 1597082ad0bab59102f1ceb20feb08c5a0bf9d04 | [
"Apache-2.0"
] | null | null | null | neon/hyperopt/gen_yaml_and_run.py | tambetm/neon | 1597082ad0bab59102f1ceb20feb08c5a0bf9d04 | [
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright 2014 Nervana Systems 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.o... | 35.263158 | 79 | 0.63806 |
6e2b9e8e1503d2d6058ddd118f2bf251fe5cfe4c | 107 | py | Python | python/triangulo.py | TheDojoMX/BasicProgramming | 6a322054da6d7b8bb2751b2aa6d7770ed4c631ab | [
"MIT"
] | null | null | null | python/triangulo.py | TheDojoMX/BasicProgramming | 6a322054da6d7b8bb2751b2aa6d7770ed4c631ab | [
"MIT"
] | null | null | null | python/triangulo.py | TheDojoMX/BasicProgramming | 6a322054da6d7b8bb2751b2aa6d7770ed4c631ab | [
"MIT"
] | null | null | null | def piramide(n, c):
for i in range(1, n + 1):
print(c * i)
piramide(10, "🐱")
piramide(10, "⌛") | 17.833333 | 29 | 0.504673 |
cb57c2a4b07987e9011672692ced1ff1c05a476b | 78,775 | py | Python | venv/lib/python3.8/site-packages/plotly/graph_objs/layout/_scene.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 10 | 2021-05-31T07:18:08.000Z | 2022-03-19T09:20:11.000Z | venv/lib/python3.8/site-packages/plotly/graph_objs/layout/_scene.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 1 | 2021-08-03T12:23:01.000Z | 2021-08-10T08:35:22.000Z | venv/lib/python3.8/site-packages/plotly/graph_objs/layout/_scene.py | SvtFilatov/soccer-predict-prices | b003ebd7c3657688790183ef7d719c42290c11b9 | [
"MIT"
] | 3 | 2021-01-31T16:40:52.000Z | 2021-08-29T18:32:34.000Z | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Scene(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.scene"
_valid_props = {
"annotationdefaults",
... | 46.256606 | 85 | 0.511838 |
07a242d3ad1c1f59a4044560747a81ffea63ccdc | 5,030 | py | Python | rfvis/__main__.py | birnbaum/rfvis | ebc31603d6f94aa4a5ecc4be4448906fd2e24cae | [
"MIT"
] | 19 | 2018-12-14T12:31:08.000Z | 2021-10-24T23:57:57.000Z | rfvis/__main__.py | birnbaum/random-forest-visualization | ebc31603d6f94aa4a5ecc4be4448906fd2e24cae | [
"MIT"
] | 2 | 2018-05-29T12:52:19.000Z | 2018-05-29T12:53:59.000Z | rfvis/__main__.py | birnbaum/random-forest-visualization | ebc31603d6f94aa4a5ecc4be4448906fd2e24cae | [
"MIT"
] | 4 | 2019-04-12T18:12:10.000Z | 2021-10-24T23:58:00.000Z | import json
import os
import tarfile
import tempfile
import click
from click import ClickException
from rfvis import __version__, start_server
@click.group(context_settings=dict(max_content_width=90))
@click.version_option(__version__)
def main():
"""A tool for visualizing the structure and performance of Rando... | 40.894309 | 119 | 0.655268 |
369d4709a27900f2d8343a6a6b25eba1d63a9fc0 | 11,792 | py | Python | guppy/heapy/OutputHandling.py | odidev/guppy3 | d51838c57220ec80e4f8bb43ae0d325d6438e788 | [
"MIT"
] | 251 | 2019-08-18T17:19:19.000Z | 2022-03-31T20:38:20.000Z | guppy/heapy/OutputHandling.py | odidev/guppy3 | d51838c57220ec80e4f8bb43ae0d325d6438e788 | [
"MIT"
] | 37 | 2019-09-05T08:03:00.000Z | 2022-01-27T12:49:50.000Z | guppy/heapy/OutputHandling.py | odidev/guppy3 | d51838c57220ec80e4f8bb43ae0d325d6438e788 | [
"MIT"
] | 20 | 2019-09-01T15:29:56.000Z | 2022-01-27T03:03:18.000Z | import types
import weakref
# To restore the old-style class behavior that __getattr__ also affects special
# methods.
class _AttrProxy:
_oh_proxied_classes = weakref.WeakSet({type, object})
# Don'r rely on _oh_add_proxy_attr to prime us, some clients use
# setup_printing to setup __repr__ function.
... | 29.853165 | 97 | 0.567334 |
b3ded495c01d595c12cf8f8408742e82bd3cb01d | 4,009 | py | Python | model/multiscale_HSD.py | Sngunfei/graph-embedding | 34308d7f4be03bd8610058d6b4896616c750e36d | [
"MIT"
] | null | null | null | model/multiscale_HSD.py | Sngunfei/graph-embedding | 34308d7f4be03bd8610058d6b4896616c750e36d | [
"MIT"
] | null | null | null | model/multiscale_HSD.py | Sngunfei/graph-embedding | 34308d7f4be03bd8610058d6b4896616c750e36d | [
"MIT"
] | 1 | 2020-09-27T02:23:12.000Z | 2020-09-27T02:23:12.000Z | # -*- encoding: utf-8 -*-
# Multi-scales HSD implementataion
import multiprocessing
from collections import defaultdict
import networkx as nx
import numpy as np
import pygsp
from tqdm import tqdm
from model import HSD
from tools import hierarchy
class MultiHSD(HSD):
def __init__(self, graph: nx.Graph, graphNam... | 33.408333 | 101 | 0.595909 |
0b3d6a353c68d9c55b49e0dcc8ab1ef9924ac383 | 3,841 | py | Python | osrc/process.py | pcurry/osrc | eb6c9c78de3c98258efbcc9c6b91f0b0bdfe676d | [
"MIT"
] | 1 | 2015-11-21T22:52:56.000Z | 2015-11-21T22:52:56.000Z | osrc/process.py | defconcepts/osrc | eb6c9c78de3c98258efbcc9c6b91f0b0bdfe676d | [
"MIT"
] | null | null | null | osrc/process.py | defconcepts/osrc | eb6c9c78de3c98258efbcc9c6b91f0b0bdfe676d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__all__ = ["parse_datetime", "process_repo", "process_user"]
from datetime import datetime
from . import google
from .models import db, Language, User, Repo
def parse_datetime(dt, fmt="%Y-%m-%dT%H:%M:%SZ"):
return datetime.strptime(dt, fmt) if dt is not None else None
def process_repo... | 33.4 | 79 | 0.579537 |
8957d70e6c08fa44044b9a97c8faf3de693e0964 | 32,050 | py | Python | python_modules/dagster/dagster/grpc/__generated__/api_pb2_grpc.py | marksteve/dagster | 9727252f739b5974866bb373605b5b2b72169a62 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/grpc/__generated__/api_pb2_grpc.py | marksteve/dagster | 9727252f739b5974866bb373605b5b2b72169a62 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/grpc/__generated__/api_pb2_grpc.py | marksteve/dagster | 9727252f739b5974866bb373605b5b2b72169a62 | [
"Apache-2.0"
] | null | null | null | # @generated
# This file was generated by running `python -m dagster.grpc.compile`
# Do not edit this file directly, and do not attempt to recompile it using
# grpc_tools.protoc directly, as several changes must be made to the raw output
# pylint: disable=no-member, unused-argument
# Generated by the gRPC Python pro... | 35.770089 | 101 | 0.644618 |
87e8e18f33b00c8adc5ec86f9b1584ef0bcfe202 | 884 | py | Python | jdcloud_sdk/services/vm/models/Ag.py | lidaobing/jdcloud-sdk-python | f305e8ddd74ab4ad445477744534e7299d4d93fb | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/vm/models/Ag.py | lidaobing/jdcloud-sdk-python | f305e8ddd74ab4ad445477744534e7299d4d93fb | [
"Apache-2.0"
] | null | null | null | jdcloud_sdk/services/vm/models/Ag.py | lidaobing/jdcloud-sdk-python | f305e8ddd74ab4ad445477744534e7299d4d93fb | [
"Apache-2.0"
] | 1 | 2019-03-01T08:44:37.000Z | 2019-03-01T08:44:37.000Z | # coding=utf8
# Copyright 2018-2025 JDCLOUD.COM
#
# 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 agr... | 29.466667 | 75 | 0.700226 |
87b1f08c14229b28365fb8c2af7bb9a2ac2fa3f2 | 2,374 | py | Python | tests/core/test_edge.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-10T14:32:32.000Z | 2020-05-10T14:32:32.000Z | tests/core/test_edge.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/core/test_edge.py | louisditzel/prefect | b1a02fee623b965e756a38aa09059db780ab67eb | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import pytest
import prefect
from prefect.core import Edge, Flow, Task
class TaskWithKey(Task):
def run(self, a_key):
return a_key
def test_edge_key_must_be_valid():
assert Edge(Task(), Task(), key=None)
assert Edge(Task(), Task(), key="test")
assert Edge(Task(), Task(), key="test_underscor... | 25.526882 | 87 | 0.60952 |
a6fb6eda46139a8bff73e426bb636b46766c5919 | 1,236 | py | Python | notebook/notebook_utils/OpenKbcMSCalculator.py | kicheolkim/multiple_sclerosis_proj | f69f4773d67a3f61d5e909aaa9849b0c5c9672e4 | [
"MIT"
] | 9 | 2021-09-04T06:19:56.000Z | 2022-01-25T23:25:58.000Z | notebook/notebook_utils/OpenKbcMSCalculator.py | kicheolkim/multiple_sclerosis_proj | f69f4773d67a3f61d5e909aaa9849b0c5c9672e4 | [
"MIT"
] | 33 | 2021-09-04T06:12:11.000Z | 2022-01-29T01:43:12.000Z | notebook/notebook_utils/OpenKbcMSCalculator.py | kicheolkim/multiple_sclerosis_proj | f69f4773d67a3f61d5e909aaa9849b0c5c9672e4 | [
"MIT"
] | 1 | 2021-09-08T00:07:45.000Z | 2021-09-08T00:07:45.000Z | from notebook_lib.nwpv.nwpv import nwpv_calculation
from notebook_lib.gene_zscore.threaded_gzscore import calculator as gzscore_class
class AdvancedCalculators(object):
def nwpv_calculator(self, test : list, contol : list, data, save : bool = True):
"""
NWPV calculator
Input
test : ... | 30.9 | 84 | 0.614078 |
d72a28fc1a1c69c6a71d5e963e3620957bd51386 | 94 | py | Python | 14-measure_temp/system_temp.py | raspberrypi-tw/gpio-game-console | 5319addec034dae72bf829e5873626b00b69e3d5 | [
"BSD-3-Clause"
] | 13 | 2016-04-17T07:23:38.000Z | 2021-04-20T04:54:26.000Z | 14-measure_temp/system_temp.py | PhoniExZoe/gpio-game-console | d229dcb4cf66324ac7597794680b174f5751e09c | [
"BSD-3-Clause"
] | null | null | null | 14-measure_temp/system_temp.py | PhoniExZoe/gpio-game-console | d229dcb4cf66324ac7597794680b174f5751e09c | [
"BSD-3-Clause"
] | 16 | 2016-05-05T04:33:06.000Z | 2021-04-23T05:42:08.000Z | #!/usr/bin/python3
import os
os.system("vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*'")
| 15.666667 | 62 | 0.62766 |
2c3b3cf20f16a1deed5f1482bef2a13fa191c644 | 1,764 | py | Python | wflow-py/UnitTests/TestFrameWork.py | edwinkost/wflow | ee9291d4b556d7b61f7f13bcb972774be9a16cec | [
"MIT"
] | null | null | null | wflow-py/UnitTests/TestFrameWork.py | edwinkost/wflow | ee9291d4b556d7b61f7f13bcb972774be9a16cec | [
"MIT"
] | null | null | null | wflow-py/UnitTests/TestFrameWork.py | edwinkost/wflow | ee9291d4b556d7b61f7f13bcb972774be9a16cec | [
"MIT"
] | null | null | null | __author__ = 'schelle'
import unittest
import wflow.wflow_sceleton as wf
import os
"""
Run sceleton for 10 steps and checks if the outcome is approx that of the reference run
"""
class MyTest(unittest.TestCase):
def testapirun(self):
startTime = 1
stopTime = 20
currentTime =... | 36 | 101 | 0.661565 |
9ece622bbacb0239fab42a05755f055566409812 | 11,593 | py | Python | routes.py | ping58972/tordle | ecda38ea7b8e59be0c64865166b2638072baa3b7 | [
"MIT"
] | null | null | null | routes.py | ping58972/tordle | ecda38ea7b8e59be0c64865166b2638072baa3b7 | [
"MIT"
] | 2 | 2022-02-23T06:40:17.000Z | 2022-03-10T07:42:28.000Z | routes.py | ping58972/tordle | ecda38ea7b8e59be0c64865166b2638072baa3b7 | [
"MIT"
] | null | null | null | """Author: Nalongsone Danddank, Final Project, begin on Feb 2 2022, end on April 27, 2022, ICS499 METRO STATE """
from helper import *
params = {
"length": 5,
"attempt": 6,
"language": "English",
"url": "url_for('home')",
"statics": {"numAttempts": 0, "percentWin": 0, "WinStreak": 0, "bestStreak": ... | 32.292479 | 113 | 0.640818 |
90f156192866ea5ca5d1f518a636cda63342769a | 283 | py | Python | django-model-sync/migrations/0012_migrate_orders.py | 3YOURMIND/django-model-sync | 5161beda92e5fc78677c9b6b86532323e953d5ea | [
"Apache-2.0"
] | 2 | 2019-11-11T21:14:03.000Z | 2020-07-02T18:32:47.000Z | django-model-sync/migrations/0012_migrate_orders.py | 3YOURMIND/django-model-sync | 5161beda92e5fc78677c9b6b86532323e953d5ea | [
"Apache-2.0"
] | null | null | null | django-model-sync/migrations/0012_migrate_orders.py | 3YOURMIND/django-model-sync | 5161beda92e5fc78677c9b6b86532323e953d5ea | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-09-06 09:22
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('b3_migration', '0011_orderbuddy'),
]
operations = []
| 18.866667 | 49 | 0.678445 |
3498ddd7f6fa62b35c300f11897a53de37f2e932 | 708 | py | Python | corkus/endpoints/search.py | MrBartusek/corkus.py | 031c11e3e251f0bddbcb67415564357460fe7fea | [
"MIT"
] | 5 | 2021-09-10T14:20:15.000Z | 2022-01-09T11:27:49.000Z | corkus/endpoints/search.py | MrBartusek/corkus.py | 031c11e3e251f0bddbcb67415564357460fe7fea | [
"MIT"
] | 11 | 2021-08-15T09:39:09.000Z | 2022-01-12T14:11:24.000Z | corkus/endpoints/search.py | MrBartusek/corkus.py | 031c11e3e251f0bddbcb67415564357460fe7fea | [
"MIT"
] | 2 | 2021-12-01T23:33:14.000Z | 2022-01-12T11:08:18.000Z | from __future__ import annotations
from typing import Optional
from .endpoint import Endpoint
from corkus.utils.request import APIVersion
from corkus.objects import SearchResult
class SearchEndpoint(Endpoint):
async def guilds_and_players(self, term: str, timeout: Optional[int] = None) -> SearchResult:
""... | 33.714286 | 97 | 0.686441 |
62966b4775db8ab6ecb0863c857e66f2132c2d2f | 7,317 | py | Python | selia_maps/templatetags/selia_maps.py | CONABIO-audio/selia-maps | 0238945f9ce7f18ad1a3a54c3a02f5f87bb806fa | [
"BSD-4-Clause"
] | null | null | null | selia_maps/templatetags/selia_maps.py | CONABIO-audio/selia-maps | 0238945f9ce7f18ad1a3a54c3a02f5f87bb806fa | [
"BSD-4-Clause"
] | null | null | null | selia_maps/templatetags/selia_maps.py | CONABIO-audio/selia-maps | 0238945f9ce7f18ad1a3a54c3a02f5f87bb806fa | [
"BSD-4-Clause"
] | null | null | null | from uuid import uuid4
import json
from django import template
from django.conf import settings
from django.utils.translation import gettext as _
from django.templatetags.static import static
from irekua_database.models import SamplingEvent
from irekua_database.models import SamplingEventDevice
from selia_maps.utils... | 28.920949 | 94 | 0.643023 |
86ec5e8bd4d9580373e1382816f7ad1000a76b44 | 2,797 | py | Python | selfdrive/car/subaru/subarucan.py | aolin480/openpilot | 9ac00c3e5e111a05a0bb10018ccd190571dfff4d | [
"MIT"
] | 37,508 | 2016-11-30T18:18:49.000Z | 2022-03-31T23:52:00.000Z | selfdrive/car/subaru/subarucan.py | aolin480/openpilot | 9ac00c3e5e111a05a0bb10018ccd190571dfff4d | [
"MIT"
] | 3,719 | 2016-11-30T19:25:03.000Z | 2022-03-31T22:03:56.000Z | selfdrive/car/subaru/subarucan.py | aolin480/openpilot | 9ac00c3e5e111a05a0bb10018ccd190571dfff4d | [
"MIT"
] | 7,859 | 2016-11-30T19:03:05.000Z | 2022-03-31T22:56:37.000Z | import copy
from cereal import car
VisualAlert = car.CarControl.HUDControl.VisualAlert
def create_steering_control(packer, apply_steer, frame, steer_step):
idx = (frame / steer_step) % 16
values = {
"Counter": idx,
"LKAS_Output": apply_steer,
"LKAS_Request": 1 if apply_steer != 0 else 0,
"SET_1"... | 30.736264 | 123 | 0.725778 |
4bd9bb93060b148c4d5c2426dd0d9a9daf35d84a | 137 | py | Python | kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/__about__.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/__about__.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | kube_apiserver_metrics/datadog_checks/kube_apiserver_metrics/__about__.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__version__ = '1.2.3'
| 27.4 | 59 | 0.722628 |
352c11aadec36d042a64e68eae14ff7b342bf847 | 1,140 | py | Python | Lib/test/test_wait4.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 1,872 | 2015-01-02T18:56:47.000Z | 2022-03-31T07:34:39.000Z | Lib/test/test_wait4.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 675 | 2015-02-27T09:01:01.000Z | 2022-03-31T14:03:25.000Z | Lib/test/test_wait4.py | inging44/python3 | fcd8d9d2ee54b46b757ecf34f284b4e60a43097a | [
"bzip2-1.0.6"
] | 278 | 2015-01-02T03:48:20.000Z | 2022-03-29T20:40:44.000Z | """This test checks for correct wait4() behavior.
"""
import os
import time
import sys
from test.fork_wait import ForkWait
from test.support import run_unittest, reap_children, get_attribute
# If either of these do not exist, skip this test.
get_attribute(os, 'fork')
get_attribute(os, 'wait4')
class Wait4Test(ForkW... | 29.230769 | 87 | 0.624561 |
b48693303c63093f7b1227537cc71eacc7214541 | 9,769 | py | Python | fabfile.py | eigener-server/fabric-server | b44d9a03a49f344119a35020219f5dd351e3f58d | [
"CC-BY-4.0"
] | null | null | null | fabfile.py | eigener-server/fabric-server | b44d9a03a49f344119a35020219f5dd351e3f58d | [
"CC-BY-4.0"
] | null | null | null | fabfile.py | eigener-server/fabric-server | b44d9a03a49f344119a35020219f5dd351e3f58d | [
"CC-BY-4.0"
] | null | null | null | import os
from fabric.api import sudo, local, run, cd, settings
from fabric.contrib.files import exists, sed, append, uncomment, comment, contains
from fabric.operations import put
from fabric.state import env
from fabric.context_managers import shell_env
new_user = 'demo'
new_user_password = 'gdgwdbchwenZZGSZW67689'
... | 48.123153 | 158 | 0.67878 |
5c513e76d1e08dabeff138db6a19f5c1fd64ab9f | 442,685 | py | Python | pyboto3/waf.py | gehad-shaat/pyboto3 | 4a0c2851a8bc04fb1c71c36086f7bb257e48181d | [
"MIT"
] | 91 | 2016-12-31T11:38:37.000Z | 2021-09-16T19:33:23.000Z | pyboto3/waf.py | gehad-shaat/pyboto3 | 4a0c2851a8bc04fb1c71c36086f7bb257e48181d | [
"MIT"
] | 7 | 2017-01-02T18:54:23.000Z | 2020-08-11T13:54:02.000Z | pyboto3/waf.py | gehad-shaat/pyboto3 | 4a0c2851a8bc04fb1c71c36086f7bb257e48181d | [
"MIT"
] | 26 | 2016-12-31T13:11:00.000Z | 2022-03-03T21:01:12.000Z | '''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
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, copy, modify, merge, p... | 45.760285 | 9,656 | 0.720661 |
0731a2ad030f064c183e5142f4f10e16c3b206e5 | 680 | py | Python | element/migrations/0005_auto_20200922_2034.py | FranchuFranchu/py-elemental | 7679815c8f8b8df5095c0c26c610179aa05d4ea0 | [
"MIT"
] | null | null | null | element/migrations/0005_auto_20200922_2034.py | FranchuFranchu/py-elemental | 7679815c8f8b8df5095c0c26c610179aa05d4ea0 | [
"MIT"
] | null | null | null | element/migrations/0005_auto_20200922_2034.py | FranchuFranchu/py-elemental | 7679815c8f8b8df5095c0c26c610179aa05d4ea0 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-09-22 20:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('element', '0004_auto_20200908_2242'),
]
operations = [
migrations.RemoveField(
model_name='suggestion',
name='ingred... | 23.448276 | 47 | 0.555882 |
1debd8d5bb7f5769e09273b71c9ee008558535c8 | 47,896 | py | Python | crypten/mpc/mpc.py | gmuraru/CrypTen | e39a7aaf65436706321fe4e3fc055308c78b6b92 | [
"MIT"
] | null | null | null | crypten/mpc/mpc.py | gmuraru/CrypTen | e39a7aaf65436706321fe4e3fc055308c78b6b92 | [
"MIT"
] | null | null | null | crypten/mpc/mpc.py | gmuraru/CrypTen | e39a7aaf65436706321fe4e3fc055308c78b6b92 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import warnings
from functools import wraps
import crypten
import torch
from crypten.common.util import pool_reshape
... | 36.066265 | 107 | 0.598025 |
89c5f421d11bdeed7eb5df4e208f5229a931f9e1 | 3,819 | py | Python | contrib/macdeploy/custom_dsstore.py | amerkestijn/ghostler | daf1efebf7d1cadee4119530318bd7177fbceb6e | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | amerkestijn/ghostler | daf1efebf7d1cadee4119530318bd7177fbceb6e | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | amerkestijn/ghostler | daf1efebf7d1cadee4119530318bd7177fbceb6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Copyright (c) 2018 The LightCoinPay developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_lit... | 61.596774 | 1,817 | 0.727939 |
c330ac7d6b2ac8ad8d69d255bbb60809ac1e499b | 2,319 | py | Python | tests/client/client_setup_test.py | lokalise/python-lokalise-api | 5a0f33e0cee41e97801887020c5c0455a9cc07f2 | [
"BSD-3-Clause"
] | 5 | 2020-09-09T15:22:34.000Z | 2021-12-07T12:24:26.000Z | tests/client/client_setup_test.py | lokalise/python-lokalise-api | 5a0f33e0cee41e97801887020c5c0455a9cc07f2 | [
"BSD-3-Clause"
] | 39 | 2020-12-08T16:56:06.000Z | 2022-03-28T15:18:52.000Z | tests/client/client_setup_test.py | lokalise/python-lokalise-api | 5a0f33e0cee41e97801887020c5c0455a9cc07f2 | [
"BSD-3-Clause"
] | 1 | 2021-03-25T02:55:49.000Z | 2021-03-25T02:55:49.000Z | """
Tests for the Client class
"""
import pytest
import lokalise
def test_client_arguments():
"""Checks that client can receive token, timeout values, and enable_compression
"""
client = lokalise.Client(
"123abc",
connect_timeout=5,
read_timeout=3,
enable_compression=True)... | 28.280488 | 83 | 0.687796 |
2e7f97df7768e3d038e1f0c754a552d1f901acda | 1,775 | py | Python | modelfitting_gridsearch.py | marwenbelkaid/basic-ql-model-fitting | 11e64829ebd3f49601a49ebc80a68bd0f82a5295 | [
"BSD-2-Clause"
] | null | null | null | modelfitting_gridsearch.py | marwenbelkaid/basic-ql-model-fitting | 11e64829ebd3f49601a49ebc80a68bd0f82a5295 | [
"BSD-2-Clause"
] | null | null | null | modelfitting_gridsearch.py | marwenbelkaid/basic-ql-model-fitting | 11e64829ebd3f49601a49ebc80a68bd0f82a5295 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from sklearn.model_selection import ParameterGrid
import multiprocessing
import datetime
from basic_qlestimator import QLEstimator
nb_runs = 20
''' Define job for each worker in the multiproc computation '''
def test_sample(gridpoint):
print "Testing estimator with sample #", gridpoint['sampl... | 28.629032 | 137 | 0.732394 |
1e1e89ec377c5036e4ef9d29b55a2bc8b04b61c3 | 16,410 | py | Python | kaldi/utils/lang/make_kn_lm.py | ishine/asv-subtools | 597dcb29a772b8113dbe7ab64f0d4cc1da298707 | [
"Apache-2.0"
] | 370 | 2020-05-31T16:28:08.000Z | 2022-03-24T07:27:50.000Z | kaldi/utils/lang/make_kn_lm.py | ts0923/asv-subtools | a678b8f3327de0e99c445a79a9e91e5e0e006b11 | [
"Apache-2.0"
] | 35 | 2020-07-01T12:08:31.000Z | 2021-12-15T03:18:14.000Z | kaldi/utils/lang/make_kn_lm.py | ts0923/asv-subtools | a678b8f3327de0e99c445a79a9e91e5e0e006b11 | [
"Apache-2.0"
] | 119 | 2020-06-08T11:27:09.000Z | 2022-03-31T05:31:53.000Z | #!/usr/bin/env python3
# Copyright 2016 Johns Hopkins University (Author: Daniel Povey)
# 2018 Ruizhe Huang
# Apache 2.0.
# This is an implementation of computing Kneser-Ney smoothed language model
# in the same way as srilm. This is a back-off, unmodified version of
# Kneser-Ney smoothing, which produces... | 43.184211 | 121 | 0.579464 |
5ea5ba4307425946469b5f4b1609fb86df0083cc | 1,695 | py | Python | rancher_metrics_collector/metrics_collector/migrations/0001_initial.py | Fufuhu/RancherMetricsCollector | cd91ca1b6eb175c89648903e4ebdc35cba9422fd | [
"Apache-2.0"
] | null | null | null | rancher_metrics_collector/metrics_collector/migrations/0001_initial.py | Fufuhu/RancherMetricsCollector | cd91ca1b6eb175c89648903e4ebdc35cba9422fd | [
"Apache-2.0"
] | null | null | null | rancher_metrics_collector/metrics_collector/migrations/0001_initial.py | Fufuhu/RancherMetricsCollector | cd91ca1b6eb175c89648903e4ebdc35cba9422fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-26 09:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | 33.9 | 122 | 0.587021 |
e498fc0d14425d0ae31bf46d0e3de5ea6fc36006 | 978 | py | Python | yingyong/detector_py_app/app.py | bbcdli/xuexi | f791d6bdc2fccc1bab322b474c9cfc7572690f44 | [
"Apache-2.0"
] | 1 | 2019-01-16T05:55:23.000Z | 2019-01-16T05:55:23.000Z | yingyong/detector_py_app/app.py | bbcdli/xuexi | f791d6bdc2fccc1bab322b474c9cfc7572690f44 | [
"Apache-2.0"
] | null | null | null | yingyong/detector_py_app/app.py | bbcdli/xuexi | f791d6bdc2fccc1bab322b474c9cfc7572690f44 | [
"Apache-2.0"
] | null | null | null | #app.py
from flask import Flask, make_response, render_template
import analyzer
import argparse
import signal
import os
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", required=True)
args = parser.parse_args()
if not os.path.exists(args.config):
raise IOError("config file does not exist!... | 22.744186 | 96 | 0.723926 |
2bd26f40377d6f64a14cdc66dd7a4c6145ed3e31 | 929 | py | Python | dev/rename_image_file.py | patarapolw/srs-sqlite | 2985d7aed645b50f8a5f13acb7d7a518cf8e50cc | [
"MIT"
] | 2 | 2019-05-09T03:51:00.000Z | 2021-05-24T13:24:05.000Z | dev/rename_image_file.py | patarapolw/srs-sqlite | 2985d7aed645b50f8a5f13acb7d7a518cf8e50cc | [
"MIT"
] | null | null | null | dev/rename_image_file.py | patarapolw/srs-sqlite | 2985d7aed645b50f8a5f13acb7d7a518cf8e50cc | [
"MIT"
] | 1 | 2021-10-29T22:15:46.000Z | 2021-10-29T22:15:46.000Z | import os
os.environ['DATABASE_URI'] = '../user/PathoImages.db'
import re
from srs_sqlite import db, Config
from srs_sqlite.databases import SrsRecord
if __name__ == '__main__':
records = dict()
for srs_record in SrsRecord.query:
match_obj = re.search(r'(.*)(image)(\d+)(\.png)', srs_record.front)
... | 29.967742 | 90 | 0.622174 |
83a6b44b78618b541c2580e93d0c75d6cf562389 | 42 | py | Python | gds_metrics/version.py | idavidmcdonald/gds_metrics_python | 18d75bb8a0087cd145a61b97f3f73389163d457d | [
"MIT"
] | null | null | null | gds_metrics/version.py | idavidmcdonald/gds_metrics_python | 18d75bb8a0087cd145a61b97f3f73389163d457d | [
"MIT"
] | null | null | null | gds_metrics/version.py | idavidmcdonald/gds_metrics_python | 18d75bb8a0087cd145a61b97f3f73389163d457d | [
"MIT"
] | null | null | null | __version__ = '0.2.0' # pragma: no cover
| 21 | 41 | 0.642857 |
8382fdc57c659fc9319854c501c4a658d53de938 | 4,043 | py | Python | torchtext/datasets/multi30k.py | mkeshita/text | d4656e2b6fe468a0a925207ab63b754aa03ed3df | [
"BSD-3-Clause"
] | null | null | null | torchtext/datasets/multi30k.py | mkeshita/text | d4656e2b6fe468a0a925207ab63b754aa03ed3df | [
"BSD-3-Clause"
] | null | null | null | torchtext/datasets/multi30k.py | mkeshita/text | d4656e2b6fe468a0a925207ab63b754aa03ed3df | [
"BSD-3-Clause"
] | null | null | null | import os
from typing import Union, Tuple
from torchtext._internal.module_utils import is_module_available
from torchtext.data.datasets_utils import (
_wrap_split_argument,
_create_dataset_directory,
)
if is_module_available("torchdata"):
from torchdata.datapipes.iter import FileOpener, IterableWrapper
... | 36.754545 | 120 | 0.699481 |
e999dd9ce45ac59be5e81e596a4cf3a74e945003 | 4,696 | py | Python | flask_similarity.py | flymemoryRPA/FuzzyMatching | 7d14604dd93a8515cf9ad077dd69b46c8886bee0 | [
"MIT"
] | null | null | null | flask_similarity.py | flymemoryRPA/FuzzyMatching | 7d14604dd93a8515cf9ad077dd69b46c8886bee0 | [
"MIT"
] | null | null | null | flask_similarity.py | flymemoryRPA/FuzzyMatching | 7d14604dd93a8515cf9ad077dd69b46c8886bee0 | [
"MIT"
] | null | null | null | from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
#import nltk
#from nltk.tokenize import sent_tokenize
class Similary():
def __init__(self,arr_for_matching,arr_databa... | 43.88785 | 127 | 0.556431 |
0f647ff9d16b7e8598fcf36caf28382fb7abcddf | 1,808 | py | Python | ge_sm/google_analytics_code/settings/chaa_jaa_settings.py | girleffect/ge-sm | 8cf8d9d060b1ca299fd05b9ae2307410a4fb9d2a | [
"BSD-3-Clause"
] | null | null | null | ge_sm/google_analytics_code/settings/chaa_jaa_settings.py | girleffect/ge-sm | 8cf8d9d060b1ca299fd05b9ae2307410a4fb9d2a | [
"BSD-3-Clause"
] | 1 | 2021-02-08T20:33:47.000Z | 2021-02-08T20:33:47.000Z | ge_sm/google_analytics_code/settings/chaa_jaa_settings.py | girleffect/ge-sm | 8cf8d9d060b1ca299fd05b9ae2307410a4fb9d2a | [
"BSD-3-Clause"
] | null | null | null | from ge_sm.common.secrets import *
chaajaauserpagesdimdict = {
'ga_user_pages_C': {'DateTime': 'dateHourMinute', 'ClientId': 'dimension1', 'Page Path': 'pagePath', 'Page Title': 'pageTitle'},
'ga_user_pages_CK': {'DateTime': 'dateHourMinute', 'ClientId': 'dimension1', 'KadenceId': 'dimension2', 'Page Path': 'pagePa... | 56.5 | 197 | 0.69469 |
4bbbd11e74b344091b423a95c8eb320ae637b571 | 9,117 | py | Python | test/test_e2e_asr_transformer.py | koso019003/espnet | 7735c992b3d71fabbc0f0c48c1d8f78d72785e17 | [
"Apache-2.0"
] | null | null | null | test/test_e2e_asr_transformer.py | koso019003/espnet | 7735c992b3d71fabbc0f0c48c1d8f78d72785e17 | [
"Apache-2.0"
] | null | null | null | test/test_e2e_asr_transformer.py | koso019003/espnet | 7735c992b3d71fabbc0f0c48c1d8f78d72785e17 | [
"Apache-2.0"
] | 1 | 2020-06-27T11:07:15.000Z | 2020-06-27T11:07:15.000Z | from argparse import Namespace
import chainer
import importlib
import logging
import numpy
import pytest
import torch
logging.basicConfig(
level=logging.INFO, format='%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s')
def test_sequential():
class Masked(torch.nn.Module):
def forward(se... | 31.437931 | 96 | 0.587584 |
989dc6b7e06440eaa1baf455b551c9b102c10503 | 2,993 | py | Python | scripts/blueprint_graph_queries.py | azdolinski/apstra-api-python | 2380bcdbd5be31e552d9259592249b13fa432286 | [
"Apache-2.0"
] | 1 | 2022-03-23T22:16:15.000Z | 2022-03-23T22:16:15.000Z | scripts/blueprint_graph_queries.py | azdolinski/apstra-api-python | 2380bcdbd5be31e552d9259592249b13fa432286 | [
"Apache-2.0"
] | 4 | 2022-03-26T15:12:50.000Z | 2022-03-31T07:31:53.000Z | scripts/blueprint_graph_queries.py | azdolinski/apstra-api-python | 2380bcdbd5be31e552d9259592249b13fa432286 | [
"Apache-2.0"
] | 2 | 2022-03-26T00:04:42.000Z | 2022-03-26T14:23:20.000Z | # Copyright 2020-present, Apstra, Inc. All rights reserved.
#
# This source code is licensed under End User License Agreement found in the
# LICENSE file at http://www.apstra.com/eula
from aos.client import AosClient
from scripts.utils import deserialize_fixture
import urllib3
urllib3.disable_warnings(urllib3.exceptio... | 33.629213 | 76 | 0.642833 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.